NAT mode A-A packet flow
This section describes an example of how packets are load balanced and how failover occurs in an active-active HA cluster running in NAT mode. In the example, the NAT mode cluster acts as the internet firewall for a client computer’s internal network. The client computer’s default route points at the IP address of the cluster internal interface. The client connects to a web server on the internet. Internet routing routes packets from the cluster external interface to the web server, and from the web server to the cluster external interface.
In NAT mode, eight MAC addresses are involved in active-active communication between the client and the web server when the primary unit load balances packets to the subordinate unit:
- Internal virtual MAC address (MAC_V_int) assigned to the primary unit internal interface,
- External virtual MAC address (MAC_V_ext) assigned to the primary unit external interface,
- Client MAC address (MAC_Client),
- Server MAC address (MAC_Server),
- Primary unit original internal MAC address (MAC_P_int),
- Primary unit original external MAC address (MAC_P_ext),
- Subordinate unit internal MAC address (MAC_S_int),
- Subordinate unit external MAC address (MAC_S_ext).
In NAT mode, the HA cluster works as a gateway when it responds to ARP requests. Therefore, the client and server only know the gateway MAC addresses. The client only knows the cluster internal virtual MAC address (MAC_V_int) and the server only knows the cluster external virtual MAC address (MAC_V_ext).
NAT mode active-active packet flow
Packet flow from client to web server
- The client computer requests a connection from 10.11.101.10 to 172.20.120.130.
- The default route on the client computer recognizes 10.11.101.100 (the cluster IP address) as the gateway to the external network where the web server is located.
- The client computer issues an ARP request to 10.11.101.100.
- The primary unit intercepts the ARP request, and responds with the internal virtual MAC address (MAC_V_int) which corresponds to its IP address of 10.11.101.100.
-
The client’s request packet reaches the primary unit internal interface.
IP address MAC address Source 10.11.101.10 MAC_Client Destination 172.20.120.130 MAC_V_int -
The primary unit decides that the subordinate unit should handle this packet, and forwards it to the subordinate unit internal interface. The source MAC address of the forwarded packet is changed to the actual MAC address of the primary unit internal interface.
IP address MAC address Source 10.11.101.10 MAC_P_int Destination 172.20.120.130 MAC_S_int - The subordinate unit recognizes that the packet has been forwarded from the primary unit and processes it.
-
The subordinate unit forwards the packet from its external interface to the web server.
IP address MAC address Source 172.20.120.141 MAC_S_ext Destination 172.20.120.130 MAC_Server - The primary unit forwards further packets in the same session to the subordinate unit.
- Packets for other sessions are load balanced by the primary unit and either sent to the subordinate unit or processed by the primary unit.
Packet flow from web server to client
- When the web server responds to the client’s packet, the cluster external interface IP address (172.20.120.141) is recognized as the gateway to the internal network.
- The web server issues an ARP request to 172.20.120.141.
- The primary unit intercepts the ARP request, and responds with the external virtual MAC address (MAC_V_ext) which corresponds its IP address of 172.20.120.141.
-
The web server then sends response packets to the primary unit external interface.
IP address MAC address Source 172.20.120.130 MAC_Server Destination 172.20.120.141 MAC_V_ext -
The primary unit decides that the subordinate unit should handle this packet, and forwards it to the subordinate unit external interface. The source MAC address of the forwarded packet is changed to the actual MAC address of the primary unit external interface.
IP address MAC address Source 172.20.120.130 MAC_P_ext Destination 172.20.120.141 MAC_S_ext - The subordinate unit recognizes that packet has been forwarded from the primary unit and processes it.
-
The subordinate unit forwards the packet from its internal interface to the client.
IP address MAC address Source 172.20.120.130 MAC_S_int Destination 10.11.101.10 MAC_Client - The primary unit forwards further packets in the same session to the subordinate unit.
- Packets for other sessions are load balanced by the primary unit and either sent to the subordinate unit or processed by the primary unit.
When a failover occurs
The following steps are followed after a device or link failure of the primary unit causes a failover.
- If the primary unit fails, the subordinate unit negotiates to become the primary unit.
-
The new primary unit changes the MAC addresses of all of its interfaces to the HA virtual MAC addresses.
The new primary unit has the same IP addresses and MAC addresses as the failed primary unit.
- The new primary units sends gratuitous ARP packets to the 10.10.101.0 network to associate its internal IP address with the internal virtual MAC address.
- The new primary units sends gratuitous ARP packets to the 172.20.120.0 network to associate its external IP address with the external virtual MAC address.
-
Traffic sent to the cluster is now received and processed by the new primary unit.
If there were more than two cluster units in the original cluster, the new primary unit would load balance packets to the remaining cluster members.