← Development Notes

RTP vs TCP for Low-Latency Screen Streaming

On a clean wired network, TCP and RTP can perform surprisingly similarly. Once the network becomes less predictable, the difference is no longer just a number: it becomes the difference between a frozen picture and a picture that keeps moving.

On a good wired network, the gap can be small.

A local Ethernet or direct wired connection usually has low packet loss, consistent delivery time, and enough bandwidth for a compressed desktop stream. In this environment, TCP's reliable ordered byte stream is not under much pressure. Retransmissions are rare, buffers stay short, and frames can arrive in time for presentation.

That makes TCP attractive. The operating system already handles ordering, retransmission, flow control, and congestion behavior. The application can write a framed media stream to a connection and read it in the same order on the other side. There are fewer transport states and fewer recovery policies for the application to design.

With careful buffering, TCP and RTP can therefore feel very close on an ideal wired link. For a prototype, a controlled installation, or a product that values implementation simplicity above resilience, TCP is a reasonable starting point.

A weaker network changes the result.

Wi-Fi is rarely as consistent as Ethernet. Interference, roaming, competing traffic, power-saving behavior, and momentary signal changes can introduce loss and jitter even when average bandwidth looks sufficient.

TCP must deliver data to the application in order. If one segment is missing, later bytes that have already arrived cannot simply move ahead of it. The stream waits for recovery. This head-of-line blocking is correct for a file transfer, where every byte matters and arriving late is better than never arriving. It is much less comfortable for an interactive display, where an old frame can become useless before it is recovered.

RTP is normally carried over UDP and gives the media pipeline sequence numbers and timestamps without imposing a reliable ordered byte stream. A real-time implementation can decide that a late packet is no longer worth waiting for. It may conceal the loss, drop part of a frame, request a new keyframe, or temporarily reduce bitrate or resolution. The picture may become soft or visibly damaged for a moment, but interaction can continue at roughly the same pace.

TCP usually protects completeness. A real-time RTP pipeline can protect continuity.

This is why our practical rule of thumb has been that wired plus TCP can feel similar to wireless plus RTP. RTP does not make Wi-Fi equivalent to Ethernet, and results depend on the encoder, buffers, hardware, and network. It does, however, give the application better tools for deciding what to sacrifice when delivery is imperfect.

Why one TCP latency number can be misleading.

TCP latency can be measured, but a single average does not describe the experience well. While the connection is clean, a TCP screen stream may remain in the range of a few tens of milliseconds in our local-network tests. When loss triggers retransmission and ordered delivery holds later data behind a missing segment, delay can rise abruptly. The user does not perceive this as a slightly larger average. The picture appears to stop and then catch up.

With our RTP-based path, normal media-transport delay has often been around the low tens of milliseconds, sometimes near 10 ms under favorable local conditions. More importantly, late media does not always have to extend the delay of everything behind it. The receiver can continue its presentation schedule and recover visual quality on later frames.

These figures are engineering observations from our implementations and test networks, not universal benchmarks for TCP or RTP. End-to-end display latency also includes capture, encoding, packetization, buffering, decoding, display refresh, and input handling. Changing any one of those can outweigh the transport difference.

The practical tradeoff

ConditionTCP streamReal-time RTP pipeline
Clean wired networkCan be very close to RTP and is simpler to build.Fast, but its resilience may not be visibly needed.
Loss or jitterRetransmission and ordered delivery can create a visible stall.Can skip late data and keep presenting newer frames.
Failure as perceived by the userThe image may freeze and then catch up.The image may briefly soften or show artifacts while motion continues.
Application complexityMany transport decisions are already made by TCP.The application must make media-specific recovery decisions.

RTP moves difficult decisions into the application.

RTP is not automatically faster simply because it uses UDP. The advantage comes from the policies built around it, and those policies are the difficult part.

The application must decide how long to wait for reordered packets, how large the jitter buffer should be, when a packet is too late to matter, how to recover from a damaged reference frame, when to request a keyframe, and how quickly to change bitrate or resolution. It must distinguish a temporary burst of loss from a network that has permanently become slower. Aggressive dropping lowers latency but can damage quality; conservative buffering improves quality but recreates the delay that RTP was meant to avoid.

TCP makes most of these choices implicitly. It provides a reliable stream and lets congestion control and retransmission determine when bytes become available. That is much easier to reason about, test, and maintain. The cost is that those general-purpose choices do not know whether the missing bytes belong to an obsolete video frame or a piece of data that must never be skipped.

Choosing for an interactive display.

If the network is controlled, wired, and consistently clean, TCP can deliver excellent results with a substantially simpler implementation. It should not be dismissed merely because it is not usually described as a real-time media transport.

If the product must remain responsive across ordinary Wi-Fi conditions, RTP offers a more useful failure mode. A temporary loss of sharpness is often preferable to stopping the desktop beneath the user's pointer. That continuity is especially important for a second display, where the screen is part of an active workspace rather than passive video playback.

For DeskJoin Screen, the important lesson is not that one protocol wins every test. It is that low latency is a policy: the system must continually decide whether to wait for perfect data or present the newest usable frame. TCP makes that decision simpler. RTP gives us more control over it.