netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Adding SNAT support to LVS/NAT
@ 2008-09-13 11:12 Julius Volz
  2008-09-13 18:17 ` Joseph Mack NA3T
  0 siblings, 1 reply; 19+ messages in thread
From: Julius Volz @ 2008-09-13 11:12 UTC (permalink / raw)
  To: lvs-devel, netdev; +Cc: j.stubbs

Hi,

I'm wondering about how hard it would be to add SNAT support to IPVS
(that is, the director rewriting packets from the client to backends
to appear to be from the VIP and some randomly allocated port). This
would allow us to have remote real servers with LVS/NAT. I realize
that Jason Stubb's PRE/POSTROUTING patches would also make this
possible, but they seemed risky and we haven't heard of them in a long
time. Also, having this option directly integrated into the rest of
the IPVS NAT code might make it easier to use: just add another flag
on the ipvsadm command line when you want SNAT for an LVS/NAT backend.

Two problems I noticed immediately:

- Getting a free port:
We need to find an unused port for the SNAT for each connection. Is
there some subsystem function than can be used to easily find/allocate
a free TCP/UDP port (sockets and netfilter NAT would need this too)?
Also, this would only allow <64k connections to each backend. The only
way to possibly differentiate between more would be to look at
sequence numbers, but IPVS doesn't do that at all currently...

- Connection entry lookup:
Connection entries are currently hashed and looked up by [client IP,
client port]. In the new SNAT case, packets coming from the real
server to the director would have to be looked up by [VIP, xport],
where xport is a port that is allocated by IPVS for each connection. A
simple (hacky?) solution would be to just hash each connection entry
twice. Is there a better way?

Are there any other major problems with this? Is it the right way to
go in general? I'm mainly just doing some exploration into this now...

Thanks for any comments!

Julius

-- 
Julius Volz - Corporate Operations - SysOps

Google Switzerland GmbH - Identification No.: CH-020.4.028.116-1

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2008-09-18  8:38 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-13 11:12 Adding SNAT support to LVS/NAT Julius Volz
2008-09-13 18:17 ` Joseph Mack NA3T
2008-09-13 18:55   ` Graeme Fowler
2008-09-13 18:58     ` Joseph Mack NA3T
2008-09-14  0:41     ` Julius Volz
2008-09-14  0:31   ` Julius Volz
2008-09-14  1:37     ` Joseph Mack NA3T
2008-09-14 10:39       ` Julius Volz
2008-09-14 14:47         ` Julius Volz
2008-09-14 15:14           ` Joseph Mack NA3T
2008-09-15  1:43           ` Simon Horman
2008-09-15 15:24             ` Joseph Mack NA3T
2008-09-16  1:31               ` Jason Stubbs
2008-09-16  1:54                 ` Joseph Mack NA3T
2008-09-16  2:04                   ` Jason Stubbs
2008-09-16 20:45             ` Julius Volz
2008-09-17 22:53               ` Joseph Mack NA3T
2008-09-18  8:38                 ` Julius Volz
2008-09-15 22:56           ` Julian Anastasov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).