What Is a UDP Port?

by Gareth Downes-Powell

The User Datagram Protocol, or UDP, is a component of the Internet Protocol suite, and used to send short messages to other computers on a local or wide area network. UDP is unreliable, and sent messages may never arrive, arrive twice, or arrive in a different order to that sent. What UDP lacks in reliability, it makes up for in speed, and consequently UDP is often used for time-critical applications.

What is the UDP Protocol?

UDP is a connectionless protocol, so messages are sent out to the receiving computer, but there is no guarantee they will be received, due to errors or corruption on route for example. If the sending computer transmits two messages at the same time, they may arrive at different times, and it is not possible to determine which message will arrive first. Although this does not sound very useful, it works well for time-critical applications where data should be acted on quickly, but if one packet does not reach its destination, it will not cause a problem. Because of the low overhead involved with the UDP protocol, messages can be sent quickly with little processing required.

Comparison to the TCP Protocol

The Transmission Control Protocol is the most commonly used component of the Internet Protocol suite, for use when reliable connections are required. Before two computers can communicate through TCP, they must first complete a handshaking protocol to establish the connection. TCP is a streaming protocol, with messages sent using flow control with error checking and error correction. The receiving computer acknowledges each packet it receives, with the sending computer retransmitting packets that fail to arrive. This guarantees that the messages arrive, and in the correct order, although this comes at the cost of speed, as more processing is required for the correct delivery of messages.

How Is UDP Used?

UDP is used by applications where speed is an important factor, such as online games. For these games, data is sent by the game to its central server and then on to other players computers in real time. As a character moves, the other player's worlds show the new position. As previous positions are irrelevant once a player has moved, it does not matter if datagrams are dropped. If a datagram never arrives, the next datagram is received fast enough for it to make little difference, and the slight delay introduced can be compensated for. DNS uses UDP, as a single request is made followed by a single response, so there is no need for the flow control offered by TCP. Audio and video streaming also rely on the speed of UDP, with compensation for lost data so that only minimal degradation is caused if datagrams are lost in transit.

UDP Ports

Ports exist on a computer to allow connections to and from remote systems. Where as an IP address is similar to a telephone number, allowing traffic to be directed to a particular computer, a port is similar to an extension number, allowing a particular application or service to be reached. Port numbers are 16-bit integers, so can range from zero through to 65,535, with core networking services using ports below 1024. Common ports include TCP port 80 for HTTP traffic, TCP port 25 for sending email through SMTP and UDP port 53 for DNS. A UDP port is simply a port that can receive or transmit using the UDP protocol.

About the Author

Gareth Downes-Powell has been writing since 2000. He has contributed to a number of U.K. magazines, including "Web Designer," and has co-written four IT-related books published by Apress and Wrox. He has also worked as a technical editor on a number of titles for U.K. and U.S. publishers. Downes-Powell attended Thanet Technical College, achieving A-Levels in computer science, math and physics.

Photo Credits

  • photo_camera Thinkstock Images/Comstock/Getty Images