Expand description
TCP Selective Acknowledgment (SACK) implementation
Implements RFC 2018 TCP SACK option parsing, scoreboard tracking, and selective retransmission hole detection. Enables efficient recovery from multiple segment losses without retransmitting already-received data.
Structs§
- Sack
Block - A single SACK block representing a contiguous range of received bytes.
- Sack
Scoreboard - Tracks selectively acknowledged ranges for a TCP connection.
Constants§
- MAX_
SACK_ BLOCKS - Maximum number of SACK blocks in a single TCP option (limited by option space)
- TCP_
OPT_ SACK - TCP option kind for SACK blocks
- TCP_
OPT_ SACK_ PERMITTED - TCP option kind for SACK-Permitted (sent in SYN/SYN-ACK)
- TCP_
OPT_ SACK_ PERMITTED_ LEN - TCP option length for SACK-Permitted
Functions§
- has_
sack_ permitted - Check if SACK-Permitted option is present in TCP options.
- parse_
sack_ blocks - Parse SACK blocks from TCP options bytes.
- seq_ge
- Returns true if
a >= bin sequence space. - seq_gt
- Returns true if
a > bin sequence space. - seq_le
- Returns true if
a <= bin sequence space. - seq_lt
- Compare sequence numbers using signed 32-bit difference.
Returns true if
ais strictly less thanbin sequence space. - serialize_
sack_ blocks - Serialize SACK blocks into TCP option bytes.
- serialize_
sack_ permitted - Serialize SACK-Permitted option (2 bytes, for SYN/SYN-ACK).