layer 4 load balancing Direct Server Return mode

Direct server return is usually shortened to DSR.

In DSR mode, the load-balancer routes packets to the backends without changing anything in it but the destination MAC address.
The backends process the requests and answer directly to the clients, without passing through the load-balancer.

The backends must have the service IP configured on a loopback to be able to accept the requests.

TCP connection overview

layer4_dsr_tcp_connection
As usual when performing layer 4 load-balancing, the TCP connection is established directly between the client and the backend.
Note that the the requests pass through the load-balancer while the responses not.

Data flow

layer4_dsr_data_flow
As explained above, the load-balancer sees only the requests and just change the destination MAC address of the packets.
The backends answers directly to the client using the service IP configured on a loopback interface.

Pros and cons

Pros

  • very fast load-balancing mode
  • load-balancer network bandwith is not a bottleneck anymore
  • total output bandwith is the sum of each backend bandwith
  • less intrusive than the layer 4 load-balancing NAT mode

Cons

  • the service VIP must be configured on a loopback interface on each backend and must not answer to ARP requests
  • no layer 7 advanced features are available

When use this architecture?

  • where response time matters
  • where no intelligence is required
  • when output capacity of the load-balancer could be the bottleneck

Links

About Baptiste Assmann

Aloha Product Manager HAProxy consultant
This entry was posted in Aloha, architecture, layer4 and tagged , , . Bookmark the permalink.

4 Responses to layer 4 load balancing Direct Server Return mode

  1. Pingback: Layer 4 load balancing tunnel mode | Exceliance – Aloha Load Balancer

  2. Pingback: Layer 4 load balancing tunnel mode | HAProxy Technologies – Aloha Load Balancer

  3. c4milo says:

    How do you do this type of load balancing using HAProxy?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s