TCP快重传和快恢复

针对不同版本书上几种不同说法,经过查验后总结如下。
(不同说法主要在于ssthresh乘法减小后产生cwnd)

其中一版本描述为:在收到新的报文段后执行“加法增大”时,是逐n加 ,
即cwnd = cwnd + n ,应该是错误的说法. 另外几个版本主要错误描述在重新设置慢启动的门限值。

勘误笔记:

快重传和快恢复算法是对慢开始和拥塞避免算法的改进。
相对于TCP Reno版本的慢启动、拥塞避免、快速重传,
Reno的快重传主要改进之处就是增加了快速恢复阶段,
不再将cwnd直接置为1从而又重新进入慢启动状态,
而是又是进入拥塞避免阶段。

参考RFC原文如下:

1⃣️

"1. When the third duplicate ACK in a row is received, set ssthresh to one-half the current congestion window, cwnd, but no less than two segments. Retransmit the missing segment. Set cwnd to ssthresh plus 3 times the segment size. This inflates the congestion window by the number of segments that have left the network and which the other end has cached (3). "

当发送端连续收到n个重复ACK时
就重新设置慢启动的门限值
ssthresh = 当前cwnd / 2
重传丢失的报文段
将cwnd 设置为
ssthresh + n * MSS,(n >= 3)

2⃣️

"2. Each time another duplicate ACK arrives, increment cwnd by the segment size. This inflates the congestion window for the additional segment that has left the network. Transmit a packet, if allowed by the new value of cwnd."

若此时发送端还允许发送报文段,那么就按拥塞避免算法继续发送报文段。
即在没有收到新的报文段,每收到一个重复的ACK,那么就"加法增大" cwnd++

3⃣️

"3. When the next ACK arrives that acknowledges new data, set cwnd to ssthresh (the value set in step 1). This ACK should be the acknowledgment of the retransmission from step 1, one round-trip time after the retransmission. Additionally, this ACK should acknowledge all the intermediate segments sent between the lost packet and the receipt of the first duplicate ACK. This step is congestion avoidance, since TCP is down to one-half the rate it was at when the packet was lost."

若收到了确认新的报文段的ACK,
则把cwnd缩小到ssthresh(1⃣️中的ssthresh值)
然后又开始继续执行拥塞避免算法

Reno快速恢复阶段退出条件:收到非重复ACK。

 

参考链接:

TCP Slow Start, Congestion Avoidance,Fast Retransmit, and Fast Recovery Algorithms
TCP快速重传与快速恢复原理分析

取消

小伙子,我看你骨骼惊奇,天赋异禀,将来必成大器!

扫码支持
随便赏点呗,有空给你看小姐姐~

打开支付宝扫一扫,即可进行扫码打赏哦