[ovs-dev] [PATCH v4 0/2] Encap & Decap actions for MPLS packet type

Martin Varghese martinvarghesenokia at gmail.com
Fri Mar 26 06:20:46 UTC 2021


From: Martin Varghese <martin.varghese at nokia.com>

The existing PUSH MPLS & POP MPLS actions inserts & removes MPLS header
between ethernet header and the IP header. Though this behaviour is fine
for L3 VPN where an IP packet is encapsulated inside a MPLS tunnel, it
does not suffice the L2 VPN requirements. In L2 VPN the ethernet packets
must be encapsulated inside MPLS tunnel

In this change the encap & decap actions are extended to support MPLS
packet type. The encap & decap adds and removes MPLS header at the start
of packet as depicted below.

Encapsulation:

Actions - encap(mpls(ether_type=0x8847)),encap(ethernet)

Incoming packet -> | ETH | IP | Payload |

1 Actions -  encap(mpls(ether_type=0x8847)) [Datapath action - ADD_MPLS:0x8847]

        Outgoing packet -> | MPLS | ETH | Payload|

2 Actions - encap(ethernet) [ Datapath action - push_eth ]

        Outgoing packet -> | ETH | MPLS | ETH | Payload|

Decapsulation:

Incoming packet -> | ETH | MPLS | ETH | IP | Payload |

Actions - decap(),decap(packet_type(ns=0,type=0)

1 Actions -  decap() [Datapath action - pop_eth)

        Outgoing packet -> | MPLS | ETH | IP | Payload|

2 Actions - decap(packet_type(ns=0,type=0) [Datapath action - POP_MPLS:0x6558]

        Outgoing packet -> | ETH  | IP | Payload|


Martin Varghese (2):
  Encap & Decap actions for MPLS packet type.
  Datapath: New MPLS actions for layer 2 tunnelling.

 NEWS                                          |  2 +-
 datapath/actions.c                            | 42 +++++++--
 datapath/flow_netlink.c                       | 33 +++++++
 .../linux/compat/include/linux/openvswitch.h  | 35 ++++++-
 include/openvswitch/ofp-ed-props.h            | 18 ++++
 lib/dpif-netdev.c                             |  1 +
 lib/dpif.c                                    |  1 +
 lib/odp-execute.c                             | 12 +++
 lib/odp-util.c                                | 58 +++++++++---
 lib/ofp-actions.c                             |  5 +
 lib/ofp-ed-props.c                            | 91 +++++++++++++++++++
 lib/ovs-actions.xml                           | 31 +++++--
 lib/packets.c                                 | 36 ++++++++
 lib/packets.h                                 |  2 +
 ofproto/ofproto-dpif-ipfix.c                  |  1 +
 ofproto/ofproto-dpif-sflow.c                  |  1 +
 ofproto/ofproto-dpif-xlate.c                  | 60 ++++++++++++
 ofproto/ofproto-dpif.c                        | 39 ++++++++
 ofproto/ofproto-dpif.h                        |  5 +-
 tests/system-traffic.at                       | 36 ++++++++
 20 files changed, 476 insertions(+), 33 deletions(-)

-- 
2.18.4



More information about the dev mailing list