UDP Protocol in Computer Networks
UDP stand for User Datagram Protocol.
UDP is connection less protocol whereas we have discussed about TCP in previous class; TCP is connection-oriented protocol.
UDP does not care about any connection unlike the TCP where the TCP first has to establish the connection and then it allows data to be send across the network.
Therefore; UDP is unreliable because if any packet gets lose in transit, then UDP does not care about the Lost packet.
But TCP use to take care of all packets; if any packet gets lose in transit, then TCP retransmit the same packet before sending any other packets across the network, that is why TCP is reliable than UDP.
UDP does not care about maintaining the order of sequence while sending packets across the network unlike TCP.
It is because UDP does not maintain any sequence number; so which packet is needed to reach first and which packet is needed to reach at last, UDP does not care to those sequencing of order unlike TCP.
Therefore; any packet may reach at any time during the transit.
Now let us discuss about the UDP Header;
UDP Header have four fields only.
The first field holds the Source port number.
We know that the application port number is required for end-to-end delivery of a data packet.
There are 0 to 216-1 port numbers available; that is 0 - 65535 ports.
0 - 1023 port numbers are well known ports and apart from those there are some registered port numbers and the rest are used as normal port numbers which we may use in our computers.
So; the first field holds the source application port number and the second field holds the destination port number.
There are different applications that we use and let say E-Mail;
If we use E-Mail then system may use the port number 25; different application such as FTP, SMTP, HTTP use different port numbers for end-to-end delivery for receiving and sending data packets across the network.
The third important field in UDP Header is length which represent the total length of the segment.
It is also a 16 bits field which holds the length of the segment and it represents by number range of minimum 0 - maximum 65535; that is 216-1.
Total number is 65536 but the range between minimum and maximum numbers is 0 - 65535; so that is total 65536 numbers (216) numbers.
The segment is divided into two parts;
The first part is header and the second part is payload that is pure data.
The size of UDP Header is 8 bytes and the maximum size of the payload is 65527.
The payload may have size of less than 65527 but it cannot exceed the size of 65527.
So; without header; it is not possible to send the data or payload.
Now the last field of the header is Checksum.
Let us understand; how Checksum is to be calculated.
Checksum = Total calculated values of (UDP Header + UDP Data + Psedo header of IP)
In the Psedo header of IP, it calculates the value of source and destination IP Addresses which does not change and stay fixed throughout the transmission period in the network layer at the router.
Unlike the TCP; UDP sends packets through different routh, and not through a single route that is why there is high chances of losing data packets.
We know that UDP is unreliable; so, it is not mandatory to use the Checksum in UDP header but it is required to have the Checksum number in TCP header because TCP is reliable and Checksum is needed to maintain the reliability.
Therefore in-spite of knowing that UDP is not reliable; still UDP is used heavily over TCP for some applications to perform real time transmission of data.
Let us discuss about those applications;
Query Response Protocol (One Request and One Reply), like DNS and DHCP;
When we try to access any domain name like google.com, then the request goes to the DNS server and the DNS server will find its associated IP Address from the database and respond with the IP Address to the user request.
In the DHCP user system sends one request to the DHCP server and the DHCP server responds with an IP Address from its pool to the user system.
Speed (Online Games, Voice over IP);
UDP helps to maintain constant speed.
The Online Game data has to be transmitted in actual time; otherwise, if the data is not to be send in real time, then, from one end a gamer will hit a shot and that shot will not respond to the other end in actual time; in between there could be other many possibilities of defence and shots which could have been violated or looked shocking.
If we say about Voice over IP then it is quite certain that data has to be transmitted in actual time otherwise communication between two or more users would have not been possible.
Broadcasting and Multicasting RIP;
Router shares its routing information to its neighbouring nodes in every 30 seconds that is a real time share of data, which is to be performs by UDP.
In this process each router sends single message to multiple routers where the UDP performs the task in real time by sending information to all neighbouring routers together.
If this process had been performed by the TCP then every time the router has to create connection with all other neighbouring routers before sending information and that would have taken lots of time.
Therefore UDP manages it without creating any connection.
Continuous Steaming (Skype and YouTube);
UDP helps to send continuous data, if any data is lost during transmission then UDP does not care about the lost data because in some operation of certain application continuous steaming is required like Skype or watching videos in YouTube.
During the continuous steaming, we sometimes experience lags in between steaming; so that is when some data is lost in transmission but UDP sends the next data without retransmitting the previous lost data.
Therefore that is how the UDP maintains speed and the continuous flow of data packets because it is a stateless process.
What is UDP Protocol in Networking What is UDP Header What is The Length of UDP Header in Bits and Bytes What is TCP and UDP What is Checksum in TCP UDP Protocol Example UDP Port Source Destination UDP Port Number Range UDP Operations in Computer Networks UDP Header Fields Difference between TCP and UDP in Computer Networks Define UDP Header Applications of UDP in Computer Networks What is UDP Protocol in Networking What is UDP Header What is The Length of UDP Header in Bits and Bytes What is TCP and UDP What is Checksum in TCP UDP Protocol Example UDP Port Source Destination UDP Port Number Range UDP Operations in Computer Networks UDP Header Fields Difference between TCP and UDP in Computer Networks Define UDP Header Applications of UDP in Computer Networks What is UDP Protocol in Networking What is UDP Header What is The Length of UDP Header in Bits and Bytes What is TCP and UDP What is Checksum in TCP UDP Protocol Example UDP Port Source Destination UDP Port Number Range UDP Operations in Computer Networks UDP Header Fields Difference between TCP and UDP in Computer Networks Define UDP Header Applications of UDP in Computer Networks