UDP – User Datagram Protocol

By | July 10, 2009

UDP is used by the network applications to transfer data between two computers. It is one of the core protocols in the protocol suite. UDP is sometimes called the Universal Datagram Protocol. Mostly the client Server application use UDP, for example : Video conferencing systems. Though UDP has many more challenging alternatives, it remains a viable technology

osi_transport

UDP is transport layer protocol as TCP is. Its main purpose is to abstract traffic in the form of datagrams. A datagram consists of  a unit binary data, first 8 bytes of a datagram consists of the header information and the remaining is the data.

UDP uses the simple model for transmission without handshaking method. Handshaking provides reliability, ordering or data integrity. As a result UDP is an unreliable service, datagrams reach the destination in an unordered way, duplicated or can be missing. UDP doesn’t rely on the error checking and correction techniques. UDP is not used by the time sensitive applications. It is compatible with the packet broadcast and multicast.

UDP applications use datagram sockets to establish host-to-host communications. Sockets bind the application to service ports, which function as the endpoints of data transmission.

UDP Packet structure:

Packet structure consists of 4 fields. In this two of the fields are optional.(Source port and checksum)

UDP Format

Source port: This field identifies the port from where the data was sent. If not used then it should be Zero(0).

Destination Port: This port identifies the destination port.

UDP Length : This is 16 bit field which specifies the length of the entire datagram in bytes. The minimum is 8 bytes.

Checksum: This is 16 bit field used for checksum and error checking function.