Making IPVS work with IPv6
Hi LVS devs,
I'm currently interning at Google Zurich and we are very interested in porting IPVS to IPv6. Indeed, I will probably dedicate 60-70% of my time to that cause for the next 5 months to come.
Now to be honest, although I've read a lot of kernel code and mailing lists, I've never done any major kernel coding myself. I think I know most of the fundamentals and am very excited about this, but I will need lots of help and ask stupid questions ;)
Here are some questions that came up regarding this. I'd be very thankful if any of you want to share your ideas on them!
1) It looks as though there is no current effort on the way to do this port, right?
2) Are there any serious technical or political roadblocks to this we are not seeing?
3) Currently, IPVS lives under .../net/ipv4/ipvs in the kernel, but much of the code is not IPv4-specific. Any ideas on how to best refactor that common code to make it usable for both IPv4 or IPv6?
4) How could this work be best split up into manageable chunks that could either be worked on serially or in parallel (by multiple developers)?
5) Who else would be interested in parts of this effort or just in helping out when questions come up?
So I've been looking at the code for a couple of days now and some parts I understand well, others I don't get at all, but I hope to change that soon ;)
Looking forward to your replies!
Kind Regards,
Julius Volz
Signature · 1 line
Google Switzerland GmbH
Quoted 3 lines · Julius Volz
Hi LVS devs,
I'm currently interning at Google Zurich and we are very interested in porting IPVS to IPv6. Indeed, I will probably dedicate 60-70% of my time to that cause for the next 5 months to come.
wonderful. Thanks
Quoted 1 line
1) It looks as though there is no current effort on the way to do this port, right?
correct.
Quoted 1 line
2) Are there any serious technical or political roadblocks to this we are not seeing?
There is an effort underway to move ipvs() from the LOCAL_IN chain, where it currently sits for historical reasons, to a better place. A better place is either PREROUTING or FORWARD. Both hooks look OK at the moment. It is possible that the location will be decided at run time. This work is being done by Janusz, who is on this mailing list, but AFAIK it's not in the kernel and hasn't had testing by selected users. You should coordinate with him so that your codes are compatible.
There is a problem with PMTU discovery when using LVS-Tun (described in the HOWTO), which is currently handled (I think) by iptables and an mss option. Part of the problem is that the Linux networking stack doesn't do PMTU correctly. At least be prepared for this problem. I don't know how easy it would be to fix.
We don't have enough people using UDP to know how LVS should handle UDP. There are problems with UDP (described in the HOWTO). People are trying to setup SIP on LVS. With all the ports involved in the protocol, I don't expect it will be easy. I expect the only solution will be a module on the director (like the ftp helper) that understands the SIP protocol. It seems that multiport protocols are going to become more common as coders try to get through ISPs who think it's their business to throttle the internet.
ipvs has an uneasy relationship with netfilter. ipvs bypasses netfilter for speed. However in doing so, iptables no longer works as users would reasonably expect (at least for LVS-NAT). With cpus getting faster, relative to networks (I think that's true), it may not hurt if ipvs is a little slower, for more compatibility with netfilter. However the speed of ipvs is a well regarded feature. *BSD has loadbalancing but it's slow compared to ipvs, so we wouldn't want to drop too much speed.
Quoted 1 line
3) Currently, IPVS lives under .../net/ipv4/ipvs in the kernel, but much of the code is not IPv4-specific.
I expect this is all historical, from when ipvs was based on masquerading code, rather than netfilter.
Quoted 1 line
Any ideas on how to best refactor that common code to make it usable for both IPv4 or IPv6?
If you write it and are happy with it, we'll take your scheme :-). Horms has been doing all the work on LVS for the last couple of years, knows the code and has thought a lot about where LVS should and shouldn't go. I'm sure he'll have ideas on what's best.
Quoted 1 line
4) How could this work be best split up into manageable chunks that could either be worked on serially or in parallel (by multiple developers)?
There hasn't been much developement on ipvs recently. The original developer Wensong hasn't been active for a while and Horms took over. Horms is the one who submits the new code to the kernel. But Horms has been busy doing other things and in the meantime ipvs is not getting a lot of attention. So you'll be it if you take on the ipv6 job.
Quoted 1 line
5) Who else would be interested in parts of this effort or just in helping out when questions come up?
Anyone on this list will be happy to listen to anything you have to say :-)
Quoted 1 line
So I've been looking at the code for a couple of days now and some parts I understand well, others I don't get at all, but I hope to change that soon ;)
good luck. Thanks for taking on the job.
Joe
Signature · 4 lines
Joseph Mack NA3T EME(B,D), FM05lw North Carolina jmack (at) wm7d (dot) net - azimuthal equidistant map generator at http://www.wm7d.net/azproj.shtml Homepage http://www.austintek.com/ It's GNU/Linux!
Simon Horman
maintainerQuoted 8 lines · On Fri, Mar 28, 2008 at 09:23:56AM -0700, Joseph Mack NA3T wrote:
Quoted 5 lines · Julius Volz
Hi LVS devs,
I'm currently interning at Google Zurich and we are very interested in porting IPVS to IPv6. Indeed, I will probably dedicate 60-70% of my time to that cause for the next 5 months to come.
Quoted 6 lines
wonderful. Thanks
Quoted 2 lines
1) It looks as though there is no current effort on the way to do this port, right?
correct.
There was a very old effort that you can find if you search a bit - I can dig up a link if you can't find it. But as far as I am aware there are no efforts at this time.
Quoted 27 lines
Quoted 2 lines
2) Are there any serious technical or political roadblocks to this we are not seeing?
There is an effort underway to move
ipvs()from theLOCAL_INchain, where it currently sits for historical reasons, to a better place. A better place is either PREROUTING or FORWARD. Both hooks look OK at the moment. It is possible that the location will be decided at run time. This work is being done by Janusz, who is on this mailing list, but AFAIK it's not in the kernel and hasn't had testing by selected users. You should coordinate with him so that your codes are compatible.There is a problem with PMTU discovery when using LVS-Tun (described in the HOWTO), which is currently handled (I think) by iptables and an mss option. Part of the problem is that the Linux networking stack doesn't do PMTU correctly.
At least be prepared for this problem. I don't know how easy it would be to fix.We don't have enough people using UDP to know how LVS should handle UDP. There are problems with UDP (described in the HOWTO). People are trying to setup SIP on LVS. With all the ports involved in the protocol, I don't expect it will be easy. I expect the only solution will be a module on the director (like the ftp helper) that understands the SIP protocol. It seems that multiport protocols are going to become more common as coders try to get through ISPs who think it's their business to throttle the internet.
Quoted 7 lines
ipvs has an uneasy relationship with netfilter. ipvs bypasses netfilter for speed. However in doing so, iptables no longer works as users would reasonably expect (at least for LVS-NAT). With cpus getting faster, relative to networks (I think that's true), it may not hurt if ipvs is a little slower, for more compatibility with netfilter. However the speed of ipvs is a well regarded feature. *BSD has loadbalancing but it's slow compared to ipvs, so we wouldn't want to drop too much speed.
[ Joe, I'm not sure that the LOCAL_IN stuff is really related
specifically to IPv6. But you do remind me that those patches need to be revisited. ]
About six months ago I spoke very briefly with Dave Miller (who is ultimately who is going to decide if the code goes in or not) and he had no objections.
Quoted 6 lines
Quoted 2 lines
3) Currently, IPVS lives under .../net/ipv4/ipvs in the kernel, but much of the code is not IPv4-specific.
I expect this is all historical, from when ipvs was based on masquerading code, rather than netfilter.
Quoted 7 lines
Quoted 2 lines
Any ideas on how to best refactor that common code to make it usable for both IPv4 or IPv6?
If you write it and are happy with it, we'll take your scheme :-). Horms has been doing all the work on LVS for the last couple of years, knows the code and has thought a lot about where LVS should and shouldn't go. I'm sure he'll have ideas on what's best.
Yes, I expect so to. It would be good to open up a discussion with Dave Miller and the other netdev people about any refactoring that you think is needed. They should be able to advise on what should go where.
Quoted 10 lines
Quoted 3 lines
4) How could this work be best split up into manageable chunks that could either be worked on serially or in parallel (by multiple developers)?
There hasn't been much developement on ipvs recently. The original developer Wensong hasn't been active for a while and Horms took over. Horms is the one who submits the new code to the kernel. But Horms has been busy doing other things and in the meantime ipvs is not getting a lot of attention. So you'll be it if you take on the ipv6 job.
Quoted 5 lines
Quoted 2 lines
5) Who else would be interested in parts of this effort or just in helping out when questions come up?
Anyone on this list will be happy to listen to anything you have to say :-)
IPv6 is something that has been needed for a long time. I'm quite interested in it myself. But to date haven't had any luck finding time to work on it. I'm happy to help out with your effort. Though I imagine that for the most part it will be in the form of reviewing patches.
Quoted 5 lines
Quoted 3 lines
So I've been looking at the code for a couple of days now and some parts I understand well, others I don't get at all, but I hope to change that soon ;)
good luck. Thanks for taking on the job.
To be honest, sometimes when I look at the code I get surprises too. But if you have any questions please just send them my way, CC usually gets my attention.
Signature · 1 line
Horms
Hi Horms,
Quoted 3 lines · Simon Horman
There was a very old effort that you can find if you search a bit - I can dig up a link if you can't find it. But as far as I am aware there are no efforts at this time.
Yes, you are probably talking about this:
http://www.yggr-drasill.com/LVS6/documents.html
The link has been dead for me throughout the last weeks (and seemed to be dead in 2003 already, so it's very, very old anyways).
Quoted 3 lines
[ Joe, I'm not sure that the
LOCAL_INstuff is really related
specifically to IPv6. But you do remind me that those patches need to be revisited. ]
So these patches might already be in the kernel when I'm starting any real coding work...
Quoted 4 lines
Yes, I expect so to. It would be good to open up a discussion with Dave Miller and the other netdev people about any refactoring that you think is needed. They should be able to advise on what should go where.
Thanks for the pointer! I will explain the issue to them!
Quoted 5 lines
IPv6 is something that has been needed for a long time. I'm quite interested in it myself. But to date haven't had any luck finding time to work on it. I'm happy to help out with your effort. Though I imagine that for the most part it will be in the form of reviewing patches.
Thanks, any help is greatly appreciated! At the moment, I'm still looking at the different projects, how they work together and how to go about this sort of thing in general.
Quoted 1 line
To be honest, sometimes when I look at the code I get surprises too.
:-)
Quoted 2 lines
But if you have any questions please just send them my way, CC usually gets my attention.
Sure, I will!
Thanks,
Julius
Signature · 1 line
Google Switzerland GmbH
Simon Horman
maintainerQuoted 7 lines · Julius Volz
Hi Horms,
Quoted 3 lines · Simon Horman
There was a very old effort that you can find if you search a bit - I can dig up a link if you can't find it. But as far as I am aware there are no efforts at this time.
Quoted 6 lines
Yes, you are probably talking about this:
http://www.yggr-drasill.com/LVS6/documents.html
The link has been dead for me throughout the last weeks (and seemed to be dead in 2003 already, so it's very, very old anyways).
Yes, thats the one. I think that when I checked (about this time last year) the code was still there. But as you say, it is very old.
Quoted 6 lines
Quoted 3 lines
[ Joe, I'm not sure that the
LOCAL_INstuff is really related
specifically to IPv6. But you do remind me that those patches need to be revisited. ]So these patches might already be in the kernel when I'm starting any real coding work...
Ok, understood.
Signature · 1 line
Horms
Quoted 3 lines · Simon Horman
[ Joe, I'm not sure that the
LOCAL_INstuff is really related
specifically to IPv6. But you do remind me that those patches need to be revisited. ]
Agree, but we don't want Julius writing code for LOCAL_IN at the same time we're moving the hook elsewhere.
Joe
Signature · 4 lines
Joseph Mack NA3T EME(B,D), FM05lw North Carolina jmack (at) wm7d (dot) net - azimuthal equidistant map generator at http://www.wm7d.net/azproj.shtml Homepage http://www.austintek.com/ It's GNU/Linux!
Quoted 8 lines · On Mon, Mar 31, 2008, Joseph Mack NA3T <[email protected]> wrote:
Quoted 3 lines · Simon Horman
[ Joe, I'm not sure that the
LOCAL_INstuff is really related
specifically to IPv6. But you do remind me that those patches need to be revisited. ]Agree, but we don't want Julius writing code for
LOCAL_INat the same time we're moving the hook elsewhere.
Horms, when you take the mentioned patch, in which repository will it go to first? In other words, which tree should I be using as my base to always be up to date? Some netdev git repo or just Linus' main one
(git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git)?
Thanks,
Julius
Signature · 1 line
Google Switzerland GmbH
Simon Horman
maintainerQuoted 7 lines · Julius Volz
Quoted 6 lines · On Mon, Mar 31, 2008, Joseph Mack NA3T <[email protected]> wrote:
Quoted 3 lines · Simon Horman
[ Joe, I'm not sure that the
LOCAL_INstuff is really related
specifically to IPv6. But you do remind me that those patches need to be revisited. ]
Quoted 7 lines
Quoted 2 lines
Agree, but we don't want Julius writing code for
LOCAL_INat the same time we're moving the hook elsewhere.Horms, when you take the mentioned patch, in which repository will it go to first? In other words, which tree should I be using as my base to always be up to date? Some netdev git repo or just Linus' main one
(git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git)?
IPVS patches almost always go through netdev and Dave Miller. Dave has a two tree system that works as follows (as far as I understand):
Suppose that the current version that Linus's tree is working towards is 2.6.24. Then Dave's net-2.6.24 tree would be for bug fixes and his net-2.6.25 tree would be for new features.
Once Linus releases 2.6.24 then his merge window for will 2.6.25 open and likely stay open for a couple of weeks. I think that at that time Dave's net-2.6.24 will be removed and net-2.6.25 will be merged into Linus's tree. Once the merge window is closed and Linus's tree is working towards 2.6.25 then net-2.6.25 will become the bugfixes tree for netdev and net-2.6.26 will be creted to accept new work.
Repeat...
So with a bit of luck the LOCAL_IN stuff might go into net-2.6.26 (I think it would be pushing it to get it into net-2.6.25). In any case, if you subscribe to this list (which is rather low volume), then you will probably see any discussions that are going on.
Signature · 1 line
Horms
Hi,
Quoted 8 lines · Simon Horman
IPVS patches almost always go through netdev and Dave Miller. Dave has a two tree system that works as follows (as far as I understand):
Suppose that the current version that Linus's tree is working towards is 2.6.24. Then Dave's net-2.6.24 tree would be for bug fixes and his net-2.6.25 tree would be for new features.
Quoted 6 lines
Once Linus releases 2.6.24 then his merge window for will 2.6.25 open and likely stay open for a couple of weeks. I think that at that time Dave's net-2.6.24 will be removed and net-2.6.25 will be merged into Linus's tree. Once the merge window is closed and Linus's tree is working towards 2.6.25 then net-2.6.25 will become the bugfixes tree for netdev and net-2.6.26 will be creted to accept new work.
Thanks for the explanation! So I will try to always keep up to date with his latest tree.
Quoted 4 lines
So with a bit of luck the
LOCAL_INstuff might go into net-2.6.26 (I think it would be pushing it to get it into net-2.6.25). In any case, if you subscribe to this list (which is rather low volume), then you will probably see any discussions that are going on.
Good. If you mean this list (lvs-devel), I am already subscribed (so no need to CC me usually, as I will look through all mails). I will also subscribe to linux-netdev, but since the traffic there is higher, I won't read through all of it ;)
Regards,
Julius
Signature · 1 line
Google Switzerland GmbH
Simon Horman
maintainerQuoted 8 lines · On Mon, Mar 31, 2008 at 04:43:35AM -0700, Joseph Mack NA3T wrote:
Quoted 3 lines · Simon Horman
[ Joe, I'm not sure that the
LOCAL_INstuff is really related
specifically to IPv6. But you do remind me that those patches need to be revisited. ]Agree, but we don't want Julius writing code for
LOCAL_INat the same time we're moving the hook elsewhere.
IIRC the current change that is being talked about is to allow switching from one hook to another. I think it will be a long while before LOCAL_IN is removed because I think there will be a lot of subtle differences between LVS-LOCAL_IN and LVS-FORWRD. The kind of differences that will break things for some people. So I think LOCAL_IN will have to remain as an option even if FORWARD ends up working well for most people most of the time.
Signature · 1 line
Horms
Quoted 3 lines · Simon Horman
IIRC the current change that is being talked about is to allow switching from one hook to another. I think it will be a long while before
LOCAL_INis removed
fine with me
Joe
Signature · 4 lines
Joseph Mack NA3T EME(B,D), FM05lw North Carolina jmack (at) wm7d (dot) net - azimuthal equidistant map generator at http://www.wm7d.net/azproj.shtml Homepage http://www.austintek.com/ It's GNU/Linux!
Hi Joe,
Thanks for the great feedback!
Quoted 9 lines · On Fri, Mar 28, 2008, Joseph Mack NA3T wrote:
There is an effort underway to move
ipvs()from theLOCAL_INchain, where it currently sits for historical reasons, to a better place. A better place is either PREROUTING or FORWARD. Both hooks look OK at the moment. It is possible that the location will be decided at run time. This work is being done by Janusz, who is on this mailing list, but AFAIK it's not in the kernel and hasn't had testing by selected users. You should coordinate with him so that your codes are compatible.
Ok, good to know, I will do that!
Quoted 6 lines
There is a problem with PMTU discovery when using LVS-Tun (described in the HOWTO), which is currently handled (I think) by iptables and an mss option. Part of the problem is that the Linux networking stack doesn't do PMTU correctly. At least be prepared for this problem. I don't know how easy it would be to fix.
Thanks for the warning, I guess you are talking about this (and the following points):
http://www.austintek.com/LVS/LVS-HOWTO/HOWTO/LVS-HOWTO.LVS-Tun.html#MTU
Does this have any special implications in the IPv6 case? The problem looks pretty complicated and no one seems to completely understand it ;) I will keep it in mind for later though.
Quoted 9 lines
We don't have enough people using UDP to know how LVS should handle UDP. There are problems with UDP (described in the HOWTO). People are trying to setup SIP on LVS. With all the ports involved in the protocol, I don't expect it will be easy. I expect the only solution will be a module on the director (like the ftp helper) that understands the SIP protocol. It seems that multiport protocols are going to become more common as coders try to get through ISPs who think it's their business to throttle the internet.
Again, interesting info. Is there a specific relation to IPv6 though?
Quoted 9 lines
ipvs has an uneasy relationship with netfilter. ipvs bypasses netfilter for speed. However in doing so, iptables no longer works as users would reasonably expect (at least for LVS-NAT). With cpus getting faster, relative to networks (I think that's true), it may not hurt if ipvs is a little slower, for more compatibility with netfilter. However the speed of ipvs is a well regarded feature. *BSD has loadbalancing but it's slow compared to ipvs, so we wouldn't want to drop too much speed.
Aha, interesting. Could you explain a bit more for a newbie in what ways IPVS "bypasses" netfilter? Other than that IPVS is basically a Netfilter extension, it is still not really clear to me how other Netfilter features are affected when using IPVS in combination with them.
Quoted 5 lines
Quoted 2 lines
3) Currently, IPVS lives under .../net/ipv4/ipvs in the kernel, but much of the code is not IPv4-specific.
I expect this is all historical, from when ipvs was based on masquerading code, rather than netfilter.
Ok.
Quoted 8 lines
Quoted 2 lines
Any ideas on how to best refactor that common code to make it usable for both IPv4 or IPv6?
If you write it and are happy with it, we'll take your scheme :-). Horms has been doing all the work on LVS for the last couple of years, knows the code and has thought a lot about where LVS should and shouldn't go. I'm sure he'll have ideas on what's best.
Great.
Quoted 10 lines
Quoted 3 lines
4) How could this work be best split up into manageable chunks that could either be worked on serially or in parallel (by multiple developers)?
There hasn't been much developement on ipvs recently. The original developer Wensong hasn't been active for a while and Horms took over. Horms is the one who submits the new code to the kernel. But Horms has been busy doing other things and in the meantime ipvs is not getting a lot of attention. So you'll be it if you take on the ipv6 job.
Wow, ok. Again, I don't have any experience with kernel coding, but I will learn as much as I can!
Quoted 5 lines
Quoted 2 lines
5) Who else would be interested in parts of this effort or just in helping out when questions come up?
Anyone on this list will be happy to listen to anything you have to say :-)
Great :)
Quoted 1 line
good luck. Thanks for taking on the job.
Thank you very much!
Julius
--
Google Switzerland GmbH
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 6 lines · Julius Volz
Thanks for the warning, I guess you are talking about this (and the following points):
http://www.austintek.com/LVS/LVS-HOWTO/HOWTO/LVS-HOWTO.LVS-Tun.html#MTU
Does this have any special implications in the IPv6 case?
possibly, possibly not. I was just warning you so that if you came across it, you would recognize it.
Quoted 6 lines
The problem looks pretty complicated and no one seems to completely understand it ;) I will keep it in mind for later though.
Quoted 2 lines
We don't have enough people using UDP to know how LVS should handle UDP.
Again, interesting info. Is there a specific relation to IPv6 though?
I assume you'll be testing UDP, and if it behaves strangely, you'll want to know which parts to blame us for :-)
Quoted 1 line
Aha, interesting. Could you explain a bit more for a newbie in what ways IPVS "bypasses" netfilter?
LVS controlled packets don't always follow the netfilter path. They appear in the output without going through the middle. So iptables rules don't always work.
Joe
Signature · 4 lines
Joseph Mack NA3T EME(B,D), FM05lw North Carolina jmack (at) wm7d (dot) net - azimuthal equidistant map generator at http://www.wm7d.net/azproj.shtml Homepage http://www.austintek.com/ It's GNU/Linux!
Hi,
Quoted 5 lines · On Mon, Mar 31, 2008, Joseph Mack NA3T wrote:
Quoted 1 line · Julius Volz
Does this have any special implications in the IPv6 case?
possibly, possibly not. I was just warning you so that if you came across it, you would recognize it.
Ok!
Quoted 5 lines
Quoted 2 lines
Again, interesting info. Is there a specific relation to IPv6 though?
I assume you'll be testing UDP, and if it behaves strangely, you'll want to know which parts to blame us for :-)
I see, thanks! :)
Quoted 6 lines
Quoted 2 lines
Aha, interesting. Could you explain a bit more for a newbie in what ways IPVS "bypasses" netfilter?
LVS controlled packets don't always follow the netfilter path. They appear in the output without going through the middle. So iptables rules don't always work.
Ah, a kind colleague just forwarded me this URL:
http://www.austintek.com/LVS/LVS-HOWTO/HOWTO/LVS-HOWTO.filter_rules.html#path_of_an_ip_vs_packet
So that fits to what I thought before. Basically, FORWARD is skipped over and the "forwarding" is done manually in IPVS (by sending a new packet, changed according to the specific load balancing mechanism? In ip_vs_xmit.c, in one of the transmitter functions).
Julius
Signature · 1 line
Google Switzerland GmbH