User Datagram Protocol (UDP)
- unreliable, unordered delivery between 2 processes (transaction-oriented, stateless)
- no-frills extension of “best-effort” IP
- segments may be: lost or delivered out-of order to app
- connectionless:
- no handshaking between UDP sender, receiver
- each UDP segment handled independently of others
- does not provide: reliability, flow control, congestion control, timing throughput guarantee, security, or connection setup.
Why bother? Why is there a UDP?
- no connection establishment (which can add RTT delay)
- simple: no connection state at sender, receiver
- small header size
- no congestion control
- UDP can blast away as fast as desired!
- can function in the face of congestion
UDP vs TCP:
Connectionless transport
UDP: User Datagram Protocol
- UDP use:
- streaming multimedia apps (loss tolerant, rate sensitive)
- DNS
- SNMP (management protocol)
- HTTP/3
- if reliable transfer needed over UDP (e.g., HTTP/3)
- add needed reliability at application layer
- add congestion control at application layer
UDP segment header:
UDP Transport Layer Actions
UDP checksum
Goal: detect errors (i.e., flipped bits) in transmitted segment
sender:
- treat contents of UDP segment (including UDP header fields and IP addresses) as sequence of 16-bit integers
- checksum: addition (one’s complement sum) of segment content (2 sequences of 16 bits at a time)
- checksum value put into UDP checksum field
receiver:
- compute the sum of all 16-bit integers incl. checksum
- check if computed checksum equals 1111111111111111:
- Not equal - error detected
- Equal - no error detected. But maybe errors nonetheless??
Summary: UDP
- “no frills” protocol
- segments may be lost, delivered out of order
- best effort service: “send and hope for the best”
- UDP has its plusses:
- no setup/handshaking needed (no RTT incurred)
- Some (limited) help with reliability (checksum)
- build additional functionality on top of UDP in application layer (e.g., HTTP/3)