Brendan Ang

Search

Search IconIcon to open search

User Datagram Protocol

Last updated Nov 8, 2022 Edit Source

# User Datagram Protocol (UDP)

UDP is a barebones transport protocol. Aside from the multiplexing/demultiplexing function and some light error checking, it adds nothing to IP. Sending:

[!Non services]

  1. There is no handshaking between sending and receiving transport layer entities and hence UDP is said to be connectionless. This also means no handshake delay!
  2. No connection state tracking. This means more active clients on UDP than TCP
  3. No congestion control.
  4. Small header size. Less overhead

# UDP Segment

Datagram: packets delivered via an unreliable service, without delivery guarantees and no failure notifications.

UDP encapsulates user messages into its own packet structure on top of the Internet Protocol:

# UDP Checksum

Sender: Perform a 1s complement sum of all the 16 bit words in the UDP segment, with overflow being wrapped around. Receiver: Sum all the 16 bit words including the checksum, the result should be 16 1s, else an error is detected. Note: this checksum is optional

# Stateless

Each datagram is carried in a single IP packet with no support for bytestreams. Hence each read will yield the full message and datagrams are not fragmented.

# Problems

Each connection relies upon Network Address Translation. Translation tables rely on the connection state in order to create and remove entries as needed, but UDP does not have any processes to define its state (no handshake, no termination sequence).

One solution: UDP routing records are expired on a timer.