Layer 4 versus layer 7

Layer 4 devices route TCP or UDP packets by address and port, very fast and protocol-agnostic. Layer 7 devices read HTTP, so they can route by path, terminate TLS and inspect headers, at slightly higher cost.

Where it shows up in real systems

  • Network load balancer

    It does not read HTTP, so it cannot route by path, but it handles millions of connections per second with sub-millisecond overhead. Use it for non-HTTP protocols, static IPs or extreme throughput.

    In production: AWS Network Load Balancer, Google Cloud Network LB, HAProxy (TCP mode), LVS

See it break, then fix it

Build an architecture, send it a day of traffic and outages, and learn why it holds or fails. Free to start.