As mentioned before, UDPis light in load but has no function to provide reliability and communication efficiency like flow and congestion control because it is a simple configuration that only specifies exchange of data between client application and server application.
Since there is no sequence number etc., even if the order of packet arrival is changed, it can not be recognized by UDP level.
In a real-time application such as VoIP, there is a negative impact when the order changes, so we may check the order in the upper layers of UDP (eg RTP).
Format of UDP
As with TCP, communication data units of UDP are often called " segments " so we will follow it here as well.
The format of the UDP segment is shown below. When UDP is used as an upper layer of IPv4, specify Ox11 (decimal number: 17) in the protocol field of IPv4.
Source port Field
16 bit. It is the port number used by the sender. If the sender is a client, the appropriate port is used from 1024 or higher ports called Higher Port in many scenes.
Destination port Field
16 bit. It is the port number to be used at the destination. If the destination is a server, it will be the port number according to the service. For example, if it is communication to the TFTP server, it will be 69, and if it is communication to the NTP server, 123 will be used.
Segment Length Field
16 bit. Indicates the length of UDP header and UDP data area in byte units.
16 bit.In this field, not only UDP header and UDP data but also source IP address, destination IP address, protocol number (Ox11), and UDP Segment Length are checked. Like the TCP reliability checksum described explained before, it is computed in the same way using the same pseudo-IP header.
For studying TCP / UDP, the following books are recommended.