Skip to content
Tutorials Center
My learning

Topics

Lesson 44 of 79 ยท Transport Layer

QUIC, SCTP and Modern Transports

Learn why TCP's single ordered stream causes head-of-line blocking, and how QUIC streams, 0-RTT, connection migration, SCTP and MPTCP address its limits.

TCP has served the Internet for more than forty years, and it is still the right tool for many jobs. But three of its design decisions have become painful on today's networks: it delivers one strictly ordered byte stream per connection, it needs a separate handshake before encryption can even start, and a connection is tied to one pair of IP addresses, so it breaks when your phone switches from Wi-Fi to cellular.

You cannot simply fix TCP, because routers, firewalls and middleboxes all over the Internet inspect and sometimes rewrite TCP headers. Changing it is slow and breakable ("ossification"). This lesson shows the problems, and then the newer transports that work around them: QUIC (now carrying HTTP/3), SCTP and MPTCP.

Head-of-line blocking

A web page needs many resources at once: HTML, a stylesheet, scripts, images. HTTP/2 sends them all as independent streams multiplexed over one TCP connection. That is efficient, but TCP does not know about streams. It sees one sequence of bytes and promises to deliver them in order.

Suppose one packet is lost. TCP must hold back every later byte, even bytes that belong to other, unaffected streams, until the missing packet has been retransmitted. This is head-of-line (HOL) blocking: the first item in the queue blocks everything behind it.

sequenceDiagram
    participant S as Sender
    participant R as Receiver (TCP)
    S->>R: packet 1 (stream A)
    S-xR: packet 2 (stream B) lost
    S->>R: packet 3 (stream C)
    S->>R: packet 4 (stream A)
    Note over R: 3 and 4 arrived but must wait.<br/>TCP delivers nothing until 2 is resent.
    S->>R: packet 2 again
    Note over R: now 2, 3 and 4 are delivered together

A lost packet from stream B also delays streams A and C, although their data arrived intact.

The simulation below sends 12 packets that carry three streams (A, B and C) in turn. The one-way delay is 20 ms and packet 4 is lost, which costs one extra round trip (40 ms) to detect and resend. For each packet it prints when the data became usable by the application: first with TCP's single ordered stream, then with independent streams as in QUIC.

Python Head-of-line blocking: TCP versus independent streams

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Stream B lost data, so it must wait in both cases (68 ms). But streams A and C finish at 38 ms and 42 ms with independent streams, versus 68 ms behind TCP. On a lossy mobile network this adds up to visible delays.

QUIC

QUIC is a transport protocol that runs on top of UDP (see UDP). Using UDP is not about unreliability: it is a way to get through existing devices, which already let UDP datagrams pass. QUIC builds its own reliability, congestion control and encryption inside those datagrams, entirely in software on the endpoints, so it can evolve without waiting for operating system or router upgrades. It was designed at Google, standardized by the IETF in 2021 (RFC 9000), and is the transport beneath HTTP/3.

Feature TCP + TLS QUIC
Runs over IP directly UDP
Streams One ordered byte stream Many independent streams in one connection
Handshake TCP handshake, then TLS handshake Transport and TLS 1.3 combined
Encryption Optional, a separate layer Always on, built in
Identifies a connection by Source/destination IP and port A connection ID
Implemented in Operating system kernel Application library (usually)

Independent streams

Inside one QUIC connection you open as many streams as you like. Each stream has its own sequence numbers and its own ordering. A lost packet delays only the streams whose data it carried; everything else keeps flowing. This removes the head-of-line blocking you just measured. (Within a single stream, data is still delivered in order, which is what applications expect.)

Note that QUIC packets are protected too: nearly all of the header and all of the payload is encrypted, so middleboxes cannot inspect or tamper with them. That is a deliberate defence against ossification.

Faster connection setup

Before a browser can send an HTTP request over TCP and TLS 1.3, it needs one round trip for the TCP handshake and another for the TLS handshake. QUIC merges transport and cryptographic setup into one exchange. If the client has talked to the server before, 0-RTT resumption lets it send application data in its very first flight, using a key remembered from the earlier session.

Python Time until the first response byte

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The numbers ignore DNS lookups and server processing time, but the shape is the point: every round trip you remove saves a whole RTT, and on a 300 ms satellite or mobile path that is a lot.

