HTTP/2 multiplexing, full duplex, bidirectional streaming and QUIC explained

Five networking terms every developer hears in system design talks and interviews, explained in plain English: duplex, multiplexing, head-of-line blocking, bidirectional streaming and QUIC. Plus which protocols support what, and where each one sits: HTTP, TCP or UDP.

A road seen from above with three layers. On top, many small cars in different colours share one wide road, labelled multiplexing. In the middle, two lanes with traffic going in opposite directions at the same time, labelled full duplex. At the bottom, the road surface is split into two kinds of tarmac, TCP and UDP, with a fast new lane on the UDP side labelled QUIC.
Fig. 1 — Many conversations on one road, traffic in both directions, and a newer, faster lane underneath.

You’re in a design review, and someone says:

“We’ll use gRPC, since it runs on HTTP/2 multiplexing and supports full-duplex bidirectional streaming. For mobile, we should look at HTTP/3 over QUIC to avoid head-of-line blocking.”

Everyone nods. But what do those words actually mean? And why do they matter for the systems you build?

This article explains the five networking terms that come up again and again in system design: duplex, multiplexing, head-of-line blocking, bidirectional streaming and QUIC. For each one, you’ll see what it means, which protocols support it, and a small Java or Spring example. It builds on the API protocols article in this thread, so it helps to have read that one first.

First, where everything sits: the layers

Networking is built in layers. Each layer does one job and relies on the layer below it. You only need four of them to follow this article:

A stack of layers, top to bottom. Application layer: HTTP/1.1, HTTP/2, HTTP/3, gRPC, WebSocket, SSE. Security layer: TLS, which encrypts. Transport layer, split in two: TCP on the left (reliable, in order, a connection) and UDP on the right (fast, no promises), with QUIC sitting on top of UDP and including TLS inside it. Network layer at the bottom: IP, which moves packets between machines. On the left, HTTP/1.1, HTTP/2, gRPC and WebSocket stack down through TLS onto TCP. On the right, HTTP/3 stacks onto QUIC, which stacks onto UDP.
HTTP/1.1 and HTTP/2 ride on TCP. HTTP/3 rides on QUIC, which rides on UDP.
  • IP (network layer) moves small packets from one machine to another. It makes no promises: packets can be lost, repeated or arrive in the wrong order.
  • TCP and UDP (transport layer) sit on top of IP:
    • TCP gives you a reliable, ordered stream of bytes. It numbers every packet, resends lost ones and puts them back in order. That’s safe, but a lost packet makes everything behind it wait.
    • UDP just sends packets. No connection, no resending, no ordering. It’s fast and simple, and the application decides what to do about losses.
  • TLS encrypts the connection. It’s the “S” in HTTPS.
  • The application layer is where your protocols live: HTTP/1.1, HTTP/2, HTTP/3, gRPC, WebSockets and Server-Sent Events.

Keep this picture in mind. Each of the five terms belongs to a specific layer, and that’s where most of the confusion comes from.

Term 1: duplex (simplex, half duplex, full duplex)

Duplex describes which directions data can flow, and whether both can flow at the same time. There are three kinds:

Three panels. Simplex: a radio tower broadcasting to a radio; data flows one way only; examples Server-Sent Events and a TV broadcast. Half duplex: two walkie-talkies; both sides can talk, but only one at a time, saying 'over'; example classic HTTP/1.1 request then response. Full duplex: two people on a phone call; both can talk at the same time; examples TCP itself, WebSockets, and gRPC bidirectional streams.
Simplex: one way. Half duplex: both ways, taking turns. Full duplex: both ways at once.
  • Simplex: one direction only. Like a radio broadcast: the station talks, your radio listens, and you can’t talk back. Server-Sent Events (SSE) work this way: the server streams updates to the browser, and that’s it.
  • Half duplex: both directions, but one at a time. Like a walkie-talkie: you talk, say “over”, then listen. Classic HTTP/1.1 feels like this: the client sends a request, then waits for the full response before using that connection again.
  • Full duplex: both directions at the same time. Like a phone call: both people can talk and listen at once. TCP connections are full duplex, and so are WebSockets, HTTP/2 streams and gRPC bidirectional streams.

Here’s a full-duplex WebSocket in Spring. The server can reply to a message, and can also push messages whenever it likes, while the client keeps sending:

// Java · ChatSocketConfig.java (Spring WebSocket: full duplex)
@Configuration
@EnableWebSocket
class ChatSocketConfig implements WebSocketConfigurer {
    @Override
    public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
        registry.addHandler(new ChatHandler(), "/chat");
    }
}

