SysPad › Lessons › networking lessons › Network Load Balancer
How Network Load Balancer works
Layer-4 load balancer for TCP, UDP, and TLS traffic. Handles millions of requests per second with ultra-low latency (<1ms). Use for gaming, IoT, and latency-sensitive workloads.
The Network Load Balancer is the opposite design philosophy from an ALB: do as little as possible, as fast as possible. It works at Layer 4, forwarding raw TCP/UDP without reading the traffic, which lets it handle millions of connections per second at ultra-low latency, with a static IP and the client’s real source IP intact.
What you will learn
- What does "Layer 4" mean, and why does ignoring the payload make NLB so fast?
- Why do static IPs and source-IP preservation matter?
- What can an NLB NOT do that an ALB can?
- When is an NLB the right choice?
Layer 4: forward, don’t read
An NLB operates at the transport layer (Layer 4): it routes by IP and port and forwards TCP/UDP connections without parsing what’s inside. No HTTP awareness, no content rules, just fast connection handling.
Doing less per connection is exactly why it scales to millions of requests per second with very low, consistent latency.
Static IPs and source-IP preservation
An NLB provides a static IP per Availability Zone (and supports Elastic IPs), which matters when clients or firewalls need to allow-list a fixed address. It also preserves the client’s source IP, so backends see who actually connected.
⚓ Useful for IP allow-listing, IoT/gaming protocols, databases, and any non-HTTP service.
What it can’t do
Because it doesn’t read HTTP, an NLB can’t route by path/host/header, can’t do HTTP-specific features, and offers only connection-level health checks (plus optional HTTP checks). The smarts of an ALB simply aren’t there, by design.
When to choose NLB
Reach for an NLB when you have non-HTTP traffic (TCP/UDP), need extreme throughput or the lowest latency, require static IPs, or must preserve source IPs. Reach for an ALB for HTTP/HTTPS apps wanting content-based routing and HTTP features.
Flashcards
- Why is an NLB faster and higher-throughput than an ALB?
- It works at Layer 4, forwarding TCP/UDP without reading the payload. Less work per connection means millions of req/s at ultra-low latency.
- Two networking features NLB offers that matter for allow-listing/backends?
- A static IP per AZ (allow-listable) and source-IP preservation (backends see the real client IP).
- Name something an NLB cannot do.
- Route by HTTP path/host/header or apply HTTP-layer rules, it doesn’t read the request contents. That’s an ALB job.
- What traffic types is NLB designed for?
- TCP, UDP, and TLS at Layer 4, including non-HTTP protocols an ALB can’t handle.
- One-line: NLB vs ALB.
- NLB = fast Layer-4 (TCP/UDP), static IPs, source-IP. ALB = smart Layer-7 HTTP routing and features.
Sources
- AWS, What is a Network Load Balancer
- AWS, NLB static IP and source IP preservation
- AWS, Choosing a load balancer (ALB vs NLB vs GWLB)
Open the SysPad canvas · Official Network Load Balancer documentation