Click here to Skip to main content
13,596,556 members
Click here to Skip to main content
Add your own
alternative version


116 bookmarked
Posted 20 Jul 2005

A UDP-based Reliable Data Transfer Library

, 21 Mar 2006
Rate this:
Please Sign up or sign in to vote.
Introduces an open source UDP-based data transfer library.


This article introduces an open source UDP-based data transfer library, namely UDT (UDP-based Data Transfer).

Currently, there are two major Internet transport protocols, TCP and UDP. TCP provides connection oriented reliable data streaming service, whereas UDP provides connection-less unreliable messaging service. Most applications use TCP to transfer data because they require data reliability.

However, when using TCP some applications suffer from two problems. First, TCP demonstrates poor performance in long distance links, especially when the bandwidth is high (e.g., 1GB/s or higher). Second, when incorporating multiple concurrent TCP flows with different RTTs in the same application, different TCP flows may have different data transfer rates (also known as RTT bias).

There are other situations where people do not want to use either TCP or UDP. For example, an application may require data reliability (so cannot use UDP directly) but also wants data to arrive at a user-controlled rate or the message boundaries to be conserved. Furthermore, sometimes it is easier to use UDP to traverse firewalls than TCP.

It may be helpful to build an open source user space transport protocol above UDP, but with the data reliability control and network flow/congestion control. Because it is at user space, it is easy to get installed. Because it is open source, it can be easily modified to meet various requirements from applications.

Example applications

Here we present two example applications in which you may need UDT.

a. Bulk data transfer and online streaming data processing

Suppose a company has their data stored in multiple branches around the world, each branch having its own part of the dataset. The datasets are very large (terabytes) and the company has a 1GB/s intranet to deliver them. Now one of its departments at Chicago branch wants to analyze its own dataset and the dataset of the London branch. This data analysis application will need to read two datasets (at London and Chicago, respectively) using the company's 1GB/s intranet to a computer at Chicago.

Recall the two problems of TCP mentioned above. First, the link must be extremely clean (very little packet loss) for TCP to fully utilize the 1GB/s bandwidth between London and Chicago. Second, when the two TCP streams (London->Chicago, Chicago->Chicago) start at the same time, the London-Chicago stream will be starved due to the RTT bias problem, thus the data analysis process will have to wait for the slower data stream.

b. Application awareness

A streaming video server is sending data to many clients. The server may choose a specific sending rate for each client during any specific period. You may have trouble asking TCP to send data at a fixed rate. And using UDP you have to do most of the data reliability control work by yourself. In addition, video frames are time sensitive data, if the frame is delayed too long, it will not be needed any more. That is, complete data reliability is not desired in this situation.

Using the UDT library, the programming work is simply several lines of option setting code.


UDT is a transport protocol with its own reliability control and flow/congestion control built above UDP. UDT provides both reliable data streaming service quite similar to TCP and partial reliable messaging. The latter allows users to send data as messages with specified delivery order and time-to-live value.

The position of UDT in the layered architecture of internet reference model is shown in the figure below. Applications use UDT socket to transfer their data, which is passed to the UDP socket. (Effort was made to avoid one time memory copy here.) A congestion control (CC) algorithm can be provided by applications; otherwise the default control algorithm is used. If user-defined control algorithm is provided, UDT will call the callback functions in CC once a control event occurs:

The default UDT control algorithm is designed for high performance data transfer over wide area high speed networks (e.g. in the case of example a). However, UDT's congestion control algorithm is configurable such that you can add your own control algorithm with ease (e.g., in the case of example b).

UDT provides a set of socket-like API. Using UDT in your application is simple as long as you are familiar with BSD socket. For example: With BSD socket, you write:

int s = socket(AF_INET, SOCK_STREAM, 0);

Its counterpart in UDT is:


UDT is currently implemented using C++ and it supports Linux, Windows (2000, XP and above), and OS X. The current version is 3.0 Beta. After you download UDT, please read the "readme" file or the documentation for detailed installation and usage information. Note that if you are using Windows, you will need VC7 to get it compiled. With VC6, you will have to fix several incompatible C++ grammar by yourself.

