net/ipv4/ip_gre: Ethernet multipoint GRE over IP
Subsystems (3)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH v7 1/1 net/ipv4/ip_gre: Ethernet multipoint GRE over IP
From: Stefan Gula <[email protected]>
This patch is an extension for current Ethernet over GRE implementation, which allows user to create virtual bridge (multipoint VPN) and forward traffic based on Ethernet MAC address information in it. It simulates the Bridge behavior learning mechanism, but instead of learning port ID from which given MAC address comes, it learns IP address of peer which encapsulated given packet. Multicast, Broadcast and unknown-multicast traffic is send over network as multicast encapsulated GRE packet, so one Ethernet multipoint GRE tunnel can be represented as one single virtual switch on logical level and be also represented as one multicast IPv4 address on network level.
---
V6&7 changes:
- added "[no]bridge" netlink option to enable or disable the behavior based on configuration rather then using only kernel option. Example of such link creation:
ip link add VPN1 type gretap local 10.1.1.1 remote 239.192.0.1 key 12345 ttl 5 nopmtu bridge
- Default value is "nobridge"
- This provides backward compatibility with any previous installations
- run flush function after interface moved from "bridge" to "nobridge" behavior
Before you decline this please consider the things below:
Reasons for adding this to kernel directly instead of openvswitch code:
- neither NVGRE nor VXLAN are part of the openvswitch for now
- NVGRE is even not yet fully standardized. Missing info how the mapping table will
be build -> new RFC is expected for this
- VXLAN uses always header of size 16B (8B VXLAN header + 8B UDP header)
- openvswitch doesn't implement ebtables/arptables/iptables rules properly, so if one wanted to use this in combinations it needs original bridge code, which would be somehow connected to openvswitch
- e.g. using veth module between them
This brings 3 lookups (original bridge, openvswitch bridge and gre internal bridge) instead of only 2 (original bridge and bridge inside the gretap interface) resulting apparently in non optimal performance.
- e.g. in my scenario linux-based APs uses ebtables, iptables and arptables to prevent ARP spoofing, DHCP spoofing, IP spoofing, and do some mangling staff like NATting of some mac-addresses...
- My patch uses headers of size from 8B to 20B (depends on configuration)
- possible less fragmentation needed in contrast to VXLAN
- methodology of learning VXLAN and my patch is almost the same - my is only missing mapping of inner multicast groups to outside multicast addresses. VXLAN relies on controller to define that, my is limited for using only one multicast address for all inner multicasts
- adding "bridge" keyword make this patch stable and backward compatible
- fully compatible with any kind of filtering/mangling needed based on standard linux network stack (excluding filtering inside the gretap bridge itself)
Summary:
- OpenVswitch is apparently good solution for virtualization deployments where network security is done on separate devices or not needed at all, but currently lacks several security aspects to be fully ready to replace the original bridge code in non virtualized environments, where the boxes implement also network security features like linux based APs. I believe that such major changes should be driven by some maintainer of openvswitch rather than myself.
Patch V7:
include/linux/if_tunnel.h +1 -0
@@ -75,6 +75,7 @@ enum {IFLA_GRE_TTL ,IFLA_GRE_TOS ,IFLA_GRE_PMTUDISC , +IFLA_GRE_BRIDGE , __IFLA_GRE_MAX, };
include/net/ipip.h +9 -0
@@ -27,6 +27,15 @@ struct ip_tunnel {__u32 o_seqno;/* The last output seqno */ int hlen;/* Precalculated GRE header length */ int mlink; +#ifdef CONFIG_NET_IPGRE_BRIDGE +#define GRETAP_BR_HASH_BITS 8 +#define GRETAP_BR_HASH_SIZE (1 << GRETAP_BR_HASH_BITS) +struct hlist_head hash[GRETAP_BR_HASH_SIZE ]; +spinlock_t hash_lock; +unsigned long ageing_time; +struct timer_list gc_timer; +bool br_enabled; +#endif struct ip_tunnel_parm parms;
net/ipv4/Kconfig +9 -0
@@ -211,6 +211,15 @@ config NET_IPGRE_BROADCAST Network), but can be distributed all over the Internet. If you want to do that, say Y here and to "IP multicast routing" below. +config NET_IPGRE_BRIDGE + bool "IP: Ethernet over multipoint GRE over IP" + depends on IP_MULTICAST && NET_IPGRE && NET_IPGRE_BROADCAST + help + Allows you to use multipoint GRE VPN as virtual switch and interconnect + several L2 endpoints over L3 routed infrastructure. It is useful for + creating multipoint L2 VPNs which can be later used inside bridge + interfaces If you want to use. GRE multipoint L2 VPN feature say Y. + config IP_MROUTE bool "IP: multicast routing" depends on IP_MULTICAST
net/ipv4/ip_gre.c +271 -4
372 lines not on this page · raw message
David Miller
maintainerFrom: Stefan Gula <[email protected]>
Date: Tue, 31 Jan 2012 14:21:51 +0100 (CET)
Quoted 1 line
- neither NVGRE nor VXLAN are part of the openvswitch for now
Too bad, it means we'll have this new user API of your's so when openvswitch does add the necessary code we CANNOT REMOVE your stuff.
I'm not applying this until you at least attempt an openvswitch version, and that's basically the end of this discussion.
2012/1/31 David Miller <[email protected]>:
Quoted 10 lines
From: Stefan Gula <[email protected]>
Date: Tue, 31 Jan 2012 14:21:51 +0100 (CET)Quoted 1 line
- neither NVGRE nor VXLAN are part of the openvswitch for now
Too bad, it means we'll have this new user API of your's so when openvswitch does add the necessary code we CANNOT REMOVE your stuff.
I'm not applying this until you at least attempt an openvswitch version, and that's basically the end of this discussion.
I actually tried to deploy it on one of my linux based APs. And that's when I realize that openvswitch have several limitations why I cannot use it in my scenario on it's own. I tried to put only standard one point-to-point GRE tunnel from openvswitch without any modifications of my own and find out that it will never work ok as it is missing the security parts (ebtables/arptables/iptables), so in my scenario I end up with original bridge for security and openvswitch bridge with opevswitch gre tunnel, all linked together by veth link. Result of performance was that (veth code + openswitch bridge + openvswitch gre code) was worse than using only my gretap code. On the other hand if I omit the fact about the missing the security features (omitting also use of the original bridge code), then the result was in favor of openvswitch (that's the same result as Joseph provided).
About the new API. Openvswitch is using it's own GRE code, with it's own API. So if the finally NVGRE or VXLAN will be added to openvswitch,it doesn't breaks anything to leave also my API as is. For those who will be using my API in that time, they could consider migrations of their scripts from standard bridge based code with gretap interfaces towards openvswitch with NVGRE code or VXLAN code instead. Until that time they can consider using bridge code with gretap interfaces or openvswitch code with the same gretap interfaces => both switches can benefit from it. So no harm done on this side - maybe I am not seeing something that you do, am I?
About the porting of my code into openvswitch directly. I believe that developing/porting something, that will be most probably replaced eventually with something based on RFC standards like NVGRE, which is still in progress of developing, and cannot be really used in managed networks, like my own, at all due other missing features, is a huge waste of anybody's time.
David Miller
maintainerFrom: Štefan Gula <[email protected]>
Date: Wed, 1 Feb 2012 00:32:04 +0100
Quoted 3 lines
About the new API. Openvswitch is using it's own GRE code, with it's own API. So if the finally NVGRE or VXLAN will be added to openvswitch,it doesn't breaks anything to leave also my API as is.
You don't understand.
If your code is superfluous in the end, we shouldn't add it in the first place.
But if I do relent and let your code in now, we have to live with it, and it's associated maintainence costs, FOREVER.
That's why I'm forcing this to be implemented properly from the start, so we don't end up with two pieces of code that provide essentially the same functionality.
2012/2/1 David Miller <[email protected]>:
Quoted 9 lines
From: Štefan Gula <[email protected]>
Date: Wed, 1 Feb 2012 00:32:04 +0100You don't understand.
If your code is superfluous in the end, we shouldn't add it in the first place.
Quoted 6 lines
But if I do relent and let your code in now, we have to live with it, and it's associated maintainence costs, FOREVER.
That's why I'm forcing this to be implemented properly from the start, so we don't end up with two pieces of code that provide essentially the same functionality.
I understand your strategic point of maintenance here and partially agree with it. And if I understand it correctly, it is to one day have openvswitch as full replacement of linux bridge code. On the other hand gretap interface already exists in kernel so that part of the code is currently also superfluous - what's the plan with that particular piece of code?. So if this is now only about the maintenance of my code, I'll be more than happy to continue maintaining it myself together with you guys. And if it comes in the future to decision to remove whole gretap code (not just my part) and replace it with something else that will provide the same or even more functionality, I have absolutely no problem with that.
David Miller
maintainerFrom: Štefan Gula <[email protected]>
Date: Wed, 1 Feb 2012 08:22:02 +0100
Quoted 3 lines
So if this is now only about the
maintenance of my code, I'll be more than happy to continue maintaining it myself together with you guys.
You have a very warped understanding of what maintainence cost means.
Everyone time someone wants to change a core API in the networking your new code will need to be considered. Every time someone wants to audit how an interface is used, your code adds to the audit burdon.
And this is burdon placed upon other people, even if you personally "promise" to maintain this specific code snippet. This promise completely meaningless from a global kernel maintainence standpoint.
More code has a cost, no matter how well that specific piece of code is maintained.
Therefore we don't add supurious code, and your code is spurious if it will end up duplicating a more desirable implementation and interface for this functionality.
The world has spun successfully countless times in the 18 years that Linux hasn't had support for the feature you are so gravely interested in including "right now", and I suspect it will spin successfully a few more times while a proper implementation is ironed out.
2012/2/1 David Miller <[email protected]>:
Quoted 7 lines
From: Štefan Gula <[email protected]>
Date: Wed, 1 Feb 2012 08:22:02 +0100Quoted 3 lines
So if this is now only about the
maintenance of my code, I'll be more than happy to continue maintaining it myself together with you guys.
Quoted 5 lines
You have a very warped understanding of what maintainence cost means.
Everyone time someone wants to change a core API in the networking your new code will need to be considered. Every time someone wants to audit how an interface is used, your code adds to the audit burdon.
That's true. But as I said. gretap interface already exists in linux kernel. Without my patch it simply use logic of point-to-point tunnel or static point-to-multipoint tunnel using muticast IP address as destination. The point here is that the maintenance cost is there already:
From the kernel API point of view the functions that enables use of gre or gretap interface are already there maintained (functions like init/exit/xmit/receive...). That part of the code was modified as little as possible. If that kernel API changes, the API will need to be changed also for standard gre or gretap code, which in the end almost the same amount of time consumed to figure out the code as it is the same functions that are called.
From the user-space/netlink API point of view those functions (open/close/add/change/del....) are already maintained - my patch allows you to use only one additional keyword "bridge" to maintain backward compatibility, so if that part of API changes, it influences again whole gre/gretap API and therefore almost the same amount of code is needed to be checked.
The last portion of auditing the code purpose is that you are developing something new that doesn't exists or try to port the code to somewhere else. In that time we are talking about maintaining the gre/gretap code itself and not some global API changes - that's the only one relevant where more time is needed, but this one is expected (at least should be by developer)
If I missed something, please feel free to highlight it.
Quoted 4 lines
And this is burdon placed upon other people, even if you personally "promise" to maintain this specific code snippet. This promise completely meaningless from a global kernel maintainence standpoint.
Yes, the burdon is there, but it's minimal from global point of view.
Quoted 3 lines
Therefore we don't add spurious code, and your code is spurious if it will end up duplicating a more desirable implementation and interface for this functionality.
It cannot duplicate something that doesn't actually currently exists. VXLAN or NVGRE are still in process of developing/designing, so in the end it could easily happen that those "standards" will not do the same thing or by the same methodology - it's completely on those developers/designers, if they adopt my implementation/design or use something else. Openvswitch gre interface is currently only the same as thing as is current gretap interface in linux kernel with some kind of caching code - nothing more.
2012/2/1 Štefan Gula <[email protected]>:
Quoted 1 line
2012/2/1 David Miller <[email protected]>:
I think that everything what could be done and said from my-side to provide you guys answers to hopefully all your questions and to get this into kernel was done. So I would like to ask you to provide me final feedback. Thanks
2012/2/7 Štefan Gula <[email protected]>:
Quoted 8 lines
2012/2/1 Štefan Gula <[email protected]>:
Quoted 1 line
2012/2/1 David Miller <[email protected]>:
I think that everything what could be done and said from my-side to provide you guys answers to hopefully all your questions and to get this into kernel was done. So I would like to ask you to provide me final feedback. Thanks
After staring at your message over ten minutes I have to say that you really need to stop overnight work ASAP and take a hot shower and a cup of hot coffee, then try to sort out answer to my question, what Ingo Molnar did, like ANK and old David, in the past ten years, and how?
David Miller
maintainerFrom: Štefan Gula <[email protected]>
Date: Tue, 7 Feb 2012 10:10:04 +0100
Quoted 6 lines
2012/2/1 Štefan Gula <[email protected]>:
Quoted 1 line
2012/2/1 David Miller <[email protected]>:
I think that everything what could be done and said from my-side to provide you guys answers to hopefully all your questions and to get this into kernel was done. So I would like to ask you to provide me final feedback. Thanks
Your patch will not be applied, you haven't said anything new to me, you haven't given me any new information that would change my position, so it should be no surprise to you that I still want you to work towards a solution that uses openvswitch.
And btw, your inability to see our point of view on this matter in any way, shape, or form, is really working to your disadvantage and is undermining your ultimate goals. Your should seriously reconsider how you are going about this, because right now I cringe when I see messages from you in my inbox and I bet a lot of other people feel this way right now as well.
Quoted 13 lines · On Tue, 31 Jan 2012 14:21:51 +0100 (CET) Stefan Gula <[email protected]> wrote:
From: Stefan Gula <[email protected]>
This patch is an extension for current Ethernet over GRE implementation, which allows user to create virtual bridge (multipoint VPN) and forward traffic based on Ethernet MAC address information in it. It simulates the Bridge behavior learning mechanism, but instead of learning port ID from which given MAC address comes, it learns IP address of peer which encapsulated given packet. Multicast, Broadcast and unknown-multicast traffic is send over network as multicast encapsulated GRE packet, so one Ethernet multipoint GRE tunnel can be represented as one single virtual switch on logical level and be also represented as one multicast IPv4 address on network level.
Quoted 1 line
Signed-off-by Stefan Gula <[email protected]>
Have you looked at the NVGRE standard?
http://tools.ietf.org/html/draft-sridharan-virtualization-nvgre-00
2012/1/31 Stephen Hemminger <[email protected]>:
Quoted 16 lines
Quoted 13 lines · On Tue, 31 Jan 2012 14:21:51 +0100 (CET) Stefan Gula <[email protected]> wrote:
From: Stefan Gula <[email protected]>
This patch is an extension for current Ethernet over GRE implementation, which allows user to create virtual bridge (multipoint VPN) and forward traffic based on Ethernet MAC address information in it. It simulates the Bridge behavior learning mechanism, but instead of learning port ID from which given MAC address comes, it learns IP address of peer which encapsulated given packet. Multicast, Broadcast and unknown-multicast traffic is send over network as multicast encapsulated GRE packet, so one Ethernet multipoint GRE tunnel can be represented as one single virtual switch on logical level and be also represented as one multicast IPv4 address on network level.
Quoted 4 lines
Quoted 1 line
Signed-off-by Stefan Gula <[email protected]>Have you looked at the NVGRE standard?
http://tools.ietf.org/html/draft-sridharan-virtualization-nvgre-00
Yes, I did.
One section from 3.1. NVGRE Endpoint:
To encapsulate an
Ethernet frame, the endpoint needs to know location information for the destination address in the frame. The way to obtain this information is not covered in this document and will be covered in a different draft. Any number of techniques can be used in the control plane to configure, discover and distribute the policy information. For the rest of this document we assume that the location information including TNI is readily available to the NVGRE endpoint.