summaryrefslogtreecommitdiff
path: root/Documentation/ref
diff options
context:
space:
mode:
authorMartin Varghese <martin.varghese@nokia.com>2021-11-29 11:52:05 +0530
committerIlya Maximets <i.maximets@ovn.org>2022-01-17 02:04:20 +0100
commit1917ace89364d366777b34467e952358d2d85b41 (patch)
tree109d821fbb510ed2df3cf8358d496af8d2830364 /Documentation/ref
parent4a6a4734622e42367faf39cd3938bc8a57786282 (diff)
downloadopenvswitch-1917ace89364d366777b34467e952358d2d85b41.tar.gz
Encap & Decap actions for MPLS packet type.
The encap & decap actions are extended to support MPLS packet type. Encap & decap actions adds and removes MPLS header at start of the packet. 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),encap(ethernet) Incoming packet -> | ETH | IP | Payload | 1 Actions - encap(mpls) [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| Signed-off-by: Martin Varghese <martin.varghese@nokia.com> Acked-by: Eelco Chaudron <echaudro@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'Documentation/ref')
-rw-r--r--Documentation/ref/ovs-actions.7.rst28
1 files changed, 26 insertions, 2 deletions
diff --git a/Documentation/ref/ovs-actions.7.rst b/Documentation/ref/ovs-actions.7.rst
index 7224896df..b59b7634f 100644
--- a/Documentation/ref/ovs-actions.7.rst
+++ b/Documentation/ref/ovs-actions.7.rst
@@ -212,12 +212,13 @@ Unsupported packet type
is not an L3 packet, and ``encap(nsh)`` raises this error if the current
packet is not Ethernet, IPv4, IPv6, or NSH.
+ The ``decap`` action is supported only for packet types ethernet, NSH and
+ MPLS. Openvswitch raises this error for other packet types.
When a ``decap`` action decapsulates a packet, Open vSwitch raises this error
if it does not support the type of inner packet. ``decap`` of an Ethernet
header raises this error if a VLAN header is present, ``decap`` of a NSH
packet raises this error if the NSH inner packet is not Ethernet, IPv4, IPv6,
- or NSH, and ``decap`` of other types of packets is unsupported and also
- raises this error.
+ or NSH.
This error terminates packet processing, retaining any previous side effects
(e.g. output actions). When this error arises within the execution of a
@@ -995,6 +996,8 @@ The ``encap`` action
| ``encap(nsh([md_type=``\ *md_type*\
``], [tlv(``\ *class*,\ *type*,\ *value*\ ``)]...))``
| ``encap(ethernet)``
+ | ``encap(mpls)``
+ | ``encap(mpls_mc)``
The ``encap`` action encapsulates a packet with a specified header. It has
variants for different kinds of encapsulation.
@@ -1018,10 +1021,20 @@ frame. The Ethernet type is initialized to the L3 packet's type, e.g. 0x0800
if the L3 packet is IPv4. The Ethernet source and destination are initially
zeroed.
+The ``encap(mpls)`` variant adds a MPLS header at the start of the packet.
+When encap(ethernet) is applied after this action, the ethertype of ethernet
+header will be populated with MPLS unicast ethertype (``0x8847``).
+
+The ``encap(mpls_mc)`` variant adds a MPLS header at the start of the packet.
+When encap(ethernet) is applied after this action, the ethertype of ethernet
+header will be populated with MPLS multicast ethertype (``0x8848``).
+
**Conformance**
This action is an Open vSwitch extension to OpenFlow 1.3 and later,
introduced in Open vSwitch 2.8.
+ The MPLS support for this action is added in Open vSwitch 2.17.
+
The ``decap`` action
--------------------
@@ -1030,6 +1043,7 @@ The ``decap`` action
**Syntax**:
| ``decap``
+ | ``decap(packet_type(ns=``\ *namespace,*\ ``type=``\ *type*\ ``))``
Removes an outermost encapsulation from the packet:
@@ -1042,12 +1056,22 @@ Removes an outermost encapsulation from the packet:
and NSH inner packet types. Other types raise unsupported packet type
errors.
+ - Otherwise, if the packet is encapsulated inside a MPLS header, removes
+ the MPLS header and classifies the inner packet as mentioned in the packet
+ type argument of the decap. The *packet_type* field specifies the type of
+ the packet in the format specified in OpenFlow 1.5 chapter
+ `7.2.3.11 Packet Type Match Field`. The inner packet will be incorrectly
+ classified, if the inner packet is different from mentioned in the
+ *packet_type* field.
+
- Otherwise, raises an unsupported packet type error.
**Conformance**
This action is an Open vSwitch extension to OpenFlow 1.3 and later,
introduced in Open vSwitch 2.8.
+ The MPLS support for this action is added in Open vSwitch 2.17.
+
Field Modification Actions
==========================