User Datagram Protocol

UDP is connectionless unreliable transport protocol. It does not add anything to the service of IP except for providing communication instead of Host-to-Host communication. A process is a running application program. Identified by the “port” number.

UDP is a simple protocol, does not provide flow control mechanism and there is no acknowledgment for received UDP datagram.

For communication we must define

The client-server paradigm: A process on the local host called a needs services from a process usually on the remote-host called

The local host and the remote host are defined using IP addresses. To define the processes we need Identifiers called

The client program defines itself with a port number called .(临时端口) The server use universal port number an they are called .(常用端口)

The destination IP address defines the host among the different hosts in the world. After the host has been selected the port number defines one of the processes on this particular host.

The ports ranging from 0-1023 are assigned and controlled by ICANN internet corporation for assigned names and numbers.

The ports ranging from 1024-49151 are not assigned or controlled by ICANN. They can only be registered with ICANN to prevent duplication.

The ports ranging from 49152-65535 are neither controlled nor registered. They can be used as temporary or private port numbers.

Socked address = IP address + Port number

The combination of an IP address and a port number is called a The client address defines the client process uniquely just as the server socket address defines the server process uniquely.

UDP datagram format

The UDP datagram have a fixed-size header of 8 bytes.

UDP provides a connectionless service. The user datagram are not numbered. There is no connection establishment and no connection termination.

The queues opened by the client are identified by ephemeral port numbers. The queues function as long as the process is running. When the process terminates the queues are destroyed.

At the server side the mechanism of creating queues is different. A server asks for incoming and outgoing queues using its well-known port. When it starts running the queues remain open as long as the server is running, even the process terminated.

The UDP package involves the following components:

keeps track of the open ports each entry in this table has four fields.

The is responsible for the management of the control-block table.When a process starts, it asks for a port number from the operating system. The process passes the process id, and the port number to the control-block module to create an entry in the table for the process.

1. Search the control-block table for a "Free" entry.
2. If not found, delete an entry using a predefined strategy.create a new entry with the state "In-use", create the process id and the port number.

The receives a user datagram from the IP layer. It searches the control-block table to find an entry having the same port number as this user datagram. If the entry is found, the module uses information in the entry to enqueue the data.

1. Look for the corresponding entry in the control-block table.
2. If found, check the queue field to see if a queue is allocated.
	If it is not, allocate a queue. 
	Then, Enqueue the data in the corresponding queue.
4. If not found, discard the datagram, use ICMP to send an error message.