Covers HTTP/2 multiplexing and HPACK, TCP head-of-line blocking, HTTP/3 over QUIC (QPACK, 0-RTT, connection migration), enabling them in Kestrel and HttpClient on .NET 10, and when the gain is real.
HTTP/2 sends many requests as multiplexed streams over one TCP connection, with binary framing and HPACK header compression, so you stop paying for extra connections and HTTP/1.1's one-request-at-a-time queue. But it still runs on TCP, so one lost packet stalls every stream: TCP head-of-line blocking.
HTTP/3 moves to QUIC over UDP with TLS 1.3 built in: each stream recovers from loss on its own, the handshake is faster (1-RTT, 0-RTT on resume), and connections survive a network change.
In .NET 10, Kestrel serves HTTP/1.1 and HTTP/2 by default. HTTP/3 is a one-line opt-in: MsQuic ships with .NET on Windows, and on Linux you install the libmsquic package. The gain is real on high-latency, lossy mobile networks with many parallel requests and for gRPC; for a single big response inside one Azure region it is usually noise. Measure per protocol before you claim it.
"HTTP/1.1 can only have one request in flight per connection, so clients open several connections and requests still queue behind each other. HTTP/2 fixes that at the HTTP layer: requests become streams of binary frames interleaved on one TCP connection, and headers are compressed with HPACK, which matters when every request carries a 1 KB bearer token. But TCP delivers bytes in order, so if one packet is lost, every stream waits for the retransmit. That is TCP head-of-line blocking, and on a lossy mobile link HTTP/2 can be worse than several HTTP/1.1 connections.
HTTP/3 solves that by running over QUIC on UDP. QUIC does its own reliability per stream, so a lost packet only stalls its stream. It folds TLS 1.3 into the transport handshake, so a new connection costs one round trip, and resumption can be zero. It also uses connection IDs, so a phone moving from Wi-Fi to 5G keeps its connection. In .NET 10, Kestrel serves HTTP/1.1 and HTTP/2 on HTTPS endpoints by default. HTTP/3 is opt-in: you set
Protocols = Http1AndHttp2AndHttp3, need MsQuic (bundled on Windows,libmsquicon Linux), and clients discover it through theAlt-Svcheader. HttpClient still defaults to HTTP/1.1, so you setDefaultRequestVersionandVersionPolicyyourself, and in .NET 10 trimmed or Native AOT apps have HTTP/3 off in HttpClient unless you turn it back on.The mistake I see is enabling HTTP/3 and expecting the p95 to halve. Between two services in the same Azure region, with sub-millisecond RTT and almost no loss, the difference is noise; and often a load balancer in the middle terminates the connection and speaks HTTP/1.1 to the app anyway. Protocols help when round trips and loss hurt; measure where your users are."
| HTTP/1.1 | HTTP/2 | HTTP/3 | |
|---|---|---|---|
| Transport | TCP | TCP | QUIC (UDP) |
| Requests per connection | 1 at a time | Many streams | Many streams |
| Header compression | None | HPACK | QPACK |
| HOL blocking | HTTP and TCP | TCP only | None across streams |
| New connection | TCP + TLS (2–3 RTT) | Same | 1 RTT, 0-RTT resume |
| Network change | New connection | New connection | Connection migration |
| Situation | Expected gain |
|---|---|
| Mobile clients, high RTT, packet loss, many small parallel calls | HTTP/3 can cut tail latency noticeably |
| SPA loading many assets/API calls from one host | HTTP/2 removes connection limits |
| gRPC | HTTP/2 is required; HTTP/3 optional |
| Service-to-service in one region, few large calls | Little or none |
A field-service app used by technicians in regional Australia made 30 small API calls on its home screen. Enabling HTTP/2 at Azure Front Door dropped home-screen p95 from 3.1 s to 1.9 s; adding HTTP/3 at the edge brought p95 on poor connections down a further ~20%, while the median barely moved. Inside the region, app-to-app calls stayed on HTTP/1.1 with no measurable loss.
Checks that the candidate understands what each HTTP version changes at the transport level, can enable them in .NET, and knows when the gain is real versus marketing.
Green flags
Red flags
conn 1: [GET /a ......][GET /d ......]
conn 2: [GET /b ........................] <- slow response blocks this conn
conn 3: [GET /c ..][GET /e ..]
One request per connection at a time (pipelining exists but is effectively unused). Browsers cap at ~6 connections per host, so extra requests queue.
TCP connection
| HEADERS(s1) | HEADERS(s3) | DATA(s1) | DATA(s3) | DATA(s1) | ...
Authorization and cookies cost a few bytes after the first request.Limits.Http2.InitialConnectionWindowSize (default 1 MB) and InitialStreamWindowSize (default 768 KB); large uploads or streaming over high-RTT links may need more, at the cost of memory per connection.SETTINGS_MAX_CONCURRENT_STREAMS limits parallel streams (Kestrel Limits.Http2.MaxStreamsPerConnection, default 100).Priority header (urgency and incremental) used by HTTP/3 too. Don't rely on server-side priority for API latency.TCP guarantees in-order bytes. If segment 41 is lost, segments 42–60 sit in the kernel buffer until 41 is retransmitted, even if they belong to other streams. With 2% loss, one HTTP/2 connection can underperform six HTTP/1.1 connections.
UDP datagrams
QUIC packet [conn-id][stream 1 frame][stream 5 frame]
-> lost packet affects only streams 1 and 5
Protocols = Http2 explicitly and is mainly for gRPC behind a proxy. HTTP/3 requires Http1AndHttp2AndHttp3, TLS, and MsQuic (shipped with .NET on Windows; install libmsquic from the Microsoft package repository on Linux); if it is missing, Kestrel logs it and falls back. Kestrel sends Alt-Svc so clients can upgrade on later requests.DefaultRequestVersion is 1.1. Set HttpVersion.Version20 or Version30 with HttpVersionPolicy.RequestVersionOrLower to fall back gracefully. In .NET 10, PublishTrimmed or PublishAot disable HTTP/3 in System.Net.Http by default (a feature switch can re-enable it).| Client | RTT | Typical effect |
|---|---|---|
| Same Azure region | <2 ms | Negligible |
| Sydney user to Australia East | 5–20 ms | Small; HTTP/2 helps many-call pages |
| Perth or regional 4G to Australia East | 50–100 ms, some loss | HTTP/2 and HTTP/3 help noticeably; HTTP/3 helps the tail |
| Overseas user to Australia East | 150–300 ms | Handshake savings and an edge PoP matter most |
--http3 for HTTP/3) with realistic RTT and loss injected (tc netem on Linux).HttpContext.Request.Protocol) and split latency by it.curl --http3 -v; check the Alt-Svc header on an HTTP/2 response first.Request.Protocol per request and chart the share of each version.tc qdisc add dev lo root netem delay 80ms loss 2% and compare HTTP/1.1, HTTP/2 and HTTP/3 with a load tool.http.client.open_connections with dotnet-counters.PublishAot=true and confirm HttpClient HTTP/3 behaviour changes.Enabling HTTP/3 in Kestrel and asking for it from HttpClient with a safe fallback:
// Program.cs (server)
using Microsoft.AspNetCore.Server.Kestrel.Core;
var builder = WebApplication.CreateBuilder(args);
builder.WebHost.ConfigureKestrel(k =>
{
k.ListenAnyIP(5001, listen =>
{
// Keep 1.1 and 2 for clients and networks that block UDP 443.
listen.Protocols = HttpProtocols.Http1AndHttp2AndHttp3;
listen.UseHttps(); // HTTP/3 requires TLS 1.3
});
});
var app = builder.Build();
// Log which protocol was negotiated so latency can be split by it.
app.Use(async (ctx, next) =>
{
using var _ = app.Logger.BeginScope(new Dictionary<string, object> { ["HttpProtocol"] = ctx.Request.Protocol });
await next(ctx);
});
app.MapGet("/ping", (HttpContext ctx) => Results.Ok(new { protocol = ctx.Request.Protocol }));
app.Run();
// Client registration in another service
using System.Net;
builder.Services.AddHttpClient<CatalogueClient>(c =>
{
c.BaseAddress = new Uri("https://catalogue.example.com.au");
c.DefaultRequestVersion = HttpVersion.Version30;
c.DefaultVersionPolicy = HttpVersionPolicy.RequestVersionOrLower; // fall back to 2 or 1.1
});
public sealed class CatalogueClient(HttpClient http)
{
public async Task<string> PingAsync(CancellationToken ct) =>
await http.GetStringAsync("/ping", ct);
}
# Verify from the command line
curl -sI --http2 https://localhost:5001/ping | grep -i alt-svc
curl -s --http3 https://localhost:5001/ping
Http1AndHttp2AndHttp3 and let Alt-Svc upgrade.Alt-Svc, or a firewall dropping UDP 443. Why it is wrong: the protocol never reaches the app, or all traffic lands on one pod. Instead: check each hop's supported protocols, use L7 balancing for HTTP/2/gRPC, and log Request.Protocol in the app.DefaultRequestVersion and VersionPolicy.EnableMultipleHttp2Connections = true.103 Early Hints, Link: rel=preload) or fewer, larger requests.Protocol upgrades are a network-latency tool, not a server-speed tool. A senior asks where the round trips and losses are: almost always the client-to-edge leg. That's why the strategic move is usually architectural: terminate HTTP/2 and HTTP/3 at an edge close to users (Azure Front Door or a CDN with points of presence in Sydney, Melbourne and Perth, or overseas for international users), keep warm pooled connections from the edge to the origin in Australia East, and cache what you can at the edge. Inside the data centre, connection reuse and fewer calls matter far more than the protocol version.
| Option | When it fits | Cost | When not to |
|---|---|---|---|
| HTTP/2 end to end | gRPC, many parallel calls to one host | Mostly config | Proxies that don't support it |
| HTTP/3 at the edge/CDN | Mobile, regional or overseas users, lossy networks | UDP 443 open, more CPU (paid by the edge) | Corporate networks that block UDP |
| HTTP/3 on Kestrel | Direct client connections, no edge proxy | libmsquic on Linux, ops work | Behind an L7 proxy that terminates anyway |
| Stay on HTTP/1.1 | In-region service calls with pooled connections | None | When you need gRPC or multiplexing |
On security: QUIC can't be run without TLS 1.3 and encrypts most transport metadata, which is good for privacy but makes middlebox inspection and some network troubleshooting harder; 0-RTT resumption trades a round trip for replay risk, so servers should accept 0-RTT only for idempotent requests.
HTTP is a request/response protocol: method + path + headers (+ body) in, status + headers (+ body) out.
GET/HEAD/OPTIONS are safe; GET, PUT, DELETE are idempotent (repeating has the same effect); POST and usually PATCH are not, so retries need an idempotency key.Content-Type, Accept, Authorization, Cache-Control, ETag/If-None-Match, Retry-After, traceparent.Use TCP for most APIs, databases and file transfer. Use UDP for DNS, real-time media, games, metrics (StatsD) and as the base for QUIC. HTTP/3 runs on QUIC over UDP so it can combine TLS 1.3 with the transport handshake, avoid TCP's head-of-line blocking between streams, and survive network changes.
A load balancer spreads traffic across healthy instances.
Health checks remove unhealthy instances (in Kubernetes: readiness for traffic, liveness for restarts). Algorithms: round robin, least connections/requests, hashing. Sticky sessions pin a user to one instance, which hurts scaling and failover. Connection draining stops new traffic to an instance before shutdown so in-flight requests finish.
gRPC uses long-lived HTTP/2 connections, so an L4 balancer balances connections, not calls: one client connection carries all its calls to one pod. Use L7 balancing (mesh/Envoy) or client-side load balancing.
How to tell it (STAR)
**S:** At [company], we switched our mobile API to HTTP/2 expecting faster screens, but users on weak connections in [regional areas] started reporting slower loads. **T:** I was asked to find out why and fix it without undoing the gains for everyone else. **A:** I split our client-side telemetry by network type and saw p99 had risen only on lossy connections. I reproduced it with netem and k6, and showed that one HTTP/2 connection stalled every request on a lost packet, while six HTTP/1.1 connections had spread that risk. We enabled HTTP/3 at the edge for capable clients and, more importantly, merged 28 home-screen calls into 4. **R:** p99 on poor connections dropped from 3.8 s to [1.9 s], the median kept its improvement, and protocol changes now need a loss-injected load test first.
Last updated 23 Nov 2026.