Principles Digital Communication System & Computer Networks (Charles River Media Computer Engineering)
| < Day Day Up > |
|
22.3 USER DATAGRAM PROTOCOL
User datagram protocol (UDP) is another transport layer protocol that can be run above the IP layer. In the place of TCP, UDP can be used to transport a message from one machine to another machine, using the IP as the underlying protocol. UDP provides an unreliable connectionless delivery service. It is unreliable because packets may be lost, arrive out of sequenceor or be duplicated. It is the higher layer software that has to take care of these problems. The advantage of UDP is that it has low protocol overhead compared to TCP. A UDP message is called a user datagram.
The format of the user datagram is shown in Figure 22.3.
Source port address (16 bits): Specifies the protocol port address from which data is originating. This is an optional field. If present, this is to indicate the address to which a response has to be sent by the destination port. If absent, the field should contain all zeros.
Destination port address (16 bits): Specifies the protocol port address to which data is intended.
Message length (16 bits): Specifies the length of the user datagram, including the header and data in octets.
Checksum (16 bits): The data is divided into 16-bit words, the one's complement sum is computed, and its one's complement is taken. However, checksum calculation is optional, and can be avoided by keeping zeros in this field to reduce computational overhead.
Data (variable length): The actual data of the user datagram.
This user datagram is encapsulated in the IP datagram's data field and then encapsulated in the frame of the datalink layer and sent over the network.
Though UDP is unreliable, it reduces the protocol overhead as compared to TCP. Hence, UDP is used for network management. Simple Network Management Protocol (SNMP) runs above the UDP. UDP is also used for voice/fax/video communication on IP networks to enable real-time transmission. This aspect is addressed in the chapter on multimedia communication over IP networks.
Another use of UDP is in networks where it is not possible to implement acknowledgements. For example, consider a satellite network (shown in Figure 22.4) working in star configuration with a hub (central location) and a number of receive-only VSATs. The server located at the hub (central station) has to transmit a file to the VSATs. It is not possible to use the TCP protocol in such a network because the VSAT cannot send an acknowledgement. We can use UDP to transmit the packets one after another from the computer at the hub; the computer at the VSAT location assembles all the UDP packets to get the file. The application layer running above UDP has to take care of assembling the file by joining the UDP datagrams in sequence.
The UDP datagram has the following fields: source port address, destination port address, message length, checksum, and data. The checksum field is optional.
Note | The header of UDP is much smaller than the header of TCP. As a result, processing of UDP user datagrams is much faster. |
| < Day Day Up > |
|