Subscribe to Windows IT Pro
October 13, 2003 12:00 AM

UDP vs. TCP

Windows IT Pro
InstantDoc ID #40315
Rating: (6)

Most programs use either UDP or TCP for communications. TCP is the more sophisticated of the two protocols, providing reliable, connection-oriented delivery. First, TCP ensures that the receiving computer is ready to accept data. It uses a three-packet handshake in which both the sender and receive agree that they are ready to communicate. To do so, a TCP packet uses packet state flags to let each host communicate the current state (i.e., beginning, ending, ongoing) of transmission. (TCP traffic is stateful.) Second, TCP makes sure that data gets to its destination. If the receiver doesn't acknowledge a particular packet, TCP automatically retransmits the packet—typically three times. If necessary, TCP can also split large packets into smaller sizes so that data can travel reliably between source and destination. TCP drops duplicate packets and rearranges packets that arrive out of sequence.

UDP, which isn't connection-oriented, is more appropriate for sending limited amounts of data per packet. UDP has no self-checking mechanism to ensure that data is received or received in order. However, the application that uses UDP will often perform that check, so the application can send a request to the source computer to retransmit missing information. UDP is also stateless; therefore, UDP offers no setup handshake and a UDP packet doesn't have state flags.

Some programs use both UDP and TCP. For example, a RealNetworks RealAudio server uses port TCP 7070 to initiate a download connection to a RealAudio Player client. After the session is established, the RealAudio server streams the data over UDP ports 6970 through 7170. In another example, Microsoft DNS uses UDP 53 for communication between DNS servers. If one DNS server establishes that the other DNS server is also a Microsoft DNS server, it might decide to switch the network connection to 53 TCP so that it can send larger amounts of domain naming data.

Related Content:

ARTICLE TOOLS

Comments
  • Anonymous User
    7 years ago
    Sep 08, 2005

    Short and simple, thanks!

  • Anonymous User
    7 years ago
    Apr 09, 2005

    http://www.mindcontrol.org/~hplus/udp-vs-tcp.html

    Same topic, same length, but from UDP prespective, a very good compliment to this article.

    www.gamingaffinity.com

  • Anonymous User
    7 years ago
    Mar 02, 2005

    thanks

  • Anonymous User
    8 years ago
    Dec 27, 2004

    Very concise and useful! 5 out of 5!

  • Anonymous User
    8 years ago
    Nov 23, 2004

    UDP would be most suitable for real time applications such as video conferencing since congestion control, as in TCP,would be damaging for such applications !!

You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.