User
Datagram
Protocol
(UDP)
UDP
User Datagram Protocol (UDP)
Telematics Engineering
Universitat Politecnica de Catalunya (UPC)
1/9
User
Datagram
Protocol
(UDP)
Outline
UDP
1 UDP
2/9
User
Datagram
Protocol
(UDP)
UDP I
User Datagram Protocol (RFC 768).
UDP
Datagram transfer between processes.
It is considered an extension of IP.
UDP = IP + Mux / Demux.
best effort type:
Unreliable: UDP messages may get lost or corrupted.
No connection-oriented: no establishment or release of
the connection.
3/9
User
Datagram
Protocol
(UDP)
UDP
UDP II
Doesnt offer:
Flow Control: The messages can overflow in the
receiver.
Congestion Control: Messages can collapse the
network.
Sequencing: No datagram numbering.
Error Control: no recognition, neither positive nor
negative (but discards).
UDP service is message-oriented:
Delivers the message or not.
If the UDP message is larger than the MTU,
fragmentation is performed at IP level.
Used by many services based on request / response.
Largest UDP message size: 216 1 20 8 = 65,507
4/9
User
Datagram
Protocol
(UDP)
UDP III
UDP
Advantages:
No delay due to connection establishment.
Simple transmitters and receivers.
It uses minimal system resources in terms of memory
and CPU.
Adds a small header (8 bytes).
It does not use any congestion control mechanism.
Data flows can follow time patterns more flexible and
adaptable.
5/9
User
Datagram
Protocol
(UDP)
UDP Aplications
UDP
The reliability problems are left to the application layer:
loss, disorder, duplication, delays, etc.
Applications that want to avoid these problems use
TCP.
Some applications do not require reliability in the way
that TCP offers it.
Typical applications:
Real-time voice/video
Request/response DNS.
Multicast Applications (not available in TCP).
6/9
User
Datagram
Protocol
(UDP)
UDP Ports
UDP
UDP ports are an independent set to TCP ports.
The port ID is 16 bits length.
The destination port identifies the receiving application.
The source port is optional.
If unused, it is set to zero.
If a reply is required, it is usually dynamically assigned
(ephemeral ports).
Typically above 1024.
7/9
User
Datagram
Protocol
(UDP)
UDP Datagram
UDP
UDP Length:
Includes header and data (in bytes).
Minimum value is 8, which is the minimum header
length.
8/9
User
Datagram
Protocol
(UDP)
UDP
Checksum
UDP checksum:
Optional. If unused, it is set to 0.
Checks the integrity of the header, data, and routing.
Is a Pseudo-header parameter: the receiver can make
sure that no routing errors occurred.
If wrong segment: discarded silently.
9/9