LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

RE: How does LVS-DR work?

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: RE: How does LVS-DR work?
From: Michael Spiegle <mike@xxxxxxxxxxxxxxxx>
Date: Sun, 05 Nov 2006 22:06:20 -0800

Ok... trying to send this email for the 3rd time.  The server didn't like my 
last reply...


Ok, I am even more confused now :)

Are you referring to Layer 2 or Layer 3 destination address mangling? 
As far as I know, an LVS configured for NAT will mangle the destination
IP address from the VIP to the realserver's address.  It then places
this packet on the network and it goes to the realserver.  Since the
LVS changes the destination (and not the source IP address), the
realserver on the backend still sees the originating IP address.  When
the realserver formulates its response, doesn't the response goto the
MAC address which it received the request from (LVS)?



In the case of LVS-DR, the destination MAC address is changed - however
the destination VIP address is maintained.  The only way a realserver
will service this connection is if you have configured the VIP on the
loopback interface.  Since we have done this, the realserver will
formulate a reply, however the reply does NOT go back to where it came
from (LVS), it goes around LVS.  Is this correct?

---
Michael Spiegle
mike@xxxxxxxxxxxxxxxx


---------------------------------------------------------------------------

Lets say a client makes a connection to your LVS, the LVS forwards that
> packet to a realserver, and the realserver then directly replies to the
> original client.  Why does the realserver send the packet to the
> originating client and not back to the LVS it came from?  It would see
> to me that under normal network situations, the realserver should reply
> back to wherever the request came from (LVS in this case), but it
> doesn't.  The only thing I can come up with is that the LVS doesn't use
> its own MAC address as the source-mac on the packets going to the
> realserver.  It uses the MAC address of whatever sent the original
> packets to the LVS (possibly a router?).  Is that how it works?


Nope...   :)   The director actually forwards the packet to the realserver and
the realserver thinks it came from the client...  The realserver sends back
a reply to the IP that the packet originated from, and since the director
doesn't change the packet's originator, it goes back to the client.

        Dave   :) 

-- 


---
Michael Spiegle
mike@xxxxxxxxxxxxxxxx


-- 


---
Michael Spiegle
mike@xxxxxxxxxxxxxxxx


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