Configuring DSR

1 Introduction

Direct Server Return (DSR) is a method whereby traffic hits the LoadMaster on the way in and bypasses the LoadMaster on the way out.

The primary advantage of DSR is that the LoadMaster only handles a portion of the work associated with load balancing, specifically the inbound traffic. The servers respond directly to the clients, bypassing the LoadMaster on the way out.

If the particular traffic profile for a site is for every packet in, eight packets are sent out, this would result in the LoadMaster handling around 87% less traffic than it would without DSR.

For DSR to work, the Virtual IP (VIP) address on a Real Server must be configured so that the server does not respond to ARP requests on the VIP address.

For Linux with a recent 2.4 kernel, this can be done by creating the VIP as an IP alias on the loopback interface. On Windows this involves creating a loopback adapter with specific configuration parameters. Refer to the Configuring a VIP on the loopback interface on Linux and  DSR Configuration on Windows sections for detailed steps on how to do this in both operating systems.

When you create the Virtual Service and assign the respective Real Servers to it, select “route” as the forwarding method to the Real Servers. This means that the LoadMaster just routes the packets from a client to a Real Server without modifying the IP addresses. The Real Server accepts requests for the VIP destination address because it has configured the VIP as an IP alias. The Real Server will then reply to the IP address of the requesting client with the source IP address of the reply set to the VIP.

The table below shows an example of DSR steps.

Step

Source IP

Destination IP

 MAC Address

1

216.139.43.10

195.30.70.200

Dest.: 00:00:00:00:00:aa

2

216.139.43.10

195.30.70.200

Dest.: 00:00:00:00:00:bb

3

195.30.70.200

216.139.43.10

Source: 00:00:00:00:00:bb

2 Configuring a VIP on the loopback interface on Linux

On a linux machine, the “ifconfig –a” command will look something like this:

root@RS1 $ ifconfig –a

eth0 Link encap:Ethernet HWaddr 00:00:00:00:00:bb inet addr: 195.30.70.11 Bcast: 195.30.70.255 Mask:255.255.255.0

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:96561817 errors:526 dropped:0 overruns:5 frame:0 TX

packets:97174301 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 Interrupt:10 Base address:0x4000

lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:3924 Metric:1 RX packets:3985923

errors:0 dropped:0 overruns:0 frame:0 TX packets:3985923 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0

To create an additional loopback interface with an IP alias, use the “ifconfig” command like this:

root@RS1 $ ifconfig lo:1 <VirtualServiceIPAddress> broadcast 195.30.70.200 netmask 255.255.255.255

root@RS1 $ ifconfig lo:1

lo:1 Link encap:Local Loopback inet addr:195.30.70.200 Mask:255.255.255.255 UP LOOPBACK RUNNING MTU:3924 Metric:1

If the machine reboots, this configuration will no longer be available. To set this permanently, some Linux configuration files need to be edited. Steps on how to do this vary from distribution to distribution.

The next step is to disable invalid ARP replies. Add the following to the /etc/sysctl.conf file:

net.ipv4.conf.all.arp_ignore=1

net.ipv4.conf.eth0.arp_ignore=1

net.ipv4.conf.eth1.arp_ignore=1

net.ipv4.conf.all.arp_announce=2

net.ipv4.conf.eth0.arp_announce=2

net.ipv4.conf.eth1.arp_announce=2

3  DSR Configuration on Windows

For Windows, it is typically best to use the loopback address. However, to use the loopback address, the loopback adapter needs to be added first. Follow the instructions for the relevant version of Windows below to add the loopback adapter. Then, configure the VIP of the loopback interface by following the instructions in the Configure the VIP of the Loopback Interface section. Add a Loopback Interface on Windows Server 2000.

Follow the instructions below to first add a loopback interface and then configure a VIP  in Windows Server 2000:

1. Click Start, select Settings and select Control Panel.

2. Click Add/Remove Hardware.

3. Click Add/troubleshoot a device.

4. Click Next.

5. Click Add a new device.

6. Click Next.

7. Select No, select from list.

8. Click Next.

9. Select Network Adapters.

10. Click Next.

11. Select Microsoft as the Manufacturer.

DSR Configuration on Windows.png

12. Select MS Loopback Adapter (or Microsoft KM-TEST Loopback Adapter for Windows 8 and Windows Server 2012).

13. Click Next.

14. Click Finish.

To configure the created Loopback Adapter, follow the steps below:

