- The User Datagram Protocol(UDP) is a connectionless , unreliable transport protocol.
- There is no concept of numbering of data, or acknowledgement and no connection is established or being terminated. Hence each of the user datagram can take a different path to reach to to the destination.
- There is no retransmission of user datagram, in case of loss or damage.
- UDP packets are called user datagram.
UDP Header: UDP header is very simple and its just 8 bytes, each field of length 2 bytes unlike TCP, which is minimum of 20 bytes.

- Source and destination port number: Each application is associated with a port number, so once the packet the transport layer, to which application it should go is determined by the port number. Here we have 2 bytes of each source and destination port.
- If the port number in the header does not match with any of the application, it sends port unreachable message back to sender.
Length field: This is of 2 bytes and computes the total length that is sum of data + UDP header.
Checksum:
- This is used for testing the integrity of the message, while it traverses the network and reaches the destination.
- It is computed in the same manner as that of TCP, that is on IP pseudo Header, data message and UDP header and placed in the UDP header and same calculation is even done at the receiver side, if it happens to be different, it is simply discarded.
- This pseudo header includes: 16 bit UDP length, Source and destination IP address, protocol field and fixed of 8 bits(set to Zero).
- These fields are just used in computing checksum, they are not transported.
UDP operations:
- A port number is associated with each application/process.
- And with each process, there are two queue associated, called incoming and outgoing queues.
- The queues are destroyed when the process terminates.

Client Side Queues:
- The client requests a port number from the operating system.
- The process opens incoming and outgoing queue with the requested port number.
Server Side Queues:
The server also asks for incoming and outgoing queue using its well-known port number.
UDP multiplexing and demultiplexing:

Multiplexing:
- It is many to one relationship at the sender side that is multiple process that need to send user datagram.
- UDP accepts messages from many process running on different port and UDP header to it and sends down to IP layer.
- Demultiplexing: This is one to many relationship on the receiver side that is UDP receives data user datagram from IP.
- And then checks error using checksum, drops the UDP header and sends it to the application based on the port number.
Categories: Networking
Leave a Reply