The so-called four-layer and seven-layer load balancing, is when the background server load balancing, based on the four layer of information or seven layer of information to determine how to forward traffic.
Four-layer load balancing: The main analysis of the IP layer and the TCP/UDP layer, by publishing a three-layer IP address (VIP) plus four-tier port number to determine which traffic needs to be load balanced, the traffic needs to be processed NAT processing and then forwarded to the background service.
The workflow takes TCP, for example, when the Load Balancer server receives the first SYN request from the client, selects an optimal server by the above method, and forwards the target IP address in the message (to the IP of the backend server) directly to the back-end server. The TCP connection is established that the three-time handshake is established directly on the client and server side, and the load Balancer device just acts as a router-like forwarding action.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/71/52/wKioL1XLMZnQLGcxAABnKwBEH10042.jpg "title=" 9.PNG " alt= "Wkiol1xlmznqlgcxaabnkwbeh10042.jpg"/>
Seven-layer load balancing: On the basis of four layer, consider the characteristics of the application layer, than like a Web server load balancing, in addition to the VIP plus 80 port to identify the traffic that needs to be processed, but also according to the seven layer of URLs, browser categories, etc. to determine whether to load balance.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/71/52/wKioL1XLOBTg1H2hAABspBzjZvg514.jpg "title=" 10.PNG "alt=" Wkiol1xlobtg1h2haabspbzjzvg514.jpg "/>
The workflow takes TCP as an example: a seven-tier load Balancing server acts as a proxy server, and when a client accesses webserver, it first establishes a TCP connection with a seven-tier load balancer through three handshakes, sends the message information to be accessed to a seven-tier load balancer, The seven-tier load balancer then selects webserver based on the set load balancing rules, then establishes a TCP connection with the webserver through three handshakes, and finally webserver the data back to the seven-tier load-balancing device and sends it back to the client.
The difference between four-layer and seven-layer load balancing