Transcript Lect04
User Datagram Protocol (UDP)
• Another protocol at transport layer is UDP.
• It is Connectionless protocol i.e. no need to
establish & terminate connection.
• UDP delivers independent messages, called
datagrams between applications or processes on
host computers end-to-end protocol.
• Message-oriented: An application using UDP
sends and receives individual message. UDP does
not divide a message into packets. Message must
fit datagram.
TCP/IP: Basics
1
User Datagram Protocol (UDP)
• Each datagram is independent of others.
• Each UDP message has the IP address and port
number of the destination and the source of the
message. IP addresses may be omitted.
• UDP provides no sequencing, i.e., individual
messages are not numbered.
• As a result datagrams may arrive out of sequence.
• There is no mechanism for reliability.
TCP/IP: Basics
2
User Datagram Protocol (UDP)
• Used in applications where speed is more
important than reliability for example voice and
video transmission.
• Can not be used for data communication like files
and messages. TCP is used.
TCP/IP: Basics
3
User Datagram Protocol (UDP)
• For generality, endpoints of UDP are called
protocol ports or ports.
• ''Best effort'' delivery - datagrams may be lost,
delivered out of order, etc.
TCP/IP: Basics
4
UDP & TCP: Layering
• Both TCP and UDP use IP to provide data
delivery for application protocols
Application
Transport: UDP, TCP
Internet (IP)
Network Interface
Hardware
TCP/IP: Basics
5
UDP Headers
• UDP datagrams have a header that follows the
hardware and IP headers:
Hardware IP UDP Application Data
• UDP header is very simple: Has Port numbers,
Message length, Checksum
TCP/IP: Basics
6
UDP Headers
UDP Source port
UDP Destination port
UDP Message Length UDP Checksum
Data
TCP/IP: Basics
7
Selecting UDP port numbers
• Communicating computers must agree on a port
number – fixed beforehand.
– ''Server'' opens selected port and waits for incoming
messages
– ''Client'' selects local port and sends message to selected
port
• Services provided by many computers use
reserved, well-known port numbers: e.g. ECHO.
• Other services use dynamically assigned port
numbers.
TCP/IP: Basics
8
Well-Known Port Numbers
Port
Name
Description
7
echo
Echo input back to sender
9
discard
Discard input
11
systat
System statistics
13
daytime
Time of day (ASCII)
17
quote
Quote of the day
19
chargen
Character generator
37
time
System time (seconds since 1970)
53
domain
DNS
69
tftp
Trivial File Transfer Protocol (TFTP)
123
ntp
Network Time Protocol (NTP)
161
snmp
Simple Network Management
Protocol (SNMP)
TCP/IP: Basics
9