← Lessons

quiz vs the machine

Platinum1850

Networking

Direct Server Return

Letting backends reply straight to the client, bypassing the balancer on the return path.

5 min read · advanced · beat Platinum to climb

Skipping the balancer on the way back

Normally a load balancer sits in both directions: requests flow in through it and responses flow back out through it. Direct server return, or DSR, breaks that symmetry. The balancer forwards the request to a backend, but the backend sends its reply directly to the client, not back through the balancer.

Why do this

For many workloads responses are far larger than requests, think downloads or video. Routing those big responses back through the balancer makes it a bandwidth bottleneck. DSR removes the return traffic from the balancer entirely.

  • The balancer handles only inbound packets, so it scales to far more throughput.
  • Backends use their bandwidth directly to the client.

How it works

The balancer forwards the packet without changing the destination IP, often by rewriting the MAC address. Each backend is configured with the balancer's virtual IP on a loopback so it accepts the packet and replies as though it were the virtual IP, which the client expects.

The constraints

  • It is an L4 only technique; the balancer never sees the response, so no L7 features, no response rewriting, no cookies.
  • It needs L2 adjacency or tunneling and careful network configuration.
  • Health and stats are one sided since return traffic is invisible.

Key idea

Direct server return forwards requests through the balancer but sends responses straight from backend to client, removing return bandwidth from the balancer at the cost of being L4 only and network constrained.

Check yourself

Answer to earn rating on the learn ladder.

1. In direct server return, the response travels:

2. The main motivation for DSR is to:

3. A constraint of DSR is that it: