LVS/dr rsp loopback device configuration principle

Source: Internet
Author: User

1. After the LVS scheduler receives a request packet whose destination address is VIP, it changes the MAC address to the MAC address of RSP and sends it to RSP through the switch (Link Layer.

2. After receiving the request from the RSP link layer, the request is sent to the IP layer. The IP layer needs to verify the target IP address of the request. Therefore, RSP needs to configure a VIP loopback device. In this way, the IP layer of the RSP receives the packet and submits it to the transport layer. The reason why the loopback device is configured is that the loopback device is invisible to external users and does not conflict with the lvs vip.

3. After RSP completes processing, return the response packet directly to the client. For a public network server, the RSP needs to connect to the Internet (Public IP address or gateway) to return the response packet.

 

If the VIP address is shared by the scheduler and the server (RealServer), will it cause IP conflict?

The answer is: no. As I said later, "the VIP address configured by the scheduler is visible to external users and is used to receive request packets from virtual services; all servers have their VIP addresses configured on their non-ARP network devices, which are invisible to the outside ". On the scheduler, the VIP and the IP address in the LAN are visible to the outside. on the server, the IP address on the LAN is visible to the outside (the IP address used when the scheduler schedules ), on the server, the VIP is generally known as 127.0.0.1. It is a loopback device that is only visible on the network layer (including the network layer ), this loopback device is used to simulate the behavior of the network adapter. Even if no Nic is installed, IP addresses such as 127.0.0.1 and VIP are available.

So why do we need to add a VIP on the server?

when only the link layer frame of the MAC address is modified and sent to the server's link layer, to submit it to the application layer to process the Program of HTTP and other servers, it must go through the network layer and transport layer, to pass through these layers, the target IP address must be detected.
just as you are going to attend a wedding, when you arrive at the door, the reception staff will ask you who you want to attend the wedding. Here, the wedding is clearly held between Li Xiang and Wang laowu, you said you want to attend the wedding with Nicholas Tse and Cecilia Cheung. The reception staff will never let you in.
What should I do if I want to attend the wedding with Nicholas Tse and Cecilia Cheung and want to enter the wedding scene of Li Xiang and Wang's old five? Then he arranged a person at the wedding scene of Li Xiang and Wang laowu. When you said to him, "I want to attend the wedding with Nicholas Tse." He smiled with a smile, it will help you arrange seats at the wedding venue of Li Xiang and Wang laowu, so that you can enjoy various services.
the VIP in the server has its own nature, which is invisible to the outside world. When the request packet arrives at a part above the network layer, the VIP can be seen, and then it goes all the way up, go to the application layer and enjoy HTTP and other services.

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.