What is UDP Datagram Format in computer networks?

The User Datagram Protocol (UDP) is a transport layer protocol defined for use with the IP network layer protocol. UDP does not provide any reliability.


Let us see the explanation of UDP in a stepwise manner.

Step 1 − For example, it does not transmit any lost packets. Often, this is the main reason to consider UDP as a transport.

Step 2 − Applications that do require reliable message delivery therefore need to implement appropriate protocol mechanisms in their application.

Step 3 − UDP's best effort service does not protect against datagram duplication i.e an application may receive multiple copies of UDP datagram.

Step 4 − Application designers therefore need to verify that their application gracefully handles datagram duplication and may need to implement a mechanism to detect duplicates.

Step 5 − The internet may also significantly delay some packets with respect to others example, due to routing transient, intermittent connectivity, or mobility. This can cause reordering, where UDP datagrams arrive at the receiver an order different from the transmission order. Applications that require ordered delivery must restore datagram ordering themselves.

The UDP datagram has 8-byte header which is shown below −

Source PortDestination Port
LengthCheck Sum

UDP Header Fields

The UDP header fields are as follows −

  • UDP Destination Port − Identifies the destination process.

  • UDP Source Port − It is optional and identifies the source process for replies or zero.

  • Message Length − The length of datagram in bytes, including header and data.

  • Checksum − It is optional with -- 16-bit checksum over header and data, or zero.

Characteristics and Importance of UDP

The important characteristics and importance of UDP are explained below −

  • UDP offers Low Functionality with high Performance.

  • UDP is optimal for Rate based small packet transfers.

  • UDP supports high throughput.

  • UDP can send small, inefficient datagrams.

  • UDP chosen for unreliable application services which must accept or deal with Packet loss due to overflows and errors and Out-of-order datagrams.

  • UDP supports Multicast and broadcast, and it is supported only by UDP.

  • UDP datagrams supports Data size up to IP MTU (64KB)

  • UDP is very useful in Application-level framing where data may be received and read by applications in different units than how it was sent.

  • UDP Supports HTTP, FTP, TELNET, POP, Remote WHO NFS and other imp protocols and services.