The reliability and flow control features provided by TCP come with additional overhead related to the connection establishment and tracking whether or not segments were received. UDP is a transport layer protocol that is used when this kind of overhead creates unnecessary delay. For example, transaction-based protocols such as DNS or DHCP, and delay-sensitive such as Voice over IP.
This section covers what UDP does and when it is a good idea to use it instead of TCP. UDP is a best-effort, lightweight transport protocol that offers the same data segmentation and reassembly as TCP but without TCP’s reliability and flow control.
UDP features include the following:
• Data is reconstructed in the order that it is received.
• Any segments that are lost are not resent.
• There is no session establishment.
• The sending is not informed about resource availability.
For more information on UDP, search the Internet for RFC 768.
UDP is a stateless protocol, which means that neither the client nor the server tracks the state of the communication session. If reliability is required when using UDP as the transport protocol, it must be handled by the application.
One of the most important requirements for delivering live video and voice over the network is that the data continues to flow quickly. Live video and voice applications can tolerate some data loss with minimal or no noticeable effect, making them perfectly suited to UDP.
The blocks of communication in UDP are called datagrams, or segments. These datagrams are sent as best effort by the transport layer protocol.
The UDP header is far simpler than the TCP header because it only has four fields and requires 8 bytes (64 bits). Figure 26-11 shows the fields in a TCP header.
Figure 26-11 Fields of the UDP Header
Table 26-2 identifies and describes the four fields in a UDP header.
Table 26-2 Details of the UDP Header Fields
Applications That Use UDP (26.3.4)
Three types of applications are best suited for UDP:
• Live video and multimedia applications—Applications that can tolerate some data loss but require little or no delay. Examples include VoIP and live streaming video.
• Simple request and reply applications—Applications with simple transactions where a host sends a request and may or may not receive a reply. Examples include DNS and DHCP.
• Applications that handle reliability themselves—Unidirectional communications where flow control, error detection, acknowledgments, and error recovery are not required or can be handled by the application. Examples include SNMP and TFTP.
Figure 26-12 identifies applications that require UDP.
Figure 26-12 Applications That Use UDP
Although DNS and SNMP use UDP by default, they both also use TCP. DNS uses TCP if the DNS request or DNS response is more than 512 bytes, such as when a DNS response includes many name resolutions. Similarly, under some situations, a network administrator may want to configure SNMP to use TCP.
Check Your Understanding—UDP Overview (26.3.5)
Refer to the online course to complete this activity.