SELECTIVE ACKNOWLEDGEMENT (SACK) RFC 2018 DUPLICATE SELECTIVE ACKNOWLEDGMENT (DSACK) RFC 2883
description
Transcript of SELECTIVE ACKNOWLEDGEMENT (SACK) RFC 2018 DUPLICATE SELECTIVE ACKNOWLEDGMENT (DSACK) RFC 2883
![Page 1: SELECTIVE ACKNOWLEDGEMENT (SACK) RFC 2018 DUPLICATE SELECTIVE ACKNOWLEDGMENT (DSACK) RFC 2883](https://reader036.fdocuments.in/reader036/viewer/2022062500/5681592a550346895dc65357/html5/thumbnails/1.jpg)
1
SELECTIVE ACKNOWLEDGEMENT (SACK)
RFC 2018
DUPLICATE SELECTIVE ACKNOWLEDGMENT
(DSACK)
RFC 2883
Rajesh Ponnurangam
Computers & Information Sciences
University of Delaware
CISC 856 – TCP OPTIONS
Thanks to Dr.Paul Amer and Pallavi Mahajan
![Page 2: SELECTIVE ACKNOWLEDGEMENT (SACK) RFC 2018 DUPLICATE SELECTIVE ACKNOWLEDGMENT (DSACK) RFC 2883](https://reader036.fdocuments.in/reader036/viewer/2022062500/5681592a550346895dc65357/html5/thumbnails/2.jpg)
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
![Page 3: SELECTIVE ACKNOWLEDGEMENT (SACK) RFC 2018 DUPLICATE SELECTIVE ACKNOWLEDGMENT (DSACK) RFC 2883](https://reader036.fdocuments.in/reader036/viewer/2022062500/5681592a550346895dc65357/html5/thumbnails/3.jpg)
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
![Page 4: SELECTIVE ACKNOWLEDGEMENT (SACK) RFC 2018 DUPLICATE SELECTIVE ACKNOWLEDGMENT (DSACK) RFC 2883](https://reader036.fdocuments.in/reader036/viewer/2022062500/5681592a550346895dc65357/html5/thumbnails/4.jpg)
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
Cumulative Ack No.
6
TCP header length
Sequence Number
Source port address
Destination port address
NOP NOP
options
kind=1 kind=1
SACK-permitted
kind=4
length=2
Window size
Urgent pointer
Checksum
1
SYN bit
TCP Header
![Page 5: SELECTIVE ACKNOWLEDGEMENT (SACK) RFC 2018 DUPLICATE SELECTIVE ACKNOWLEDGMENT (DSACK) RFC 2883](https://reader036.fdocuments.in/reader036/viewer/2022062500/5681592a550346895dc65357/html5/thumbnails/5.jpg)
5
SENDER
SACK-Permitted Option and SACK
RECEIVER
SYN“SACK-permitted”
SYN/ACK“SACK-permitted”ACK
TCP connection
establishment phase
data transfer phase
cum ack and optional
SACKs
Cumulative Ack No.
Sequence Number
Source port address Destination port address
SACK-permitted
kind=4
length=2
Window size
Urgent pointer
Checksum
NOP NOP
options
kind=1 kind=1
1
SYN bit
Cumulative Ack No.
Sequence Number
Source port address Destination port address
SACK-permitted
kind=4
length=2
Window size
Urgent pointer
Checksum
NOP NOP
options
kind=1 kind=1
1
SYN bit
1
ACK bit
Cumulative Ack No.
Sequence Number
Source port address Destination port address
Window size
Urgent pointer
Checksum
kind=1 kind=1
1
ACK bit
![Page 6: SELECTIVE ACKNOWLEDGEMENT (SACK) RFC 2018 DUPLICATE SELECTIVE ACKNOWLEDGMENT (DSACK) RFC 2883](https://reader036.fdocuments.in/reader036/viewer/2022062500/5681592a550346895dc65357/html5/thumbnails/6.jpg)
6
SACK Option
Cumulative Ack No.
Sequence Number
Source port address
Window size
Urgent pointer
Checksum
HLEN
Destination port address
Right edge of nth block
Left edge of nth block
Right edge of 1st block
Left edge of 1st block
Kind=1
Length=??Kind=1 Kind=5
= (2 + 8 * n) bytes
• Max number of SACK blocks possible?
= 4 SACK blocks (barring no other TCP Options)
• Max number bytes available for TCP Options?
= 40 bytes
• Length of SACK with n blocks?
![Page 7: SELECTIVE ACKNOWLEDGEMENT (SACK) RFC 2018 DUPLICATE SELECTIVE ACKNOWLEDGMENT (DSACK) RFC 2883](https://reader036.fdocuments.in/reader036/viewer/2022062500/5681592a550346895dc65357/html5/thumbnails/7.jpg)
7
SACK Example
1 - 100 receiver’s buffer
sen
der
receiv
er
101 - 200
ACK 201201-300301-400
401 - 500501 - 600
ACK 201 SACK 401-601
1-100 101-200
1-100 101-200
401-500
501-600
![Page 8: SELECTIVE ACKNOWLEDGEMENT (SACK) RFC 2018 DUPLICATE SELECTIVE ACKNOWLEDGMENT (DSACK) RFC 2883](https://reader036.fdocuments.in/reader036/viewer/2022062500/5681592a550346895dc65357/html5/thumbnails/8.jpg)
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 1st 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
![Page 9: SELECTIVE ACKNOWLEDGEMENT (SACK) RFC 2018 DUPLICATE SELECTIVE ACKNOWLEDGMENT (DSACK) RFC 2883](https://reader036.fdocuments.in/reader036/viewer/2022062500/5681592a550346895dc65357/html5/thumbnails/9.jpg)
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
![Page 10: SELECTIVE ACKNOWLEDGEMENT (SACK) RFC 2018 DUPLICATE SELECTIVE ACKNOWLEDGMENT (DSACK) RFC 2883](https://reader036.fdocuments.in/reader036/viewer/2022062500/5681592a550346895dc65357/html5/thumbnails/10.jpg)
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
![Page 11: SELECTIVE ACKNOWLEDGEMENT (SACK) RFC 2018 DUPLICATE SELECTIVE ACKNOWLEDGMENT (DSACK) RFC 2883](https://reader036.fdocuments.in/reader036/viewer/2022062500/5681592a550346895dc65357/html5/thumbnails/11.jpg)
11
Another SACK Example
sen
der
receiv
er
100-299
ACK 300
100 299
Receiver Buffer
300-499
500-699
ACK 300, SACK 500-700
500300 699
700-899
900-1099
ACK 300, SACK 900-1100, 500-
700
699300 500 900 1099
1100-1299
![Page 12: SELECTIVE ACKNOWLEDGEMENT (SACK) RFC 2018 DUPLICATE SELECTIVE ACKNOWLEDGMENT (DSACK) RFC 2883](https://reader036.fdocuments.in/reader036/viewer/2022062500/5681592a550346895dc65357/html5/thumbnails/12.jpg)
12
sen
der
receiv
er
1100-1299
300-499
699300 500 900 1099
ACK 700, SACK 900-1100
699300 500 900 1099
700-899
ACK 1100700300 500 900 1099
1100
Another SACK Example (cont’d)
![Page 13: SELECTIVE ACKNOWLEDGEMENT (SACK) RFC 2018 DUPLICATE SELECTIVE ACKNOWLEDGMENT (DSACK) RFC 2883](https://reader036.fdocuments.in/reader036/viewer/2022062500/5681592a550346895dc65357/html5/thumbnails/13.jpg)
13
Without SACK vs. With SACK
sen
der
receiv
er
100-199
ACK 200
200-299
300-399
400-499
500-599
ACK 200
ACK 200
ACK 200
fast retransmit
200-599
ACK 600
sen
der
receiv
er
100-199
ACK 200
200-299
300-399
400-499
500-599
ACK 200, SACK 300-400
ACK 200, SACK 300-500
fast retransmit
200-299
ACK 600
ACK 200, SACK 300-600
TCP without SACK TCP with SACK
![Page 14: SELECTIVE ACKNOWLEDGEMENT (SACK) RFC 2018 DUPLICATE SELECTIVE ACKNOWLEDGMENT (DSACK) RFC 2883](https://reader036.fdocuments.in/reader036/viewer/2022062500/5681592a550346895dc65357/html5/thumbnails/14.jpg)
14
Data Receiver Reneging
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
![Page 15: SELECTIVE ACKNOWLEDGEMENT (SACK) RFC 2018 DUPLICATE SELECTIVE ACKNOWLEDGMENT (DSACK) RFC 2883](https://reader036.fdocuments.in/reader036/viewer/2022062500/5681592a550346895dc65357/html5/thumbnails/15.jpg)
15
Reneging Example
sen
der
receiv
er
200-299
100-199 100 199
ACK 200; SACK 300-400
500-599
ACK 200
ACK 200; SACK 500-600
400-499
300-399200 399300
200
200
599500200
window increases
reneg occurs; window decreases
![Page 16: SELECTIVE ACKNOWLEDGEMENT (SACK) RFC 2018 DUPLICATE SELECTIVE ACKNOWLEDGMENT (DSACK) RFC 2883](https://reader036.fdocuments.in/reader036/viewer/2022062500/5681592a550346895dc65357/html5/thumbnails/16.jpg)
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
![Page 17: SELECTIVE ACKNOWLEDGEMENT (SACK) RFC 2018 DUPLICATE SELECTIVE ACKNOWLEDGMENT (DSACK) RFC 2883](https://reader036.fdocuments.in/reader036/viewer/2022062500/5681592a550346895dc65357/html5/thumbnails/17.jpg)
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
![Page 18: SELECTIVE ACKNOWLEDGEMENT (SACK) RFC 2018 DUPLICATE SELECTIVE ACKNOWLEDGMENT (DSACK) RFC 2883](https://reader036.fdocuments.in/reader036/viewer/2022062500/5681592a550346895dc65357/html5/thumbnails/18.jpg)
18
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 D-SACK 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
![Page 19: SELECTIVE ACKNOWLEDGEMENT (SACK) RFC 2018 DUPLICATE SELECTIVE ACKNOWLEDGMENT (DSACK) RFC 2883](https://reader036.fdocuments.in/reader036/viewer/2022062500/5681592a550346895dc65357/html5/thumbnails/19.jpg)
19D-SACK Example
Segment replicated by the network
sen
der
receiv
er
200-399
ACK 400
200 399
Receiver Buffer
400-599
600-799
ACK 400, SACK 600-800
600400 799
800-999
ACK 400, SACK 800-1000, 600-
1000
800400 600 999
ACK 400, SACK 600-1000
800400 600 999
![Page 20: SELECTIVE ACKNOWLEDGEMENT (SACK) RFC 2018 DUPLICATE SELECTIVE ACKNOWLEDGMENT (DSACK) RFC 2883](https://reader036.fdocuments.in/reader036/viewer/2022062500/5681592a550346895dc65357/html5/thumbnails/20.jpg)
20
DSACK – Another example
sen
der
receiv
er
500-599 500 599
Receiver Buffer
700-799
ACK 700, SACK 800-900,1100-
1200
600 1100 1199
700-899
ACK 900, SACK 800-900,1100-
1200
ACK 600, SACK 1100-1200
600-699
800-899900-999
1000-1099
1100-1199
ACK 700, SACK 1100-1200
1100600 699 1199
700 800 899 1100 1199
1100600 699 1199800 899
![Page 21: SELECTIVE ACKNOWLEDGEMENT (SACK) RFC 2018 DUPLICATE SELECTIVE ACKNOWLEDGMENT (DSACK) RFC 2883](https://reader036.fdocuments.in/reader036/viewer/2022062500/5681592a550346895dc65357/html5/thumbnails/21.jpg)
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 1st 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 2nd SACK block (if there is one)
• if the 1st SACK block is reporting duplicate data that lies above the cumulative ACK, then the 1st SACK block will be a subset of the 2nd SACK block.
![Page 22: SELECTIVE ACKNOWLEDGEMENT (SACK) RFC 2018 DUPLICATE SELECTIVE ACKNOWLEDGMENT (DSACK) RFC 2883](https://reader036.fdocuments.in/reader036/viewer/2022062500/5681592a550346895dc65357/html5/thumbnails/22.jpg)
22
sen
der
receiv
er
100-199
ACK 200
300-399
400-499
500-599
ACK 200, SACK 300-400
ACK 200, SACK 300-500
fast retransmit
200-299ACK 600
ACK 200, SACK 300-600
200-299
ACK 600
cwnd =10
cwnd =5
cwnd =5
cwnd =5
sen
der
receiv
er
100-199
ACK 200
300-399
400-499
500-599
ACK 200, SACK 300-400
ACK 200, SACK 300-500
fast retransmit
200-299ACK 600
ACK 200, SACK 300-600
200-299
ACK 600, SACK 200-300
cwnd =10
cwnd =5
cwnd =5
cwnd =10
TCP with SACK & without D-SACK
TCP with SACK and D-SACK
DSACK Example
![Page 23: SELECTIVE ACKNOWLEDGEMENT (SACK) RFC 2018 DUPLICATE SELECTIVE ACKNOWLEDGMENT (DSACK) RFC 2883](https://reader036.fdocuments.in/reader036/viewer/2022062500/5681592a550346895dc65357/html5/thumbnails/23.jpg)
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.
![Page 24: SELECTIVE ACKNOWLEDGEMENT (SACK) RFC 2018 DUPLICATE SELECTIVE ACKNOWLEDGMENT (DSACK) RFC 2883](https://reader036.fdocuments.in/reader036/viewer/2022062500/5681592a550346895dc65357/html5/thumbnails/24.jpg)
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.
![Page 25: SELECTIVE ACKNOWLEDGEMENT (SACK) RFC 2018 DUPLICATE SELECTIVE ACKNOWLEDGMENT (DSACK) RFC 2883](https://reader036.fdocuments.in/reader036/viewer/2022062500/5681592a550346895dc65357/html5/thumbnails/25.jpg)
25
Current Implementations of SACK
• Windows 2000/XP
• Controlled by a registry parameter – SackOpts in “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters” - SackOpts="1"
• Windows Vista
• Windows Server 2008 and Windows Vista support TCP SACK
• Free BSD and NetBSD have optional modules
• Solaris 7 and later
![Page 26: SELECTIVE ACKNOWLEDGEMENT (SACK) RFC 2018 DUPLICATE SELECTIVE ACKNOWLEDGMENT (DSACK) RFC 2883](https://reader036.fdocuments.in/reader036/viewer/2022062500/5681592a550346895dc65357/html5/thumbnails/26.jpg)
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.