]> git.proxmox.com Git - mirror_ovs.git/blob - lib/meta-flow.xml
netdev-offload-tc: Use single 'once' variable for probing tc features
[mirror_ovs.git] / lib / meta-flow.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <fields>
3 <h1>Introduction</h1>
4
5 <p>
6 This document aims to comprehensively document all of the fields,
7 both standard and non-standard, supported by OpenFlow or Open
8 vSwitch, regardless of origin.
9 </p>
10
11 <h2>Fields</h2>
12
13 <p>
14 A <dfn>field</dfn> is a property of a packet. Most familiarly, <dfn>data
15 fields</dfn> are fields that can be extracted from a packet. Most data
16 fields are copied directly from protocol headers, e.g. at layer 2, the
17 Ethernet source and destination addresses, or the VLAN ID; at layer 3, the
18 IPv4 or IPv6 source and destination; and at layer 4, the TCP or UDP ports.
19 Other data fields are computed, e.g. <ref field="ip_frag"/> describes
20 whether a packet is a fragment but it is not copied directly from the IP
21 header.
22 </p>
23
24 <p>
25 Data fields that are always present as a consequence of the basic
26 networking technology in use are called called <dfn>root fields</dfn>.
27 Open vSwitch 2.7 and earlier considered Ethernet fields to be root fields,
28 and this remains the default mode of operation for Open vSwitch bridges.
29 When a packet is received from a non-Ethernet interfaces, such as a layer-3
30 LISP tunnel, Open vSwitch 2.7 and earlier force-fit the packet to this
31 Ethernet-centric point of view by pretending that an Ethernet header is
32 present whose Ethernet type that indicates the packet's actual type (and
33 whose source and destination addresses are all-zero).
34 </p>
35
36 <p>
37 Open vSwitch 2.8 and later implement the ``packet type-aware pipeline''
38 concept introduced in OpenFlow 1.5. Such a pipeline does not have any root
39 fields. Instead, a new metadata field, <ref field="packet_type"/>,
40 indicates the basic type of the packet, which can be Ethernet, IPv4, IPv6,
41 or another type. For backward compatibility, by default Open vSwitch 2.8
42 imitates the behavior of Open vSwitch 2.7 and earlier. Later versions of
43 Open vSwitch may change the default, and in the meantime controllers can
44 turn off this legacy behavior, on a port-by-port basis, by setting
45 <code>options:packet_type</code> to <code>ptap</code> in the
46 <code>Interface</code> table. This is significant only for ports that can
47 handle non-Ethernet packets, which is currently just LISP, VXLAN-GPE, and
48 GRE tunnel ports. See <code>ovs-vwitchd.conf.db</code>(5) for more
49 information.
50 </p>
51
52 <p>
53 Non-root data fields are not always present. A packet contains ARP
54 fields, for example, only when its packet type is ARP or when it is an
55 Ethernet packet whose Ethernet header indicates the Ethertype for ARP,
56 0x0806. In this documentation, we say that a field is
57 <dfn>applicable</dfn> when it is present in a packet, and
58 <dfn>inapplicable</dfn> when it is not. (These are not standard terms.)
59 We refer to the conditions that determine whether a field is applicable as
60 <dfn>prerequisites</dfn>. Some VLAN-related fields are a special case:
61 these fields are always applicable for Ethernet packets, but have a
62 designated value or bit that indicates whether a VLAN header is present,
63 with the remaining values or bits indicating the VLAN header's content
64 (if it is present). <!-- XXX also ethertype -->
65 </p>
66
67 <p>
68 An inapplicable field does not have a value, not even a nominal
69 ``value'' such as all-zero-bits. In many circumstances, OpenFlow
70 and Open vSwitch allow references only to applicable fields. For
71 example, one may match (see <cite>Matching</cite>, below) a given
72 field only if the match includes the field's prerequisite,
73 e.g. matching an ARP field is only allowed if one also matches on
74 Ethertype 0x0806 or the <ref field="packet_type"/> for ARP in a packet
75 type-aware bridge.
76 </p>
77
78 <p>
79 Sometimes a packet may contain multiple instances of a header.
80 For example, a packet may contain multiple VLAN or MPLS headers,
81 and tunnels can cause any data field to recur. OpenFlow and Open
82 vSwitch do not address these cases uniformly. For VLAN and MPLS
83 headers, only the outermost header is accessible, so that inner
84 headers may be accessed only by ``popping'' (removing) the outer
85 header. (Open vSwitch supports only a single VLAN header in any
86 case.) For tunnels, e.g. GRE or VXLAN, the outer header and inner
87 headers are treated as different data fields.
88 </p>
89
90 <p>
91 Many network protocols are built in layers as a stack of concatenated
92 headers. Each header typically contains a ``next type'' field that
93 indicates the type of the protocol header that follows, e.g. Ethernet
94 contains an Ethertype and IPv4 contains a IP protocol type. The
95 exceptional cases, where protocols are layered but an outer layer does not
96 indicate the protocol type for the inner layer, or gives only an ambiguous
97 indication, are troublesome. An MPLS header, for example, only indicates
98 whether another MPLS header or some other protocol follows, and in the
99 latter case the inner protocol must be known from the context. In these
100 exceptional cases, OpenFlow and Open vSwitch cannot provide insight into
101 the inner protocol data fields without additional context, and thus they
102 treat all later data fields as inapplicable until an OpenFlow action
103 explicitly specifies what protocol follows. In the case of MPLS, the
104 OpenFlow ``pop MPLS'' action that removes the last MPLS header from a
105 packet provides this context, as the Ethertype of the payload. See
106 <cite>Layer 2.5: MPLS</cite> for more information.
107 </p>
108
109 <p>
110 OpenFlow and Open vSwitch support some fields other than data
111 fields. <dfn>Metadata fields</dfn> relate to the origin or
112 treatment of a packet, but they are not extracted from the packet
113 data itself. One example is the physical port on which a packet
114 arrived at the switch. <dfn>Register fields</dfn> act like
115 variables: they give an OpenFlow switch space for temporary
116 storage while processing a packet. Existing metadata and register
117 fields have no prerequisites.
118 </p>
119
120 <p>
121 A field's value consists of an integral number of bytes. For data
122 fields, sometimes those bytes are taken directly from the packet.
123 Other data fields are copied from a packet with padding (usually
124 with zeros and in the most significant positions). The remaining
125 data fields are transformed in other ways as they are copied from
126 the packets, to make them more useful for matching.
127 </p>
128
129 <h2>Matching</h2>
130
131 <p>
132 The most important use of fields in OpenFlow is
133 <dfn>matching</dfn>, to determine whether particular field values
134 agree with a set of constraints called a <dfn>match</dfn>. A
135 match consists of zero or more constraints on individual fields,
136 all of which must be met to satisfy the match. (A match that
137 contains no constraints is always satisfied.) OpenFlow and Open
138 vSwitch support a number of forms of matching on individual
139 fields:
140 </p>
141
142 <dl>
143 <dt><dfn>Exact match</dfn>, e.g. <code>nw_src=10.1.2.3</code></dt>
144 <dd>
145 <p>
146 Only a particular value of the field is matched; for example, only one
147 particular source IP address. Exact matches are written as
148 <code><var>field</var>=<var>value</var></code>. The forms accepted for
149 <var>value</var> depend on the field.
150 </p>
151
152 <p>
153 All fields support exact matches.
154 </p>
155 </dd>
156
157 <dt>
158 <dfn>Bitwise match</dfn>, e.g. <code>nw_src=10.1.0.0/255.255.0.0</code>
159 </dt>
160 <dd>
161 <p>
162 Specific bits in the field must have specified values; for example,
163 only source IP addresses in a particular subnet. Bitwise matches are
164 written as
165 <code><var>field</var>=<var>value</var>/<var>mask</var></code>, where
166 <var>value</var> and <var>mask</var> take one of the forms accepted for
167 an exact match on <var>field</var>. Some fields accept other forms for
168 bitwise matches; for example, <code>nw_src=10.1.0.0/255.255.0.0</code>
169 may also be written <code>nw_src=10.1.0.0/16</code>.
170 </p>
171
172 <p>
173 Most OpenFlow switches do not allow every bitwise matching on every
174 field (and before OpenFlow 1.2, the protocol did not even provide for
175 the possibility for most fields). Even switches that do allow bitwise
176 matching on a given field may restrict the masks that are allowed, e.g.
177 by allowing matches only on contiguous sets of bits starting from the
178 most significant bit, that is, ``CIDR'' masks [RFC 4632]. Open vSwitch
179 does not allows bitwise matching on every field, but it allows
180 arbitrary bitwise masks on any field that does support bitwise
181 matching. (Older versions had some restrictions, as documented in the
182 descriptions of individual fields.)
183 </p>
184 </dd>
185
186 <dt><dfn>Wildcard</dfn>, e.g. ``any <code>nw_src</code>''</dt>
187 <dd>
188 <p>
189 The value of the field is not constrained. Wildcarded fields may be
190 written as <code><var>field</var>=*</code>, although it is unusual to
191 mention them at all. (When specifying a wildcard explicitly in a
192 command invocation, be sure to using quoting to protect against shell
193 expansion.)
194 </p>
195
196 <p>
197 There is a tiny difference between wildcarding a field and not
198 specifying any match on a field: wildcarding a field requires
199 satisfying the field's prerequisites.
200 </p>
201 </dd>
202 </dl>
203
204 <p>
205 Some types of matches on individual fields cannot be expressed directly
206 with OpenFlow and Open vSwitch. These can be expressed indirectly:
207 </p>
208
209 <dl>
210 <dt><dfn>Set match</dfn>, e.g. ``<code>tcp_dst</code> ∈ {80, 443,
211 8080}''</dt>
212 <dd>
213 <p>
214 The value of a field is one of a specified set of values; for
215 example, the TCP destination port is 80, 443, or 8080.
216 </p>
217
218 <p>
219 For matches used in flows (see <cite>Flows</cite>, below), multiple
220 flows can simulate set matches.
221 </p>
222 </dd>
223
224 <dt><dfn>Range match</dfn>, e.g. ``1000<code>tcp_dst</code>
225 1999''</dt>
226 <dd>
227 <p>
228 The value of the field must lie within a numerical range, for
229 example, TCP destination ports between 1000 and 1999.
230 </p>
231
232 <p>
233 Range matches can be expressed as a collection of bitwise matches. For
234 example, suppose that the goal is to match TCP source ports 1000 to
235 1999, inclusive. The binary representations of 1000 and 1999 are:
236 </p>
237
238 <pre fixed="yes">
239 01111101000
240 11111001111
241 </pre>
242
243 <p>
244 The following series of bitwise matches will match 1000 and
245 1999 and all the values in between:
246 </p>
247
248 <pre fixed="yes">
249 01111101xxx
250 0111111xxxx
251 10xxxxxxxxx
252 110xxxxxxxx
253 1110xxxxxxx
254 11110xxxxxx
255 1111100xxxx
256 </pre>
257
258 <p>
259 which can be written as the following matches:
260 </p>
261
262 <pre>
263 tcp,tp_src=0x03e8/0xfff8
264 tcp,tp_src=0x03f0/0xfff0
265 tcp,tp_src=0x0400/0xfe00
266 tcp,tp_src=0x0600/0xff00
267 tcp,tp_src=0x0700/0xff80
268 tcp,tp_src=0x0780/0xffc0
269 tcp,tp_src=0x07c0/0xfff0
270 </pre>
271 </dd>
272
273 <dt><dfn>Inequality match</dfn>, e.g. ``<code>tcp_dst</code>80''</dt>
274 <dd>
275 <p>
276 The value of the field differs from a specified value, for
277 example, all TCP destination ports except 80.
278 </p>
279
280 <p>
281 An inequality match on an <var>n</var>-bit field can be expressed as a
282 disjunction of <var>n</var> 1-bit matches. For example, the inequality
283 match ``<code>vlan_pcp</code>5'' can be expressed as
284 ``<code>vlan_pcp</code> = 0/4 or <code>vlan_pcp</code> = 2/2 or
285 <code>vlan_pcp</code> = 0/1.'' For matches used in flows (see
286 <cite>Flows</cite>, below), sometimes one can more compactly express
287 inequality as a higher-priority flow that matches the exceptional case
288 paired with a lower-priority flow that matches the general case.
289 </p>
290
291 <p>
292 Alternatively, an inequality match may be converted to a pair of range
293 matches, e.g. <code>tcp_src ≠ 80</code> may be expressed as ``0
294 <code>tcp_src</code> &lt; 80 or 80 &lt; <code>tcp_src</code>65535'',
295 and then each range match may in turn be converted to a bitwise match.
296 </p>
297 </dd>
298
299 <dt><dfn>Conjunctive match</dfn>, e.g. ``<code>tcp_src</code> ∈ {80, 443, 8080} and <code>tcp_dst</code> ∈ {80, 443, 8080}''</dt>
300 <dd>
301 As an OpenFlow extension, Open vSwitch supports matching on conditions on
302 conjunctions of the previously mentioned forms of matching. See the
303 documentation for <ref field="conj_id"/> for more information.
304 </dd>
305 </dl>
306
307 <p>
308 All of these supported forms of matching are special cases of bitwise
309 matching. In some cases this influences the design of field values. <ref
310 field="ip_frag"/> is the most prominent example: it is designed to make all
311 of the practically useful checks for IP fragmentation possible as a single
312 bitwise match.
313 </p>
314
315 <h3>Shorthands</h3>
316
317 <p>
318 Some matches are very commonly used, so Open vSwitch accepts shorthand
319 notations. In some cases, Open vSwitch also uses shorthand notations when
320 it displays matches. The following shorthands are defined, with their long
321 forms shown on the right side:
322 </p>
323
324 <dl>
325 <dt><code>eth</code></dt>
326 <dd><code>packet_type=(0,0)</code> (Open vSwitch 2.8 and later)</dd>
327 <dt><code>ip</code></dt> <dd><code>eth_type=0x0800</code></dd>
328 <dt><code>ipv6</code></dt> <dd><code>eth_type=0x86dd</code></dd>
329 <dt><code>icmp</code></dt> <dd><code>eth_type=0x0800,ip_proto=1</code></dd>
330 <dt><code>icmp6</code></dt> <dd><code>eth_type=0x86dd,ip_proto=58</code></dd>
331 <dt><code>tcp</code></dt> <dd><code>eth_type=0x0800,ip_proto=6</code></dd>
332 <dt><code>tcp6</code></dt> <dd><code>eth_type=0x86dd,ip_proto=6</code></dd>
333 <dt><code>udp</code></dt> <dd><code>eth_type=0x0800,ip_proto=17</code></dd>
334 <dt><code>udp6</code></dt> <dd><code>eth_type=0x86dd,ip_proto=17</code></dd>
335 <dt><code>sctp</code></dt> <dd><code>eth_type=0x0800,ip_proto=132</code></dd>
336 <dt><code>sctp6</code></dt> <dd><code>eth_type=0x86dd,ip_proto=132</code></dd>
337 <dt><code>arp</code></dt> <dd><code>eth_type=0x0806</code></dd>
338 <dt><code>rarp</code></dt> <dd><code>eth_type=0x8035</code></dd>
339 <dt><code>mpls</code></dt> <dd><code>eth_type=0x8847</code></dd>
340 <dt><code>mplsm</code></dt> <dd><code>eth_type=0x8848</code></dd>
341 </dl>
342
343
344 <h2>Evolution of OpenFlow Fields</h2>
345
346 <p>
347 The discussion so far applies to all OpenFlow and Open vSwitch
348 versions. This section starts to draw in specific information by
349 explaining, in broad terms, the treatment of fields and matches in
350 each OpenFlow version.
351 </p>
352
353 <h3>OpenFlow 1.0</h3>
354
355 <p>
356 OpenFlow 1.0 defined the OpenFlow protocol format of a match as a
357 fixed-length data structure that could match on the following
358 fields:
359 </p>
360
361 <ul>
362 <li>Ingress port.</li>
363 <li>Ethernet source and destination MAC.</li>
364 <li>Ethertype (with a special value to match frames that lack an
365 Ethertype).</li>
366 <li>VLAN ID and priority.</li>
367 <li>IPv4 source, destination, protocol, and DSCP.</li>
368 <li>TCP source and destination port.</li>
369 <li>UDP source and destination port.</li>
370 <li>ICMPv4 type and code.</li>
371 <li>ARP IPv4 addresses (SPA and TPA) and opcode.</li>
372 </ul>
373
374 <p>
375 Each supported field corresponded to some member of the data
376 structure. Some members represented multiple fields, in the case
377 of the TCP, UDP, ICMPv4, and ARP fields whose presence is mutually
378 exclusive. This also meant that some members were poor fits for
379 their fields: only the low 8 bits of the 16-bit ARP opcode could
380 be represented, and the ICMPv4 type and code were padded with 8 bits
381 of zeros to fit in the 16-bit members primarily meant for TCP and
382 UDP ports. An additional bitmap member indicated, for each
383 member, whether its field should be an ``exact'' or ``wildcarded''
384 match (see <cite>Matching</cite>), with additional support for
385 CIDR prefix matching on the IPv4 source and destination fields.
386 </p>
387
388 <p>
389 Simplicity was recognized early on as the main virtue of this
390 approach. Obviously, any fixed-length data structure cannot
391 support matching new protocols that do not fit. There was no
392 room, for example, for matching IPv6 fields, which was not a
393 priority at the time. Lack of room to support matching the
394 Ethernet addresses inside ARP packets actually caused more of a
395 design problem later, leading to an Open vSwitch extension action
396 specialized for dropping ``spoofed'' ARP packets in which the
397 frame and ARP Ethernet source addressed differed. (This extension
398 was never standardized. Open vSwitch dropped support for it a few
399 releases after it added support for full ARP matching.)
400 </p>
401
402 <p>
403 The design of the OpenFlow fixed-length matches also illustrates
404 compromises, in both directions, between the strengths and
405 weaknesses of software and hardware that have always influenced
406 the design of OpenFlow. Support for matching ARP fields that do
407 fit in the data structure was only added late in the design
408 process (and remained optional in OpenFlow 1.0), for example,
409 because common switch ASICs did not support matching these fields.
410 </p>
411
412 <p>
413 The compromises in favor of software occurred for more complicated
414 reasons. The OpenFlow designers did not know how to implement
415 matching in software that was fast, dynamic, and general. (A way
416 was later found [Srinivasan].) Thus, the designers sought to
417 support dynamic, general matching that would be fast in realistic
418 special cases, in particular when all of the matches were
419 <dfn>microflows</dfn>, that is, matches that specify every field
420 present in a packet, because such matches can be implemented as a
421 single hash table lookup. Contemporary research supported the
422 feasibility of this approach: the number of microflows in a campus
423 network had been measured to peak at about 10,000 [Casado, section
424 3.2]. (Calculations show that this can only be true in a lightly
425 loaded network [Pepelnjak].)
426 </p>
427
428 <p>
429 As a result, OpenFlow 1.0 required switches to treat microflow
430 matches as the highest possible priority. This let software
431 switches perform the microflow hash table lookup first. Only on
432 failure to match a microflow did the switch need to fall back to
433 checking the more general and presumed slower matches. Also, the
434 OpenFlow 1.0 flow match was minimally flexible, with no support
435 for general bitwise matching, partly on the basis that this seemed
436 more likely amenable to relatively efficient software
437 implementation. (CIDR masking for IPv4 addresses was added
438 relatively late in the OpenFlow 1.0 design process.)
439 </p>
440
441 <p>
442 Microflow matching was later discovered to aid some hardware
443 implementations. The TCAM chips used for matching in hardware do
444 not support priority in the same way as OpenFlow but instead tie
445 priority to ordering [Pagiamtzis]. Thus, adding a new match with
446 a priority between the priorities of existing matches can require
447 reordering an arbitrary number of TCAM entries. On the other
448 hand, when microflows are highest priority, they can be managed as
449 a set-aside portion of the TCAM entries.
450 </p>
451
452 <p>
453 The emphasis on matching microflows also led designers to
454 carefully consider the bandwidth requirements between switch and
455 controller: to maximize the number of microflow setups per second,
456 one must minimize the size of each flow's description. This
457 favored the fixed-length format in use, because it expressed
458 common TCP and UDP microflows in fewer bytes than more flexible
459 ``type-length-value'' (TLV) formats. (Early versions of OpenFlow
460 also avoided TLVs in general to head off protocol fragmentation.)
461 </p>
462
463 <h4>Inapplicable Fields</h4>
464
465 <p>
466 OpenFlow 1.0 does not clearly specify how to treat inapplicable
467 fields. The members for inapplicable fields are always present in
468 the match data structure, as are the bits that indicate whether
469 the fields are matched, and the ``correct'' member and bit values
470 for inapplicable fields is unclear. OpenFlow 1.0 implementations
471 changed their behavior over time as priorities shifted. The early
472 OpenFlow reference implementation, motivated to make every flow a
473 microflow to enable hashing, treated inapplicable fields as exact
474 matches on a value of 0. Initially, this behavior was implemented
475 in the reference controller only.
476 </p>
477
478 <p>
479 Later, the reference switch was also changed to actually force any
480 wildcarded inapplicable fields into exact matches on 0. The
481 latter behavior sometimes caused problems, because the modified
482 flow was the one reported back to the controller later when it
483 queried the flow table, and the modifications sometimes meant that
484 the controller could not properly recognize the flow that it had
485 added. In retrospect, perhaps this problem should have alerted
486 the designers to a design error, but the ability to use a single
487 hash table was held to be more important than almost every other
488 consideration at the time.
489 </p>
490
491 <p>
492 When more flexible match formats were introduced much later, they
493 disallowed any mention of inapplicable fields as part of a match.
494 This raised the question of how to translate between this new
495 format and the OpenFlow 1.0 fixed format. It seemed somewhat
496 inconsistent and backward to treat fields as exact-match in one
497 format and forbid matching them in the other, so instead the
498 treatment of inapplicable fields in the fixed-length format was
499 changed from exact match on 0 to wildcarding. (A better
500 classifier had by now eliminated software performance problems
501 with wildcards.)
502 </p>
503
504 <p>
505 The OpenFlow 1.0.1 errata (released only in 2012) added some
506 additional explanation [OpenFlow 1.0.1, section 3.4], but it did
507 not mandate specific behavior because of variation among
508 implementations.
509 </p>
510
511 <h3>OpenFlow 1.1</h3>
512
513 <p>
514 The OpenFlow 1.1 protocol match format was designed as a type/length/value
515 (TLV) format to allow for future flexibility. The specification
516 standardized only a single type <code>OFPMT_STANDARD</code> (0) with a
517 fixed-size payload, described here. The additional fields and bitwise
518 masks in OpenFlow 1.1 cause this match structure to be over twice as large
519 as in OpenFlow 1.0, 88 bytes versus 40.
520 </p>
521
522 <p>
523 OpenFlow 1.1 added support for the following fields:
524 </p>
525
526 <ul>
527 <li>SCTP source and destination port.</li>
528 <li>MPLS label and traffic control (TC) fields.</li>
529 <li>One 64-bit register (named ``metadata'').</li>
530 </ul>
531
532 <p>
533 OpenFlow 1.1 increased the width of the ingress port number field (and all
534 other port numbers in the protocol) from 16 bits to 32 bits.
535 </p>
536
537 <p>
538 OpenFlow 1.1 increased matching flexibility by introducing
539 arbitrary bitwise matching on Ethernet and IPv4 address fields and
540 on the new ``metadata'' register field. Switches were not
541 required to support all possible masks [OpenFlow 1.1, section
542 4.3].
543 </p>
544
545 <p>
546 By a strict reading of the specification, OpenFlow 1.1 removed
547 support for matching ICMPv4 type and code [OpenFlow 1.1, section
548 A.2.3], but this is likely an editing error because ICMP
549 matching is described elsewhere [OpenFlow 1.1, Table 3, Table 4,
550 Figure 4]. Open vSwitch does support ICMPv4 type and code
551 matching with OpenFlow 1.1.
552 </p>
553
554 <p>
555 OpenFlow 1.1 avoided the pitfalls of inapplicable fields that
556 OpenFlow 1.0 encountered, by requiring the switch to ignore the
557 specified field values [OpenFlow 1.1, section A.2.3]. It also
558 implied that the switch should ignore the bits that indicate
559 whether to match inapplicable fields.
560 </p>
561
562 <h4>Physical Ingress Port</h4>
563
564 <p>
565 OpenFlow 1.1 introduced a new pseudo-field, the physical ingress port. The
566 physical ingress port is only a pseudo-field because it cannot be used for
567 matching. It appears only one place in the protocol, in the ``packet-in''
568 message that passes a packet received at the switch to an OpenFlow
569 controller.
570 </p>
571
572 <p>
573 A packet's ingress port and physical ingress port are identical except for
574 packets processed by a switch feature such as bonding or tunneling that
575 makes a packet appear to arrive on a ``virtual'' port associated with the
576 bond or the tunnel. For such packets, the ingress port is the virtual port
577 and the physical ingress port is, naturally, the physical port. Open
578 vSwitch implements both bonding and tunneling, but its bonding
579 implementation does not use virtual ports and its tunnels are typically not
580 on the same OpenFlow switch as their physical ingress ports (which need not
581 be part of any switch), so the ingress port and physical ingress port are
582 always the same in Open vSwitch.
583 </p>
584
585 <h3>OpenFlow 1.2</h3>
586
587 <p>
588 OpenFlow 1.2 abandoned the fixed-length approach to matching. One reason
589 was size, since adding support for IPv6 address matching (now seen as
590 important), with bitwise masks, would have added 64 bytes to the match
591 length, increasing it from 88 bytes in OpenFlow 1.1 to over 150 bytes.
592 Extensibility had also become important as controller writers increasingly
593 wanted support for new fields without having to change messages throughout
594 the OpenFlow protocol. The challenges of carefully defining fixed-length
595 matches to avoid problems with inapplicable fields had also become clear
596 over time.
597 </p>
598
599 <p>
600 Therefore, OpenFlow 1.2 adopted a flow format using a flexible
601 type-length-value (TLV) representation, in which each TLV expresses a match
602 on one field. These TLVs were in turn encapsulated inside the outer TLV
603 wrapper introduced in OpenFlow 1.1 with the new identifier
604 <code>OFPMT_OXM</code> (1). (This wrapper fulfilled its intended purpose
605 of reducing the amount of churn in the protocol when changing match
606 formats; some messages that included matches remained unchanged from
607 OpenFlow 1.1 to 1.2 and later versions.)
608 </p>
609
610 <p>
611 OpenFlow 1.2 added support for the following fields:
612 </p>
613
614 <ul>
615 <li>ARP hardware addresses (SHA and THA).</li>
616 <li>IPv4 ECN.</li>
617 <li>IPv6 source and destination addresses, flow label, DSCP, ECN,
618 and protocol.</li>
619 <li>TCP, UDP, and SCTP port numbers when encapsulated inside IPv6.</li>
620 <li>ICMPv6 type and code.</li>
621 <li>ICMPv6 Neighbor Discovery target address and source and target
622 Ethernet addresses.</li>
623 </ul>
624
625 <!-- mention tun_id_from_cookie extension? -->
626
627 <p>
628 The OpenFlow 1.2 format, called <dfn>OXM</dfn> (<dfn>OpenFlow Extensible
629 Match</dfn>), was modeled closely on an extension to OpenFlow 1.0
630 introduced in Open vSwitch 1.1 called <dfn>NXM</dfn> (<dfn>Nicira Extended
631 Match</dfn>). Each OXM or NXM TLV has the following format:
632 </p>
633
634 <diagram>
635 <header name="type">
636 <bits name="vendor/class" above="16" width=".75"/>
637 <bits name="field" above="7" width=".4"/>
638 </header>
639 <nospace/>
640 <header name="">
641 <bits name="HM" above="1" width=".25"/>
642 <bits name="length" above="8" width=".4"/>
643 </header>
644 <header name="">
645 <bits name="body" above="length bytes" width="1.7"/>
646 </header>
647 </diagram>
648
649 <p>
650 The most significant 16 bits of the NXM or OXM header, called
651 <code>vendor</code> by NXM and <code>class</code> by OXM, identify
652 an organization permitted to allocate identifiers for fields. NXM
653 allocates only two vendors, 0x0000 for fields supported by
654 OpenFlow 1.0 and 0x0001 for fields implemented as an Open vSwitch
655 extension. OXM assigns classes as follows:
656 </p>
657
658 <dl>
659 <dt>0x0000 (<code>OFPXMC_NXM_0</code>).</dt>
660 <dt>0x0001 (<code>OFPXMC_NXM_1</code>).</dt>
661 <dd>Reserved for NXM compatibility.</dd>
662
663 <dt>0x0002 to 0x7fff</dt>
664 <dd>
665 Reserved for allocation to ONF members, but none yet assigned.
666 </dd>
667
668 <dt>0x8000 (<code>OFPXMC_OPENFLOW_BASIC</code>)</dt>
669 <dd>
670 Used for most standard OpenFlow fields.
671 </dd>
672
673 <dt>0x8001 (<code>OFPXMC_PACKET_REGS</code>)</dt>
674 <dd>
675 Used for packet register fields in OpenFlow 1.5 and later.
676 </dd>
677
678 <dt>0x8002 to 0xfffe</dt>
679 <dd>
680 Reserved for the OpenFlow specification.
681 </dd>
682
683 <dt>0xffff (<code>OFPXMC_EXPERIMENTER</code>)</dt>
684 <dd>Experimental use.</dd>
685 </dl>
686
687 <p>
688 When <code>class</code> is 0xffff, the OXM header is extended to 64 bits by
689 using the first 32 bits of the body as an <code>experimenter</code> field
690 whose most significant byte is zero and whose remaining bytes are an
691 Organizationally Unique Identifier (OUI) assigned by the IEEE [IEEE OUI],
692 as shown below.
693 </p>
694
695 <diagram>
696 <header name="type">
697 <bits name="class" above="16" below="0xffff" width=".75"/>
698 <bits name="field" above="7" width=".4"/>
699 </header>
700 <nospace/>
701 <header name="">
702 <bits name="HM" above="1" width=".25"/>
703 <bits name="length" above="8" width=".4"/>
704 </header>
705
706 <header name="experimenter">
707 <bits name="zero" above="8" below="0x00" width=".4"/>
708 <bits name="OUI" above="24" width="1"/>
709 </header>
710 <header name="">
711 <bits name="body" above="(length - 4) bytes" width="1.7"/>
712 </header>
713 </diagram>
714
715 <p>
716 OpenFlow says that support for experimenter fields is optional. Open
717 vSwitch 2.4 and later does support them, so that it can support the
718 following experimenter classes:
719 </p>
720
721 <dl>
722 <dt>0x4f4e4600 (<code>ONFOXM_ET</code>)</dt>
723 <dd>
724 Used by official Open Networking Foundation extensions in OpenFlow 1.3
725 and later.
726 e.g. [TCP Flags Match Field Extension].
727 </dd>
728
729 <dt>0x005ad650 (<code>NXOXM_NSH</code>)</dt>
730 <dd>
731 Used by Open vSwitch for NSH extensions, in the absence of an official
732 ONF-assigned class. (This OUI is randomly generated.)
733 </dd>
734 </dl>
735
736 <p>
737 Taken as a unit, <code>class</code> (or <code>vendor</code>),
738 <code>field</code>, and <code>experimenter</code> (when present) uniquely
739 identify a particular field.
740 </p>
741
742 <p>
743 When <code>hasmask</code> (abbreviated <code>HM</code> above) is 0, the OXM
744 is an exact match on an entire field. In this case, the body (excluding
745 the experimenter field, if present) is a single value to be matched.
746 </p>
747
748 <p>
749 When <code>hasmask</code> is 1, the OXM is a bitwise match. The body
750 (excluding the experimenter field) consists of a value to match, followed
751 by the bitwise mask to apply. A 1-bit in the mask indicates that the
752 corresponding bit in the value should be matched and a 0-bit that it should
753 be ignored. For example, for an IP address field, a value of 192.168.0.0
754 followed by a mask of 255.255.0.0 would match addresses in the
755 196.168.0.0/16 subnet.
756 </p>
757
758 <ul>
759 <li>
760 Some fields might not support masking at all, and some fields that do
761 support masking might restrict it to certain patterns. For example,
762 fields that have IP address values might be restricted to CIDR masks.
763 The descriptions of individual fields note these restrictions.
764 </li>
765
766 <li>
767 An OXM TLV with a mask that is all zeros is not useful (although it is
768 not forbidden), because it is has the same effect as omitting the TLV
769 entirely.
770 </li>
771
772 <li>
773 It is not meaningful to pair a 0-bit in an OXM mask with a 1-bit in its
774 value, and Open vSwitch rejects such an OXM with the error
775 <code>OFPBMC_BAD_WILDCARDS</code>, as required by OpenFlow 1.3 and later.
776 </li>
777 </ul>
778
779 <p>
780 The <code>length</code> identifies the number of bytes in the body,
781 including the 4-byte <code>experimenter</code> header, if it is present.
782 Each OXM TLV has a fixed length; that is, given <code>class</code>,
783 <code>field</code>, <code>experimenter</code> (if present), and
784 <code>hasmask</code>, <code>length</code> is a constant. The
785 <code>length</code> is included explicitly to allow software to minimally
786 parse OXM TLVs of unknown types.
787 </p>
788
789 <p>
790 OXM TLVs must be ordered so that a field's prerequisites are satisfied
791 before it is parsed. For example, an OXM TLV that matches on the IPv4
792 source address field is only allowed following an OXM TLV that matches on
793 the Ethertype for IPv4. Similarly, an OXM TLV that matches on the TCP
794 source port must follow a TLV that matches an Ethertype of IPv4 or IPv6 and
795 one that matches an IP protocol of TCP (in that order). The order of OXM
796 TLVs is not otherwise restricted; no canonical ordering is defined.
797 </p>
798
799 <p>
800 A given field may be matched only once in a series of OXM TLVs.
801 </p>
802
803 <!-- EXT-482? -->
804
805 <h3>OpenFlow 1.3</h3>
806
807 <p>
808 OpenFlow 1.3 showed OXM to be largely successful, by adding new fields
809 without making any changes to how flow matches otherwise worked. It added
810 OXMs for the following fields supported by Open vSwitch:
811 </p>
812
813 <ul>
814 <li>Tunnel ID for ports associated with e.g. VXLAN or keyed GRE.</li>
815 <li>MPLS ``bottom of stack'' (BOS) bit.</li>
816 </ul>
817
818 <p>
819 OpenFlow 1.3 also added OXMs for the following fields not documented here
820 and not yet implemented by Open vSwitch:
821 </p>
822
823 <ul>
824 <li>IPv6 extension header handling.</li>
825 <li>PBB I-SID.</li>
826 </ul>
827
828 <h3>OpenFlow 1.4</h3>
829
830 <p>
831 OpenFlow 1.4 added OXMs for the following fields not documented here and
832 not yet implemented by Open vSwitch:
833 </p>
834
835 <ul>
836 <li>PBB UCA.</li>
837 </ul>
838
839 <h3>OpenFlow 1.5</h3>
840
841 <p>
842 OpenFlow 1.5 added OXMs for the following fields supported by Open vSwitch:
843 </p>
844
845 <ul>
846 <li>Packet type.</li>
847 <li>TCP flags.</li>
848 <li>Packet registers.</li>
849 <li>The output port in the OpenFlow action set.</li>
850 </ul>
851
852 <h1>Fields Reference</h1>
853
854 <p>
855 The following sections document the fields that Open vSwitch supports.
856 Each section provides introductory material on a group of related fields,
857 followed by information on each individual field. In addition to
858 field-specific information, each field begins with a table with entries for
859 the following important properties:
860 </p>
861
862 <dl>
863 <dt>Name</dt>
864 <dd>
865 The field's name, used for parsing and formatting the field, e.g. in
866 <code>ovs-ofctl</code> commands. For historical reasons, some fields
867 have an additional name that is accepted as an alternative in parsing.
868 This name, when there is one, is listed as well, e.g. ``<code>tun</code>
869 (aka <code>tunnel_id</code>).''
870 </dd>
871
872 <dt>Width</dt>
873 <dd>
874 The field's width, always a multiple of 8 bits. Some fields don't use
875 all of the bits, so this may be accompanied by an explanation. For
876 example, OpenFlow embeds the 2-bit IP ECN field as as the low bits in an
877 8-bit byte, and so its width is expressed as ``8 bits (only the
878 least-significant 2 bits may be nonzero).''
879 </dd>
880
881 <dt>Format</dt>
882 <dd>
883 <p>
884 How a value for the field is formatted or parsed by, e.g.,
885 <code>ovs-ofctl</code>. Some possibilities are generic:
886 </p>
887
888 <dl>
889 <dt>decimal</dt>
890 <dd>
891 Formats as a decimal number. On input, accepts decimal numbers or
892 hexadecimal numbers prefixed by <code>0x</code>.
893 </dd>
894
895 <dt>hexadecimal</dt>
896 <dd>
897 Formats as a hexadecimal number prefixed by <code>0x</code>. On
898 input, accepts decimal numbers or hexadecimal numbers prefixed by
899 <code>0x</code>. (The default for parsing is <em>not</em>
900 hexadecimal: only a <code>0x</code> prefix causes input to be treated
901 as hexadecimal.)
902 </dd>
903
904 <dt>Ethernet</dt>
905 <dd>
906 Formats and accepts the common Ethernet address format
907 <code><var>xx</var>:<var>xx</var>:<var>xx</var>:<var>xx</var>:<var>xx</var>:<var>xx</var></code>.
908 </dd>
909
910 <dt>IPv4</dt>
911 <dd>
912 Formats and accepts the dotted-quad format
913 <code><var>a</var>.<var>b</var>.<var>c</var>.<var>d</var></code>.
914 For bitwise matches, formats and accepts
915 <code><var>address</var>/<var>length</var></code> CIDR notation in
916 addition to <code><var>address</var>/<var>mask</var></code>.
917 </dd>
918
919 <dt>IPv6</dt>
920 <dd>
921 Formats and accepts the common IPv6 address formats, plus CIDR
922 notation for bitwise matches.
923 </dd>
924
925 <dt>OpenFlow 1.0 port</dt>
926 <dd>
927 Accepts 16-bit port numbers in decimal, plus OpenFlow well-known port
928 names (e.g. <code>IN_PORT</code>) in uppercase or lowercase.
929 </dd>
930
931 <dt>OpenFlow 1.1+ port</dt>
932 <dd>
933 Same syntax as OpenFlow 1.0 ports but for 32-bit OpenFlow 1.1+ port
934 number fields.
935 </dd>
936 </dl>
937
938 <p>
939 Other, field-specific formats are explained along with their fields.
940 </p>
941 </dd>
942
943 <dt>Masking</dt>
944 <dd>
945 For most fields, this says ``arbitrary bitwise masks,'' meaning that a
946 flow may match any combination of bits in the field. Some fields
947 instead say ``exact match only,'' which means that a flow that matches
948 on this field must match on the whole field instead of just certain
949 bits. Either way, this reports masking support for the latest version
950 of Open vSwitch using OXM or NXM (that is, either OpenFlow 1.2+ or
951 OpenFlow 1.0 plus Open vSwitch NXM extensions). In particular,
952 OpenFlow 1.0 (without NXM) and 1.1 don't always support masking even if
953 Open vSwitch itself does; refer to the <em>OpenFlow 1.0</em> and
954 <em>OpenFlow 1.1</em> rows to learn about masking with these protocol
955 versions.
956 </dd>
957
958 <dt>Prerequisites</dt>
959 <dd>
960 <p>
961 Requirements that must be met to match on this field. For example,
962 <ref field="ip_src"/> has IPv4 as a prerequisite, meaning that a match
963 must include <code>eth_type=0x0800</code> to match on the IPv4 source
964 address. The following prerequisites, with their requirements, are
965 currently in use:
966 </p>
967
968 <dl>
969 <dt>none</dt>
970 <dd>(no requirements)</dd>
971
972 <dt>VLAN VID</dt>
973 <dd><code>vlan_tci=0x1000/0x1000</code> (i.e. a VLAN header is
974 present)</dd>
975
976 <dt>ARP</dt>
977 <dd><code>eth_type=0x0806</code> (ARP) or <code>eth_type=0x8035</code> (RARP)</dd>
978
979 <dt>IPv4</dt>
980 <dd><code>eth_type=0x0800</code></dd>
981
982 <dt>IPv6</dt>
983 <dd><code>eth_type=0x86dd</code></dd>
984
985 <dt>IPv4/IPv6</dt>
986 <dd>IPv4 or IPv6</dd>
987
988 <dt>MPLS</dt>
989 <dd><code>eth_type=0x8847</code> or <code>eth_type=0x8848</code></dd>
990
991 <dt>TCP</dt>
992 <dd>IPv4/IPv6 and <code>ip_proto=6</code></dd>
993
994 <dt>UDP</dt>
995 <dd>IPv4/IPv6 and <code>ip_proto=17</code></dd>
996
997 <dt>SCTP</dt>
998 <dd>IPv4/IPv6 and <code>ip_proto=132</code></dd>
999
1000 <dt>ICMPv4</dt>
1001 <dd>IPv4 and <code>ip_proto=1</code></dd>
1002
1003 <dt>ICMPv6</dt>
1004 <dd>IPv6 and <code>ip_proto=58</code></dd>
1005
1006 <dt>ND solicit</dt>
1007 <dd>ICMPv6 and <code>icmp_type=135</code> and <code>icmp_code=0</code></dd>
1008
1009 <dt>ND advert</dt>
1010 <dd>ICMPv6 and <code>icmp_type=136</code> and <code>icmp_code=0</code></dd>
1011
1012 <dt>ND</dt>
1013 <dd>ND solicit or ND advert</dd>
1014 </dl>
1015
1016 <p>
1017 The TCP, UDP, and SCTP prerequisites also have the special requirement
1018 that <code>nw_frag</code> is not being used to select ``later
1019 fragments.'' This is because only the first fragment of a fragmented
1020 IPv4 or IPv6 datagram contains the TCP or UDP header.
1021 </p>
1022 </dd>
1023
1024 <dt>Access</dt>
1025 <dd>
1026 Most fields are ``read/write,'' which means that common OpenFlow actions
1027 like <code>set_field</code> can modify them. Fields that are
1028 ``read-only'' cannot be modified in these general-purpose ways, although
1029 there may be other ways that actions can modify them.
1030 </dd>
1031
1032 <dt>OpenFlow 1.0</dt>
1033 <dt>OpenFlow 1.1</dt>
1034 <dd>
1035 These rows report the level of support that OpenFlow 1.0 or OpenFlow 1.1,
1036 respectively, has for a field. For OpenFlow 1.0, supported fields are
1037 reported as either ``yes (exact match only)'' for fields that do not
1038 support any bitwise masking or ``yes (CIDR match only)'' for fields that
1039 support CIDR masking. OpenFlow 1.1 supported fields report either ``yes
1040 (exact match only)'' or simply ``yes'' for fields that do support
1041 arbitrary masks. These OpenFlow versions supported a fixed collection of
1042 fields that cannot be extended, so many more fields are reported as ``not
1043 supported.''
1044 </dd>
1045
1046 <dt>OXM</dt>
1047 <dt>NXM</dt>
1048 <dd>
1049 <p>
1050 These rows report the OXM and NXM code points that correspond to a
1051 given field. Either or both may be ``none.''
1052 </p>
1053
1054 <p>
1055 A field that has only an OXM code point is usually one that was
1056 standardized before it was added to Open vSwitch. A field that has
1057 only an NXM code point is usually one that is not yet standardized.
1058 When a field has both OXM and NXM code points, it usually indicates
1059 that it was introduced as an Open vSwitch extension under the NXM code
1060 point, then later standardized under the OXM code point. A field can
1061 have more than one OXM code point if it was standardized in OpenFlow
1062 1.4 or later and additionally introduced as an official ONF extension
1063 for OpenFlow 1.3. (A field that has neither OXM nor NXM code point is
1064 typically an obsolete field that is supported in some other form using
1065 OXM or NXM.)
1066 </p>
1067
1068 <p>
1069 Each code point in these rows is described in the form
1070 ``<code>NAME</code> (<var>number</var>) since OpenFlow <var>spec</var>
1071 and Open vSwitch <var>version</var>,''
1072 e.g. ``<code>OXM_OF_ETH_TYPE</code> (5) since OpenFlow 1.2 and Open
1073 vSwitch 1.7.'' First, <code>NAME</code>, which specifies a name for
1074 the code point, starts with a prefix that designates a class and, in
1075 some cases, a vendor, as listed in the following table:
1076 </p>
1077
1078 <oxm_classes/>
1079
1080 <p>
1081 For more information on OXM/NXM classes and vendors, refer back to
1082 <em>OpenFlow 1.2</em> under <em>Evolution of OpenFlow Fields</em>. The
1083 <var>number</var> is the field number within the class and vendor. The
1084 OpenFlow <var>spec</var> is the version of OpenFlow that standardized
1085 the code point. It is omitted for NXM code points because they are
1086 nonstandard. The <var>version</var> is the version of Open vSwitch
1087 that first supported the code point.
1088 </p>
1089 </dd>
1090 </dl>
1091
1092 <group title="Conjunctive Match">
1093 <p>
1094 An individual OpenFlow flow can match only a single value for each field.
1095 However, situations often arise where one wants to match one of a set of
1096 values within a field or fields. For matching a single field against a
1097 set, it is straightforward and efficient to add multiple flows to the
1098 flow table, one for each value in the set. For example, one might use
1099 the following flows to send packets with IP source address <var>a</var>,
1100 <var>b</var>, <var>c</var>, or <var>d</var> to the OpenFlow controller:
1101 </p>
1102
1103 <pre>
1104 ip,ip_src=<var>a</var> actions=controller
1105 ip,ip_src=<var>b</var> actions=controller
1106 ip,ip_src=<var>c</var> actions=controller
1107 ip,ip_src=<var>d</var> actions=controller
1108 </pre>
1109
1110 <p>
1111 Similarly, these flows send packets with IP destination address
1112 <var>e</var>, <var>f</var>, <var>g</var>, or <var>h</var> to the OpenFlow
1113 controller:
1114 </p>
1115
1116 <pre>
1117 ip,ip_dst=<var>e</var> actions=controller
1118 ip,ip_dst=<var>f</var> actions=controller
1119 ip,ip_dst=<var>g</var> actions=controller
1120 ip,ip_dst=<var>h</var> actions=controller
1121 </pre>
1122
1123 <p>
1124 Installing all of the above flows in a single flow table yields a
1125 disjunctive effect: a packet is sent to the controller if
1126 <code>ip_src</code> ∈ {<var>a</var>,<var>b</var>,<var>c</var>,<var>d</var>}
1127 or <code>ip_dst</code>
1128 {<var>e</var>,<var>f</var>,<var>g</var>,<var>h</var>} (or both).
1129 (Pedantically, if both of the above sets of flows are present in the flow
1130 table, they should have different priorities, because OpenFlow says that
1131 the results are undefined when two flows with same priority can both match
1132 a single packet.)
1133 </p>
1134
1135 <p>
1136 Suppose, on the other hand, one wishes to match conjunctively, that is, to
1137 send a packet to the controller only if both <code>ip_src</code>
1138 {<var>a</var>,<var>b</var>,<var>c</var>,<var>d</var>} and
1139 <code>ip_dst</code>
1140 {<var>e</var>,<var>f</var>,<var>g</var>,<var>h</var>}. This requires 4 × 4
1141 = 16 flows, one for each possible pairing of <code>ip_src</code> and
1142 <code>ip_dst</code>. That is acceptable for our small example, but it does
1143 not gracefully extend to larger sets or greater numbers of dimensions.
1144 </p>
1145
1146 <p>
1147 The <code>conjunction</code> action is a solution for conjunctive matches
1148 that is built into Open vSwitch. A <code>conjunction</code> action ties groups of
1149 individual OpenFlow flows into higher-level ``conjunctive flows''. Each
1150 group corresponds to one dimension, and each flow within the group matches
1151 one possible value for the dimension. A packet that matches one flow from
1152 each group matches the conjunctive flow.
1153 </p>
1154
1155 <p>
1156 To implement a conjunctive flow with <code>conjunction</code>, assign the
1157 conjunctive flow a 32-bit <var>id</var>, which must be unique within an
1158 OpenFlow table. Assign each of the <var>n</var>2 dimensions a unique
1159 number from 1 to <var>n</var>; the ordering is unimportant. Add one flow
1160 to the OpenFlow flow table for each possible value of each dimension with
1161 <code>conjunction(<var>id</var>, <var>k</var>/<var>n</var>)</code> as the
1162 flow's actions, where <var>k</var> is the number assigned to the flow's
1163 dimension. Together, these flows specify the conjunctive flow's match
1164 condition. When the conjunctive match condition is met, Open vSwitch looks
1165 up one more flow that specifies the conjunctive flow's actions and receives
1166 its statistics. This flow is found by setting <code>conj_id</code> to the
1167 specified <var>id</var> and then again searching the flow table.
1168 </p>
1169
1170 <p>
1171 The following flows provide an example. Whenever the IP source is one of
1172 the values in the flows that match on the IP source (dimension 1 of 2),
1173 <em>and</em> the IP destination is one of the values in the flows that
1174 match on IP destination (dimension 2 of 2), Open vSwitch searches for a
1175 flow that matches <code>conj_id</code> against the conjunction ID (1234),
1176 finding the first flow listed below.
1177 </p>
1178
1179 <pre>
1180 conj_id=1234 actions=controller
1181 ip,ip_src=10.0.0.1 actions=conjunction(1234, 1/2)
1182 ip,ip_src=10.0.0.4 actions=conjunction(1234, 1/2)
1183 ip,ip_src=10.0.0.6 actions=conjunction(1234, 1/2)
1184 ip,ip_src=10.0.0.7 actions=conjunction(1234, 1/2)
1185 ip,ip_dst=10.0.0.2 actions=conjunction(1234, 2/2)
1186 ip,ip_dst=10.0.0.5 actions=conjunction(1234, 2/2)
1187 ip,ip_dst=10.0.0.7 actions=conjunction(1234, 2/2)
1188 ip,ip_dst=10.0.0.8 actions=conjunction(1234, 2/2)
1189 </pre>
1190
1191 <p>
1192 Many subtleties exist:
1193 </p>
1194
1195 <ul>
1196 <li>
1197 In the example above, every flow in a single dimension has the same form,
1198 that is, dimension 1 matches on <code>ip_src</code> and dimension 2 on
1199 <code>ip_dst</code>, but this is not a requirement. Different flows
1200 within a dimension may match on different bits within a field (e.g. IP
1201 network prefixes of different lengths, or TCP/UDP port ranges as bitwise
1202 matches), or even on entirely different fields (e.g. to match packets for
1203 TCP source port 80 or TCP destination port 80).
1204 </li>
1205
1206 <li>
1207 The flows within a dimension can vary their matches across more than
1208 one field, e.g. to match only specific pairs of IP source and
1209 destination addresses or L4 port numbers.
1210 </li>
1211
1212 <li>
1213 A flow may have multiple <code>conjunction</code> actions, with different
1214 <code>id</code> values. This is useful for multiple conjunctive flows with
1215 overlapping sets. If one conjunctive flow matches packets with both
1216 <code>ip_src</code> ∈ {<var>a</var>,<var>b</var>} and <code>ip_dst</code>
1217 {<var>d</var>,<var>e</var>} and a second conjunctive flow matches <code>ip_src</code>
1218 ∈ {<var>b</var>,<var>c</var>} and <code>ip_dst</code> ∈ {<var>f</var>,<var>g</var>}, for
1219 example, then the flow that matches <code>ip_src=</code><var>b</var> would have two
1220 <code>conjunction</code> actions, one for each conjunctive flow. The order
1221 of <code>conjunction</code> actions within a list of actions is not
1222 significant.
1223 </li>
1224 <li>
1225 A flow with <code>conjunction</code> actions may also include <code>note</code>
1226 actions for annotations, but not any other kind of actions. (They
1227 would not be useful because they would never be executed.)
1228 </li>
1229 <li>
1230 All of the flows that constitute a conjunctive flow with a given
1231 <var>id</var> must have the same priority. (Flows with the same <var>id</var>
1232 but different priorities are currently treated as different
1233 conjunctive flows, that is, currently <var>id</var> values need only be
1234 unique within an OpenFlow table at a given priority. This behavior
1235 isn't guaranteed to stay the same in later releases, so please use
1236 <var>id</var> values unique within an OpenFlow table.)
1237 </li>
1238 <li>
1239 Conjunctive flows must not overlap with each other, at a given
1240 priority, that is, any given packet must be able to match at most one
1241 conjunctive flow at a given priority. Overlapping conjunctive flows
1242 yield unpredictable results.
1243 (The flows that constitute a conjunctive flow may overlap with those
1244 that constitute the same or another conjunctive flow.)
1245 </li>
1246 <li>
1247 Following a conjunctive flow match, the search for the flow with
1248 <code>conj_id=</code><var>id</var> is done in the same general-purpose way as
1249 other flow table searches, so one can use flows with
1250 <code>conj_id=</code><var>id</var> to act differently depending on
1251 circumstances. (One exception is that the search for the
1252 <code>conj_id=</code><var>id</var> flow itself ignores conjunctive flows, to
1253 avoid recursion.) If the search with <code>conj_id=</code><var>id</var> fails,
1254 Open vSwitch acts as if the conjunctive flow had not matched at all, and
1255 continues searching the flow table for other matching flows.
1256 </li>
1257 <li>
1258 <p>
1259 OpenFlow prerequisite checking occurs for the flow with
1260 <code>conj_id=</code><var>id</var> in the same way as any other flow, e.g. in
1261 an OpenFlow 1.1+ context, putting a <code>mod_nw_src</code> action into the example
1262 above would require adding an <code>ip</code> match, like this:
1263 </p>
1264 <pre>
1265 conj_id=1234,ip actions=mod_nw_src:1.2.3.4,controller
1266 </pre>
1267 </li>
1268 <li>
1269 OpenFlow prerequisite checking also occurs for the individual flows
1270 that comprise a conjunctive match in the same way as any other flow.
1271 </li>
1272 <li>
1273 The flows that constitute a conjunctive flow do not have useful
1274 statistics. They are never updated with byte or packet counts, and so
1275 on. (For such a flow, therefore, the idle and hard timeouts work much
1276 the same way.)
1277 </li>
1278 <li>
1279 <p>
1280 Sometimes there is a choice of which flows include a particular match.
1281 For example, suppose that we added an extra constraint to our example,
1282 to match on <code>ip_src</code>
1283 {<var>a</var>,<var>b</var>,<var>c</var>,<var>d</var>} and
1284 <code>ip_dst</code>
1285 {<var>e</var>,<var>f</var>,<var>g</var>,<var>h</var>} and
1286 <code>tcp_dst</code> = <var>i</var>. One way to implement this is to
1287 add the new constraint to the <code>conj_id</code> flow, like this:
1288 </p>
1289 <pre>
1290 conj_id=1234,tcp,tcp_dst=<var>i</var> actions=mod_nw_src:1.2.3.4,controller
1291 </pre>
1292 <p>
1293 but <em>this is not recommended</em> because of the cost of the extra
1294 flow table lookup. Instead, add the constraint to the individual
1295 flows, either in one of the dimensions or (slightly better) all of
1296 them.
1297 </p>
1298 </li>
1299 <li>
1300 A conjunctive match must have <var>n</var>2 dimensions (otherwise a
1301 conjunctive match is not necessary). Open vSwitch enforces this.
1302 </li>
1303 <li>
1304 Each dimension within a conjunctive match should ordinarily have more
1305 than one flow. Open vSwitch does not enforce this.
1306 </li>
1307 </ul>
1308
1309 <field id="MFF_CONJ_ID" title="Conjunction ID">
1310 Used for conjunctive matching. See above for more information.
1311 </field>
1312 </group>
1313
1314 <group title="Tunnel">
1315 <p>
1316 The fields in this group relate to tunnels, which Open vSwitch
1317 supports in several forms (GRE, VXLAN, and so on). Most of
1318 these fields do appear in the wire format of a packet, so they
1319 are data fields from that point of view, but they are metadata
1320 from an OpenFlow flow table point of view because they do not
1321 appear in packets that are forwarded to the controller or to
1322 ordinary (non-tunnel) output ports.
1323 </p>
1324
1325 <p>
1326 Open vSwitch supports a spectrum of usage models for mapping
1327 tunnels to OpenFlow ports:
1328 </p>
1329
1330 <dl>
1331 <dt>``Port-based'' tunnels</dt>
1332 <dd>
1333 <p>
1334 In this model, an OpenFlow port represents one tunnel: it matches a
1335 particular type of tunnel traffic between two IP endpoints, with a
1336 particular tunnel key (if keys are in use). In this situation, <ref
1337 field="in_port"/> suffices to distinguish one tunnel from another, so
1338 the tunnel header fields have little importance for OpenFlow
1339 processing. (They are still populated and may be used if it is
1340 convenient.) The tunnel header fields play no role in sending
1341 packets out such an OpenFlow port, either, because the OpenFlow port
1342 itself fully specifies the tunnel headers.
1343 </p>
1344
1345 <p>
1346 The following Open vSwitch commands create a bridge
1347 <code>br-int</code>, add port <code>tap0</code> to the bridge as
1348 OpenFlow port 1, establish a port-based GRE tunnel between the local
1349 host and remote IP 192.168.1.1 using GRE key 5001 as OpenFlow port 2,
1350 and arranges to forward all traffic from <code>tap0</code> to the
1351 tunnel and vice versa:
1352 </p>
1353
1354 <pre>
1355 ovs-vsctl add-br br-int
1356 ovs-vsctl add-port br-int tap0 -- set interface tap0 ofport_request=1
1357 ovs-vsctl add-port br-int gre0 -- \
1358 set interface gre0 ofport_request=2 type=gre \
1359 options:remote_ip=192.168.1.1 options:key=5001
1360 ovs-ofctl add-flow br-int in_port=1,actions=2
1361 ovs-ofctl add-flow br-int in_port=2,actions=1
1362 </pre>
1363 </dd>
1364
1365 <dt>``Flow-based'' tunnels</dt>
1366 <dd>
1367 <p>
1368 In this model, one OpenFlow port represents all possible tunnels of a
1369 given type with an endpoint on the current host, for example, all GRE
1370 tunnels. In this situation, <ref field="in_port"/> only indicates
1371 that traffic was received on the particular kind of tunnel. This is
1372 where the tunnel header fields are most important: they allow the
1373 OpenFlow tables to discriminate among tunnels based on their IP
1374 endpoints or keys. Tunnel header fields also determine the IP
1375 endpoints and keys of packets sent out such a tunnel port.
1376 </p>
1377
1378 <p>
1379 The following Open vSwitch commands create a bridge
1380 <code>br-int</code>, add port <code>tap0</code> to the
1381 bridge as OpenFlow port 1, establish a flow-based GRE tunnel
1382 port 3, and arranges to forward all traffic from
1383 <code>tap0</code> to remote IP 192.168.1.1 over a GRE tunnel
1384 with key 5001 and vice versa:
1385 </p>
1386
1387 <pre>
1388 ovs-vsctl add-br br-int
1389 ovs-vsctl add-port br-int tap0 -- set interface tap0 ofport_request=1
1390 ovs-vsctl add-port br-int allgre -- \
1391 set interface allgre ofport_request=3 type=gre \
1392 options:remote_ip=flow options:key=flow
1393 ovs-ofctl add-flow br-int \
1394 'in_port=1 actions=set_tunnel:5001,set_field:192.168.1.1->tun_dst,3'
1395 ovs-ofctl add-flow br-int 'in_port=3,tun_src=192.168.1.1,tun_id=5001 actions=1'
1396 </pre>
1397 </dd>
1398
1399 <dt>Mixed models.</dt>
1400 <dd>
1401 <p>
1402 One may define both flow-based and port-based tunnels at the
1403 same time. For example, it is valid and possibly useful to
1404 create and configure both <code>gre0</code> and
1405 <code>allgre</code> tunnel ports described above.
1406 </p>
1407
1408 <p>
1409 Traffic is attributed on ingress to the most specific
1410 matching tunnel. For example, <code>gre0</code> is more
1411 specific than <code>allgre</code>. Therefore, if both
1412 exist, then <code>gre0</code> will be the ingress port for any
1413 GRE traffic received from 192.168.1.1 with key 5001.
1414 </p>
1415
1416 <p>
1417 On egress, traffic may be directed to any appropriate tunnel
1418 port. If both <code>gre0</code> and <code>allgre</code> are
1419 configured as already described, then the actions
1420 <code>2</code> and
1421 <code>set_tunnel:5001,set_field:192.168.1.1->tun_dst,3</code>
1422 send the same tunnel traffic.
1423 </p>
1424 </dd>
1425
1426 <dt>Intermediate models.</dt>
1427 <dd>
1428 Ports may be configured as partially flow-based. For example,
1429 one may define an OpenFlow port that represents tunnels
1430 between a pair of endpoints but leaves the flow table to
1431 discriminate on the flow key.
1432 </dd>
1433 </dl>
1434
1435 <p>
1436 <code>ovs-vswitchd.conf.db</code>(5) describes all the details of tunnel
1437 configuration.
1438 </p>
1439
1440 <p>
1441 These fields do not have any prerequisites, which means that a
1442 flow may match on any or all of them, in any combination.
1443 </p>
1444
1445 <p>
1446 These fields are zeros for packets that did not arrive on a tunnel.
1447 </p>
1448
1449 <field id="MFF_TUN_ID" title="Tunnel ID">
1450 <p>
1451 Many kinds of tunnels support a tunnel ID:
1452 </p>
1453
1454 <ul>
1455 <li>
1456 VXLAN and Geneve have a 24-bit virtual network identifier (VNI).
1457 </li>
1458 <li>LISP has a 24-bit instance ID.</li>
1459 <li>GRE has an optional 32-bit key.</li>
1460 <li>STT has a 64-bit key.</li>
1461 <li>ERSPAN has a 10-bit key (Session ID).</li>
1462 <li>GTPU has a 32-bit key (Tunnel Endpoint ID).</li>
1463 </ul>
1464
1465 <p>
1466 When a packet is received from a tunnel, this field holds the
1467 tunnel ID in its least significant bits, zero-extended to fit.
1468 This field is zero if the tunnel does not support an ID, or if
1469 no ID is in use for a tunnel type that has an optional ID, or
1470 if an ID of zero received, or if the packet was not received
1471 over a tunnel.
1472 </p>
1473
1474 <p>
1475 When a packet is output to a tunnel port, the tunnel
1476 configuration determines whether the tunnel ID is taken from
1477 this field or bound to a fixed value. See the earlier
1478 description of ``port-based'' and ``flow-based'' tunnels for
1479 more information.
1480 </p>
1481
1482 <p>
1483 The following diagram shows the origin of this field in a
1484 typical keyed GRE tunnel:
1485 </p>
1486
1487 <diagram>
1488 <header name="Ethernet">
1489 <bits name="dst" above="48" width="0.4"/>
1490 <bits name="src" above="48" width="0.4"/>
1491 <bits name="type" above="16" below="0x800" width="0.4"/>
1492 </header>
1493 <header name="IPv4">
1494 <bits name="..." width="0.4"/>
1495 <bits name="proto" above="8" below="47" width="0.4"/>
1496 <bits name="src" above="32" width="0.4"/>
1497 <bits name="dst" above="32" width="0.4"/>
1498 </header>
1499 <header name="GRE">
1500 <bits name="..." above="16" width="0.4"/>
1501 <bits name="type" above="16" below="0x6558" width="0.4"/>
1502 <bits name="key" above="32" width=".4" fill="yes"/>
1503 </header>
1504 <header name="Ethernet">
1505 <bits name="dst" above="48" width="0.4"/>
1506 <bits name="src" above="48" width="0.4"/>
1507 <bits name="type" above="16" width="0.4"/>
1508 </header>
1509 <dots/>
1510 </diagram>
1511 </field>
1512
1513 <field id="MFF_TUN_SRC" title="Tunnel IPv4 Source">
1514 <p>
1515 When a packet is received from a tunnel, this field is the
1516 source address in the outer IP header of the tunneled packet.
1517 This field is zero if the packet was not received over a
1518 tunnel.
1519 </p>
1520
1521 <p>
1522 When a packet is output to a flow-based tunnel port, this
1523 field influences the IPv4 source address used to send the
1524 packet. If it is zero, then the kernel chooses an appropriate
1525 IP address based using the routing table.
1526 </p>
1527
1528 <p>
1529 The following diagram shows the origin of this field in a
1530 typical keyed GRE tunnel:
1531 </p>
1532
1533 <diagram>
1534 <header name="Ethernet">
1535 <bits name="dst" above="48" width="0.4"/>
1536 <bits name="src" above="48" width="0.4"/>
1537 <bits name="type" above="16" below="0x800" width="0.4"/>
1538 </header>
1539 <header name="IPv4">
1540 <bits name="..." width="0.4"/>
1541 <bits name="proto" above="8" below="47" width="0.4"/>
1542 <bits name="src" above="32" width="0.4" fill="yes"/>
1543 <bits name="dst" above="32" width="0.4"/>
1544 </header>
1545 <header name="GRE">
1546 <bits name="..." above="16" width="0.4"/>
1547 <bits name="type" above="16" below="0x6558" width="0.4"/>
1548 <bits name="key" above="32" width=".4"/>
1549 </header>
1550 <header name="Ethernet">
1551 <bits name="dst" above="48" width="0.4"/>
1552 <bits name="src" above="48" width="0.4"/>
1553 <bits name="type" above="16" width="0.4"/>
1554 </header>
1555 <dots/>
1556 </diagram>
1557 </field>
1558
1559 <field id="MFF_TUN_DST" title="Tunnel IPv4 Destination">
1560 <p>
1561 When a packet is received from a tunnel, this field is the
1562 destination address in the outer IP header of the tunneled
1563 packet. This field is zero if the packet was not received
1564 over a tunnel.
1565 </p>
1566
1567 <p>
1568 When a packet is output to a flow-based tunnel port, this
1569 field specifies the destination to which the tunnel packet is
1570 sent.
1571 </p>
1572
1573 <p>
1574 The following diagram shows the origin of this field in a
1575 typical keyed GRE tunnel:
1576 </p>
1577
1578 <diagram>
1579 <header name="Ethernet">
1580 <bits name="dst" above="48" width="0.4"/>
1581 <bits name="src" above="48" width="0.4"/>
1582 <bits name="type" above="16" below="0x800" width="0.4"/>
1583 </header>
1584 <header name="IPv4">
1585 <bits name="..." width="0.4"/>
1586 <bits name="proto" above="8" below="47" width="0.4"/>
1587 <bits name="src" above="32" width="0.4"/>
1588 <bits name="dst" above="32" width="0.4" fill="yes"/>
1589 </header>
1590 <header name="GRE">
1591 <bits name="..." above="16" width="0.4"/>
1592 <bits name="type" above="16" below="0x6558" width="0.4"/>
1593 <bits name="key" above="32" width=".4"/>
1594 </header>
1595 <header name="Ethernet">
1596 <bits name="dst" above="48" width="0.4"/>
1597 <bits name="src" above="48" width="0.4"/>
1598 <bits name="type" above="16" width="0.4"/>
1599 </header>
1600 <dots/>
1601 </diagram>
1602 </field>
1603
1604 <field id="MFF_TUN_IPV6_SRC" title="Tunnel IPv6 Source">
1605 Similar to <ref field="tun_src"/>, but for tunnels over IPv6.
1606 </field>
1607
1608 <field id="MFF_TUN_IPV6_DST" title="Tunnel IPv6 Destination">
1609 Similar to <ref field="tun_dst"/>, but for tunnels over IPv6.
1610 </field>
1611
1612 <h2>VXLAN Group-Based Policy Fields</h2>
1613
1614 <p>
1615 The VXLAN header is defined as follows [RFC 7348], where the
1616 <code>I</code> bit must be set to 1, unlabeled bits or those labeled
1617 <code>reserved</code> must be set to 0, and Open vSwitch makes the VNI
1618 available via <ref field="tun_id"/>:
1619 </p>
1620
1621 <diagram>
1622 <header name="VXLAN flags">
1623 <bits name="" above="1" width="0.15"/>
1624 <bits name="" above="1" width="0.15"/>
1625 <bits name="" above="1" width="0.15"/>
1626 <bits name="" above="1" width="0.15"/>
1627 <bits name="I" above="1" width="0.15"/>
1628 <bits name="" above="1" width="0.15"/>
1629 <bits name="" above="1" width="0.15"/>
1630 <bits name="" above="1" width="0.15"/>
1631 </header>
1632 <nospace/>
1633 <header>
1634 <bits name="reserved" above="24" width="1.2"/>
1635 <bits name="VNI" above="24" width="1.2"/>
1636 <bits name="reserved" above="8" width=".5"/>
1637 </header>
1638 </diagram>
1639
1640 <p>
1641 VXLAN Group-Based Policy [VXLAN Group Policy Option] adds new
1642 interpretations to existing bits in the VXLAN header, reinterpreting it
1643 as follows, with changes highlighted:
1644 </p>
1645
1646 <diagram>
1647 <header name="GBP flags">
1648 <bits name="" above="1" width="0.15"/>
1649 <bits name="D" above="1" width="0.15" fill="yes"/>
1650 <bits name="" above="1" width="0.15"/>
1651 <bits name="" above="1" width="0.15"/>
1652 <bits name="A" above="1" width="0.15" fill="yes"/>
1653 <bits name="" above="1" width="0.15"/>
1654 <bits name="" above="1" width="0.15"/>
1655 <bits name="" above="1" width="0.15"/>
1656 </header>
1657 <nospace/>
1658 <header>
1659 <bits name="group policy ID" above="24" width="1.2" fill="yes"/>
1660 <bits name="VNI" above="24" width="1.2"/>
1661 <bits name="reserved" above="8" width=".5"/>
1662 </header>
1663 </diagram>
1664
1665 <p>
1666 Open vSwitch makes GBP fields and flags available through the following
1667 fields. Only packets that arrive over a VXLAN tunnel with the GBP
1668 extension enabled have these fields set. In other packets they are zero
1669 on receive and ignored on transmit.
1670 </p>
1671
1672 <field id="MFF_TUN_GBP_ID" title="VXLAN Group-Based Policy ID">
1673 <p>
1674 For a packet tunneled over VXLAN with the Group-Based Policy (GBP)
1675 extension, this field represents the GBP policy ID, as shown above.
1676 </p>
1677 </field>
1678
1679 <field id="MFF_TUN_GBP_FLAGS" title="VXLAN Group-Based Policy Flags">
1680 <p>
1681 For a packet tunneled over VXLAN with the Group-Based Policy (GBP)
1682 extension, this field represents the GBP policy flags, as shown above.
1683 </p>
1684
1685 <p>
1686 The field has the format shown below:
1687 </p>
1688
1689 <diagram>
1690 <header name="GBP Flags">
1691 <bits name="" above="1" width="0.15"/>
1692 <bits name="D" above="1" width="0.15"/>
1693 <bits name="" above="1" width="0.15"/>
1694 <bits name="" above="1" width="0.15"/>
1695 <bits name="A" above="1" width="0.15"/>
1696 <bits name="" above="1" width="0.15"/>
1697 <bits name="" above="1" width="0.15"/>
1698 <bits name="" above="1" width="0.15"/>
1699 </header>
1700 </diagram>
1701
1702 <p>
1703 Unlabeled bits are reserved and must be transmitted as 0. The VXLAN
1704 GBP draft defines the other bits' meanings as:
1705 </p>
1706
1707 <dl>
1708 <dt><code>D</code> (Don't Learn)</dt>
1709 <dd>
1710 When set, this bit indicates that the egress tunnel endpoint must not
1711 learn the source address of the encapsulated frame.
1712 </dd>
1713
1714 <dt><code>A</code> (Applied)</dt>
1715 <dd>
1716 When set, indicates that the group policy has already been applied to
1717 this packet. Devices must not apply policies when the A bit is set.
1718 </dd>
1719 </dl>
1720 </field>
1721
1722 <h2>ERSPAN Metadata Fields</h2>
1723 <p>
1724 These fields provide access to features in the ERSPAN tunneling protocol
1725 [ERSPAN], which has two major versions: version 1 (aka type II) and
1726 version 2 (aka type III).
1727 </p>
1728
1729 <p>
1730 Regardless of version, ERSPAN is encapsulated within a fixed 8-byte GRE
1731 header that consists of a 4-byte GRE base header and a 4-byte sequence
1732 number. The ERSPAN version 1 header format is:
1733 </p>
1734
1735 <diagram>
1736 <header name="GRE">
1737 <bits name="..." above="16" width="0.4"/>
1738 <bits name="type" above="16" below="0x88be" width="0.4"/>
1739 <bits name="seq" above="32" width=".4"/>
1740 </header>
1741 <header name="ERSPAN v1">
1742 <bits name="ver" above="4" below="1" width="0.4"/>
1743 <bits name="..." above="18" width="0.4"/>
1744 <bits name="session" above="10" below="tun_id" width="0.5"/>
1745 <bits name="..." above="12" width="0.4"/>
1746 <bits name="idx" above="20" width="0.6"/>
1747 </header>
1748 <header name="Ethernet">
1749 <bits name="dst" above="48" width="0.4"/>
1750 <bits name="src" above="48" width="0.4"/>
1751 <bits name="type" above="16" width="0.4"/>
1752 </header>
1753 <dots/>
1754 </diagram>
1755
1756 <p>
1757 The ERSPAN version 2 header format is:
1758 </p>
1759
1760 <diagram>
1761 <header name="GRE">
1762 <bits name="..." above="16" width="0.4"/>
1763 <bits name="type" above="16" below="0x22eb" width="0.4"/>
1764 <bits name="seq" above="32" width=".4"/>
1765 </header>
1766 <header name="ERSPAN v2">
1767 <bits name="ver" above="4" below="2" width="0.4"/>
1768 <bits name="..." above="18" width="0.4"/>
1769 <bits name="session" above="10" below="tun_id" width="0.5"/>
1770 <bits name="timestamp" above="32" width=".7"/>
1771 <bits name="..." above="22" width="0.4"/>
1772 <bits name="hwid" above="6" width="0.4"/>
1773 <bits name="dir" above="1" below="0/1" width="0.4"/>
1774 <bits name="..." above="3" width="0.4"/>
1775 </header>
1776 <header name="Ethernet">
1777 <bits name="dst" above="48" width="0.4"/>
1778 <bits name="src" above="48" width="0.4"/>
1779 <bits name="type" above="16" width="0.4"/>
1780 </header>
1781 <dots/>
1782 </diagram>
1783
1784 <field id="MFF_TUN_ERSPAN_VER" title="ERSPAN Version">
1785 ERSPAN version number: 1 for version 1, or 2 for version 2.
1786 </field>
1787
1788 <field id="MFF_TUN_ERSPAN_IDX" title="ERSPAN Index">
1789 This field is a 20-bit index/port number associated with the ERSPAN
1790 traffic's source port and direction (ingress/egress). This field is
1791 platform dependent.
1792 </field>
1793
1794 <field id="MFF_TUN_ERSPAN_DIR" title="ERSPAN Direction">
1795 For ERSPAN v2, the mirrored traffic's direction: 0 for ingress traffic, 1
1796 for egress traffic.
1797 </field>
1798
1799 <field id="MFF_TUN_ERSPAN_HWID" title="ERSPAN Hardware ID">
1800 A 6-bit unique identifier of an ERSPAN v2 engine within a system.
1801 </field>
1802
1803 <h2>GTP-U Metadata Fields</h2>
1804
1805 <p>
1806 These fields provide access to set-up GPRS Tunnelling Protocol
1807 for User Plane (GTPv1-U), based on 3GPP TS 29.281. A GTP-U
1808 header has the following format:
1809 </p>
1810
1811 <diagram>
1812 <header>
1813 <bits name="flags" above="8" width="0.6"/>
1814 <bits name="msg type" above="8" width="0.6"/>
1815 <bits name="length" above="16" width="0.9"/>
1816 <bits name="TEID" above="32" width="1.3"/>
1817 </header>
1818 <dots/>
1819 </diagram>
1820
1821 <p>
1822 The flags and message type have the Open vSwitch GTP-U specific fields
1823 described below. Open vSwitch makes the TEID (Tunnel Endpoint
1824 Identifier), which identifies a tunnel endpoint in the receiving GTP-U
1825 protocol entity, available via <ref field="tun_id"/>.
1826 </p>
1827
1828 <field id="MFF_TUN_GTPU_FLAGS" title="GTP-U Flags">
1829 <p>
1830 This field holds the 8-bit GTP-U flags, encoded as:
1831 </p>
1832
1833 <diagram>
1834 <header name="GTP-U Tunnel Flags">
1835 <bits name="version" above="3" below="1" width="0.5"/>
1836 <bits name="PT" above="1" width="0.3"/>
1837 <bits name="rsv" above="1" below="0" width="0.3"/>
1838 <bits name="E" above="1" width="0.3"/>
1839 <bits name="S" above="1" width="0.3"/>
1840 <bits name="PN" above="1" width="0.3"/>
1841 </header>
1842 </diagram>
1843
1844 <p>
1845 The flags are:
1846 </p>
1847 <dl>
1848 <dt>version</dt>
1849 <dd>Used to determine the version of the GTP-U protocol, which should
1850 be set to 1.</dd>
1851
1852 <dt>PT</dt>
1853 <dd>Protocol type, used as a protocol discriminator
1854 between GTP (1) and GTP' (0).</dd>
1855
1856 <dt>rsv</dt>
1857 <dd>Reserved. Must be zero.</dd>
1858
1859 <dt>E</dt>
1860 <dd>If 1, indicates the presence of a meaningful value of the Next
1861 Extension Header field.</dd>
1862
1863 <dt>S</dt>
1864 <dd>If 1, indicates the presence of a meaningful value of the Sequence
1865 Number field.</dd>
1866
1867 <dt>PN</dt>
1868 <dd>If 1, indicates the presence of a meaningful value of the N-PDU
1869 Number field.</dd>
1870 </dl>
1871 </field>
1872
1873 <field id="MFF_TUN_GTPU_MSGTYPE" title="GTP-U Message Type">
1874 This field indicates whether it's a signalling message used for path
1875 management, or a user plane message which carries the original packet.
1876 The complete range of message types can be referred to [3GPP TS 29.281].
1877 </field>
1878
1879 <h2>Geneve Fields</h2>
1880
1881 <p>
1882 These fields provide access to additional features in the Geneve
1883 tunneling protocol [Geneve]. Their names are somewhat generic in the
1884 hope that the same fields could be reused for other protocols in the
1885 future; for example, the NSH protocol [NSH] supports TLV options whose
1886 form is identical to that for Geneve options.
1887 </p>
1888
1889 <field id="MFF_TUN_METADATA0" title="Generic Tunnel Option 0">
1890 <p>
1891 The above information specifically covers generic tunnel option 0, but
1892 Open vSwitch supports 64 options, numbered 0 through 63, whose
1893 NXM field numbers are 40 through 103.
1894 </p>
1895
1896 <p>
1897 These fields provide OpenFlow access to the generic type-length-value
1898 options defined by the Geneve tunneling protocol or other protocols
1899 with options in the same TLV format as Geneve options. Each of these
1900 options has the following wire format:
1901 </p>
1902
1903 <diagram>
1904 <header name="header">
1905 <bits name="class" above="16" width="0.6"/>
1906 <bits name="type" above="8" width="0.5"/>
1907 <bits name="res" above="3" below="0" width="0.25"/>
1908 <bits name="length" above="5" width="0.4"/>
1909 </header>
1910 <nospace/>
1911 <header name="body">
1912 <bits name="value" above="4×(length - 1) bytes" width="1.7"/>
1913 </header>
1914 </diagram>
1915
1916 <p>
1917 Taken together, the <code>class</code> and <code>type</code> in the
1918 option format mean that there are about 16 million distinct kinds of
1919 TLV options, too many to give individual OXM code points. Thus, Open
1920 vSwitch requires the user to define the TLV options of interest, by
1921 binding up to 64 TLV options to generic tunnel option NXM code points.
1922 Each option may have up to 124 bytes in its body, the maximum allowed
1923 by the TLV format, but bound options may total at most 252 bytes of
1924 body.
1925 </p>
1926
1927 <p>
1928 Open vSwitch extensions to the OpenFlow protocol bind TLV options to
1929 NXM code points. The <code>ovs-ofctl</code>(8) program offers one way
1930 to use these extensions, e.g. to configure a mapping from a TLV option
1931 with <code>class</code> <code>0xffff</code>, <code>type</code>
1932 <code>0</code>, and a body length of 4 bytes:
1933 </p>
1934
1935 <pre>
1936 ovs-ofctl add-tlv-map br0 "{class=0xffff,type=0,len=4}->tun_metadata0"
1937 </pre>
1938
1939 <p>
1940 Once a TLV option is properly bound, it can be accessed and modified
1941 like any other field, e.g. to send packets that have value 1234 for the
1942 option described above to the controller:
1943 </p>
1944
1945 <pre>
1946 ovs-ofctl add-flow br0 tun_metadata0=1234,actions=controller
1947 </pre>
1948
1949 <p>
1950 An option not received or not bound is matched as all zeros.
1951 </p>
1952 </field>
1953 <!--- XXX need a way to define a range of OXMs -->
1954 <field id="MFF_TUN_METADATA1" title="Generic Tunnel Option 1" hidden="yes"/>
1955 <field id="MFF_TUN_METADATA2" title="Generic Tunnel Option 2" hidden="yes"/>
1956 <field id="MFF_TUN_METADATA3" title="Generic Tunnel Option 3" hidden="yes"/>
1957 <field id="MFF_TUN_METADATA4" title="Generic Tunnel Option 4" hidden="yes"/>
1958 <field id="MFF_TUN_METADATA5" title="Generic Tunnel Option 5" hidden="yes"/>
1959 <field id="MFF_TUN_METADATA6" title="Generic Tunnel Option 6" hidden="yes"/>
1960 <field id="MFF_TUN_METADATA7" title="Generic Tunnel Option 7" hidden="yes"/>
1961 <field id="MFF_TUN_METADATA8" title="Generic Tunnel Option 8" hidden="yes"/>
1962 <field id="MFF_TUN_METADATA9" title="Generic Tunnel Option 9" hidden="yes"/>
1963 <field id="MFF_TUN_METADATA10" title="Generic Tunnel Option 10" hidden="yes"/>
1964 <field id="MFF_TUN_METADATA11" title="Generic Tunnel Option 11" hidden="yes"/>
1965 <field id="MFF_TUN_METADATA12" title="Generic Tunnel Option 12" hidden="yes"/>
1966 <field id="MFF_TUN_METADATA13" title="Generic Tunnel Option 13" hidden="yes"/>
1967 <field id="MFF_TUN_METADATA14" title="Generic Tunnel Option 14" hidden="yes"/>
1968 <field id="MFF_TUN_METADATA15" title="Generic Tunnel Option 15" hidden="yes"/>
1969 <field id="MFF_TUN_METADATA16" title="Generic Tunnel Option 16" hidden="yes"/>
1970 <field id="MFF_TUN_METADATA17" title="Generic Tunnel Option 17" hidden="yes"/>
1971 <field id="MFF_TUN_METADATA18" title="Generic Tunnel Option 18" hidden="yes"/>
1972 <field id="MFF_TUN_METADATA19" title="Generic Tunnel Option 19" hidden="yes"/>
1973 <field id="MFF_TUN_METADATA20" title="Generic Tunnel Option 20" hidden="yes"/>
1974 <field id="MFF_TUN_METADATA21" title="Generic Tunnel Option 21" hidden="yes"/>
1975 <field id="MFF_TUN_METADATA22" title="Generic Tunnel Option 22" hidden="yes"/>
1976 <field id="MFF_TUN_METADATA23" title="Generic Tunnel Option 23" hidden="yes"/>
1977 <field id="MFF_TUN_METADATA24" title="Generic Tunnel Option 24" hidden="yes"/>
1978 <field id="MFF_TUN_METADATA25" title="Generic Tunnel Option 25" hidden="yes"/>
1979 <field id="MFF_TUN_METADATA26" title="Generic Tunnel Option 26" hidden="yes"/>
1980 <field id="MFF_TUN_METADATA27" title="Generic Tunnel Option 27" hidden="yes"/>
1981 <field id="MFF_TUN_METADATA28" title="Generic Tunnel Option 28" hidden="yes"/>
1982 <field id="MFF_TUN_METADATA29" title="Generic Tunnel Option 29" hidden="yes"/>
1983 <field id="MFF_TUN_METADATA30" title="Generic Tunnel Option 30" hidden="yes"/>
1984 <field id="MFF_TUN_METADATA31" title="Generic Tunnel Option 31" hidden="yes"/>
1985 <field id="MFF_TUN_METADATA32" title="Generic Tunnel Option 32" hidden="yes"/>
1986 <field id="MFF_TUN_METADATA33" title="Generic Tunnel Option 33" hidden="yes"/>
1987 <field id="MFF_TUN_METADATA34" title="Generic Tunnel Option 34" hidden="yes"/>
1988 <field id="MFF_TUN_METADATA35" title="Generic Tunnel Option 35" hidden="yes"/>
1989 <field id="MFF_TUN_METADATA36" title="Generic Tunnel Option 36" hidden="yes"/>
1990 <field id="MFF_TUN_METADATA37" title="Generic Tunnel Option 37" hidden="yes"/>
1991 <field id="MFF_TUN_METADATA38" title="Generic Tunnel Option 38" hidden="yes"/>
1992 <field id="MFF_TUN_METADATA39" title="Generic Tunnel Option 39" hidden="yes"/>
1993 <field id="MFF_TUN_METADATA40" title="Generic Tunnel Option 40" hidden="yes"/>
1994 <field id="MFF_TUN_METADATA41" title="Generic Tunnel Option 41" hidden="yes"/>
1995 <field id="MFF_TUN_METADATA42" title="Generic Tunnel Option 42" hidden="yes"/>
1996 <field id="MFF_TUN_METADATA43" title="Generic Tunnel Option 43" hidden="yes"/>
1997 <field id="MFF_TUN_METADATA44" title="Generic Tunnel Option 44" hidden="yes"/>
1998 <field id="MFF_TUN_METADATA45" title="Generic Tunnel Option 45" hidden="yes"/>
1999 <field id="MFF_TUN_METADATA46" title="Generic Tunnel Option 46" hidden="yes"/>
2000 <field id="MFF_TUN_METADATA47" title="Generic Tunnel Option 47" hidden="yes"/>
2001 <field id="MFF_TUN_METADATA48" title="Generic Tunnel Option 48" hidden="yes"/>
2002 <field id="MFF_TUN_METADATA49" title="Generic Tunnel Option 49" hidden="yes"/>
2003 <field id="MFF_TUN_METADATA50" title="Generic Tunnel Option 50" hidden="yes"/>
2004 <field id="MFF_TUN_METADATA51" title="Generic Tunnel Option 51" hidden="yes"/>
2005 <field id="MFF_TUN_METADATA52" title="Generic Tunnel Option 52" hidden="yes"/>
2006 <field id="MFF_TUN_METADATA53" title="Generic Tunnel Option 53" hidden="yes"/>
2007 <field id="MFF_TUN_METADATA54" title="Generic Tunnel Option 54" hidden="yes"/>
2008 <field id="MFF_TUN_METADATA55" title="Generic Tunnel Option 55" hidden="yes"/>
2009 <field id="MFF_TUN_METADATA56" title="Generic Tunnel Option 56" hidden="yes"/>
2010 <field id="MFF_TUN_METADATA57" title="Generic Tunnel Option 57" hidden="yes"/>
2011 <field id="MFF_TUN_METADATA58" title="Generic Tunnel Option 58" hidden="yes"/>
2012 <field id="MFF_TUN_METADATA59" title="Generic Tunnel Option 59" hidden="yes"/>
2013 <field id="MFF_TUN_METADATA60" title="Generic Tunnel Option 60" hidden="yes"/>
2014 <field id="MFF_TUN_METADATA61" title="Generic Tunnel Option 61" hidden="yes"/>
2015 <field id="MFF_TUN_METADATA62" title="Generic Tunnel Option 62" hidden="yes"/>
2016 <field id="MFF_TUN_METADATA63" title="Generic Tunnel Option 63" hidden="yes"/>
2017
2018 <field id="MFF_TUN_FLAGS" title="Tunnel Flags">
2019 <p>
2020 Flags indicating various aspects of the tunnel encapsulation.
2021 </p>
2022
2023 <p>
2024 Matches on this field are most conveniently written in terms of
2025 symbolic names (given in the diagram below), each preceded by either
2026 <code>+</code> for a flag that must be set, or <code>-</code> for a
2027 flag that must be unset, without any other delimiters between the
2028 flags. Flags not mentioned are wildcarded. For example,
2029 <code>tun_flags=+oam</code> matches only OAM packets. Matches can also
2030 be written as <code><var>flags</var>/<var>mask</var></code>, where
2031 <var>flags</var> and <var>mask</var> are 16-bit numbers in decimal or
2032 in hexadecimal prefixed by <code>0x</code>.
2033 </p>
2034
2035 <p>
2036 Currently, only one flag is defined:
2037 </p>
2038
2039 <dl>
2040 <dt><code>oam</code></dt>
2041 <dd>
2042 The tunnel protocol indicated that this is an OAM (Operations and
2043 Management) control packet.
2044 </dd>
2045 </dl>
2046
2047 <p>
2048 The switch may reject matches against unknown flags.
2049 </p>
2050
2051 <p>
2052 Newer versions of Open vSwitch may introduce additional flags with new
2053 meanings. It is therefore not recommended to use an exact match on
2054 this field since the behavior of these new flags is unknown and should
2055 be ignored.
2056 </p>
2057
2058 <p>
2059 For non-tunneled packets, the value is 0.
2060 </p>
2061 </field>
2062
2063 <!-- Open vSwitch uses the following fields internally, but it
2064 does not expose them to the user via OpenFlow, so we do not
2065 document them. -->
2066 <field id="MFF_TUN_TTL" title="Tunnel IPv4 Time-to-Live" internal="yes"/>
2067 <field id="MFF_TUN_TOS" title="Tunnel IPv4 Type of Service" internal="yes"/>
2068 </group>
2069
2070 <group title="Metadata">
2071 <p>
2072 These fields relate to the origin or treatment of a packet, but
2073 they are not extracted from the packet data itself.
2074 </p>
2075
2076 <field id="MFF_IN_PORT" title="Ingress Port">
2077 <p>
2078 The OpenFlow port on which the packet being processed arrived.
2079 This is a 16-bit field that holds an OpenFlow 1.0 port number.
2080 For receiving a packet, the only values that appear in this
2081 field are:
2082 </p>
2083
2084 <dl>
2085 <dt>1 through <code>0xfeff</code> (65,279), inclusive.</dt>
2086 <dd>
2087 Conventional OpenFlow port numbers.
2088 </dd>
2089
2090 <dt><code>OFPP_LOCAL</code> (<code>0xfffe</code> or 65,534).</dt>
2091 <dd>
2092 <p>
2093 The ``local'' port, which in Open vSwitch is always named
2094 the same as the bridge itself. This represents a
2095 connection between the switch and the local TCP/IP stack.
2096 This port is where an IP address is most commonly
2097 configured on an Open vSwitch switch.
2098 </p>
2099
2100 <p>
2101 OpenFlow does not require a switch to have a local port,
2102 but all existing versions of Open vSwitch have always
2103 included a local port. <b>Future Directions:</b> Future
2104 versions of Open vSwitch might be able to optionally omit
2105 the local port, if someone submits code to implement such
2106 a feature.
2107 </p>
2108 </dd>
2109
2110 <dt><code>OFPP_NONE</code> (OpenFlow 1.0) or <code>OFPP_ANY</code> (OpenFlow 1.1+) (<code>0xffff</code> or 65,535).</dt>
2111 <dt><code>OFPP_CONTROLLER</code> (<code>0xfffd</code> or 65,533).</dt>
2112 <dd>
2113 <p>
2114 When a controller injects a packet into an OpenFlow switch
2115 with a ``packet-out'' request, it can specify one of these
2116 ingress ports to indicate that the packet was generated
2117 internally rather than having been received on some port.
2118 </p>
2119
2120 <p>
2121 OpenFlow 1.0 specified <code>OFPP_NONE</code> for this
2122 purpose. Despite that, some controllers used
2123 <code>OFPP_CONTROLLER</code>, and some switches only
2124 accepted <code>OFPP_CONTROLLER</code>, so OpenFlow 1.0.2
2125 required support for both ports. OpenFlow 1.1 and later
2126 were more clearly drafted to allow only
2127 <code>OFPP_CONTROLLER</code>. For maximum compatibility,
2128 Open vSwitch allows both ports with all OpenFlow versions.
2129 </p>
2130 </dd>
2131 </dl>
2132
2133 <p>
2134 Values not mentioned above will never appear when receiving a
2135 packet, including the following notable values:
2136 </p>
2137
2138 <dl>
2139 <dt>0</dt>
2140 <dd>
2141 Zero is not a valid OpenFlow port number.
2142 </dd>
2143
2144 <dt><code>OFPP_MAX</code> (<code>0xff00</code> or 65,280).</dt>
2145 <dd>
2146 This value has only been clearly specified as a valid port
2147 number as of OpenFlow 1.3.3. Before that, its status was
2148 unclear, and so Open vSwitch has never allowed
2149 <code>OFPP_MAX</code> to be used as a port number, so
2150 packets will never be received on this port. (Other
2151 OpenFlow switches, of course, might use it.)
2152 </dd>
2153
2154 <dt><code>OFPP_UNSET</code> (<code>0xfff7</code> or 65,527)</dt>
2155 <dt><code>OFPP_IN_PORT</code> (<code>0xfff8</code> or 65,528)</dt>
2156 <dt><code>OFPP_TABLE</code> (<code>0xfff9</code> or 65,529)</dt>
2157 <dt><code>OFPP_NORMAL</code> (<code>0xfffa</code> or 65,530)</dt>
2158 <dt><code>OFPP_FLOOD</code> (<code>0xfffb</code> or 65,531)</dt>
2159 <dt><code>OFPP_ALL</code> (<code>0xfffc</code> or 65,532)</dt>
2160 <dd>
2161 <p>
2162 These port numbers are used only in output actions and never
2163 appear as ingress ports.
2164 </p>
2165
2166 <p>
2167 Most of these port numbers were defined in OpenFlow 1.0, but
2168 <code>OFPP_UNSET</code> was only introduced in OpenFlow 1.5.
2169 </p>
2170 </dd>
2171 </dl>
2172
2173 <p>
2174 Values that will never appear when receiving a packet may
2175 still be matched against in the flow table. There are still
2176 circumstances in which those flows can be matched:
2177 </p>
2178
2179 <ul>
2180 <li>
2181 The <code>resubmit</code> Open vSwitch extension action allows a
2182 flow table lookup with an arbitrary ingress port.
2183 </li>
2184
2185 <li>
2186 An action that modifies the ingress port field (see below),
2187 such as e.g. <code>load</code> or <code>set_field</code>,
2188 followed by an action or instruction that performs another
2189 flow table lookup, such as <code>resubmit</code> or
2190 <code>goto_table</code>.
2191 </li>
2192 </ul>
2193
2194 <p>
2195 This field is heavily used for matching in OpenFlow tables,
2196 but for packet egress, it has only very limited roles:
2197 </p>
2198
2199 <ul>
2200 <li>
2201 <p>
2202 OpenFlow requires suppressing output actions to <ref
2203 field="in_port"/>. That is, the following two flows both drop all
2204 packets that arrive on port 1:
2205 </p>
2206
2207 <pre>
2208 in_port=1,actions=1
2209 in_port=1,actions=drop
2210 </pre>
2211
2212 <p>
2213 (This behavior is occasionally useful for flooding to a
2214 subset of ports. Specifying <code>actions=1,2,3,4</code>,
2215 for example, outputs to ports 1, 2, 3, and 4, omitting the
2216 ingress port.)
2217 </p>
2218 </li>
2219
2220 <li>
2221 OpenFlow has a special port <code>OFPP_IN_PORT</code> (with
2222 value 0xfff8) that outputs to the ingress port. For example,
2223 in a switch that has four ports numbered 1 through 4,
2224 <code>actions=1,2,3,4,in_port</code> outputs to ports 1, 2,
2225 3, and 4, including the ingress port.
2226 </li>
2227 </ul>
2228
2229 <p>
2230 Because the ingress port field has so little influence on packet
2231 processing, it does not ordinarily make sense to modify the
2232 ingress port field. The field is writable only to support the
2233 occasional use case where the ingress port's roles in packet
2234 egress, described above, become troublesome. For example,
2235 <code>actions=load:0-&gt;NXM_OF_IN_PORT[],output:123</code>
2236 will output to port 123 regardless of whether it is in the
2237 ingress port. If the ingress port is important, then one may save
2238 and restore it on the stack:
2239 </p>
2240
2241 <pre>
2242 actions=push:NXM_OF_IN_PORT[],load:0->NXM_OF_IN_PORT[],output:123,pop:NXM_OF_IN_PORT[]
2243 </pre>
2244
2245 <p>
2246 or, in Open vSwitch 2.7 or later, use the <code>clone</code> action to
2247 save and restore it:
2248 </p>
2249
2250 <pre>
2251 actions=clone(load:0->NXM_OF_IN_PORT[],output:123)
2252 </pre>
2253
2254 <p>
2255 The ability to modify the ingress port is an Open vSwitch
2256 extension to OpenFlow.
2257 </p>
2258 </field>
2259
2260 <field id="MFF_IN_PORT_OXM" title="OXM Ingress Port">
2261 <p>
2262 OpenFlow 1.1 and later use a 32-bit port number, so this field
2263 supplies a 32-bit view of the ingress port. Current versions of
2264 Open vSwitch support only a 16-bit range of ports:
2265 </p>
2266
2267 <ul>
2268 <li>
2269 OpenFlow 1.0 ports <code>0x0000</code> to
2270 <code>0xfeff</code>, inclusive, map to OpenFlow 1.1
2271 port numbers with the same values.
2272 </li>
2273
2274 <li>
2275 OpenFlow 1.0 ports <code>0xff00</code> to
2276 <code>0xffff</code>, inclusive, map to OpenFlow 1.1 port
2277 numbers <code>0xffffff00</code> to <code>0xffffffff</code>.
2278 </li>
2279
2280 <li>
2281 OpenFlow 1.1 ports <code>0x0000ff00</code> to
2282 <code>0xfffffeff</code> are not mapped and not supported.
2283 </li>
2284 </ul>
2285
2286 <p>
2287 <ref field="in_port"/> and <ref field="in_port_oxm"/> are two views of
2288 the same information, so all of the comments on <ref field="in_port"/>
2289 apply to <ref field="in_port_oxm"/> too. Modifying <ref
2290 field="in_port"/> changes <ref field="in_port_oxm"/>, and vice versa.
2291 </p>
2292
2293 <p>
2294 Setting <ref field="in_port_oxm"/> to an unsupported value yields
2295 unspecified behavior.
2296 </p>
2297 </field>
2298
2299 <field id="MFF_SKB_PRIORITY" title="Output Queue">
2300 <p>
2301 <b>Future Directions:</b> Open vSwitch implements the output queue as a
2302 field, but does not currently expose it through OXM or NXM for matching
2303 purposes. If this turns out to be a useful feature, it could be
2304 implemented in future versions. Only the <code>set_queue</code>,
2305 <code>enqueue</code>, and <code>pop_queue</code> actions currently
2306 influence the output queue.
2307 </p>
2308
2309 <p>
2310 This field influences how packets in the flow will be queued,
2311 for quality of service (QoS) purposes, when they egress the
2312 switch. Its range of meaningful values, and their meanings,
2313 varies greatly from one OpenFlow implementation to another.
2314 Even within a single implementation, there is no guarantee
2315 that all OpenFlow ports have the same queues configured or
2316 that all OpenFlow ports in an implementation can be configured
2317 the same way queue-wise.
2318 </p>
2319
2320 <p>
2321 Configuring queues on OpenFlow is not well standardized. On
2322 Linux, Open vSwitch supports queue configuration via OVSDB,
2323 specifically the <code>QoS</code> and <code>Queue</code>
2324 tables (see <code>ovs-vswitchd.conf.db(5)</code> for details).
2325 Ports of Open vSwitch to other platforms might require queue
2326 configuration through some separate protocol (such as a CLI).
2327 Even on Linux, Open vSwitch exposes only a fraction of the
2328 kernel's queuing features through OVSDB, so advanced or
2329 unusual uses might require use of separate utilities
2330 (e.g. <code>tc</code>). OpenFlow switches other than Open
2331 vSwitch might use OF-CONFIG or any of the configuration
2332 methods mentioned above. Finally, some OpenFlow switches have
2333 a fixed number of fixed-function queues (e.g. eight queues
2334 with strictly defined priorities) and others do not support
2335 any control over queuing.
2336 </p>
2337
2338 <p>
2339 The only output queue that all OpenFlow implementations must
2340 support is zero, to identify a default queue, whose properties
2341 are implementation-defined. Outputting a packet to a queue
2342 that does not exist on the output port yields unpredictable
2343 behavior: among the possibilities are that the packet might be
2344 dropped or transmitted with a very high or very low priority.
2345 </p>
2346
2347 <p>
2348 OpenFlow 1.0 only allowed output queues to be specified as part of an
2349 <code>enqueue</code> action that specified both a queue and an output
2350 port. That is, OpenFlow 1.0 treats the queue as an argument to an
2351 action, not as a field.
2352 </p>
2353
2354 <p>
2355 To increase flexibility, OpenFlow 1.1 added an action to set the output
2356 queue. This model was carried forward, without change, through
2357 OpenFlow 1.5.
2358 </p>
2359
2360 <p>
2361 Open vSwitch implements the native queuing model of each
2362 OpenFlow version it supports. Open vSwitch also includes an
2363 extension for setting the output queue as an action in
2364 OpenFlow 1.0.
2365 </p>
2366
2367 <p>
2368 When a packet ingresses into an OpenFlow switch, the output
2369 queue is ordinarily set to 0, indicating the default queue.
2370 However, Open vSwitch supports various ways to forward a
2371 packet from one OpenFlow switch to another within a single
2372 host. In these cases, Open vSwitch maintains the output queue
2373 across the forwarding step. For example:
2374 </p>
2375
2376 <ul>
2377 <li>
2378 A hop across an Open vSwitch ``patch port'' (which does not
2379 actually involve queuing) preserves the output queue.
2380 </li>
2381
2382 <li>
2383 <p>
2384 When a flow sets the output queue then outputs to an
2385 OpenFlow tunnel port, the encapsulation preserves the
2386 output queue. If the kernel TCP/IP stack routes the
2387 encapsulated packet directly to a physical interface, then
2388 that output honors the output queue. Alternatively, if
2389 the kernel routes the encapsulated packet to another Open
2390 vSwitch bridge, then the output queue set previously
2391 becomes the initial output queue on ingress to the second
2392 bridge and will thus be used for further output actions
2393 (unless overridden by a new ``set queue'' action).
2394 </p>
2395
2396 <p>
2397 (This description reflects the current behavior of Open
2398 vSwitch on Linux. This behavior relies on details of the
2399 Linux TCP/IP stack. It could be difficult to make ports
2400 to other operating systems behave the same way.)
2401 </p>
2402 </li>
2403 </ul>
2404 </field>
2405
2406 <field id="MFF_PKT_MARK" title="Packet Mark">
2407 <p>
2408 Packet mark comes to Open vSwitch from the Linux kernel, in
2409 which the <code>sk_buff</code> data structure that represents
2410 a packet contains a 32-bit member named <code>skb_mark</code>.
2411 The value of <code>skb_mark</code> propagates along with the
2412 packet it accompanies wherever the packet goes in the kernel.
2413 It has no predefined semantics but various kernel-user
2414 interfaces can set and match on it, which makes it suitable
2415 for ``marking'' packets at one point in their handling and
2416 then acting on the mark later. With <code>iptables</code>,
2417 for example, one can mark some traffic specially at ingress
2418 and then handle that traffic differently at egress based on
2419 the marked value.
2420 </p>
2421
2422 <p>
2423 Packet mark is an attempt at a generalization of the
2424 <code>skb_mark</code> concept beyond Linux, at least through more
2425 generic naming. Like <ref field="skb_priority"/>, packet mark is
2426 preserved across forwarding steps within a machine. Unlike <ref
2427 field="skb_priority"/>, packet mark has no direct effect on packet
2428 forwarding: the value set in packet mark does not matter unless some
2429 later OpenFlow table or switch matches on packet mark, or unless the
2430 packet passes through some other kernel subsystem that has been
2431 configured to interpret packet mark in specific ways, e.g. through
2432 <code>iptables</code> configuration mentioned above.
2433 </p>
2434
2435 <p>
2436 Preserving packet mark across kernel forwarding steps relies
2437 heavily on kernel support, which ports to non-Linux operating
2438 systems may not have. Regardless of operating system support,
2439 Open vSwitch supports packet mark within a single bridge and
2440 across patch ports.
2441 </p>
2442
2443 <p>
2444 The value of packet mark when a packet ingresses into the
2445 first Open vSwich bridge is typically zero, but it could be
2446 nonzero if its value was previously set by some kernel
2447 subsystem.
2448 </p>
2449 </field>
2450
2451 <field id="MFF_ACTSET_OUTPUT" title="Action Set Output Port">
2452 <p>
2453 Holds the output port currently in the OpenFlow action set (i.e. from
2454 an <code>output</code> action within a <code>write_actions</code>
2455 instruction). Its value is an OpenFlow port number. If there is no
2456 output port in the OpenFlow action set, or if the output port will be
2457 ignored (e.g. because there is an output group in the OpenFlow action
2458 set), then the value will be <code>OFPP_UNSET</code>.
2459 </p>
2460
2461 <p>
2462 Open vSwitch allows any table to match this field. OpenFlow, however,
2463 only requires this field to be matchable from within an OpenFlow egress
2464 table (a feature that Open vSwitch does not yet implement).
2465 </p>
2466 </field>
2467
2468 <field id="MFF_DP_HASH" title="Datapath Hash" internal="yes"/>
2469 <field id="MFF_RECIRC_ID" title="Datapath Recirculation ID" internal="yes"/>
2470
2471 <field id="MFF_PACKET_TYPE" title="Packet Type">
2472 <p>
2473 The type of the packet in the format specified in OpenFlow 1.5:
2474 </p>
2475
2476 <diagram>
2477 <header name="Packet type">
2478 <bits name="ns" above="16" width=".75"/>
2479 <bits name="ns_type" above="16" width=".75"/>
2480 </header>
2481 <dots/>
2482 </diagram>
2483
2484 <p>
2485 The upper 16 bits, <var>ns</var>, are a namespace. The meaning of
2486 <var>ns_type</var> depends on the namespace. The packet type field is
2487 specified and displayed in the format
2488 <code>(<var>ns</var>,<var>ns_type</var>)</code>.
2489 </p>
2490
2491 <p>
2492 Open vSwitch currently supports the following classes of packet types
2493 for matching:
2494 <dl>
2495 <dt><code>(0,0)</code></dt>
2496 <dd>Ethernet.</dd>
2497 <dt><code>(1,<var>ethertype</var>)</code></dt>
2498 <dd>
2499 <p>
2500 The specified <var>ethertype</var>. Open vSwitch can forward
2501 packets with any <var>ethertype</var>, but it can only match on
2502 and process data fields for the following supported packet types:
2503 </p>
2504 <dl>
2505 <dt><code>(1,0x800)</code></dt> <dd>IPv4</dd>
2506 <dt><code>(1,0x806)</code></dt> <dd>ARP</dd>
2507 <dt><code>(1,0x86dd)</code></dt> <dd>IPv6</dd>
2508 <dt><code>(1,0x8847)</code></dt> <dd>MPLS</dd>
2509 <dt><code>(1,0x8848)</code></dt> <dd>MPLS multicast</dd>
2510 <dt><code>(1,0x8035)</code></dt> <dd>RARP</dd>
2511 <dt><code>(1,0x894f)</code></dt> <dd>NSH</dd>
2512 </dl>
2513 </dd>
2514 </dl>
2515 </p>
2516
2517 <p>
2518 Consider the distinction between a packet with <code>packet_type=(0,0),
2519 dl_type=0x800</code> and one with <code>packet_type=(1,0x800)</code>.
2520 The former is an Ethernet frame that contains an IPv4 packet, like
2521 this:
2522 </p>
2523
2524 <diagram>
2525 <header name="Ethernet">
2526 <bits name="dst" above="48" width="0.4"/>
2527 <bits name="src" above="48" width="0.4"/>
2528 <bits name="type" above="16" below="0x800" width="0.4"/>
2529 </header>
2530 <header name="IPv4">
2531 <bits name="..." width="0.4"/>
2532 <bits name="proto" above="8" width="0.4"/>
2533 <bits name="src" above="32" width="0.4"/>
2534 <bits name="dst" above="32" width="0.4"/>
2535 </header>
2536 <dots/>
2537 </diagram>
2538
2539 <p>
2540 The latter is an IPv4 packet not encapsulated inside any outer frame,
2541 like this:
2542 </p>
2543
2544 <diagram>
2545 <header name="IPv4">
2546 <bits name="..." width="0.4"/>
2547 <bits name="proto" above="8" width="0.4"/>
2548 <bits name="src" above="32" width="0.4"/>
2549 <bits name="dst" above="32" width="0.4"/>
2550 </header>
2551 <dots/>
2552 </diagram>
2553
2554 <p>
2555 Matching on <ref field="packet_type"/> is a pre-requisite for matching
2556 on any data field, but for backward compatibility, when a match on a
2557 data field is present without a <ref field="packet_type"/> match, Open
2558 vSwitch acts as though a match on <code>(0,0)</code> (Ethernet) had
2559 been supplied. Similarly, when Open vSwitch sends flow match
2560 information to a controller, e.g. in a reply to a request to dump the
2561 flow table, Open vSwitch omits a match on packet type (0,0) if it would
2562 be implied by a data field match.
2563 </p>
2564 </field>
2565
2566 </group>
2567
2568 <group title="Connection Tracking">
2569 <p>
2570 Open vSwitch supports ``connection tracking,'' which allows
2571 bidirectional streams of packets to be statefully grouped into
2572 connections. Open vSwitch connection tracking, for example, identifies
2573 the patterns of TCP packets that indicates a successfully initiated
2574 connection, as well as those that indicate that a connection has been
2575 torn down. Open vSwitch connection tracking can also identify related
2576 connections, such as FTP data connections spawned from FTP control
2577 connections.
2578 </p>
2579
2580 <p>
2581 An individual packet passing through the pipeline may be in one of two
2582 states, ``untracked'' or ``tracked,'' which may be distinguished via the
2583 ``trk'' flag in <ref field="ct_state"/>. A packet is
2584 <dfn>untracked</dfn> at the beginning of the Open vSwitch pipeline and
2585 continues to be untracked until the pipeline invokes the <code>ct</code>
2586 action. The connection tracking fields are all zeroes in an untracked
2587 packet. When a flow in the Open vSwitch pipeline invokes the
2588 <code>ct</code> action, the action initializes the connection tracking
2589 fields and the packet becomes <dfn>tracked</dfn> for the remainder of its
2590 processing.
2591 </p>
2592
2593 <p>
2594 The connection tracker stores connection state in an internal table, but
2595 it only adds a new entry to this table when a <code>ct</code> action for
2596 a new connection invokes <code>ct</code> with the <code>commit</code>
2597 parameter. For a given connection, when a pipeline has executed
2598 <code>ct</code>, but not yet with <code>commit</code>, the connection is
2599 said to be <dfn>uncommitted</dfn>. State for an uncommitted connection
2600 is ephemeral and does not persist past the end of the pipeline, so some
2601 features are only available to committed connections. A connection would
2602 typically be left uncommitted as a way to drop its packets.
2603 </p>
2604
2605 <p>
2606 Connection tracking is an Open vSwitch extension to OpenFlow. Open
2607 vSwitch 2.5 added the initial support for connection tracking.
2608 Subsequent versions of Open vSwitch added many refinements and extensions
2609 to the initial support. Many of these capabilities depend on the Open
2610 vSwitch datapath rather than simply the userspace version. The
2611 <code>capabilities</code> column in the <code>Datapath</code> table (see
2612 <code>ovs-vswitchd.conf.db</code>(5)) reports the detailed capabilities
2613 of a particular Open vSwitch datapath.
2614 </p>
2615
2616 <field id="MFF_CT_STATE" title="Connection Tracking State">
2617 <p>
2618 This field holds several flags that can be used to determine the state
2619 of the connection to which the packet belongs.
2620 </p>
2621
2622 <p>
2623 Matches on this field are most conveniently written in terms of
2624 symbolic names (listed below), each preceded by either <code>+</code>
2625 for a flag that must be set, or <code>-</code> for a flag that must be
2626 unset, without any other delimiters between the flags. Flags not
2627 mentioned are wildcarded. For example,
2628 <code>tcp,ct_state=+trk-new</code> matches TCP packets that have been
2629 run through the connection tracker and do not establish a new
2630 connection. Matches can also be written as
2631 <code><var>flags</var>/<var>mask</var></code>, where <var>flags</var>
2632 and <var>mask</var> are 32-bit numbers in decimal or in hexadecimal
2633 prefixed by <code>0x</code>.
2634 </p>
2635
2636 <p>
2637 The following flags are defined:
2638 </p>
2639
2640 <dl>
2641 <dt><code>new</code> (0x01)</dt>
2642 <dd>
2643 A new connection. Set to 1 if this is an uncommitted connection.
2644 </dd>
2645
2646 <dt><code>est</code> (0x02)</dt>
2647 <dd>
2648 Part of an existing connection. Set to 1 if packets of a committed
2649 connection have been seen by conntrack from both directions.
2650 </dd>
2651
2652 <dt><code>rel</code> (0x04)</dt>
2653 <dd>
2654 <p>
2655 Related to an existing connection, e.g. an ICMP ``destination
2656 unreachable'' message or an FTP data connections. This flag will
2657 only be 1 if the connection to which this one is related is
2658 committed.
2659 </p>
2660
2661 <p>
2662 Connections identified as <code>rel</code> are separate from the
2663 originating connection and must be committed separately. All
2664 packets for a related connection will have the <code>rel</code>
2665 flag set, not just the initial packet.
2666 </p>
2667 </dd>
2668
2669 <dt><code>rpl</code> (0x08)</dt>
2670 <dd>
2671 This packet is in the reply direction, meaning that it is in the
2672 opposite direction from the packet that initiated the connection.
2673 This flag will only be 1 if the connection is committed.
2674 </dd>
2675
2676 <dt><code>inv</code> (0x10)</dt>
2677 <dd>
2678 <p>
2679 The state is invalid, meaning that the connection tracker couldn't
2680 identify the connection. This flag is a catch-all for problems
2681 in the connection or the connection tracker, such as:
2682 </p>
2683
2684 <ul>
2685 <li>
2686 L3/L4 protocol handler is not loaded/unavailable. With the Linux
2687 kernel datapath, this may mean that the
2688 <code>nf_conntrack_ipv4</code> or <code>nf_conntrack_ipv6</code>
2689 modules are not loaded.
2690 </li>
2691
2692 <li>
2693 L3/L4 protocol handler determines that the packet is malformed.
2694 </li>
2695
2696 <li>
2697 Packets are unexpected length for protocol.
2698 </li>
2699 </ul>
2700 </dd>
2701
2702 <dt><code>trk</code> (0x20)</dt>
2703 <dd>
2704 This packet is tracked, meaning that it has previously traversed the
2705 connection tracker. If this flag is not set, then no other flags
2706 will be set. If this flag is set, then the packet is tracked and
2707 other flags may also be set.
2708 </dd>
2709
2710 <dt><code>snat</code> (0x40)</dt>
2711 <dd>
2712 This packet was transformed by source address/port translation by a
2713 preceding <code>ct</code> action. Open vSwitch 2.6 added this flag.
2714 </dd>
2715
2716 <dt><code>dnat</code> (0x80)</dt>
2717 <dd>
2718 This packet was transformed by destination address/port translation
2719 by a preceding <code>ct</code> action. Open vSwitch 2.6 added this
2720 flag.
2721 </dd>
2722 </dl>
2723
2724 <p>
2725 There are additional constraints on these flags, listed in decreasing
2726 order of precedence below:
2727 </p>
2728
2729 <ol>
2730 <li>
2731 If <code>trk</code> is unset, no other flags are set.
2732 </li>
2733
2734 <li>
2735 If <code>trk</code> is set, one or more other flags may be set.
2736 </li>
2737
2738 <li>
2739 If <code>inv</code> is set, only the <code>trk</code> flag is also
2740 set.
2741 </li>
2742
2743 <li>
2744 <code>new</code> and <code>est</code> are mutually exclusive.
2745 </li>
2746
2747 <li>
2748 <code>new</code> and <code>rpl</code> are mutually exclusive.
2749 </li>
2750
2751 <li>
2752 <code>rel</code> may be set in conjunction with any other flags.
2753 </li>
2754 </ol>
2755
2756 <p>
2757 Future versions of Open vSwitch may define new flags.
2758 </p>
2759 </field>
2760
2761 <field id="MFF_CT_ZONE" title="Connection Tracking Zone">
2762 A connection tracking zone, the zone value passed to the most recent
2763 <code>ct</code> action. Each zone is an independent connection tracking
2764 context, so tracking the same packet in multiple contexts requires using
2765 the <code>ct</code> action multiple times.
2766 </field>
2767
2768 <field id="MFF_CT_MARK" title="Connection Tracking Mark">
2769 The metadata committed, by an action within the <code>exec</code>
2770 parameter to the <code>ct</code> action, to the connection to which the
2771 current packet belongs.
2772 </field>
2773
2774 <field id="MFF_CT_LABEL" title="Connection Tracking Label">
2775 The label committed, by an action within the <code>exec</code>
2776 parameter to the <code>ct</code> action, to the connection to which the
2777 current packet belongs.
2778 </field>
2779
2780 <p>
2781 Open vSwitch 2.8 introduced the matching support for connection
2782 tracker original direction 5-tuple fields.
2783 </p>
2784
2785 <p>
2786 For non-committed non-related connections the conntrack original
2787 direction tuple fields always have the same values as the
2788 corresponding headers in the packet itself. For any other packets of
2789 a committed connection the conntrack original direction tuple fields
2790 reflect the values from that initial non-committed non-related packet,
2791 and thus may be different from the actual packet headers, as the
2792 actual packet headers may be in reverse direction (for reply packets),
2793 transformed by NAT (when <code>nat</code> option was applied to the
2794 connection), or be of different protocol (i.e., when an ICMP response
2795 is sent to an UDP packet). In case of related connections, e.g., an
2796 FTP data connection, the original direction tuple contains the
2797 original direction headers from the parent connection, e.g., an FTP
2798 control connection.
2799 </p>
2800
2801 <p>
2802 The following fields are populated by the <code>ct</code>
2803 action, and require a
2804 match to a valid connection tracking state as a prerequisite, in
2805 addition to the IP or IPv6 ethertype match. Examples of valid
2806 connection tracking state matches include <code>ct_state=+new</code>,
2807 <code>ct_state=+est</code>, <code>ct_state=+rel</code>, and
2808 <code>ct_state=+trk-inv</code>.
2809 </p>
2810
2811 <field id="MFF_CT_NW_SRC" title="Connection Tracking Original Direction IPv4 Source Address">
2812 Matches IPv4 conntrack original direction tuple source address.
2813 See the paragraphs above for general description to the
2814 conntrack original direction tuple. Introduced in Open vSwitch
2815 2.8.
2816 </field>
2817
2818 <field id="MFF_CT_NW_DST" title="Connection Tracking Original Direction IPv4 Destination Address">
2819 Matches IPv4 conntrack original direction tuple destination address.
2820 See the paragraphs above for general description to the
2821 conntrack original direction tuple. Introduced in Open vSwitch
2822 2.8.
2823 </field>
2824
2825 <field id="MFF_CT_IPV6_SRC" title="Connection Tracking Original Direction IPv6 Source Address">
2826 Matches IPv6 conntrack original direction tuple source address.
2827 See the paragraphs above for general description to the
2828 conntrack original direction tuple. Introduced in Open vSwitch
2829 2.8.
2830 </field>
2831
2832 <field id="MFF_CT_IPV6_DST" title="Connection Tracking Original Direction IPv6 Destination Address">
2833 Matches IPv6 conntrack original direction tuple destination address.
2834 See the paragraphs above for general description to the
2835 conntrack original direction tuple. Introduced in Open vSwitch
2836 2.8.
2837 </field>
2838
2839 <field id="MFF_CT_NW_PROTO" title="Connection Tracking Original Direction IP Protocol">
2840 Matches conntrack original direction tuple IP protocol type,
2841 which is specified as a decimal number between 0 and 255,
2842 inclusive (e.g. 1 to match ICMP packets or 6 to match TCP
2843 packets). In case of, for example, an ICMP response to an UDP
2844 packet, this may be different from the IP protocol type of the
2845 packet itself. See the paragraphs above for general description
2846 to the conntrack original direction tuple. Introduced in Open
2847 vSwitch 2.8.
2848 </field>
2849
2850 <field id="MFF_CT_TP_SRC" title="Connection Tracking Original Direction Transport Layer Source Port">
2851 Bitwise match on the conntrack original direction tuple
2852 transport source, when
2853 <code>MFF_CT_NW_PROTO</code> has value 6 for TCP, 17 for UDP, or
2854 132 for SCTP. When <code>MFF_CT_NW_PROTO</code> has value 1 for
2855 ICMP, or 58 for ICMPv6, the lower 8 bits of
2856 <code>MFF_CT_TP_SRC</code> matches the conntrack original
2857 direction ICMP type. See the paragraphs above for general
2858 description to the conntrack original direction
2859 tuple. Introduced in Open vSwitch 2.8.
2860 </field>
2861
2862 <field id="MFF_CT_TP_DST" title="Connection Tracking Original Direction Transport Layer Source Port">
2863 Bitwise match on the conntrack original direction tuple
2864 transport destination port, when
2865 <code>MFF_CT_NW_PROTO</code> has value 6 for TCP, 17 for UDP, or
2866 132 for SCTP. When <code>MFF_CT_NW_PROTO</code> has value 1 for
2867 ICMP, or 58 for ICMPv6, the lower 8 bits of
2868 <code>MFF_CT_TP_DST</code> matches the conntrack original
2869 direction ICMP code. See the paragraphs above for general
2870 description to the conntrack original direction
2871 tuple. Introduced in Open vSwitch 2.8.
2872 </field>
2873 </group>
2874
2875 <group title="Register">
2876 <p>
2877 These fields give an OpenFlow switch space for temporary storage while
2878 the pipeline is running. Whereas metadata fields can have a meaningful
2879 initial value and can persist across some hops across OpenFlow switches,
2880 registers are always initially 0 and their values never persist across
2881 inter-switch hops (not even across patch ports).
2882 </p>
2883
2884 <field id="MFF_METADATA" title="OpenFlow Metadata">
2885 <p>
2886 This field is the oldest standardized OpenFlow register field,
2887 introduced in OpenFlow 1.1. It was introduced to model the limited
2888 number of user-defined bits that some ASIC-based switches can carry
2889 through their pipelines. Because of hardware limitations, OpenFlow
2890 allows switches to support writing and masking only an
2891 implementation-defined subset of bits, even no bits at all. The Open
2892 vSwitch software switch always supports all 64 bits, but of course an
2893 Open vSwitch port to an ASIC would have the same restriction as the
2894 ASIC itself.
2895 </p>
2896
2897 <p>
2898 This field has an OXM code point, but OpenFlow 1.4 and earlier allow it
2899 to be modified only with a specialized instruction, not with a
2900 ``set-field'' action. OpenFlow 1.5 removes this restriction. Open
2901 vSwitch does not enforce this restriction, regardless of OpenFlow
2902 version.
2903 </p>
2904 </field>
2905
2906 <field id="MFF_REG0" title="Register 0">
2907 This is the first of several Open vSwitch registers, all of which have
2908 the same properties. Open vSwitch 1.1 introduced registers 0, 1, 2, and
2909 3, version 1.3 added register 4, version 1.7 added registers 5, 6, and 7,
2910 and version 2.6 added registers 8 through 15.
2911 </field>
2912 <!-- XXX series -->
2913 <field id="MFF_REG1" title="Register 1" hidden="yes"/>
2914 <field id="MFF_REG2" title="Register 2" hidden="yes"/>
2915 <field id="MFF_REG3" title="Register 3" hidden="yes"/>
2916 <field id="MFF_REG4" title="Register 4" hidden="yes"/>
2917 <field id="MFF_REG5" title="Register 5" hidden="yes"/>
2918 <field id="MFF_REG6" title="Register 6" hidden="yes"/>
2919 <field id="MFF_REG7" title="Register 7" hidden="yes"/>
2920 <field id="MFF_REG8" title="Register 8" hidden="yes"/>
2921 <field id="MFF_REG9" title="Register 9" hidden="yes"/>
2922 <field id="MFF_REG10" title="Register 10" hidden="yes"/>
2923 <field id="MFF_REG11" title="Register 11" hidden="yes"/>
2924 <field id="MFF_REG12" title="Register 12" hidden="yes"/>
2925 <field id="MFF_REG13" title="Register 13" hidden="yes"/>
2926 <field id="MFF_REG14" title="Register 14" hidden="yes"/>
2927 <field id="MFF_REG15" title="Register 15" hidden="yes"/>
2928
2929 <field id="MFF_XREG0" title="Extended Register 0">
2930 <p>
2931 This is the first of the registers introduced in OpenFlow 1.5.
2932 OpenFlow 1.5 calls these fields just the ``packet registers,'' but Open
2933 vSwitch already had 32-bit registers by that name, so Open vSwitch uses
2934 the name ``extended registers'' in an attempt to reduce confusion. The
2935 standard allows for up to 128 registers, each 64 bits wide, but Open
2936 vSwitch only implements 4 (in versions 2.4 and 2.5) or 8 (in version
2937 2.6 and later).
2938 </p>
2939
2940 <p>
2941 Each of the 64-bit extended registers overlays two of the 32-bit
2942 registers: <code>xreg0</code> overlays <code>reg0</code> and
2943 <code>reg1</code>, with <code>reg0</code> supplying the
2944 most-significant bits of <code>xreg0</code> and <code>reg1</code> the
2945 least-significant. Similarly, <code>xreg1</code> overlays
2946 <code>reg2</code> and <code>reg3</code>, and so on.
2947 </p>
2948
2949 <p>
2950 The OpenFlow specification says, ``In most cases, the packet registers
2951 can not be matched in tables, i.e. they usually can not be used in the
2952 flow entry match structure'' [OpenFlow 1.5, section 7.2.3.10], but
2953 there is no reason for a software switch to impose such a restriction,
2954 and Open vSwitch does not.
2955 </p>
2956 </field>
2957
2958 <!-- XXX series -->
2959 <field id="MFF_XREG1" title="Extended Register 1" hidden="yes"/>
2960 <field id="MFF_XREG2" title="Extended Register 2" hidden="yes"/>
2961 <field id="MFF_XREG3" title="Extended Register 3" hidden="yes"/>
2962 <field id="MFF_XREG4" title="Extended Register 4" hidden="yes"/>
2963 <field id="MFF_XREG5" title="Extended Register 5" hidden="yes"/>
2964 <field id="MFF_XREG6" title="Extended Register 6" hidden="yes"/>
2965 <field id="MFF_XREG7" title="Extended Register 7" hidden="yes"/>
2966
2967 <field id="MFF_XXREG0" title="Double-Extended Register 0">
2968 <p>
2969 This is the first of the double-extended registers introduce in Open
2970 vSwitch 2.6. Each of the 128-bit extended registers overlays four of
2971 the 32-bit registers: <code>xxreg0</code> overlays <code>reg0</code>
2972 through <code>reg3</code>, with <code>reg0</code> supplying the
2973 most-significant bits of <code>xxreg0</code> and <code>reg3</code> the
2974 least-significant. <code>xxreg1</code> similarly overlays
2975 <code>reg4</code> through <code>reg7</code>, and so on.
2976 </p>
2977 </field>
2978
2979 <!-- XXX series -->
2980 <field id="MFF_XXREG1" title="Double-Extended Register 1" hidden="yes"/>
2981 <field id="MFF_XXREG2" title="Double-Extended Register 2" hidden="yes"/>
2982 <field id="MFF_XXREG3" title="Double-Extended Register 3" hidden="yes"/>
2983 </group>
2984
2985 <group title="Layer 2 (Ethernet)">
2986 <p>
2987 Ethernet is the only layer-2 protocol that Open vSwitch
2988 supports. As with most software, Open vSwitch and OpenFlow
2989 regard an Ethernet frame to begin with the 14-byte header and
2990 end with the final byte of the payload; that is, the frame check
2991 sequence is not considered part of the frame.
2992 </p>
2993
2994 <field id="MFF_ETH_SRC" title="Ethernet Source">
2995 <p>
2996 The Ethernet source address:
2997 </p>
2998
2999 <diagram>
3000 <header name="Ethernet">
3001 <bits name="dst" above="48" width=".75"/>
3002 <bits name="src" above="48" width=".75" fill="yes"/>
3003 <bits name="type" above="16" width="0.4"/>
3004 </header>
3005 <dots/>
3006 </diagram>
3007 </field>
3008
3009 <field id="MFF_ETH_DST" title="Ethernet Destination">
3010 <p>
3011 The Ethernet destination address:
3012 </p>
3013
3014 <diagram>
3015 <header name="Ethernet">
3016 <bits name="dst" above="48" width=".75" fill="yes"/>
3017 <bits name="src" above="48" width=".75"/>
3018 <bits name="type" above="16" width="0.4"/>
3019 </header>
3020 <dots/>
3021 </diagram>
3022
3023 <p>
3024 Open vSwitch 1.8 and later support arbitrary masks for source and/or
3025 destination. Earlier versions only support masking the destination
3026 with the following masks:
3027 </p>
3028
3029 <dl>
3030 <dt><code>01:00:00:00:00:00</code></dt>
3031 <dd>
3032 Match only the multicast bit. Thus,
3033 <code>dl_dst=01:00:00:00:00:00/01:00:00:00:00:00</code> matches all
3034 multicast (including broadcast) Ethernet packets, and
3035 <code>dl_dst=00:00:00:00:00:00/01:00:00:00:00:00</code> matches all
3036 unicast Ethernet packets.
3037 </dd>
3038
3039 <dt><code>fe:ff:ff:ff:ff:ff</code></dt>
3040 <dd>
3041 Match all bits except the multicast bit. This is probably not
3042 useful.
3043 </dd>
3044
3045 <dt><code>ff:ff:ff:ff:ff:ff</code></dt>
3046 <dd>
3047 Exact match (equivalent to omitting the mask).
3048 </dd>
3049
3050 <dt><code>00:00:00:00:00:00</code></dt>
3051 <dd>
3052 Wildcard all bits (equivalent to <code>dl_dst=*</code>).
3053 </dd>
3054 </dl>
3055 </field>
3056
3057 <field id="MFF_ETH_TYPE" title="Ethernet Type">
3058 <p>
3059 The most commonly seen Ethernet frames today use a format
3060 called ``Ethernet II,'' in which the last two bytes of the
3061 Ethernet header specify the Ethertype. For such a frame, this
3062 field is copied from those bytes of the header, like so:
3063 </p>
3064
3065 <diagram>
3066 <header name="Ethernet">
3067 <bits name="dst" above="48" width=".75"/>
3068 <bits name="src" above="48" width=".75"/>
3069 <bits name="type" above="16" below="\[&gt;=]0x600" width="0.4" fill="yes"/>
3070 </header>
3071 <dots/>
3072 </diagram>
3073
3074 <p>
3075 Every Ethernet type has a value 0x600 (1,536) or greater.
3076 When the last two bytes of the Ethernet header have a value
3077 too small to be an Ethernet type, then the value found there
3078 is the total length of the frame in bytes, excluding the
3079 Ethernet header. An 802.2 LLC header typically follows the
3080 Ethernet header. OpenFlow and Open vSwitch only support LLC
3081 headers with DSAP and SSAP <code>0xaa</code> and control byte
3082 <code>0x03</code>, which indicate that a SNAP header follows
3083 the LLC header. In turn, OpenFlow and Open vSwitch only
3084 support a SNAP header with organization <code>0x000000</code>.
3085 In such a case, this field is copied from the type field in
3086 the SNAP header, like this:
3087 </p>
3088
3089 <diagram>
3090 <header name="Ethernet">
3091 <bits name="dst" above="48" width=".75"/>
3092 <bits name="src" above="48" width=".75"/>
3093 <bits name="type" above="16" below="&lt;0x600" width="0.4"/>
3094 </header>
3095 <header name="LLC">
3096 <bits name="DSAP" above="8" below="0xaa" width=".4"/>
3097 <bits name="SSAP" above="8" below="0xaa" width=".4"/>
3098 <bits name="cntl" above="8" below="0x03" width=".4"/>
3099 </header>
3100 <header name="SNAP">
3101 <bits name="org" above="24" below="0x000000" width=".75"/>
3102 <bits name="type" above="16" below="\[&gt;=]0x600" width=".4" fill="yes"/>
3103 </header>
3104 <dots/>
3105 </diagram>
3106
3107 <p>
3108 When an 802.1Q header is inserted after the Ethernet source
3109 and destination, this field is populated with the encapsulated
3110 Ethertype, not the 802.1Q Ethertype. With an Ethernet II
3111 inner frame, the result looks like this:
3112 </p>
3113
3114 <diagram>
3115 <header name="Ethernet">
3116 <bits name="dst" above="48" width=".75"/>
3117 <bits name="src" above="48" width=".75"/>
3118 </header>
3119 <header name="802.1Q">
3120 <bits name="TPID" above="16" below="0x8100" width=".4"/>
3121 <bits name="TCI" above="16" width=".4"/>
3122 </header>
3123 <header name="Ethertype">
3124 <bits name="type" above="16" below="\[&gt;=]0x600" width=".4" fill="yes"/>
3125 </header>
3126 <dots/>
3127 </diagram>
3128
3129 <p>
3130 LLC and SNAP encapsulation look like this with an 802.1Q header:
3131 </p>
3132
3133 <diagram>
3134 <header name="Ethernet">
3135 <bits name="dst" above="48" width=".75"/>
3136 <bits name="src" above="48" width=".75"/>
3137 </header>
3138 <header name="802.1Q">
3139 <bits name="TPID" above="16" below="0x8100" width=".4"/>
3140 <bits name="TCI" above="16" width=".4"/>
3141 </header>
3142 <header name="Ethertype">
3143 <bits name="type" above="16" below="&lt;0x600" width="0.4"/>
3144 </header>
3145 <header name="LLC">
3146 <bits name="DSAP" above="8" below="0xaa" width=".4"/>
3147 <bits name="SSAP" above="8" below="0xaa" width=".4"/>
3148 <bits name="cntl" above="8" below="0x03" width=".4"/>
3149 </header>
3150 <header name="SNAP">
3151 <bits name="org" above="24" below="0x000000" width=".75"/>
3152 <bits name="type" above="16" below="\[&gt;=]0x600" width=".4" fill="yes"/>
3153 </header>
3154 <dots/>
3155 </diagram>
3156
3157 <p>
3158 When a packet doesn't match any of the header formats described
3159 above, Open vSwitch and OpenFlow set this field to
3160 <code>0x5ff</code> (<code>OFP_DL_TYPE_NOT_ETH_TYPE</code>).
3161 </p>
3162 </field>
3163 </group>
3164
3165 <group title="VLAN">
3166 <p>
3167 The 802.1Q VLAN header causes more trouble than any other 4
3168 bytes in networking. OpenFlow 1.0, 1.1, and 1.2+ all treat VLANs
3169 differently. Open vSwitch extensions add another variant to the mix.
3170 Open vSwitch reconciles all four treatments as best it can.
3171 </p>
3172
3173 <h2>VLAN Header Format</h2>
3174
3175 <p>
3176 An 802.1Q VLAN header consists of two 16-bit fields:
3177 </p>
3178
3179 <diagram>
3180 <header name="TPID">
3181 <bits name="Ethertype" above="16" below="0x8100" width="1.8"/>
3182 </header>
3183 <nospace/>
3184 <header name="TCI">
3185 <bits name="PCP" above="3" width=".6"/>
3186 <bits name="CFI" above="1" below="0" width=".3"/>
3187 <bits name="VID" above="12" width=".9"/>
3188 </header>
3189 </diagram>
3190
3191 <p>
3192 The first 16 bits of the VLAN header, the <dfn>TPID</dfn> (Tag Protocol
3193 IDentifier), is an Ethertype. When the VLAN header is inserted just
3194 after the source and destination MAC addresses in a Ethertype frame, the
3195 TPID serves to identify the presence of the VLAN. The standard TPID, the
3196 only one that Open vSwitch supports, is <code>0x8100</code>. OpenFlow
3197 1.0 explicitly supports only TPID <code>0x8100</code>. OpenFlow 1.1, but
3198 not earlier or later versions, also requires support for TPID
3199 <code>0x88a8</code> (Open vSwitch does not support this). OpenFlow 1.2
3200 through 1.5 do not require support for specific TPIDs (the ``push vlan
3201 header'' action does say that only <code>0x8100</code> and
3202 <code>0x88a8</code> should be pushed). No version of OpenFlow provides a
3203 way to distinguish or match on the TPID.
3204 </p>
3205
3206 <p>
3207 The remaining 16 bits of the VLAN header, the <dfn>TCI</dfn>
3208 (Tag Control Information), is subdivided into three subfields:
3209 </p>
3210
3211 <ul>
3212 <li>
3213 <dfn>PCP</dfn> (Priority Control Point), is a 3-bit 802.1p
3214 <dfn>priority</dfn>. The lowest priority is value 1, the
3215 second-lowest is value 0, and priority increases from 2 up to
3216 highest priority 7.
3217 </li>
3218
3219 <li>
3220 <p>
3221 <dfn>CFI</dfn> (Canonical Format Indicator), is a 1-bit field. On an
3222 Ethernet network, its value is always 0. This led to it later being
3223 repurposed under the name <dfn>DEI</dfn> (Drop Eligibility
3224 Indicator). By either name, OpenFlow and Open vSwitch don't provide
3225 any way to match or set this bit.
3226 </p>
3227 </li>
3228
3229 <li>
3230 <dfn>VID</dfn> (VLAN IDentifier), is a 12-bit VLAN. If the
3231 VID is 0, then the frame is not part of a VLAN. In that case,
3232 the VLAN header is called a <dfn>priority tag</dfn> because it
3233 is only meaningful for assigning the frame a priority. VID
3234 <code>0xfff</code> (4,095) is reserved.
3235 </li>
3236 </ul>
3237
3238 <p>
3239 See <ref field="eth_type"/> for illustrations of a complete Ethernet
3240 frame with 802.1Q tag included.
3241 </p>
3242
3243 <h2>Multiple VLANs</h2>
3244
3245 <p>
3246 Open vSwitch can match only a single VLAN header. If more than
3247 one VLAN header is present, then <ref field="eth_type"/>
3248 holds the TPID of the inner VLAN header. Open vSwitch stops
3249 parsing the packet after the inner TPID, so matching further
3250 into the packet (e.g. on the inner TCI or L3 fields) is not
3251 possible.
3252 </p>
3253
3254 <p>
3255 OpenFlow only directly supports matching a single VLAN header. In
3256 OpenFlow 1.1 or later, one OpenFlow table can match on the outermost VLAN
3257 header and pop it off, and a later OpenFlow table can match on the next
3258 outermost header. Open vSwitch does not support this.
3259 </p>
3260
3261 <h2>VLAN Field Details</h2>
3262
3263 <p>
3264 The four variants have three different levels of expressiveness: OpenFlow
3265 1.0 and 1.1 VLAN matching are less powerful than OpenFlow 1.2+ VLAN
3266 matching, which is less powerful than Open vSwitch extension VLAN
3267 matching.
3268 </p>
3269
3270 <h2>OpenFlow 1.0 VLAN Fields</h2>
3271
3272 <p>
3273 OpenFlow 1.0 uses two fields, called <code>dl_vlan</code> and
3274 <code>dl_vlan_pcp</code>, each of which can be either exact-matched or
3275 wildcarded, to specify VLAN matches:
3276 </p>
3277
3278 <ul>
3279 <li>
3280 When both <code>dl_vlan</code> and <code>dl_vlan_pcp</code> are
3281 wildcarded, the flow matches packets without an 802.1Q header or
3282 with any 802.1Q header.
3283 </li>
3284
3285 <li>
3286 The match <code>dl_vlan=0xffff</code> causes a flow to match only
3287 packets without an 802.1Q header. Such a flow should also wildcard
3288 <code>dl_vlan_pcp</code>, since a packet without an 802.1Q header does
3289 not have a PCP. OpenFlow does not specify what to do if a match on PCP
3290 is actually present, but Open vSwitch ignores it.
3291 </li>
3292
3293 <li>
3294 <p>
3295 Otherwise, the flow matches only packets with an 802.1Q
3296 header. If <code>dl_vlan</code> is not wildcarded, then the
3297 flow only matches packets with the VLAN ID specified in
3298 <code>dl_vlan</code>'s low 12 bits. If
3299 <code>dl_vlan_pcp</code> is not wildcarded, then the flow
3300 only matches packets with the priority specified in
3301 <code>dl_vlan_pcp</code>'s low 3 bits.
3302 </p>
3303
3304 <p>
3305 OpenFlow does not specify how to interpret the high 4 bits of
3306 <code>dl_vlan</code> or the high 5 bits of <code>dl_vlan_pcp</code>.
3307 Open vSwitch ignores them.
3308 </p>
3309 </li>
3310 </ul>
3311
3312 <field id="MFF_DL_VLAN" title="OpenFlow 1.0 VLAN ID" hidden="yes"/>
3313 <field id="MFF_DL_VLAN_PCP" title="OpenFlow 1.0 VLAN Priority"
3314 hidden="yes"/>
3315
3316 <h2>OpenFlow 1.1 VLAN Fields</h2>
3317
3318 <p>
3319 VLAN matching in OpenFlow 1.1 is similar to OpenFlow 1.0.
3320 The one refinement is that when <code>dl_vlan</code> matches on
3321 <code>0xfffe</code> (<code>OFVPID_ANY</code>), the flow matches
3322 only packets with an 802.1Q header, with any VLAN ID. If
3323 <code>dl_vlan_pcp</code> is wildcarded, the flow matches any
3324 packet with an 802.1Q header, regardless of VLAN ID or priority.
3325 If <code>dl_vlan_pcp</code> is not wildcarded, then the flow
3326 only matches packets with the priority specified in
3327 <code>dl_vlan_pcp</code>'s low 3 bits.
3328 </p>
3329
3330 <p>
3331 OpenFlow 1.1 uses the name <code>OFPVID_NONE</code>, instead of
3332 <code>OFP_VLAN_NONE</code>, for a <code>dl_vlan</code> of
3333 <code>0xffff</code>, but it has the same meaning.
3334 </p>
3335
3336 <p>
3337 In OpenFlow 1.1, Open vSwitch reports error
3338 <code>OFPBMC_BAD_VALUE</code> for an attempt to match on
3339 <code>dl_vlan</code> between 4,096 and <code>0xfffd</code>,
3340 inclusive, or <code>dl_vlan_pcp</code> greater than 7.
3341 </p>
3342
3343 <h2>OpenFlow 1.2 VLAN Fields</h2>
3344
3345 <field id="MFF_VLAN_VID" title="OpenFlow 1.2+ VLAN ID">
3346 <p>
3347 The OpenFlow standard describes this field as consisting of
3348 ``12+1'' bits. On ingress, its value is 0 if no 802.1Q header
3349 is present, and otherwise it holds the VLAN VID in its least
3350 significant 12 bits, with bit 12 (<code>0x1000</code> aka
3351 <code>OFPVID_PRESENT</code>) also set to 1. The three most
3352 significant bits are always zero:
3353 </p>
3354
3355 <diagram>
3356 <header name="OXM_OF_VLAN_VID">
3357 <bits name="" above="3" below="0" width=".6"/>
3358 <bits name="P" above="1" width=".1"/>
3359 <bits name="VLAN ID" above="12" width=".9"/>
3360 </header>
3361 </diagram>
3362
3363 <p>
3364 As a consequence of this field's format, one may use it to match the
3365 VLAN ID in all of the ways available with the OpenFlow 1.0 and 1.1
3366 formats, and a few new ways:
3367 </p>
3368
3369 <dl>
3370 <dt>Fully wildcarded</dt>
3371 <dd>
3372 Matches any packet, that is, one without an 802.1Q header or
3373 with an 802.1Q header with any TCI value.
3374 </dd>
3375
3376 <dt>
3377 Value <code>0x0000</code> (<code>OFPVID_NONE</code>), mask
3378 <code>0xffff</code> (or no mask)
3379 </dt>
3380 <dd>
3381 Matches only packets without an 802.1Q header.
3382 </dd>
3383
3384 <dt>
3385 Value <code>0x1000</code>, mask <code>0x1000</code>
3386 </dt>
3387 <dd>
3388 Matches any packet with an 802.1Q header, regardless of VLAN
3389 ID.
3390 </dd>
3391
3392 <dt>
3393 Value <code>0x1009</code>, mask <code>0xffff</code> (or no mask)
3394 </dt>
3395 <dd>
3396 Match only packets with an 802.1Q header with VLAN ID 9.
3397 </dd>
3398
3399 <dt>Value <code>0x1001</code>, mask <code>0x1001</code></dt>
3400 <dd>
3401 Matches only packets that have an 802.1Q header with an
3402 odd-numbered VLAN ID. (This is just an example; one can
3403 match on any desired VLAN ID bit pattern.)
3404 </dd>
3405 </dl>
3406 </field>
3407
3408 <field id="MFF_VLAN_PCP" title="OpenFlow 1.2+ VLAN Priority">
3409 <p>
3410 The 3 least significant bits may be used to match the PCP bits
3411 in an 802.1Q header. Other bits are always zero:
3412 </p>
3413
3414 <diagram>
3415 <header name="OXM_OF_VLAN_VID">
3416 <bits name="zero" above="5" below="0" width="1.0"/>
3417 <bits name="PCP" above="3" width=".6"/>
3418 </header>
3419 </diagram>
3420
3421 <p>
3422 This field may only be used when <ref field="vlan_vid"/> is not
3423 wildcarded and does not exact match on 0 (which only matches
3424 when there is no 802.1Q header).
3425 </p>
3426
3427 <p>
3428 See <cite>VLAN Comparison Chart</cite>, below, for some examples.
3429 </p>
3430 </field>
3431
3432 <h2>Open vSwitch Extension VLAN Field</h2>
3433
3434 <p>
3435 The <ref field="vlan_tci"/> extension can describe more kinds of VLAN
3436 matches than the other variants. It is also simpler than the other
3437 variants.
3438 </p>
3439
3440 <field id="MFF_VLAN_TCI" title="VLAN TCI">
3441 <p>
3442 For a packet without an 802.1Q header, this field is zero. For a
3443 packet with an 802.1Q header, this field is the TCI with the bit in
3444 CFI's position (marked <code>P</code> for ``present'' below) forced to
3445 1. Thus, for a packet in VLAN 9 with priority 7, it has the value
3446 <code>0xf009</code>:
3447 </p>
3448
3449 <diagram>
3450 <header name="NXM_VLAN_TCI">
3451 <bits name="PCP" above="3" below="7" width=".6"/>
3452 <bits name="P" above="1" below="1" width=".2"/>
3453 <bits name="VID" above="12" below="9" width=".9"/>
3454 </header>
3455 </diagram>
3456
3457 <p>
3458 Usage examples:
3459 </p>
3460
3461 <dl>
3462 <dt><code>vlan_tci=0</code></dt>
3463 <dd>
3464 Match packets without an 802.1Q header.
3465 </dd>
3466
3467 <dt><code>vlan_tci=0x1000/0x1000</code></dt>
3468 <dd>
3469 Match packets with an 802.1Q header, regardless of VLAN
3470 and priority values.
3471 </dd>
3472
3473 <dt><code>vlan_tci=0xf123</code></dt>
3474 <dd>
3475 Match packets tagged with priority 7 in VLAN 0x123.
3476 </dd>
3477
3478 <dt><code>vlan_tci=0x1123/0x1fff</code></dt>
3479 <dd>
3480 Match packets tagged with VLAN 0x123 (and any priority).
3481 </dd>
3482
3483 <dt><code>vlan_tci=0x5000/0xf000</code></dt>
3484 <dd>
3485 Match packets tagged with priority 2 (in any VLAN).
3486 </dd>
3487
3488 <dt><code>vlan_tci=0/0xfff</code></dt>
3489 <dd>
3490 Match packets with no 802.1Q header or tagged with VLAN 0
3491 (and any priority).
3492 </dd>
3493
3494 <dt><code>vlan_tci=0x5000/0xe000</code></dt>
3495 <dd>
3496 Match packets with no 802.1Q header or tagged with priority 2 (in any VLAN).
3497 </dd>
3498
3499 <dt><code>vlan_tci=0/0xefff</code></dt>
3500 <dd>
3501 Match packets with no 802.1Q header or tagged with VLAN 0
3502 and priority 0.
3503 </dd>
3504 </dl>
3505
3506 <p>
3507 See <cite>VLAN Comparison Chart</cite>, below, for more examples.
3508 </p>
3509 </field>
3510
3511 <h2>VLAN Comparison Chart</h2>
3512
3513 <p>
3514 The following table describes each of several possible matching
3515 criteria on 802.1Q header may be expressed with each variation
3516 of the VLAN matching fields:
3517 </p>
3518
3519 <tbl>
3520 r r r r r.
3521 Criteria OpenFlow 1.0 OpenFlow 1.1 OpenFlow 1.2+ NXM
3522 \_ \_ \_ \_ \_
3523 [1] \fL????\fR/\fL1\fR,\fL??\fR/\fL?\fR \fL????\fR/\fL1\fR,\fL??\fR/\fL?\fR \fL0000\fR/\fL0000\fR,\fL--\fR \fL0000\fR/\fL0000\fR
3524 [2] \fLffff\fR/\fL0\fR,\fL??\fR/\fL?\fR \fLffff\fR/\fL0\fR,\fL??\fR/\fL?\fR \fL0000\fR/\fLffff\fR,\fL--\fR \fL0000\fR/\fLffff\fR
3525 [3] \fL0xxx\fR/\fL0\fR,\fL??\fR/\fL1\fR \fL0xxx\fR/\fL0\fR,\fL??\fR/\fL1\fR \fL1xxx\fR/\fLffff\fR,\fL--\fR \fL1xxx\fR/\fL1fff\fR
3526 [4] \fL????\fR/\fL1\fR,\fL0y\fR/\fL0\fR \fLfffe\fR/\fL0\fR,\fL0y\fR/\fL0\fR \fL1000\fR/\fL1000\fR,\fL0y\fR \fLz000\fR/\fLf000\fR
3527 [5] \fL0xxx\fR/\fL0\fR,\fL0y\fR/\fL0\fR \fL0xxx\fR/\fL0\fR,\fL0y\fR/\fL0\fR \fL1xxx\fR/\fLffff\fR,\fL0y\fR \fLzxxx\fR/\fLffff\fR
3528 .T&amp;
3529 r r c c r.
3530 [6] (none) (none) \fL1001\fR/\fL1001\fR,\fL--\fR \fL1001\fR/\fL1001\fR
3531 .T&amp;
3532 r r c c c.
3533 [7] (none) (none) (none) \fL3000\fR/\fL3000\fR
3534 [8] (none) (none) (none) \fL0000\fR/\fL0fff\fR
3535 [9] (none) (none) (none) \fL0000\fR/\fLf000\fR
3536 [10] (none) (none) (none) \fL0000\fR/\fLefff\fR
3537 </tbl>
3538
3539 <p>
3540 All numbers in the table are expressed in hexadecimal. The
3541 columns in the table are interpreted as follows:
3542 </p>
3543
3544 <dl>
3545 <dt>Criteria</dt>
3546 <dd>See the list below.</dd>
3547
3548 <dt>OpenFlow 1.0</dt>
3549 <dt>OpenFlow 1.1</dt>
3550 <dd>
3551 <literal>wwww/x,yy/z</literal> means VLAN ID match value
3552 <literal>wwww</literal> with wildcard bit <literal>x</literal>
3553 and VLAN PCP match value <literal>yy</literal> with wildcard
3554 bit <literal>z</literal>. <literal>?</literal> means that the
3555 given bits are ignored (and conventionally
3556 <literal>0</literal> for <literal>wwww</literal> or
3557 <literal>yy</literal>, conventionally <literal>1</literal> for
3558 <literal>x</literal> or <literal>z</literal>). ``(none)''
3559 means that OpenFlow 1.0 (or 1.1) cannot match with these
3560 criteria.
3561 </dd>
3562
3563 <dt>OpenFlow 1.2+</dt>
3564 <dd>
3565 <literal>xxxx/yyyy,zz</literal> means <ref field="vlan_vid"/> with
3566 value <literal>xxxx</literal> and mask <literal>yyyy</literal>, and
3567 <ref field="vlan_pcp"/> (which is not maskable) with value
3568 <literal>zz</literal>. <literal>--</literal> means that <ref
3569 field="vlan_pcp"/> is omitted. ``(none)'' means that OpenFlow 1.2
3570 cannot match with these criteria.
3571 </dd>
3572
3573 <dt>NXM</dt>
3574 <dd>
3575 <literal>xxxx/yyyy</literal> means <ref field="vlan_tci"/> with value
3576 <literal>xxxx</literal> and mask <literal>yyyy</literal>.
3577 </dd>
3578 </dl>
3579
3580 <p>
3581 The matching criteria described by the table are:
3582 </p>
3583
3584 <dl>
3585 <dt>[1]</dt>
3586 <dd>
3587 Matches any packet, that is, one without an 802.1Q header or
3588 with an 802.1Q header with any TCI value.
3589 </dd>
3590
3591 <dt>[2]</dt>
3592 <dd>
3593 <p>
3594 Matches only packets without an 802.1Q header.
3595 </p>
3596
3597 <p>
3598 OpenFlow 1.0 doesn't define the behavior if <ref field="dl_vlan"/> is
3599 set to <code>0xffff</code> and <ref field="dl_vlan_pcp"/> is not
3600 wildcarded. (Open vSwitch always ignores <ref field="dl_vlan_pcp"/>
3601 when <ref field="dl_vlan"/> is set to <code>0xffff</code>.)
3602 </p>
3603
3604 <p>
3605 OpenFlow 1.1 says explicitly to ignore <ref field="dl_vlan_pcp"/>
3606 when <ref field="dl_vlan"/> is set to <code>0xffff</code>.
3607 </p>
3608
3609 <p>
3610 OpenFlow 1.2 doesn't say how to interpret a match with <ref
3611 field="vlan_vid"/> value 0 and a mask with
3612 <code>OFPVID_PRESENT</code> (<code>0x1000</code>) set to 1 and some
3613 other bits in the mask set to 1 also. Open vSwitch interprets it the
3614 same way as a mask of <code>0x1000</code>.
3615 </p>
3616
3617 <p>
3618 Any NXM match with <ref field="vlan_tci"/> value 0 and the CFI bit
3619 set to 1 in the mask is equivalent to the one listed in the table.
3620 </p>
3621 </dd>
3622
3623 <dt>[3]</dt>
3624 <dd>
3625 Matches only packets that have an 802.1Q header with VID
3626 <literal>xxx</literal> (and any PCP).
3627 </dd>
3628
3629 <dt>[4]</dt>
3630 <dd>
3631 <p>
3632 Matches only packets that have an 802.1Q header with PCP
3633 <literal>y</literal> (and any VID).
3634 </p>
3635
3636 <p>
3637 OpenFlow 1.0 doesn't clearly define the behavior for this
3638 case. Open vSwitch implements it this way.
3639 </p>
3640
3641 <p>
3642 In the NXM value, <literal>z</literal> equals
3643 (<literal>y</literal> &lt;&lt; 1) | 1.
3644 </p>
3645 </dd>
3646
3647 <dt>[5]</dt>
3648 <dd>
3649 <p>
3650 Matches only packets that have an 802.1Q header with VID
3651 <literal>xxx</literal> and PCP <literal>y</literal>.
3652 </p>
3653
3654 <p>
3655 In the NXM value, <literal>z</literal> equals
3656 (<literal>y</literal> &lt;&lt; 1) | 1.
3657 </p>
3658 </dd>
3659
3660 <dt>[6]</dt>
3661 <dd>
3662 Matches only packets that have an 802.1Q header with an
3663 odd-numbered VID (and any PCP). Only possible with OpenFlow
3664 1.2 and NXM. (This is just an example; one can match on any
3665 desired VID bit pattern.)
3666 </dd>
3667
3668 <dt>[7]</dt>
3669 <dd>
3670 Matches only packets that have an 802.1Q header with an
3671 odd-numbered PCP (and any VID). Only possible with NXM.
3672 (This is just an example; one can match on any desired VID bit
3673 pattern.)
3674 </dd>
3675
3676 <dt>[8]</dt>
3677 <dd>
3678 Matches packets with no 802.1Q header or with an 802.1Q header
3679 with a VID of 0. Only possible with NXM.
3680 </dd>
3681
3682 <dt>[9]</dt>
3683 <dd>
3684 Matches packets with no 802.1Q header or with an 802.1Q header
3685 with a PCP of 0. Only possible with NXM.
3686 </dd>
3687
3688 <dt>[10]</dt>
3689 <dd>
3690 Matches packets with no 802.1Q header or with an 802.1Q header
3691 with both VID and PCP of 0. Only possible with NXM.
3692 </dd>
3693 </dl>
3694 </group>
3695
3696 <group title="Layer 2.5: MPLS">
3697 <p>
3698 One or more MPLS headers (more commonly called <dfn>MPLS
3699 labels</dfn>) follow an Ethernet type field that specifies an
3700 MPLS Ethernet type [RFC 3032]. Ethertype <code>0x8847</code> is
3701 used for all unicast. Multicast MPLS is divided into two
3702 specific classes, one of which uses Ethertype
3703 <code>0x8847</code> and the other <code>0x8848</code> [RFC
3704 5332].
3705 </p>
3706
3707 <p>
3708 The most common overall packet format is Ethernet II, shown
3709 below (SNAP encapsulation may be used but is not ordinarily seen
3710 in Ethernet networks):
3711 </p>
3712
3713 <diagram>
3714 <header name="Ethernet">
3715 <bits name="dst" above="48" width="0.75"/>
3716 <bits name="src" above="48" width="0.75"/>
3717 <bits name="type" above="16" below="0x8847" width="0.4"/>
3718 </header>
3719 <header name="MPLS">
3720 <bits name="label" above="20" width=".6"/>
3721 <bits name="TC" above="3" width=".3"/>
3722 <bits name="S" above="1" width=".1"/>
3723 <bits name="TTL" above="8" width=".4"/>
3724 </header>
3725 <dots/>
3726 </diagram>
3727
3728 <p>
3729 MPLS can be encapsulated inside an 802.1Q header, in which case
3730 the combination looks like this:
3731 </p>
3732
3733 <diagram>
3734 <header name="Ethernet">
3735 <bits name="dst" above="48" width=".75"/>
3736 <bits name="src" above="48" width=".75"/>
3737 </header>
3738 <header name="802.1Q">
3739 <bits name="TPID" above="16" below="0x8100" width=".4"/>
3740 <bits name="TCI" above="16" width=".4"/>
3741 </header>
3742 <header name="Ethertype">
3743 <bits name="type" above="16" below="0x8847" width=".4"/>
3744 </header>
3745 <header name="MPLS">
3746 <bits name="label" above="20" width=".6"/>
3747 <bits name="TC" above="3" width=".3"/>
3748 <bits name="S" above="1" width=".1"/>
3749 <bits name="TTL" above="8" width=".4"/>
3750 </header>
3751 <dots/>
3752 </diagram>
3753
3754 <p>
3755 The fields within an MPLS label are:
3756 </p>
3757
3758 <dl>
3759 <dt>Label, 20 bits.</dt>
3760 <dd>
3761 An identifier.
3762 </dd>
3763
3764 <dt>Traffic control (TC), 3 bits.</dt>
3765 <dd>
3766 Used for quality of service.
3767 </dd>
3768
3769 <dt>Bottom of stack (BOS), 1 bit (labeled just ``S'' above).</dt>
3770 <dd>
3771 <p>
3772 0 indicates that another MPLS label follows this one.
3773 </p>
3774
3775 <p>
3776 1 indicates that this MPLS label is the last one in the
3777 stack, so that some other protocol follows this one.
3778 </p>
3779 </dd>
3780
3781 <dt>Time to live (TTL), 8 bits.</dt>
3782 <dd>
3783 <p>
3784 Each hop across an MPLS network decrements the TTL by 1. If
3785 it reaches 0, the packet is discarded.
3786 </p>
3787
3788 <p>
3789 OpenFlow does not make the MPLS TTL available as a match field, but
3790 actions are available to set and decrement the TTL. Open vSwitch 2.6
3791 and later makes the MPLS TTL available as an extension.
3792 </p>
3793 </dd>
3794 </dl>
3795
3796 <h2>MPLS Label Stacks</h2>
3797
3798 <p>
3799 Unlike the other encapsulations supported by OpenFlow and Open vSwitch,
3800 MPLS labels are routinely used in ``stacks'' two or three deep and
3801 sometimes even deeper. Open vSwitch currently supports up to three
3802 labels.
3803 </p>
3804
3805 <p>
3806 The OpenFlow specification only supports matching on the outermost MPLS
3807 label at any given time. To match on the second label, one must first
3808 ``pop'' the outer label and advance to another OpenFlow table, where the
3809 inner label may be matched. To match on the third label, one must pop
3810 the two outer labels, and so on.
3811 </p>
3812
3813 <h2>MPLS Inner Protocol</h2>
3814
3815 <p>
3816 Unlike all other forms of encapsulation that Open vSwitch and
3817 OpenFlow support, an MPLS label does not indicate what inner
3818 protocol it encapsulates. Different deployments determine the
3819 inner protocol in different ways [RFC 3032]:
3820 </p>
3821
3822 <ul>
3823 <li>
3824 A few reserved label values do indicate an inner protocol.
3825 Label 0, the ``IPv4 Explicit NULL Label,'' indicates inner
3826 IPv4. Label 2, the ``IPv6 Explicit NULL Label,'' indicates
3827 inner IPv6.
3828 </li>
3829
3830 <li>
3831 Some deployments use a single inner protocol consistently.
3832 </li>
3833
3834 <li>
3835 In some deployments, the inner protocol must be inferred from
3836 the innermost label.
3837 </li>
3838
3839 <li>
3840 In some deployments, the inner protocol must be inferred from
3841 the innermost label and the encapsulated data, e.g. to
3842 distinguish between inner IPv4 and IPv6 based on whether the
3843 first nibble of the inner protocol data are <code>4</code> or
3844 <code>6</code>. OpenFlow and Open vSwitch do not currently
3845 support these cases.
3846 </li>
3847 </ul>
3848
3849 <p>
3850 Open vSwitch and OpenFlow do not infer the inner protocol, even if
3851 reserved label values are in use. Instead, the flow table must specify
3852 the inner protocol at the time it pops the bottommost MPLS label, using
3853 the Ethertype argument to the <code>pop_mpls</code> action.
3854 </p>
3855
3856 <h2>Field Details</h2>
3857
3858 <field id="MFF_MPLS_LABEL" title="MPLS Label">
3859 <p>
3860 The least significant 20 bits hold the ``label'' field from
3861 the MPLS label. Other bits are zero:
3862 </p>
3863
3864 <diagram>
3865 <header name="OXM_OF_MPLS_LABEL">
3866 <bits name="zero" above="12" below="0" width=".6"/>
3867 <bits name="label" above="20" width="1.0"/>
3868 </header>
3869 </diagram>
3870
3871 <p>
3872 Most label values are available for any use by deployments.
3873 Values under 16 are reserved.
3874 </p>
3875 </field>
3876
3877 <field id="MFF_MPLS_TC" title="MPLS Traffic Class">
3878 <p>
3879 The least significant 3 bits hold the TC field from the MPLS
3880 label. Other bits are zero:
3881 </p>
3882
3883 <diagram>
3884 <header name="OXM_OF_MPLS_TC">
3885 <bits name="zero" above="5" below="0" width="1.0"/>
3886 <bits name="TC" above="3" width=".6"/>
3887 </header>
3888 </diagram>
3889
3890 <p>
3891 This field is intended for use for Quality of Service (QoS)
3892 and Explicit Congestion Notification purposes, but its
3893 particular interpretation is deployment specific.
3894 </p>
3895
3896 <p>
3897 Before 2009, this field was named EXP and reserved for
3898 experimental use [RFC 5462].
3899 </p>
3900 </field>
3901
3902 <field id="MFF_MPLS_BOS" title="MPLS Bottom of Stack">
3903 <p>
3904 The least significant bit holds the BOS field from the MPLS
3905 label. Other bits are zero:
3906 </p>
3907
3908 <diagram>
3909 <header name="OXM_OF_MPLS_BOS">
3910 <bits name="zero" above="7" below="0" width="1.3"/>
3911 <bits name="BOS" above="1" width=".3"/>
3912 </header>
3913 </diagram>
3914
3915 <p>
3916 This field is useful as part of processing a series of incoming MPLS
3917 labels. A flow that includes a <code>pop_mpls</code> action should
3918 generally match on <ref field="mpls_bos"/>:
3919 </p>
3920
3921 <ul>
3922 <li>
3923 When <ref field="mpls_bos"/> is 0, there is another MPLS label
3924 following this one, so the Ethertype passed to <code>pop_mpls</code>
3925 should be an MPLS Ethertype. For example: <code>table=0,
3926 dl_type=0x8847, mpls_bos=0, actions=pop_mpls:0x8847,
3927 goto_table:1</code>
3928 </li>
3929
3930 <li>
3931 When <ref field="mpls_bos"/> is 1, this MPLS label is the last one,
3932 so the Ethertype passed to <code>pop_mpls</code> should be a non-MPLS
3933 Ethertype such as IPv4. For example: <code>table=1, dl_type=0x8847,
3934 mpls_bos=1, actions=pop_mpls:0x0800, goto_table:2</code>
3935 </li>
3936 </ul>
3937 </field>
3938
3939 <field id="MFF_MPLS_TTL" title="MPLS Time-to-Live">
3940 <p>
3941 Holds the 8-bit time-to-live field from the MPLS label:
3942 </p>
3943
3944 <diagram>
3945 <header name="NXM_NX_MPLS_TTL">
3946 <bits name="TTL" above="8" width=".4"/>
3947 </header>
3948 </diagram>
3949 </field>
3950 </group>
3951
3952 <group title="Layer 3: IPv4 and IPv6">
3953 <h2>IPv4 Specific Fields</h2>
3954
3955 <p>
3956 These fields are applicable only to IPv4 flows, that is, flows that match
3957 on the IPv4 Ethertype <code>0x0800</code>.
3958 </p>
3959
3960 <field id="MFF_IPV4_SRC" title="IPv4 Source Address">
3961 <p>
3962 The source address from the IPv4 header:
3963 </p>
3964
3965 <diagram>
3966 <header name="Ethernet">
3967 <bits name="dst" above="48" width="0.4"/>
3968 <bits name="src" above="48" width="0.4"/>
3969 <bits name="type" above="16" below="0x800" width="0.4"/>
3970 </header>
3971 <header name="IPv4">
3972 <bits name="..." width="0.4"/>
3973 <bits name="proto" above="8" width="0.4"/>
3974 <bits name="src" above="32" width="0.4" fill="yes"/>
3975 <bits name="dst" above="32" width="0.4"/>
3976 </header>
3977 <dots/>
3978 </diagram>
3979
3980 <p>
3981 For historical reasons, in an ARP or RARP flow, Open vSwitch interprets
3982 matches on <code>nw_src</code> as actually referring to the ARP SPA.
3983 </p>
3984 </field>
3985
3986 <field id="MFF_IPV4_DST" title="IPv4 Destination Address">
3987 <p>
3988 The destination address from the IPv4 header:
3989 </p>
3990
3991 <diagram>
3992 <header name="Ethernet">
3993 <bits name="dst" above="48" width="0.4"/>
3994 <bits name="src" above="48" width="0.4"/>
3995 <bits name="type" above="16" below="0x800" width="0.4"/>
3996 </header>
3997 <header name="IPv4">
3998 <bits name="..." width="0.4"/>
3999 <bits name="proto" above="8" width="0.4"/>
4000 <bits name="src" above="32" width="0.4"/>
4001 <bits name="dst" above="32" width="0.4" fill="yes"/>
4002 </header>
4003 <dots/>
4004 </diagram>
4005
4006 <p>
4007 For historical reasons, in an ARP or RARP flow, Open vSwitch interprets
4008 matches on <code>nw_dst</code> as actually referring to the ARP TPA.
4009 </p>
4010 </field>
4011
4012 <h2>IPv6 Specific Fields</h2>
4013
4014 <p>
4015 These fields apply only to IPv6 flows, that is, flows that match
4016 on the IPv6 Ethertype <code>0x86dd</code>.
4017 </p>
4018
4019 <field id="MFF_IPV6_SRC" title="IPv6 Source Address">
4020 <p>
4021 The source address from the IPv6 header:
4022 </p>
4023
4024 <diagram>
4025 <header name="Ethernet">
4026 <bits name="dst" above="48" width="0.4"/>
4027 <bits name="src" above="48" width="0.4"/>
4028 <bits name="type" above="16" below="0x86dd" width="0.4"/>
4029 </header>
4030 <header name="IPv6">
4031 <bits name="..." width="0.4"/>
4032 <bits name="next" above="8" width="0.3"/>
4033 <bits name="src" above="128" width="0.8" fill="yes"/>
4034 <bits name="dst" above="128" width="0.8"/>
4035 </header>
4036 <dots/>
4037 </diagram>
4038
4039 <p>
4040 Open vSwitch 1.8 added support for bitwise matching; earlier versions
4041 supported only CIDR masks.
4042 </p>
4043 </field>
4044 <field id="MFF_IPV6_DST" title="IPv6 Destination Address">
4045 <p>
4046 The destination address from the IPv6 header:
4047 </p>
4048 <diagram>
4049 <header name="Ethernet">
4050 <bits name="dst" above="48" width="0.4"/>
4051 <bits name="src" above="48" width="0.4"/>
4052 <bits name="type" above="16" below="0x86dd" width="0.4"/>
4053 </header>
4054 <header name="IPv6">
4055 <bits name="..." width="0.4"/>
4056 <bits name="next" above="8" width="0.3"/>
4057 <bits name="src" above="128" width="0.8"/>
4058 <bits name="dst" above="128" width="0.8" fill="yes"/>
4059 </header>
4060 <dots/>
4061 </diagram>
4062
4063 <p>
4064 Open vSwitch 1.8 added support for bitwise matching; earlier versions
4065 supported only CIDR masks.
4066 </p>
4067 </field>
4068 <field id="MFF_IPV6_LABEL" title="IPv6 Flow Label">
4069 <p>
4070 The least significant 20 bits hold the flow label field from
4071 the IPv6 header. Other bits are zero:
4072 </p>
4073
4074 <diagram>
4075 <header name="OXM_OF_IPV6_FLABEL">
4076 <bits name="zero" above="12" below="0" width=".6"/>
4077 <bits name="label" above="20" width="1.0"/>
4078 </header>
4079 </diagram>
4080 </field>
4081
4082 <h2>IPv4/IPv6 Fields</h2>
4083
4084 <p>
4085 These fields exist with at least approximately the same meaning in both
4086 IPv4 and IPv6, so they are treated as a single field for matching
4087 purposes. Any flow that matches on the IPv4 Ethertype
4088 <code>0x0800</code> or the IPv6 Ethertype <code>0x86dd</code> may match
4089 on these fields.
4090 </p>
4091
4092 <field id="MFF_IP_PROTO" title="IPv4/v6 Protocol">
4093 <p>
4094 Matches the IPv4 or IPv6 protocol type.
4095 </p>
4096
4097 <p>
4098 For historical reasons, in an ARP or RARP flow, Open vSwitch interprets
4099 matches on <code>nw_proto</code> as actually referring to the ARP
4100 opcode. The ARP opcode is a 16-bit field, so for matching purposes ARP
4101 opcodes greater than 255 are treated as 0; this works adequately
4102 because in practice ARP and RARP only use opcodes 1 through 4.
4103 </p>
4104 </field>
4105
4106 <field id="MFF_IP_TTL" title="IPv4/v6 TTL/Hop Limit">
4107 The main reason to match on the TTL or hop limit field is to detect
4108 whether a <code>dec_ttl</code> action will fail due to a TTL exceeded
4109 error. Another way that a controller can detect TTL exceeded is to
4110 listen for <code>OFPR_INVALID_TTL</code> ``packet-in'' messages via
4111 OpenFlow.
4112 </field>
4113
4114 <field id="MFF_IP_FRAG" title="IPv4/v6 Fragment Bitmask">
4115 <p>
4116 Specifies what kinds of IP fragments or non-fragments to match. The
4117 value for this field is most conveniently specified as one of the
4118 following:
4119 </p>
4120
4121 <dl>
4122 <dt><code>no</code></dt>
4123 <dd>
4124 Match only non-fragmented packets.
4125 </dd>
4126
4127 <dt><code>yes</code></dt>
4128 <dd>
4129 Matches all fragments.
4130 </dd>
4131
4132 <dt><code>first</code></dt>
4133 <dd>
4134 Matches only fragments with offset 0.
4135 </dd>
4136
4137 <dt><code>later</code></dt>
4138 <dd>
4139 Matches only fragments with nonzero offset.
4140 </dd>
4141
4142 <dt><code>not_later</code></dt>
4143 <dd>
4144 Matches non-fragmented packets and fragments with zero offset.
4145 </dd>
4146 </dl>
4147
4148 <p>
4149 The field is internally formatted as 2 bits: bit 0 is 1 for an IP
4150 fragment with any offset (and otherwise 0), and bit 1 is 1 for an IP
4151 fragment with nonzero offset (and otherwise 0), like so:
4152 </p>
4153
4154 <diagram>
4155 <header name="NXM_NX_IP_FRAG">
4156 <bits name="zero" above="6" below="0" width=".9"/>
4157 <bits name="later" above="1" width=".3"/>
4158 <bits name="any" above="1" width=".3"/>
4159 </header>
4160 </diagram>
4161
4162 <p>
4163 Even though 2 bits have 4 possible values, this field only uses 3 of
4164 them:
4165 </p>
4166
4167 <ul>
4168 <li>
4169 A packet that is not an IP fragment has value 0.
4170 </li>
4171
4172 <li>
4173 A packet that is an IP fragment with offset 0 (the first fragment)
4174 has bit 0 set and thus value 1.
4175 </li>
4176
4177 <li>
4178 A packet that is an IP fragment with nonzero offset has bits 0 and 1
4179 set and thus value 3.
4180 </li>
4181 </ul>
4182
4183 <p>
4184 The switch may reject matches against values that can never appear.
4185 </p>
4186
4187 <p>
4188 It is important to understand how this field interacts with the
4189 OpenFlow fragment handling mode:
4190 </p>
4191
4192 <ul>
4193 <li>
4194 In <code>OFPC_FRAG_DROP</code> mode, the OpenFlow switch drops all IP
4195 fragments before they reach the flow table, so every packet that is
4196 available for matching will have value 0 in this field.
4197 </li>
4198
4199 <li>
4200 Open vSwitch does not implement <code>OFPC_FRAG_REASM</code> mode,
4201 but if it did then IP fragments would be reassembled before they
4202 reached the flow table and again every packet available for matching
4203 would always have value 0.
4204 </li>
4205
4206 <li>
4207 In <code>OFPC_FRAG_NORMAL</code> mode, all three values are possible,
4208 but OpenFlow 1.0 says that fragments' transport ports are always 0,
4209 even for the first fragment, so this does not provide much extra
4210 information.
4211 </li>
4212
4213 <li>
4214 In <code>OFPC_FRAG_NX_MATCH</code> mode, all three values are
4215 possible. For fragments with offset 0, Open vSwitch makes L4 header
4216 information available.
4217 </li>
4218 </ul>
4219
4220 <p>
4221 Thus, this field is likely to be most useful for an Open vSwitch switch
4222 configured in <code>OFPC_FRAG_NX_MATCH</code> mode. See the
4223 description of the <code>set-frags</code> command in
4224 <code>ovs-ofctl</code>(8), for more details.
4225 </p>
4226 </field>
4227
4228 <h3>IPv4/IPv6 TOS Fields</h3>
4229
4230 <p>
4231 IPv4 and IPv6 contain a one-byte ``type of service'' or TOS field that
4232 has the following format:
4233 </p>
4234
4235 <diagram>
4236 <header name="type of service">
4237 <bits name="DSCP" above="6" width=".9"/>
4238 <bits name="ECN" above="2" width=".3"/>
4239 </header>
4240 </diagram>
4241
4242 <field id="MFF_IP_DSCP" title="IPv4/v6 DSCP (Bits 2-7)">
4243 <p>
4244 This field is the TOS byte with the two ECN bits cleared to 0:
4245 </p>
4246
4247 <diagram>
4248 <header name="NXM_OF_IP_TOS">
4249 <bits name="DSCP" above="6" width=".9"/>
4250 <bits name="zero" above="2" below="0" width=".3"/>
4251 </header>
4252 </diagram>
4253 </field>
4254 <field id="MFF_IP_DSCP_SHIFTED" title="IPv4/v6 DSCP (Bits 0-5)">
4255 <p>
4256 This field is the TOS byte shifted right to put the DSCP bits in the
4257 6 least-significant bits:
4258 </p>
4259
4260 <diagram>
4261 <header name="OXM_OF_IP_DSCP">
4262 <bits name="zero" above="2" below="0" width=".3"/>
4263 <bits name="DSCP" above="6" width=".9"/>
4264 </header>
4265 </diagram>
4266 </field>
4267 <field id="MFF_IP_ECN" title="IPv4/v6 ECN">
4268 <p>
4269 This field is the TOS byte with the DSCP bits cleared to 0:
4270 </p>
4271
4272 <diagram>
4273 <header name="OXM_OF_IP_ECN">
4274 <bits name="zero" above="6" below="0" width=".9"/>
4275 <bits name="ECN" above="2" width=".35"/>
4276 </header>
4277 </diagram>
4278 </field>
4279
4280 </group>
4281
4282 <group title="Layer 3: ARP">
4283 <p>
4284 In theory, Address Resolution Protocol, or ARP, is a generic protocol
4285 generic protocol that can be used to obtain the hardware address that
4286 corresponds to any higher-level protocol address. In contemporary usage,
4287 ARP is used only in Ethernet networks to obtain the Ethernet address for
4288 a given IPv4 address. OpenFlow and Open vSwitch only support this usage
4289 of ARP. For this use case, an ARP packet has the following format, with
4290 the ARP fields exposed as Open vSwitch fields highlighted:
4291 </p>
4292
4293 <diagram>
4294 <header name="Ethernet">
4295 <bits name="dst" above="48" width="0.4"/>
4296 <bits name="src" above="48" width="0.4"/>
4297 <bits name="type" above="16" below="0x806" width="0.4"/>
4298 </header>
4299 <header name="ARP">
4300 <bits name="hrd" above="16" below="1" width=".3"/>
4301 <bits name="pro" above="16" below="0x800" width=".3"/>
4302 <bits name="hln" above="8" below="6" width=".2"/>
4303 <bits name="pln" above="8" below="4" width=".2"/>
4304 <bits name="op" above="16" width=".2" fill="yes"/>
4305 <bits name="sha" above="48" width="0.5" fill="yes"/>
4306 <bits name="spa" above="16" width="0.3" fill="yes"/>
4307 <bits name="tha" above="48" width="0.5" fill="yes"/>
4308 <bits name="tpa" above="16" width="0.3" fill="yes"/>
4309 </header>
4310 </diagram>
4311
4312 <p>
4313 The ARP fields are also used for RARP, the Reverse Address Resolution
4314 Protocol, which shares ARP's wire format.
4315 </p>
4316
4317 <field id="MFF_ARP_OP" title="ARP Opcode">
4318 Even though this is a 16-bit field, Open vSwitch does not support ARP
4319 opcodes greater than 255; it treats them to zero. This works adequately
4320 because in practice ARP and RARP only use opcodes 1 through 4.
4321 </field>
4322
4323 <field id="MFF_ARP_SPA" title="ARP Source IPv4 Address"/>
4324 <field id="MFF_ARP_TPA" title="ARP Target IPv4 Address"/>
4325 <field id="MFF_ARP_SHA" title="ARP Source Ethernet Address"/>
4326 <field id="MFF_ARP_THA" title="ARP Target Ethernet Address"/>
4327 </group>
4328
4329 <group title="Layer 3: NSH">
4330 <p>
4331 Service functions are widely deployed and essential in many networks.
4332 These service functions provide a range of features such as security,
4333 WAN acceleration, and server load balancing. Service functions may
4334 be instantiated at different points in the network infrastructure
4335 such as the wide area network, data center, and so forth.
4336 </p>
4337
4338 <p>
4339 Prior to development of the SFC architecture [RFC 7665] and the
4340 protocol specified in this document, current service function
4341 deployment models have been relatively static and bound to topology
4342 for insertion and policy selection. Furthermore, they do not adapt
4343 well to elastic service environments enabled by virtualization.
4344 </p>
4345
4346 <p>
4347 New data center network and cloud architectures require more flexible
4348 service function deployment models. Additionally, the transition to
4349 virtual platforms demands an agile service insertion model that
4350 supports dynamic and elastic service delivery. Specifically, the
4351 following functions are necessary:
4352 </p>
4353
4354 <ol>
4355 <li>
4356 The movement of service functions and application workloads in
4357 the network.
4358 </li>
4359
4360 <li>
4361 The ability to easily bind service policy to granular information, such
4362 as per-subscriber state.
4363 </li>
4364
4365 <li>
4366 The capability to steer traffic to the requisite service function(s).
4367 </li>
4368 </ol>
4369
4370 <p>
4371 The Network Service Header (NSH) specification defines a new data
4372 plane protocol, which is an encapsulation for service function
4373 chains. The NSH is designed to encapsulate an original packet or
4374 frame, and in turn be encapsulated by an outer transport
4375 encapsulation (which is used to deliver the NSH to NSH-aware network
4376 elements), as shown below:
4377 </p>
4378
4379 <diagram>
4380 <header>
4381 <bits name="Transport Encapsulation" width="1.8"/>
4382 </header>
4383 <nospace/>
4384 <header>
4385 <bits name="Network Service Header (NSH)" width="2.0"/>
4386 </header>
4387 <nospace/>
4388 <header>
4389 <bits name="Original Packet/Frame" width="1.8"/>
4390 </header>
4391 </diagram>
4392
4393 <p>
4394 The NSH is composed of the following elements:
4395 </p>
4396
4397 <ol>
4398 <li>Service Function Path identification.</li>
4399 <li>Indication of location within a Service Function Path.</li>
4400 <li>Optional, per packet metadata (fixed length or variable).</li>
4401 </ol>
4402
4403 <p>
4404 [RFC 7665] provides an overview of a service chaining architecture
4405 that clearly defines the roles of the various elements and the scope
4406 of a service function chaining encapsulation. Figure 3 of [RFC 7665]
4407 depicts the SFC architectural components after classification. The
4408 NSH is the SFC encapsulation referenced in [RFC 7665].
4409 </p>
4410
4411 <field id="MFF_NSH_FLAGS"
4412 title="flags field (2 bits)"/>
4413 <field id="MFF_NSH_TTL"
4414 title="TTL field (6 bits)"/>
4415 <field id="MFF_NSH_MDTYPE"
4416 title="mdtype field (8 bits)"/>
4417 <field id="MFF_NSH_NP"
4418 title="np (next protocol) field (8 bits)"/>
4419 <field id="MFF_NSH_SPI"
4420 title="spi (service path identifier) field (24 bits)"/>
4421 <field id="MFF_NSH_SI"
4422 title="si (service index) field (8 bits)"/>
4423 <field id="MFF_NSH_C1"
4424 title="c1 (Network Platform Context) field (32 bits)"/>
4425 <field id="MFF_NSH_C2"
4426 title="c2 (Network Shared Context) field (32 bits)"/>
4427 <field id="MFF_NSH_C3"
4428 title="c3 (Service Platform Context) field (32 bits)"/>
4429 <field id="MFF_NSH_C4"
4430 title="c4 (Service Shared Context) field (32 bits)"/>
4431 </group>
4432
4433
4434 <group title="Layer 4: TCP, UDP, and SCTP">
4435 <p>
4436 For matching purposes, no distinction is made whether these protocols are
4437 encapsulated within IPv4 or IPv6.
4438 </p>
4439
4440 <h2>TCP</h2>
4441
4442 <p>
4443 The following diagram shows TCP within IPv4. Open vSwitch also supports
4444 TCP in IPv6. Only TCP fields implemented as Open vSwitch fields are
4445 shown:
4446 </p>
4447
4448 <diagram>
4449 <header name="Ethernet">
4450 <bits name="dst" above="48" width="0.4"/>
4451 <bits name="src" above="48" width="0.4"/>
4452 <bits name="type" above="16" below="0x800" width="0.4"/>
4453 </header>
4454 <header name="IPv4">
4455 <bits name="..." width="0.4"/>
4456 <bits name="proto" above="8" below="6" width="0.3"/>
4457 <bits name="src" above="32" width="0.4"/>
4458 <bits name="dst" above="32" width="0.4"/>
4459 </header>
4460 <header name="TCP">
4461 <bits name="src" above="16" width=".2"/>
4462 <bits name="dst" above="16" width=".2"/>
4463 <bits name="..." width=".75"/>
4464 <bits name="flags" above="12" width=".3"/>
4465 <bits name="..." width=".6"/>
4466 </header>
4467 <dots/>
4468 </diagram>
4469 <field id="MFF_TCP_SRC" title="TCP Source Port">
4470 Open vSwitch 1.6 added support for bitwise matching.
4471 </field>
4472 <field id="MFF_TCP_DST" title="TCP Destination Port">
4473 Open vSwitch 1.6 added support for bitwise matching.
4474 </field>
4475 <field id="MFF_TCP_FLAGS" title="TCP Flags">
4476 <p>
4477 This field holds the TCP flags. TCP currently defines 9 flag bits. An
4478 additional 3 bits are reserved. For more information, see [RFC 793],
4479 [RFC 3168], and [RFC 3540].
4480 </p>
4481
4482 <p>
4483 Matches on this field are most conveniently written in terms of
4484 symbolic names (given in the diagram below), each preceded by either
4485 <code>+</code> for a flag that must be set, or <code>-</code> for a
4486 flag that must be unset, without any other delimiters between the
4487 flags. Flags not mentioned are wildcarded. For example,
4488 <code>tcp,tcp_flags=+syn-ack</code> matches TCP SYNs that are not ACKs,
4489 and <code>tcp,tcp_flags=+[200]</code> matches TCP packets with the
4490 reserved [200] flag set. Matches can also be written as
4491 <code><var>flags</var>/<var>mask</var></code>, where <var>flags</var>
4492 and <var>mask</var> are 16-bit numbers in decimal or in hexadecimal
4493 prefixed by <code>0x</code>.
4494 </p>
4495
4496 <p>
4497 The flag bits are:
4498 </p>
4499
4500 <diagram>
4501 <header>
4502 <bits name="zero" above="4" below="0" width=".9"/>
4503 </header>
4504 <nospace/>
4505 <header name="reserved">
4506 <bits name="[800]" above="1" width=".35"/>
4507 <bits name="[400]" above="1" width=".35"/>
4508 <bits name="[200]" above="1" width=".35"/>
4509 </header>
4510 <nospace/>
4511 <header name="later RFCs">
4512 <bits name="NS" above="1" width=".35"/>
4513 <bits name="CWR" above="1" width=".35"/>
4514 <bits name="ECE" above="1" width=".35"/>
4515 </header>
4516 <nospace/>
4517 <header name="RFC 793">
4518 <bits name="URG" above="1" width=".35"/>
4519 <bits name="ACK" above="1" width=".35"/>
4520 <bits name="PSH" above="1" width=".35"/>
4521 <bits name="RST" above="1" width=".35"/>
4522 <bits name="SYN" above="1" width=".35"/>
4523 <bits name="FIN" above="1" width=".35"/>
4524 </header>
4525 </diagram>
4526 </field>
4527
4528 <h2>UDP</h2>
4529
4530 <p>
4531 The following diagram shows UDP within IPv4. Open vSwitch also supports
4532 UDP in IPv6. Only UDP fields that Open vSwitch exposes as fields are
4533 shown:
4534 </p>
4535
4536 <diagram>
4537 <header name="Ethernet">
4538 <bits name="dst" above="48" width="0.4"/>
4539 <bits name="src" above="48" width="0.4"/>
4540 <bits name="type" above="16" below="0x800" width="0.4"/>
4541 </header>
4542 <header name="IPv4">
4543 <bits name="..." width="0.4"/>
4544 <bits name="proto" above="8" below="17" width="0.3"/>
4545 <bits name="src" above="32" width="0.4"/>
4546 <bits name="dst" above="32" width="0.4"/>
4547 </header>
4548 <header name="UDP">
4549 <bits name="src" above="16" width=".2"/>
4550 <bits name="dst" above="16" width=".2"/>
4551 <bits name="..." width=".4"/>
4552 </header>
4553 <dots/>
4554 </diagram>
4555 <field id="MFF_UDP_SRC" title="UDP Source Port"/>
4556 <field id="MFF_UDP_DST" title="UDP Destination Port"/>
4557
4558 <h2>SCTP</h2>
4559
4560 <p>
4561 The following diagram shows SCTP within IPv4. Open vSwitch also supports
4562 SCTP in IPv6. Only SCTP fields that Open vSwitch exposes as fields are
4563 shown:
4564 </p>
4565
4566 <diagram>
4567 <header name="Ethernet">
4568 <bits name="dst" above="48" width="0.4"/>
4569 <bits name="src" above="48" width="0.4"/>
4570 <bits name="type" above="16" below="0x800" width="0.4"/>
4571 </header>
4572 <header name="IPv4">
4573 <bits name="..." width="0.4"/>
4574 <bits name="proto" above="8" below="132" width="0.3"/>
4575 <bits name="src" above="32" width="0.4"/>
4576 <bits name="dst" above="32" width="0.4"/>
4577 </header>
4578 <header name="SCTP">
4579 <bits name="src" above="16" width=".2"/>
4580 <bits name="dst" above="16" width=".2"/>
4581 <bits name="..." width=".8"/>
4582 </header>
4583 <dots/>
4584 </diagram>
4585 <field id="MFF_SCTP_SRC" title="SCTP Source Port"/>
4586 <field id="MFF_SCTP_DST" title="SCTP Destination Port"/>
4587 </group>
4588
4589 <group title="Layer 4: ICMPv4 and ICMPv6">
4590 <h2>ICMPv4</h2>
4591 <diagram>
4592 <header name="Ethernet">
4593 <bits name="dst" above="48" width="0.4"/>
4594 <bits name="src" above="48" width="0.4"/>
4595 <bits name="type" above="16" below="0x800" width="0.4"/>
4596 </header>
4597 <header name="IPv4">
4598 <bits name="..." width="0.4"/>
4599 <bits name="proto" above="8" below="1" width="0.3"/>
4600 <bits name="src" above="32" width="0.4"/>
4601 <bits name="dst" above="32" width="0.4"/>
4602 </header>
4603 <header name="ICMPv4">
4604 <bits name="type" above="8" width=".3"/>
4605 <bits name="code" above="8" width=".3"/>
4606 <bits name="..." width=".8"/>
4607 </header>
4608 <dots/>
4609 </diagram>
4610 <field id="MFF_ICMPV4_TYPE" title="ICMPv4 Type">
4611 <p>
4612 For historical reasons, in an ICMPv4 flow, Open vSwitch interprets
4613 matches on <code>tp_src</code> as actually referring to the ICMP type.
4614 </p>
4615 </field>
4616 <field id="MFF_ICMPV4_CODE" title="ICMPv4 Code">
4617 <p>
4618 For historical reasons, in an ICMPv4 flow, Open vSwitch interprets
4619 matches on <code>tp_dst</code> as actually referring to the ICMP code.
4620 </p>
4621 </field>
4622
4623 <h2>ICMPv6</h2>
4624 <diagram>
4625 <header name="Ethernet">
4626 <bits name="dst" above="48" width="0.4"/>
4627 <bits name="src" above="48" width="0.4"/>
4628 <bits name="type" above="16" below="0x86dd" width="0.4"/>
4629 </header>
4630 <header name="IPv6">
4631 <bits name="..." width="0.2"/>
4632 <bits name="next" above="8" below="58" width="0.3"/>
4633 <bits name="src" above="128" width="0.4"/>
4634 <bits name="dst" above="128" width="0.4"/>
4635 </header>
4636 <header name="ICMPv6">
4637 <bits name="type" above="8" width=".3"/>
4638 <bits name="code" above="8" width=".3"/>
4639 <bits name="..." width=".8"/>
4640 </header>
4641 <dots/>
4642 </diagram>
4643 <field id="MFF_ICMPV6_TYPE" title="ICMPv6 Type"/>
4644 <field id="MFF_ICMPV6_CODE" title="ICMPv6 Code"/>
4645
4646 <h2>ICMPv6 Neighbor Discovery</h2>
4647 <diagram>
4648 <header name="Ethernet">
4649 <bits name="dst" above="48" width="0.4"/>
4650 <bits name="src" above="48" width="0.4"/>
4651 <bits name="type" above="16" below="0x86dd" width="0.4"/>
4652 </header>
4653 <header name="IPv6">
4654 <bits name="..." width="0.2"/>
4655 <bits name="next" above="8" below="58" width="0.3"/>
4656 <bits name="src" above="128" width="0.4"/>
4657 <bits name="dst" above="128" width="0.4"/>
4658 </header>
4659 <header name="ICMPv6">
4660 <bits name="type" above="8" below="135/136" width=".3"/>
4661 <bits name="code" above="8" below="0" width=".3"/>
4662 <bits name="..." width=".8"/>
4663 </header>
4664 <header name="ICMPv6 ND">
4665 <bits name="target" above="128" width=".4"/>
4666 <bits name="option ..." width=".6"/>
4667 </header>
4668 </diagram>
4669 <field id="MFF_ND_TARGET" title="ICMPv6 Neighbor Discovery Target IPv6"/>
4670 <field id="MFF_ND_SLL"
4671 title="ICMPv6 Neighbor Discovery Source Ethernet Address"/>
4672 <field id="MFF_ND_TLL"
4673 title="ICMPv6 Neighbor Discovery Target Ethernet Address"/>
4674 <field id="MFF_ND_RESERVED"
4675 title="ICMPv6 Neighbor Discovery Reserved Field"/>
4676 <p>
4677 This is used to set the R,S,O bits in Neighbor Advertisement Messages
4678 </p>
4679 <field id="MFF_ND_OPTIONS_TYPE"
4680 title="ICMPv6 Neighbor Discovery Options Type Field"/>
4681 <p>
4682 A value of 1 indicates that the option is Source Link Layer.
4683 A value of 2 indicates that the options is Target Link Layer.
4684 See RFC 4861 for further details.
4685 </p>
4686 </group>
4687
4688 <h1>References</h1>
4689
4690 <dl>
4691 <dt>Casado</dt>
4692 <dd>
4693 M. Casado, M. J. Freedman, J. Pettit, J. Luo, N. McKeown, and
4694 S. Shenker, ``Ethane: Taking Control of the Enterprise,''
4695 Computer Communications Review, October 2007.
4696 </dd>
4697
4698 <dt>ERSPAN</dt>
4699 <dd>
4700 M. Foschiano, K. Ghosh, M. Mehta, ``Cisco Systems' Encapsulated Remote
4701 Switch Port Analyzer (ERSPAN),'' <url
4702 href="https://tools.ietf.org/html/draft-foschiano-erspan-03"/>.
4703 </dd>
4704
4705 <dt>EXT-56</dt>
4706 <dd>
4707 J. Tonsing, ``Permit one of a set of prerequisites to apply, e.g. don't
4708 preclude non-Ethernet media,'' <url
4709 href="https://rs.opennetworking.org/bugs/browse/EXT-56"/> (ONF
4710 members only).
4711 </dd>
4712
4713 <dt>EXT-112</dt>
4714 <dd>
4715 J. Tourrilhes, ``Support non-Ethernet packets throughout the
4716 pipeline,'' <url
4717 href="https://rs.opennetworking.org/bugs/browse/EXT-112"/> (ONF
4718 members only).
4719 </dd>
4720
4721 <dt>EXT-134</dt>
4722 <dd>
4723 J. Tourrilhes, ``Match first nibble of the MPLS payload,'' <url
4724 href="https://rs.opennetworking.org/bugs/browse/EXT-134"/> (ONF
4725 members only).
4726 </dd>
4727
4728 <dt>Geneve</dt>
4729 <dd>
4730 J. Gross, I. Ganga, and T. Sridhar, editors, ``Geneve: Generic Network
4731 Virtualization Encapsulation,'' <url
4732 href="https://datatracker.ietf.org/doc/draft-ietf-nvo3-geneve/"/>.
4733 </dd>
4734
4735 <dt>IEEE OUI</dt>
4736 <dd>
4737 IEEE Standards Association, ``MAC Address Block Large (MA-L),''
4738 <url
4739 href="https://standards.ieee.org/develop/regauth/oui/index.html"/>.
4740 </dd>
4741
4742 <dt>NSH</dt>
4743 <dd>
4744 P. Quinn and U. Elzur, editors, ``Network Service Header,'' <url
4745 href="https://datatracker.ietf.org/doc/draft-ietf-sfc-nsh/"/>.
4746 </dd>
4747
4748 <dt>OpenFlow 1.0.1</dt>
4749 <dd>
4750 Open Networking Foundation, ``OpenFlow Switch Errata, Version
4751 1.0.1,'' June 2012.
4752 </dd>
4753
4754 <dt>OpenFlow 1.1</dt>
4755 <dd>
4756 OpenFlow Consortium, ``OpenFlow Switch Specification Version
4757 1.1.0 Implemented (Wire Protocol 0x02),'' February 2011.
4758 </dd>
4759
4760 <dt>OpenFlow 1.5</dt>
4761 <dd>
4762 Open Networking Foundation, ``OpenFlow Switch Specification Version
4763 1.5.0 (Protocol version 0x06),'' December 2014.
4764 </dd>
4765
4766 <dt>OpenFlow Extensions 1.3.x Package 2</dt>
4767 <dd>
4768 Open Networking Foundation, ``OpenFlow Extensions 1.3.x Package 2,''
4769 December 2013.
4770 </dd>
4771
4772 <dt>TCP Flags Match Field Extension</dt>
4773 <dd>
4774 Open Networking Foundation, ``TCP flags match field Extension,'' December
4775 2014. In [OpenFlow Extensions 1.3.x Package 2].
4776 </dd>
4777
4778 <dt>Pepelnjak</dt>
4779 <dd>
4780 I. Pepelnjak, ``OpenFlow and Fermi Estimates,'' <url
4781 href="http://blog.ipspace.net/2013/09/openflow-and-fermi-estimates.html"/>.
4782 </dd>
4783
4784 <dt>RFC 793</dt>
4785 <dd>
4786 ``Transmission Control Protocol,'' <url
4787 href="http://www.ietf.org/rfc/rfc793.txt"/>.
4788 </dd>
4789
4790 <dt>RFC 3032</dt>
4791 <dd>
4792 E. Rosen, D. Tappan, G. Fedorkow, Y. Rekhter, D. Farinacci,
4793 T. Li, and A. Conta, ``MPLS Label Stack Encoding,'' <url
4794 href="http://www.ietf.org/rfc/rfc3032.txt"/>.
4795 </dd>
4796
4797 <dt>RFC 3168</dt>
4798 <dd>
4799 K. Ramakrishnan, S. Floyd, and D. Black, ``The Addition of Explicit
4800 Congestion Notification (ECN) to IP,'' <url href="https://tools.ietf.org/html/rfc3168"/>.
4801 </dd>
4802
4803 <dt>RFC 3540</dt>
4804 <dd>
4805 N. Spring, D. Wetherall, and D. Ely, ``Robust Explicit Congestion
4806 Notification (ECN) Signaling with Nonces,'' <url
4807 href="https://tools.ietf.org/html/rfc3540"/>.
4808 </dd>
4809
4810 <dt>RFC 4632</dt>
4811 <dd>
4812 V. Fuller and T. Li, ``Classless Inter-domain Routing (CIDR): The
4813 Internet Address Assignment and Aggregation Plan,'' <url
4814 href="https://tools.ietf.org/html/rfc4632"/>.
4815 </dd>
4816
4817 <dt>RFC 5462</dt>
4818 <dd>
4819 L. Andersson and R. Asati, ``Multiprotocol Label Switching
4820 (MPLS) Label Stack Entry: ``EXP'' Field Renamed to ``Traffic
4821 Class'' Field,'' <url
4822 href="http://www.ietf.org/rfc/rfc5462.txt"/>.
4823 </dd>
4824
4825 <dt>RFC 6830</dt>
4826 <dd>
4827 D. Farinacci, V. Fuller, D. Meyer, and D. Lewis, ``The
4828 Locator/ID Separation Protocol (LISP),'' <url
4829 href="http://www.ietf.org/rfc/rfc6830.txt"/>.
4830 </dd>
4831
4832 <dt>RFC 7348</dt>
4833 <dd>
4834 M. Mahalingam, D. Dutt, K. Duda, P. Agarwal, L. Kreeger, T. Sridhar,
4835 M. Bursell, and C. Wright, ``Virtual eXtensible Local Area Network
4836 (VXLAN): A Framework for Overlaying Virtualized Layer 2 Networks over
4837 Layer 3 Networks, '' <url href="https://tools.ietf.org/html/rfc7348"/>.
4838 </dd>
4839
4840 <dt>RFC 7665</dt>
4841 <dd>
4842 J. Halpern, Ed. and C. Pignataro, Ed.,
4843 ``Service Function Chaining (SFC) Architecture,''
4844 <url href="https://tools.ietf.org/html/rfc7665"/>.
4845 </dd>
4846
4847 <dt>Srinivasan</dt>
4848 <dd>
4849 V. Srinivasan, S. Suriy, and G. Varghese, ``Packet
4850 Classification using Tuple Space Search,'' SIGCOMM 1999.
4851 </dd>
4852
4853 <dt>Pagiamtzis</dt>
4854 <dd>
4855 K. Pagiamtzis and A. Sheikholeslami, ``Content-addressable
4856 memory (CAM) circuits and architectures: A tutorial and
4857 survey,'' IEEE Journal of Solid-State Circuits, vol. 41, no. 3,
4858 pp. 712-727, March 2006.
4859 </dd>
4860
4861 <dt>VXLAN Group Policy Option</dt>
4862 <dd>
4863 M. Smith and L. Kreeger, `` VXLAN Group Policy Option.'' Internet-Draft.
4864 <url href="https://tools.ietf.org/html/draft-smith-vxlan-group-policy"/>.
4865 </dd>
4866 </dl>
4867
4868 <h1>Authors</h1>
4869
4870 <p>
4871 Ben Pfaff, with advice from Justin Pettit and Jean Tourrilhes.
4872 </p>
4873
4874 </fields>
4875
4876 <!--
4877 OXM fields not yet supported Future Directions References/See Also
4878 OXM fields required by various versions and by the "Conformance Test Specification for OpenFlow Switch Specification 1.0.1"
4879 -->