class ChatHandler extends TextWebSocketHandler {
    @Override
    protected void handleTextMessage(WebSocketSession session, TextMessage message) throws IOException {
        // the client can send at any time...
        session.sendMessage(new TextMessage("got: " + message.getPayload()));
        // ...and the server can also push at any time, e.g. from another thread:
        // session.sendMessage(new TextMessage("Asha is typing..."));
    }
}

And here’s simplex, one-way streaming with Server-Sent Events in Spring WebFlux:

// Java · PriceController.java (SSE: server → client only)
@GetMapping(value = "/prices", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
Flux<Price> prices() {
    return priceFeed.updates();   // each new price is pushed to the browser as it happens
}

Term 2: multiplexing

Multiplexing means carrying many separate conversations over one shared channel at the same time. Think of a single wide road with many cars on it, instead of building a private road for each car.

The problem with HTTP/1.1

In HTTP/1.1, one connection handles one request at a time. If a web page needs 60 files (HTML, CSS, scripts, images), they queue up behind each other. To go faster, browsers open several connections per website (about six), but each one still carries just one request at a time. Every extra connection costs a TCP handshake, a TLS handshake and memory on both sides.

How HTTP/2 multiplexes

HTTP/2 keeps one TCP connection and splits every request and response into small frames. Each frame is labelled with a stream ID. Frames from different requests are mixed together on the wire, and the other side uses the stream IDs to put each message back together.

Top, HTTP/1.1: three separate connections, each carrying one request at a time, with requests 4, 5 and 6 waiting in a queue. Bottom, HTTP/2: one connection carrying small frames from streams 1, 3, 5 and 7 mixed together, each frame tagged with its stream number; on the other side, the frames are sorted back into four complete responses.
HTTP/1.1: one request per connection at a time. HTTP/2: many streams share one connection, cut into labelled frames.

The result: dozens of requests at once on one connection, with no queue. HTTP/2 also compresses headers (HPACK), which helps because many requests repeat the same headers.

Java’s built-in HttpClient uses HTTP/2 by default when the server supports it. Fire off many requests and they’re multiplexed over a single connection:

// Java · fetch 50 users at once over ONE HTTP/2 connection
HttpClient client = HttpClient.newBuilder()
        .version(HttpClient.Version.HTTP_2)          // the default since Java 11
        .build();

List<CompletableFuture<HttpResponse<String>>> calls = userIds.stream()
        .map(id -> HttpRequest.newBuilder(URI.create("https://api.example.com/users/" + id)).build())
        .map(req -> client.sendAsync(req, HttpResponse.BodyHandlers.ofString()))
        .toList();

CompletableFuture.allOf(calls.toArray(CompletableFuture[]::new)).join();
System.out.println(calls.getFirst().join().version());   // HTTP_2

To serve HTTP/2 from a Spring Boot app, one property is enough (browsers only use HTTP/2 over HTTPS, so set up TLS too):

# application.properties
server.http2.enabled=true
server.ssl.enabled=true

Who multiplexes? HTTP/2, HTTP/3 and gRPC (which is built on HTTP/2). HTTP/1.1 does not.

Term 3: head-of-line blocking

Head-of-line blocking is what happens when the first item in a queue is stuck, so everything behind it has to wait, even if those items are ready. Picture a supermarket queue where the first customer’s card is declined and the whole line stops.

It shows up at two different layers, and that’s the key to understanding HTTP/3:

Three rows. HTTP/1.1: a slow response for request 1 blocks requests 2 and 3 on the same connection; blocking at the HTTP layer. HTTP/2 over TCP: frames from streams A, B and C share one TCP connection; one TCP packet carrying a piece of stream A is lost, and TCP holds back everything after it, so streams B and C also freeze until the lost packet is resent; blocking at the TCP layer. HTTP/3 over QUIC: the same loss only pauses stream A, while streams B and C keep flowing, because QUIC tracks each stream separately.
HTTP/2 fixed head-of-line blocking at the HTTP layer, but TCP still has it. QUIC fixes it at the transport layer.
  • HTTP/1.1: a slow response blocks the next request on that connection. (HTTP layer.)
  • HTTP/2 over TCP: HTTP/2 removes the HTTP-level queue. But TCP delivers one ordered stream of bytes, and it doesn’t know about HTTP/2’s streams. If one packet is lost, TCP holds back everything after it until the lost packet is resent, so all streams freeze, even ones whose data already arrived. (TCP layer.)
  • HTTP/3 over QUIC: QUIC knows about streams, so a lost packet only pauses the one stream it belongs to. The others carry on.

On a clean office network, packet loss is rare and HTTP/2 is excellent. On a crowded mobile network, where packets go missing often, TCP’s head-of-line blocking can make HTTP/2 stall. That’s the main reason HTTP/3 exists.

Term 4: streaming and bidirectional streaming

Duplex is about the channel: can data flow both ways? Streaming is about the messages: instead of one request and one response, one side sends many messages over time on the same call.

gRPC names the four patterns clearly, so it’s the best way to learn them:

Four rows, each showing a client on the left and a server on the right. Unary: one request, one response, like a normal function call; example GetUser. Server streaming: one request, many responses; example a stock price feed or downloading results page by page. Client streaming: many requests, one response at the end; example uploading sensor readings then getting a summary. Bidirectional streaming: many messages in both directions at the same time, independently; example chat or live collaboration.
The four gRPC call types. Bidirectional streaming is both sides streaming at once, over one HTTP/2 stream.
Pattern Client sends Server sends Example
Unary 1 message 1 message Get a user by ID
Server streaming 1 message many messages Live price feed, large search results
Client streaming many messages 1 message Upload readings, get a summary
Bidirectional streaming (bi-streaming) many messages many messages, at the same time Chat, live collaboration, voice assistants

Bidirectional streaming (“bi-streaming”) is the most powerful: both sides send streams of messages independently and at the same time over one call. It needs a full-duplex channel underneath, which HTTP/2 streams provide.

In the .proto contract, the stream keyword on both sides makes a call bidirectional:

// chat.proto
service ChatService {
  rpc Chat (stream ChatMessage) returns (stream ChatMessage);   // bi-streaming
}

message ChatMessage {
  string room = 1;
  string from = 2;
  string text = 3;
}

The Java server receives a stream of messages and writes back its own stream, whenever it wants:

// Java · ChatService.java (gRPC bidirectional streaming)
public class ChatService extends ChatServiceGrpc.ChatServiceImplBase {
    @Override
    public StreamObserver<ChatMessage> chat(StreamObserver<ChatMessage> toClient) {
        rooms.join(toClient);                         // keep this caller so we can push to it later
        return new StreamObserver<>() {
            @Override public void onNext(ChatMessage msg) { rooms.broadcast(msg); }  // client → server, any time
            @Override public void onError(Throwable t)    { rooms.leave(toClient); }
            @Override public void onCompleted()           { rooms.leave(toClient); toClient.onCompleted(); }
        };
    }
}

Who supports what? gRPC supports all four patterns. WebSockets give you bidirectional messaging too, without a fixed contract. SSE only does server streaming. Browsers can’t use gRPC bidi streams directly: gRPC-Web supports only unary and server streaming, so for two-way streaming in a browser you’d normally use WebSockets.

Term 5: QUIC and HTTP/3

QUIC is a newer transport protocol, originally built at Google and standardised in 2021. It does the job TCP does (reliable, ordered delivery) but it’s built on top of UDP, and it fixes TCP’s biggest weaknesses for the modern web. HTTP/3 is simply HTTP running over QUIC.

Two columns comparing connection set-up and features. Left, HTTP/2 over TCP and TLS 1.3: one round trip for the TCP handshake, then one round trip for the TLS handshake, then the first request, so two round trips before data. Right, HTTP/3 over QUIC: transport and encryption handshakes combined in one round trip, or zero round trips when reconnecting to a known server. Below, three QUIC features with icons: streams built into the transport, so no head-of-line blocking between streams; encryption always on, with TLS 1.3 built in; and connection migration, a phone moving from Wi-Fi to mobile data keeps the same connection thanks to a connection ID instead of an IP address.
QUIC folds the transport and encryption handshakes together, understands streams, and survives a change of network.

What QUIC brings:

  1. No head-of-line blocking between streams. Streams are part of the transport, so a lost packet only delays its own stream.
  2. Faster connection set-up. TCP needs one round trip to connect, then TLS 1.3 needs another. QUIC does both in one round trip, and can send data in zero round trips when reconnecting to a server it has talked to before.
  3. Encryption is always on. TLS 1.3 is built into QUIC. There is no unencrypted QUIC.
  4. Connection migration. A TCP connection is tied to your IP address, so it breaks when your phone switches from Wi-Fi to mobile data. A QUIC connection is identified by a connection ID, so it can carry on across the switch.

Why run on UDP instead of fixing TCP? TCP is built into operating systems and countless routers and firewalls, and changing it would take decades. UDP is already everywhere and gets out of the way, so QUIC can do all its clever work in ordinary software that can be updated quickly.

The catches:

  • Some company networks and firewalls block or slow down UDP, so clients must be able to fall back to HTTP/2. Browsers do this automatically.
  • QUIC does more work in software, so it can use more CPU than TCP, which has decades of operating-system tuning behind it.
  • Inside a data centre, where networks are fast and rarely lose packets, HTTP/2 is usually still the right choice for service-to-service calls. HTTP/3 shines most for users on mobile and unreliable networks.

HTTP/3 in Java and Spring

Since Java 26, the built-in HttpClient can speak HTTP/3. It still defaults to HTTP/2, so you opt in:

// Java 26+ · prefer HTTP/3, fall back automatically if the server doesn't support it
HttpClient client = HttpClient.newBuilder()
        .version(HttpClient.Version.HTTP_3)
        .build();

HttpResponse<String> res = client.send(
        HttpRequest.newBuilder(URI.create("https://example.com/")).build(),
        HttpResponse.BodyHandlers.ofString());

System.out.println(res.version());   // HTTP_3 if the server supports it

On the server side, Spring WebFlux apps running on Reactor Netty 1.2+ (Spring Boot 3.4 and later) can serve HTTP/3 through a server customizer. Support is still marked experimental, so in practice many teams put a load balancer or CDN in front that speaks HTTP/3 to users and HTTP/2 to the app behind it.

Which protocols support what

Here’s the whole picture in one table:

Protocol Runs on Multiplexing Duplex Streaming Head-of-line blocking In browsers
HTTP/1.1 TCP No (one request at a time per connection) Half duplex in practice Response body only Yes, at HTTP and TCP level Yes
HTTP/2 TCP (+TLS) Yes, streams on one connection Full duplex streams Yes Only at TCP level Yes (HTTPS)
HTTP/3 QUIC over UDP Yes, streams in the transport Full duplex streams Yes No, between streams Yes, most modern browsers
gRPC HTTP/2 Yes Full duplex Unary, server, client and bidi At TCP level Partly, via gRPC-Web (no bidi)
WebSocket TCP (starts as an HTTP/1.1 upgrade) No, one socket per connection Full duplex Messages both ways At TCP level Yes
SSE HTTP/1.1 or HTTP/2 Via HTTP/2 Simplex (server → client) Server streaming Like the HTTP version it uses Yes
Raw TCP IP No Full duplex Byte stream Yes No
Raw UDP IP No streams Both ways, no connection Single packets No, but no delivery promise either No

Puzzle 1: HTTP/2 made mobile slower

With HTTP/1.1, the app had about six separate TCP connections. A lost packet only stalled the one connection it was on, so only one request waited.

With HTTP/2, everything shares one TCP connection. On a lossy network, every lost packet makes TCP hold back all streams until it’s resent: TCP-level head-of-line blocking. So the whole screen freezes. HTTP/3 over QUIC is the real fix, because a lost packet only pauses its own stream.

Puzzle 2: is a WebSocket “HTTP”?

It starts as HTTP and then stops being HTTP. The client sends an ordinary HTTP/1.1 request with an Upgrade: websocket header. The server answers 101 Switching Protocols, and from then on, the same TCP connection carries WebSocket frames, not HTTP. That’s why WebSockets pass through most proxies (they look like HTTP at first) but still need proxies and load balancers that understand long-lived connections. (There are also newer standards for running WebSockets over HTTP/2 and HTTP/3 streams, but the HTTP/1.1 upgrade is still the common case.)

Quick reference

  • Simplex: data flows one way only (SSE).
  • Half duplex: both ways, taking turns (classic HTTP/1.1 request, then response).
  • Full duplex: both ways at the same time (TCP, WebSockets, HTTP/2 streams).
  • Multiplexing: many conversations share one connection (HTTP/2, HTTP/3, gRPC).
  • Head-of-line blocking: one stuck item makes everything behind it wait (HTTP/1.1 at HTTP level, HTTP/2 at TCP level).
  • Bidirectional streaming: both sides send many messages at once on one call (gRPC bidi, WebSockets).
  • QUIC: a reliable, encrypted, multiplexed transport built on UDP; HTTP/3 runs on it.

Key takeaways

  1. Know the layer. HTTP/1.1, HTTP/2 and WebSockets ride on TCP. HTTP/3 rides on QUIC, which rides on UDP.
  2. Duplex is about direction: one way, taking turns, or both at once.
  3. Multiplexing lets HTTP/2 carry many requests on one connection, which removes HTTP/1.1’s queues.
  4. HTTP/2 still suffers from TCP’s head-of-line blocking on lossy networks. QUIC fixes it.
  5. Bidirectional streaming needs a full-duplex channel. gRPC does it on HTTP/2 streams; in browsers, use WebSockets.
  6. QUIC gives faster set-up, always-on encryption and connection migration, but needs a fallback where UDP is blocked. In Java, HttpClient speaks HTTP/3 from Java 26.

This rounds off the Communication & integration thread: sync vs async, API protocols, delivery guarantees, and now the network underneath them.

Comments

LEAVE A COMMENT
No sign-up. Comments appear after a quick review.