UDT 介绍

来源:互联网 发布:ip与mac绑定防蹭网 编辑:程序博客网 时间:2024/04/30 23:35

小弟初学翻译,如有不当之处请各位包涵及指教,谢谢!

 

 

 1. Introduction......................................................................

 2. Packet Structures..............................................................

 3. UDP Multiplexer.................................................................

 4. Timers...............................................................................

 5. Connection Setup and shutdown.......................................

     5.1 Client/Server Connection Setup....................................

     5.2 Rendezvous Connection Setup.....................................

     5.3 Shutdown.....................................................................

 6. Data Sending and Receiving...............................................

     6.1 The Sender’s Algorithm..................................................

     6.2 The Receiver’s Algorithm................................................

     6.3 Flow Control..................................................................

     6.4 Loss Information Compression Scheme.........................

 7. Configurable Congestion Control (CCC)...............................

     7.1 CCC Interface.................................................................

     7.2 UDT’s Native Control Algorithm.......................................

 

 

1. Introduction

    简介

 

    The Transmission Control Protocol (TCP) [RFC5681] has been very successful and greatly contributes to the      

    popularity of today’s Internet. Today TCP still contributes the majority of the traffic on the Internet.

 

    TCP传输协议对今天因特网流行做出了巨大的贡献并取得了巨大的成功。今天TCP依然是因特网的主要传输方式。

 

 

    However, TCP is not perfect and it is not designed for every specific applications. In the last several years, with

    the rapid advance of optical networks and rich Internet applications, TCP has been found inefficient as the network

    bandwidth-delay product (BDP) increases.Its AIMD (additive increase multiplicative decrease) algorithm reduces the

    TCP congestion window drastically but fails to recover it to the available bandwidth quickly. Theoretical flow level    

    analysis has shown that TCP becomes more vulnerable to packet loss as the BDP increases higher [LM97].

 

    然而,TCP并不完美,它不是为所有的具体应用而设计的。在最近的几年,随着光网络及丰富的网络应用的发展,发现TCP并不能满足延

    迟带宽产品的需求。它的AIMD算法大大的减少了TCP的拥塞窗口,但并不能快速的恢复可用带宽。从流级别的理论分析显示,当BDP增幅

    很大时,TCP变得更加脆弱,更容易丢包。 

 

 

     To overcome the TCP’s inefficiency problem over high speed wide area networks is the original motivation of UDT.

     Although there are new TCP variants deployed today (for example, BiC TCP [XHR04] on Linux and Compound TCP

     [TS06] on Windows), certain problems still exist. For example, none of the new TCP variants address RTT

     unfairness, the   situation that connections with shorter RTT consume more bandwidth.

 

     UDT的最初动机是为了克服TCP在高速广域网中的低效问题。尽管当前部署了各种TCP的变种(如Linux上的BIC TCP,Window上的

     Compound TCP)。但某些问题依然存在。比如,没有任何一个新的TCP变种解决RTT不公平的问题:RTT小的连接占有更多的带宽。

 

     Moreover, as the Internet continues to evolve, new challenges and requirements to the transport protocol will
     always emerge. Researchers need a platform to rapidly develop and test new algorithms and protocols. Network
     researchers and students can use UDT to easily implement their ideas on transport protocols, in particular
     congestion control algorithms, and conduct experiments over real networks. 
     而且,随着因特网的演变发展,传输协议将面临一些新的挑战和需求。研究人员需要一个平台快速的开发和测试新的算法和协议。网络研
     究人员和学生通过UDT可以很简单的实现他们关于传输协议的想法,特别是拥塞控制算法,并在真实网络中进行实验。
    Finally, there are other situations when UDT can be found more helpful than TCP. For example, UDP-based protocol
    is usually easier for punching NAT firewalls. For another example, TCP’s congestion control and reliability control is
    not desirable in certain applications of VOIP, wireless communication, etc. Application developers can use (with or
    without modification) UDT to suit their requirements. 
    最后,在下面的场景UDT比TCP有更好的表现。比如,基于UDP的协议可以更容易的穿透NAT及防火墙。还有,在一些VOIP及无线通信应用方面,
    TCP 的拥塞控制及可靠控制并不能满足需求。对于应用开发者来说,UDT更能满足他们的需求。
    Due to all those reasons and motivations described above, we believe that it is necessary to design a well defined
    and developed UDP-based data transfer protocol. 
    由于上面描述的原因及动机,我们相信设计一个好的定义及开发基于UDP的数据传输协议是有必要的。
    As its name suggest, UDT is built solely on the top of UDP [RFC768]. Both data and control packets are transferred
    using UDP. UDT is connection-oriented in order to easily maintain congestion control,reliability, and security. It is a
    unicast protocol while multicast is not considered here. Finally, data can be transferred over UDT in duplex.
    正如课题名所说,UDT是唯一一个构建于UDP之上的。数据包和控制包都是通过UDP传输的。为了更容易的维护拥塞控制,可靠性及安全
    性,UDT采用面向连接的机制。它是一个单播协议,在次我们不考虑多播。最后,UDT通过双工的方式传输数据。
    UDT supports both reliable data streaming and partial reliable messaging. The data streaming semantics is similar
    to that of TCP,while the messaging semantics can be regarded as a subset of SCTP[RFC4960].
    UDT支持可靠的数据流及部分可靠的消息。数据流的语义跟TCP相似。而消息的语义可以看作是SCTP的一个子集。
    This document defines UDT’s protocol specification. The detailed description and performance analysis can be found
    in [GG07], and a fully functional reference implementation can be found at [UDT].
 
    本文档定义了UDT的具体协议。详细的描述及性能分析可以在GG07中找到,完整的函数参考实现可以在UDT中找到。
    2.  Packet Structures
         包结构
         UDT has two kinds of packets: the data packets and the control packets. They are distinguished by the 1st bit
         (flag bit) of the packet header.
         UDT包分为两种:数据包和控制包。他们是通过包头的第一位进行区分的。
        The data packet header structure is as following.
   0                   1                   2                   3
   0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |0|                     Packet Sequence Number                  |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |FF |O|                     Message Number                      |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                          Time Stamp                           |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                    Destination Socket ID                      |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        The data packet header starts with 0. Packet sequence number uses the  following 31 bits after the flag bit.
        UDT uses packet based sequencing, i.e., the sequence number is increased by 1 for each sent data packet in the         order of packet sending. Sequence number is wrapped after it is increased to the maximum number (2^31 - 1).
        下面是数据包的包头结构:
        数据包的包头第一位是0,接下去的31位是包序号。UDT的包是用序号来标识的,比如每发送一个包,包序号加一。在序号增加后(最
        大值2^31-1)进行封装。
        The next 32-bit field in the header is for the messaging. The first two bits "FF" flags the position of the packet is           a message. "10" is the first packet, "01" is the last one, "11" is the only packet, and "00" is any packets in the             middle. The third bit "O" means if the message should be delivered in order (1) or not (0). A message to be 
        delivered in order requires that all previous messages must be either delivered or dropped. The rest 29 bits is             the message number, similar to packet sequence number (but independent). A UDT message may contain                   multiple UDT packets.
        包头中第二个32位字段是消息的。前面2位"FF"标识表示该包是一个消息。“10”表示第一个包,“01”表示最后一个,"11"表示只有
        一个包,“00”表示是中间的任意一个包。第3位"O"为“1”表示顺序递交,为“0”则不用顺序递交。消息顺序传递要求:前面的消息要
       么递送了要么丢弃了。剩下的29位是消息号,跟包序号类似(但不保证唯一)。一个UDT消息可以包含多个UDT包。
   
        Following are the 32-bit time stamp when the packet is sent and the destination socket ID. The time stamp is a
        relative value starting from the time when the connection is set up. The time stamp information is not required             by UDT or its native control algorithm. It is included only in case that a user defined control algorithm may
        require the information (See Section 6).
 
       接下来的32位是包发送的时间截和目标套接字的ID。时间截是一个相对值,想到链接建立的时间。接下来的32位是包发送的时间截和
       目标套接字的ID。时间截是一个相对值,想到链接建立的时间。
       The Destination ID is used for UDP multiplexer. Multiple UDT socket can be bound on the same UDP port and this          UDT socket ID is used to differentiate the UDT connections.
       目标ID是为UDP的多路选择服务的。多个UDT套接字可以使用同一个UDP端口,而这个UDT套接字ID是用来区分不同的UDT链接。
       If the flag bit of a UDT packet is 1, then it is a control packet and parsed according to the following structure.
   0                   1                   2                   3
   0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |1|             Type            |            Reserved           |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     |                    Additional Info                      |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                            Time Stamp                         |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                    Destination Socket ID                      |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                                                               |
   ˜                 Control Information Field                     ˜
   |                                                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      There are 8 types of control packets in UDT and the type information is put in bit field 1 - 15 of the header. The           contents of the following fields depend on the packet type. The first 128 bits must exist in the packet header,             whereas there may be an empty control information field, depending on the packet type.
      如果UDT包的标识位是1,那么这个包是控制包,通过下面的结构进行解包。
      在UDT控制包有8种类型,包头的第1-15位用来表示类型信息。下面的字段内容跟包的类型相关。包头最少必须包括前面的128位,某         些类型的包,它的控制信息字段可能为空。 
