NAT-mode server load balancing
Figure 42: Network diagram
As shown in Figure 42, NAT-mode server load balancing contains the following elements:
Cluster—Provides services. A cluster contains an LB device and multiple servers.
LB device—Distributes different service requests to multiple servers.
Server—Responds to and processes different service requests.
VSIP—Virtual service IP address of the cluster, used for users to request services.
Server IP—IP address of a server, used by the LB device to distribute requests.
NAT-mode server load balancing is implemented through the following modes:
Destination NAT (DNAT).
Source NAT (SNAT).
DNAT + SNAT.
DNAT mode
DNAT-mode server load balancing requires you to change the gateway or configure a static route for the server to send packets destined to the host through the LB device.
Figure 43: DNAT-mode server load balancing workflow
Table 10: Workflow description
Description | Source IP address | Destination IP address |
---|---|---|
1. The host sends a request. | Host IP | VSIP |
2. When the LB device receives the request, it uses a scheduling algorithm to calculate to which server it distributes the request. | N/A | N/A |
3. The LB device uses the DNAT technology to distribute the request, using Server IP as the destination IP. | Host IP | Server IP |
4. The server receives and processes the request and then sends a response. | Server IP | Host IP |
5. The LB device receives the response, translates the source IP to VSIP, and forwards the response to the requesting host. | VSIP | Host IP |
SNAT mode
SNAT-mode server load balancing requires the following configurations:
Configure VSIP for the loopback interface on each server.
Configure a route to the IP address assigned by the SNAT address pool.
As a best practice, do not use SNAT-mode server load balancing because its application scope is limited. This chapter does not provide detailed information about SNAT-mode server load balancing.
DNAT + SNAT mode
Figure 44: DNAT + SNAT-mode server load balancing workflow
Table 11: Workflow description
Description | Source IP address | Destination IP address |
---|---|---|
1. The host sends a request. | Host IP | VSIP |
2. When the LB device receives the request, it uses a scheduling algorithm to calculate to which server it distributes the request. | N/A | N/A |
3. The LB device uses the DNAT + SNAT technology to distribute the request, using the IP address in the SNAT address pool as the source IP and Server IP as the destination IP. | SNAT IP | Server IP |
4. The server receives and processes the request and then sends a response. | Server IP | SNAT IP |
5. The LB device receives the response, translates the source IP to VSIP and destination IP to Host IP, and forwards the response to the requesting host. | VSIP | Host IP |