UDP vs. TCP and Which One to Use for Video Streaming (2024)

UDP vs. TCP and Which One to Use for Video Streaming (1)

If you’re weighing the virtues of TCP vs. UDP, we’re going to assume that you’re already familiar with the seven layers of networking and the all-important transport layer. As with everything, there are advantages and disadvantages to both protocols. To make an informed decision, though, it’s important to understand the key differences between the two.

UDP vs. TCP and Which One to Use for Video Streaming (2)

Table of Contents
  • Transmission Control Protocol(TCP)
  • User Datagram Protocol (UDP)
  • Streaming Protocols
  • TCP and UDP Uses and Examples

Transmission Control Protocol(TCP)

Transmission Control Protocol (also noted as TCP/IP) is one of the earliest, most foundational networking protocols, and it’s used extensively by core internet applications such as the World Wide Web (HTTP), email (SMTP), File Transfer Protocol (FTP), and many others. It’s best suited for applications where accurate delivery is more important than timeliness.

How Does TCP Work?

TCP was designed to offer a highly reliable, end-to-end byte stream over an unreliable network. It “cares” about the quality of the data stream and prioritizes ordered and precise packet delivery. It achieves this dependability through a technique known as positive acknowledgment with retransmission.

This means that TCP requires a handshake between hosts, and it detects issues with IP packets — whether they’re due to network congestion, issues with load balancing, or other unpredictable network behaviors. If TCP determines that IP packets are lost, duplicated, or out of sequence, it’ll request retransmission of missed data, correct out-of-order data, and even minimize network congestion. Once the sequence of packets has been assembled in the appropriate order, the TCP receiver passes the data to the receiving application.

Become a Streaming Protocol Expert

Learn about codecs and protocols, the latest live streaming trends, and much more.

Subscribe

User Datagram Protocol (UDP)

User Datagram Protocol, however, is a simple connectionless protocol with minimal mechanisms. It doesn’t require recipients to let the sender know that all data packets have arrived, giving it a reputation for being unreliable (some jokingly refer to UDP as the Unreliable Datagram Protocol). Nevertheless, it has a number of attributes that make it attractive for streaming.

How Does UDP Work?

UDP leverages simple checksums instead of handshakes to validate data integrity and offers no guarantees of delivery, ordering, or duplicate protection. It’s also stateless, which makes it ideal for transmitting data to large numbers of clients.

UDP also boasts multicast support, unlocking capabilities such as service discovery and broadcasting. Its lack of retransmission delays makes it suitable for real-time applications such as Voice over IP (VoIP), online games, and live video streaming. As such, UDP is ideal to use alongside Real-Time Streaming Protocol (RTSP).

Pros and Cons of TCP and UDP

One of the biggest advantages of TCP over UDP is that it requires devices to interact with one another more frequently to check for errors. This enhanced verification means even if data packets arrive at a recipient’s IP address out of order, or if pieces are missing entirely, the protocol communicates with the sender to ensure each piece arrives where it should be.

However, prioritizing accuracy can also incur lengthy delays (several seconds’ worth) while waiting for message retransmission. These delays might be unnoticeable to human Internet users, but when it comes to UDP vs. TCP speed, UDP is a clear winner. TCP, on the other hand, is preferable for sending important files and messages that don’t need to happen in real time.

UDP is generally favored for kinds of data streaming where near immediacy is essential. The drawback is that a few data packets sent via UDP streaming might be missing or out of order, which could result in a few frames missing (for example) or a slight glitch in audio during a live stream. If the difference is minor, it hopefully won’t negatively impact your user experience too much.

