1 CISC 856 TCP OPTIONS SELECTIVE ACKNOWLEDGEMENT SACK

  • Slides: 26
Download presentation
1 CISC 856 – TCP OPTIONS SELECTIVE ACKNOWLEDGEMENT (SACK) RFC 2018 DUPLICATE SELECTIVE ACKNOWLEDGMENT

1 CISC 856 – TCP OPTIONS SELECTIVE ACKNOWLEDGEMENT (SACK) RFC 2018 DUPLICATE SELECTIVE ACKNOWLEDGMENT (DSACK) RFC 2883 Thanks to Dr. Paul Amer and Pallavi Mahajan Rajesh Ponnurangam Computers & Information Sciences University of Delaware

2 TCP without SACK • TCP uses cumulative ACKs • Receiver identifies the last

2 TCP without SACK • TCP uses cumulative ACKs • Receiver identifies the last byte of data successfully received • Out of rrder segments are not ACKed • Receiver sends duplicate ACKs • TCP without SACK forces the TCP sender • Either to wait an RTT to find out a segment was lost • Or, unnecessarily retransmit data that has been correctly received • Can result in reduced overall throughput

3 TCP with Selective Ack (SACK) • SACK + Selective Repeat Retransmission Policy allows

3 TCP with Selective Ack (SACK) • SACK + Selective Repeat Retransmission Policy allows • receiver informs sender about all segments that are successfully received. • sender fast retransmits only the missing data segments • SACK is implemented using two TCP Options • SACK-Permitted Option • SACK Option

4 SACK-Permitted Option • Sack–Permitted option • is allowed only in a SYN Segment.

4 SACK-Permitted Option • Sack–Permitted option • is allowed only in a SYN Segment. • indicates sender handles SACKs, and receiver should send SACKs if possible. • SACK option can be used once connection is established Source port address TCP header length Destination port address Sequence Number Cumulative Ack No. 1 6 Checksum SYN bit TCP Header kind=4 length=2 SACKpermitted Window size Urgent pointer kind=1 NOP options

5 SACK-Permitted Option and SACK RECEIVER SENDER TCP connection establishment phase “SACK-permitted” SYN/ACK SYN

5 SACK-Permitted Option and SACK RECEIVER SENDER TCP connection establishment phase “SACK-permitted” SYN/ACK SYN “SACK-permitted” Sourceportaddress Destinationportaddress Source port address Sequence Number Sequence. Destination Number port address data transfer phase SYN bit ACK bit Sequence Ack Number Cumulative Ack. No. s K C A ti 1 onal SAck p o d n Cumulative No. a Window size k c 1 1 cum a Window size Checksum Urgentpointer 1 Checksum kind=4 length=2 SACK- Urgent kind=1 pointer kind=1 NOP options

6 SACK Option Source port address Destination port address Sequence Number • Length of

6 SACK Option Source port address Destination port address Sequence Number • Length of SACK with n blocks? = (2 + 8 * n) bytes Cumulative Ack No. HLEN Window size Checksum Kind=1 Urgent pointer Kind=5 Length=? ? Left edge of 1 st block Right edge of 1 st block Left edge of nth block Right edge of nth block • Max number bytes available for TCP Options? = 40 bytes • Max number of SACK blocks possible? = 4 SACK blocks (barring no other TCP Options)

7 SACK Example 1 - 100 receiver’s buffer ACK 201 -300 301 -400 401

7 SACK Example 1 - 100 receiver’s buffer ACK 201 -300 301 -400 401 - 50 0 501 - 60 0 1 -100 101 -200 receiver sender 101 - 200 1 401 -60 K C A S 1 0 2 ACK 1 -100 101 -200 401 -500 501 -600

8 SACK Rules • With SACKs, the ACK field is still a cum ACK

8 SACK Rules • With SACKs, the ACK field is still a cum ACK • A SACK cannot be sent unless the SACK-Permitted option has been received (in the SYN) • The 1 st SACK block MUST specify the contiguous block of data containing the segment which triggered this acknowledgment • If SACKs are sent, SACK option should be included in all ACK’s which do not ACK the highest sequence number in the data receiver’s queue

9 Generating SACKs – data receiver behavior • If the data receiver has not

