395d85114848e0db64b3cceb596b7f5152406961
[cascardo/ovs.git] / utilities / ovs-ofctl.8.in
1 .\" -*- nroff -*-
2 .de IQ
3 .  br
4 .  ns
5 .  IP "\\$1"
6 ..
7 .TH ovs\-ofctl 8 "@VERSION@" "Open vSwitch" "Open vSwitch Manual"
8 .ds PN ovs\-ofctl
9 .
10 .SH NAME
11 ovs\-ofctl \- administer OpenFlow switches
12 .
13 .SH SYNOPSIS
14 .B ovs\-ofctl
15 [\fIoptions\fR] \fIcommand \fR[\fIswitch\fR] [\fIargs\fR\&...]
16 .
17 .SH DESCRIPTION
18 The
19 .B ovs\-ofctl
20 program is a command line tool for monitoring and administering
21 OpenFlow switches.  It can also show the current state of an OpenFlow
22 switch, including features, configuration, and table entries.
23 It should work with any OpenFlow switch, not just Open vSwitch.
24 .
25 .SS "OpenFlow Switch Management Commands"
26 .PP
27 These commands allow \fBovs\-ofctl\fR to monitor and administer an OpenFlow
28 switch.  It is able to show the current state of a switch, including
29 features, configuration, and table entries.
30 .PP
31 Most of these commands take an argument that specifies the method for
32 connecting to an OpenFlow switch.  The following connection methods
33 are supported:
34 .
35 .RS
36 .so lib/vconn-active.man
37 .
38 .IP "\fIfile\fR"
39 This is short for \fBunix:\fIfile\fR, as long as \fIfile\fR does not
40 contain a colon.
41 .
42 .IP \fIbridge\fR
43 This is short for \fBunix:@RUNDIR@/\fIbridge\fB.mgmt\fR, as long as
44 \fIbridge\fR does not contain a colon.
45 .
46 .IP [\fItype\fB@\fR]\fIdp\fR
47 Attempts to look up the bridge associated with \fIdp\fR and open as
48 above.  If \fItype\fR is given, it specifies the datapath provider of
49 \fIdp\fR, otherwise the default provider \fBsystem\fR is assumed.
50 .RE
51 .
52 .TP
53 \fBshow \fIswitch\fR
54 Prints to the console information on \fIswitch\fR, including
55 information on its flow tables and ports.
56 .
57 .TP
58 \fBdump\-tables \fIswitch\fR
59 Prints to the console statistics for each of the flow tables used by
60 \fIswitch\fR.
61 .TP
62 \fBdump\-table\-features \fIswitch\fR
63 Prints to the console features for each of the flow tables used by
64 \fIswitch\fR.
65 .
66 .IP "\fBmod\-table \fIswitch\fR \fItable_id\fR  \fIflow_miss_handling\fR"
67 An OpenFlow 1.0 switch looks up each packet that arrives at the switch
68 in table 0, then in table 1 if there is no match in table 0, then in
69 table 2, and so on until the packet finds a match in some table.
70 Finally, if no match was found, the switch sends the packet to the
71 controller
72 .IP
73 OpenFlow 1.1 and later offer more flexibility.  This command
74 configures the flow table miss handling configuration for table
75 \fItable_id\fR in \fIswitch\fR.  \fItable_id\fR may be an OpenFlow
76 table number between 0 and 254, inclusive, or the keyword \fBALL\fR to
77 modify all tables.  \fIflow_miss_handling\fR may be any one of the
78 following:
79 .RS
80 .IP \fBdrop\fR
81 Drop the packet.
82 .IP \fBcontinue\fR
83 Continue to the next table in the pipeline.  (This is how an OpenFlow
84 1.0 switch always handles packets that do not match any flow, in
85 tables other than the last one.)
86 .IP \fBcontroller\fR
87 Send to controller.  (This is how an OpenFlow 1.0 switch always
88 handles packets that do not match any flow in the last table.)
89 .RE
90 .
91 .TP
92 \fBdump\-ports \fIswitch\fR [\fInetdev\fR]
93 Prints to the console statistics for network devices associated with 
94 \fIswitch\fR.  If \fInetdev\fR is specified, only the statistics
95 associated with that device will be printed.  \fInetdev\fR can be an
96 OpenFlow assigned port number or device name, e.g. \fBeth0\fR.
97 .
98 .IP "\fBdump\-ports\-desc \fIswitch\fR [\fIport\fR]"
99 Prints to the console detailed information about network devices
100 associated with \fIswitch\fR.  To dump only a specific port, specify
101 its number as \fIport\fR.  Otherwise, if \fIport\fR is omitted, or if
102 it is specified as \fBANY\fR, then all ports are printed.  This is a
103 subset of the information provided by the \fBshow\fR command.
104 .IP
105 If the connection to \fIswitch\fR negotiates OpenFlow 1.0, 1.2, or
106 1.2, this command uses an OpenFlow extension only implemented in Open
107 vSwitch (version 1.7 and later).
108 .IP
109 Only OpenFlow 1.5 and later support dumping a specific port.  Earlier
110 versions of OpenFlow always dump all ports.
111 .
112 .IP "\fBmod\-port \fIswitch\fR \fIport\fR \fIaction\fR"
113 Modify characteristics of port \fBport\fR in \fIswitch\fR.  \fIport\fR
114 may be an OpenFlow port number or name or the keyword \fBLOCAL\fR (the
115 preferred way to refer to the OpenFlow local port).  The \fIaction\fR
116 may be any one of the following:
117 .
118 .RS
119 .IQ \fBup\fR
120 .IQ \fBdown\fR
121 Enable or disable the interface.  This is equivalent to \fBifconfig
122 up\fR or \fBifconfig down\fR on a Unix system.
123 .
124 .IP \fBstp\fR
125 .IQ \fBno\-stp\fR
126 Enable or disable 802.1D spanning tree protocol (STP) on the
127 interface.  OpenFlow implementations that don't support STP will
128 refuse to enable it.
129 .
130 .IP \fBreceive\fR
131 .IQ \fBno\-receive\fR
132 .IQ \fBreceive\-stp\fR
133 .IQ \fBno\-receive\-stp\fR
134 Enable or disable OpenFlow processing of packets received on this
135 interface.  When packet processing is disabled, packets will be
136 dropped instead of being processed through the OpenFlow table.  The
137 \fBreceive\fR or \fBno\-receive\fR setting applies to all packets
138 except 802.1D spanning tree packets, which are separately controlled
139 by \fBreceive\-stp\fR or \fBno\-receive\-stp\fR.
140 .
141 .IP \fBforward\fR
142 .IQ \fBno\-forward\fR
143 Allow or disallow forwarding of traffic to this interface.  By
144 default, forwarding is enabled.
145 .
146 .IP \fBflood\fR
147 .IQ \fBno\-flood\fR
148 Controls whether an OpenFlow \fBflood\fR action will send traffic out
149 this interface.  By default, flooding is enabled.  Disabling flooding
150 is primarily useful to prevent loops when a spanning tree protocol is
151 not in use.
152 .
153 .IP \fBpacket\-in\fR
154 .IQ \fBno\-packet\-in\fR
155 Controls whether packets received on this interface that do not match
156 a flow table entry generate a ``packet in'' message to the OpenFlow
157 controller.  By default, ``packet in'' messages are enabled.
158 .RE
159 .IP
160 The \fBshow\fR command displays (among other information) the
161 configuration that \fBmod\-port\fR changes.
162 .
163 .IP "\fBget\-frags \fIswitch\fR"
164 Prints \fIswitch\fR's fragment handling mode.  See \fBset\-frags\fR,
165 below, for a description of each fragment handling mode.
166 .IP
167 The \fBshow\fR command also prints the fragment handling mode among
168 its other output.
169 .
170 .IP "\fBset\-frags \fIswitch frag_mode\fR"
171 Configures \fIswitch\fR's treatment of IPv4 and IPv6 fragments.  The
172 choices for \fIfrag_mode\fR are:
173 .RS
174 .IP "\fBnormal\fR"
175 Fragments pass through the flow table like non-fragmented packets.
176 The TCP ports, UDP ports, and ICMP type and code fields are always set
177 to 0, even for fragments where that information would otherwise be
178 available (fragments with offset 0).  This is the default fragment
179 handling mode for an OpenFlow switch.
180 .IP "\fBdrop\fR"
181 Fragments are dropped without passing through the flow table.
182 .IP "\fBreassemble\fR"
183 The switch reassembles fragments into full IP packets before passing
184 them through the flow table.  Open vSwitch does not implement this
185 fragment handling mode.
186 .IP "\fBnx\-match\fR"
187 Fragments pass through the flow table like non-fragmented packets.
188 The TCP ports, UDP ports, and ICMP type and code fields are available
189 for matching for fragments with offset 0, and set to 0 in fragments
190 with nonzero offset.  This mode is a Nicira extension.
191 .RE
192 .IP
193 See the description of \fBip_frag\fR, below, for a way to match on
194 whether a packet is a fragment and on its fragment offset.
195 .
196 .TP
197 \fBdump\-flows \fIswitch \fR[\fIflows\fR]
198 Prints to the console all flow entries in \fIswitch\fR's
199 tables that match \fIflows\fR.  If \fIflows\fR is omitted, all flows
200 in the switch are retrieved.  See \fBFlow Syntax\fR, below, for the
201 syntax of \fIflows\fR.  The output format is described in
202 \fBTable Entry Output\fR.
203 .
204 .IP
205 By default, \fBovs\-ofctl\fR prints flow entries in the same order
206 that the switch sends them, which is unlikely to be intuitive or
207 consistent.  See the description of \fB\-\-sort\fR and \fB\-\-rsort\fR,
208 under \fBOPTIONS\fR below, to influence the display order.
209 .
210 .TP
211 \fBdump\-aggregate \fIswitch \fR[\fIflows\fR]
212 Prints to the console aggregate statistics for flows in
213 \fIswitch\fR's tables that match \fIflows\fR.  If \fIflows\fR is omitted, 
214 the statistics are aggregated across all flows in the switch's flow
215 tables.  See \fBFlow Syntax\fR, below, for the syntax of \fIflows\fR.
216 The output format is described in \fBTable Entry Output\fR.
217 .
218 .IP "\fBqueue\-stats \fIswitch \fR[\fIport \fR[\fIqueue\fR]]"
219 Prints to the console statistics for the specified \fIqueue\fR on
220 \fIport\fR within \fIswitch\fR.  \fIport\fR can be an OpenFlow port
221 number or name, the keyword \fBLOCAL\fR (the preferred way to refer to
222 the OpenFlow local port), or the keyword \fBALL\fR.  Either of
223 \fIport\fR or \fIqueue\fR or both may be omitted (or equivalently the
224 keyword \fBALL\fR).  If both are omitted, statistics are printed for
225 all queues on all ports.  If only \fIqueue\fR is omitted, then
226 statistics are printed for all queues on \fIport\fR; if only
227 \fIport\fR is omitted, then statistics are printed for \fIqueue\fR on
228 every port where it exists.
229 .
230 .SS "OpenFlow 1.1+ Group Table Commands"
231 .
232 The following commands work only with switches that support OpenFlow
233 1.1 or later.  Because support for OpenFlow 1.1 and later is still
234 experimental in Open vSwitch, it is necessary to explicitly enable
235 these protocol versions in \fBovs\-ofctl\fR (using \fB\-O\fR) and in
236 the switch itself (with the \fBprotocols\fR column in the \fBBridge\fR
237 table).  For more information, see ``Q: What versions of OpenFlow does
238 Open vSwitch support?'' in the Open vSwitch FAQ.
239 .
240 .IP "\fBdump\-groups \fIswitch\fR [\fIgroup\fR]"
241 Prints group entries in \fIswitch\fR's tables to console.  To dump
242 only a specific group, specify its number as \fIgroup\fR.  Otherwise,
243 if \fIgroup\fR is omitted, or if it is specified as \fBALL\fR, then
244 all groups are printed.  Each line of output is a group entry as
245 described in \fBGroup Syntax\fR below.
246 .IP
247 Only OpenFlow 1.5 and later support dumping a specific group.  Earlier
248 versions of OpenFlow always dump all groups.
249 .
250 .IP "\fBdump\-group\-features \fIswitch"
251 Prints to the console the group features of the \fIswitch\fR.
252 .
253 .IP "\fBdump\-group-stats \fIswitch \fR[\fIgroups\fR]"
254 Prints to the console statistics for the specified \fIgroups in the
255 \fIswitch\fR's tables.  If \fIgroups\fR is omitted then statistics for all
256 groups are printed.  See \fBGroup Syntax\fR, below, for the syntax of
257 \fIgroups\fR.
258 .
259 .SS "OpenFlow 1.3+ Switch Meter Table Commands"
260 .
261 These commands manage the meter table in an OpenFlow switch.  In each
262 case, \fImeter\fR specifies a meter entry in the format described in
263 \fBMeter Syntax\fR, below.
264 .
265 .PP
266 OpenFlow 1.3 introduced support for meters, so these commands only
267 work with switches that support OpenFlow 1.3 or later.  The caveats
268 described for groups in the previous section also apply to meters.
269 .
270 .IP "\fBadd\-meter \fIswitch meter\fR"
271 Add a meter entry to \fIswitch\fR's tables. The \fImeter\fR syntax is
272 described in section \fBMeter Syntax\fR, below.
273 .
274 .IP "\fBmod\-meter \fIswitch meter\fR"
275 Modify an existing meter.
276 .
277 .IP "\fBdel\-meters \fIswitch\fR"
278 .IQ "\fBdel\-meter \fIswitch\fR [\fImeter\fR]"
279 Delete entries from \fIswitch\fR's meter table.  \fImeter\fR can specify
280 a single meter with syntax \fBmeter=\fIid\fR, or all meters with syntax
281 \fBmeter=all\fR.
282 .
283 .IP "\fBdump\-meters \fIswitch\fR"
284 .IQ "\fBdump\-meter \fIswitch\fR [\fImeter\fR]"
285 Print meter configuration.  \fImeter\fR can specify a single meter with
286 syntax \fBmeter=\fIid\fR, or all meters with syntax \fBmeter=all\fR.
287 .
288 .IP "\fBmeter\-stats \fIswitch\fR [\fImeter\fR]"
289 Print meter statistics.  \fImeter\fR can specify a single meter with
290 syntax \fBmeter=\fIid\fR, or all meters with syntax \fBmeter=all\fR.
291 .
292 .IP "\fBmeter\-features \fIswitch\fR"
293 Print meter features.
294 .
295 .SS "OpenFlow Switch Flow Table Commands"
296 .
297 These commands manage the flow table in an OpenFlow switch.  In each
298 case, \fIflow\fR specifies a flow entry in the format described in
299 \fBFlow Syntax\fR, below, \fIfile\fR is a text file that contains zero
300 or more flows in the same syntax, one per line, and the optional
301 \fB\-\-bundle\fR option operates the command as a single atomic
302 transation, see option \fB\-\-bundle\fR, below.
303 .
304 .IP "[\fB\-\-bundle\fR] \fBadd\-flow \fIswitch flow\fR"
305 .IQ "[\fB\-\-bundle\fR] \fBadd\-flow \fIswitch \fB\- < \fIfile\fR"
306 .IQ "[\fB\-\-bundle\fR] \fBadd\-flows \fIswitch file\fR"
307 Add each flow entry to \fIswitch\fR's tables.
308 .
309 Each flow specification (e.g., each line in \fIfile\fR) may start with
310 \fBadd\fR, \fBmodify\fR, \fBdelete\fR, \fBmodify_strict\fR, or
311 \fBdelete_strict\fR keyword to specify whether a flow is to be added,
312 modified, or deleted, and whether the modify or delete is strict or
313 not.  For backwards compatibility a flow specification without one of
314 these keywords is treated as a flow add.  All flow mods are executed
315 in the order specified.
316 .
317 .IP "[\fB\-\-bundle\fR] [\fB\-\-strict\fR] \fBmod\-flows \fIswitch flow\fR"
318 .IQ "[\fB\-\-bundle\fR] [\fB\-\-strict\fR] \fBmod\-flows \fIswitch \fB\- < \fIfile\fR"
319 Modify the actions in entries from \fIswitch\fR's tables that match
320 the specified flows.  With \fB\-\-strict\fR, wildcards are not treated
321 as active for matching purposes.
322 .
323 .IP "[\fB\-\-bundle\fR] \fBdel\-flows \fIswitch\fR"
324 .IQ "[\fB\-\-bundle\fR] [\fB\-\-strict\fR] \fBdel\-flows \fIswitch \fR[\fIflow\fR]"
325 .IQ "[\fB\-\-bundle\fR] [\fB\-\-strict\fR] \fBdel\-flows \fIswitch \fB\- < \fIfile\fR"
326 Deletes entries from \fIswitch\fR's flow table.  With only a
327 \fIswitch\fR argument, deletes all flows.  Otherwise, deletes flow
328 entries that match the specified flows.  With \fB\-\-strict\fR,
329 wildcards are not treated as active for matching purposes.
330 .
331 .IP "[\fB\-\-bundle\fR] [\fB\-\-readd\fR] \fBreplace\-flows \fIswitch file\fR"
332 Reads flow entries from \fIfile\fR (or \fBstdin\fR if \fIfile\fR is
333 \fB\-\fR) and queries the flow table from \fIswitch\fR.  Then it fixes
334 up any differences, adding flows from \fIflow\fR that are missing on
335 \fIswitch\fR, deleting flows from \fIswitch\fR that are not in
336 \fIfile\fR, and updating flows in \fIswitch\fR whose actions, cookie,
337 or timeouts differ in \fIfile\fR.
338 .
339 .IP
340 With \fB\-\-readd\fR, \fBovs\-ofctl\fR adds all the flows from
341 \fIfile\fR, even those that exist with the same actions, cookie, and
342 timeout in \fIswitch\fR.  This resets all the flow packet and byte
343 counters to 0, which can be useful for debugging.
344 .
345 .IP "\fBdiff\-flows \fIsource1 source2\fR"
346 Reads flow entries from \fIsource1\fR and \fIsource2\fR and prints the
347 differences.  A flow that is in \fIsource1\fR but not in \fIsource2\fR
348 is printed preceded by a \fB\-\fR, and a flow that is in \fIsource2\fR
349 but not in \fIsource1\fR is printed preceded by a \fB+\fR.  If a flow
350 exists in both \fIsource1\fR and \fIsource2\fR with different actions,
351 cookie, or timeouts, then both versions are printed preceded by
352 \fB\-\fR and \fB+\fR, respectively.
353 .IP
354 \fIsource1\fR and \fIsource2\fR may each name a file or a switch.  If
355 a name begins with \fB/\fR or \fB.\fR, then it is considered to be a
356 file name.  A name that contains \fB:\fR is considered to be a switch.
357 Otherwise, it is a file if a file by that name exists, a switch if
358 not.
359 .IP
360 For this command, an exit status of 0 means that no differences were
361 found, 1 means that an error occurred, and 2 means that some
362 differences were found.
363 .
364 .IP "\fBpacket\-out \fIswitch in_port actions packet\fR..."
365 Connects to \fIswitch\fR and instructs it to execute the OpenFlow
366 \fIactions\fR on each \fIpacket\fR.  Each \fBpacket\fR is specified as a
367 series of hex digits.  For the purpose of executing the
368 actions, the packets are considered to have arrived on \fIin_port\fR,
369 which may be an OpenFlow port number or name (e.g. \fBeth0\fR), the
370 keyword \fBLOCAL\fR (the preferred way to refer to the OpenFlow
371 ``local'' port), or the keyword \fBNONE\fR to indicate that the packet
372 was generated by the switch itself.
373 .
374 .SS "OpenFlow Switch Group Table Commands"
375 .
376 These commands manage the group table in an OpenFlow switch.  In each
377 case, \fIgroup\fR specifies a group entry in the format described in
378 \fBGroup Syntax\fR, below, and \fIfile\fR is a text file that contains
379 zero or more groups in the same syntax, one per line.
380
381 .IP "\fBadd\-group \fIswitch group\fR"
382 .IQ "\fBadd\-group \fIswitch \fB\- < \fIfile\fR"
383 .IQ "\fBadd\-groups \fIswitch file\fR"
384 Add each group entry to \fIswitch\fR's tables.
385 .
386 .IP "\fBmod\-group \fIswitch group\fR"
387 .IQ "\fBmod\-group \fIswitch \fB\- < \fIfile\fR"
388 Modify the action buckets in entries from \fIswitch\fR's tables for
389 each group entry.
390 .
391 .IP "\fBdel\-groups \fIswitch\fR"
392 .IQ "\fBdel\-groups \fIswitch \fR[\fIgroup\fR]"
393 .IQ "\fBdel\-groups \fIswitch \fB\- < \fIfile\fR"
394 Deletes entries from \fIswitch\fR's group table.  With only a
395 \fIswitch\fR argument, deletes all groups.  Otherwise, deletes the group
396 for each group entry.
397 .
398 .IP "\fBinsert\-buckets \fIswitch group\fR"
399 .IQ "\fBinsert\-buckets \fIswitch \fB\- < \fIfile\fR"
400 Add buckets to an existing group present in the \fIswitch\fR's group table.
401 If no \fIcommand_bucket_id\fR is present in the group specification then all
402 buckets of the group are removed.
403 .
404 .IP "\fBremove\-buckets \fIswitch group\fR"
405 .IQ "\fBremove\-buckets \fIswitch \fB\- < \fIfile\fR"
406 Remove buckets to an existing group present in the \fIswitch\fR's group table.
407 If no \fIcommand_bucket_id\fR is present in the group specification then all
408 buckets of the group are removed.
409 .
410 .SS "OpenFlow Switch Geneve Option Table Commands"
411 .
412 In order to work with Geneve options, it is necessary to maintain a mapping
413 table between an option (defined by <class, type, length>) and an NXM field
414 that can be operated on for the purposes of matches, actions, etc. This
415 mapping must be explicitly specified by the user through the following
416 commands. The format for \fIoptions\fR is given in \fBOption Syntax\fR below.
417
418 Note that a given mapping should not be changed while it is in active use by
419 a flow. The result of doing so is undefined.
420
421 Currently, the Geneve mapping table is shared between all OpenFlow
422 switches in a given instance of Open vSwitch. This restriction will
423 be lifted in the future to allow for easier management.
424
425 These commands are Nicira extensions to OpenFlow and require Open vSwitch
426 2.5 or later.
427
428 .IP "\fBadd\-geneve\-map \fIswitch options\fR"
429 Add each option entry to \fIswitch\fR's tables. Duplicate fields are
430 rejected.
431 .
432 .IP "\fBdel\-geneve\-map \fIswitch \fR[\fIoptions\fR]"
433 Delete each option entry in \fIswitch\fR's tables based on its field index.
434 Fields that aren't already mapped will be ignored. If no options are
435 specified then the entire table will be cleared.
436 .
437 .IP "\fBdump\-geneve\-map \fIswitch\fR"
438 Show the currently mapped fields in the switch's option table as well
439 as switch capabilities.
440 .
441 .IP "\fBOption Syntax\fR"
442 \fB{class=\fIclass\fB,type=\fItype\fB,len=\fIlength\fB}->tun_metadata\fIn\fR
443
444 An option can be specified in this form (repeating as necessary and
445 separated by commas). For example, the follow is used to map a new option:
446
447 .RS
448 add-geneve-map br0 "{class=0xffff,type=0,len=4}->tun_metadata0"
449 .RE
450 .
451 .SS "OpenFlow Switch Monitoring Commands"
452 .
453 .IP "\fBsnoop \fIswitch\fR"
454 Connects to \fIswitch\fR and prints to the console all OpenFlow
455 messages received.  Unlike other \fBovs\-ofctl\fR commands, if
456 \fIswitch\fR is the name of a bridge, then the \fBsnoop\fR command
457 connects to a Unix domain socket named
458 \fB@RUNDIR@/\fIbridge\fB.snoop\fR.  \fBovs\-vswitchd\fR listens on
459 such a socket for each bridge and sends to it all of the OpenFlow
460 messages sent to or received from its configured OpenFlow controller.
461 Thus, this command can be used to view OpenFlow protocol activity
462 between a switch and its controller.
463 .IP
464 When a switch has more than one controller configured, only the
465 traffic to and from a single controller is output.  If none of the
466 controllers is configured as a master or a slave (using a Nicira
467 extension to OpenFlow 1.0 or 1.1, or a standard request in OpenFlow
468 1.2 or later), then a controller is chosen arbitrarily among
469 them.  If there is a master controller, it is chosen; otherwise, if
470 there are any controllers that are not masters or slaves, one is
471 chosen arbitrarily; otherwise, a slave controller is chosen
472 arbitrarily.  This choice is made once at connection time and does not
473 change as controllers reconfigure their roles.
474 .IP
475 If a switch has no controller configured, or if
476 the configured controller is disconnected, no traffic is sent, so
477 monitoring will not show any traffic.
478 .
479 .IP "\fBmonitor \fIswitch\fR [\fImiss-len\fR] [\fBinvalid_ttl\fR] [\fBwatch:\fR[\fIspec\fR...]]"
480 Connects to \fIswitch\fR and prints to the console all OpenFlow
481 messages received.  Usually, \fIswitch\fR should specify the name of a
482 bridge in the \fBovs\-vswitchd\fR database.
483 .IP
484 If \fImiss-len\fR is provided, \fBovs\-ofctl\fR sends an OpenFlow ``set
485 configuration'' message at connection setup time that requests
486 \fImiss-len\fR bytes of each packet that misses the flow table.  Open vSwitch
487 does not send these and other asynchronous messages to an
488 \fBovs\-ofctl monitor\fR client connection unless a nonzero value is
489 specified on this argument.  (Thus, if \fImiss\-len\fR is not
490 specified, very little traffic will ordinarily be printed.)
491 .IP
492 If \fBinvalid_ttl\fR is passed, \fBovs\-ofctl\fR sends an OpenFlow ``set
493 configuration'' message at connection setup time that requests
494 \fBINVALID_TTL_TO_CONTROLLER\fR, so that \fBovs\-ofctl monitor\fR can
495 receive ``packet-in'' messages when TTL reaches zero on \fBdec_ttl\fR action.
496 .IP
497 \fBwatch:\fR[\fB\fIspec\fR...] causes \fBovs\-ofctl\fR to send a
498 ``monitor request'' Nicira extension message to the switch at
499 connection setup time.  This message causes the switch to send
500 information about flow table changes as they occur.  The following
501 comma-separated \fIspec\fR syntax is available:
502 .RS
503 .IP "\fB!initial\fR"
504 Do not report the switch's initial flow table contents.
505 .IP "\fB!add\fR"
506 Do not report newly added flows.
507 .IP "\fB!delete\fR"
508 Do not report deleted flows.
509 .IP "\fB!modify\fR"
510 Do not report modifications to existing flows.
511 .IP "\fB!own\fR"
512 Abbreviate changes made to the flow table by \fBovs\-ofctl\fR's own
513 connection to the switch.  (These could only occur using the
514 \fBofctl/send\fR command described below under \fBRUNTIME MANAGEMENT
515 COMMANDS\fR.)
516 .IP "\fB!actions\fR"
517 Do not report actions as part of flow updates.
518 .IP "\fBtable=\fInumber\fR"
519 Limits the monitoring to the table with the given \fInumber\fR between
520 0 and 254.  By default, all tables are monitored.
521 .IP "\fBout_port=\fIport\fR"
522 If set, only flows that output to \fIport\fR are monitored.  The
523 \fIport\fR may be an OpenFlow port number or keyword
524 (e.g. \fBLOCAL\fR).
525 .IP "\fIfield\fB=\fIvalue\fR"
526 Monitors only flows that have \fIfield\fR specified as the given
527 \fIvalue\fR.  Any syntax valid for matching on \fBdump\-flows\fR may
528 be used.
529 .RE
530 .IP
531 This command may be useful for debugging switch or controller
532 implementations.  With \fBwatch:\fR, it is particularly useful for
533 observing how a controller updates flow tables.
534 .
535 .SS "OpenFlow Switch and Controller Commands"
536 .
537 The following commands, like those in the previous section, may be
538 applied to OpenFlow switches, using any of the connection methods
539 described in that section.  Unlike those commands, these may also be
540 applied to OpenFlow controllers.
541 .
542 .TP
543 \fBprobe \fItarget\fR
544 Sends a single OpenFlow echo-request message to \fItarget\fR and waits
545 for the response.  With the \fB\-t\fR or \fB\-\-timeout\fR option, this
546 command can test whether an OpenFlow switch or controller is up and
547 running.
548 .
549 .TP
550 \fBping \fItarget \fR[\fIn\fR]
551 Sends a series of 10 echo request packets to \fItarget\fR and times
552 each reply.  The echo request packets consist of an OpenFlow header
553 plus \fIn\fR bytes (default: 64) of randomly generated payload.  This
554 measures the latency of individual requests.
555 .
556 .TP
557 \fBbenchmark \fItarget n count\fR
558 Sends \fIcount\fR echo request packets that each consist of an
559 OpenFlow header plus \fIn\fR bytes of payload and waits for each
560 response.  Reports the total time required.  This is a measure of the
561 maximum bandwidth to \fItarget\fR for round-trips of \fIn\fR-byte
562 messages.
563 .
564 .SS "Other Commands"
565 .
566 .IP "\fBofp\-parse\fR \fIfile\fR"
567 Reads \fIfile\fR (or \fBstdin\fR if \fIfile\fR is \fB\-\fR) as a
568 series of OpenFlow messages in the binary format used on an OpenFlow
569 connection, and prints them to the console.  This can be useful for
570 printing OpenFlow messages captured from a TCP stream.
571 .
572 .IP "\fBofp\-parse\-pcap\fR \fIfile\fR [\fIport\fR...]"
573 Reads \fIfile\fR, which must be in the PCAP format used by network
574 capture tools such as \fBtcpdump\fR or \fBwireshark\fR, extracts all
575 the TCP streams for OpenFlow connections, and prints the OpenFlow
576 messages in those connections in human-readable format on
577 \fBstdout\fR.
578 .IP
579 OpenFlow connections are distinguished by TCP port number.
580 Non-OpenFlow packets are ignored.  By default, data on TCP ports 6633
581 and 6653 are considered to be OpenFlow.  Specify one or more
582 \fIport\fR arguments to override the default.
583 .IP
584 This command cannot usefully print SSL encrypted traffic.  It does not
585 understand IPv6.
586 .
587 .SS "Flow Syntax"
588 .PP
589 Some \fBovs\-ofctl\fR commands accept an argument that describes a flow or
590 flows.  Such flow descriptions comprise a series
591 \fIfield\fB=\fIvalue\fR assignments, separated by commas or white
592 space.  (Embedding spaces into a flow description normally requires
593 quoting to prevent the shell from breaking the description into
594 multiple arguments.)
595 .PP
596 Flow descriptions should be in \fBnormal form\fR.  This means that a
597 flow may only specify a value for an L3 field if it also specifies a
598 particular L2 protocol, and that a flow may only specify an L4 field
599 if it also specifies particular L2 and L3 protocol types.  For
600 example, if the L2 protocol type \fBdl_type\fR is wildcarded, then L3
601 fields \fBnw_src\fR, \fBnw_dst\fR, and \fBnw_proto\fR must also be
602 wildcarded.  Similarly, if \fBdl_type\fR or \fBnw_proto\fR (the L3
603 protocol type) is wildcarded, so must be the L4 fields \fBtcp_dst\fR and
604 \fBtcp_src\fR.  \fBovs\-ofctl\fR will warn about
605 flows not in normal form.
606 .PP
607 The following field assignments describe how a flow matches a packet.
608 If any of these assignments is omitted from the flow syntax, the field
609 is treated as a wildcard; thus, if all of them are omitted, the
610 resulting flow matches all packets.  The string \fB*\fR may be specified
611 to explicitly mark any of these fields as a wildcard.
612 (\fB*\fR should be quoted to protect it from shell expansion.)
613 .
614 .IP \fBin_port=\fIport\fR
615 Matches OpenFlow port \fIport\fR, which may be an OpenFlow port number
616 or keyword (e.g. \fBLOCAL\fR).
617 \fBovs\-ofctl show\fR.
618 .IP
619 (The \fBresubmit\fR action can search OpenFlow flow tables with
620 arbitrary \fBin_port\fR values, so flows that match port numbers that
621 do not exist from an OpenFlow perspective can still potentially be
622 matched.)
623 .
624 .IP \fBdl_vlan=\fIvlan\fR
625 Matches IEEE 802.1q Virtual LAN tag \fIvlan\fR.  Specify \fB0xffff\fR
626 as \fIvlan\fR to match packets that are not tagged with a Virtual LAN;
627 otherwise, specify a number between 0 and 4095, inclusive, as the
628 12-bit VLAN ID to match.
629 .
630 .IP \fBdl_vlan_pcp=\fIpriority\fR
631 Matches IEEE 802.1q Priority Code Point (PCP) \fIpriority\fR, which is
632 specified as a value between 0 and 7, inclusive.  A higher value
633 indicates a higher frame priority level.
634 .
635 .IP \fBdl_src=\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fR
636 .IQ \fBdl_dst=\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fR
637 Matches an Ethernet source (or destination) address specified as 6
638 pairs of hexadecimal digits delimited by colons
639 (e.g. \fB00:0A:E4:25:6B:B0\fR).
640 .
641 .IP \fBdl_src=\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB/\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fR
642 .IQ \fBdl_dst=\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB/\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fR
643 Matches an Ethernet destination address specified as 6 pairs of
644 hexadecimal digits delimited by colons (e.g. \fB00:0A:E4:25:6B:B0\fR),
645 with a wildcard mask following the slash. Open vSwitch 1.8 and later
646 support arbitrary masks for source and/or destination. Earlier
647 versions only support masking the destination with the following masks:
648 .RS
649 .IP \fB01:00:00:00:00:00\fR
650 Match only the multicast bit.  Thus,
651 \fBdl_dst=01:00:00:00:00:00/01:00:00:00:00:00\fR matches all multicast
652 (including broadcast) Ethernet packets, and
653 \fBdl_dst=00:00:00:00:00:00/01:00:00:00:00:00\fR matches all unicast
654 Ethernet packets.
655 .IP \fBfe:ff:ff:ff:ff:ff\fR
656 Match all bits except the multicast bit.  This is probably not useful.
657 .IP \fBff:ff:ff:ff:ff:ff\fR
658 Exact match (equivalent to omitting the mask).
659 .IP \fB00:00:00:00:00:00\fR
660 Wildcard all bits (equivalent to \fBdl_dst=*\fR.)
661 .RE
662 .
663 .IP \fBdl_type=\fIethertype\fR
664 Matches Ethernet protocol type \fIethertype\fR, which is specified as an
665 integer between 0 and 65535, inclusive, either in decimal or as a 
666 hexadecimal number prefixed by \fB0x\fR (e.g. \fB0x0806\fR to match ARP 
667 packets).
668 .
669 .IP \fBnw_src=\fIip\fR[\fB/\fInetmask\fR]
670 .IQ \fBnw_dst=\fIip\fR[\fB/\fInetmask\fR]
671 When \fBdl_type\fR is 0x0800 (possibly via shorthand, e.g. \fBip\fR
672 or \fBtcp\fR), matches IPv4 source (or destination) address \fIip\fR,
673 which may be specified as an IP address or host name
674 (e.g. \fB192.168.1.1\fR or \fBwww.example.com\fR).  The optional
675 \fInetmask\fR allows restricting a match to an IPv4 address prefix.
676 The netmask may be specified as a dotted quad
677 (e.g. \fB192.168.1.0/255.255.255.0\fR) or as a CIDR block
678 (e.g. \fB192.168.1.0/24\fR).  Open vSwitch 1.8 and later support
679 arbitrary dotted quad masks; earlier versions support only CIDR masks,
680 that is, the dotted quads that are equivalent to some CIDR block.
681 .IP
682 When \fBdl_type=0x0806\fR or \fBarp\fR is specified, matches the
683 \fBar_spa\fR or \fBar_tpa\fR field, respectively, in ARP packets for
684 IPv4 and Ethernet.
685 .IP
686 When \fBdl_type=0x8035\fR or \fBrarp\fR is specified, matches the
687 \fBar_spa\fR or \fBar_tpa\fR field, respectively, in RARP packets for
688 IPv4 and Ethernet.
689 .IP
690 When \fBdl_type\fR is wildcarded or set to a value other than 0x0800,
691 0x0806, or 0x8035, the values of \fBnw_src\fR and \fBnw_dst\fR are ignored
692 (see \fBFlow Syntax\fR above).
693 .
694 .IP \fBnw_proto=\fIproto\fR
695 .IQ \fBip_proto=\fIproto\fR
696 When \fBip\fR or \fBdl_type=0x0800\fR is specified, matches IP
697 protocol type \fIproto\fR, which is specified as a decimal number
698 between 0 and 255, inclusive (e.g. 1 to match ICMP packets or 6 to match
699 TCP packets).
700 .IP
701 When \fBipv6\fR or \fBdl_type=0x86dd\fR is specified, matches IPv6
702 header type \fIproto\fR, which is specified as a decimal number between
703 0 and 255, inclusive (e.g. 58 to match ICMPv6 packets or 6 to match
704 TCP).  The header type is the terminal header as described in the
705 \fBDESIGN\fR document.
706 .IP
707 When \fBarp\fR or \fBdl_type=0x0806\fR is specified, matches the lower
708 8 bits of the ARP opcode.  ARP opcodes greater than 255 are treated as
709 0.
710 .IP
711 When \fBrarp\fR or \fBdl_type=0x8035\fR is specified, matches the lower
712 8 bits of the ARP opcode.  ARP opcodes greater than 255 are treated as
713 0.
714 .IP
715 When \fBdl_type\fR is wildcarded or set to a value other than 0x0800,
716 0x0806, 0x8035 or 0x86dd, the value of \fBnw_proto\fR is ignored (see
717 \fBFlow Syntax\fR above).
718 .
719 .IP \fBnw_tos=\fItos\fR
720 Matches IP ToS/DSCP or IPv6 traffic class field \fItos\fR, which is
721 specified as a decimal number between 0 and 255, inclusive.  Note that
722 the two lower reserved bits are ignored for matching purposes.
723 .IP
724 When \fBdl_type\fR is wildcarded or set to a value other than 0x0800 or
725 0x86dd, the value of \fBnw_tos\fR is ignored (see \fBFlow Syntax\fR
726 above).
727 .
728 .IP \fBip_dscp=\fIdscp\fR
729 Matches IP ToS/DSCP or IPv6 traffic class field \fIdscp\fR, which is
730 specified as a decimal number between 0 and 63, inclusive.
731 .IP
732 When \fBdl_type\fR is wildcarded or set to a value other than 0x0800 or
733 0x86dd, the value of \fBip_dscp\fR is ignored (see \fBFlow Syntax\fR
734 above).
735 .
736 .IP \fBnw_ecn=\fIecn\fR
737 .IQ \fBip_ecn=\fIecn\fR
738 Matches \fIecn\fR bits in IP ToS or IPv6 traffic class fields, which is
739 specified as a decimal number between 0 and 3, inclusive.
740 .IP
741 When \fBdl_type\fR is wildcarded or set to a value other than 0x0800 or
742 0x86dd, the value of \fBnw_ecn\fR is ignored (see \fBFlow Syntax\fR
743 above).
744 .
745 .IP \fBnw_ttl=\fIttl\fR
746 Matches IP TTL or IPv6 hop limit value \fIttl\fR, which is
747 specified as a decimal number between 0 and 255, inclusive.
748 .IP
749 When \fBdl_type\fR is wildcarded or set to a value other than 0x0800 or
750 0x86dd, the value of \fBnw_ttl\fR is ignored (see \fBFlow Syntax\fR
751 above).
752 .IP
753 .
754 .IP \fBtcp_src=\fIport\fR
755 .IQ \fBtcp_dst=\fIport\fR
756 .IQ \fBudp_src=\fIport\fR
757 .IQ \fBudp_dst=\fIport\fR
758 .IQ \fBsctp_src=\fIport\fR
759 .IQ \fBsctp_dst=\fIport\fR
760 Matches a TCP, UDP, or SCTP source or destination port \fIport\fR,
761 which is specified as a decimal number between 0 and 65535, inclusive.
762 .IP
763 When \fBdl_type\fR and \fBnw_proto\fR are wildcarded or set to values
764 that do not indicate an appropriate protocol, the values of these
765 settings are ignored (see \fBFlow Syntax\fR above).
766 .
767 .IP \fBtcp_src=\fIport\fB/\fImask\fR
768 .IQ \fBtcp_dst=\fIport\fB/\fImask\fR
769 .IQ \fBudp_src=\fIport\fB/\fImask\fR
770 .IQ \fBudp_dst=\fIport\fB/\fImask\fR
771 .IQ \fBsctp_src=\fIport\fB/\fImask\fR
772 .IQ \fBsctp_dst=\fIport\fB/\fImask\fR
773 Bitwise match on TCP (or UDP or SCTP) source or destination port.
774 The \fIport\fR and \fImask\fR are 16-bit numbers
775 written in decimal or in hexadecimal prefixed by \fB0x\fR.  Each 1-bit
776 in \fImask\fR requires that the corresponding bit in \fIport\fR must
777 match.  Each 0-bit in \fImask\fR causes the corresponding bit to be
778 ignored.
779 .IP
780 Bitwise matches on transport ports are rarely useful in isolation, but
781 a group of them can be used to reduce the number of flows required to
782 match on a range of transport ports.  For example, suppose that the
783 goal is to match TCP source ports 1000 to 1999, inclusive.  One way is
784 to insert 1000 flows, each of which matches on a single source port.
785 Another way is to look at the binary representations of 1000 and 1999,
786 as follows:
787 .br
788 .B "01111101000"
789 .br
790 .B "11111001111"
791 .br
792 and then to transform those into a series of bitwise matches that
793 accomplish the same results:
794 .br
795 .B "01111101xxx"
796 .br
797 .B "0111111xxxx"
798 .br
799 .B "10xxxxxxxxx"
800 .br
801 .B "110xxxxxxxx"
802 .br
803 .B "1110xxxxxxx"
804 .br
805 .B "11110xxxxxx"
806 .br
807 .B "1111100xxxx"
808 .br
809 which become the following when written in the syntax required by
810 \fBovs\-ofctl\fR:
811 .br
812 .B "tcp,tcp_src=0x03e8/0xfff8"
813 .br
814 .B "tcp,tcp_src=0x03f0/0xfff0"
815 .br
816 .B "tcp,tcp_src=0x0400/0xfe00"
817 .br
818 .B "tcp,tcp_src=0x0600/0xff00"
819 .br
820 .B "tcp,tcp_src=0x0700/0xff80"
821 .br
822 .B "tcp,tcp_src=0x0780/0xffc0"
823 .br
824 .B "tcp,tcp_src=0x07c0/0xfff0"
825 .IP
826 Only Open vSwitch 1.6 and later supports bitwise matching on transport
827 ports.
828 .IP
829 Like the exact-match forms described
830 above, the bitwise match forms apply only when \fBdl_type\fR and
831 \fBnw_proto\fR specify TCP or UDP or SCTP.
832 .
833 .IP \fBtp_src=\fIport\fR
834 .IQ \fBtp_dst=\fIport\fR
835 These are deprecated generic forms of L4 port matches.  In new code,
836 please use the TCP-, UDP-, or SCTP-specific forms described above.
837 .
838 .IP \fBtcp_flags=\fIflags\fB/\fImask\fR
839 .IQ \fBtcp_flags=\fR[\fB+\fIflag\fR...][\fB-\fIflag\fR...]
840 Bitwise match on TCP flags.  The \fIflags\fR and \fImask\fR are 16-bit
841 numbers written in decimal or in hexadecimal prefixed by \fB0x\fR.
842 Each 1-bit in \fImask\fR requires that the corresponding bit in
843 \fIflags\fR must match.  Each 0-bit in \fImask\fR causes the corresponding
844 bit to be ignored.
845 .IP
846 Alternatively, the flags can be specified by their symbolic names
847 (listed below), each preceded by either \fB+\fR for a flag that must
848 be set, or \fB\-\fR for a flag that must be unset, without any other
849 delimiters between the flags.  Flags not mentioned are wildcarded.
850 For example, \fBtcp,tcp_flags=+syn\-ack\fR matches TCP SYNs that are
851 not ACKs.
852 .IP
853 TCP protocol currently defines 9 flag bits, and additional 3 bits are
854 reserved (must be transmitted as zero), see RFCs 793, 3168, and 3540.
855 The flag bits are, numbering from the least significant bit:
856 .RS
857 .IP "\fB0: fin\fR"
858 No more data from sender.
859 .IP "\fB1: syn\fR"
860 Synchronize sequence numbers.
861 .IP "\fB2: rst\fR"
862 Reset the connection.
863 .IP "\fB3: psh\fR"
864 Push function.
865 .IP "\fB4: ack\fR"
866 Acknowledgement field significant.
867 .IP "\fB5: urg\fR"
868 Urgent pointer field significant.
869 .IP "\fB6: ece\fR"
870 ECN Echo.
871 .IP "\fB7: cwr\fR"
872 Congestion Windows Reduced.
873 .IP "\fB8: ns\fR"
874 Nonce Sum.
875 .IP "\fB9-11:\fR"
876 Reserved.
877 .IP "\fB12-15:\fR"
878 Not matchable, must be zero.
879 .RE
880 .IP \fBicmp_type=\fItype\fR
881 .IQ \fBicmp_code=\fIcode\fR
882 When \fBdl_type\fR and \fBnw_proto\fR specify ICMP or ICMPv6, \fItype\fR
883 matches the ICMP type and \fIcode\fR matches the ICMP code.  Each is
884 specified as a decimal number between 0 and 255, inclusive.
885 .IP
886 When \fBdl_type\fR and \fBnw_proto\fR take other values, the values of
887 these settings are ignored (see \fBFlow Syntax\fR above).
888 .
889 .IP \fBtable=\fInumber\fR
890 For flow dump commands, limits the flows dumped to those in the table
891 with the given \fInumber\fR between 0 and 254.  If not specified (or if
892 255 is specified as \fInumber\fR), then flows in all tables are
893 dumped.
894 .
895 .IP
896 For flow table modification commands, behavior varies based on the
897 OpenFlow version used to connect to the switch:
898 .
899 .RS
900 .IP "OpenFlow 1.0"
901 OpenFlow 1.0 does not support \fBtable\fR for modifying flows.
902 \fBovs\-ofctl\fR will exit with an error if \fBtable\fR (other than
903 \fBtable=255\fR) is specified for a switch that only supports OpenFlow
904 1.0.
905 .IP
906 In OpenFlow 1.0, the switch chooses the table into which to insert a
907 new flow.  The Open vSwitch software switch always chooses table 0.
908 Other Open vSwitch datapaths and other OpenFlow implementations may
909 choose different tables.
910 .IP
911 The OpenFlow 1.0 behavior in Open vSwitch for modifying or removing
912 flows depends on whether \fB\-\-strict\fR is used.  Without
913 \fB\-\-strict\fR, the command applies to matching flows in all tables.
914 With \fB\-\-strict\fR, the command will operate on any single matching
915 flow in any table; it will do nothing if there are matches in more
916 than one table.  (The distinction between these behaviors only matters
917 if non-OpenFlow 1.0 commands were also used, because OpenFlow 1.0
918 alone cannot add flows with the same matching criteria to multiple
919 tables.)
920 .
921 .IP "OpenFlow 1.0 with table_id extension"
922 Open vSwitch implements an OpenFlow extension that allows the
923 controller to specify the table on which to operate.  \fBovs\-ofctl\fR
924 automatically enables the extension when \fBtable\fR is specified and
925 OpenFlow 1.0 is used.  \fBovs\-ofctl\fR automatically detects whether
926 the switch supports the extension.  As of this writing, this extension
927 is only known to be implemented by Open vSwitch.
928 .
929 .IP
930 With this extension, \fBovs\-ofctl\fR operates on the requested table
931 when \fBtable\fR is specified, and acts as described for OpenFlow 1.0
932 above when no \fBtable\fR is specified (or for \fBtable=255\fR).
933 .
934 .IP "OpenFlow 1.1"
935 OpenFlow 1.1 requires flow table modification commands to specify a
936 table.  When \fBtable\fR is not specified (or \fBtable=255\fR is
937 specified), \fBovs\-ofctl\fR defaults to table 0.
938 .
939 .IP "OpenFlow 1.2 and later"
940 OpenFlow 1.2 and later allow flow deletion commands, but not other
941 flow table modification commands, to operate on all flow tables, with
942 the behavior described above for OpenFlow 1.0.
943 .RE
944 .
945 .IP \fBmetadata=\fIvalue\fR[\fB/\fImask\fR]
946 Matches \fIvalue\fR either exactly or with optional \fImask\fR in the metadata
947 field. \fIvalue\fR and \fImask\fR are 64-bit integers, by default in decimal
948 (use a \fB0x\fR prefix to specify hexadecimal). Arbitrary \fImask\fR values
949 are allowed: a 1-bit in \fImask\fR indicates that the corresponding bit in
950 \fIvalue\fR must match exactly, and a 0-bit wildcards that bit. Matching on
951 metadata was added in Open vSwitch 1.8.
952 .
953 .PP
954 The following shorthand notations are also available:
955 .
956 .IP \fBip\fR
957 Same as \fBdl_type=0x0800\fR.
958 .
959 .IP \fBicmp\fR
960 Same as \fBdl_type=0x0800,nw_proto=1\fR.
961 .
962 .IP \fBtcp\fR
963 Same as \fBdl_type=0x0800,nw_proto=6\fR.
964 .
965 .IP \fBudp\fR
966 Same as \fBdl_type=0x0800,nw_proto=17\fR.
967 .
968 .IP \fBsctp\fR
969 Same as \fBdl_type=0x0800,nw_proto=132\fR.
970 .
971 .IP \fBarp\fR
972 Same as \fBdl_type=0x0806\fR.
973 .
974 .IP \fBrarp\fR
975 Same as \fBdl_type=0x8035\fR.
976 .
977 .PP
978 The following field assignments require support for the NXM (Nicira
979 Extended Match) extension to OpenFlow.  When one of these is specified,
980 \fBovs\-ofctl\fR will automatically attempt to negotiate use of this
981 extension.  If the switch does not support NXM, then \fBovs\-ofctl\fR
982 will report a fatal error.
983 .
984 .IP \fBvlan_tci=\fItci\fR[\fB/\fImask\fR]
985 Matches modified VLAN TCI \fItci\fR.  If \fImask\fR is omitted,
986 \fItci\fR is the exact VLAN TCI to match; if \fImask\fR is specified,
987 then a 1-bit in \fImask\fR indicates that the corresponding bit in
988 \fItci\fR must match exactly, and a 0-bit wildcards that bit.  Both
989 \fItci\fR and \fImask\fR are 16-bit values that are decimal by
990 default; use a \fB0x\fR prefix to specify them in hexadecimal.
991 .
992 .IP
993 The value that \fBvlan_tci\fR matches against is 0 for a packet that
994 has no 802.1Q header.  Otherwise, it is the TCI value from the 802.1Q
995 header with the CFI bit (with value \fB0x1000\fR) forced to 1.
996 .IP
997 Examples:
998 .RS
999 .IP \fBvlan_tci=0\fR
1000 Match only packets without an 802.1Q header.
1001 .IP \fBvlan_tci=0xf123\fR
1002 Match packets tagged with priority 7 in VLAN 0x123.
1003 .IP \fBvlan_tci=0x1123/0x1fff\fR
1004 Match packets tagged with VLAN 0x123 (and any priority).
1005 .IP \fBvlan_tci=0x5000/0xf000\fR
1006 Match packets tagged with priority 2 (in any VLAN).
1007 .IP \fBvlan_tci=0/0xfff\fR
1008 Match packets with no 802.1Q header or tagged with VLAN 0 (and any
1009 priority).
1010 .IP \fBvlan_tci=0x5000/0xe000\fR
1011 Match packets with no 802.1Q header or tagged with priority 2 (in any
1012 VLAN).
1013 .IP \fBvlan_tci=0/0xefff\fR
1014 Match packets with no 802.1Q header or tagged with VLAN 0 and priority
1015 0.
1016 .RE
1017 .IP
1018 Some of these matching possibilities can also be achieved with
1019 \fBdl_vlan\fR and \fBdl_vlan_pcp\fR.
1020 .
1021 .IP \fBip_frag=\fIfrag_type\fR
1022 When \fBdl_type\fR specifies IP or IPv6, \fIfrag_type\fR
1023 specifies what kind of IP fragments or non-fragments to match.  The
1024 following values of \fIfrag_type\fR are supported:
1025 .RS
1026 .IP "\fBno\fR"
1027 Matches only non-fragmented packets.
1028 .IP "\fByes\fR"
1029 Matches all fragments.
1030 .IP "\fBfirst\fR"
1031 Matches only fragments with offset 0.
1032 .IP "\fBlater\fR"
1033 Matches only fragments with nonzero offset.
1034 .IP "\fBnot_later\fR"
1035 Matches non-fragmented packets and fragments with zero offset.
1036 .RE
1037 .IP
1038 The \fBip_frag\fR match type is likely to be most useful in
1039 \fBnx\-match\fR mode.  See the description of the \fBset\-frags\fR
1040 command, above, for more details.
1041 .
1042 .IP \fBarp_spa=\fIip\fR[\fB/\fInetmask\fR]
1043 .IQ \fBarp_tpa=\fIip\fR[\fB/\fInetmask\fR]
1044 When \fBdl_type\fR specifies either ARP or RARP, \fBarp_spa\fR and
1045 \fBarp_tpa\fR match the source and target IPv4 address, respectively.
1046 An address may be specified as an IP address or host name
1047 (e.g. \fB192.168.1.1\fR or \fBwww.example.com\fR).  The optional
1048 \fInetmask\fR allows restricting a match to an IPv4 address prefix.
1049 The netmask may be specified as a dotted quad
1050 (e.g. \fB192.168.1.0/255.255.255.0\fR) or as a CIDR block
1051 (e.g. \fB192.168.1.0/24\fR).
1052 .
1053 .IP \fBarp_sha=\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fR
1054 .IQ \fBarp_tha=\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fR
1055 When \fBdl_type\fR specifies either ARP or RARP, \fBarp_sha\fR and
1056 \fBarp_tha\fR match the source and target hardware address, respectively.  An
1057 address is specified as 6 pairs of hexadecimal digits delimited by colons
1058 (e.g. \fB00:0A:E4:25:6B:B0\fR).
1059 .
1060 .IP \fBarp_sha=\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB/\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fR
1061 .IQ \fBarp_tha=\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB/\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fR
1062 When \fBdl_type\fR specifies either ARP or RARP, \fBarp_sha\fR and
1063 \fBarp_tha\fR match the source and target hardware address, respectively.  An
1064 address is specified as 6 pairs of hexadecimal digits delimited by colons
1065 (e.g. \fB00:0A:E4:25:6B:B0\fR), with a wildcard mask following the slash.
1066 .
1067
1068 .IP \fBipv6_src=\fIipv6\fR[\fB/\fInetmask\fR]
1069 .IQ \fBipv6_dst=\fIipv6\fR[\fB/\fInetmask\fR]
1070 When \fBdl_type\fR is 0x86dd (possibly via shorthand, e.g., \fBipv6\fR
1071 or \fBtcp6\fR), matches IPv6 source (or destination) address \fIipv6\fR,
1072 which may be specified as defined in RFC 2373.  The preferred format is 
1073 \fIx\fB:\fIx\fB:\fIx\fB:\fIx\fB:\fIx\fB:\fIx\fB:\fIx\fB:\fIx\fR, where
1074 \fIx\fR are the hexadecimal values of the eight 16-bit pieces of the
1075 address.  A single instance of \fB::\fR may be used to indicate multiple
1076 groups of 16-bits of zeros.  The optional \fInetmask\fR allows
1077 restricting a match to an IPv6 address prefix.  A netmask is specified
1078 as an IPv6 address (e.g. \fB2001:db8:3c4d:1::/ffff:ffff:ffff:ffff::\fR)
1079 or a CIDR block (e.g. \fB2001:db8:3c4d:1::/64\fR).  Open vSwitch 1.8
1080 and later support arbitrary masks; earlier versions support only CIDR
1081 masks, that is, CIDR block and IPv6 addresses that are equivalent to
1082 CIDR blocks.
1083 .
1084 .IP \fBipv6_label=\fIlabel\fR
1085 When \fBdl_type\fR is 0x86dd (possibly via shorthand, e.g., \fBipv6\fR
1086 or \fBtcp6\fR), matches IPv6 flow label \fIlabel\fR.
1087 .
1088 .IP \fBnd_target=\fIipv6\fR[\fB/\fInetmask\fR]
1089 When \fBdl_type\fR, \fBnw_proto\fR, and \fBicmp_type\fR specify
1090 IPv6 Neighbor Discovery (ICMPv6 type 135 or 136), matches the target address
1091 \fIipv6\fR.  \fIipv6\fR is in the same format described earlier for the
1092 \fBipv6_src\fR and \fBipv6_dst\fR fields.
1093 .
1094 .IP \fBnd_sll=\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fR
1095 When \fBdl_type\fR, \fBnw_proto\fR, and \fBicmp_type\fR specify IPv6
1096 Neighbor Solicitation (ICMPv6 type 135), matches the source link\-layer
1097 address option.  An address is specified as 6 pairs of hexadecimal
1098 digits delimited by colons.
1099 .
1100 .IP \fBnd_tll=\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fR
1101 When \fBdl_type\fR, \fBnw_proto\fR, and \fBicmp_type\fR specify IPv6
1102 Neighbor Advertisement (ICMPv6 type 136), matches the target link\-layer
1103 address option.  An address is specified as 6 pairs of hexadecimal
1104 digits delimited by colons.
1105 .
1106 .IP \fBmpls_bos=\fIbos\fR
1107 When \fBdl_type\fR is 0x8847 or 0x8848 (possibly via shorthand e.g.,
1108 \fBmpls\fR or \fBmplsm\fR), matches the bottom-of-stack bit of the
1109 outer-most MPLS label stack entry. Valid values are 0 and 1.
1110 .IP
1111 If 1 then for a packet with a well-formed MPLS label stack the
1112 bottom-of-stack bit indicates that the outer label stack entry is also
1113 the inner-most label stack entry and thus that is that there is only one
1114 label stack entry present.  Conversely, if 0 then for a packet with a
1115 well-formed MPLS label stack the bottom-of-stack bit indicates that the
1116 outer label stack entry is not the inner-most label stack entry and
1117 thus there is more than one label stack entry present.
1118 .
1119 .IP \fBmpls_label=\fIlabel\fR
1120 When \fBdl_type\fR is 0x8847 or 0x8848 (possibly via shorthand e.g.,
1121 \fBmpls\fR or \fBmplsm\fR), matches the label of the outer
1122 MPLS label stack entry. The label is a 20-bit value that is decimal by default;
1123 use a \fB0x\fR prefix to specify them in hexadecimal.
1124 .
1125 .IP \fBmpls_tc=\fItc\fR
1126 When \fBdl_type\fR is 0x8847 or 0x8848 (possibly via shorthand e.g.,
1127 \fBmpls\fR or \fBmplsm\fR), matches the traffic-class of the outer
1128 MPLS label stack entry. Valid values are between 0 (lowest) and 7 (highest).
1129 .
1130 .IP \fBtun_id=\fItunnel-id\fR[\fB/\fImask\fR]
1131 .IQ \fBtunnel_id=\fItunnel-id\fR[\fB/\fImask\fR]
1132 Matches tunnel identifier \fItunnel-id\fR.  Only packets that arrive
1133 over a tunnel that carries a key (e.g. GRE with the RFC 2890 key
1134 extension and a nonzero key value) will have a nonzero tunnel ID.
1135 If \fImask\fR is omitted, \fItunnel-id\fR is the exact tunnel ID to match;
1136 if \fImask\fR is specified, then a 1-bit in \fImask\fR indicates that the
1137 corresponding bit in \fItunnel-id\fR must match exactly, and a 0-bit
1138 wildcards that bit.
1139 .
1140 .IP \fBtun_src=\fIip\fR[\fB/\fInetmask\fR]
1141 .IQ \fBtun_dst=\fIip\fR[\fB/\fInetmask\fR]
1142 Matches tunnel IPv4 source (or destination) address \fIip\fR. Only packets
1143 that arrive over a tunnel will have nonzero tunnel addresses.
1144 The address may be specified as an IP address or host name
1145 (e.g. \fB192.168.1.1\fR or \fBwww.example.com\fR).  The optional
1146 \fInetmask\fR allows restricting a match to a masked IPv4 address.
1147 The netmask may be specified as a dotted quad
1148 (e.g. \fB192.168.1.0/255.255.255.0\fR) or as a CIDR block
1149 (e.g. \fB192.168.1.0/24\fR).
1150 .
1151 .IP \fBtun_gbp_id=\fIvalue\fR[\fB/\fImask\fR]
1152 .IQ \fBtun_gbp_flags=\fIvalue\fR[\fB/\fImask\fR]
1153 Matches the group policy identifier and flags in the VXLAN header. Only
1154 packets that arrive over a VXLAN tunnel with the "gbp" extension
1155 enabled can have this field set. The fields may also be referred to by
1156 NXM_NX_TUN_GBP_ID[] (16 bits) and NXM_NX_TUN_GBP_FLAGS[] (8 bits) in
1157 the context of field manipulation actions. If these fields are set and
1158 the packet matched by the flow is encapsulated in a VXLAN-GBP tunnel,
1159 then the policy identifier and flags are transmitted to the destination
1160 VXLAN tunnel endpoint.
1161 .IP
1162 The \fBtun_gbp_flags\fR field has the following format:
1163 .IP
1164 .in +2
1165 \f(CR+-+-+-+-+-+-+-+-+\fR
1166 .br
1167 \f(CR|-|D|-|-|A|-|-|-|\fR
1168 .br
1169 \f(CR+-+-+-+-+-+-+-+-+\fR
1170
1171 .B D :=
1172 Don't Learn bit. When set, this bit indicates that the egress
1173 tunnel endpoint MUST NOT learn the source address of the encapsulated
1174 frame.
1175
1176 .B A :=
1177 Indicates that the group policy has already been applied to
1178 this packet. Policies MUST NOT be applied by devices when the A bit is
1179 set.
1180 .in -2
1181 .IP
1182 For more information, please see the corresponding IETF draft:
1183 https://tools.ietf.org/html/draft-smith-vxlan-group-policy
1184 .
1185 .IP "\fBtun_metadata\fIidx\fB=\fIvalue\fR[\fB/\fImask\fR]"
1186 Matches \fIvalue\fR either exactly or with optional \fImask\fR in
1187 tunnel metadata field number \fIidx\fR (numbered from 0 to 63).
1188 Tunnel metadata fields can be dynamically assigned onto the data
1189 contained in the options of Geneve packets using the commands
1190 described in the section \fBOpenFlow Switch Geneve Option Table
1191 Commands\fR. Once assigned, the length of the field is variable
1192 according to the size of the option. Before updating a mapping in
1193 the option table, flows with references to it should be removed,
1194 otherwise the result is non-deterministic.
1195 .IP
1196 These fields were introduced in Open vSwitch 2.5.
1197 .
1198 .IP "\fBreg\fIidx\fB=\fIvalue\fR[\fB/\fImask\fR]"
1199 Matches \fIvalue\fR either exactly or with optional \fImask\fR in
1200 register number \fIidx\fR.  The valid range of \fIidx\fR depends on
1201 the switch.  \fIvalue\fR and \fImask\fR are 32-bit integers, by
1202 default in decimal (use a \fB0x\fR prefix to specify hexadecimal).
1203 Arbitrary \fImask\fR values are allowed: a 1-bit in \fImask\fR
1204 indicates that the corresponding bit in \fIvalue\fR must match
1205 exactly, and a 0-bit wildcards that bit.
1206 .IP
1207 When a packet enters an OpenFlow switch, all of the registers are set
1208 to 0.  Only explicit actions change register values.
1209 .
1210 .IP "\fBxreg\fIidx\fB=\fIvalue\fR[\fB/\fImask\fR]"
1211 Matches \fIvalue\fR either exactly or with optional \fImask\fR in
1212 64-bit ``extended register'' number \fIidx\fR.  Each of the 64-bit
1213 extended registers overlays two of the 32-bit registers: \fBxreg0\fR
1214 overlays \fBreg0\fR and \fBreg1\fR, with \fBreg0\fR supplying the
1215 most-significant bits of \fBxreg0\fR and \fBreg1\fR the
1216 least-significant.  \fBxreg1\fR similarly overlays \fBreg2\fR and
1217 \fBreg3\fR, and so on.
1218 .IP
1219 These fields were added in Open vSwitch 2.3 to conform with the
1220 OpenFlow 1.5 specification.  OpenFlow 1.5 calls these fields
1221 just the ``packet registers,'' but Open vSwitch already had 32-bit
1222 registers by that name, which is why Open vSwitch refers to the
1223 standard registers as ``extended registers''.
1224 .
1225 .IP \fBpkt_mark=\fIvalue\fR[\fB/\fImask\fR]
1226 Matches packet metadata mark \fIvalue\fR either exactly or with optional
1227 \fImask\fR. The mark is associated data that may be passed into other
1228 system components in order to facilitate interaction between subsystems.
1229 On Linux this corresponds to the skb mark but the exact implementation is
1230 platform-dependent.
1231 .
1232 .IP \fBactset_output=\fIport\fR
1233 Matches the output port currently in the OpenFlow action set, where
1234 \fIport\fR may be an OpenFlow port number or keyword
1235 (e.g. \fBLOCAL\fR).  If there is no output port in the OpenFlow action
1236 set, or if the output port will be ignored (e.g. because there is an
1237 output group in the OpenFlow action set), then the value will be
1238 \fBUNSET\fR.
1239 .IP
1240 This field was introduced in Open vSwitch 2.4 to conform with the
1241 OpenFlow 1.5 specification.
1242 .
1243 .IP \fBconj_id=\fIvalue\fR
1244 Matches the given 32-bit \fIvalue\fR against the conjunction ID.  This
1245 is used only with the \fBconjunction\fR action (see below).
1246 .IP
1247 This field was introduced in Open vSwitch 2.4.
1248 .
1249 .PP
1250 Defining IPv6 flows (those with \fBdl_type\fR equal to 0x86dd) requires
1251 support for NXM.  The following shorthand notations are available for
1252 IPv6-related flows:
1253 .
1254 .IP \fBipv6\fR
1255 Same as \fBdl_type=0x86dd\fR.
1256 .
1257 .IP \fBtcp6\fR
1258 Same as \fBdl_type=0x86dd,nw_proto=6\fR.
1259 .
1260 .IP \fBudp6\fR
1261 Same as \fBdl_type=0x86dd,nw_proto=17\fR.
1262 .
1263 .IP \fBsctp6\fR
1264 Same as \fBdl_type=0x86dd,nw_proto=132\fR.
1265 .
1266 .IP \fBicmp6\fR
1267 Same as \fBdl_type=0x86dd,nw_proto=58\fR.
1268 .
1269 .PP
1270 Finally, field assignments to \fBduration\fR, \fBn_packets\fR, or
1271 \fBn_bytes\fR are ignored to allow output from the \fBdump\-flows\fR
1272 command to be used as input for other commands that parse flows.
1273 .
1274 .PP
1275 The \fBadd\-flow\fR, \fBadd\-flows\fR, and \fBmod\-flows\fR commands
1276 require an additional field, which must be the final field specified:
1277 .
1278 .IP \fBactions=\fR[\fIaction\fR][\fB,\fIaction\fR...]\fR
1279 Specifies a comma-separated list of actions to take on a packet when the 
1280 flow entry matches.  If no \fIaction\fR is specified, then packets
1281 matching the flow are dropped.  The following forms of \fIaction\fR
1282 are supported:
1283 .
1284 .RS
1285 .IP \fIport\fR
1286 .IQ \fBoutput:\fIport\fR
1287 Outputs the packet to OpenFlow port number \fIport\fR.  If \fIport\fR
1288 is the packet's input port, the packet is not output.
1289 .
1290 .IP \fBoutput:\fIsrc\fB[\fIstart\fB..\fIend\fB]
1291 Outputs the packet to the OpenFlow port number read from \fIsrc\fR,
1292 which must be an NXM field as described above.  For example,
1293 \fBoutput:NXM_NX_REG0[16..31]\fR outputs to the OpenFlow port number
1294 written in the upper half of register 0.  If the port number is the
1295 packet's input port, the packet is not output.
1296 .IP
1297 This form of \fBoutput\fR was added in Open vSwitch 1.3.0.  This form
1298 of \fBoutput\fR uses an OpenFlow extension that is not supported by
1299 standard OpenFlow switches.
1300 .
1301 .IP \fBgroup:\fIgroup_id\fR
1302 Outputs the packet to the OpenFlow group \fIgroup_id\fR. Group tables
1303 are only supported in OpenFlow 1.1+. See Group Syntax for more details.
1304 .
1305 .IP \fBnormal\fR
1306 Subjects the packet to the device's normal L2/L3 processing.  (This
1307 action is not implemented by all OpenFlow switches.)
1308 .
1309 .IP \fBflood\fR
1310 Outputs the packet on all switch physical ports other than the port on
1311 which it was received and any ports on which flooding is disabled
1312 (typically, these would be ports disabled by the IEEE 802.1D spanning
1313 tree protocol).
1314 .
1315 .IP \fBall\fR
1316 Outputs the packet on all switch physical ports other than the port on
1317 which it was received.
1318 .
1319 .IP \fBlocal\fR
1320 Outputs the packet on the ``local port,'' which corresponds to the
1321 network device that has the same name as the bridge.
1322 .
1323 .IP \fBin_port\fR
1324 Outputs the packet on the port from which it was received.
1325 .
1326 .IP \fBcontroller(\fIkey\fB=\fIvalue\fR...\fB)
1327 Sends the packet to the OpenFlow controller as a ``packet in''
1328 message.  The supported key-value pairs are:
1329 .RS
1330 .IP "\fBmax_len=\fInbytes\fR"
1331 Limit to \fInbytes\fR the number of bytes of the packet to send to
1332 the controller.  By default the entire packet is sent.
1333 .IP "\fBreason=\fIreason\fR"
1334 Specify \fIreason\fR as the reason for sending the message in the
1335 ``packet in'' message.  The supported reasons are \fBaction\fR (the
1336 default), \fBno_match\fR, and \fBinvalid_ttl\fR.
1337 .IP "\fBid=\fIcontroller-id\fR"
1338 Specify \fIcontroller-id\fR, a 16-bit integer, as the connection ID of
1339 the OpenFlow controller or controllers to which the ``packet in''
1340 message should be sent.  The default is zero.  Zero is also the
1341 default connection ID for each controller connection, and a given
1342 controller connection will only have a nonzero connection ID if its
1343 controller uses the \fBNXT_SET_CONTROLLER_ID\fR Nicira extension to
1344 OpenFlow.
1345 .RE
1346 .IP
1347 Any \fIreason\fR other than \fBaction\fR and any nonzero
1348 \fIcontroller-id\fR uses a Nicira vendor extension that, as of this
1349 writing, is only known to be implemented by Open vSwitch (version 1.6
1350 or later).
1351 .
1352 .IP \fBcontroller\fR
1353 .IQ \fBcontroller\fR[\fB:\fInbytes\fR]
1354 Shorthand for \fBcontroller()\fR or
1355 \fBcontroller(max_len=\fInbytes\fB)\fR, respectively.
1356 .
1357 .IP \fBenqueue(\fIport\fB,\fIqueue\fB)\fR
1358 Enqueues the packet on the specified \fIqueue\fR within port
1359 \fIport\fR, which must be an OpenFlow port number or keyword
1360 (e.g. \fBLOCAL\fR).  The number of supported queues depends on the
1361 switch; some OpenFlow implementations do not support queuing at all.
1362 .
1363 .IP \fBdrop\fR
1364 Discards the packet, so no further processing or forwarding takes place.
1365 If a drop action is used, no other actions may be specified.
1366 .
1367 .IP \fBmod_vlan_vid\fR:\fIvlan_vid\fR
1368 Modifies the VLAN id on a packet.  The VLAN tag is added or modified 
1369 as necessary to match the value specified.  If the VLAN tag is added,
1370 a priority of zero is used (see the \fBmod_vlan_pcp\fR action to set
1371 this).
1372 .
1373 .IP \fBmod_vlan_pcp\fR:\fIvlan_pcp\fR
1374 Modifies the VLAN priority on a packet.  The VLAN tag is added or modified 
1375 as necessary to match the value specified.  Valid values are between 0
1376 (lowest) and 7 (highest).  If the VLAN tag is added, a vid of zero is used 
1377 (see the \fBmod_vlan_vid\fR action to set this).
1378 .
1379 .IP \fBstrip_vlan\fR
1380 Strips the VLAN tag from a packet if it is present.
1381 .
1382 .IP \fBpush_vlan\fR:\fIethertype\fR
1383 Push a new VLAN tag onto the packet.  Ethertype is used as the the Ethertype
1384 for the tag. Only ethertype 0x8100 should be used. (0x88a8 which the spec
1385 allows isn't supported at the moment.)
1386 A priority of zero and the tag of zero are used for the new tag.
1387 .
1388 .IP \fBpush_mpls\fR:\fIethertype\fR
1389 Changes the packet's Ethertype to \fIethertype\fR, which must be either
1390 \fB0x8847\fR or \fB0x8848\fR, and pushes an MPLS LSE.
1391 .IP
1392 If the packet does not already contain any MPLS labels then an initial
1393 label stack entry is pushed.  The label stack entry's label is 2 if the
1394 packet contains IPv6 and 0 otherwise, its default traffic control value is
1395 the low 3 bits of the packet's DSCP value (0 if the packet is not IP), and
1396 its TTL is copied from the IP TTL (64 if the packet is not IP).
1397 .IP
1398 If the packet does already contain an MPLS label, pushes a new
1399 outermost label as a copy of the existing outermost label.
1400 .IP
1401 A limitation of the implementation is that processing of actions will stop
1402 if \fBpush_mpls\fR follows another \fBpush_mpls\fR unless there is a
1403 \fBpop_mpls\fR in between.
1404 .
1405 .IP \fBpop_mpls\fR:\fIethertype\fR
1406 Strips the outermost MPLS label stack entry.
1407 Currently the implementation restricts \fIethertype\fR to a non-MPLS Ethertype
1408 and thus \fBpop_mpls\fR should only be applied to packets with
1409 an MPLS label stack depth of one. A further limitation is that processing of
1410 actions will stop if \fBpop_mpls\fR follows another \fBpop_mpls\fR unless
1411 there is a \fBpush_mpls\fR in between.
1412 .
1413 .IP \fBmod_dl_src\fB:\fImac\fR
1414 Sets the source Ethernet address to \fImac\fR.
1415 .
1416 .IP \fBmod_dl_dst\fB:\fImac\fR
1417 Sets the destination Ethernet address to \fImac\fR.
1418 .
1419 .IP \fBmod_nw_src\fB:\fIip\fR
1420 Sets the IPv4 source address to \fIip\fR.
1421 .
1422 .IP \fBmod_nw_dst\fB:\fIip\fR
1423 Sets the IPv4 destination address to \fIip\fR.
1424 .
1425 .IP \fBmod_tp_src\fB:\fIport\fR
1426 Sets the TCP or UDP or SCTP source port to \fIport\fR.
1427 .
1428 .IP \fBmod_tp_dst\fB:\fIport\fR
1429 Sets the TCP or UDP or SCTP destination port to \fIport\fR.
1430 .
1431 .IP \fBmod_nw_tos\fB:\fItos\fR
1432 Sets the DSCP bits in the IPv4 ToS/DSCP or IPv6 traffic class field to
1433 \fItos\fR, which must be a multiple of 4 between 0 and 255.  This action
1434 does not modify the two least significant bits of the ToS field (the ECN bits).
1435 .
1436 .IP \fBmod_nw_ecn\fB:\fIecn\fR
1437 Sets the ECN bits in the IPv4 ToS or IPv6 traffic class field to \fIecn\fR,
1438 which must be a value between 0 and 3, inclusive.  This action does not modify
1439 the six most significant bits of the field (the DSCP bits).
1440 .IP
1441 Requires OpenFlow 1.1 or later.
1442 .
1443 .IP \fBmod_nw_ttl\fB:\fIttl\fR
1444 Sets the IPv4 TTL or IPv6 hop limit field to \fIttl\fR, which is specified as
1445 a decimal number between 0 and 255, inclusive.  Switch behavior when setting
1446 \fIttl\fR to zero is not well specified, though.
1447 .IP
1448 Requires OpenFlow 1.1 or later.
1449 .RE
1450 .IP
1451 The following actions are Nicira vendor extensions that, as of this writing, are
1452 only known to be implemented by Open vSwitch:
1453 .
1454 .RS
1455 .
1456 .IP \fBresubmit\fB:\fIport\fR
1457 .IQ \fBresubmit\fB(\fR[\fIport\fR]\fB,\fR[\fItable\fR]\fB)
1458 Re-searches this OpenFlow flow table (or the table whose number is
1459 specified by \fItable\fR) with the \fBin_port\fR field replaced by
1460 \fIport\fR (if \fIport\fR is specified) and executes the actions
1461 found, if any, in addition to any other actions in this flow entry.
1462 .IP
1463 Recursive \fBresubmit\fR actions are obeyed up to an
1464 implementation-defined maximum depth.  Open vSwitch 1.0.1 and earlier
1465 did not support recursion; Open vSwitch before 1.2.90 did not support
1466 \fItable\fR.
1467 .
1468 .IP \fBset_tunnel\fB:\fIid\fR
1469 .IQ \fBset_tunnel64\fB:\fIid\fR
1470 If outputting to a port that encapsulates the packet in a tunnel and
1471 supports an identifier (such as GRE), sets the identifier to \fIid\fR.
1472 If the \fBset_tunnel\fR form is used and \fIid\fR fits in 32 bits,
1473 then this uses an action extension that is supported by Open vSwitch
1474 1.0 and later.  Otherwise, if \fIid\fR is a 64-bit value, it requires
1475 Open vSwitch 1.1 or later.
1476 .
1477 .IP \fBset_queue\fB:\fIqueue\fR
1478 Sets the queue that should be used to \fIqueue\fR when packets are
1479 output.  The number of supported queues depends on the switch; some
1480 OpenFlow implementations do not support queuing at all.
1481 .
1482 .IP \fBpop_queue\fR
1483 Restores the queue to the value it was before any \fBset_queue\fR
1484 actions were applied.
1485 .
1486 .IP \fBdec_ttl\fR
1487 .IQ \fBdec_ttl\fB[\fR(\fIid1,id2\fI)\fR]\fR
1488 Decrement TTL of IPv4 packet or hop limit of IPv6 packet.  If the
1489 TTL or hop limit is initially zero or decrementing would make it so, no
1490 decrement occurs, as packets reaching TTL zero must be rejected.  Instead,
1491 a ``packet-in'' message with reason code \fBOFPR_INVALID_TTL\fR is
1492 sent to each connected controller that has enabled receiving them,
1493 if any.  Processing the current set of actions then stops.  However,
1494 if the current set of actions was reached through ``resubmit'' then
1495 remaining actions in outer levels resume processing.  This action
1496 also optionally supports the ability to specify a list of valid
1497 controller ids.  Each of controllers in the list will receive the
1498 ``packet_in'' message only if they have registered to receive the
1499 invalid ttl packets.  If controller ids are not specified, the
1500 ``packet_in'' message will be sent only to the controllers having
1501 controller id zero which have registered for the invalid ttl packets.
1502 .
1503 .IP \fBset_mpls_label\fR:\fIlabel\fR
1504 Set the label of the outer MPLS label stack entry of a packet.
1505 \fIlabel\fR should be a 20-bit value that is decimal by default;
1506 use a \fB0x\fR prefix to specify them in hexadecimal.
1507 .
1508 .IP \fBset_mpls_tc\fR:\fItc\fR
1509 Set the traffic-class of the outer MPLS label stack entry of a packet.
1510 \fItc\fR should be a in the range 0 to 7 inclusive.
1511 .
1512 .IP \fBset_mpls_ttl\fR:\fIttl\fR
1513 Set the TTL of the outer MPLS label stack entry of a packet.
1514 \fIttl\fR should be in the range 0 to 255 inclusive.
1515 .
1516 .IP \fBdec_mpls_ttl\fR
1517 Decrement TTL of the outer MPLS label stack entry of a packet.  If the TTL
1518 is initially zero or decrementing would make it so, no decrement occurs.
1519 Instead, a ``packet-in'' message with reason code \fBOFPR_INVALID_TTL\fR
1520 is sent to the main controller (id zero), if it has enabled receiving them.
1521 Processing the current set of actions then stops.  However, if the current
1522 set of actions was reached through ``resubmit'' then remaining actions in
1523 outer levels resume processing.
1524 .
1525 .IP \fBnote:\fR[\fIhh\fR]...
1526 Does nothing at all.  Any number of bytes represented as hex digits
1527 \fIhh\fR may be included.  Pairs of hex digits may be separated by
1528 periods for readability.
1529 The \fBnote\fR action's format doesn't include an exact length for its
1530 payload, so the provided bytes will be padded on the right by enough
1531 bytes with value 0 to make the total number 6 more than a multiple of
1532 8.
1533 .
1534 .IP "\fBmove:\fIsrc\fB[\fIstart\fB..\fIend\fB]\->\fIdst\fB[\fIstart\fB..\fIend\fB]\fR"
1535 Copies the named bits from field \fIsrc\fR to field \fIdst\fR.
1536 \fIsrc\fR and \fIdst\fR must be NXM field names as defined in
1537 \fBnicira\-ext.h\fR, e.g. \fBNXM_OF_UDP_SRC\fR or \fBNXM_NX_REG0\fR.
1538 Each \fIstart\fR and \fIend\fR pair, which are inclusive, must specify
1539 the same number of bits and must fit within its respective field.
1540 Shorthands for \fB[\fIstart\fB..\fIend\fB]\fR exist: use
1541 \fB[\fIbit\fB]\fR to specify a single bit or \fB[]\fR to specify an
1542 entire field.
1543 .IP
1544 Examples: \fBmove:NXM_NX_REG0[0..5]\->NXM_NX_REG1[26..31]\fR copies the
1545 six bits numbered 0 through 5, inclusive, in register 0 into bits 26
1546 through 31, inclusive;
1547 \fBmove:NXM_NX_REG0[0..15]\->NXM_OF_VLAN_TCI[]\fR copies the least
1548 significant 16 bits of register 0 into the VLAN TCI field.
1549 .IP
1550 In OpenFlow 1.0 through 1.4, \fBmove\fR ordinarily uses an Open
1551 vSwitch extension to OpenFlow.  In OpenFlow 1.5, \fBmove\fR uses the
1552 OpenFlow 1.5 standard \fBcopy_field\fR action.  The ONF has
1553 also made \fBcopy_field\fR available as an extension to OpenFlow 1.3.
1554 Open vSwitch 2.4 and later understands this extension and uses it if a
1555 controller uses it, but for backward compatibility with older versions
1556 of Open vSwitch, \fBovs\-ofctl\fR does not use it.
1557 .
1558 .IP "\fBset_field:\fIvalue\fR[/\fImask\fR]\fB\->\fIdst"
1559 .IQ "\fBload:\fIvalue\fB\->\fIdst\fB[\fIstart\fB..\fIend\fB]"
1560 Loads a literal value into a field or part of a field.  With
1561 \fBset_field\fR, \fBvalue\fR and the optional \fBmask\fR are given in
1562 the customary syntax for field \fIdst\fR, which is expressed as a
1563 field name.  For example, \fBset_field:00:11:22:33:44:55->eth_src\fR
1564 sets the Ethernet source address to 00:11:22:33:44:55.  With
1565 \fBload\fR, \fIvalue\fR must be an integer value (in decimal or
1566 prefixed by \fB0x\fR for hexadecimal) and \fIdst\fR is the NXM or OXM
1567 name for the field.  For example,
1568 \fBload:0x001122334455->OXM_OF_ETH_DST[]\fR has the same effect as the
1569 prior \fBset_field\fR example.
1570 .IP
1571 The two forms exist for historical reasons.  Open vSwitch 1.1
1572 introduced \fBNXAST_REG_LOAD\fR as a Nicira extension to OpenFlow 1.0
1573 and used \fBload\fR to express it.  Later, OpenFlow 1.2 introduced a
1574 standard \fBOFPAT_SET_FIELD\fR action that was restricted to loading
1575 entire fields, so Open vSwitch added the form \fBset_field\fR with
1576 this restriction.  OpenFlow 1.5 extended \fBOFPAT_SET_FIELD\fR to the
1577 point that it became a superset of \fBNXAST_REG_LOAD\fR.  Open vSwitch
1578 translates either syntax as necessary for the OpenFlow version in use:
1579 in OpenFlow 1.0 and 1.1, \fBNXAST_REG_LOAD\fR; in OpenFlow 1.2, 1.3,
1580 and 1.4, \fBNXAST_REG_LOAD\fR for \fBload\fR or for loading a
1581 subfield, \fBOFPAT_SET_FIELD\fR otherwise; and OpenFlow 1.5 and later,
1582 \fBOFPAT_SET_FIELD\fR.
1583 .
1584 .IP "\fBpush:\fIsrc\fB[\fIstart\fB..\fIend\fB]"
1585 Pushes \fIstart\fR to \fIend\fR bits inclusive, in fields
1586 on top of the stack.
1587 .IP
1588 Example: \fBpush:NXM_NX_REG2[0..5]\fR push the value stored in register
1589 2 bits 0 through 5, inclusive, on to the internal stack.
1590 .
1591 .IP "\fBpop:\fIdst\fB[\fIstart\fB..\fIend\fB]"
1592 Pops from the top of the stack, retrieves the \fIstart\fR to \fIend\fR bits
1593 inclusive, from the value popped and store them into the corresponding
1594 bits in \fIdst\fR.
1595 .
1596 .IP
1597 Example: \fBpop:NXM_NX_REG2[0..5]\fR pops the value from top of the stack.
1598 Set register 2 bits 0 through 5, inclusive, based on bits 0 through 5 from the
1599 value just popped.
1600 .
1601 .
1602 .IP "\fBmultipath(\fIfields\fB, \fIbasis\fB, \fIalgorithm\fB, \fIn_links\fB, \fIarg\fB, \fIdst\fB[\fIstart\fB..\fIend\fB])\fR"
1603 Hashes \fIfields\fR using \fIbasis\fR as a universal hash parameter,
1604 then the applies multipath link selection \fIalgorithm\fR (with
1605 parameter \fIarg\fR) to choose one of \fIn_links\fR output links
1606 numbered 0 through \fIn_links\fR minus 1, and stores the link into
1607 \fIdst\fB[\fIstart\fB..\fIend\fB]\fR, which must be an NXM field as
1608 described above.
1609 .IP
1610 Currently, \fIfields\fR must be either \fBeth_src\fR or
1611 \fBsymmetric_l4\fR and \fIalgorithm\fR must be one of \fBmodulo_n\fR,
1612 \fBhash_threshold\fR, \fBhrw\fR, and \fBiter_hash\fR.  Only
1613 the \fBiter_hash\fR algorithm uses \fIarg\fR.
1614 .IP
1615 Refer to \fBnicira\-ext.h\fR for more details.
1616 .
1617 .IP "\fBbundle(\fIfields\fB, \fIbasis\fB, \fIalgorithm\fB, \fIslave_type\fB, slaves:[\fIs1\fB, \fIs2\fB, ...])\fR"
1618 Hashes \fIfields\fR using \fIbasis\fR as a universal hash parameter, then
1619 applies the bundle link selection \fIalgorithm\fR to choose one of the listed
1620 slaves represented as \fIslave_type\fR.  Currently the only supported
1621 \fIslave_type\fR is \fBofport\fR.  Thus, each \fIs1\fR through \fIsN\fR should
1622 be an OpenFlow port number. Outputs to the selected slave.
1623 .IP
1624 Currently, \fIfields\fR must be either \fBeth_src\fR or \fBsymmetric_l4\fR and
1625 \fIalgorithm\fR must be one of \fBhrw\fR and \fBactive_backup\fR.
1626 .IP
1627 Example: \fBbundle(eth_src,0,hrw,ofport,slaves:4,8)\fR uses an Ethernet source
1628 hash with basis 0, to select between OpenFlow ports 4 and 8 using the Highest
1629 Random Weight algorithm.
1630 .IP
1631 Refer to \fBnicira\-ext.h\fR for more details.
1632 .
1633 .IP "\fBbundle_load(\fIfields\fB, \fIbasis\fB, \fIalgorithm\fB, \fIslave_type\fB, \fIdst\fB[\fIstart\fB..\fIend\fB], slaves:[\fIs1\fB, \fIs2\fB, ...])\fR"
1634 Has the same behavior as the \fBbundle\fR action, with one exception.  Instead
1635 of outputting to the selected slave, it writes its selection to
1636 \fIdst\fB[\fIstart\fB..\fIend\fB]\fR, which must be an NXM field as described
1637 above.
1638 .IP
1639 Example: \fBbundle_load(eth_src, 0, hrw, ofport, NXM_NX_REG0[],
1640 slaves:4, 8)\fR uses an Ethernet source hash with basis 0, to select
1641 between OpenFlow ports 4 and 8 using the Highest Random Weight
1642 algorithm, and writes the selection to \fBNXM_NX_REG0[]\fR.
1643 .IP
1644 Refer to \fBnicira\-ext.h\fR for more details.
1645 .
1646 .IP "\fBlearn(\fIargument\fR[\fB,\fIargument\fR]...\fB)\fR"
1647 This action adds or modifies a flow in an OpenFlow table, similar to
1648 \fBovs\-ofctl \-\-strict mod\-flows\fR.  The arguments specify the
1649 flow's match fields, actions, and other properties, as follows.  At
1650 least one match criterion and one action argument should ordinarily be
1651 specified.
1652 .RS
1653 .IP \fBidle_timeout=\fIseconds\fR
1654 .IQ \fBhard_timeout=\fIseconds\fR
1655 .IQ \fBpriority=\fIvalue\fR
1656 .IQ \fBcookie=\fIvalue\fR
1657 .IQ \fBsend_flow_rem\fR
1658 These arguments have the same meaning as in the usual \fBovs\-ofctl\fR
1659 flow syntax.
1660 .
1661 .IP \fBfin_idle_timeout=\fIseconds\fR
1662 .IQ \fBfin_hard_timeout=\fIseconds\fR
1663 Adds a \fBfin_timeout\fR action with the specified arguments to the
1664 new flow.  This feature was added in Open vSwitch 1.5.90.
1665 .
1666 .IP \fBtable=\fInumber\fR
1667 The table in which the new flow should be inserted.  Specify a decimal
1668 number between 0 and 254.  The default, if \fBtable\fR is unspecified,
1669 is table 1.
1670 .
1671 .IP \fBdelete_learned\fR
1672 This flag enables deletion of the learned flows when the flow with the
1673 \fBlearn\fR action is removed.  Specifically, when the last
1674 \fBlearn\fR action with this flag and particular \fBtable\fR and
1675 \fBcookie\fR values is removed, the switch deletes all of the flows in
1676 the specified table with the specified cookie.
1677 .
1678 .IP
1679 This flag was added in Open vSwitch 2.4.
1680 .
1681 .IP \fIfield\fB=\fIvalue\fR
1682 .IQ \fIfield\fB[\fIstart\fB..\fIend\fB]=\fIsrc\fB[\fIstart\fB..\fIend\fB]\fR
1683 .IQ \fIfield\fB[\fIstart\fB..\fIend\fB]\fR
1684 Adds a match criterion to the new flow.
1685 .IP
1686 The first form specifies that \fIfield\fR must match the literal
1687 \fIvalue\fR, e.g. \fBdl_type=0x0800\fR.  All of the fields and values
1688 for \fBovs\-ofctl\fR flow syntax are available with their usual
1689 meanings.
1690 .IP
1691 The second form specifies that \fIfield\fB[\fIstart\fB..\fIend\fB]\fR
1692 in the new flow must match \fIsrc\fB[\fIstart\fB..\fIend\fB]\fR taken
1693 from the flow currently being processed.
1694 .IP
1695 The third form is a shorthand for the second form.  It specifies that
1696 \fIfield\fB[\fIstart\fB..\fIend\fB]\fR in the new flow must match
1697 \fIfield\fB[\fIstart\fB..\fIend\fB]\fR taken from the flow currently
1698 being processed.
1699 .
1700 .IP \fBload:\fIvalue\fB\->\fIdst\fB[\fIstart\fB..\fIend\fB]
1701 .IQ \fBload:\fIsrc\fB[\fIstart\fB..\fIend\fB]\->\fIdst\fB[\fIstart\fB..\fIend\fB]
1702 .
1703 Adds a \fBload\fR action to the new flow.
1704 .IP
1705 The first form loads the literal \fIvalue\fR into bits \fIstart\fR
1706 through \fIend\fR, inclusive, in field \fIdst\fR.  Its syntax is the
1707 same as the \fBload\fR action described earlier in this section.
1708 .IP
1709 The second form loads \fIsrc\fB[\fIstart\fB..\fIend\fB]\fR, a value
1710 from the flow currently being processed, into bits \fIstart\fR
1711 through \fIend\fR, inclusive, in field \fIdst\fR.
1712 .
1713 .IP \fBoutput:\fIfield\fB[\fIstart\fB..\fIend\fB]\fR
1714 Add an \fBoutput\fR action to the new flow's actions, that outputs to
1715 the OpenFlow port taken from \fIfield\fB[\fIstart\fB..\fIend\fB]\fR,
1716 which must be an NXM field as described above.
1717 .RE
1718 .IP
1719 For best performance, segregate learned flows into a table (using
1720 \fBtable=\fInumber\fR) that is not used for any other flows except
1721 possibly for a lowest-priority ``catch-all'' flow, that is, a flow
1722 with no match criteria.  (This is why the default \fBtable\fR is 1, to
1723 keep the learned flows separate from the primary flow table 0.)
1724 .RE
1725 .
1726 .RS
1727 .
1728 .IP \fBclear_actions\fR
1729 Clears all the actions in the action set immediately.
1730 .
1731 .IP \fBwrite_actions(\fR[\fIaction\fR][\fB,\fIaction\fR...]\fB)
1732 Add the specific actions to the action set.  The syntax of
1733 \fIactions\fR is the same as in the \fBactions=\fR field.  The action
1734 set is carried between flow tables and then executed at the end of the
1735 pipeline.
1736 .
1737 .IP
1738 The actions in the action set are applied in the following order, as
1739 required by the OpenFlow specification, regardless of the order in
1740 which they were added to the action set.  Except as specified
1741 otherwise below, the action set only holds at most a single action of
1742 each type.  When more than one action of a single type is written to
1743 the action set, the one written later replaces the earlier action:
1744 .
1745 .RS
1746 .IP 1.
1747 \fBstrip_vlan\fR
1748 .IQ
1749 \fBpop_mpls\fR
1750 .
1751 .IP 2.
1752 \fBpush_mpls\fR
1753 .
1754 .IP 3.
1755 \fBpush_vlan\fR
1756 .
1757 .IP 4.
1758 \fBdec_ttl\fR
1759 .IQ
1760 \fBdec_mpls_ttl\fR
1761 .
1762 .IP 5.
1763 \fBload\fR
1764 .IQ
1765 \fBmove\fR
1766 .IQ
1767 \fBmod_dl_dst\fR
1768 .IQ
1769 \fBmod_dl_src\fR
1770 .IQ
1771 \fBmod_nw_dst\fR
1772 .IQ
1773 \fBmod_nw_src\fR
1774 .IQ
1775 \fBmod_nw_tos\fR
1776 .IQ
1777 \fBmod_nw_ecn\fR
1778 .IQ
1779 \fBmod_nw_ttl\fR
1780 .IQ
1781 \fBmod_tp_dst\fR
1782 .IQ
1783 \fBmod_tp_src\fR
1784 .IQ
1785 \fBmod_vlan_pcp\fR
1786 .IQ
1787 \fBmod_vlan_vid\fR
1788 .IQ
1789 \fBset_field\fR
1790 .IQ
1791 \fBset_tunnel\fR
1792 .IQ
1793 \fBset_tunnel64\fR
1794 .IQ
1795 The action set can contain any number of these actions, with
1796 cumulative effect. They will be applied in the order as added.
1797 That is, when multiple actions modify the same part of a field,
1798 the later modification takes effect, and when they modify
1799 different parts of a field (or different fields), then both
1800 modifications are applied.
1801 .
1802 .IP 6.
1803 \fBset_queue\fR
1804 .
1805 .IP 7.
1806 \fBgroup\fR
1807 .IQ
1808 \fBoutput\fR
1809 .IQ
1810 \fBresubmit\fR
1811 .IQ
1812 If more than one of these actions is present, then the one listed
1813 earliest above is executed and the others are ignored, regardless of
1814 the order in which they were added to the action set.  (If none of these
1815 actions is present, the action set has no real effect, because the
1816 modified packet is not sent anywhere and thus the modifications are
1817 not visible.)
1818 .RE
1819 .IP
1820 Only the actions listed above may be written to the action set.
1821 .
1822 .IP \fBwrite_metadata\fB:\fIvalue\fR[/\fImask\fR]
1823 Updates the metadata field for the flow. If \fImask\fR is omitted, the
1824 metadata field is set exactly to \fIvalue\fR; if \fImask\fR is specified, then
1825 a 1-bit in \fImask\fR indicates that the corresponding bit in the metadata
1826 field will be replaced with the corresponding bit from \fIvalue\fR. Both
1827 \fIvalue\fR and \fImask\fR are 64-bit values that are decimal by default; use
1828 a \fB0x\fR prefix to specify them in hexadecimal.
1829 .
1830 .IP \fBmeter\fR:\fImeter_id\fR
1831 Apply the \fImeter_id\fR before any other actions. If a meter band rate is
1832 exceeded, the packet may be dropped, or modified, depending on the meter
1833 band type. See the description of the \fBMeter Table Commands\fR, above,
1834 for more details.
1835 .
1836 .IP \fBgoto_table\fR:\fItable\fR
1837 Indicates the next table in the process pipeline.
1838 .
1839 .IP "\fBfin_timeout(\fIargument\fR[\fB,\fIargument\fR]\fB)"
1840 This action changes the idle timeout or hard timeout, or both, of this
1841 OpenFlow rule when the rule matches a TCP packet with the FIN or RST
1842 flag.  When such a packet is observed, the action reduces the rule's
1843 timeouts to those specified on the action.  If the rule's existing
1844 timeout is already shorter than the one that the action specifies,
1845 then that timeout is unaffected.
1846 .IP
1847 \fIargument\fR takes the following forms:
1848 .RS
1849 .IP "\fBidle_timeout=\fIseconds\fR"
1850 Causes the flow to expire after the given number of seconds of
1851 inactivity.
1852 .
1853 .IP "\fBhard_timeout=\fIseconds\fR"
1854 Causes the flow to expire after the given number of seconds,
1855 regardless of activity.  (\fIseconds\fR specifies time since the
1856 flow's creation, not since the receipt of the FIN or RST.)
1857 .RE
1858 .IP
1859 This action was added in Open vSwitch 1.5.90.
1860 .
1861 .IP "\fBsample(\fIargument\fR[\fB,\fIargument\fR]...\fB)\fR"
1862 Samples packets and sends one sample for every sampled packet.
1863 .IP
1864 \fIargument\fR takes the following forms:
1865 .RS
1866 .IP "\fBprobability=\fIpackets\fR"
1867 The number of sampled packets out of 65535.  Must be greater or equal to 1.
1868 .IP "\fBcollector_set_id=\fIid\fR"
1869 The unsigned 32-bit integer identifier of the set of sample collectors
1870 to send sampled packets to.  Defaults to 0.
1871 .IP "\fBobs_domain_id=\fIid\fR"
1872 When sending samples to IPFIX collectors, the unsigned 32-bit integer
1873 Observation Domain ID sent in every IPFIX flow record.  Defaults to 0.
1874 .IP "\fBobs_point_id=\fIid\fR"
1875 When sending samples to IPFIX collectors, the unsigned 32-bit integer
1876 Observation Point ID sent in every IPFIX flow record.  Defaults to 0.
1877 .RE
1878 .IP
1879 Refer to \fBovs\-vswitchd.conf.db\fR(8) for more details on
1880 configuring sample collector sets.
1881 .IP
1882 This action was added in Open vSwitch 1.10.90.
1883 .
1884 .IP "\fBexit\fR"
1885 This action causes Open vSwitch to immediately halt execution of
1886 further actions.  Those actions which have already been executed are
1887 unaffected.  Any further actions, including those which may be in
1888 other tables, or different levels of the \fBresubmit\fR call stack,
1889 are ignored.  Actions in the action set is still executed (specify
1890 \fBclear_actions\fR before \fBexit\fR to discard them).
1891 .
1892 .IP "\fBconjunction(\fIid\fB, \fIk\fB/\fIn\fR\fB)\fR"
1893 An individual OpenFlow flow can match only a single value for each
1894 field.  However, situations often arise where one wants to match one
1895 of a set of values within a field or fields.  For matching a single
1896 field against a set, it is straightforward and efficient to add
1897 multiple flows to the flow table, one for each value in the set.  For
1898 example, one might use the following flows to send packets with IP
1899 source address \fIa\fR, \fIb\fR, \fIc\fR, or \fId\fR to the OpenFlow
1900 controller:
1901 .RS +1in
1902 .br
1903 \fBip,ip_src=\fIa\fB actions=controller\fR
1904 .br
1905 \fBip,ip_src=\fIb\fB actions=controller\fR
1906 .br
1907 \fBip,ip_src=\fIc\fB actions=controller\fR
1908 .br
1909 \fBip,ip_src=\fId\fB actions=controller\fR
1910 .br
1911 .RE
1912 .IP
1913 Similarly, these flows send packets with IP destination address
1914 \fIe\fR, \fIf\fR, \fIg\fR, or \fIh\fR to the OpenFlow controller:
1915 .RS +1in
1916 .br
1917 \fBip,ip_dst=\fIe\fB actions=controller\fR
1918 .br
1919 \fBip,ip_dst=\fIf\fB actions=controller\fR
1920 .br
1921 \fBip,ip_dst=\fIg\fB actions=controller\fR
1922 .br
1923 \fBip,ip_dst=\fIh\fB actions=controller\fR
1924 .br
1925 .RE
1926 .IP
1927 Installing all of the above flows in a single flow table yields a
1928 disjunctive effect: a packet is sent to the controller if \fBip_src\fR
1929 \[mo] {\fIa\fR,\fIb\fR,\fIc\fR,\fId\fR} or \fBip_dst\fR \[mo]
1930 {\fIe\fR,\fIf\fR,\fIg\fR,\fIh\fR} (or both).  (Pedantically, if both
1931 of the above sets of flows are present in the flow table, they should
1932 have different priorities, because OpenFlow says that the results are
1933 undefined when two flows with same priority can both match a single
1934 packet.)
1935 .IP
1936 Suppose, on the other hand, one wishes to match conjunctively, that
1937 is, to send a packet to the controller only if both \fBip_src\fR \[mo]
1938 {\fIa\fR,\fIb\fR,\fIc\fR,\fId\fR} and \fBip_dst\fR \[mo]
1939 {\fIe\fR,\fIf\fR,\fIg\fR,\fIh\fR}.  This requires 4 \[mu] 4 = 16
1940 flows, one for each possible pairing of \fBip_src\fR and \fBip_dst\fR.
1941 That is acceptable for our small example, but it does not gracefully
1942 extend to larger sets or greater numbers of dimensions.
1943 .IP
1944 The \fBconjunction\fR action is a solution for conjunctive matches
1945 that is built into Open vSwitch.  A \fBconjunction\fR action ties
1946 groups of individual OpenFlow flows into higher-level ``conjunctive
1947 flows''.  Each group corresponds to one dimension, and each flow
1948 within the group matches one possible value for the dimension.  A
1949 packet that matches one flow from each group matches the conjunctive
1950 flow.
1951 .IP
1952 To implement a conjunctive flow with \fBconjunction\fR, assign the
1953 conjunctive flow a 32-bit \fIid\fR, which must be unique within an
1954 OpenFlow table.  Assign each of the \fIn\fR \[>=] 2 dimensions a
1955 unique number from 1 to \fIn\fR; the ordering is unimportant.  Add one
1956 flow to the OpenFlow flow table for each possible value of each
1957 dimension with \fBconjunction(\fIid, \fIk\fB/\fIn\fB)\fR as the flow's
1958 actions, where \fIk\fR is the number assigned to the flow's dimension.
1959 Together, these flows specify the conjunctive flow's match condition.
1960 When the conjunctive match condition is met, Open vSwitch looks up one
1961 more flow that specifies the conjunctive flow's actions and receives
1962 its statistics.  This flow is found by setting \fBconj_id\fR to the
1963 specified \fIid\fR and then again searching the flow table.
1964 .IP
1965 The following flows provide an example.  Whenever the IP source is one
1966 of the values in the flows that match on the IP source (dimension 1 of
1967 2), \fIand\fR the IP destination is one of the values in the flows
1968 that match on IP destination (dimension 2 of 2), Open vSwitch searches
1969 for a flow that matches \fBconj_id\fR against the conjunction ID
1970 (1234), finding the first flow listed below.
1971 .RS +1in
1972 .br
1973 .B "conj_id=1234 actions=controller"
1974 .br
1975 .B "ip,ip_src=10.0.0.1 actions=conjunction(1234, 1/2)"
1976 .br
1977 .B "ip,ip_src=10.0.0.4 actions=conjunction(1234, 1/2)"
1978 .br
1979 .B "ip,ip_src=10.0.0.6 actions=conjunction(1234, 1/2)"
1980 .br
1981 .B "ip,ip_src=10.0.0.7 actions=conjunction(1234, 1/2)"
1982 .br
1983 .B "ip,ip_dst=10.0.0.2 actions=conjunction(1234, 2/2)"
1984 .br
1985 .B "ip,ip_dst=10.0.0.5 actions=conjunction(1234, 2/2)"
1986 .br
1987 .B "ip,ip_dst=10.0.0.7 actions=conjunction(1234, 2/2)"
1988 .br
1989 .B "ip,ip_dst=10.0.0.8 actions=conjunction(1234, 2/2)"
1990 .RE
1991 .IP
1992 Many subtleties exist:
1993 .RS
1994 .IP \(bu
1995 In the example above, every flow in a single dimension has the same
1996 form, that is, dimension 1 matches on \fBip_src\fR, dimension 2 on
1997 \fBip_dst\fR, but this is not a requirement.  Different flows within a
1998 dimension may match on different bits within a field (e.g. IP network
1999 prefixes of different lengths, or TCP/UDP port ranges as bitwise
2000 matches), or even on entirely different fields (e.g. to match packets
2001 for TCP source port 80 or TCP destination port 80).
2002 .IP \(bu
2003 The flows within a dimension can vary their matches across more than
2004 one field, e.g. to match only specific pairs of IP source and
2005 destination addresses or L4 port numbers.
2006 .IP \(bu
2007 A flow may have multiple \fBconjunction\fR actions, with different
2008 \fIid\fR values.  This is useful for multiple conjunctive flows with
2009 overlapping sets.  If one conjunctive flow matches packets with both
2010 \fBip_src\fR \[mo] {\fIa\fR,\fIb\fR} and \fBip_dst\fR \[mo]
2011 {\fId\fR,\fIe\fR} and a second conjunctive flow matches \fBip_src\fR
2012 \[mo] {\fIb\fR,\fIc\fR} and \fBip_dst\fR \[mo] {\fIf\fR,\fIg\fR}, for
2013 example, then the flow that matches \fBip_src=\fIb\fR would have two
2014 \fBconjunction\fR actions, one for each conjunctive flow.  The order
2015 of \fBconjunction\fR actions within a list of actions is not
2016 significant.
2017 .IP \(bu
2018 A flow with \fBconjunction\fR actions may also include \fBnote\fR
2019 actions for annotations, but not any other kind of actions.  (They
2020 would not be useful because they would never be executed.)
2021 .IP \(bu
2022 All of the flows that constitute a conjunctive flow with a given
2023 \fIid\fR must have the same priority.  (Flows with the same \fIid\fR
2024 but different priorities are currently treated as different
2025 conjunctive flows, that is, currently \fIid\fR values need only be
2026 unique within an OpenFlow table at a given priority.  This behavior
2027 isn't guaranteed to stay the same in later releases, so please use
2028 \fIid\fR values unique within an OpenFlow table.)
2029 .IP \(bu
2030 Conjunctive flows must not overlap with each other, at a given
2031 priority, that is, any given packet must be able to match at most one
2032 conjunctive flow at a given priority.  Overlapping conjunctive flows
2033 yield unpredictable results.
2034 .IP \(bu
2035 Following a conjunctive flow match, the search for the flow with
2036 \fBconj_id=\fIid\fR is done in the same general-purpose way as other flow
2037 table searches, so one can use flows with \fBconj_id=\fIid\fR to act
2038 differently depending on circumstances.  (One exception is that the
2039 search for the \fBconj_id=\fIid\fR flow itself ignores conjunctive flows,
2040 to avoid recursion.) If the search with \fBconj_id=\fIid\fR fails, Open
2041 vSwitch acts as if the conjunctive flow had not matched at all, and
2042 continues searching the flow table for other matching flows.
2043 .IP \(bu
2044 OpenFlow prerequisite checking occurs for the flow with
2045 \fBconj_id=\fIid\fR in the same way as any other flow, e.g. in an
2046 OpenFlow 1.1+ context, putting a \fBmod_nw_src\fR action into the
2047 example above would require adding an \fBip\fR match, like this:
2048 .RS +1in
2049 .br
2050 .B "conj_id=1234,ip actions=mod_nw_src:1.2.3.4,controller"
2051 .br
2052 .RE
2053 .IP \(bu
2054 OpenFlow prerequisite checking also occurs for the individual flows
2055 that comprise a conjunctive match in the same way as any other flow.
2056 .IP \(bu
2057 The flows that constitute a conjunctive flow do not have useful
2058 statistics.  They are never updated with byte or packet counts, and so
2059 on.  (For such a flow, therefore, the idle and hard timeouts work much
2060 the same way.)
2061 .IP \(bu
2062 Conjunctive flows can be a useful building block for negation, that
2063 is, inequality matches like \fBtcp_src\fR \[!=] 80.  To implement an
2064 inequality match, convert it to a pair of range matches, e.g. 0 \[<=]
2065 \fBtcp_src\ < 80 and 80 < \fBtcp_src\fR \[<=] 65535, then convert each
2066 of the range matches into a collection of bitwise matches as explained
2067 above in the description of \fBtcp_src\fR.
2068 .IP \(bu
2069 Sometimes there is a choice of which flows include a particular match.
2070 For example, suppose that we added an extra constraint to our example,
2071 to match on \fBip_src\fR \[mo] {\fIa\fR,\fIb\fR,\fIc\fR,\fId\fR} and
2072 \fBip_dst\fR \[mo] {\fIe\fR,\fIf\fR,\fIg\fR,\fIh\fR} and \fBtcp_dst\fR
2073 = \fIi\fR.  One way to implement this is to add the new constraint to
2074 the \fBconj_id\fR flow, like this:
2075 .RS +1in
2076 .br
2077 \fBconj_id=1234,tcp,tcp_dst=\fIi\fB actions=mod_nw_src:1.2.3.4,controller\fR
2078 .br
2079 .RE
2080 .IP
2081 \fIbut this is not recommended\fR because of the cost of the extra
2082 flow table lookup.  Instead, add the constraint to the individual
2083 flows, either in one of the dimensions or (slightly better) all of
2084 them.
2085 .IP \(bu
2086 A conjunctive match must have \fIn\fR \[>=] 2 dimensions (otherwise a
2087 conjunctive match is not necessary).  Open vSwitch enforces this.
2088 .IP \(bu
2089 Each dimension within a conjunctive match should ordinarily have more
2090 than one flow.  Open vSwitch does not enforce this.
2091 .RE
2092 .IP
2093 The \fBconjunction\fR action and \fBconj_id\fR field were introduced
2094 in Open vSwitch 2.4.
2095 .RE
2096 .
2097 .PP
2098 An opaque identifier called a cookie can be used as a handle to identify
2099 a set of flows:
2100 .
2101 .IP \fBcookie=\fIvalue\fR
2102 .
2103 A cookie can be associated with a flow using the \fBadd\-flow\fR,
2104 \fBadd\-flows\fR, and \fBmod\-flows\fR commands.  \fIvalue\fR can be any
2105 64-bit number and need not be unique among flows.  If this field is
2106 omitted, a default cookie value of 0 is used.
2107 .
2108 .IP \fBcookie=\fIvalue\fR\fB/\fImask\fR
2109 .
2110 When using NXM, the cookie can be used as a handle for querying,
2111 modifying, and deleting flows.  \fIvalue\fR and \fImask\fR may be
2112 supplied for the \fBdel\-flows\fR, \fBmod\-flows\fR, \fBdump\-flows\fR, and
2113 \fBdump\-aggregate\fR commands to limit matching cookies.  A 1-bit in
2114 \fImask\fR indicates that the corresponding bit in \fIcookie\fR must
2115 match exactly, and a 0-bit wildcards that bit.  A mask of \-1 may be used
2116 to exactly match a cookie.
2117 .IP
2118 The \fBmod\-flows\fR command can update the cookies of flows that
2119 match a cookie by specifying the \fIcookie\fR field twice (once with a
2120 mask for matching and once without to indicate the new value):
2121 .RS
2122 .IP "\fBovs\-ofctl mod\-flows br0 cookie=1,actions=normal\fR"
2123 Change all flows' cookies to 1 and change their actions to \fBnormal\fR.
2124 .IP "\fBovs\-ofctl mod\-flows br0 cookie=1/\-1,cookie=2,actions=normal\fR"
2125 Update cookies with a value of 1 to 2 and change their actions to
2126 \fBnormal\fR.
2127 .RE
2128 .IP
2129 The ability to match on cookies was added in Open vSwitch 1.5.0.
2130 .
2131 .PP
2132 The following additional field sets the priority for flows added by
2133 the \fBadd\-flow\fR and \fBadd\-flows\fR commands.  For
2134 \fBmod\-flows\fR and \fBdel\-flows\fR when \fB\-\-strict\fR is
2135 specified, priority must match along with the rest of the flow
2136 specification.  For \fBmod-flows\fR without \fB\-\-strict\fR,
2137 priority is only significant if the command creates a new flow, that
2138 is, non-strict \fBmod\-flows\fR does not match on priority and will
2139 not change the priority of existing flows.  Other commands do not
2140 allow priority to be specified.
2141 .
2142 .IP \fBpriority=\fIvalue\fR
2143 The priority at which a wildcarded entry will match in comparison to
2144 others.  \fIvalue\fR is a number between 0 and 65535, inclusive.  A higher 
2145 \fIvalue\fR will match before a lower one.  An exact-match entry will always 
2146 have priority over an entry containing wildcards, so it has an implicit 
2147 priority value of 65535.  When adding a flow, if the field is not specified, 
2148 the flow's priority will default to 32768.
2149 .IP
2150 OpenFlow leaves behavior undefined when two or more flows with the
2151 same priority can match a single packet.  Some users expect
2152 ``sensible'' behavior, such as more specific flows taking precedence
2153 over less specific flows, but OpenFlow does not specify this and Open
2154 vSwitch does not implement it.  Users should therefore take care to
2155 use priorities to ensure the behavior that they expect.
2156 .
2157 .PP
2158 The \fBadd\-flow\fR, \fBadd\-flows\fR, and \fBmod\-flows\fR commands
2159 support the following additional options.  These options affect only
2160 new flows.  Thus, for \fBadd\-flow\fR and \fBadd\-flows\fR, these
2161 options are always significant, but for \fBmod\-flows\fR they are
2162 significant only if the command creates a new flow, that is, their
2163 values do not update or affect existing flows.
2164 .
2165 .IP "\fBidle_timeout=\fIseconds\fR"
2166 Causes the flow to expire after the given number of seconds of
2167 inactivity.  A value of 0 (the default) prevents a flow from expiring
2168 due to inactivity.
2169 .
2170 .IP \fBhard_timeout=\fIseconds\fR
2171 Causes the flow to expire after the given number of seconds,
2172 regardless of activity.  A value of 0 (the default) gives the flow no
2173 hard expiration deadline.
2174 .
2175 .IP "\fBimportance=\fIvalue\fR"
2176 Sets the importance of a flow.  The flow entry eviction mechanism can
2177 use importance as a factor in deciding which flow to evict.  A value
2178 of 0 (the default) makes the flow non-evictable on the basis of
2179 importance.  Specify a value between 0 and 65535.
2180 .IP
2181 Only OpenFlow 1.4 and later support \fBimportance\fR.
2182 .
2183 .IP "\fBsend_flow_rem\fR"
2184 Marks the flow with a flag that causes the switch to generate a ``flow
2185 removed'' message and send it to interested controllers when the flow
2186 later expires or is removed.
2187 .
2188 .IP "\fBcheck_overlap\fR"
2189 Forces the switch to check that the flow match does not overlap that
2190 of any different flow with the same priority in the same table.  (This
2191 check is expensive so it is best to avoid it.)
2192 .
2193 .PP
2194 The \fBdump\-flows\fR, \fBdump\-aggregate\fR, \fBdel\-flow\fR 
2195 and \fBdel\-flows\fR commands support one additional optional field:
2196 .
2197 .TP
2198 \fBout_port=\fIport\fR
2199 If set, a matching flow must include an output action to \fIport\fR,
2200 which must be an OpenFlow port number or name (e.g. \fBlocal\fR).
2201 .
2202 .SS "Table Entry Output"
2203 .
2204 The \fBdump\-tables\fR and \fBdump\-aggregate\fR commands print information 
2205 about the entries in a datapath's tables.  Each line of output is a 
2206 flow entry as described in \fBFlow Syntax\fR, above, plus some
2207 additional fields:
2208 .
2209 .IP \fBduration=\fIsecs\fR
2210 The time, in seconds, that the entry has been in the table.
2211 \fIsecs\fR includes as much precision as the switch provides, possibly
2212 to nanosecond resolution.
2213 .
2214 .IP \fBn_packets\fR
2215 The number of packets that have matched the entry.
2216 .
2217 .IP \fBn_bytes\fR
2218 The total number of bytes from packets that have matched the entry.
2219 .
2220 .PP
2221 The following additional fields are included only if the switch is
2222 Open vSwitch 1.6 or later and the NXM flow format is used to dump the
2223 flow (see the description of the \fB\-\-flow-format\fR option below).
2224 The values of these additional fields are approximations only and in
2225 particular \fBidle_age\fR will sometimes become nonzero even for busy
2226 flows.
2227 .
2228 .IP \fBhard_age=\fIsecs\fR
2229 The integer number of seconds since the flow was added or modified.
2230 \fBhard_age\fR is displayed only if it differs from the integer part
2231 of \fBduration\fR.  (This is separate from \fBduration\fR because
2232 \fBmod\-flows\fR restarts the \fBhard_timeout\fR timer without zeroing
2233 \fBduration\fR.)
2234 .
2235 .IP \fBidle_age=\fIsecs\fR
2236 The integer number of seconds that have passed without any packets
2237 passing through the flow.
2238 .
2239 .SS "Group Syntax"
2240 .PP
2241 Some \fBovs\-ofctl\fR commands accept an argument that describes a group or
2242 groups.  Such flow descriptions comprise a series
2243 \fIfield\fB=\fIvalue\fR assignments, separated by commas or white
2244 space.  (Embedding spaces into a group description normally requires
2245 quoting to prevent the shell from breaking the description into
2246 multiple arguments.). Unless noted otherwise only the last instance
2247 of each field is honoured.
2248 .PP
2249 .IP \fBgroup_id=\fIid\fR
2250 The integer group id of group.
2251 When this field is specified in \fBdel\-groups\fR or \fBdump\-groups\fR,
2252 the keyword "all" may be used to designate all groups.
2253 .
2254 This field is required.
2255
2256
2257 .IP \fBtype=\fItype\fR
2258 The type of the group.  The \fBadd-group\fR, \fBadd-groups\fR and
2259 \fBmod-groups\fR commands require this field.  It is prohibited for
2260 other commands. The following keywords designated the allowed types:
2261 .RS
2262 .IP \fBall\fR
2263 Execute all buckets in the group.
2264 .IP \fBselect\fR
2265 Execute one bucket in the group.
2266 The switch should select the bucket in such a way that should implement
2267 equal load sharing is achieved.  The switch may optionally select the
2268 bucket based on bucket weights.
2269 .IP \fBindirect\fR
2270 Executes the one bucket in the group.
2271 .IP \fBff\fR
2272 .IQ \fBfast_failover\fR
2273 Executes the first live bucket in the group which is associated with
2274 a live port or group.
2275 .RE
2276
2277 .IP \fBcommand_bucket_id=\fIid\fR
2278 The bucket to operate on.  The \fBinsert-buckets\fR and \fBremove-buckets\fR
2279 commands require this field.  It is prohibited for other commands.
2280 \fIid\fR may be an integer or one of the following keywords:
2281 .RS
2282 .IP \fBall\fR
2283 Operate on all buckets in the group.
2284 Only valid when used with the \fBremove-buckets\fR command in which
2285 case the effect is to remove all buckets from the group.
2286 .IP \fBfirst\fR
2287 Operate on the first bucket present in the group.
2288 In the case of the \fBinsert-buckets\fR command the effect is to
2289 insert new bucets just before the first bucket already present in the group;
2290 or to replace the buckets of the group if there are no buckets already present
2291 in the group.
2292 In the case of the \fBremove-buckets\fR command the effect is to
2293 remove the first bucket of the group; or do nothing if there are no
2294 buckets present in the group.
2295 .IP \fBlast\fR
2296 Operate on the last bucket present in the group.
2297 In the case of the \fBinsert-buckets\fR command the effect is to
2298 insert new bucets just after the last bucket already present in the group;
2299 or to replace the buckets of the group if there are no buckets already present
2300 in the group.
2301 In the case of the \fBremove-buckets\fR command the effect is to
2302 remove the last bucket of the group; or do nothing if there are no
2303 buckets present in the group.
2304 .RE
2305 .IP
2306 If \fIid\fR is an integer then it should correspond to the \fBbucket_id\fR
2307 of a bucket present in the group.
2308 In case of the \fBinsert-buckets\fR command the effect is to
2309 insert buckets just before the bucket in the group whose \fBbucket_id\fR is
2310 \fIid\fR.
2311 In case of the \fBiremove-buckets\fR command the effect is to
2312 remove the in the group whose \fBbucket_id\fR is \fIid\fR.
2313 It is an error if there is no bucket persent group in whose \fBbucket_id\fR is
2314 \fIid\fR.
2315
2316 .IP \fBselection_method\fR=\fImethod\fR
2317 The selection method used to select a bucket for a select group.
2318 This is a string of 1 to 15 bytes in length known to lower layers.
2319 This field is optional for \fBadd\-group\fR, \fBadd\-groups\fR and
2320 \fBmod\-group\fR commands on groups of type \fBselect\fR. Prohibited
2321 otherwise. The default value is the empty string.
2322 .IP
2323 This option will use a Netronome OpenFlow extension which is only supported
2324 when using Open vSwitch 2.4 and later with OpenFlow 1.5 and later.
2325
2326 .IP \fBselection_method_param\fR=\fIparam\fR
2327 64-bit integer parameter to the selection method selected by the
2328 \fBselection_method\fR field.  The parameter's use is defined by the
2329 lower-layer that implements the \fBselection_method\fR.  It is optional if
2330 the \fBselection_method\fR field is specified as a non-empty string.
2331 Prohibited otherwise. The default value is zero.
2332 .IP
2333 This option will use a Netronome OpenFlow extension which is only supported
2334 when using Open vSwitch 2.4 and later with OpenFlow 1.5 and later.
2335
2336 .IP \fBfields\fR=\fIparam\fR
2337 The field parameters to selection method selected by the
2338 \fBselection_method\fR field.  The syntax is described in \fBFlow Syntax\fR
2339 with the additional restrictions that if a value is provided it is
2340 treated as a wildcard mask and wildcard masks following a slash are
2341 prohibited. The pre-requisites of fields must be provided by any flows that
2342 output to the group. The use of the fields is defined by the lower-layer
2343 that implements the \fBselection_method\fR.  They are optional if the
2344 \fBselection_method\fR field is specified as a non-empty string.
2345 Prohibited otherwise. The default is no fields.
2346 .IP
2347 This option will use a Netronome OpenFlow extension which is only supported
2348 when using Open vSwitch 2.4 and later with OpenFlow 1.5 and later.
2349
2350 .IP \fBbucket\fR=\fIbucket_parameters\fR
2351 The \fBadd-group\fR, \fBadd-groups\fR and \fBmod-group\fR commands
2352 require at least one bucket field. Bucket fields must appear after
2353 all other fields.
2354 .
2355 Multiple bucket fields to specify multiple buckets.
2356 The order in which buckets are specified corresponds to their order in
2357 the group. If the type of the group is "indirect" then only one group may
2358 be specified.
2359 .
2360 \fIbucket_parameters\fR consists of a list of \fIfield\fB=\fIvalue\fR
2361 assignments, separated by commas or white space followed by a
2362 comma-separated list of actions.
2363 The fields for \fIbucket_parameters\fR are:
2364 .
2365 .RS
2366 .IP \fBbucket_id=\fIid\fR
2367 The 32-bit integer group id of the bucket.  Values greater than
2368 0xffffff00 are reserved.
2369 .
2370 This field was added in Open vSwitch 2.4 to conform with the OpenFlow
2371 1.5 specification. It is not supported when earlier versions
2372 of OpenFlow are used.  Open vSwitch will automatically allocate bucket
2373 ids when they are not specified.
2374 .IP \fBactions=\fR[\fIaction\fR][\fB,\fIaction\fR...]\fR
2375 The syntax of actions are identical to the \fBactions=\fR field described in
2376 \fBFlow Syntax\fR above. Specyfing \fBactions=\fR is optional, any unknown
2377 bucket parameter will be interpreted as an action.
2378 .IP \fBweight=\fIvalue\fR
2379 The relative weight of the bucket as an integer. This may be used by the switch
2380 during bucket select for groups whose \fBtype\fR is \fBselect\fR.
2381 .IP \fBwatch_port=\fIport\fR
2382 Port used to determine liveness of group.
2383 This or the \fBwatch_group\fR field is required
2384 for groups whose \fBtype\fR is \fBff\fR or \fBfast_failover\fR.
2385 .IP \fBwatch_group=\fIgroup_id\fR
2386 Group identifier of group used to determine liveness of group.
2387 This or the \fBwatch_port\fR field is required
2388 for groups whose \fBtype\fR is \fBff\fR or \fBfast_failover\fR.
2389 .RE
2390 .
2391 .SS "Meter Syntax"
2392 .PP
2393 The meter table commands accept an argument that describes a meter.
2394 Such meter descriptions comprise a series \fIfield\fB=\fIvalue\fR
2395 assignments, separated by commas or white space.
2396 (Embedding spaces into a group description normally requires
2397 quoting to prevent the shell from breaking the description into
2398 multiple arguments.). Unless noted otherwise only the last instance
2399 of each field is honoured.
2400 .PP
2401 .IP \fBmeter=\fIid\fR
2402 The integer meter id of the meter.
2403 When this field is specified in \fBdel-meter\fR, \fBdump-meter\fR, or
2404 \fBmeter-stats\fR, the keyword "all" may be used to designate all meters.
2405 .
2406 This field is required, exept for \fBmeter-stats\fR, which dumps all stats
2407 when this field is not specified.
2408
2409 .IP \fBkbps\fR
2410 .IQ \fBpktps\fR
2411 The unit for the meter band rate parameters, either kilobits per second, or
2412 packets per second, respectively.  One of these must be specified.  The burst
2413 size unit corresponds to the rate unit by dropping the "per second", i.e.,
2414 burst is in units of kilobits or packets, respectively.
2415
2416 .IP \fBburst\fR
2417 Specify burst size for all bands, or none of them, if this flag is not given.
2418
2419 .IP \fBstats\fR
2420 Collect meter and band statistics.
2421
2422 .IP \fBbands\fR=\fIband_parameters\fR
2423 The \fBadd-meter\fR and \fBmod-meter\fR commands require at least one
2424 band specification. Bands must appear after all other fields.
2425 .RS
2426 .IP \fBtype=\fItype\fR
2427 The type of the meter band.  This keyword starts a new band specification.
2428 Each band specifies a rate above which the band is to take some action. The
2429 action depends on the band type.  If multiple bands' rate is exceeded, then
2430 the band with the highest rate among the exceeded bands is selected.
2431 The following keywords designate the allowed
2432 meter band types:
2433 .RS
2434 .IP \fBdrop\fR
2435 Drop packets exceeding the band's rate limit.
2436 .RE
2437 .
2438 .IP "The other \fIband_parameters\fR are:"
2439 .IP \fBrate=\fIvalue\fR
2440 The relative rate limit for this band, in kilobits per second or packets per
2441 second, depending on the meter flags defined above.
2442 .IP \fBburst_size=\fIsize\fR
2443 The maximum burst allowed for the band.  If \fBpktps\fR is specified,
2444 then \fIsize\fR is a packet count, otherwise it is in kilobits.  If
2445 unspecified, the switch is free to select some reasonable value
2446 depending on its configuration.
2447 .RE
2448 .
2449 .SH OPTIONS
2450 .TP
2451 \fB\-\-strict\fR
2452 Uses strict matching when running flow modification commands.
2453 .
2454 .IP "\fB\-\-bundle\fR"
2455 Execute flow mods as an OpenFlow 1.4 atomic bundle transaction.
2456 .RS
2457 .IP \(bu
2458 Within a bundle, all flow mods are processed in the order they appear
2459 and as a single atomic transaction, meaning that if one of them fails,
2460 the whole transaction fails and none of the changes are made to the
2461 \fIswitch\fR's flow table, and that each given datapath packet
2462 traversing the OpenFlow tables sees the flow tables either as before
2463 the transaction, or after all the flow mods in the bundle have been
2464 successfully applied.
2465 .IP \(bu
2466 The beginning and the end of the flow table modification commands in a
2467 bundle are delimited with OpenFlow 1.4 bundle control messages, which
2468 makes it possible to stream the included commands without explicit
2469 OpenFlow barriers, which are otherwise used after each flow table
2470 modification command.  This may make large modifications execute
2471 faster as a bundle.
2472 .IP \(bu
2473 Bundles require OpenFlow 1.4 or higher.  An explicit \fB-O
2474 OpenFlow14\fR option is not needed, but you may need to enable
2475 OpenFlow 1.4 support for OVS by setting the OVSDB \fIprotocols\fR
2476 column in the \fIbridge\fR table.
2477 .RE
2478 .
2479 .so lib/ofp-version.man
2480 .
2481 .IP "\fB\-F \fIformat\fR[\fB,\fIformat\fR...]"
2482 .IQ "\fB\-\-flow\-format=\fIformat\fR[\fB,\fIformat\fR...]"
2483 \fBovs\-ofctl\fR supports the following individual flow formats, any
2484 number of which may be listed as \fIformat\fR:
2485 .RS
2486 .IP "\fBOpenFlow10\-table_id\fR"
2487 This is the standard OpenFlow 1.0 flow format.  All OpenFlow switches
2488 and all versions of Open vSwitch support this flow format.
2489 .
2490 .IP "\fBOpenFlow10+table_id\fR"
2491 This is the standard OpenFlow 1.0 flow format plus a Nicira extension
2492 that allows \fBovs\-ofctl\fR to specify the flow table in which a
2493 particular flow should be placed.  Open vSwitch 1.2 and later supports
2494 this flow format.
2495 .
2496 .IP "\fBNXM\-table_id\fR (Nicira Extended Match)"
2497 This Nicira extension to OpenFlow is flexible and extensible.  It
2498 supports all of the Nicira flow extensions, such as \fBtun_id\fR and
2499 registers.  Open vSwitch 1.1 and later supports this flow format.
2500 .
2501 .IP "\fBNXM+table_id\fR (Nicira Extended Match)"
2502 This combines Nicira Extended match with the ability to place a flow
2503 in a specific table.  Open vSwitch 1.2 and later supports this flow
2504 format.
2505 .
2506 .IP "\fBOXM-OpenFlow12\fR"
2507 .IQ "\fBOXM-OpenFlow13\fR"
2508 .IQ "\fBOXM-OpenFlow14\fR"
2509 These are the standard OXM (OpenFlow Extensible Match) flow format in
2510 OpenFlow 1.2, 1.3, and 1.4, respectively.
2511 .RE
2512 .
2513 .IP
2514 \fBovs\-ofctl\fR also supports the following abbreviations for
2515 collections of flow formats:
2516 .RS
2517 .IP "\fBany\fR"
2518 Any supported flow format.
2519 .IP "\fBOpenFlow10\fR"
2520 \fBOpenFlow10\-table_id\fR or \fBOpenFlow10+table_id\fR.
2521 .IP "\fBNXM\fR"
2522 \fBNXM\-table_id\fR or \fBNXM+table_id\fR.
2523 .IP "\fBOXM\fR"
2524 \fBOXM-OpenFlow12\fR, \fBOXM-OpenFlow13\fR, or \fBOXM-OpenFlow14\fR.
2525 .RE
2526 .
2527 .IP
2528 For commands that modify the flow table, \fBovs\-ofctl\fR by default
2529 negotiates the most widely supported flow format that supports the
2530 flows being added.  For commands that query the flow table,
2531 \fBovs\-ofctl\fR by default uses the most advanced format supported by
2532 the switch.
2533 .IP
2534 This option, where \fIformat\fR is a comma-separated list of one or
2535 more of the formats listed above, limits \fBovs\-ofctl\fR's choice of
2536 flow format.  If a command cannot work as requested using one of the
2537 specified flow formats, \fBovs\-ofctl\fR will report a fatal error.
2538 .
2539 .IP "\fB\-P \fIformat\fR"
2540 .IQ "\fB\-\-packet\-in\-format=\fIformat\fR"
2541 \fBovs\-ofctl\fR supports the following packet_in formats, in order of
2542 increasing capability:
2543 .RS
2544 .IP "\fBopenflow10\fR"
2545 This is the standard OpenFlow 1.0 packet in format. It should be supported by
2546 all OpenFlow switches.
2547 .
2548 .IP "\fBnxm\fR (Nicira Extended Match)"
2549 This packet_in format includes flow metadata encoded using the NXM format.
2550 .
2551 .RE
2552 .IP
2553 Usually, \fBovs\-ofctl\fR prefers the \fBnxm\fR packet_in format, but will
2554 allow the switch to choose its default if \fBnxm\fR is unsupported.  When
2555 \fIformat\fR is one of the formats listed in the above table, \fBovs\-ofctl\fR
2556 will insist on the selected format.  If the switch does not support the
2557 requested format, \fBovs\-ofctl\fR will report a fatal error.  This option only
2558 affects the \fBmonitor\fR command.
2559 .
2560 .IP "\fB\-\-timestamp\fR"
2561 Print a timestamp before each received packet.  This option only
2562 affects the \fBmonitor\fR, \fBsnoop\fR, and \fBofp\-parse\-pcap\fR
2563 commands.
2564 .
2565 .IP "\fB\-m\fR"
2566 .IQ "\fB\-\-more\fR"
2567 Increases the verbosity of OpenFlow messages printed and logged by
2568 \fBovs\-ofctl\fR commands.  Specify this option more than once to
2569 increase verbosity further.
2570 .
2571 .IP \fB\-\-sort\fR[\fB=\fIfield\fR]
2572 .IQ \fB\-\-rsort\fR[\fB=\fIfield\fR]
2573 Display output sorted by flow \fIfield\fR in ascending
2574 (\fB\-\-sort\fR) or descending (\fB\-\-rsort\fR) order, where
2575 \fIfield\fR is any of the fields that are allowed for matching or
2576 \fBpriority\fR to sort by priority.  When \fIfield\fR is omitted, the
2577 output is sorted by priority.  Specify these options multiple times to
2578 sort by multiple fields.
2579 .IP
2580 Any given flow will not necessarily specify a value for a given
2581 field.  This requires special treatement:
2582 .RS
2583 .IP \(bu
2584 A flow that does not specify any part of a field that is used for sorting is
2585 sorted after all the flows that do specify the field.  For example,
2586 \fB\-\-sort=tcp_src\fR will sort all the flows that specify a TCP
2587 source port in ascending order, followed by the flows that do not
2588 specify a TCP source port at all.
2589 .IP \(bu
2590 A flow that only specifies some bits in a field is sorted as if the
2591 wildcarded bits were zero.  For example, \fB\-\-sort=nw_src\fR would
2592 sort a flow that specifies \fBnw_src=192.168.0.0/24\fR the same as
2593 \fBnw_src=192.168.0.0\fR.
2594 .RE
2595 .IP
2596 These options currently affect only \fBdump\-flows\fR output.
2597 .
2598 .ds DD \
2599 \fBovs\-ofctl\fR detaches only when executing the \fBmonitor\fR or \
2600 \fBsnoop\fR commands.
2601 .so lib/daemon.man
2602 .so lib/unixctl.man
2603 .SS "Public Key Infrastructure Options"
2604 .so lib/ssl.man
2605 .so lib/vlog.man
2606 .so lib/common.man
2607 .
2608 .SH "RUNTIME MANAGEMENT COMMANDS"
2609 \fBovs\-appctl\fR(8) can send commands to a running \fBovs\-ofctl\fR
2610 process.  The supported commands are listed below.
2611 .
2612 .IP "\fBexit\fR"
2613 Causes \fBovs\-ofctl\fR to gracefully terminate.  This command applies
2614 only when executing the \fBmonitor\fR or \fBsnoop\fR commands.
2615 .
2616 .IP "\fBofctl/set\-output\-file \fIfile\fR"
2617 Causes all subsequent output to go to \fIfile\fR instead of stderr.
2618 This command applies only when executing the \fBmonitor\fR or
2619 \fBsnoop\fR commands.
2620 .
2621 .IP "\fBofctl/send \fIofmsg\fR..."
2622 Sends each \fIofmsg\fR, specified as a sequence of hex digits that
2623 express an OpenFlow message, on the OpenFlow connection.  This command
2624 is useful only when executing the \fBmonitor\fR command.
2625 .
2626 .IP "\fBofctl/barrier\fR"
2627 Sends an OpenFlow barrier request on the OpenFlow connection and waits
2628 for a reply.  This command is useful only for the \fBmonitor\fR
2629 command.
2630 .
2631 .SH EXAMPLES
2632 .
2633 The following examples assume that \fBovs\-vswitchd\fR has a bridge
2634 named \fBbr0\fR configured.
2635 .
2636 .TP
2637 \fBovs\-ofctl dump\-tables br0\fR
2638 Prints out the switch's table stats.  (This is more interesting after
2639 some traffic has passed through.)
2640 .
2641 .TP
2642 \fBovs\-ofctl dump\-flows br0\fR
2643 Prints the flow entries in the switch.
2644 .
2645 .SH "SEE ALSO"
2646 .
2647 .BR ovs\-appctl (8),
2648 .BR ovs\-vswitchd (8)
2649 .BR ovs\-vswitchd.conf.db (8)