TCPUDP
A connection-oriented protocol.A connectionless protocol.
Uses specifichandshake protocols(generally,SYN, SYN-ACK, ACK).No handshake.
Guarantees the delivery of data to the destination router, thus making it reliable.Doesn’t guarantee the delivery of data to the destination.
Treats communication stream as a sequence of bytes.Messages contain packets thatare considered independent of one another.
Messages make their way across the internet from one computer to another.UDP isn’t connection-based, so one program can send lots of packets to another.
Packet sequence is verified.Data is processed in order of arrival.
Slower speed of transmissiondue to reordering and retransmission.Fasterbecause integrity is checked at the arrival timeusing checksum.
Performserror checking andattemptserror recovery.Performsbasicerror checking and discards erroneous packets without attemptingerror recovery.
Offers extensive error-checking mechanisms using flow control and acknowledgment of data.Has only a single error-checking mechanism, which is used for checksums.
Acknowledgessegments.Doesn’t acknowledge specificsegments.
Header size is 20 bytes.Header size is 8 bytes.
TCP isheavy.Itneeds three packets to set up a socket connection before data can be sent.UDP is lightweight. Thereisno tracking of connections, ordering of messages, etc.
Adapted from https://www.guru99.com/tcp-vs-udp-understanding-the-difference.html.

Download our low-latency deep dive

Find out what’s required to delivery interactive video experiences.

Get the PDF

Streaming Protocols

Because HTTP communication typically takes place over TCP connections, we tend to see HTTP-based streaming protocols layered over TCP connections. However, newer technologies leverage UDP’s simplicity and speed. You can see which streaming protocols pair with TCP or UDP best in the chart below:

TCPUDP
RTMP (Real-Time Messaging Protocol)SRT (Secure Reliable Transport)
RTSP (Real-Time Streaming Protocol)WebRTC (Web Real-Time Communications)
Apple HLS(includesLow-Latency HLS)RTSP (Real-Time Streaming Protocol)
MPEG-DASH(includesCMAF)RTP (Real-Time Transport Protocol)

You’ll notice that RTSP is on both sides of the chart because it often relies on TCP’s reliable transmission for control and UDP’s best-efforts delivery to display audio and video on client-side applications before the complete file has arrived. So, if you’re using RTSP, UDP or TCP isn’t the question — you need each of them for an optimal experience. RTP is also capable of using both, but RTMP is strictly a TCP-based protocol.

MPEG-DASH is made to work with TCP but is incompatible with Apple devices. If you know a portion of your audience uses iOS devices or Safari, don’t worry; Apple HLS is also designed to function with TCP to ensure reliability and maintain its powerful adaptive bitrate. Unfortunately, this also results in high latency (as much as 30-45 seconds), but Low-Latency HLS is created to operate with TCP as well and ensure speedy delivery.

The WebRTC protocol can leverage either TCP or UDP, but we recommend using it with the latter. SRT is also best used with UDP because it’s built with its own latency and “jitter” control from packet loss on low networks, which can compensate for UDP’s reduced accuracy, making them an ideal combination for data transmission.

UDP vs. TCP and Which One to Use for Video Streaming (3)

TCP and UDP Uses and Examples

What are some applications for both TCP and UDP in real life? Knowing that TCP is primarily for functions where accuracy is prioritized over timeliness, this protocol is common for Internet essentials like sending emails, sharing files, text messaging and accessing web pages. Some specific TCP examples include:

  • iMessage
  • Instagram
  • WhatsApp
  • FileZilla Client
  • HTTP (the Internet as we know it)
  • Gmail
  • Outlook
  • Yahoo

UDP applications include functions like video conferencing, voice over IP, online games, and domain name systems. All of these require transferring data as fast as possible, even if it results in a glitch or two. For instance, the slightest delay while video conferencing ruins the illusion that the conversation is happening in real-time, and gamers can’t tolerate lags when playing together. Some specific UDP examples include:

  • Zoom
  • Google Meet
  • FaceTime
  • WhatsApp’s voice calling feature
  • Viber
  • Halo
  • Team Fortress

Of course, there are exceptions, such as when an application needs a feature of another protocol it doesn’t benefit from its typical partner, like security. World of Warcraft, for example, leverages TCP instead of UDP like other video games.

Conclusion

