User Datagram Protocol (UDP)
Introduction to UDP
- The User Datagram Protocol (UDP) is called as a connectionless, unreliable protocol.
- UDP has a very limited error checking capability.
- It is a very simple protocol and it can be used with minimum overhead.
- The UDP can be used, when process needs to send a small message without any issue of reliability. UDP takes less time as compared to TCP (Transmission Protocol) or SCTP (Stream Control Transmission Protocol).
Some Standard Ports for UDP are listed below:
Port No | Protocol | Description |
---|
7 | Echo | Resends a received datagram back to the sender. |
9 | Discard | Discards a received datagram. |
11 | Users | Shows active users. |
13 | Daytime | Gives the date and time. |
17 | Quote | Gives a Quote of the day. |
19 | Chargen | Gives a string of characters. |
53 | Nameserver | Shows Domain Name Service. |
67 | BOOTPs | Server port to download bootstrap information. |
68 | BOOTCPc | Client port to download bootstrap information. |
69 | TFTP | Trivial File Transfer Protocol. |
111 | RPC | Remote Procedure Call. |
123 | NTP | Network Time Protocol. |
161 | SNMP | Simple Network Management Protocol. |
162 | SNMP | Simple Network Management Protocol. (trap) |
User Datagram
UDP packets are called as
user datagrams, which contain the fixed-size header of 8-bytes.
The important fields of user datagrams are:
1. Source Port Number- It is used by the process, which is running on the source host.
- Source Port Number is 16 bits long
- If the source host is a client and sends a request, the port number is unknown, which is requested by the process and then accepted by the UDP software.
- If the source host is a server (server sending a reply), the port number is known.
2. Destination Port Number- It is used by the process, which is running on the destination host as well as source host.
- If the destination host is a server (server sending request), the port number is known.
If the destination host is a client (client sending reply), the port number is unknown.
3. Length- This is the total length of the user datagram and it is 16 bit (0 to 65535 bytes) long.
- A UDP user datagram can be stored in an IP datagram with a length of 65535 bytes.
- Total UDP length = IP length – IP headers length.
4. Checksum
Checksum is used to detect the errors in the user datagram.
Features of UDP
Some features of UDP are as stated below:
1. Connectionless service
UDP provides connectionless service. Each user datagram sent by the UDP is an independent datagram. There is no relationship between the different user datagrams even if they are coming from the same source and going to the same destination source.
2. Encapsulation and De-capsulation
While sending the messages from source process to destination, UDP encapsulates and de-capsulates the messages in an IP datagram.
3. Queuing
The Queues are associated with the ports in UDP.
Uses of UDP
Some uses of UDP are as stated below
1. UDP can be very useful to process the required simple request –response communication and less concern of error checking.
2. UDP protocol is suitable for multitasking.
3. UDP is also applicable in the management processes.
For example: SNMP (Simple Network Management Protocol)
4. UDP is used to implement RIP (Routing Information Protocol).