9 Generating SACKs – data receiver behavior • If the data receiver has not received a SACK-Permitted Option for a given connection, the receiver must not send SACK options on that connection • The receiver should send an ACK for every valid segment that arrives containing new data • The data receiver should include as many distinct SACK blocks as possible in the SACK option • SACK option should be filled out by repeating the most recently reported SACK blocks • The data receiver provides the sender with the most up-to-date info about the state of the network and the receiver’s queue

10 Interpreting SACKs - Data Sender behavior • The sender records the SACK for

10 Interpreting SACKs - Data Sender behavior • The sender records the SACK for future reference • Maintains a retransmission queue containing unacknowledged segments • One possible implementation • Turns on SACK bit for the segment in retransmission queue when it receives a SACK • Skips SACKed data during any later fast retransmission • On fast retransmit, retransmits data not SACKed so far and less than the highest SACKed data • Turns off SACK bit after retransmission time out

11 Another SACK Example Receiver Buffer 100 299 100 -299 ACK 300 -499 500

11 Another SACK Example Receiver Buffer 100 299 100 -299 ACK 300 -499 500 -699 700 -899 900 -1099 00 100, 500 -7 -1 0 0 9 K C A ACK 300, S 1100 -129 9 699 300 699 receiver sender CK 500 -700 A ACK 300, S 300 500 900 1099

12 Another SACK Example 300 1100 -129 9 300 -499 500 699 900 (cont’d)

12 Another SACK Example 300 1100 -129 9 300 -499 500 699 900 (cont’d) 1099 300 500 699 900 1099 300 500 700 900 1099 00 ACK 900 -11 ACK 700, S sender ACK 1100 receiver 700 -899 1100

13 Without SACK vs. With SACK TCP without SACK 200 -299 100 -199 ACK

13 Without SACK vs. With SACK TCP without SACK 200 -299 100 -199 ACK 200 300 -399 ACK 200 500 -599 ACK 200 sender fast retransmit receiver sender ACK 200 400 -499 0 -400 ACK 200, SACK 30 500 -599 0 -500 ACK 200, SACK 30 0 -600 fast retransmit 200 -299 200 -599 ACK 600 receiver 400 -499

14 Data Receiver Reneging – fail to fulfill a promise or obligation • Data

14 Data Receiver Reneging – fail to fulfill a promise or obligation • Data receiver is permitted to discard data in its queue that has not been acknowledged to the data sender, even if the data has already been SACKed • Such discarding of SACKed segments is discouraged, but may occur if the receiver must give buffer space back to the OS • If reneging occurs • first SACK should reflect the newest segment even if its going to be discarded • Except for the newest segment, all SACK blocks MUST NOT report any old data which is no longer actually held by the receiver

15 Reneging Example 100 -199 200 -299 100 ACK 200 300 -399 400 -499

15 Reneging Example 100 -199 200 -299 100 ACK 200 300 -399 400 -499 199 00 -400 500 -599 K ACK 200; SAC receiver sender K 3 ACK 200; SAC 200 200 500 -600 399 reneg occurs; window decreases window increases 500 599

16 Consequences of Reneging • Sender must maintain normal TCP timeouts • Data cannot

16 Consequences of Reneging • Sender must maintain normal TCP timeouts • Data cannot be considered “communicated” until a cum ACK is sent • Sender must retransmit the data at the left window edge after a retransmit timeout, even if that data has been SACKed by the receiver • Sender MUST NOT discard data before being acked by the Cum Ack

17 SACK Observations • SACK TCP follows standard TCP congestion control; Adding SACK to

17 SACK Observations • SACK TCP follows standard TCP congestion control; Adding SACK to TCP does not change the basic underlying congestion control algorithms • SACK TCP has major advantages when compared TCP Tahoe, Reno, Vegas and New Reno, as PDUs have been provided with additional information due to the SACK • Difference in behavior when multiple packets are dropped from one window of data • SACK information allows the sender to better decide what to retransmit and what not to

Duplicate SACK (D-SACK) Extension to SACK – RFC 2883 • How is SACK option

Duplicate SACK (D-SACK) Extension to SACK – RFC 2883 • How is SACK option used when duplicate segments are received? • D-SACK does not require separate negotiation between a TCP sender and receiver that have already negotiated SACK • When D-SACK is used, the first block of the SACK option should be a DSACK block specifying a duplicate segment • A D-SACK block is only used to report a duplicate contiguous sequence of data received by the receiver in the most recent segment • Each duplicate contiguous sequence of data received is reported in at most one D-SACK block 18