If you’re debating whether to use UDP or TCP for streaming, keep in mind how fast you want your transmission to send and what your margin for error is before it impacts your user experience. It’s crucial to architect a workflow that uses the best streaming protocols for your specific requirement, which is why we built Wowza’s technology to be flexible.

Wowza’s platform supports all the protocols discussed in this article and can be customized to your needs.Simplycontact us todayto talk to an expert about the best way to architect your streaming workflow.

Try Wowza Video
Free for 30 Days

Test both UDP and TCP protocols and much more. No card necessary.

UDP vs. TCP and Which One to Use for Video Streaming (2024)

FAQs

UDP vs. TCP and Which One to Use for Video Streaming? ›

Low Latency: UDP's lack of handshakes and acknowledgments means lower latency, resulting in faster video startup and smoother playback. Efficiency: Without the overhead of TCP, UDP maximizes available bandwidth for video content, making it suitable for high-quality streaming.

Is TCP or UDP normally used when streaming live video? ›

On the other hand, UDP is typically used for live streaming and multicast video conferencing. Such applications normally require their own protocol (commonly RTP/RTCP over UDP) on top of UDP.

Does Netflix use TCP or UDP for video streaming? ›

"Netflix uses TCP because TCP is much time-sensitive and does not require port forwarding. It helps to enable the full bandwidth of the network. We can compress more data at once in TCP and also reloaded data packets do not pose a problem. It also ensures higher video quality and fewer network congestion problems.

What protocol is best suited for streaming videos? ›

HTTP Live Streaming or HLS is an adaptive bitrate streaming communication protocol and is one of the most popular streaming protocols that combines HTML5-based video playback and produces one of the best live streaming experiences by dynamically adapting to network conditions depending on the connection speeds.

Can TCP be used for video streaming? ›

TCP is used by many of the most popular applications on the internet, including streaming media applications. TCP is a connection-oriented, end-to-end reliable protocol which supports multi-network applications.

Is UDP or TCP better for video streaming? ›

User Datagram Protocol (UDP) is the superior choice for online streaming videos. UDP emphasizes speed and efficiency, making it exceptionally well-suited for real-time data transmission, including video streaming. It delivers data with minimal latency and without burdening your network's resources.

Which protocol to use for streaming? ›

Real-Time Streaming Protocol (RTSP)

RTSP works with both live and on-demand data and can use either UDP or TCP as a transport protocol. Most often, RTSP uses RTP for media stream delivery, but it can also use other protocols.

What is the best format for streaming? ›

For web streaming, the best video codec is simple to identify – it is H. 264. H. 264 is hands down the best codec for web streaming because it is highly efficient and compatible with most other forms of video technology you need to use for web streaming.

Does Zoom use TCP or UDP? ›

Zoom uses a combination of both TCP (Transmission Control Protocol) and UDP (User Datagram Protocol). TCP is a reliable, stream-oriented protocol that establishes a secure connection between two devices and ensures that data is transmitted in the correct order and without errors.

What ports are used for streaming video? ›

In order to send out your video stream, you will need to make sure there isn't a firewall on your network blocking any ports. There are three ports that you want to focus on: 1935, 80, and 443.

What protocol is used for real-time streaming? ›

RTSP is a communication protocol used to control servers that stream media content over the Internet. It helps in setting up and managing connections between devices for streaming audio or video.

What is the lowest latency streaming protocol? ›

What is the best streaming protocol for low latency? Some of the best low-latency live streaming services use HTTP live streaming (HLS) protocol. Dacast for instance, uses the HLS protocol with RTMP ingests which reduces latency to 15 seconds or less. This is a low enough latency for comfortable professional streaming.

Which is better TCP or UDP? ›

TCP is best used for direct communication in which a reliable connection is needed, such as web browsing, email, text messaging, and file transfers. UDP is best used for live and real-time data transmission when speed is more important than reliability.

Does Vimeo use TCP or UDP? ›

Viewers should ensure the following ports are open on their network for playback: TCP/UDP 80 (HTTP)

