NETWORK ~ UDP protocol

     


    UDP (User Datagram Protocol) is an alternative communication protocol to TCP (Transmission Control Protocol) used mainly to send short messages called datagrams, but it is a less reliable and connectionless protocol. UDP is officially defined in RFC (Request for Comment) 768.

    UDP is widely used in video conferencing and real-time computer games. The protocol allows individual packets to be dropped and UDP packets to be received in a different order than when they were sent, resulting in better performance.

UDP header:

    Each UDP message is called a user datagram. The UDP header is a simple, fixed 8-byte header, while TCP can vary from 20 bytes to 60 bytes. The first 8 bytes contain all the necessary header information and the remaining part is data.

    ~Source and destination port: Port numbers identify the sending and receiving process. TCP and UDP use the destination port number to demultiplex incoming data from the IP layer. Since the IP layer has already demultiplexed the incoming IP datagram into TCP or UDP (depending on the protocol value in the IP header), this means that TCP port numbers are examined by TCP and UDP port numbers by UDP. TCP port numbers are independent of UDP port numbers.
 
    ~Length: The length in bytes of the UDP header and the encapsulated data. The minimum value for this field is 8.

     ~Checksum: The last 16 bits of the UDP header are reserved for the checksum value. The checksum is used as an error detection mechanism. The source machine performs a mathematical algorithm on the datagram. The destination machine or receiver uses the same mathematical algorithm on the datagram. If the two values match, we can assume that the datagram has not been damaged during its journey.

      If the checksum is set to zero, the checksum is disabled. The designers have chosen to make checksum optional to allow implementations to work quickly. If the calculated checksum is zero, this field must be set to 0xFFFF.

Applications of UDP:

Used for simple, fast communication, so when the data size is smaller, and flow control and errors are less of a concern.

This protocol is suitable for multicast, as UDP supports packet switching.

UDP is used for some routing update protocols such as RIP (Routing Information Protocol).

The following implementations use UDP as the transport layer protocol:

    -NTP (Network Time Protocol)
    -DNS (Domain Name System)
    -BOOTP, DHCP.
    -NNP (Network News Protocol)
    -TFTP, RTSP, RIP, OSPF protocol.

UDP takes the datagram from the network layer, then attaches its header and sends it to the user. So it's fast. In reality, UDP is a null protocol if you remove the checksum field.

THANK YOU for reading

You Tech 56

Follow us on social medias: linktr.ee/youtech56

 

Comments

Popular Posts