What Is a Network Load Balancer? Distribute TCP and UDP Flows Across Backends
A network load balancer usually distributes connections or flows such as TCP and UDP at the transport layer (OSI Layer 4, or L4). Unlike an application load balancer that reads HTTP paths or headers to route requests to services, it selects destinations using lower-level information such as protocol, addresses, ports, and connection state. Implementations vary: some proxy and terminate connections, while others pass packets through, so the product name alone does not tell you exactly how it behaves.
A network load balancer usually distributes connections or flows such as TCP and UDP at the transport layer (OSI Layer 4, or L4). Unlike an application load balancer that reads HTTP paths or headers to route requests to services, it selects destinations using lower-level information such as protocol, addresses, ports, and connection state. Implementations vary: some proxy and terminate connections, while others pass packets through, so the product name alone does not tell you exactly how it behaves.
How are connections or flows distributed?
The client connects to the load balancer’s frontend IP address and port. A listener and its rules accept protocols and ports, identify a backend pool, and a distribution algorithm sends each connection or flow to a backend. A TCP connection typically stays with one backend for its lifetime. UDP has no TCP-style connection, but packets in the same flow generally need to reach the same target so the service can handle state and replies consistently. Check the product’s flow definition, affinity, and timeout settings.
A health check or probe determines whether a backend can receive traffic. A target that fails checks can be removed from new flows, but an established connection does not necessarily move safely to another server. Stateful protocols may need client reconnection and retry logic, or server-side session/state handling.
Why does proxy versus passthrough matter?
A proxy accepts the client connection and opens a separate connection to the backend. It may offer TLS termination or connection-management features, but the IP and port seen by the backend, and how the original client address appears in logs, can change. If the application needs the real client IP, verify the product’s metadata-forwarding method and trust boundary.
A passthrough implementation can forward packets without terminating the application connection. Some preserve the original source IP and use direct server return (DSR), where the backend responds directly to clients. This can suit requirements for original addresses or a particular network path, but backend routing, firewalls, and response paths must be configured correctly. Do not assume every passthrough service preserves the source IP.
| Aspect | Proxy-style L4 | Passthrough-style L4 |
|---|---|---|
| Connection handling | Accepts a front-side connection and creates a separate backend connection | Forwards packets or flows without necessarily terminating the application connection |
| Client information at backend | Proxy address or forwarded metadata, depending on product and configuration | Some products can retain the original source IP |
| Operational focus | Proxy trust, TLS, and connection limits | Return path, firewalls, original IP, and DSR constraints |
Products illustrate different choices. AWS Network Load Balancer uses target groups for supported protocols such as TCP, UDP, and TLS; cross-zone distribution and client-IP behavior depend on configuration and target type. Google Cloud’s external passthrough Network Load Balancer is not a proxy and documents forwarding packet attributes, including the source IP, to backends. Azure Load Balancer distributes Layer 4 TCP/UDP flows across virtual machine pools. These are examples in the same broad category, not identical implementations.
Example: a TCP service across two availability zones
This is an illustrative scenario, not a tested deployment. Suppose a private TCP service has two instances in each of zones A and B, registered in an internal network load balancer’s backend pool. Clients connect to one internal IP and service port. The balancer assigns each new flow to a healthy instance. If an instance in zone A fails, health checks may send new connections to healthy instances in B. Confirm that the remaining zone has enough capacity and that the frontend itself can tolerate a zone outage.
An existing TCP session to an instance in A generally does not move intact to another instance. The client may need to detect the error and open a new connection. Consider application request handling and idempotency so a retry does not accidentally duplicate work. This example explains the design; it does not claim that a particular cloud configuration was tested.
When should you choose a network load balancer?
Consider one when distributing TCP, UDP, or another supported protocol that does not need HTTP content inspection; for a private service entry point, static address, or large number of connection flows. If you need URL-path or host routing, HTTP redirects, header inspection, or a web application firewall, an application load balancer may fit better. Client-IP preservation, TLS handling, and tolerance of zone or region failures depend on the implementation and configuration.
Before deployment, verify supported protocols and ports, backend target types, proxy or passthrough behavior, client-address forwarding, cross-zone or global scope, health-check criteria, connection draining, and timeouts. In a test environment, confirm new connections reach healthy targets, observe how new flows behave when a target fails, and check what happens to existing sessions. If using packet capture or logs, limit collection to avoid sensitive payloads. After a failure exercise, review actual application responses and error rates alongside target health.
A network load balancer is suited to distributing traffic at the connection or flow level rather than inspecting HTTP content. Whether it proxies or passes through, preserves original addresses, or tolerates a particular failure depends on the product. Choose and validate it against protocol behavior, client-IP requirements, health checks, and connection recovery.
Sources
[AWS: What is a Network Load Balancer?](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/introduction.html)
[Google Cloud: Regional external passthrough Network Load Balancer overview](https://docs.cloud.google.com/load-balancing/docs/network/networklb-backend-service)
[Microsoft Learn: What is Azure Load Balancer?](https://learn.microsoft.com/en-us/azure/load-balancer/load-balancer-overview)