Scenarios and differences based on fourth-tier load balancing and seven-tier load balancing

Source: Internet
Author: User

we are talking about Load balancer, sometimes called a four-tier load balancer or seven-tier load balancing device, sometimes called a four-layer switch or seven-layer exchange. The four-layer load balancing device mainly analyzes the IP layer and the TCP/UDP layer to achieve four-layer traffic load balancing. The seven-tier load balancing device supports the analysis of the application layer, such as HTTP protocol URI or cookie information, in addition to four-tier load balancing.

However, it is important to note that the other devices or software is a seventh-tier load device, which only supports the seventh Layer network protocol, does not support other underlying network protocols, and the seven-tier load balancer device is very different, requiring additional attention.

Simply put, the four-layer load balancer device does not recognize the HTTP protocol, and the seven-tier load-balancing device recognizes the HTTP protocol.

1, load balancing is divided into L4, that is, the 4th layer of the OSI work, is the TCP layer. This type of load balance does not understand the application protocol (such as Http/ftp/mysql, etc.). Example: Lvs,f5.

2, another is called L7,osi the highest layer, the application layer. At this point, the load balancer can understand the application protocol. Example: Haproxy,mysql Proxy.

Note: Many of the load balancing devices above can do a four-tiered load or seven-layer load.

The difference in technical principle

fourth level load balancing , also called the load balancing based on the fourth Layer network communication technology, that is, the target address and port in the message, plus the server selection mode of the load Balancer device, decides the internal server of the final choice.

In the case of common TCP , the Load balancer device, when it receives the first SYN request from the client, chooses the best server in the above way and modifies the destination IP address in the message (instead of the backend server IP) and forwards it directly to the server. TCP connection is established, that is, the three-time handshake is established directly between the client and the server, the load balancer device is just a router-like forwarding action. In some deployment situations, in order to ensure that the server back-up can be correctly returned to the load balancer device, while forwarding the message may also be the original source address of the message to modify.

Seventh level load Balancing , also called based on the seventh layer of network application layer load Balancing, also known as " content Exchange", that is, mainly through the message of the real meaningful application layer content, coupled with the load Balancer device settings of the server selection mode, determine the final choice of internal server.

For example, in the case of TCP, the load balancing device can only accept the message of the real application layer content sent by the client after the server is selected by the actual application layer and then the client must establish a connection (three handshake), and then according to the specific fields in the message, Plus the server selection method of the Load Balancer device setting determines the final selected internal server. Load balancer device In this case, it is more like a reverse proxy server. The load balancer and the front-end clients and the backend servers establish TCP connections separately. So from this point of view, the seven-layer load balancer is significantly more demanding for load balancing devices, and the ability to handle seven layers is bound to be lower than the four-tier mode deployment.

Simply put, the fourth layer is based on the network protocol, the seventh layer is based on content, four layer is faster than the seven layer.

Application Scenario Differences

Four-tier application load is mainly biased to the lower level of some services, such as the use of interfaces and communication;

The benefits of seven-tier application load, through continuous optimization, can make the whole network more " Intelligent " . For example, to access the user traffic of a website, through the seventh tier, the request to the picture class can be forwarded to a specific image server and can use the caching technology, the text class request can be forwarded to a specific text server and can use compression technology. Of course, this is only a small case of seven-tier application, from the technical principle, this way can be the client's request and the response of the server in any sense, greatly improved the application system in the network layer of flexibility. Many of the features deployed in the background, such as Nginx or Apache, can be moved forward to the load balancer device, such as header rewriting in customer requests, keyword filtering in server responses, or content insertion.

Another feature that is often referred to IS is a security. The most common SYN Flood attack in the network , that is, hackers control many source clients, using a false IP address to send SYN attacks to the same target, usually this kind of attack will send a large number of SYN packets, exhausted the relevant resources on the server to achieve denial of Service ( DoS) for the purpose. It can also be seen from the technical principle that these SYN attacks are forwarded to the backend server in the four-layer mode, whereas in the seven-tier mode these SYN attacks are naturally cut off on the load-balanced device without affecting the normal operation of the backend servers. In addition, the load Balancer device can set up various strategies at seven layers, filter specific messages, such as SQL injection and other application-level attack methods, and further improve the overall security of the system from the application level.

now the 7- layer load balancing, mainly focus on the application of HTTP protocol, so its application is mainly a number of web sites or internal information platform, such as based on B/s development system.

Issues to consider when using a seven-tier load balancing device

1: Necessity , seven-tier applications can indeed increase the flow of intelligence, and must not be immune to the complex configuration of equipment, load balancing pressure and the complexity of troubleshooting problems. In the design of the system you need to consider the four-layer seven-layer simultaneous application of the mixed situation.

2: Security . For example , the Synflood attack, seven-tier mode does block these traffic from the server, but the load balancer device itself has a strong anti-DDoS capability, or even if the server is functioning as a central dispatch load Balancer device failure can cause the entire application to crash. If multiple applications share one or a set of load-balancing devices, then all applications are unavailable when the load-balancing device fails;

3: Flexibility . The advantage of seven-tier applications is that the flow of the entire application can be intelligent, but the load balancing device needs to provide a complete seven-tier capability to meet the customer's application-based scheduling according to different situations.

Scenarios and differences based on fourth-tier load balancing and seven-tier load balancing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.