Segment 1 is sent at t0.
Ack for segment 1 is received at t5.
Ack for segment 1 is recieved at t7.
Which Ack should I use to calculate Re-transmission Timeout?
Related
I know that control bits in tcp define the flags of TCP connection like SYN, FIN, ACK. But from my network traffic sometimes for some packets control bits are 0 (not-set).
What does this behaviour mean?
Those are flags of a TCP segment, not connection.
When a flag bit isn't set that indicates the absence of the meaning and behavior defined for the corresponding flag.
It means ACK and only ACK flag is set. RFC says ACK is 16, however it's only 16 when used in combination with another flag e.g. SYN/ACK (18), FIN/ACK (17). Flags value 0 could also indicate a 'null' scan.
If you see a flow record with value 2 and there are 8 packets in it, that means there are both SYN packet(s) and ACK packets.
If you see 18 and there are more than 1 packet in the flow that means there is at least one SYN/ACK and the rest are ACK.
In TCP,
segment1---client-to-server----x(dropped)
seg1(ACK+somedata)<-----------server-to-client
segment2---------->client-to-server
seg2(ack+somedata)<-----------server-to-client
Retransmitted Segment1------> client-to-server
Now can retransmitted segment1 ack for seg2? Or seg2 will be acked by seperate message from client?
In the fast retransmission logic in TCP, TCP retransmit the packet when the sender gets the 3 duplicated ACKs. However, what if the sender gets 6 duplicated ACKS?
The following procedure is what I think,
1) sender sends lots of packets with big window size
2) the first packet is dropped
3) Receiver sends ACKS that contains the seq # of the first packets. And other ACKS will have same ack numbers. (For example, the sender send 1,2,3,4,5,6,7 and packet 1 is dropped. Then, the receiver sends ACKs 1,1,1,1,1,1,1)
4) The sender gets 3 dup acks and retransmit the dropped packet However, the receiver still sends 6 dup acks because the receiver doesn't get retransmitted packet. Therefore, the receiver will send duplicated ACK until it gets the dropped packet
5) The sender gets 3 dup acks again, and retransmits the packet again.
Therefore, the sender will retransmit the packet repeatedly. I thinks this is weird. Is there any problem in the above procedure (scenario) ?
Or is there any TCP logic that can prevent the above problem?
I'm trying to understand how the transmission and ACK work in TCP. In this Figuure, when A retransmitt the seq 100 after he recive three duplikated ACK , B will answer with 121 ACK or 158 ACK ?
B would only be issuing the 100 ACK because it didn't receive the SEQ 121 packet. There's no evidence that it received the next packets either, but even if it did it isn't required to save them. So the answer depends on things that aren't specified in your question.
Why does the TCP three-way handshake bump the sequence number when acking during the initial handshake? How is that better than just leaving the acknowledgement number equal to the sequence number?
The connection is established with
Client sends SYN,A
Server responds with SYN-ACK,A+1,B
Client confirms with ACK,B+1
How is that better than
Client sends SYN,A
Server responds with SYN-ACK,A,B
Client confirms with ACK,B
That's because the ACK field means this when the ACK flag is set:
Acknowledgment number (32 bits) – if the ACK flag is set then the value of this field is the next sequence number that the receiver is expecting.
If it is not set to (inital sequence number+1), it would be inconsistently mean both ack'ing the SYN (both SYN and ACK flags must be set in this packet) and saying it is expecting that sequence number again (i.e. hasn't received it).