Network Load Balancer (NLB)

When to Use NLB?

What if you need a static IP?

If you need static IPs, consider:

  • NLB (Network Load Balancer): Supports Elastic IPs, which are static
  • You can put ALB behind NLB using AWS Global Accelerator for static IPs + HTTP/HTTPS support

NLB vs ALB Comparison

Feature / Use CaseNLB (Network Load Balancer)ALB (Application Load Balancer)
OSI LayerLayer 4 (TCP, UDP, TLS) TransportLayer 7 (HTTP, HTTPS, WebSocket) Application
Protocol SupportTCP, UDP, TLSHTTP, HTTPS, WebSocket
PerformanceUltra-high performance; millions of requests/secHigh performance, but slightly lower than NLB
LatencyUltra-low (suitable for real-time systems)Slightly higher due to Layer 7 processing
Static IP Support✅ (Elastic IPs)❌ (uses dynamic IPs)
Preserve Client IPOnly via X-Forwarded-For header
TLS Termination
Advanced Routing (URL path, host-based, headers, etc.)
WebSocket Support✅ (via TCP)
Target TypesEC2, IP, ALBsEC2, IP, Lambda
Use with PrivateLink✅ (required)
AWS WAF Integration
Best ForReal-time apps, gaming, messaging, low-latency needs, private servicesWeb apps, microservices, API Gateway, advanced routing needs

DNS Lookup Example

$ nslookup WebServer-nlb-5de2d39359116356.elb.us-east-1.amazonaws.com

Resources

Deploying AWS Elastic Load Balancers | ALB and NLB

NLB Architecture