0% found this document useful (0 votes)
10 views

Ch11-User Datagram Protocol

Uploaded by

sachaniajay26
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Ch11-User Datagram Protocol

Uploaded by

sachaniajay26
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

User Datagram Protocol (UDP)

LESSON 11

Lesson 11 - (1 of 31)
Outline:
User Datagram Protocol (UDP)
• Identifying Multiple • Multiplexing,
Destinations within a Host Demultiplexing, and Ports
• User Datagram • UDP Input and Output
Protocol (UDP) • UDP Port Numbers
• UDP Message Format
• UDP Pseudo-Header • TCP/IP Protocol Tracing:
• Conceptual Layering – ARP
• UDP Encapsulation – IP
• UDP / IP Integration – DNS

Lesson 11 - (2 of 31)
Identifying Multiple
Destinations within a Host:
• Software and communication protocols provide a
mechanism that distinguishes among multiple
destinations within a given host.
• Often, this mechanism is used to support transport
services for multiple applications.
• The ultimate destination in a host is not a process,
but a software Port.

Lesson 11 - (3 of 31)
Identifying Multiple
Destinations within a Host:
• Software Ports:
– A set of abstract destinations points called
protocol ports are identified by positive integer
values and controlled by the local operating
system.
• Ports are usually allocated by an operating system
to an application in the form of memory blocks,
accessed by specific data structures..

Lesson 11 - (4 of 31)
Identifying Multiple
Destinations within a Host:
• Packets arriving from the IP layer, destined for a
particular port, are enqueued within a buffer.
• Protocol ports also use outgoing queues to store
messages being sent from an application program.
• To send and receive, we need to know the source
and destination port numbers. Both are always
sent in each message.

Lesson 11 - (5 of 31)
User Datagram
Protocol (UDP):
• User Datagram Protocol (UDP):
– A connectionless, unreliable delivery service
using the IP protocol for its message transport.
– UDP distinguishes among multiple destinations
in a host, but sends no acknowledgments
(ACKs).

Lesson 11 - (6 of 31)
User Datagram
Protocol (UDP):
• Applications using UDP must handle all problems
to ensure reliable transfer. They must deal with:
– Duplicate messages.
– Lost messages.
– Delayed and Out-of-Order delivery.
• UDP is good for delay-sensitive traffic such as
video and voice since no acknowledgment or
retransmission features are used.

Lesson 11 - (7 of 31)
UDP Message Format:

• UDP messages (called user datagrams) have two


distinct parts:
– UDP Headers
– UDP Data area
• The header is always a fixed size of 4 octets,
which specifies (in part) the source and destination
protocol ports.

Lesson 11 - (8 of 31)
UDP Message Format:

0 16 31

UDP SOURCE PORT UDP DESTINATION PORT

UDP MESSAGE LENGTH UDP CHECKSUM

DATA

...

Lesson 11 - (9 of 31)
UDP Message Format:

• SOURCE PORT (16-bits):


– UDP protocol port number which specifies
where replies should be sent (optional = 0).
• DESTINATION PORT (16-bits):
– Required protocol port number to demultiplex
datagrams among waiting processes.

Lesson 11 - (10 of 31)


UDP Message Format:

• MESSAGE LENGTH (16-bits):


– The count of octets in the UDP datagram,
which includes the header and data areas.
Minimum length = 8 (length of only the
header).
• CHECKSUM (16-bits):
– The optional checksum is usually used since IP
does not compute any checksum on carried
data. Set to zero if not used.
Lesson 11 - (11 of 31)
UDP Pseudo-Header:

• UDP Pseudo-Header:
– Used to verify that the UDP datagram has
reached it’s correct destination (since UDP
headers only use port numbers).
• A checksum is computed over the pseudo-header,
UDP-header, and the data area before sending the
user datagram.

Lesson 11 - (12 of 31)


UDP Pseudo-Header:

0 8 16 31
SOURCE IP ADDRESS
DESTINATION IP ADDRESS
PADDING PROTOCOL UDP LENGTH

Lesson 11 - (13 of 31)


UDP Pseudo-Header:

• The twelve octets of the pseudo-header include the


