Make a little progress every day-IP address of Server Load balancer

Source: Internet
Author: User

Reprint please explain the source: http://blog.csdn.net/cywosp/article/details/38036537
First, let's take a look at the layer chart of the TCP/IP protocol family that everyone is very familiar with: the role of each layer in the network packet transmission process is not the focus of this article, this article mainly explains how to use IP addresses at the network layer for server cluster load balancing and why it can be used for load balancing at this layer. The Header Format of the IP protocol is as follows: the source address and destination address in the red box is the key to the IP Server Load balancer function. IP Server Load balancer can also be called network layer Server Load balancer, the core principle is to use the kernel driver to change the IP address to achieve data load balancing, as shown in: After the user request data packet (Source Address: 200.110.50.1) reaches the Server Load balancer 114.100.0000200, the server Load balancer server obtains network data packets in the kernel process, obtains an internal Real Server 192.168.1.1 based on a certain load balancing algorithm, and then modifies the destination IP address of the data packet to 192.168.1.1, afterwards, the data packet will be sent to the server at 192.168.1.1. After the server completes processing, the corresponding data packet will be returned to the Server Load balancer server, after the Server Load balancer server changes the source address to 114.100.0000200, the data packet is transmitted to the user's browser. In this process, the data packet does not pass through the user's application process, so the performance of the Server Load balancer is very high. Based on the above diagram and the above explanation, you may think this is easy to implement, the key to processing here is how to return the processed data from the server inside the cluster to the Server Load balancer. Because the destination address of the data packet requested by the user before arriving at the Server Load balancer server is 114.100.0000200, the source address is 200.110.50.1, the destination address modified by the Server Load balancer server is 192.168.1.1, and the source address is 200.110.50.1, therefore, the destination address of the returned data packet will be 200.110.50.1, and the source address will be 192.168.1.1. The final returned data packet will be returned to the Server Load balancer server. There are two solutions: 1. the Server Load balancer server uses a dual-nic, which is an internal and external server. It also modifies the source address while modifying the destination IP address of the request data packet, set the source address to its own IP address, that is, the source address translation (SNAT), so that the internal cluster server will return to the Server Load balancer server; 2. Use the Server Load balancer server as the gateway server of the physical server cluster, so that all responses will be sent through the Server Load balancer. IP Server Load balancer completes data distribution in the kernel process, improving the processing performance. However, because all requests and responses must go through the Server Load balancer server, the maximum response data throughput of the cluster will be limited by the bandwidth of the NIC of the Server Load balancer server, it is difficult for websites that require massive data transmission, such as download services or video services. If response packets can be sent directly to the user's machine without bypassing the Server Load balancer server, what can be done? Of course, there is load balancing at the link layer, which will be explained in the next blog.






Reference: [1] "TCP/IP details, vol. 1: Protocol" [2] "technical architecture of large websites-Core Principles and case studies"






Make a little progress every day-IP address of Server Load balancer

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.