[ovs-dev] adding an option for GRE tunneling without an Ethernet header

thomas.morin at orange.com thomas.morin at orange.com
Thu Feb 27 17:16:18 UTC 2014


Hello,

Currently, OVS GRE tunnels use Ethertype 6558 and the GRE packets 
produced by OVS hence always are xxx-over-Ethernet-over-GRE. 
Symmetrically OVS expects received GRE packets to be of the same 
ethertype and carry an Ethernet payload.

I have written the included patch, which does the following:
- add a "noeth" option for a GRE tunnel, so that the Ethernet header is 
stripped before GRE encapsulation (the option, of course, defaults to 
the current behavior)
- on reception, recreates a fake Ethernet header if the ethertype of the 
received packet is not 6558 -- this behavior is similar to what the LISP 
tunneling code does

Note that, in both cases, the code takes care of preserving correct 
ethertypes.

As a result, this patch allows to setup GRE tunnels to interconnect OVS 
with network devices doing a usual x-over-GRE approach such as IP/MPLS 
routers.

The patch builds and passes unit tests.
It has been tested to confirm with a packet capture that:
- with the option set on a tunnel, the GRE packets from this tunnel are 
send and received as expected
- for a tunnel without this option, or we the option disabled, the 
current behavior is preserved

Caveats:
- documentation and unit test are missing, but I'll be happy to 
contribute these later
- I not an experimented C coder, please be kind :)
- some parts of the code are a bit of a guess work from me: I'm unsure 
of what needs to be done for GSO (possibly it can be done later?), or if 
re-checksumming is really needed after recreating a fake Ethernet header

I'd be happy to have comments on the approach and on the patch and to 
take them into account.

Thank you,

-Thomas

  datapath/datapath.c                            |    1
  datapath/flow_netlink.c                        |    7 +++
  datapath/linux/compat/include/net/gre.h        |    4 +
  datapath/linux/compat/include/net/ip_tunnels.h |    1
  datapath/vport-gre.c                           |   57 
++++++++++++++++++++++++-
  include/linux/openvswitch.h                    |    1
  lib/flow.c                                     |    2
  lib/flow.h                                     |    1
  lib/netdev-vport.c                             |    9 +++
  lib/netdev.h                                   |    1
  lib/odp-util.c                                 |   11 ++++
  lib/odp-util.h                                 |    3 -
  ofproto/tunnel.c                               |    7 ++-
  13 files changed, 101 insertions(+), 4 deletions(-)

_________________________________________________________________________________________________________________________

Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gre-noeth.diff
Type: text/x-patch
Size: 12394 bytes
Desc: gre-noeth.diff
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20140227/41d7c8ad/attachment-0005.bin>


More information about the dev mailing list