140 likes | 365 Vues
Identifying the Ultimate Destination. Each executing program is referred to as a process, task, application, or a user level process. It may seem natural to say that a process is the ultimate destination for a message. First, however, processes are created and destroyed dynamically, and senders seld
E N D
1. User Datagram Protocol (UDP) Chapter 11
2. Identifying the Ultimate Destination Each executing program is referred to as a process, task, application, or a user level process. It may seem natural to say that a process is the ultimate destination for a message. First, however, processes are created and destroyed dynamically, and senders seldom know enough to identify a process on another machine.
3. Identifying the Ultimate Destination (cointinued) Second, we would like to replace processes that receive datagrams without informing all senders (if, for example, the machine reboots).
Third, it is desirable to identify a destination by the function it provides. It is also possible that a single process may handle two or more funtions.
4. Identifying the Ultimate Destination (cointinued) Enter an abstraction! Destination points called protocol ports identified by positive integers.
Most operating systems provide synchronous access to ports.
Computation stops during a port access. If a process attempts to extract data from a port before any data arrives, the OS stops (blocks) the process until data arrives.
Ports are buffered so that data that arrives too soon will not be lost.
5. Identifying the Ultimate Destination (cointinued) To communicate with a foreign port a sender needs to know the IP address of the destination machine and the protocol port number of the destination within that machine.
Each UDP message contains both a destination and a source port number (for replying).
6. The User Datagram Protocol UDP provides the primary mechanism that application programs use to send datagrams to other applications.
UDP uses the underlying internet layer and provides the same unreliable, connectionless delivery semantics as IP.
UDP does not use acknowledgements, does not order incoming datagrams, and has no flow control.
7. Format of UDP Messages Each UDP message is called a user datagram.
http://www.calvin.edu/~lave/figure-11.1.pdf
Message length is in octets
Checksum is optional
Zero means ignore
But what if the checksum is really zero?
8. The UDP Pseudo-header The UDP checksum covers more information than is in the datagram
UDP prepends a pseudo-header to ensure that the datagram has reached the correct destination
http://www.calvin.edu/~lave/figure-11.2.pdf
At the destination fields must be extracted from the IP header
9. UDP Encapsulation UDP is our first example of a transport layer protocol
http://www.calvin.edu/~lave/figure-11.4.pdf
10. Layering and the UDP Checksum Observant readers will have noticed a seeming contradiction.
It can be argured that the source IP address must be known when the UDP datagram is constructed.
But consider a multi-homed machine. The transport layer software should not know which interface, and hence which source IP address, will be used.
11. continued Compromise! Compromise and be wise!
UDP software asks the IP layer to compute the source and destination IP addresses, uses them to compute the checksum, and then discards the pseudo-header
The reason for the compromise is to ensure that datagrams are not delivered to the wrong destination or the wrong application
12. continued Does the strong interaction between UDP and IP violate the separation of functionality that layering provides? Yes.
Exercise 11.4 considers the question of whether or not UDP should be separated from IP
13. UDP Multiplexing http://www.calvin.edu/~lave/figure-11.5.pdf
A UDP port is a queue provided by the OS
http://www.calvin.edu/~lave/figure-11.6.pdf
14. Reserved and Available Port Numbers Universal assignment
Well-known port assignments
Dynamic binding
When a program needs a port, the OS assigns one.
What port is the file transfer service using?
TCP/IP designers adopted a hybrid approach
http://www.calvin.edu/~lave/figure-11.6.pdf