D-SACK Example Segment replicated by the network Receiver Buffer 200 399 200 -399 ACK

D-SACK Example Segment replicated by the network Receiver Buffer 200 399 200 -399 ACK 400 -599 600 -799 800 -999 ACK 600 -10 ACK 400, S receiver sender CK 600 -800 A ACK 400, S 400 600 799 400 600 800 999 00 00 -1000, 6 8 K C A S , 0 ACK 40 19

20 DSACK – Another example Receiver Buffer 500 599 500 -599 600 -699 700

20 DSACK – Another example Receiver Buffer 500 599 500 -599 600 -699 700 -799 800 -899 900 -999 1000 -109 9 700 -89 9 0 K 1100 -120 C A S , 0 0 6 ACK 200 ACK 1100 -1 ACK 700, S 0 0 00, 1100 -12 ACK 800 -9 ACK 900, S 600 1199 600 699 1100 1199 receiver sender 1100 -1199 600 699 800 899 700 899 1100 1199

21 Interpreting D-SACK - Data Sender Behavior • The loss of a single ACK

21 Interpreting D-SACK - Data Sender Behavior • The loss of a single ACK can prevent this information from reaching the sender. • How does sender knows the first SACK block is a D-SACK? • Compares the sequence space in the 1 st SACK block to the cum ACK • if seq_space < cum_ACK, then duplicate data has been received • if seq_space > cum_ACK, then sender compares seq_space with the seq_space in 2 nd SACK block (if there is one) • if the 1 st SACK block is reporting duplicate data that lies above the cumulative ACK, then the 1 st SACK block will be a subset of the 2 nd SACK block.

22 DSACK Example TCP with SACK & without D-SACK cwnd =10 200 -299 100

22 DSACK Example TCP with SACK & without D-SACK cwnd =10 200 -299 100 -199 ACK 200 300 -399 400 -499 0 -400 ACK 200, SACK 30 500 -599 0 -500 ACK 200, SACK 30 0 -600 ACK 200, SACK 30 fast retransmit ACK 600 200 -299 cwnd =5 cwnd =10 ACK 200, SACK 30 0 -600 fast retransmit ACK 600 200 -299 0 -300 ACK 600, SACK 20 receiver cwnd =5 200 -299 ACK 200 sender cwnd =5 cwnd =10 receiver sender cwnd =5 100 -199 TCP with SACK and D-SACK

23 D-SACK and Retransmissions • D-SACK allows TCP sender to determine when a retransmission

23 D-SACK and Retransmissions • D-SACK allows TCP sender to determine when a retransmission was “spurious” (ie, unnecessary) and then undo congestion control measures • D-SACK allows TCP sender to determine if the network is duplicating TCP-PDUs • D-SACK does not allow a sender to determine if both the original and retransmitted data are received, or the original is lost and the retransmitted data is duplicated by the network.

24 SACK and D-SACK Interaction • There is no difference between SACK and D-SACK,

24 SACK and D-SACK Interaction • There is no difference between SACK and D-SACK, except that the first SACK block is used to report a duplicate segment in D-SACK. • D-SACK does not require separate negotiation between a TCP sender and receiver that have already negotiated SACK capability. • D-SACK is compatible with current implementations of SACK option in TCP.

25 Current Implementations of SACK • Windows 2000/XP • Controlled by a registry parameter

25 Current Implementations of SACK • Windows 2000/XP • Controlled by a registry parameter – Sack. Opts in “HKEY_LOCAL_MACHINESYSTEMCurrent. Control. SetServicesTcpipPa rameters” - Sack. Opts="1" • Windows Vista • Windows Server 2008 and Windows Vista support TCP SACK • Free BSD and Net. BSD have optional modules • Solaris 7 and later

26 References • RFC 2018 – TCP Selective Acknowledgement Options. • RFC 2883 –

26 References • RFC 2018 – TCP Selective Acknowledgement Options. • RFC 2883 – An Extension to SACK option for TCP. • Kevin Fall and Sally Floyd, “Simulation-based Comparisons of Tahoe, Reno, and SACK TCP”, Lawrence Berkley National Laboratory.