Direct server return (DSR) is a load balancing forwarding mode in which the load balancer handles only the inbound half of each connection, while the backend server sends its responses directly to the client. Because response traffic never passes back through the balancer, DSR removes the balancer from the return path and allows a small appliance to front services whose outbound traffic is many times larger than their inbound traffic.
In networking practice, DSR is also called direct routing, triangular routing or asymmetric load balancing. It is a technique of Layer 4 load balancing and works best for protocols where requests are small and responses are large, such as video delivery, file downloads and DNS.
How direct server return forwards traffic
Direct server return works by letting the balancer rewrite only the delivery information of an incoming packet, not its destination IP address. The client sends a request to the virtual IP address (VIP) published by the service. The balancer selects a backend with its load balancing algorithm and forwards the packet so that it still carries the VIP as its destination.
Each backend has the VIP configured on a loopback interface and therefore accepts the packet as addressed to itself. When the server replies, it uses the VIP as the source address and sends the response through its default gateway, straight toward the client. The client sees a normal conversation with the VIP and never learns that two different machines handled the two directions.
The following table shows the path of a single TCP connection in DSR mode compared with a conventional proxy or NAT design.
| Step | DSR mode | Full proxy or NAT mode |
|---|---|---|
| Client request | Client to VIP on the balancer | Client to VIP on the balancer |
| Forward to backend | Destination MAC or outer header rewritten | Destination IP rewritten or new connection opened |
| Backend response | Server to client directly | Server to balancer |
| Return to client | Balancer not involved | Balancer rewrites and forwards |
| Source IP seen by server | Original client IP | Balancer IP unless preserved |
Variants of DSR forwarding
DSR comes in several forwarding variants that differ in how the packet reaches a backend while keeping the VIP intact. The choice depends mainly on whether the balancer and servers share a Layer 2 broadcast domain.
| Method | How the packet is delivered | Network requirement | Typical overhead |
|---|---|---|---|
| MAC rewriting | Only the destination MAC address changes | Same Layer 2 segment | None |
| IP-in-IP tunneling | Packet encapsulated in a new IP header | Routed reachability | 20 bytes per packet |
| GRE or GUE tunneling | Packet wrapped in a tunnel protocol | Routed reachability, tunnel endpoint on server | 24 to 32 bytes per packet |
| Destination NAT with source preserved | Partial rewrite, return routed via policy | Careful routing design | Varies |
MAC-based DSR is the original and simplest form, used by Linux Virtual Server in its direct routing mode and by many hardware appliances. Tunnel-based DSR removes the Layer 2 constraint and allows backends in different subnets or data centers, at the cost of a reduced effective MTU, which must be handled with a lower MSS or path MTU discovery.
DSR compared with other load balancing modes
DSR trades features for throughput. A balancer that sees only half of each conversation cannot inspect responses, terminate TLS or retry a failed request, so DSR sits at the opposite end of the spectrum from Layer 7 load balancing.
| Property | Direct server return | Layer 4 NAT | Layer 7 proxy |
|---|---|---|---|
| Return traffic through balancer | No | Yes | Yes |
| Balancer bandwidth need | Inbound only | Both directions | Both directions |
| TLS termination | Not possible | Not possible | Supported |
| Content-based routing | Not possible | Not possible | Supported |
| Client IP visible to server | Yes, natively | Yes, with routing design | Through headers or PROXY protocol |
| Server configuration changes | Loopback VIP and ARP tuning | Gateway via balancer | None |
Because the server sees the real client address without any additional header, DSR avoids the need for the PROXY protocol or an X-Forwarded-For header. However, session persistence is limited to source-IP-based methods such as IP hash or consistent hashing, since the balancer cannot read cookies.
When direct server return is the right choice
DSR is most valuable when the response-to-request ratio is high and the balancer would otherwise become the bandwidth bottleneck. For a streaming service, responses can be ten to a hundred times larger than requests, so removing the return path reduces balancer load by roughly the same factor.
| Situation | Recommended choice | Reason |
|---|---|---|
| Video, downloads, CDN origin | DSR | Large asymmetric responses |
| DNS and other UDP services | DSR | Stateless, small queries, high packet rates |
| HTTPS with path routing or WAF | Layer 7 proxy | Needs content inspection |
| Backends in another cloud or subnet without tunnels | NAT or proxy | MAC rewriting cannot cross routers |
| Strict stateful firewall between servers and clients | NAT or proxy | Asymmetric flows break state tracking |
Large operators often combine both approaches: a DSR tier of Layer 4 balancers distributes traffic across a fleet of Layer 7 proxies, which then terminate TLS. This design scales the expensive proxy layer horizontally while keeping the front tier lightweight.
Limitations and common configuration mistakes
Most DSR failures come from the server-side configuration, because every backend must accept traffic for an address it must never advertise. The most frequent problem is the ARP problem: if a server answers ARP requests for the VIP, upstream switches may send all client traffic straight to that server and bypass the balancer entirely.
- Suppress ARP for the VIP on every backend, for example with the Linux settings
arp_ignore=1andarp_announce=2. - Bind services to the VIP as well as the real address, or responses will carry the wrong source IP and clients will reset the connection.
- Disable strict reverse path filtering where tunnel-based DSR delivers packets on an unexpected interface.
- Health checks see only reachability: the balancer cannot observe response errors or latency, so checks must test the application explicitly.
- Stateful middleboxes such as firewalls drop return packets they never saw opening, so the return path must be stateless or permitted explicitly.
Operational features are also reduced. Connection draining, rate limiting and response-based metrics must move to the servers themselves, and troubleshooting requires captures on both the balancer and the backend because no single device sees the complete flow.
In everyday language
Imagine a busy restaurant where a host at the door takes every order and assigns it to a cook. In a normal setup, each finished dish goes back past the host before it reaches the table, and the host soon becomes a crowded bottleneck.
Direct server return lets the cooks carry the dishes straight to the tables. The host still decides who cooks what, but only handles the small orders, not the heavy plates. The result is that one modest doorway can serve a very large dining room, as long as every cook knows how to find the tables and nobody needs the host to check each plate.
Seen in the real world
A regional video platform serves recorded lectures from twelve origin servers, each with a 25 Gbit/s uplink. Requests from viewers total about 2 Gbit/s at peak, while video responses reach roughly 180 Gbit/s. A pair of Layer 4 balancers with 40 Gbit/s interfaces could never carry that return traffic in proxy mode.
The network team configures DSR with IP-in-IP tunneling, places the VIP on each server’s loopback, suppresses ARP for it and lowers the TCP MSS to absorb the tunnel header. Session affinity uses consistent hashing on the client address. After the change, the balancers carry only the inbound 2 Gbit/s, CPU load on them stays below 15 percent, and the origin servers deliver video at full uplink speed directly to viewers.