If you are interested in the project, please refer to this site for more information.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Web Developer
United States United States
No Biography provided

You may also be interested in...


Comments and Discussions

QuestionASP.NET Pin
Volodymyr Sergio Kalinchuk18-Sep-15 3:59
memberVolodymyr Sergio Kalinchuk18-Sep-15 3:59 
Questionerror code 1001 Pin
Member 107820505-May-14 3:11
memberMember 107820505-May-14 3:11 
GeneralMy vote of 5 Pin
Member 432084428-Jun-12 22:47
memberMember 432084428-Jun-12 22:47 
GeneralConnecting to a wireless pc from a pc inside a network trough a server. Pin
lukekando1-Jul-10 3:12
memberlukekando1-Jul-10 3:12 
GeneralRe: Connecting to a wireless pc from a pc inside a network trough a server. Pin
Member 432084428-Jun-12 22:44
memberMember 432084428-Jun-12 22:44 
QuestionDoes anyone know how to port and compile as a module? Pin
hookarm3-Mar-10 3:54
memberhookarm3-Mar-10 3:54 
QuestionUDT::select doesn't work? Pin
thunder5400726-Sep-07 2:31
memberthunder5400726-Sep-07 2:31 
AnswerRe: UDT::select doesn't work? Pin
realscan28-Mar-11 22:58
memberrealscan28-Mar-11 22:58 
NewsHint: UDT v3.3 works good, the UDT-m/UDT v4 did not work well at the moment. Pin
Jens.Schneeweiss17-Jul-07 0:02
memberJens.Schneeweiss17-Jul-07 0:02 
Generalconflict with the Queue and Multithreading Pin
Jens.Schneeweiss16-Jul-07 23:52
memberJens.Schneeweiss16-Jul-07 23:52 
Generalbreaking protocol from applications Pin
Geode8511-Nov-06 3:58
memberGeode8511-Nov-06 3:58 
Questionmultiple UDT sockets Pin
Wee Lio31-Oct-06 19:58
memberWee Lio31-Oct-06 19:58 
QuestionIs UDT Support Punching Firewall/NAT only in Rendezvous mode? Pin
China_Boy31-Aug-06 16:22
memberChina_Boy31-Aug-06 16:22 
QuestionHow to add multiple connection support in Rendezvous mode Pin
Hing17-Jul-06 16:54
memberHing17-Jul-06 16:54 
AnswerRe: How to add multiple connection support in Rendezvous mode Pin
lilyco17-Jul-06 17:12
memberlilyco17-Jul-06 17:12 
QuestionRe: How to add multiple connection support in Rendezvous mode Pin
Hing17-Jul-06 22:22
memberHing17-Jul-06 22:22 
GeneralRedezvous connection again Pin
Hing16-Jul-06 21:36
memberHing16-Jul-06 21:36 
GeneralRe: Redezvous connection again Pin
lilyco17-Jul-06 5:48
memberlilyco17-Jul-06 5:48 
GeneralQuestion on broken client [modified] Pin
Hing12-Jul-06 17:19
memberHing12-Jul-06 17:19 
GeneralRe: Question on broken client Pin
lilyco12-Jul-06 17:47
memberlilyco12-Jul-06 17:47 
GeneralRe: Question on broken client [modified] Pin
Hing12-Jul-06 18:45
memberHing12-Jul-06 18:45 
GeneralRe: Question on broken client Pin
lilyco13-Jul-06 13:17
memberlilyco13-Jul-06 13:17 
GeneralRe: Question on broken client Pin
Hing13-Jul-06 23:21
memberHing13-Jul-06 23:21 
GeneralRe: Question on broken client Pin
lilyco17-Jul-06 5:07
memberlilyco17-Jul-06 5:07 
GeneralQuestion on RENDEZVOUS connection [modified] Pin
Hing9-Jul-06 18:05
memberHing9-Jul-06 18:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web02 | 2.8.180621.3 | Last Updated 22 Mar 2006
Article Copyright 2005 by lilyco
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid