User Datagram Protocol (UDP) is one of the core members of the Internet Protocol Suite. It is a layer 4 protocol according the OSI 7 layer model. The protocol was designed in 1980 and is defined in RFC 768. UDP packets are officially called Datagrams.
UDP uses what you might think of as the ‘send and pray’ method, more correctly call connectionless. The sender does not receive acknowledgements from the receiver (sometimes called handshaking) and thus it exposes the user’s program to any unreliability of the underlying network protocol – there is no guarantee of delivery, ordering, or duplicate protection.
UDP provides checksums for data integrity. The data in the packet is added up at the sender and the result put in the header. The maths is repeated at the receiver, and if the receiver detects a checksum error it will ignore the packet.
UDP supports port numbers which mark, in the packet header, the packet as coming from a particular application (or function within an application) so the receiver what to pass it to.
With UDP, applications can send messages, called datagrams, to other hosts on an IP network without prior communications to set up special transmission channels or data paths.
Because it has no error correction or handshaking it is fast.
It is good for video and audio where dropping packets is better than waiting for delayed packets.
See TCP, IP