Particularly, UDT uses sub-sequencing for ACK packet. Each ACK packet  is assigned a unique increasing 16-bit sequence number, which is  independent of the data packet sequence number. The ACK sequence number uses bits 32 - 63 ("Additional Info") in the control packet header. The ACK sequence number ranges from 0 to (2^31 - 1).
特别是,UDT的ACK包使用自序号。每个ACK包分配一个唯一的增加的16的序号,该序号跟数据包的序号无关。AKC序号用控制包头
中的第32-63位(附加信息)表示。ACK序号的范围是0-2^31-1
TYPE 0x0:  Protocol Connection Handshake
              Additional Info: Undefined
              Control Info:
              1) 32 bits: UDT version
              2) 32 bits: Socket Type (STREAM or DGRAM)
              3) 32 bits: initial packet sequence number
              4) 32 bits: maximum packet size (including UDP/IP headers)
              5) 32 bits: maximum flow window size
              6) 32 bits: connection type (regular or rendezvous)
              7) 32 bits: socket ID
              8) 32 bits: SYN cookie
              9) 128 bits: the IP address of the peer’s UDP socket
类型 0 :握手连接协议
附加信息:未定义
控制信息:
1)32位:UDT版本
2)32位:套接字类型(STREAM或DGRAM)
3)  32位:包序号初始值
4)32位:包最大值(包括UDP/IP包头)
5)32位:流窗口最大值
6)32位:连接类型(规则的或约定的)
7)32位:套接字ID
8)32位:SYN cookie
9)128位:对方UDP套接字的IP地址
TYPE 0x1:  Keep-alive
              Additional Info: Undefined
              Control Info: None
