Windows Server 2003 : Clustering Servers - Using Network Load Balancing (part 1) - Planning a Network Load Balancing Deployment
1. Understanding Network Load Balancing
A Network Load Balancing cluster consists of up to 32 servers, referred to as hosts, each of which is running a duplicate copy of the application you want the cluster to provide to clients. Network Load Balancing works by creating on each host a virtual network adapter that represents the cluster as a single entity. The virtual network adapter has its own IP and media access control (MAC) addresses, independent of the addresses assigned to the physical network interface adapters in the computers. Clients address their application requests to the cluster IP address instead of to an individual server’s IP address.
Off the Record
When an incoming client request addressed to the cluster IP address arrives, all the hosts in the cluster receive and process the message. On each host in an NLB cluster, a Network Load Balancing service functions as a filter between the cluster adapter and the computer’s TCP/IP stacks. This filter enables NLB to calculate which host in the cluster should be responsible for resolving the request. No communication between the hosts is required for this purpose. Each host performs the same calculations independently and decides whether it should process that request or not. The algorithm the hosts use to perform these calculations changes only when hosts are added or removed from the cluster.
2. Planning a Network Load Balancing Deployment
Before you deploy a Network Load Balancing cluster, you must create a plan for the network infrastructure that will support your cluster servers. The high availability provided by NLB will do you no good if your users can’t access the servers because of a failure in a router, switch, or Internet connection. In addition, because many NLB installations provide Web and other services to Internet users, you must consider the security of your cluster servers and the rest of your internal network.
Important
|
NLB Operational Modes
The servers that are going to be the hosts in your NLB cluster do not require any special hardware. There is no shared data store as in a server cluster, for example, so you do not have to build a storage area network. However, NLB imposes certain limitations on a server with a single network interface adapter in a standard configuration, and in some cases, you can benefit from installing a second network interface adapter in each of your servers.
Windows Server 2003 Network Load Balancing has two operational modes: unicast mode and multicast mode. In unicast mode, Network Load Balancing replaces the MAC address of the physical network interface adapter in each server with the MAC address of the virtual network adapter representing the cluster. The server does not use the computer’s original MAC address at all, effectively transforming the computer’s physical network interface adapter into a virtual network adapter. The Address Resolution Protocol (ARP) resolves both of the server’s IP addresses (the IP address originally assigned to the network interface adapter and the cluster IP address) to the single MAC address for the cluster.
Off the Record
Because the network interface adapters of all the servers in the cluster have the same MAC address, the cluster servers cannot communicate among themselves in the normal way, using their individual MAC addresses. The servers can, however, communicate with other computers on the same subnet, and with computers on other subnets, as long as the IP datagrams don’t contain the cluster MAC address.
Note
In some cases, this is not a problem. Dedicated Web servers hosting the same site, for example, don’t often need to communicate with each other under normal conditions. However, if you determine that it is necessary for the servers in your NLB cluster to communicate with each other, there are two possible solutions:
Configure the cluster servers to operate in NLB multicast mode In multicast mode, NLB assigns a cluster MAC address to the physical network interface adapter, but it also retains the adapter’s original MAC address. The cluster IP address resolves to the cluster MAC address, and the server’s original IP address resolves to the original MAC address. For this configuration to function properly, the routers on the network must support the use of multicast MAC addresses.
Install a second network interface adapter in each server One of the network interface adapters becomes the network interface adapter for the cluster, with its original MAC address replaced by the cluster MAC address. Both the cluster IP address and the adapter’s original IP address resolve to the cluster MAC address. The system does not use this adapter’s original MAC address. Like a single adapter in unicast mode, the cluster adapter cannot communicate with the other servers in the cluster. The second adapter retains its original MAC address and assigned IP address and handles all noncluster network communications.
Tip
In summary, a server in an NLB cluster can have either one network interface adapter or multiple adapters, and it can run in either unicast or multicast mode. By combining these options, you can use four possible NLB configurations, each of which has advantages and disadvantages, as shown in Table 1.
| NLB Configuration | Advantages | Disadvantages |
|---|---|---|
| Single network interface adapter in unicast mode |
|
|
| Single network interface adapter in multicast mode |
|
|
| Multiple network interface adapters in unicast mode |
|
|
| Multiple network interface adapters in multicast mode |
|
|
The most popular configuration for large NLB installations is to install two network interface adapters in each server and run them in unicast mode. This configuration enables the servers to function as normal participants on the network, in addition to performing their NLB server duties. There are also no problems with routers handling multicast MAC addresses and no bottlenecks caused by cluster traffic and ordinary network traffic sharing a single network interface adapter.
NLB Networking
Although the servers in a Network Load Balancing cluster do not share a single data store, as in a server cluster, and perform their own independent calculations to determine which server will service an incoming request, the servers do communicate with each other. The cluster servers must exchange information to know how many servers are in the cluster and to determine when a server has been added or removed from the cluster. This communication enables the cluster to compensate for a failed server and to take advantage of new servers in the cluster by redistributing the traffic load.
Important
The cluster traffic between NLB servers takes the form of a heartbeat message that each server transmits once per second to the other servers in the cluster. If one cluster server fails, it stops transmitting its heartbeat messages, and the other servers detect the absence of the heartbeats. Once the other servers in the cluster miss five consecutive heartbeat messages from a server, they begin a process called convergence, in which they recalculate their traffic distribution algorithm to compensate for the missing server. In the same way, adding a new server to an NLB cluster introduces a new heartbeat to the network, which triggers a convergence in the other servers, enabling them to redistribute the traffic so that the new server receives an equal share of the load.
Note
When you deploy NLB cluster servers with a single network interface adapter in each computer, obviously all the cluster-related traffic must travel over the same network as your ordinary traffic. This is usually not a major burden because the heartbeat packets are small, less than 1,500 bytes, and they fit into a single Ethernet packet. If you decide to install multiple network interface adapters in each cluster server, you can connect both adapters to the same local area network (LAN) or construct a separate network for the cluster traffic.
Planning