• 聊一聊 tcp拥塞控制 九 fack


     FACK 重传

      FACK全称Forward Acknowledgment 算法,论文地址在这里(PDFForward Acknowledgement: Refining TCP Congestion Control

      SACK是使用了TCP扩展字段Ack了有哪些数据收到,哪些数据没有收到,他比Fast Retransmit的3 个duplicated acks好处在于,前者只知道有包丢了,不知道是一个还是多个,而SACK可以准确的知道有哪些包丢了。 所以,SACK可以让发送端这边在重传过程中,把那些丢掉的包重传,而不是一个一个的传,但这样的一来,如果重传的包数据比较多的话,又会导致本来就很忙的网络就更忙了。所以,FACK用来做重传过程中的拥塞流控

    • 这个算法会把SACK中最大的Sequence Number 保存在snd.fack这个变量中,snd.fack的更新由ack决定,如果网络一切安好则和snd.una一样(snd.una就是还没有收到ack的地方,也就是前面sliding window里的category #2的第一个地方)
    • 然后定义一个awnd = snd.nxt – snd.fack(snd.nxt指向发送端sliding window中正在要被发送的地方——前面sliding windows图示的category#3第一个位置),这样awnd的意思就是在网络上的数据。(所谓awnd意为:actual quantity of data outstanding in the network)
    • 如果需要重传(包括在cwnd内允许传输的段)数据,那么,awnd = snd.nxt – snd.fack + retran_data,也就是说,awnd是传出去的数据 + 重传的数据。
    • 然后触发Fast Recovery 的条件是: ( ( snd.fack – snd.una ) > (3*MSS) ) || (dupacks == 3) ) 。这样一来,就不需要等到3个duplicated acks才重传,而是只要sack中的最大的一个数据和ack的数据比较长了(3个MSS),那就触发重传。在整个重传过程中cwnd不变。直到当第一次丢包的snd.nxt<=snd.una(也就是重传的数据都被确认了),然后进来拥塞避免机制——cwnd线性上涨。

      

      FACK 它拥有标准 SACK 算法的一切性质,除此之外,它假设网络不会使数据包乱序,因此收到最大的被 SACK 的数据包之前,FACK 均认为是丢失的。FACK 模式下,重传时机为 被 SACKed 的包数 + 空洞数 > dupthresh 同时dupack == dupthresh(3) 默认
    如下图所示,设 dupthresh = 3,FACKed_count = 12,从 unACKed 包开始的 FACKed_count
      dupthresh 个数据包,即 9 个包会被标记为 LOST。 也就是 段的数量为(snd.fack – snd.una-sacked)

    拥塞窗口状态

    记分板状态如下,红色表示该数据包丢失.

    FACK Design Goals

      The requisite network state information can be obtained with accurate knowledge about the forward most data held by the receiver. By forward-most, we mean the correctly-received data with the highest sequence number. This is the origin of the name "forward acknowledgement."The goal of the FACK algorithm is to perform precise congestion control during recovery by keeping an accurate estimate of the amount of data outstanding in the network.

    FACK  Algorithm

      When a SACK block is received which acknowledges data with a higher sequence number than the current value of snd.fack, snd.fack is updated to reflect the highest sequence number known to have been received plus one. The FACK algorithm uses the additional information provided by the SACK option to keep an explicit measure of the total number of bytes of data outstanding in the network. In contrast, Reno and Reno + SACK both attempt to estimate this by assuming that each duplicate ACK received represents
    one segment which has left the network. The FACK algorithm is able to do this in a staightforward way by introducing two new state variables, snd.fack and retran_data.
    TCP's estimate of the amount of data outstanding in the network during recovery is given by:

    awind = snd.nxt - snd.fack + retran_data

    Triggering Recovery

       Reno invokes Fast Recovery by counting duplicate acknowledgements:

    if ( dupacks == 3 ) {
    ...
    }

      This algorithm causes an unnecessary delay if several segments are lost prior to receiving three duplicate acknowledgements. In the FACK version, the cwnd adjustment and retransmission are also triggered when the receiver reports that the reassembley queue is longer than 3 segments:

    if ( ( snd.fack - snd.una ) > (3*MSS) ) || (dupacks == 3) ) {
    ...
    }
  • 相关阅读:
    【jquery仿dataList】应用之——模仿igoogle【定制化、拖动排序,最大化、分屏】
    【jquery版.net控件—dropdownlist】附源码,欢迎大家指点、指正、拍砖!!!
    求【javascript设计模式】【高性能网站建设指南】PDF!哪位有给下啊!!!
    只言碎语总结,今后发展web前端,并分享两个项目难点解决方案。
    【jquery模仿net控件】简单的datalist控件更新,及其简单应用
    一次上机面试题带来的感悟【学习的感觉、学习的方法】
    【jquery模仿net控件】初步GridView模型实现,及其简单应用
    【HTML5初探之Web Workers】网页也能多线程
    Fiddler真乃前端大杀器!!!
    【初探HTML5之使用新标签布局】用html5布局我的博客页!
  • 原文地址:https://www.cnblogs.com/codestack/p/15579941.html
Copyright © 2020-2023  润新知