Skip to main content

Load Balancing Modes and Algorithms

Last update:

Load Balancing Modes

VMware NSX® Edge™ (Edge router) offers support for two load balancer deployment modes: proxy mode (one-arm) and transparent mode (inline).

Proxy mode (one-arm)

When a request is sent to one of the backends in proxy mode, the Edge uses its own IP address as the source address — the load balancer performs both Source and Destination NAT functions simultaneously. The backend sees all traffic as being sent from the load balancer and responds to it directly. In this configuration, the load balancer must be in the same network segment as the internal servers.

The user sends a request to the VIP address (the load balancer address) configured on the Edge. The Edge selects one of the backends and performs Destination NAT, replacing the VIP address with the address of the selected backend. The Edge performs Source NAT, replacing the address of the user who sent the request with its own, and the packet is sent to the selected backend.

The backend responds not to the user directly, but to the Edge, since the user's original address was changed to the load balancer's address. The Edge forwards the server response to the user.

Transparent mode (inline)

In transparent mode, the load balancer has interfaces in both the internal and external networks, but there is no direct access to the internal network from the external one. The built-in load balancer acts as a NAT gateway for virtual machines in the internal network.

The user sends a request to the VIP address (the load balancer address) configured on the Edge. The Edge selects one of the backends and performs Destination NAT, replacing the VIP address with the address of the selected backend, and the packet is sent to the selected backend.

The backend receives a request with the user's original address (Source NAT was not performed) and responds to them directly. The traffic is received by the load balancer again, as in an inline scheme it typically acts as the default gateway for the server farm. Edge performs Source NAT to send traffic to the user using its VIP as the Source IP address.

Load Balancing Algorithms

  • IP Hash — the server is selected based on the results of a hash function for the Source and Destination IP of each packet;
  • Least Connections — incoming connections are balanced depending on the number of existing connections on a specific server. New connections will be directed to the server with the fewest connections;
  • Round Robin — new connections are sent to each server in turn according to the assigned server weight;
  • URI — the left part of the URI (before the question mark) is hashed and divided by the total weight of the servers in the pool. The result indicates which server receives the request. The request is directed to the same server as long as all servers remain available;
  • HTTP Header — balancing based on an HTTP header, which can be specified as a parameter. If the header is missing or has no value set, the Round Robin algorithm is applied;
  • URL — in each HTTP GET request, a search is performed for the URL parameter specified as an argument. If the parameter is followed by an equals sign and a value, the value is hashed and divided by the total weight of the running servers. The result indicates which server receives the request. This process is used to track user IDs in requests. The User ID is sent to the same server as long as all servers remain available.