0-RTT data is not protected against replay: an attacker who records the first flight can send it again. Servers should accept 0-RTT only for requests that are safe to repeat, such as a plain GET.

Connection migration

A TCP connection is identified by the 4-tuple (source IP, source port, destination IP, destination port). If your phone leaves the Wi-Fi network, its source IP changes and every TCP connection dies. QUIC connections are identified by a connection ID chosen by the endpoints, not by addresses. When the client moves to a new network it keeps sending packets with the same connection ID from its new address (after a quick path validation), and the transfer continues.

Python Finding a connection: 4-tuple versus connection ID

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Real QUIC is a little more careful: it validates the new path before sending much data (so an attacker cannot redirect a flood), and it rotates connection IDs so that an observer cannot link a user's activity across networks.

Other modern transports

SCTP

The Stream Control Transmission Protocol (RFC 4960) was designed for telephony signalling in the early 2000s and shares ideas that QUIC later popularized:

  • Message-oriented. Unlike TCP, SCTP preserves message boundaries, so there is no framing problem as in socket programming.
  • Multi-streaming. One association carries several streams, and loss on one does not block the others.
  • Multi-homing. An endpoint can have several IP addresses, and the association fails over to another path if one stops working.
  • A four-way handshake with a cookie, which makes it resistant to the SYN flood attack that affects TCP's handshake.

SCTP runs directly on IP (protocol number 132), and that is also its weakness: many NATs and firewalls drop anything that is not TCP or UDP, so it never became popular on the public web. It is widely used inside telecom networks (for example in 4G and 5G signalling, see cellular networks) and underneath WebRTC data channels, where it is tunnelled inside UDP.

Multipath TCP

MPTCP keeps TCP's semantics but lets a single connection use several network paths at once, for example Wi-Fi and cellular together. To applications it looks like an ordinary TCP socket. Underneath it creates several regular TCP subflows, each with its own addresses, and spreads the data across them while presenting one ordered stream. Phones use it for seamless handover, and data centers and some ISPs use it to combine links. It was designed to look like normal TCP on each path, so it can pass through most middleboxes.

flowchart LR
    APP["Application<br/>one socket"] --> MP["MPTCP layer"]
    MP --> SF1["TCP subflow 1<br/>Wi-Fi"]
    MP --> SF2["TCP subflow 2<br/>cellular"]
    SF1 --> NET((Internet))
    SF2 --> NET

MPTCP stripes one connection over several ordinary TCP subflows.

DCCP

The Datagram Congestion Control Protocol (RFC 4340) targets applications that want timely delivery rather than perfect delivery, such as streaming audio, video calls and online games. UDP gives them speed but no congestion control, so a heavy UDP sender can flood a path. TCP is fair but retransmits old data that is no longer useful. DCCP sits in between: unreliable datagrams with congestion control. The sender is slowed when the network is congested, but a lost packet is never retransmitted.

Key features:

  • A connection with a handshake, using packet types Request, Response and Ack, and a clean close with Close, CloseReq and Reset. Other types are Data, DataAck, Sync and SyncAck.
  • Pluggable congestion control. Each half-connection chooses a CCID: CCID 2 behaves like TCP (additive increase, multiplicative decrease, bumpy rate), while CCID 3 uses TCP-Friendly Rate Control (TFRC), which changes the rate smoothly, better for audio and video.
  • Sequence numbers count packets, not bytes, and each packet is acknowledged so the sender can measure loss, even though lost data is not resent.
  • Service codes that let a host tell which application a connection is for, and a partial checksum (checksum coverage) so damaged payloads can still be delivered when the application prefers a corrupted frame to none.

The header is small: 16-bit source and destination ports, a data offset, a 4-bit CCVal and 4-bit checksum coverage, a 16-bit checksum, the packet type and a 48-bit sequence number (a short 24-bit form also exists). DCCP runs directly on IP as protocol 33, so, like SCTP, it meets NATs and firewalls that drop anything not TCP or UDP. That is the main reason it stayed rare, and the Linux kernel has deprecated its implementation. Its ideas live on in QUIC's pluggable congestion control and in WebRTC's congestion controllers.

RUDP and "reliable UDP"

