SACK

最後更新: 2017-12-29

 

介紹

 

TCP Selective Acknowledgments (SACK)

應用範圍: packets are lost from one window of data

原理: inform the data sender of non-contiguous blocks of data that have been received and queued.
        When missing segments are received, the data receiver acknowledges the data normally by
        advancing the left window edge in the Acknowledgement Number Field of the TCP header.

RFC: 2018, 2883

RFC 2018 (SACK Extension)

specifying the use of the SACK option for acknowledging duplicate packets.

when duplicate packets are received, the first block of the SACK option field can be used to report the sequence numbers

of the packet that triggered the acknowledgement.


Example

 

R   <-#1   S
R X <-#2   S
R   <-#3   S
R X <-#4   S
R   <-#5   S
R X <-#6   S
R   <-#7   S
R X <-#8   S

沒有 SACK 時: A TCP sender can only learn about a single lost packet per round trip time

Package Format

TCP Option 5:

Kind. 8 bits
Length. 8 bits
SACK block. 64 bits (Left: 32 bits + Right : 32bits Edge of Block)

SACK 跡象

A duplicate acknowledgment with SACK includes a SACK option

SACK option cannot simply specify which segment(s) were received.
It specifies the left and right edges of data that has been received
beyond the packet's acknowledgment number.

* Duplicate ACK 的原因係每次都話發送方知 right side 去到邊
 * 每個 duplicate package 都是相同的 Seq & Ack
 * duplicate 直到 Server "Seq=Ack & Ack=Seq"

 


Example

 

[1] Missing Package & Out Of Oder

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:

Triggering  ACK    First Block   2nd Block     3rd Block
Segment            Left   Right  Left   Right  Left   Right
                   Edge   Edge   Edge   Edge   Edge   Edge

5000       5500
5500       (lost)
6000       5500    6000   6500
6500       (lost)
7000       5500    7000   7500   6000   6500
7500       (lost)
8000       5500    8000   8500   7000   7500   6000   6500
8500       (lost)
 

the 4th packet is received out of order.

Triggering  ACK    First Block   2nd Block     3rd Block
Segment            Left   Right  Left   Right  Left   Right
                   Edge   Edge   Edge   Edge   Edge   Edge

6500       5500    6000   7500   8000   8500

the 2nd segment is received

Triggering  ACK    First Block   2nd Block     3rd Block
Segment            Left   Right  Left   Right  Left   Right
                   Edge   Edge   Edge   Edge   Edge   Edge

5500       7500    8000   8500

[2]

# Reporting a duplicate segment

Transmitted    Received    ACK Sent
Segment        Segment     (Including SACK Blocks)

3000-3499      3000-3499   3500 (ACK dropped)
3500-3999      3500-3999   4000 (ACK dropped)
3000-3499      3000-3499   4000, SACK=3000-3500

# Reporting an out-of-order segment and a duplicate segment.

Transmitted    Received    ACK Sent
Segment        Segment     (Including SACK Blocks)

3000-3499      3000-3499   3500 (ACK dropped)
3500-3999      3500-3999   4000 (ACK dropped)
4000-4499      (data packet dropped)
4500-4999      4500-4999   4000, SACK=4500-5000 (ACK dropped)
3000-3499      3000-3499   4000, SACK=3000-3500, 4500-5000