The Right Transport Layer Protocol for the Right Application (26.1.6)
Some applications can tolerate some data loss during transmission over the network but cannot tolerate delays in transmission. For these applications, UDP is the better choice because it requires less network overhead. UDP is preferable for applications such as voice over IP (VoIP). Acknowledgments and retransmission would slow down delivery and make the voice conversation unacceptable.
UDP is also used by request-and-reply applications where the data is minimal and retransmission can be done quickly. For example, DNS uses UDP for this type of transaction. The client requests IPv4 and IPv6 addresses for a known domain name from a DNS server. If the client does not receive a response in a predetermined amount of time, it simply sends the request again.
For example, if one or two segments of a live video stream fail to arrive, it creates a momentary disruption in the stream. This may appear as distortion in the image or sound, but may not be noticeable to the user. If the destination device had to account for lost data, the stream could be delayed while waiting for retransmissions, therefore causing the image or sound to be greatly degraded. In this case, it is better to render the best media possible with the segments received, and forego reliability.
For other applications, it is important that all the data arrives and that it can be processed in its proper sequence. For these types of applications, TCP is used as the transport protocol. For example, applications such as databases, web browsers, and email clients require that all data that is sent arrives at the destination in its original condition. Any missing data could corrupt a communication, making it either incomplete or unreadable. For example, it is important when accessing banking information over the web to make sure all the information is sent and received correctly.
Application developers must choose which transport protocol type is appropriate based on the requirements of the application. Video may be sent over TCP or UDP. Applications that stream stored audio and video typically use TCP. For example, the application uses TCP to perform buffering, bandwidth probing, and congestion control to provide a better user experience.
Real-time video and voice usually use UDP, but may also use TCP, or both UDP and TCP. A video conferencing application may use UDP by default, but because many firewalls block UDP, the application may also be sent over TCP.
Applications that stream stored audio and video use TCP. For example, if your network suddenly cannot support the bandwidth needed to watch an on-demand movie, the application pauses the playback. During the pause, you might see a “buffering…” message while TCP works to reestablish the stream. When all the segments are in order and a minimum level of bandwidth is restored, your TCP session resumes, and the movie resumes playing.
Figure 26-8 summarizes differences between UDP and TCP.
Figure 26-8 UDP and TCP Uses
Check Your Understanding—Transportation of Data (26.1.7)
Refer to the online course to complete this activity.