You get a bonus - 1 coin for daily activity. Now you have 1 coin

UDP User Datagram Delivery Protocol

Lecture



The purpose of the UDP (User Datagram Protocol) transport layer protocol is to transfer data between application processes without delivery guarantees, so its packets may be lost, duplicated, or not in the order in which they were sent.

Reserved and available UDP ports

While the task of the network layer is to transfer data between arbitrary network nodes, the task of the transport layer is to transfer data between any application processes running on any network node. Indeed, after the packet has been delivered by the IP protocol to the recipient computer, the data must be sent to a specific recipient process. Each computer can perform several processes, moreover, an application process can also have several entry points acting as a destination address for data packets.

Packets arriving at the transport layer are organized by the operating system in the form of multiple queues to the entry points of various application processes. In TCP / IP terminology, these system queues are called ports . Thus, the destination address that is used at the transport level is the identifier (number) of the port of the application service. The port number specified by the transport layer, together with the network number and computer number specified by the network layer, uniquely identify the application process in the network.

The assignment of port numbers to application processes is either centralized if these processes are popular public services, such as the TFTP file access service (Trivial FTP) or the telnet remote control service, or locally for those services that have not yet become so common they secure standard (reserved) numbers.

Centralized assignment of port numbers to services is performed by the Internet Assigned Numbers Authority . These numbers are then fixed and published in Internet standards. For example, the TFTP Remote Access File Service mentioned above is assigned the standard port number 69.

The local assignment of a port number is that the developer of some application simply associates with it any available, randomly chosen numeric identifier, taking care that it is not included in the number of reserved port numbers. In the future, all remote requests to this application from other applications should be addressed with an indication of the port number assigned to it.

Multiplexing and demultiplexing application protocols using the UDP protocol

UDP protocol conducts two queues for each port: a queue of packets arriving at a given port from the network and a queue of packets sent by this port to the network.

The procedure for servicing UDP requests from several different application services is called multiplexing .

The UDP protocol distribution of packets arriving from the network layer between the set of high-level services identified by the port numbers is called demultiplexing (Figure 5.1).

  UDP User Datagram Delivery Protocol

Fig. 5.1.

Although any application can access the services of the UDP protocol, many of them prefer to deal with another, more complex TCP transport layer protocol. The fact is that the UDP protocol is a simple intermediary between the network layer and application services, and, unlike TCP, does not assume any functions to ensure the reliability of the transmission. UDP is a datagram protocol, that is, it does not establish a logical connection, does not number and does not order data packets.

On the other hand, the functional simplicity of the UDP protocol determines the simplicity of its algorithm, compactness and high speed. Therefore, those applications that implement their own, fairly reliable, connection-based messaging mechanism, prefer to use less reliable, but faster means of transport for direct data transmission over the network, which is the UDP protocol as TCP protocol . The UDP protocol can also be used in the case when the good quality of the communication channels provides a sufficient level of reliability without the use of additional techniques such as establishing a logical connection and acknowledging transmitted packets.

UDP message format

A unit of UDP data is called a UDP packet or user datagram. A UDP packet consists of a header and a data field in which the application layer packet is located. The header has a simple format and consists of four two-byte fields:

  • UDP source port - the port number of the sending process,
  • UDP destination port - the port number of the receiving process,
  • UDP message length - the length of the UDP packet in bytes,
  • UDP checksum - UDP checksum

Not all fields of a UDP packet must be filled. If the datagram sent does not involve a reply, then zeros can be placed in place of the sender's address. You can refuse to calculate the checksum, however, it should be noted that the IP protocol counts the checksum only for the header of the IP packet, ignoring the data field.


Comments


To leave a comment
If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Computer networks

Terms: Computer networks