действия и инструкции OpenFlow с расширениями Open vSwitch (OpenFlow actions and instructions with Open vSwitch extensions)
ENCAPSULATION AND DECAPSULATION ACTIONS
The strip_vlan and pop actions
Syntax:
strip_vlan
pop_vlan
Removes the outermost VLAN tag, if any, from the packet.
The two names for this action are synonyms with no semantic
difference. The OpenFlow 1.0 specification uses the name
strip_vlan
and later versions use pop_vlan
, but OVS accepts
either name regardless of version.
In OpenFlow 1.1 and later, consistency rules allow strip_vlan
only in a flow that matches only packets with a VLAN tag (or
following an action that pushes a VLAN tag, such as push_vlan
).
See ``Inconsistencies'', above, for more information.
Conformance:
All versions of OpenFlow and Open vSwitch support this action.
The push_vlan action
Syntax:
push_vlan:
ethertype
Pushes a new outermost VLAN onto the packet. Uses TPID ethertype,
which must be 0x8100
for an 802.1Q C-tag or 0x88a8
for a 802.1ad
S-tag.
Conformance:
OpenFlow 1.1 and later supports this action. Open vSwitch 2.8
added support for multiple VLAN tags (with a limit of 2) and
802.1ad S-tags.
The push_mpls action
Syntax:
push_mpls:
ethertype
Pushes a new outermost MPLS label stack entry (LSE) onto the
packet and changes the packet's Ethertype to ethertype, which
must be either B0x8847
or 0x8848
.
If the packet did not already contain any MPLS labels,
initializes the new LSE as:
Label 2, if the packet contains IPv6, 0 otherwise.
TC The low 3 bits of the packet's DSCP value, or 0 if
the packet is not IP.
TTL Copied from the IP TTL, or 64 if the packet is not
IP.
If the packet did already contain an MPLS label, initializes the
new outermost label as a copy of the existing outermost label.
OVS currently supports at most 3 MPLS labels.
This action applies only to Ethernet packets.
Conformance:
Open vSwitch 1.11 introduced support for MPLS. OpenFlow 1.1 and
later support push_mpls
. Open vSwitch implements push_mpls
as an
extension to OpenFlow 1.0.
The pop_mpls action
Syntax:
pop_mpls:
ethertype
Strips the outermost MPLS label stack entry and changes the
packet's Ethertype to ethertype.
This action applies only to Ethernet packets with at least one
MPLS label. If there is more than one MPLS label, then ethertype
should be an MPLS Ethertype (B0x8847
or 0x8848
).
Conformance:
Open vSwitch 1.11 introduced support for MPLS. OpenFlow 1.1 and
later support pop_mpls
. Open vSwitch implements pop_mpls
as an
extension to OpenFlow 1.0.
The encap action
Syntax:
encap(nsh(
[md_type=
md_type],
[tlv(
class,
type,
value)
]...))
encap(ethernet)
The encap
action encapsulates a packet with a specified header.
It has variants for different kinds of encapsulation.
The encap(nsh(
...))
variant encapsulates an Ethernet frame with
NSH. The md_type may be 1
or 2
for metadata type 1 or 2,
defaulting to 1. For metadata type 2, TLVs may be specified with
class as a 16-bit hexadecimal integer beginning with 0x
, type as
an 8-bit decimal integer, and value a sequence of pairs of hex
digits beginning with 0x
. For example:
encap(nsh(md_type=1))
Encapsulates the packet with an NSH header with
metadata type 1.
encap(nsh(md_type=2,tlv(0x1000,10,0x12345678)))
Encapsulates the packet with an NSH header, NSH
metadata type 2, and an NSH TLV with class 0x1000,
type 10, and the 4-byte value 0x12345678.
The encap(ethernet)
variant encapsulate a bare L3 packet in an
Ethernet 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.
Conformance:
This action is an Open vSwitch extension to OpenFlow 1.3 and
later, introduced in Open vSwitch 2.8.
The decap action
Syntax:
decap
Removes an outermost encapsulation from the packet:
• If the packet is an Ethernet packet, removes the
Ethernet header, which changes the packet into a
bare L3 packet. If the packet has VLAN tags, raises
an unsupported packet type error (see ``Error
Handling'', above).
• Otherwise, if the packet is an NSH packet, removes
the NSH header, revealing the inner packet. Open
vSwitch supports Ethernet, IPv4, IPv6, and NSH
inner packet types. Other types raise unsupported
packet type errors.
• 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.