On this page
What server load balancing doesLayer 4 balancing methodsHealth checks at Layer 3, 4 and 7NAT mode versus direct server returnConfig shape in ServerIron-style CLIHigh availability of the balancer itselfCapacity terms that matterQuestions01 /What server load balancing does
Server load balancing advertises one virtual IP address (VIP) and distributes the connections arriving at it across two or more real servers. Clients only see the VIP. The balancer owns the address and keeps a table that maps every active flow to the real server handling it. The rest of the load balancing hub builds on this idea.
Three objects appear in almost every implementation. A real server is an address and port on a machine running the application. A virtual server is the VIP and port clients connect to. A bind ties a virtual port to one or more real ports. Foundry sold this as an appliance from around 1998: the ServerIron was marketed as a Layer 4 through 7 "web switch"; the original Foundry SLB configuration guide was among the most linked documents on this domain.
02 /Layer 4 balancing methods
The selection method (Foundry called it the predictor) decides which real server receives the next new connection.
| Method | How it chooses | Fits when |
|---|---|---|
| Round robin | Next server in a fixed rotation | Identical servers, short uniform requests |
| Weighted round robin | Rotation biased by a per-server weight | Mixed hardware generations in one pool |
| Least connections | Server with the fewest active connections | Long-lived or uneven requests |
| Response time | Fastest recent health check or handshake | Latency-sensitive services on shared hosts |
None of these methods remember a client between connections; per-user server state needs a persistence rule.
03 /Health checks at Layer 3, 4 and 7
Checks are layered:
- Layer 3: ICMP echo to the server. Proves the host is up.
- Layer 4: a TCP handshake to the bound port. Proves a process is listening.
- Layer 7: an HTTP request such as
GET /health, passing only on an expected status code or body string. Proves the application answers.
Each check has an interval, a failure count before the server is marked down and a recovery count before it returns. A server that passes Layer 4 but fails Layer 7 is the classic hung process: the socket accepts, the application never answers.
Check what the user needs, not what is cheap to check. A 200 from a health URL that touches the database beats a completed TCP handshake.
04 /NAT mode versus direct server return
In NAT mode the balancer rewrites the destination of each inbound packet from the VIP to the chosen real server. Return traffic must pass back through it so the source can be rewritten to the VIP, so the balancer is either the default gateway of the servers or it also source-NATs the client. NAT mode sees both directions and is required for any Layer 7 feature.
In direct server return (DSR, or transparent mode) the balancer changes only the destination MAC address. The real server carries the VIP on a loopback interface and replies straight to the client. Responses never touch the balancer, so a modest appliance can front heavy outbound traffic. The cost: no Layer 7 inspection and no server-side NAT. Foundry marketed its DSR mode under the name SwitchBack, around the early 2000s.
05 /Config shape in ServerIron-style CLI
The general shape of an SLB configuration on IronWare-era ServerIron software is below. It is illustrative: define the real servers, define the virtual server, bind the ports.
server real web1 10.1.1.11 port http port http url "HEAD /" server real web2 10.1.1.12 port http server virtual www 192.0.2.10 port http bind http web1 http web2 http ! show server real show server virtual show server bind
The url line attaches a Layer 7 check to the real port. The bind line maps the virtual HTTP port to each real HTTP port. Second-hand units still boot into this syntax (CLI reference).
06 /High availability of the balancer itself
The balancer is a single point of failure unless paired. The usual pattern is active/standby: two units share the VIP through a VRRP-style election (see VRRP and VSRP) and the standby takes the address within seconds of the active unit disappearing. Session synchronisation copies the flow table to the standby so established connections survive failover.
07 /Capacity terms that matter
Three numbers describe a balancer. Connections per second (CPS): how many new flows it can set up, the limit for busy web front ends. Concurrent sessions: the size of the flow table, exhausted first by long-lived connections. Throughput only matters in NAT mode, because DSR keeps the return direction off the box. Layer 7 processing lowers all three, the trade discussed under Layer 4 versus Layer 7.
08 /Questions
What is the difference between a VIP and a real server?
The VIP is the address clients connect to and the balancer owns. A real server is an actual host and port behind it. One VIP maps to several real servers through a bind; clients never learn the real addresses.
Which load balancing method should be the default?
Round robin for pools of identical servers handling short requests. Switch to least connections when request duration varies or when some connections are long-lived, because round robin piles new work onto a busy server.
Why do health checks need Layer 7 at all?
A TCP handshake succeeds as long as something is listening. A hung application still listens. Only a Layer 7 check that expects a specific status code or body string proves the application is producing correct answers.
When is direct server return worth the complexity?
When responses dwarf requests, as on media or download servers, and no Layer 7 features are needed. Return traffic bypasses the balancer, so its throughput stops being the ceiling. Servers must carry the VIP on a loopback and not answer ARP for it.
Do sessions survive a balancer failover?
Only if the pair synchronises its flow table. Without session sync the standby takes the VIP but has no record of established connections, so clients see resets and reconnect. Appliance-class balancers, including the ServerIron generation, offered synchronisation as an option.
Sources
- IETF RFC 2391, Load Sharing using IP Network Address Translation (LSNAT), 1998
- IETF RFC 3234, Middleboxes: Taxonomy and Issues, 2002
- V. Cardellini, M. Colajanni, P. Yu, Dynamic Load Balancing on Web-server Systems, IEEE Internet Computing, 1999
- Foundry Networks, ServerIron Server Load Balancing guide (original Foundry documentation, historical, around 2000)