类型 1:心跳包
附加信息:未定义
控制信息:  无
   TYPE 0x2:  Acknowledgement (ACK)
              Additional Info: ACK sequence number
              Control Info:
              1) 32 bits: The packet sequence number to which all the
                 previous packets have been received (excluding)
              [The following fields are optional]
              2) 32 bits: RTT (in microseconds)
              3) 32 bits: RTT variance
              4) 32 bits: Available buffer size (in bytes)
              5) 32 bits: Packets receiving rate (in number of packets
                          per second)
              6) 32 bits: Estimated link capacity (in number of packets per second)
类型 2:应答包
附加信息: ACK序号
控制信息:
1)32位:包的序号,表示该序号之前的所
          有包均收到(不包括本序号所指的包)
          下面的字段是可选的
2)32位:RTT(微秒级)
3)32位:RTT方差
4)32位:可用缓冲区大小(字节数)
5)32位:包接受速率(包/秒)
6)32位:链路吞吐量估计值(包/秒) 
   TYPE 0x3:  Negative Acknowledgement (NAK)
              Additional Info: Undefined
              Control Info:
              1) 32 bits integer array of compressed loss information
                 (see section 3.9).
类型 3:丢包报告
附加信息:未定义
控制信息:
1)压缩的32位整形数组
     表示丢包信息
   TYPE 0x4:  Unused