Is RTSP over TCP or UDP? ›

RTSP uses a Transmission Control Protocol (TCP) connection for control of the streaming media session, although it is also possible to use UDP for this purpose.

Does broadcast use TCP or UDP? ›

Broadcasting and multicasting only apply to UDP, where it makes sense for an application to send a single message to multiple recipients. TCP is a connection-oriented protocol that implies a connection between two hosts (specified by IP addresses) and one process on each host (specified by port numbers).

Do online video games use TCP or UDP? ›

For speed purposes, UDP is substantially faster. For reliability and 'always on' connections, TCP is the only way to go. MOST modern multiplayer games use a combination of both to achieve the results they do.

What port is used for video streaming? ›

In order to send out your video stream, you will need to make sure there isn't a firewall on your network blocking any ports. There are three ports that you want to focus on: 1935, 80, and 443.

Top Articles
10 Fruits That Are Considered Lucky In Feng Shui
5 Tips for Self-Introduction in Zoom Meetings | Leverage Edu
Evil Dead Rise Showtimes Near Massena Movieplex
Chalupp's Pizza Taos Menu
The Potter Enterprise from Coudersport, Pennsylvania
Lenscrafters Westchester Mall
Osrs But Damage
Mlifeinsider Okta
Strange World Showtimes Near Cmx Downtown At The Gardens 16
Missing 2023 Showtimes Near Landmark Cinemas Peoria
Keniakoop
6th gen chevy camaro forumCamaro ZL1 Z28 SS LT Camaro forums, news, blog, reviews, wallpapers, pricing – Camaro5.com
Otterbrook Goldens
Daily Voice Tarrytown
How pharmacies can help
TBM 910 | Turboprop Aircraft - DAHER TBM 960, TBM 910
Talbots.dayforce.com
V-Pay: Sicherheit, Kosten und Alternativen - BankingGeek
Robeson County Mugshots 2022
Toyota Camry Hybrid Long Term Review: A Big Luxury Sedan With Hatchback Efficiency
Diakimeko Leaks
Tripadvisor Napa Restaurants
Gas Buddy Prices Near Me Zip Code
Living Shard Calamity
kvoa.com | News 4 Tucson
Pensacola Tattoo Studio 2 Reviews
10 Best Places to Go and Things to Know for a Trip to the Hickory M...
Pixel Combat Unblocked
1636 Pokemon Fire Red U Squirrels Download
Abga Gestation Calculator
Jailfunds Send Message
Superhot Free Online Game Unblocked
Spirited Showtimes Near Marcus Twin Creek Cinema
Lincoln Financial Field, section 110, row 4, home of Philadelphia Eagles, Temple Owls, page 1
Ellafeet.official
Hermann Memorial Urgent Care Near Me
Domino's Delivery Pizza
Pitchfork's Top 200 of the 2010s: 50-1 (clips)
Linda Sublette Actress
18 terrible things that happened on Friday the 13th
Low Tide In Twilight Manga Chapter 53
Www.craigslist.com Waco
US-amerikanisches Fernsehen 2023 in Deutschland schauen
Mbfs Com Login
Craigslist Central Il
412Doctors
N33.Ultipro
Enjoy Piggie Pie Crossword Clue
Plasma Donation Greensburg Pa
Bbwcumdreams
Craiglist.nj
Frank 26 Forum
Latest Posts
Article information

Author: Allyn Kozey

Last Updated:

Views: 5826

Rating: 4.2 / 5 (43 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Allyn Kozey

Birthday: 1993-12-21

Address: Suite 454 40343 Larson Union, Port Melia, TX 16164

Phone: +2456904400762

Job: Investor Administrator

Hobby: Sketching, Puzzles, Pet, Mountaineering, Skydiving, Dowsing, Sports

Introduction: My name is Allyn Kozey, I am a outstanding, colorful, adventurous, encouraging, zealous, tender, helpful person who loves writing and wants to share my knowledge and understanding with you.