LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: What is the IP address of responses via LVS DR?

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: What is the IP address of responses via LVS DR?
From: Horms <horms@xxxxxxxxxxxx>
Date: Fri, 5 Dec 2003 18:55:12 +0900
On Fri, Dec 05, 2003 at 03:40:01PM +0530, SAMPATHKUMAR KISHORE KANIYAR wrote:
>   LVS folks,
>   
>   I am new to LVS, and have been configuring and using LVS and learning
>   how LVS works.
>   
>   I have a question about LVS-DR. Look at the following configuration:
>   
>                                     A  ---------------
>                     ------------------| LOAD BALANCER |
>                    |                   ---------------
>                    |                          | A'
>                    |                          |
>                    |                          | 
>                    |                      -------- 
>                    |             --------| Switch |------- 
>                    |            |         --------        |
>                    |            |                         |
>                    |            | B'                      | C'
>                    |        ----------                 ---------- 
>                    |       | SERVER 1 |               | SERVER 2 |
>                    |        ----------                 ----------
>                    |            | B                       | C
>                   _____         |                         |
>                  /     \        |                         |
>   --------      /       \       |                         |
>  | CLIENT |----| Gateway |---------------------------------
>   --------      \       / 
>                  \_____/
>   
>   
>   I have indicated the N/W inteface cards for the Load balancer and
>   the Servers by A, A', B, B' and C, C' respectively.
>   
>   Also, let us say the IP address for N/W interface card A on Load
>   balancer is configured to the Virtual IP: VIP.
>   
>   When the Client request to VIP is directed by the load balancer to
>   Server 1 (say), my understanding is that it is received by
>   Server 1 on N/W interface card B', which will have a loopback
>   alias interface configured with IP address VIP.
>   
>   I have 2 questions about Server 1 "responding" to the "client":
>   1) Server 1 responds to the CLIENT on N/W interface card B, right?
>   2) If so, what is the IP address returned in the response packet?
>      Isn't it the IP address configured for N/W interface card B,
>      which is -not- VIP? But, the client knows/expects only VIP.
>   
>   Can someone clarify?

No it is the VIP. The destination address of the packet recieved
from the end-user (client) via the linux director (load balancer)
will be the VIP. Thus the source address in the reply packet from
the real server (server) to the end-user will be the VIP.

Think of it like this. A host can have more than one IP address
(e.g. 10.0.0.1 and 127.0.0.1) and when a connection is made
to one of these addresses the reply always comes back from
that addresss. This is the same mechanism that is at play in LVS-DR.

As an asside, it is not neccessary to have two NIC's in 
each of the real-servers. One is fine. Though your topology
should work.

-- 
Horms
<Prev in Thread] Current Thread [Next in Thread>