15. Click Start, select Settings and select Control Panel.

16. Click Network and Dial up Connections.

17. Right-click the new adapter and select Properties.

18. Select Internet Protocol.

19. Remove the tick from Client for MS Networks and File and Printer sharing.

20. In TCP/IP Properties, enter the IP address of Virtual Server.

The loopback adapter gets the same address as the LoadMaster Virtual Service IP.

Do not enter a default gateway.

21. Click Advanced.

22. Set the Interface Metric to 254.

This step is important – it prevents the loopback adapter from responding to ARP requests.

23. Click OK and save all changes.

3.1 Add a loopback interface on Windows Server 2008, 2008 R2 and 2012

The steps below have been tested in Windows Server 2008 R2 and 2012.

To add a loopback adapter on Windows Server 2008 and 2012, follow the steps below:

1. Click Start and right-click Computer.

Add a loopback interface on.png

2. Select Properties.

Add a loopback interface on_1.png

3. Click Device Manager.

Add a loopback interface on_2.png

4. Right-click the computer name and select Add Legacy Hardware.

5. Click Next.

Add a loopback interface on_3.png

6. Select Install the hardware that I manually select from a list (Advanced).

7. Click Next.

Add a loopback interface on_4.png

8. Select Network adapters.

9. Click Next.

10. Select Microsoft on the left.

Add a loopback interface on_5.png

11. Select Microsoft KM-TEST Loopback Adapter on the right.

12. Click Next.

13. Click Next again.

Add a loopback interface on_6.png

14. Click Start and select Control Panel.

Add a loopback interface on_7.png

15. Click Network and Sharing Center.

Add a loopback interface on_8.png

16. Click Change adapter settings.

It is a good idea to rename the adapters so that they are distinguishable, for example; rename the new adapter to loopback and the real network adapter to network.

17. Configure the loopback adapter with the Virtual Service IP. For instructions on how to do this, refer to the Configure the VIP of the Loopback Interface section.

Ensure the “network” adapter is the actual network adapter that will send and receive traffic.

18. On the Windows command line, run the following commands:

netsh interface ipv4 set interface "net" weakhostreceive=enabled

netsh interface ipv4 set interface "loopback" weakhostreceive=enabled

netsh interface ipv4 set interface "loopback" weakhostsend=enabled

3.1.1 Loopback Adapter Configuration for IPv6

On the Windows command line, run the following commands:

netsh interface ipv6 set interface LAN weakhostreceive=enabled

netsh interface *ipv6 *set interface KEMP-SMTP-LOOPBACK weakhostreceive=enabled

netsh interface *ipv6 *set interface KEMP-SMTP-LOOPBACK weakhostsend=enabled

In the loopback adapter properties:

IPv6 address: <IPAddressOf TheVIP>

Subnet prefix length: 128

In Advanced Properties, set the Interface metric to 254.

 

3.2 Configure the VIP of the Loopback Interface

To configure the VIP of the loopback interface, follow the steps below:

1. Click Start and select Control Panel.

2. Click Network Connections.

3. Right-click the loopback interface and select Properties.

4. Select Internet Protocol (TCP/IP).

Internet Protocol Properties for Loopback

5. The TCP/IP properties window will appear. This is where the Virtual Service IP address can be configured. Enter the Virtual Service IP address and click Advanced.... 

Advanced TCPIP Setting for loopback adapter

6. Advanced TCP/IP SettingsRemove the check from the Automatic metric checkbox.

7. Enter 254 in the Interface metric text box.

 Setting the Interface metric is an important step. This will disable this server so that it will not respond to ARP requests for the MAC address for the Virtual Service IP.

8. Click OK to activate the change.

9. Click OK and Close.

References

Unless otherwise specified, the following documents can be found at http://kemptechnologies.com/documentation.

Web User Interface (WUI), Configuration Guide

Document History

Date

Change

Reason for Change

Ver.

Resp.

Mar 2014

Minor change

Update to Copyright Notices

1.4

LB

June 2014

Minor change

Defects resolved

1.5

LB

Aug 2014

Minor change

Defects resolved

1.6

LB

Oct 2014

Minor changes

Defects resolved

1.7

LB

Oct 2015

Minor changes

Updated header and footer

3.0

LB

Jan 2016

Minor changes

Updated Copyright Notices

4.0

LB

Jan 2017 Release updates Updates for 7.2.37 5.0 LB

 

Was this article helpful?

0 out of 0 found this helpful

Comments