The function of a load balancer is to transparently distribute communication and processing loads across multiple service endpoints to ensure high application availability, optimal performance, and elastic scalability. In short, a load balancer is a strategic and crucial component of any serious online service platform to help ensure that application delivery and application availability meet organizational goals. To understand how load balancing figures into networking and review the types of load balancers available, we need to look at the leading models of network communications.
In our articles [What is IPv4?] and [What is IPv6?], we discussed the TCP/IP model and explained how network addressing works in both cases. The TCP/IP model we discussed breaks up networking communications into four layers:
This model is, without a doubt, the most common way the networking industry thinks about moving data from one endpoint to another. But while the TCP/IP model is the most widely used, the Open Systems Interconnection (OSI) model is a close second. It is, in many ways, a more sophisticated model providing greater structure and functional granularity, both of which provide significant engineering advantages. In addition, the OSI Network model was created by the International Organization for Standardization (ISO) making it a de jure network communication architecture.
As Wikipedia notes: “several networking models have sought to create an intellectual framework for clarifying networking concepts and activities, but none have been as successful as the OSI reference model in becoming the standard for discussing, teaching, and learning for the networking procedures in the field of Information technology.”
The OSI Network model has seven layers:
Comparing the two models is a little tricky as there are not only three more layers in the OSI Network model but the functionality of the layers in the two models are subtly and conceptually different. For example, TCP/IP is a functional model based on specific, standardized protocols while the OSI Network model is generic and protocol independent. Another difference between the models is that in the OSI Network model only layers 1, 2, and 3 are required to mediate application communications whereas applications in the TCP/IP model usually use all of the layers. That said, you can align the two models functionally like this:
There are two types of load balancers: A load balancer can operate at either at OSI Layer 4, the transport layer, or at OSI Layer 7, the application layer.
Layer 4 load balancing manages network traffic based on information such as the protocol being used, and source and destination ports and provides high availability but doesn’t provide visibility into the actual content of messages. This is an effective technique for simple packet-level high availability load balancing because messages are neither inspected nor decrypted which allows them to be forwarded quickly, efficiently, and securely. But layer 4 load balancing can’t make decisions based on message content and it’s not possible to route traffic based on media type, localization rules, or other criteria beyond simple algorithms such as round-robin routing.
OSI layer 7 load balancing introduces a more nuanced view of managing the flow of data and how it is routed.
Layer 7 load balancing monitors protocols such as HTTP, HTTPS, and SMTP and makes decisions based on the content of each message. A layer 7 load balancer also doesn’t just forward traffic, it can terminate sessions, perform decryption if HTTPS is involved, inspect messages, make content-based routing decisions, initiate a new TCP connection to the appropriate upstream server, and send the request to the selected server.
By supporting application-aware networking, layer 7 load balancing delivers intelligent traffic distribution across a group of servers. Also, by viewing and modifying cookies and tracking unique client sessions, layer 7 load balancing provides server persistence, or “sticky sessions”. Server persistence ensures all client requests for that session are sent to the same server which creates greater efficiency by not having to always open new sessions and then restore state data. Packet-level visibility also allows content caching to be used, holding frequently accessed items in memory for easy retrieval.
Most importantly for enterprises, layer 7 load balancing provides the intelligence to optimize traffic and reduce overhead by managing protocols that piggyback (multiplex) requests onto a single connection.
While a load balancer solves many problems about how to optimize high traffic throughput across multiple network resources, there is another level of network communications management that takes it to a higher level: Deploying an application delivery controller (ADC).
An application delivery controller uses algorithms to determine how inbound application traffic is distributed. An ADC can inspect packet headers for keywords or requested file types and direct the request to the appropriate server based on this data to ensure application availability and scalable performance.
Application delivery controllers provide in-depth traffic management by assessing server health and routing traffic to alternate servers as needed to ensure high availability.ADCs also provide real-time and historical analysis of user and network traffic, measuring ping or round-trip connection times, bandwidth usage, latency, and jitter, which is crucial in assisting help desk staff to resolve performance issues and ensure high availability.
The decision to use a conventional load balancer vs. an ADC, comes down to whether you need the raw performance of layer 4 load balancing or the overhead of deep traffic inspection with layer 7 load balancing. However, you don’t have to make a choice: With the A10 Thunder® Application Delivery Controller (ADC) you get the best of both approaches—the performance of layer 4 load balancing with the in-depth, highly granular data stream inspection of layer 7 load balancing. For more information on A10’s strategic approach, see the A10 Thunder Application Delivery Controller.
Take this brief multi-cloud application services assessment and receive a customized report.