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

Martin Varghese martinvarghesenokia at gmail.com
Fri May 8 04:30:48 UTC 2020


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):
  Datapath: New MPLS actions for layer 2 tunnelling
  Encap & Decap actions for MPLS packet type

 NEWS                                              |  1 +
 datapath/actions.c                                | 42 ++++++++---
 datapath/flow_netlink.c                           | 33 +++++++++
 datapath/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                                    | 38 ++++++++--
 lib/ofp-actions.c                                 |  5 ++
 lib/ofp-ed-props.c                                | 89 +++++++++++++++++++++++
 lib/ovs-actions.xml                               | 32 ++++++--
 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                      | 54 ++++++++++++++
 tests/system-traffic.at                           | 34 +++++++++
 18 files changed, 410 insertions(+), 25 deletions(-)

-- 
1.8.3.1



More information about the dev mailing list