类型 4:未使用
   TYPE 0x5:  Shutdown
              Additional Info: Undefined
              Control Info: None
类型 5:关闭
附加信息:未定义
控制信息:无
   TYPE 0x6:  Acknowledgement of Acknowledgement (ACK2)
              Additional Info: ACK sequence number
              Control Info: None
类型 6:应答包的响应包
附加信息:应答序号
控制信息:无
   TYPE 0x7:  Message Drop Request:
              Additional Info: Message ID
              Control Info:
              1) 32 bits: First sequence number in the message
              2) 32 bits: Last sequence number in the message
类型 7:消息丢弃请求
附加信息:消息ID
控制信息:
1)32位:消息的开始序号
2)32位:消息的结束序号
   TYPE 0x7FFF: Explained by bits 16 - 31, reserved for user defined
              Control Packet
类型 0x7FFF:16-31为扩展字段,用于用户自定义控制包
Finally, Time Stamp and Destination Socket ID also exist in the   control packets.
最后,控制包中还包括时间截和目标套接字ID
3.  UDP Multiplexer
     A UDP multiplexer is used to handle concurrent UDT connections sharing the same UDP port. The multiplexer       dispatch incoming UDT packets to the corresponding UDT sockets according to the destination socket ID in the     packet header.
    一个UDP多路器被用来处理UDT并发链接,他们共享同一个UDP端口。多路器根据收到的UDT包包头中的目标套接字ID将包分发给     对应的UDT套接字。
    One multiplexer is used for all UDT connections bound to the same UDP port. That is, UDT sockets on different       UDP port will be handled by different multiplexers.
    一个多路器被所有的UDT连接公用同一个UDP端口。也就是说,UDT套接字中不同的UDP端口被不同的多路器处理。
    A multiplexer maintains two queues. The sending queue includes the sockets with at least one packet                   scheduled for sending. The UDT sockets in the sending queue are ordered by the next packet sending
    time. A high performance timer is maintained by the sending queue and when it is time for the first socket in         the queue to send its packet,  the packet will be sent and the socket will be removed. If there are more               packets for that socket to be sent, the socket will be re-inserted to the queue.
    一个多路器维护两个队列。发送队列包含的套接字最少有一个包被安排发送。UDT发送队列中的套接字是根据下一个包的发送时间进    行排序。发送队列维护了一个精确的定时器,当队列中的第一个套接字发完包后,该套接字将从队列中移去。如果该套接字还有更多    的包要发送,那么该套接字将重新插入到队列中。
   The receiving queue reads incoming packets and dispatches them to the corresponding sockets. If the                  destination ID is 0, the packet will be sent to the listening socket (if there is any), or to a socket that
   is in rendezvous connection phase. (See Section 5.)
   接受队列读入到来的包,并分发给对应的套接字。如果目标ID是0,包将发送给监听套接字(如果有的话),或者发送给处于链接约定      阶段的套接字。
   Similar to the sending queue, the receiving queue also maintains a list of sockets waiting for incoming packets.    The receiving queue scans the list to check if any timer expires for each socket every SYN (SYN = 0.01 second,      defined in Section 4).
  与发送队列一样,接受队列同意维护了一个套接字列表,这些套接字在等待数据包的到来。接受队列浏览套接字列表检查其用来处理     SYN的定时器是否到期。
    未完,待续,谢谢!
原创粉丝点击