Documentation ¶
Index ¶
- Constants
- Variables
- func FindWndScale(wnd seqnum.Size) int
- func TrimSACKBlockList(sack *SACKInfo, rcvNxt seqnum.Value)
- func UpdateSACKBlocks(sack *SACKInfo, segStart seqnum.Value, segEnd seqnum.Value, ...)
- type AvailableCongestionControlOption
- type CongestionControlOption
- type ReceiveBufferSizeOption
- type SACKEnabled
- type SACKInfo
- type SendBufferSizeOption
Constants ¶
View Source
const ( ProtocolName = "tcp" ProtocolNumber = header.TCPProtocolNumber DefaultBufferSize = 1 << 20 // 1MB 接收或发送缓存的默认值 )
View Source
const (
InitialCwnd = 10 // 初始拥塞窗口大小
)
View Source
const (
MaxSACKBlocks = 6 // 接收端存储的最大SACK块数。
)
Variables ¶
View Source
var ( // SynRcvdCountThreshold 在TCP使用 SYN cookies接受连接之前,允许的最大的处于 SYN-RCVD 状态的数量 SynRcvdCountThreshold uint64 = 1000 )
Functions ¶
func FindWndScale ¶
FindWndScale 对于给定的最大窗口大小,确定窗口扩展因子 因为窗口的大小不能超过序列号范围的一半,即窗口最大2^30, so (2^16)*(2^maxWnsScale) < 2^30, get maxWnsScale = 14
func TrimSACKBlockList ¶
TrimSACKBlockList tcp的可靠性:通过删除/修改 start为 <rcvNxt 的任何块来更新sack块列表。
Types ¶
type AvailableCongestionControlOption ¶
type AvailableCongestionControlOption string // 返回支持的拥塞控制算法
type CongestionControlOption ¶
type CongestionControlOption string // 设置当前的拥塞控制算法
type ReceiveBufferSizeOption ¶
type SACKEnabled ¶
type SACKEnabled bool // 开启SACK功能
type SACKInfo ¶
type SACKInfo struct { Blocks [MaxSACKBlocks]header.SACKBlock NumBlocks int // 有效blocks的数量 }
SACKInfo 持有给定端点的TCP SACK信息
type SendBufferSizeOption ¶
Click to show internal directories.
Click to hide internal directories.