UDP (User Datagram Protocol)
UDP is a connectionless, unreliable transport layer protocol, simple, with limited error checking and minimum overhead.
User Datagram : UDP packets, 8 bytes of header. Format of user datagram:-
1. Source port number (16 bit) 2. Destination port number (16 bit)
3. Length (Header+Data: 16 bit). UDP length = IP length - IP header length, as UDP datagram is encapsulated in IP datagram. 4. Checksum. Checksum is the only error checking mechanism in UDP. If packets are lost/duplicated, there is no mechanism, if it is corrupted, and detected by checksum, packet is silently discarded (no acknowledgement sent).
Queues: Both clients and servers have incoming and outgoing queues. If a message arrives and the incoming queue is not created, or is already full, then the UDP sends Port Unreachable message to sender.
Use of UDP - processes that require simple request-response communication with no error or flow control requirements, example - FTP that needs to send bulk data, processes with internal flow and error control mechanism, example - TFTP, multicasting, management processes, example SNMP, route updating protocols, example RIP (Routing Information Protocol).