User Datagram Protocol (UDP) is a transport layer protocol

  • Bare minimum transport protocol
  • “Best effort” service, UDP segments may be lost or delivered out of order
  • Connectionless:
    • No handshaking between UDP client and server
    • Each UDP segment handled independently of others
  • Datagram messaging service
    • Multiplexing based on port numbers
    • Detects corruption using checksum
  • To achieve reliable transfer over UDP, add reliability at application layer
    • Application-specific error recovery

Uses for UDP:

  • Streaming multimedia apps
  • Simple query-response protocols:

Advantages of UDP

  • Fine-grained control: UDP sends as soon as the application writes
  • No connection set-up delay
  • No connection state: No buffers, parameters, sequence numbers, etc.
  • Small header overhead: UDP header only 8 bytes

What does UDP provide over IP?

  • Checksum
  • Multiplexing based on port number

Checksum

Goal: detect “flipped bits” in transmitted segment

To compute:

  • Treat segment contents as sequence of 16-bit numbers
  • Checksum is 1’s complement sum of segment contents

Receiver checks if computed checksum equals checksum field value