Compare
Side-by-side on the decisions that recur: TCP vs UDP, HTTP/2 vs HTTP/3, flow vs congestion control, L4 vs L7, forward vs reverse proxy, IPv4 vs IPv6 — with when to choose each.
TCP vs UDPHTTP/2 vs HTTP/3Flow control vs Congestion controlSwitch vs RouterForward proxy vs Reverse proxyL4 load balancing vs L7 load balancingServer-Sent Events vs WebSocketsIPv4 vs IPv6ARP (IPv4) vs Neighbor Discovery (IPv6)Keep-alive (reuse) vs New connection per request
| L4 load balancing | L7 load balancing | |
|---|---|---|
| Sees | IP addresses and TCP/UDP ports | HTTP: method, path, headers, cookies |
| Decision granularity | Per connection | Per request — many requests on one connection can go to different backends |
| TLS | Passed through; the backend terminates it | Usually terminated here; backend traffic may be plain or re-encrypted |
| Routing rules | Hash of 5-tuple, round robin, least connections | Path prefix, host header, header value, weighted canaries |
| Cost per byte | Very low; can run in the kernel or on hardware | Higher: parses and re-serialises every request |
| Client IP at the backend | Preserved (DSR / NAT modes vary) | Lost unless X-Forwarded-For or PROXY protocol |
| Health check | Can the port accept a TCP connection? | Does GET /healthz return 200? |
| Choose this when | Non-HTTP traffic, very high throughput, or when backends must terminate TLS themselves. | Path- or header-based routing, canaries, sticky sessions by cookie, TLS offload, and HTTP-aware retries. |