User Datagram Protocol UDP - PowerPoint PPT Presentation

1 / 23
About This Presentation
Title:

User Datagram Protocol UDP

Description:

Imagine each machine has a set of protocol ports. Each port identified by a ... Testing is usually done in controlled, reliable LANs ... Only datagram gets sent ... – PowerPoint PPT presentation

Number of Views:108
Avg rating:3.0/5.0
Slides: 24
Provided by: ValuedGate2204
Category:

less

Transcript and Presenter's Notes

Title: User Datagram Protocol UDP


1
User Datagram Protocol (UDP)
  • Chapter 11

2
  • Know TCP/IP transfers datagrams around
  • Forwarded based on destinations IP address
  • At IP layer, destination address identifies host
  • Made no further distinction about which
    application on the host gets the datagram
  • This chapter extends TCP/IP protocol suite
  • Adds mechanism to distinguish among hosts
  • Multiple applications on a given computer can
    send and receive datagrams independently

3
The Ultimate Destination
  • Most OSs support multiprogramming
  • Multiple applications execute simultaneously
  • In OS terms, each executing program is a process,
    task, application program, or user level process
  • Systems are called multitasking systems

4
  • Is a process the ultimate destination?
  • Seems natural but is a bit misleading
  • Processes are created and destroyed dynamically
  • Want to replace processes without notifying
    senders
  • Want to identify destinations by function
  • Not by process that implements them
  • Single process may handle multiple functions
  • Want process to decide which function the sender
    wants
  • So, we will abstract the problem
  • Imagine each machine has a set of protocol ports
  • Each port identified by a positive integer
  • Local OS provides means to specify or access a
    port

5
  • Most OSs provide synchronous port access
  • Computation stops during port access operation
  • Block process extracting data if no data there
  • Most ports are buffered
  • Puts waiting data in a finite queue
  • To communicate with a foreign port
  • Sender must know IP address protocol port
  • Messages must carry
  • Destination port on the machine receiving the msg
  • Source port on the machine sending the msg

6
User Datagram Protocol (UDP)
  • Provides primary mechanism for application
    programs to swap datagrams
  • Provides protocol ports to distinguish among
    multiple executing programs
  • Uses IP to transport messages between machines
  • Provides same unreliable, connectionless image
  • No acknowledgements no ordering of incoming msgs
  • No feedback for rate control can lose messages

7
  • Application programs have full responsibility
    for
  • Reliability
  • Message loss
  • Duplication
  • Out-of-order delivery
  • Loss of connectivity
  • Unfortunately, most application programmers
    ignore this responsibility
  • Testing is usually done in controlled, reliable
    LANs
  • Fail dramatically when used in TCP/IP internet

8
Format of UDP Messages
  • Each UDP message is a user datagram
  • Has a header and data area

9
UDP Pseudo-Header
  • Checksum can cover data in datagram
  • Need to ensure more than that
  • Datagram only has protocol port number
  • Correct destination includes specific machine
  • Want to compute checksum on destination IP as
    well as UDP datagram
  • Constructs pseudo-header and includes in checksum
    computation

10
Pseudo-header
UDP datagram
  • Sender computes checksum over pseudo-header and
    datagram
  • Only datagram gets sent
  • Receiver reconstructs pseudo-header by extracting
    fields from the IP header

11
UDP Encapsulation Protocol Layering
  • UDP is our first transport protocol example

12
  • Layering above UDP means complete UDP message
    (header and data) is encapsulated in an IP
    datagram
  • UDP datagram in IP datagram data area
  • IP datagram in frame data area
  • Layering provides division of duties
  • IP layer identifies source destination hosts
  • UDP layer identifies source or destination ports
    within a host

13
Figure 11.4
14
Layering UDP Checksum
  • Violation of layering rules with checksum
  • Pseudo-header needs source dest IP address
  • UDP must interact with IP layer to get these
  • Regardless of method, still interacts
  • Violates separation of functionality by layering
  • UDP is tightly integrated with IP
  • Compromise made for practical reasons

15
UDP Multiplexing, Demultiplexing, Ports
  • Thru the layers, SW must mux and demux among
    multiple objects at next layer
  • UDP provides another example of this
  • Accepts UDP datagrams from many application
    programs
  • Passes to IP for transmission
  • Takes arriving datagrams
  • Passes each to appropriate application program

16
Figure 11.5
17
  • Conceptually, mux demux occurs at ports
  • In practice, little more involved
  • Applications negotiate with OS to obtain a port
    protocol and associated port number
  • One assigned, application puts the port number in
    all outgoing UDP datagrams
  • Think of ports as queues
  • OS creates internal queue when provides port
  • UDP receives datagram, see if port matches one
  • If not, sends port unreachable ICMP error msg,
    discards
  • If is, enqueues datagram at port for application
    program
  • If port full, get error and datagram discarded

18
Reserved Available Ports
  • How should port numbers be assigned?
  • Two computers must agree on port numbers
  • A wants file from B needs to know what port the
    file transfer program on B uses
  • Two fundamental approaches
  • Central authority
  • Dynamic binding

19
  • Central Authority
  • Everyone agrees that central authority assigns
  • List of assignments will be published
  • All software will be built according to the list
  • Also called universal assignment
  • Called well-known port assignments
  • Dynamic Binding
  • Ports not globally known
  • Software assigns ports when needed
  • Must send request to computer to learn of
    assignments
  • Target machine replies with the port number to use

20
  • TCP/IP uses hybrid approach
  • Some ports globally assigned a priori
  • Many left available for local sites or
    applications
  • Low values going up are assigned
  • Higher values left open

21
(No Transcript)
22
Summary
  • Can have multiple applications executing
  • UDP distinguishes among these processes
  • Uses two 16-bit integers for port numbers
  • Some are pre-assigned (well-known)
  • Some available for arbitrary use

23
  • UDP is a thin protocol
  • Not add significantly to semantics of IP
  • Provides way for applications to use IP to
    communicate
  • Unreliable, connectionless
  • UDP lies in transport layer
  • Conceptual independence between it and internet
    layer is somewhat violated
Write a Comment
User Comments (0)
About PowerShow.com