NLB Architecture and Components
What you'll learn: The building blocks of a Network Load Balancer and how traffic moves through them at the transport layer.
The Core Components
A Network Load Balancer (NLB) operates at Layer 4 (the transport layer), meaning it routes TCP/UDP traffic based on IP addresses and ports—without inspecting the actual content inside packets.
Think of an NLB like a postal sorting facility that only looks at addresses on envelopes, never opening them to read the letters inside.
Key Components
Listeners: These define what traffic the NLB accepts. Each listener watches for connections on a specific protocol (TCP/UDP/TLS) and port number. For example, a listener on TCP port 443 catches all HTTPS traffic.
Target Groups: Collections of backend servers (targets) that receive traffic. Targets can be EC2 instances, IP addresses, or even other load balancers. Each target group is associated with a specific listener.
Health Checks: The NLB regularly pings each target to verify it's responsive. If a target fails health checks, the NLB stops sending new connections to it until it recovers. Unlike ALBs, NLB health checks are simpler—typically just checking if a TCP port responds.
How Traffic Flows
- Client connects to the NLB's IP address and port
- The listener accepts the connection based on protocol/port rules
- The NLB selects a healthy target from the target group
- Traffic flows directly to the target at Layer 4 (preserving the client's source IP)
- Health checks continuously monitor target availability
The NLB maintains extreme performance (millions of requests per second) because it doesn't need to decrypt, inspect, or modify packets—just route them.
Key Takeaway: NLBs use listeners (protocol/port watchers), target groups (backend server pools), and health checks (availability monitors) to route transport-layer traffic with ultra-low latency and preserve client IP addresses.