RUDP (Reliable UDP) names two things. The formal one is a 1999 Internet-Draft from the SIGTRAN group, meant to carry telephony signalling over IP. It added acknowledgments, retransmission, sequence numbers, keep-alives and optional checksums to UDP, with header flags such as SYN, ACK, EAK (extended acknowledgment), RST and NUL (keep-alive). It never became an RFC and is not the same as QUIC.

The other meaning is generic: any application-level scheme that builds some reliability on UDP, because the application wants something TCP does not offer. Typical choices are per-message reliability (resend only important messages), no head-of-line blocking, or custom timers. Game networking libraries, media streaming and file-transfer tools such as UDT use designs like this, and QUIC is the standardized, secure, congestion-controlled descendant of the idea.

The cost of "reliable UDP" is that you must write acknowledgments, timers and congestion control yourself, and a careless version can harm a network. Reuse a well-tested library or QUIC rather than inventing one for production.

Protocol Reliable? Ordered? Congestion control Runs over
UDP No No None IP (17)
DCCP No No Yes (CCID 2, 3) IP (33)
Reliable-UDP schemes Yes (or selectively) Optional Varies, often basic UDP
TCP Yes Yes Yes IP (6)

The toy below shows the difference in miniature. The first part is a stop-and-wait scheme with sequence numbers and acknowledgments over a channel that loses 30% of packets; the second is DCCP-style delivery, where lost datagrams are simply skipped.

Python Reliable UDP versus DCCP-style delivery

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Every message arrives in the first scheme, at the cost of 17 transmissions for 5 messages, while the second delivers only the packets that survived. Real stacks use sliding windows and adaptive timers (see flow control and ARQ); stop-and-wait keeps the toy readable.

Choosing a transport

Need Good choice
Reliable, ordered, works everywhere TCP
Simple request/response, tiny messages, custom reliability UDP
Web traffic with many resources, mobile clients, fast setup QUIC (HTTP/3)
Telecom signalling, multi-homing, message framing SCTP
Using several paths for one TCP connection MPTCP

QUIC is not a drop-in win everywhere. Because it runs in user space it uses more CPU than a kernel TCP stack, some corporate networks block UDP port 443, and congestion control still has to behave fairly. That is why browsers try HTTP/3 and quietly fall back to HTTP/2 over TCP when it does not work.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. What is head-of-line blocking in TCP?

    TCP delivers one ordered byte stream, so bytes after a gap must wait until the gap is filled, regardless of which application stream they belong to.
  2. 2. Why does QUIC run on top of UDP?

    Middleboxes already forward UDP, and a new IP protocol would be blocked. QUIC implements loss recovery, congestion control and TLS 1.3 itself, in the endpoints.
  3. 3. A phone moves from Wi-Fi to cellular during a QUIC download. Why can the connection survive?

    The server finds the connection by its ID. After validating the new path, the transfer continues from the client's new address.
  4. 4. Which transport preserves message boundaries, supports several streams and multi-homing, and runs directly over IP?

    SCTP is message-oriented, multi-streamed and multi-homed. MPTCP still gives a single byte stream, UDP has no streams or associations, and TCP is a single byte stream.
  5. 5. Why should servers be careful with QUIC 0-RTT data?

    0-RTT data is sent before the handshake proves freshness, so a recorded flight can be sent again. Accept it only for idempotent requests.

Summary

  • TCP's single ordered stream causes head-of-line blocking: one lost packet delays every stream multiplexed over the connection.
  • QUIC runs over UDP, encrypts everything with TLS 1.3, gives each stream its own ordering, and combines transport and cryptographic handshakes. Return visits can use 0-RTT, with replay caveats.
  • A connection ID lets QUIC survive IP address changes, which TCP's 4-tuple cannot.
  • SCTP offers messages, multi-streaming and multi-homing but is limited by middleboxes. MPTCP spreads one TCP connection over several paths.
  • Browsers use HTTP/3 over QUIC where it works and fall back to TCP where it does not.
  • DCCP offers congestion-controlled but unreliable datagrams; "reliable UDP" is a family of application-level schemes (and an old, never-standardized draft) that add acknowledgments to UDP.

Next, move up to the layer you use every day, starting with Application Layer Protocols and Architectures.