UDP - User Datagram Protocol
UDP - User Datagram Protocol
UDP
indigoo.com
PETER R. EGLI
INDIGOO.COM
1/7
Rev. 3.50
indigoo.com
Contents
1. UDP (RFC768) characteristics
2. UDP Service
3. Typical UDP applications
4. UDP Checksum
5. UDP versus TCP
2/7
Rev. 3.50
indigoo.com
Host 2
1
1
Host 1 sends
packets.
Packet 1 is stored
in the receive queue.
2
1
Packet 2 is stored
in the receive queue.
3
2
1
Packet 3 is stored
in the receive queue.
3
2
1
5
3
2
Packet 4 is
dropped (buffer
overrun).
Packet 1 is sent
to the application.
1
indigoo.com
Appl.
300
Application
reads packets
(APDUs)
from the
socket
interface
Application
sends packets
(APDUs) over
the socket
interface
2500
500
150
150
500
2500
300
Socket interface
UDP layer
UDP layer
300
150
2500
TPDUs
(UDP datagrams)
500
150
TPDUs
(UDP datagrams)
IP layer
2500
300
300
500
IP layer
1000
1500
500
150
IP packets
4/7
Rev. 3.50
indigoo.com
UDP is best suited for applications with short command-response type transactions
that do not justify the establishment / release prior to the data exchange.
Host 1
SNMP
Host 2
Host 1
DHCP/Bootp
Host 2
Host 1
RADIUS
RADIUS Access Request
SNTP
Host 2
Time request
Time response
Host 2
Host 1
RIP
Host 2
DHCP Response
RPC
Host 1
DNS Response
DHCP Request
Host 1
Host 2
DNS Query
Host 1
DNS
Host 2
RPC Request
RPC Reply
5/7
Rev. 3.50
indigoo.com
UDP has a checksum too that provides minimal protection against transmission errors.
The checksum is optional; if it is not used it shall be set to 0.
Becaus the IP addresses are used in the UDP checksum calculation,
UDP is tightly bound to the IP layer. Therefore UDP can only run on top of IP.
IP Source Address
Pseudo
header
IP Destination Address
The checksum is
calculated over
the pseudo header,
UDP header and
data (UDP payload).
00000000
Protocol=17
UDP
Length
UDP Length
Source Port
Destination Port
Checksum
Length
UDP
header
Data
6/7
Rev. 3.50
indigoo.com
UDP
Connection-less, best-effort
Reliable end-to-end:
No bit errors due to checksum.
Packet ordering preserved.
No duplicates.
No packet loss.
No flow control
No congestion control
Analogon: phone
N.B.: It is possible to run application protocols over both TCP and UDP. E.g. DNS is normally run on UDP, but
for zone transfers (higher data volume) DNS uses TCP. Actually there is a shift towards using TCP instead
UDP since TCP can better provide security (SSL/TLS, simpler filtering in firewalls etc.).
Peter R. Egli 2015
7/7
Rev. 3.50