The principle, advantages and disadvantages of three working modes of LVS

Source: Internet
Author: User
Tags requires node server advantage

First, NAT mode (Vs-nat)

Principle:

Is the destination address of the IP header of the packet sent to the client, in the load balancer replaced by one of the RS IP address, and then to deal with RS, RS processing completed after the data to the load balancer, load balancer and then the original IP address of the packet to its own IP, When the destination address is changed to the client IP address, the load balancer must be passed either in or out of the traffic.

Advantage: The physical servers in the cluster can use any TCP/IP operating system, and only the load balancer requires a legitimate IP address.

Disadvantage: limited scalability. When the server node (normal PC server) grows too much, the load balancer becomes the bottleneck of the entire system, because all the request packages and the response packets flow through the load balancer. When there are too many server nodes, a large number of packets converge on the load balancer, and the speed slows down!

Second, IP tunnel mode (Vs-tun)

Principle:

The first thing to know is that most Internet services on the Internet request packages are short, and the answer packs are usually large. So the tunnel mode is the packet that sends the client, encapsulation of a new IP header tag (only the destination IP) sent to the Rs,rs received, first the packet's head to untie, restore the packet, after processing, directly back to the client, do not need to go through the load Balancer attention, because RS need to load Balancer sent Data packets to be restored, so that the Iptunnel protocol must be supported so, in the kernel of RS, you must compile the support iptunnel this option

Advantage: The load balancer is responsible only for distributing the request packets to the backend node server, while RS sends the answer packets directly to the user. Therefore, reduce the load balancer a large number of data flow, load balancer is no longer the bottleneck of the system, can handle a huge request, this way, a load balancer can be distributed for many Rs. and running on the public web can be distributed in different regions.

Disadvantage: Tunnel mode RS nodes need legitimate IP, this way requires all servers to support the "IP Tunneling" (IP Encapsulation) protocol, the server may only be limited to some Linux systems.

Iii. Direct routing mode (VS-DR)

Principle:

Both the Load balancer and RS use the same IP external service, but only Dr responds to ARP requests, all RS to the ARP request of itself this IP is silent that is to say, the gateway to the service IP request all directed to the DR, and Dr received the packet according to the scheduling algorithm, find the corresponding RS, To change the destination MAC address to Rs Mac (because the IP is consistent) and distribute the request to this RS at this time RS received this packet, processing completed, due to IP consistent, you can directly return the data to the customer, it is equal to receive this packet directly from the client, Back to the client directly after the load balancer to the two-layer header change, so the load balancer and RS must be in a broadcast domain, but also can be simply understood as on the same switch

Advantages: As with Tun (tunnel mode), the load balancer is only a distribution request, and the answer packet is returned to the client through a separate routing method. Compared with Vs-tun, VS-DR does not require a tunneling structure, so most operating systems can be used as physical servers.

Disadvantages: (Can not say the shortcoming, can only say is insufficient) requires that the network adapter of the load balancer must be in a physical section with the physical NIC.

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/Servers/zs/

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.