fields:
– Source IP address (4-octets).
– Destination IP address (4-octets).
– Padding field filled with zeros (1-octet).
– Protocol Type (1-octet), UDP = 17.

Lesson 11 - (14 of 31)


UDP Pseudo-Header:

– UDP Length (2-octets)


• Length of the UDP datagram without the
pseudo-header.
• These values are extracted from the IP datagram
header, then the checksum is recomputed (using
this pseudo-header).
• ? Is there a problem with this scenario ?

Lesson 11 - (15 of 31)


Conceptual Layering:

Application Layer
User Datagram Protocol (UDP)
Internet Protocol (IP)
Network Interface and Hardware

Lesson 11 - (16 of 31)


UDP Encapsulation:

• UDP Encapsulation - [lowest layer to higher


layers] involves stripping off the headers at each
appropriate level.

• Outermost header - lowest layer protocol.


• Innermost header - highest protocol layer.

Lesson 11 - (17 of 31)


UDP
HEADER UDP DATA AREA

IP IP DATA AREA
HEADER

FRAME
FRAME DATA AREA
HEADER

Lesson 11 - (18 of 31)


UDP Encapsulation:

• Important distinction:
– IP Layer - transferring of data between a pair of
hosts on the Internet (only responsibility).
– UDP Layer - differentiating among multiple
sources or destinations within one host only
(same for TCP as well).

Lesson 11 - (19 of 31)


UDP / IP Integration:

• UDP is tightly integrated with the IP protocol:


– This is practical.
– Produces greater efficiency.
• However, the tight integration violates our
layering abstraction and the independents of
functionality that each layer provides.

Lesson 11 - (20 of 31)


UDP / IP Integration:

• ? How does it violate the layering abstraction?


– The UDP layer encapsulates UDP messages
within an IP datagram.
– It fills in the source and destination IP header
fields.
– It computes the UDP checksum.
– It then passes the IP datagram to the IP layer,
which fills in the rest of the header fields.

Lesson 11 - (21 of 31)


Multiplexing, Demultiplexing,
and Ports:
• Applications negotiate with the operating system
to obtain a protocol port and the port number.
• UDP multiplexes application output from the
various protocol ports.
• It also demultiplexes input from the network
connection, to the appropriate receiving ports.

Lesson 11 - (22 of 31)


Port 1 Port 2 Port 3

UDP : Demultiplexing
Based On Port

UDP Datagram arrives

IP Layer

Lesson 11 - (23 of 31)


Multiplexing, Demultiplexing,
and Ports:
• Receiving packets to send to a port are:
– Normally placed in the active port’s queue.
– Dropped if the port’s queue is full.
• If the destination port is currently not in use, an
ICMP port unreachable error message is sent and
the packet is dropped.

Lesson 11 - (24 of 31)


UDP Input and Output:

• UDP does not have complex input and output


modules since it is connectionless.
• It does however have separate modules to handle
the processing required in each, as well as input
and output queues.

Lesson 11 - (25 of 31)


UDP input

application programs
operating system ports for
UDP
datagrams

TCP Input
Process

Lesson 11 - (26 of 31)


TCP output application programs UDP
operating system output

Control
messages

port for TCP output

TCP TCP
queue for datagrams
Timer Process sent to IP

Lesson 11 - (27 of 31)


UDP Port Numbers:

• ? How do we assign protocol port numbers ?


• Two fundamental approaches:
– Dynamic Port Binding:
• Large integer values are used to dynamically
assign a protocol port number (network
software performs the assignment).

Lesson 11 - (28 of 31)


UDP Port Numbers:

– Universal Assignment:
• Everyone agrees on allowing a central
authority to assign and publish port numbers
(software is built around
well-known port assignments).

Lesson 11 - (29 of 31)


UDP Port Numbers:

• TCP/IP takes a hybrid approach to port


assignment where it:
– Assigns lower-valued port numbers to priori
applications
– Allows the higher-valued port numbers to be
used by local sites or application programs.

Lesson 11 - (30 of 31)


UDP Port Numbers:

• ? How do we know which port to use when


requesting an application service?
– Send a port-service request message to the
destination.
– It responds by providing the appropriate
protocol port in which to send packets to.

Lesson 11 - (31 of 31)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy