Presentation is loading. Please wait.

Presentation is loading. Please wait.

Internet Networking recitation #11

Similar presentations


Presentation on theme: "Internet Networking recitation #11"— Presentation transcript:

1 Internet Networking recitation #11
TCP Sack (RFC 2018, RFC 3517) Spring Semester 2009, Dept. of Computer Science, Technion

2 TCP SACK (RFC 2018, RFC 3517) TCP Selective acknowledgement
TCP option designed for adopting the sender rate to the actual network conditions Enables to cope with a loss of more than one packet by changing message structure (using TCP options) Main purpose - increasing the throughput when multiple packets are lost from the same window. Main idea - receiver tells the sender not only the next in-sequence expected byte, but also a range of bytes received out-of-order. The receiver replies with a mask of packets received rather than the last segment that was received in a continuity. SACK uses the Option field in the TCP header. Invoked only if both sides support it. Internet Networking

3 Fast Retransmit in TCP Reno
A sender uses fast retransmit / fast recovery algorithm to improve throughput of TCP “Fast” – because it doesn’t wait for time out when not getting an ACK for a segment Fast Retransmit – after 3 “duplicative ACKs”, the sender assumes that the segment was lost, retransmits the segment and moves to Fast Recovery phase Treats every segment loss as an indication of congestion, and decreases its sending rate accordingly Fast-Retransmit waits for 3 duplicate ACKs before retransmitting, to eliminate false alarms caused by reordering of segments Internet Networking

4 Fast Recovery in TCP Reno
The sender decreases the Congestion Window (cwnd) Half of its original size + 3 Since 3 packets left the network and buffered by the receiver Continue to send new segments (if allowed by the cwnd value). Until receiving new different ACK that acknowledge receiving a segment that caused entering Fast Recovery phase assuming that no more segments were lost. For each additional duplicated ACK received, cwnd is incremented by 1 Internet Networking

5 Example (TCP Reno) Initial state cwnd=7 Slow start
1 Ack(1) 2 3 Ack(1) 4 Ack(1) 5 Ack(1) 6 Ack(1) Ack(1) cwnd=8 7 8 Ack(1) Ack(1) Fast Retransmit cwnd=8/2+3=7 ssthresh=8/2=4 => Fast Recovery 1 cwnd=8 Ack(9) cwnd=9 9 Ack(10) cwnd=10 10 cwnd=11 11 Exit Fast Recovery cwnd=ssthresh=4 => Congestion Avoidance 12 Internet Networking

6 Congestion Control in TCP SACK (1)
A conservative extension of Reno’s congestion control. Using the same algorithms for increasing and decreasing the congestion window. During Fast Recovery, the sender maintains a variable called “pipe” that represents the estimated number of packets outstanding in the path. Pipe is initialized according to the ACK and the SACK mask We know how much packets were sent and how much were received Internet Networking

7 SACK Example Assume that when entering the fast recovery cwnd = 6.
Then: Cwnd = 6/2+3 = 6 The highest sequence number transmitted = 6. Segments that were acked (during current window) are 3,4,5 Thus: Pipe = 6 – 3 = 3 Hence: 1 & 2 will be sent immediately Internet Networking

8 Congestion Control in TCP SACK – the Pipe
Pipe is incremented for packets that have not been SACKed and have not been determined to have been lost Incremented by one when sending a new or retransmitted packet. Decremented by one when receiving a dup ACK. Decremented by two when receiving a partial ACK. Once for the retransmitted packet and once for the original packet presumed to be dropped. Exiting Fast Recovery upon receiving ACK for all packets that was outstanding when Fast Recovery was entered. The sender is permitted to send packets only when pipe is less than the congestion window size. What to send? Fill holes according to the sequence numbers. If retransmitted packet drops – Slow start. Internet Networking

9 SACK Sender Algorithm The main differences between SACK’s sender algorithm and Reno’s sender algorithm are: In Reno, the Fast-Recovery period lasts until an ACK on the retransmitted segment is received. In New Reno and in SACK it lasts until the last segment that was outstanding at the time of entrance to F.R. is received. Internet Networking

10 Sack-Permitted Option
Two-byte option is sent in a SYN by a TCP that has been extended to receive (and presumably process) the SACK option once the connection has opened. It MUST NOT be sent on non-SYN segments. TCP Sack-Permitted Option: Kind: 4 Internet Networking

11 SACK Option Internet Networking

12 SACK Block Each contiguous block of data queued at the data receiver is defined in the SACK option by two 32-bit unsigned integers in network byte order: Left Edge of Block is the first sequence number of this block. Right Edge of Block is the sequence number immediately following the last sequence number of this block. Internet Networking

13 Examples from RFC 2018 (1) Assume the left window edge is 5000 and that the data transmitter sends a burst of 8 segments, each containing 500 data bytes. Case 1: The first 4 segments are received but the last 4 are dropped. The data receiver will return a normal TCP ACK segment acknowledging sequence number 7000, with no SACK option. Internet Networking

14 Examples from RFC 2018 (2) Case 2: The first segment is dropped
The remaining 7 are received. Upon receiving each of the last seven packets, the data receiver will return: 1) a TCP ACK segment that acknowledges sequence number 5000 and 2) contains a SACK option specifying one block of queued data: Internet Networking

15 Examples from RFC 2018 (3) Case 3:
The 2nd, 4th, 6th, and 8th (last) segments are dropped. The data receiver ACKs the first packet normally. The third, fifth, and seventh packets trigger SACK options as follows: Internet Networking

16 Examples from RFC 2018 (4) Suppose at this point, the 4th packet is received out of order. This could either be because the data was badly misordered in the network or because the 2nd packet was retransmitted and lost, and then the 4th packet was retransmitted At this point the data receiver has only two SACK blocks to report. The data receiver replies with the following Selective Acknowledgment: Internet Networking


Download ppt "Internet Networking recitation #11"

Similar presentations


Ads by Google