In: Computer Science
Draw a UDP segment, identify its header fields, and provide a brief description for each one of them
User Datagram Protocol (UDP) is a Transport
Layer protocol. UDP is a part of Internet Protocol suite, referred
as UDP/IP suite. Unlike TCP, it is unreliable and
connectionless protocol. So, there is no need to establish
connection prior to data transfer. Though Transmission Control
Protocol (TCP) is the dominant transport layer protocol used with
most of Internet services; provides assured delivery, reliability
and much more but all these services cost us with additional
overhead and latency. Here, UDP comes into picture. For the
realtime services like computer gaming, voice or video
communication, live conferences; we need UDP. Since high
performance is needed, UDP permits packets to be dropped instead of
processing delayed packets. There is no error checking in UDP, so
it also save bandwidth.
User Datagram Protocol (UDP) is more efficient in terms of both
latency and bandwidth.
UDP header
UDP is a simple, datagram-oriented, transport layer protocol: each output operation by a process produces exactly one UDP datagram, which causes one IP datagram to be sent. The encapsulation of a UDP datagram as an IP datagram looks like this:
UDP Header Format -
..............................................................................................................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................................................................................................
A user datagram consists of two parts: a UDP Header and a UDP data area. The header is divided in four 16-bit fields as shown:
Source and Destination Port
The port numbers identify the sending process and the receiving process. TCP and UDP use the destination port number to demultiplex incoming data from IP. Since IP has already demultiplexed the incoming IP datagram to either TCP or UDP (based on the protocol value in the IP header), this means the TCP port numbers are looked at by TCP, and the UDP port numbers by UDP. The TCP port numbers are independent of the UDP port numbers.
Length
The length in bytes of the UDP header and the encapsulated data. The minimum value for this field is 8.
Checksum
This is computed as the 16-bit one's complement of the one's complement sum of a pseudo header of information from the IP header, the UDP header, and the data, padded as needed with zero bytes at the end to make a multiple of two bytes. If the checksum is set to zero, then checksuming is disabled. The designers chose to make the checksum optional to allow implementations to operate with little computational overhead. If the computed checksum is zero, then this field must be set to 0xFFFF.