Путеводитель по Руководству Linux

  User  |  Syst  |  Libr  |  Device  |  Files  |  Other  |  Admin  |  Head  |



   ovs-fields    ( 7 )

поля заголовка протокола в OpenFlow и Open vSwitch (protocol header fields in OpenFlow and Open vSwitch)

LAYER 2.5: MPLS FIELDS

Summary: Name Bytes Mask RW? Prereqs NXM/OXM Support

─────────── ──────────────── ───── ──── ──────── ────────────────────── mpls_label 4 (low 20 bits) no yes MPLS OF 1.2+ and OVS 1.11+ mpls_tc 1 (low 3 bits) no yes MPLS OF 1.2+ and OVS 1.11+

mpls_bos 1 (low 1 bits) no no MPLS OF 1.3+ and OVS 1.11+ mpls_ttl 1 no yes MPLS OVS 2.6+

One or more MPLS headers (more commonly called MPLS labels) follow an Ethernet type field that specifies an MPLS Ethernet type [RFC 3032]. Ethertype 0x8847 is used for all unicast. Multicast MPLS is divided into two specific classes, one of which uses Ethertype 0x8847 and the other 0x8848 [RFC 5332].

The most common overall packet format is Ethernet II, shown below (SNAP encapsulation may be used but is not ordinarily seen in Ethernet networks):

Ethernet MPLS <------------> <------------> 48 48 16 20 3 1 8 +---+---+------+ +-----+--+-+---+ |dst|src| type | |label|TC|S|TTL| ... +---+---+------+ +-----+--+-+---+ 0x8847

MPLS can be encapsulated inside an 802.1Q header, in which case the combination looks like this:

Ethernet 802.1Q Ethertype MPLS <------> <--------> <-------> <------------> 48 48 16 16 16 20 3 1 8 +----+---+ +------+---+ +---------+ +-----+--+-+---+ |dst |src| | TPID |TCI| | type | |label|TC|S|TTL| ... +----+---+ +------+---+ +---------+ +-----+--+-+---+ 0x8100 0x8847

The fields within an MPLS label are:

Label, 20 bits. An identifier.

Traffic control (TC), 3 bits. Used for quality of service.

Bottom of stack (BOS), 1 bit (labeled just ``S'' above). 0 indicates that another MPLS label follows this one.

1 indicates that this MPLS label is the last one in the stack, so that some other protocol follows this one.

Time to live (TTL), 8 bits. Each hop across an MPLS network decrements the TTL by 1. If it reaches 0, the packet is discarded.

OpenFlow does not make the MPLS TTL available as a match field, but actions are available to set and decrement the TTL. Open vSwitch 2.6 and later makes the MPLS TTL available as an extension.

MPLS Label Stacks Unlike the other encapsulations supported by OpenFlow and Open vSwitch, MPLS labels are routinely used in ``stacks'' two or three deep and sometimes even deeper. Open vSwitch currently supports up to three labels.

The OpenFlow specification only supports matching on the outermost MPLS label at any given time. To match on the second label, one must first ``pop'' the outer label and advance to another OpenFlow table, where the inner label may be matched. To match on the third label, one must pop the two outer labels, and so on.

MPLS Inner Protocol Unlike all other forms of encapsulation that Open vSwitch and OpenFlow support, an MPLS label does not indicate what inner protocol it encapsulates. Different deployments determine the inner protocol in different ways [RFC 3032]:

• A few reserved label values do indicate an inner protocol. Label 0, the ``IPv4 Explicit NULL Label,'' indicates inner IPv4. Label 2, the ``IPv6 Explicit NULL Label,'' indicates inner IPv6.

• Some deployments use a single inner protocol consistently.

• In some deployments, the inner protocol must be inferred from the innermost label.

• In some deployments, the inner protocol must be inferred from the innermost label and the encapsulated data, e.g. to distinguish between inner IPv4 and IPv6 based on whether the first nibble of the inner protocol data are 4 or 6. OpenFlow and Open vSwitch do not currently support these cases.

Open vSwitch and OpenFlow do not infer the inner protocol, even if reserved label values are in use. Instead, the flow table must specify the inner protocol at the time it pops the bottommost MPLS label, using the Ethertype argument to the pop_mpls action.

Field Details MPLS Label Field

Name: mpls_label Width: 32 bits (only the least-significant 20 bits may be nonzero) Format: decimal Masking: not maskable

Prerequisites: MPLS Access: read/write OpenFlow 1.0: not supported OpenFlow 1.1: yes (exact match only) OXM: OXM_OF_MPLS_LABEL (34) since OpenFlow 1.2 and Open vSwitch 1.11 NXM: none

The least significant 20 bits hold the ``label'' field from the MPLS label. Other bits are zero:

OXM_OF_MPLS_LABEL <---------------> 12 20 +--------+--------+ | zero | label | +--------+--------+ 0

Most label values are available for any use by deployments. Values under 16 are reserved.

MPLS Traffic Class Field

Name: mpls_tc Width: 8 bits (only the least-significant 3 bits may be nonzero) Format: decimal Masking: not maskable Prerequisites: MPLS Access: read/write

OpenFlow 1.0: not supported OpenFlow 1.1: yes (exact match only) OXM: OXM_OF_MPLS_TC (35) since OpenFlow 1.2 and Open vSwitch 1.11 NXM: none

The least significant 3 bits hold the TC field from the MPLS label. Other bits are zero:

OXM_OF_MPLS_TC <------------> 5 3 +--------+-----+ | zero | TC | +--------+-----+ 0

This field is intended for use for Quality of Service (QoS) and Explicit Congestion Notification purposes, but its particular interpretation is deployment specific.

Before 2009, this field was named EXP and reserved for experimental use [RFC 5462].

MPLS Bottom of Stack Field

Name: mpls_bos Width: 8 bits (only the least-significant 1 bits may be nonzero) Format: decimal Masking: not maskable

Prerequisites: MPLS Access: read-only OpenFlow 1.0: not supported OpenFlow 1.1: not supported OXM: OXM_OF_MPLS_BOS (36) since OpenFlow 1.3 and Open vSwitch 1.11 NXM: none

The least significant bit holds the BOS field from the MPLS label. Other bits are zero:

OXM_OF_MPLS_BOS <-------------> 7 1 +--------+------+ | zero | BOS | +--------+------+ 0

This field is useful as part of processing a series of incoming MPLS labels. A flow that includes a pop_mpls action should generally match on mpls_bos:

• When mpls_bos is 0, there is another MPLS label following this one, so the Ethertype passed to pop_mpls should be an MPLS Ethertype. For example: table=0, dl_type=0x8847, mpls_bos=0, actions=pop_mpls:0x8847, goto_table:1

• When mpls_bos is 1, this MPLS label is the last one, so the Ethertype passed to pop_mpls should be a non-MPLS Ethertype such as IPv4. For example: table=1, dl_type=0x8847, mpls_bos=1, actions=pop_mpls:0x0800, goto_table:2

MPLS Time-to-Live Field

Name: mpls_ttl

Width: 8 bits Format: decimal Masking: not maskable Prerequisites: MPLS Access: read/write OpenFlow 1.0: not supported OpenFlow 1.1: not supported

OXM: none NXM: NXM_NX_MPLS_TTL (30) since Open vSwitch 2.6

Holds the 8-bit time-to-live field from the MPLS label:

NXM_NX_MPLS_TTL <-------------> 8 +---------------+ | TTL | +---------------+