Section 8.3. User Datagram Protocol (UDP)


8.3. User Datagram Protocol (UDP)

The user datagram protocol (UDP) is another transport-layer protocol that is placed on top of the network layer. UDP is a connectionless protocol, as no handshaking between sending and receiving points occurs before sending a segment. UDP does not provide a reliable service. The enhancement provided by UDP over IP is its ability to check the integrity of flowing packets. IP is capable of delivering a packet to its destination but stops delivering them to an application. UDP fills this gap by providing a mechanism to differentiate among multiple applications and deliver a packet to the desired application. UDP can perform error detection to a certain extent but not to the level that TCP can.

8.3.1. UDP Segment

The format of the UDP segment is shown in Figure 8.4. The segment starts with the source port , followed by the destination port . These port numbers are used to identify the ports of applications at the source or the destination, respectively. The source port identifies the application that is sending the data. The destination port helps UDP to demultiplex the packet and directs it to the right application. The UDP length field indicates the length of the UDP segment, including both the header and the data. UDP checksum specifies the computed checksum when transmitting the packet from the host. If no checksum is computed, this field contains all zeroes. When this segment is received at the destination, the checksum is computed; if there is an error, the packet is discarded.

Figure 8.4. User datagram protocol segment

UDP takes messages from the application process, attaches source and destination port number fields and two other fields, and makes this segment available to the network layer. The network layer encapsulates the segment into an IP datagram (packet) and finds the best path to deliver the segment to the other end host.

8.3.2. Applications of TCP and UDP

Although TCP provides a reliable service and UDP does not, many applications fit better in the communication system by using UDP, for the following reasons:

  • Faster delivery of the application object. TCP is equipped with congestion-control mechanism and requires the guarantee of data delivery at any timing cost. This may not be well suited for real-time applications.

  • Support for a larger number of active clients . TCP maintains connection state and does track connection parameters. Therefore, a server designated to a particular application supports fewer active clients when the application runs over TCP rather than over UDP.

  • Smaller segment header overhead. UDP has only 8 bytes of overhead, whereas the TCP segment has 20 bytes of header.

The first category includes such applications as e-mail, the Web, remote terminal access , and file transfer . These applications run over TCP, as they all require reliable data-transfer service. The second category of applications, including DNS , RIP routing table updates , and SNMP network management, run over UDP rather than over TCP. For example, RIP updates are transmitted periodically, and reliability may not be an issue, as a more recent update can always replace a lost one.



Computer and Communication Networks
Computer and Communication Networks (paperback)
ISBN: 0131389106
EAN: 2147483647
Year: 2007
Pages: 211
Authors: Nader F. Mir

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net