Presentation is loading. Please wait.

Presentation is loading. Please wait.

User Datagram Protocol (UDP) Chapter 11. Know TCP/IP transfers datagrams around Forwarded based on destination’s IP address Forwarded based on destination’s.

Similar presentations


Presentation on theme: "User Datagram Protocol (UDP) Chapter 11. Know TCP/IP transfers datagrams around Forwarded based on destination’s IP address Forwarded based on destination’s."— Presentation transcript:

1 User Datagram Protocol (UDP) Chapter 11

2 Know TCP/IP transfers datagrams around Forwarded based on destination’s IP address Forwarded based on destination’s IP address At IP layer, destination address identifies host 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 Adds mechanism to distinguish among hosts Multiple applications on a given computer can send and receive datagrams independently Multiple applications on a given computer can send and receive datagrams independently

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

4 Is a process the ultimate destination? Seems natural; but is a bit misleading 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 Not by process that implements them Single process may handle multiple functions Want process to decide which function the sender wants Want process to decide which function the sender wants So, we will abstract the problem 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 OS’s provide synchronous port access Computation stops during port access operation 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 Puts waiting data in a finite queue To communicate with a foreign port Sender must know IP address & protocol port # Sender must know IP address & protocol port # Messages must carry 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 Provides protocol ports to distinguish among multiple executing programs Uses IP to transport messages between machines Uses IP to transport messages between machines Provides same unreliable, connectionless image 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: Application programs have full responsibility for:Reliability Message loss Duplication Out-of-order delivery Loss of connectivity Unfortunately, most application programmers ignore this responsibility 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 Has a header and data area 0 16 31 UDP Source Port UDP Destination Port UDP Message Length UDP Checksum Data...

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

10 Sender computes checksum over pseudo-header and datagram Sender computes checksum over pseudo-header and datagram Only datagram gets sent Only datagram gets sent Receiver reconstructs pseudo-header by extracting fields from the IP header Receiver reconstructs pseudo-header by extracting fields from the IP header 0 8 16 31 Source IP Address Destination IP Address ZeroProtoUDP Length UDP Source Port UDP Destination Port UDP Message Length UDP Checksum Data... Pseudo- header UDP datagram

11 UDP Encapsulation & Protocol Layering UDP is our first transport protocol example Application User Datagram (UDP) Internet (IP) Network Interface

12 Layering above UDP means complete UDP message (header and data) is encapsulated in an IP datagram UDP datagram in IP datagram data area UDP datagram in IP datagram data area IP datagram in frame data area IP datagram in frame data area Layering provides division of duties IP layer identifies source & destination hosts IP layer identifies source & destination hosts UDP layer identifies source or destination ports within a host 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 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 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 Accepts UDP datagrams from many application programs Passes to IP for transmission Passes to IP for transmission Takes arriving datagrams Takes arriving datagrams Passes each to appropriate application program Passes each to appropriate application program

16 Figure 11.5

17 Conceptually, mux & demux occurs at ports In practice, little more involved 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 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 not, sends port unreachable ICMP error msg, discards If is, enqueues datagram at port for application program 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 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 Central authority Dynamic binding Dynamic binding

19 Central Authority Everyone agrees that central authority assigns Everyone agrees that central authority assigns List of assignments will be published List of assignments will be published All software will be built according to the list All software will be built according to the list Also called universal assignment Also called universal assignment Called well-known port assignments Called well-known port assignments Dynamic Binding Ports not globally known Ports not globally known Software assigns ports when needed 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 Some ports globally assigned a priori Many left available for local sites or applications Many left available for local sites or applications Low values going up are assigned Higher values left open

21

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

23 UDP is a thin protocol Not add significantly to semantics of IP Not add significantly to semantics of IP Provides way for applications to use IP to communicate 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 Conceptual independence between it and internet layer is somewhat violated


Download ppt "User Datagram Protocol (UDP) Chapter 11. Know TCP/IP transfers datagrams around Forwarded based on destination’s IP address Forwarded based on destination’s."

Similar presentations


Ads by Google