Download presentation
Presentation is loading. Please wait.
Published byEdgar West Modified over 9 years ago
1
1 User Datagram Protocol
2
2 Transport Protocols Provide logical communication between application processes running on different hosts Run on end hosts Sender: breaks application messages into segments, and passes to network layer Receiver: reassembles segments into messages, passes to application layer Multiple transport protocol available to applications Internet: TCP and UDP application transport network data link physical application transport network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical logical end-end transport
3
What is User Datagram Protocol UDP (User Datagram Protocol) is an alternative communications protocol to Transmission Control Protocol (TCP) used primarily for establishing low-latency and loss tolerating connections between applications on the Internet. Both UDP and TCP run on top of the Internet Protocol (IP) and are sometimes referred to as UDP/IP or TCP/IP. Both protocols send short packets of data, called datagrams.TCPdatagrams
4
UDP—User Datagram Protocol An unreliable, connectionless transport layer protocol Two additional functions beyond IP Layer: Demultiplexing: deliver to different upper layer entities such as DNS, RTP, SNMP based on the destination port # in the header. i.e., UDP can support multiple applications in the same end systems. (Optionally) check the integrity of entire UDP. (recall IP only checks the integrity of IP header.) If source does not want to compute checksum, fill checksum with all 0s. If compute checksum and the checksum happens to be 0s, then fill all 1s. UDP checksum computation is similar to IP checksum, with two more:
5
Figure 14.1 Position of UDP in the TCP/IP protocol suite
6
Difference between TCP and UDP TCPUDP Acronym forTransmission Control Protocol User Datagram Protocol or Universal Datagram Protocol Connection TCP is a connection-oriented protocol. UDP is a connectionless protocol. Function As a message makes its way across the internet from one computer to another. This is connection based.internet UDP is also a protocol used in message transport or transfer. This is not connection based which means that one program can send a load of packets to another and that would be the end of the relationship. Usage TCP is suited for applications that require high reliability, and transmission time is relatively less critical. UDP is suitable for applications that need fast, efficient transmission, such as games. UDP's stateless nature is also useful for servers that answer small queries from huge numbers of clients. Use by other protocolsHTTP, HTTPs, FTP, SMTP, Telnet DNS, DHCP, TFTP, SNMP, RIP, VOIP. Speed of transfer The speed for TCP is slower than UDP. UDP is faster because there is no error-checking for packets.
7
UDP Characteristics End-to-End: an application sends/receives data to/from another application. Connectionless: Application does not need to preestablish communication before sending data; application does not need to terminate communication when finished. Message-oriented: application sends/receives individual messages (UDP datagram), not packets. Best-effort: same best-effort delivery semantics as IP. I.e. message can be lost, duplicated, and corrupted. Arbitrary interaction: application communicates with many or one other applications. Operating system independent: identifying application does not depend on O/S.
8
Identifying An Application UDP cannot extend IP address No unused bits Cannot use OS-dependent quantity Process ID, Task number, Job name Must work on all computer systems Technique Each application assigned unique integer Called protocol port number
9
Protocol Port Number UDP uses Port Number to identify an application as an endpoint. UDP messages are delivered to the port specified in the message by the sending application In general, a port can be used for any datagram, as long as the sender and the receiver agrees In practice, a collection of well-known ports are used for special purposes such as telnet, ftp, and email. E.g. port 7 for Echo application. Local operating system provides an interface for processes to specify and access a port.
11
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA UDP Multiplexing & Demultiplexing Sender: multiplexing of UDP datagrams. UDP datagrams are received from multiple application programs. A single sequence of UDP datagrams is passed to IP layer. Receiver: demultiplexing of UDP datagrams. Single sequence of UDP datagrams received from IP layer. UDP datagram received is passed to appropriate application.
12
Figure 14.7 Multiplexing and demultiplexing
13
UDP Datagram Format Source Port - 16 bit port number Destination Port - 16 bit port number Length (of UDP header + data) - 16 bit count of octets UDP checksum - 16 bit field. if 0, then there is no checksum, else it is a checksum over a pseudo header + UDP data area
14
Checksum and Pseudo Header UDP uses a pseudo-header to verify that the UDP message has arrived at both the correct machine and the correct port. Proto : IP protocol type code. Length : Length of the UDP datagram.
15
Encapsulation and Layering UDP message is encapsulated into an IP datagram. IP datagram in turn is encapsulated into a physical frame for actually delivery.
16
Figure 14.5 Encapsulation and decapsulation
17
Popular Applications That Use UDP Multimedia streaming Retransmitting lost/corrupted packets is not worthwhile By the time the packet is retransmitted, it’s too late E.g., telephone calls, video conferencing, gaming Simple query protocols like Domain Name System Overhead of connection establishment is overkill Easier to have application retransmit if needed
18
Why Would Anyone Use UDP? Finer control over what data is sent and when As soon as an application process writes into the socket … UDP will package the data and send the packet No delay for connection establishment UDP just blasts away without any formal preliminaries … which avoids introducing any unnecessary delays
19
No connection state No allocation of buffers, parameters, sequence #s, etc. … making it easier to handle many active clients at once Small packet header overhead UDP header is only eight-bytes long
20
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA History of FTP The first proposed file transfer mechanisms were developed for implementation on hosts at M.I.T. (RFC 114) in 1971, even before the TCP/IP was existed. FTP general structure was established in 1973. The base specification RFC959 was published in 1985.
21
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA Overview of FTP After a TCP connection is established, an FTP control connection is created. Internal FTP commands are passed over this logical connection based on formatting rules established by the Telnet protocol. Each command sent by the client receives a reply from the server to indicate whether it succeeded or failed. A data connection is established for each individual data transfer to be performed. FTP supports either normal or passive data connections, allowing either the server or client to initiate the data connection. Multiple data types and file types are supported to allow flexibility for various types of transfers.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.