`
jimmee
  • 浏览: 529828 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

UDT协议-基于UDP的可靠数据传输协议的实现分析(7)-流量和拥塞控制

阅读更多

流量控制
 
对于一个带宽1Gbps, RTT为100ms的网络来说
 
BDP=1,000,000,000*0.1/8=12,500,000字节=12207K=12M
 
传统TCP接收窗口大小=65535byte=64K, 显然满足不了
 
udt使用包大小1500byte, 默认接口窗口大小为8192, 因此
接收窗口的大小为=1500*8192=12,288,000字节=12000K=11.7M
 
因此, 可以看到udt的默认设置已经足够.

Congestion Control(拥塞控制)

1. 两个重要的参数:
congestion window size and the inter-packet sending interval

2. 主要的接口

   1) init: when the UDT socket is connected.
   2) close: when the UDT socket is closed.
   3) onACK: when ACK is received.
   4) onLOSS: when NACK is received.
   5) onTimeout: when timeout occurs.
   6) onPktSent: when a data packet is sent.
   7) onPktRecv: when a data packet is received.

3. udt的拥塞算法:

   On ACK packet received:
   1) If the current status is in the slow start phase, set the
      congestion window size to the product of packet arrival rate and
      (RTT + SYN). Slow Start ends. Stop.
   2) Set the congestion window size (CWND) to: CWND = A * (RTT + SYN) +
      16.
   3) The number of sent packets to be increased in the next SYN period
      (inc) is calculated as:
         if (B <= C)
            inc = 1/PS;
         else
            inc = max(10^(ceil(log10((B-C)*PS*8))) * Beta/PS, 1/PS);
      where B is the estimated link capacity and C is the current
      sending speed. All are counted as packets per second. PS is the
      fixed size of UDT packet counted in bytes. Beta is a constant
      value of 0.0000015.
   4) The SND period is updated as:
         SND = (SND * SYN) / (SND * inc + SYN).

 

*/
    public void onACK(long ackSeqno){
        //increase window during slow start
        if(slowStartPhase){
            congestionWindowSize+=ackSeqno-lastAckSeqNumber;
            lastAckSeqNumber = ackSeqno;
            //but not beyond a maximum size
            if(congestionWindowSize>session.getFlowWindowSize()){
                slowStartPhase=false;
                if(packetArrivalRate>0){
                    packetSendingPeriod=1000000.0/packetArrivalRate;
                }
                else{
                    packetSendingPeriod=(double)congestionWindowSize/(roundTripTime+Util.getSYNTimeD());
                }
            }

        }else{
            //1.if it is  not in slow start phase,set the congestion window size
            //to the product of packet arrival rate and(rtt +SYN)
            double A=packetArrivalRate/1000000.0*(roundTripTime+Util.getSYNTimeD());
            congestionWindowSize=(long)A+16;
            if(logger.isLoggable(Level.FINER)){
                logger.finer("receive rate "+packetArrivalRate+" rtt "+roundTripTime+" set to window size: "+(A+16));
            }
        }

        //no rate increase during slow start
        if(slowStartPhase)return;

        //no rate increase "immediately" after a NAK
        if(loss){
            loss=false;
            return;
        }

        //4. compute the increase in sent packets for the next SYN period
        double numOfIncreasingPacket=computeNumOfIncreasingPacket();

        //5. update the send period
        double factor=Util.getSYNTimeD()/(packetSendingPeriod*numOfIncreasingPacket+Util.getSYNTimeD());
        packetSendingPeriod=factor*packetSendingPeriod;
        //packetSendingPeriod=0.995*packetSendingPeriod;

        statistics.setSendPeriod(packetSendingPeriod);
    }

 

On NAK packet received:
   1) If it is in slow start phase, set inter-packet interval to
      1/recvrate. Slow start ends. Stop.
   2) If this NAK starts a new congestion period, increase inter-packet
      interval (snd) to snd = snd * 1.125; Update AvgNAKNum, reset
      NAKCount to 1, and compute DecRandom to a random (average
      distribution) number between 1 and AvgNAKNum. Update LastDecSeq.
      Stop.
   3) If DecCount <= 5, and NAKCount == DecCount * DecRandom:
        a. Update SND period: SND = SND * 1.125;
        b. Increase DecCount by 1;
        c. Record the current largest sent sequence number (LastDecSeq).

   

 /* (non-Javadoc)
     * @see udt.CongestionControl#onNAK(java.util.List)
     */
    public void onLoss(List<Integer>lossInfo){
        loss=true;
        long firstBiggestlossSeqNo=lossInfo.get(0);
        nACKCount++;
        /*1) If it is in slow start phase, set inter-packet interval to
             1/recvrate. Slow start ends. Stop. */
        if(slowStartPhase){
            if(packetArrivalRate>0){
                packetSendingPeriod = 100000.0/packetArrivalRate;
            }
            else{
                packetSendingPeriod=congestionWindowSize/(roundTripTime+Util.getSYNTime());
            }
            slowStartPhase = false;
            return;
        }

        long currentMaxSequenceNumber=session.getSocket().getSender().getCurrentSequenceNumber();
        // 2)If this NAK starts a new congestion epoch
        if(firstBiggestlossSeqNo>lastDecreaseSeqNo){
            // -increase inter-packet interval
            packetSendingPeriod = Math.ceil(packetSendingPeriod*1.125);
            // -Update AvgNAKNum(the average number of NAKs per congestion)
            averageNACKNum = (int)Math.ceil(averageNACKNum*0.875 + nACKCount*0.125);
            // -reset NAKCount and DecCount to 1,
            nACKCount=1;
            decCount=1;
            /* - compute DecRandom to a random (average distribution) number between 1 and AvgNAKNum */
            decreaseRandom =(int)Math.ceil((averageNACKNum-1)*Math.random()+1);
            // -Update LastDecSeq
            lastDecreaseSeqNo = currentMaxSequenceNumber;
            // -Stop.
        }
        //* 3) If DecCount <= 5, and NAKCount == DecCount * DecRandom:
        else if(decCount<=5 && nACKCount==decCount*decreaseRandom){
            // a. Update SND period: SND = SND * 1.125;
            packetSendingPeriod = Math.ceil(packetSendingPeriod*1.125);
            // b. Increase DecCount by 1;
            decCount++;
            // c. Record the current largest sent sequence number (LastDecSeq).
            lastDecreaseSeqNo= currentMaxSequenceNumber;
        }
       
        statistics.setSendPeriod(packetSendingPeriod);
        return;
    }

 

分享到:
评论

相关推荐

    UDT-基于UDP的可靠数据传输协议【中文版】

    另一个重要的应用场景是,允许网络研究人员、学生和应用程序开发人员在UDT框架下轻松地实现和部署新的数据传输算法和协议。此外,UDT也可用于更好地支持防火墙穿透。 UDT完全构建在UDP之上。但是,UDT是有连接的,...

    UDT协议及其拥塞控制机制

    介绍了一种基于UDP的高性能数据传输协议UDT,并分析了UDT的拥塞控制机制。 UDT是面向连接的流数据传输协议,结合了窗口流量拥塞控制和速率控制两种控制方法,采用了新的DAIMD速率控制算法和带宽估计算法,支持高速...

    udt.sdk.4.11.tar.zip

    基于UDP的数据传输协议(UDP-based Data Transfer Protocol,简称UDT)是一种互联网数据传输协议。UDT的主要目的是支持高速广域网上的海量数据传输,而互联网上的标准数据传输协议TCP在高带宽长距离网络上性能很差。...

    UDT:基于UDP的数据传输协议

    UDT是一种可靠的基于UDP的应用程序级别数据传输协议,用于广域高速网络上的分布式数据密集型应用程序。 UDT使用UDP通过其自己的可靠性控制和拥塞控制机制来传输批量数据。 新协议可以以比TCP更高的速度传输数据。 ...

    udt.sdk.4.5a.win32.zip_Mesh_udt_udt u_可靠 udp

    UDT(UDP-based Data Transfer Protocol,简称UDT)是一种互联网数据传输协议。UDT建于UDP之上,并引入新的拥塞控制和数据可靠性控制机制。UDT是面向连接的双向的应用层协议。它同时支持可靠的数据流传输和部分可靠...

    论文研究-基于NS2的传输协议的能耗对比研究.pdf

    从能耗角度对比了标准TCP协议、基于TCP协议改进的XCP协议、基于UDP协议改进的Reliable Blast UDP(RBUDP)和UDP-based Data Transport(UDT)协议,进一步分析各协议的拥塞控制策略对能耗的影响。利用ns-2平台进行...

    基于UDP传输协议的实现分析之流量和拥塞控制

    基于UDP的数据传输协议是一种互联网数据传输协议。UDT的主要目的是支持高速广域网上的海量数据传输,而互联网上的标准数据传输协议TCP在高带宽长距离网络上性能很差,控制UDP的流量和拥塞控制如何解决,请参考下

    udt.sdk.4.11.zip

    基于UDP的数据传输协议(英语:UDP-based Data Transfer Protocol,缩写:UDT)是一种互联网数据传输协议。UDT的主要目的是支持高速广域网上的海量数据传输,而互联网上的标准数据传输协议TCP在高带宽长距离网络上...

    论文研究-基于Tsunami协议的干涉测量数据实时传输 .pdf

    基于Tsunami协议的干涉测量数据实时传输,刘禄,唐歌实,Tsunami是一种可靠的基于UDP的应用层传输协议。首先介绍了干涉测量数据的实时传输需求,分析了Tsunami基于差错率反馈的拥塞控制机制;�

    udt.sdk.4.9.tar.gz_udt

    UDT(UDP-based Data Transfer Protocol,简称UDT)是一种互联网数据传输协议。UDT建于UDP之上,并引入新的拥塞控制和数据可靠性控制机制。UDT是面向连接的双向的应用层协议。它同时支持可靠的数据流传输和部分可靠...

Global site tag (gtag.js) - Google Analytics