]> git.proxmox.com Git - ovs.git/blob - utilities/ovs-ofctl.8.in
ofproto: Add support for specifying a meter in controller actions.
[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 .TP
66 \fBdump\-table\-desc \fIswitch\fR
67 Prints to the console configuration for each of the flow tables used
68 by \fIswitch\fR for OpenFlow 1.4+.
69 .IP "\fBmod\-table \fIswitch\fR \fItable\fR \fIsetting\fR"
70 This command configures flow table settings in \fIswitch\fR for
71 OpenFlow table \fItable\fR, which may be expressed as a number or
72 (unless \fB\-\-no\-names\fR is specified) a name.
73 .IP
74 The available settings depend on
75 the OpenFlow version in use. In OpenFlow 1.1 and 1.2 (which must be
76 enabled with the \fB\-O\fR option) only, \fBmod\-table\fR configures
77 behavior when no flow is found when a packet is looked up in a flow
78 table. The following \fIsetting\fR values are available:
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 .IP
91 In OpenFlow 1.4 and later (which must be enabled with the \fB\-O\fR
92 option) only, \fBmod\-table\fR configures the behavior when a
93 controller attempts to add a flow to a flow table that is full. The
94 following \fIsetting\fR values are available:
95 .RS
96 .IP \fBevict\fR
97 Delete some existing flow from the flow table, according to the
98 algorithm described for the \fBFlow_Table\fR table in
99 \fBovs-vswitchd.conf.db\fR(5).
100 .IP \fBnoevict\fR
101 Refuse to add the new flow. (Eviction might still be enabled through
102 the \fBoverflow_policy\fR column in the \fBFlow_Table\fR table
103 documented in \fBovs-vswitchd.conf.db\fR(5).)
104 .IP \fBvacancy:\fIlow\fB,\fIhigh\fR
105 Enables sending vacancy events to controllers using \fBTABLE_STATUS\fR
106 messages, based on percentage thresholds \fIlow\fR and \fIhigh\fR.
107 .IP \fBnovacancy\fR
108 Disables vacancy events.
109 .RE
110 .
111 .TP
112 \fBdump\-ports \fIswitch\fR [\fInetdev\fR]
113 Prints to the console statistics for network devices associated with
114 \fIswitch\fR. If \fInetdev\fR is specified, only the statistics
115 associated with that device will be printed. \fInetdev\fR can be an
116 OpenFlow assigned port number or device name, e.g. \fBeth0\fR.
117 .
118 .IP "\fBdump\-ports\-desc \fIswitch\fR [\fIport\fR]"
119 Prints to the console detailed information about network devices
120 associated with \fIswitch\fR. To dump only a specific port, specify
121 its number as \fIport\fR. Otherwise, if \fIport\fR is omitted, or if
122 it is specified as \fBANY\fR, then all ports are printed. This is a
123 subset of the information provided by the \fBshow\fR command.
124 .IP
125 If the connection to \fIswitch\fR negotiates OpenFlow 1.0, 1.2, or
126 1.2, this command uses an OpenFlow extension only implemented in Open
127 vSwitch (version 1.7 and later).
128 .IP
129 Only OpenFlow 1.5 and later support dumping a specific port. Earlier
130 versions of OpenFlow always dump all ports.
131 .
132 .IP "\fBmod\-port \fIswitch\fR \fIport\fR \fIaction\fR"
133 Modify characteristics of port \fBport\fR in \fIswitch\fR. \fIport\fR
134 may be an OpenFlow port number or name (unless \fB\-\-no\-names\fR is
135 specified) or the keyword \fBLOCAL\fR (the
136 preferred way to refer to the OpenFlow local port). The \fIaction\fR
137 may be any one of the following:
138 .
139 .RS
140 .IQ \fBup\fR
141 .IQ \fBdown\fR
142 Enable or disable the interface. This is equivalent to \fBip
143 link set up\fR or \fBip link set down\fR on a Unix system.
144 .
145 .IP \fBstp\fR
146 .IQ \fBno\-stp\fR
147 Enable or disable 802.1D spanning tree protocol (STP) on the
148 interface. OpenFlow implementations that don't support STP will
149 refuse to enable it.
150 .
151 .IP \fBreceive\fR
152 .IQ \fBno\-receive\fR
153 .IQ \fBreceive\-stp\fR
154 .IQ \fBno\-receive\-stp\fR
155 Enable or disable OpenFlow processing of packets received on this
156 interface. When packet processing is disabled, packets will be
157 dropped instead of being processed through the OpenFlow table. The
158 \fBreceive\fR or \fBno\-receive\fR setting applies to all packets
159 except 802.1D spanning tree packets, which are separately controlled
160 by \fBreceive\-stp\fR or \fBno\-receive\-stp\fR.
161 .
162 .IP \fBforward\fR
163 .IQ \fBno\-forward\fR
164 Allow or disallow forwarding of traffic to this interface. By
165 default, forwarding is enabled.
166 .
167 .IP \fBflood\fR
168 .IQ \fBno\-flood\fR
169 Controls whether an OpenFlow \fBflood\fR action will send traffic out
170 this interface. By default, flooding is enabled. Disabling flooding
171 is primarily useful to prevent loops when a spanning tree protocol is
172 not in use.
173 .
174 .IP \fBpacket\-in\fR
175 .IQ \fBno\-packet\-in\fR
176 Controls whether packets received on this interface that do not match
177 a flow table entry generate a ``packet in'' message to the OpenFlow
178 controller. By default, ``packet in'' messages are enabled.
179 .RE
180 .IP
181 The \fBshow\fR command displays (among other information) the
182 configuration that \fBmod\-port\fR changes.
183 .
184 .IP "\fBget\-frags \fIswitch\fR"
185 Prints \fIswitch\fR's fragment handling mode. See \fBset\-frags\fR,
186 below, for a description of each fragment handling mode.
187 .IP
188 The \fBshow\fR command also prints the fragment handling mode among
189 its other output.
190 .
191 .IP "\fBset\-frags \fIswitch frag_mode\fR"
192 Configures \fIswitch\fR's treatment of IPv4 and IPv6 fragments. The
193 choices for \fIfrag_mode\fR are:
194 .RS
195 .IP "\fBnormal\fR"
196 Fragments pass through the flow table like non-fragmented packets.
197 The TCP ports, UDP ports, and ICMP type and code fields are always set
198 to 0, even for fragments where that information would otherwise be
199 available (fragments with offset 0). This is the default fragment
200 handling mode for an OpenFlow switch.
201 .IP "\fBdrop\fR"
202 Fragments are dropped without passing through the flow table.
203 .IP "\fBreassemble\fR"
204 The switch reassembles fragments into full IP packets before passing
205 them through the flow table. Open vSwitch does not implement this
206 fragment handling mode.
207 .IP "\fBnx\-match\fR"
208 Fragments pass through the flow table like non-fragmented packets.
209 The TCP ports, UDP ports, and ICMP type and code fields are available
210 for matching for fragments with offset 0, and set to 0 in fragments
211 with nonzero offset. This mode is a Nicira extension.
212 .RE
213 .IP
214 See the description of \fBip_frag\fR, below, for a way to match on
215 whether a packet is a fragment and on its fragment offset.
216 .
217 .TP
218 \fBdump\-flows \fIswitch \fR[\fIflows\fR]
219 Prints to the console all flow entries in \fIswitch\fR's
220 tables that match \fIflows\fR. If \fIflows\fR is omitted, all flows
221 in the switch are retrieved. See \fBFlow Syntax\fR, below, for the
222 syntax of \fIflows\fR. The output format is described in
223 \fBTable Entry Output\fR.
224 .
225 .IP
226 By default, \fBovs\-ofctl\fR prints flow entries in the same order
227 that the switch sends them, which is unlikely to be intuitive or
228 consistent. Use \fB\-\-sort\fR and \fB\-\-rsort\fR to control display
229 order. The \fB\-\-names\fR/\fB\-\-no\-names\fR and
230 \fB\-\-stats\fR/\fB\-\-no\-stats\fR options also affect output
231 formatting. See the descriptions of these options, under
232 \fBOPTIONS\fR below, for more information
233 .
234 .TP
235 \fBdump\-aggregate \fIswitch \fR[\fIflows\fR]
236 Prints to the console aggregate statistics for flows in
237 \fIswitch\fR's tables that match \fIflows\fR. If \fIflows\fR is omitted,
238 the statistics are aggregated across all flows in the switch's flow
239 tables. See \fBFlow Syntax\fR, below, for the syntax of \fIflows\fR.
240 The output format is described in \fBTable Entry Output\fR.
241 .
242 .IP "\fBqueue\-stats \fIswitch \fR[\fIport \fR[\fIqueue\fR]]"
243 Prints to the console statistics for the specified \fIqueue\fR on
244 \fIport\fR within \fIswitch\fR. \fIport\fR can be an OpenFlow port
245 number or name, the keyword \fBLOCAL\fR (the preferred way to refer to
246 the OpenFlow local port), or the keyword \fBALL\fR. Either of
247 \fIport\fR or \fIqueue\fR or both may be omitted (or equivalently the
248 keyword \fBALL\fR). If both are omitted, statistics are printed for
249 all queues on all ports. If only \fIqueue\fR is omitted, then
250 statistics are printed for all queues on \fIport\fR; if only
251 \fIport\fR is omitted, then statistics are printed for \fIqueue\fR on
252 every port where it exists.
253 .
254 .IP "\fBqueue\-get\-config \fIswitch [\fIport \fR[\fIqueue\fR]]"
255 Prints to the console the configuration of \fIqueue\fR on \fIport\fR
256 in \fIswitch\fR. If \fIport\fR is omitted or \fBANY\fR, reports
257 queues for all port. If \fIqueue\fR is omitted or \fBANY\fR, reports
258 all queues. For OpenFlow 1.3 and earlier, the output always includes
259 all queues, ignoring \fIqueue\fR if specified.
260 .IP
261 This command has limited usefulness, because ports often have no
262 configured queues and because the OpenFlow protocol provides only very
263 limited information about the configuration of a queue.
264 .
265 .IP "\fBdump\-ipfix\-bridge \fIswitch\fR"
266 Prints to the console the statistics of bridge IPFIX for \fIswitch\fR.
267 If bridge IPFIX is configured on the \fIswitch\fR, IPFIX statistics
268 can be retrieved. Otherwise, error message will be printed.
269 .IP
270 This command uses an Open vSwitch extension that is only in Open
271 vSwitch 2.6 and later.
272 .
273 .IP "\fBdump\-ipfix\-flow \fIswitch\fR"
274 Prints to the console the statistics of flow-based IPFIX for
275 \fIswitch\fR. If flow-based IPFIX is configured on the \fIswitch\fR,
276 statistics of all the collector set ids on the \fIswitch\fR will be
277 printed. Otherwise, print error message.
278 .IP
279 Refer to \fBovs\-vswitchd.conf.db\fR(5) for more details on configuring
280 flow based IPFIX and collector set ids.
281 .IP
282 This command uses an Open vSwitch extension that is only in Open
283 vSwitch 2.6 and later.
284 .
285 .IP "\fBct\-flush\-zone \fIswitch zone\fR
286 Flushes the connection tracking entries in \fIzone\fR on \fIswitch\fR.
287 .IP
288 This command uses an Open vSwitch extension that is only in Open
289 vSwitch 2.6 and later.
290 .
291 .SS "OpenFlow Switch Flow Table Commands"
292 .
293 These commands manage the flow table in an OpenFlow switch. In each
294 case, \fIflow\fR specifies a flow entry in the format described in
295 \fBFlow Syntax\fR, below, \fIfile\fR is a text file that contains zero
296 or more flows in the same syntax, one per line, and the optional
297 \fB\-\-bundle\fR option operates the command as a single atomic
298 transation, see option \fB\-\-bundle\fR, below.
299 .
300 .IP "[\fB\-\-bundle\fR] \fBadd\-flow \fIswitch flow\fR"
301 .IQ "[\fB\-\-bundle\fR] \fBadd\-flow \fIswitch \fB\- < \fIfile\fR"
302 .IQ "[\fB\-\-bundle\fR] \fBadd\-flows \fIswitch file\fR"
303 Add each flow entry to \fIswitch\fR's tables.
304 .
305 Each flow specification (e.g., each line in \fIfile\fR) may start with
306 \fBadd\fR, \fBmodify\fR, \fBdelete\fR, \fBmodify_strict\fR, or
307 \fBdelete_strict\fR keyword to specify whether a flow is to be added,
308 modified, or deleted, and whether the modify or delete is strict or
309 not. For backwards compatibility a flow specification without one of
310 these keywords is treated as a flow add. All flow mods are executed
311 in the order specified.
312 .
313 .IP "[\fB\-\-bundle\fR] [\fB\-\-strict\fR] \fBmod\-flows \fIswitch flow\fR"
314 .IQ "[\fB\-\-bundle\fR] [\fB\-\-strict\fR] \fBmod\-flows \fIswitch \fB\- < \fIfile\fR"
315 Modify the actions in entries from \fIswitch\fR's tables that match
316 the specified flows. With \fB\-\-strict\fR, wildcards are not treated
317 as active for matching purposes.
318 .
319 .IP "[\fB\-\-bundle\fR] \fBdel\-flows \fIswitch\fR"
320 .IQ "[\fB\-\-bundle\fR] [\fB\-\-strict\fR] \fBdel\-flows \fIswitch \fR[\fIflow\fR]"
321 .IQ "[\fB\-\-bundle\fR] [\fB\-\-strict\fR] \fBdel\-flows \fIswitch \fB\- < \fIfile\fR"
322 Deletes entries from \fIswitch\fR's flow table. With only a
323 \fIswitch\fR argument, deletes all flows. Otherwise, deletes flow
324 entries that match the specified flows. With \fB\-\-strict\fR,
325 wildcards are not treated as active for matching purposes.
326 .
327 .IP "[\fB\-\-bundle\fR] [\fB\-\-readd\fR] \fBreplace\-flows \fIswitch file\fR"
328 Reads flow entries from \fIfile\fR (or \fBstdin\fR if \fIfile\fR is
329 \fB\-\fR) and queries the flow table from \fIswitch\fR. Then it fixes
330 up any differences, adding flows from \fIflow\fR that are missing on
331 \fIswitch\fR, deleting flows from \fIswitch\fR that are not in
332 \fIfile\fR, and updating flows in \fIswitch\fR whose actions, cookie,
333 or timeouts differ in \fIfile\fR.
334 .
335 .IP
336 With \fB\-\-readd\fR, \fBovs\-ofctl\fR adds all the flows from
337 \fIfile\fR, even those that exist with the same actions, cookie, and
338 timeout in \fIswitch\fR. In OpenFlow 1.0 and 1.1, re-adding a flow
339 always resets the flow's packet and byte counters to 0, and in
340 OpenFlow 1.2 and later, it does so only if the \fBreset_counts\fR flag
341 is set.
342 .
343 .IP "\fBdiff\-flows \fIsource1 source2\fR"
344 Reads flow entries from \fIsource1\fR and \fIsource2\fR and prints the
345 differences. A flow that is in \fIsource1\fR but not in \fIsource2\fR
346 is printed preceded by a \fB\-\fR, and a flow that is in \fIsource2\fR
347 but not in \fIsource1\fR is printed preceded by a \fB+\fR. If a flow
348 exists in both \fIsource1\fR and \fIsource2\fR with different actions,
349 cookie, or timeouts, then both versions are printed preceded by
350 \fB\-\fR and \fB+\fR, respectively.
351 .IP
352 \fIsource1\fR and \fIsource2\fR may each name a file or a switch. If
353 a name begins with \fB/\fR or \fB.\fR, then it is considered to be a
354 file name. A name that contains \fB:\fR is considered to be a switch.
355 Otherwise, it is a file if a file by that name exists, a switch if
356 not.
357 .IP
358 For this command, an exit status of 0 means that no differences were
359 found, 1 means that an error occurred, and 2 means that some
360 differences were found.
361 .
362 .IP "\fBpacket\-out \fIswitch\fR \fIpacket-out\fR"
363 Connects to \fIswitch\fR and instructs it to execute the
364 \fIpacket-out\fR OpenFlow message, specified as defined in
365 \fBPacket\-Out Syntax\fR section.
366 .
367 .SS "Group Table Commands"
368 .
369 These commands manage the group table in an OpenFlow switch. In each
370 case, \fIgroup\fR specifies a group entry in the format described in
371 \fBGroup Syntax\fR, below, and \fIfile\fR is a text file that contains
372 zero or more groups in the same syntax, one per line, and the optional
373 \fB\-\-bundle\fR option operates the command as a single atomic
374 transation, see option \fB\-\-bundle\fR, below.
375 .PP
376 The group commands work only with switches that support OpenFlow 1.1
377 or later or the Open vSwitch group extensions to OpenFlow 1.0 (added
378 in Open vSwitch 2.9.90). For OpenFlow 1.1 or later, it is necessary
379 to explicitly enable these protocol versions in \fBovs\-ofctl\fR
380 (using \fB\-O\fR). For more information, see ``Q: What versions of
381 OpenFlow does Open vSwitch support?'' in the Open vSwitch FAQ.
382 .
383 .IP "[\fB\-\-bundle\fR] \fBadd\-group \fIswitch group\fR"
384 .IQ "[\fB\-\-bundle\fR] \fBadd\-group \fIswitch \fB\- < \fIfile\fR"
385 .IQ "[\fB\-\-bundle\fR] \fBadd\-groups \fIswitch file\fR"
386 Add each group entry to \fIswitch\fR's tables.
387 .
388 Each group specification (e.g., each line in \fIfile\fR) may start
389 with \fBadd\fR, \fBmodify\fR, \fBadd_or_mod\fR, \fBdelete\fR,
390 \fBinsert_bucket\fR, or \fBremove_bucket\fR keyword to specify whether
391 a flow is to be added, modified, or deleted, or whether a group bucket
392 is to be added or removed. For backwards compatibility a group
393 specification without one of these keywords is treated as a group add.
394 All group mods are executed in the order specified.
395 .
396 .IP "[\fB\-\-bundle\fR] [\fB\-\-may\-create\fR] \fBmod\-group \fIswitch group\fR"
397 .IQ "[\fB\-\-bundle\fR] [\fB\-\-may\-create\fR] \fBmod\-group \fIswitch \fB\- < \fIfile\fR"
398 Modify the action buckets in entries from \fIswitch\fR's tables for
399 each group entry. If a specified group does not already exist, then
400 without \fB\-\-may\-create\fR, this command has no effect; with
401 \fB\-\-may\-create\fR, it creates a new group. The
402 \fB\-\-may\-create\fR option uses an Open vSwitch extension to
403 OpenFlow only implemented in Open vSwitch 2.6 and later.
404 .
405 .IP "[\fB\-\-bundle\fR] \fBdel\-groups \fIswitch\fR"
406 .IQ "[\fB\-\-bundle\fR] \fBdel\-groups \fIswitch \fR[\fIgroup\fR]"
407 .IQ "[\fB\-\-bundle\fR] \fBdel\-groups \fIswitch \fB\- < \fIfile\fR"
408 Deletes entries from \fIswitch\fR's group table. With only a
409 \fIswitch\fR argument, deletes all groups. Otherwise, deletes the group
410 for each group entry.
411 .
412 .IP "[\fB\-\-bundle\fR] \fBinsert\-buckets \fIswitch group\fR"
413 .IQ "[\fB\-\-bundle\fR] \fBinsert\-buckets \fIswitch \fB\- < \fIfile\fR"
414 Add buckets to an existing group present in the \fIswitch\fR's group table.
415 If no \fIcommand_bucket_id\fR is present in the group specification then all
416 buckets of the group are removed.
417 .
418 .IP "[\fB\-\-bundle\fR] \fBremove\-buckets \fIswitch group\fR"
419 .IQ "[\fB\-\-bundle\fR] \fBremove\-buckets \fIswitch \fB\- < \fIfile\fR"
420 Remove buckets to an existing group present in the \fIswitch\fR's group table.
421 If no \fIcommand_bucket_id\fR is present in the group specification then all
422 buckets of the group are removed.
423 .
424 .IP "\fBdump\-groups \fIswitch\fR [\fIgroup\fR]"
425 Prints group entries in \fIswitch\fR's tables to console. To dump
426 only a specific group, specify its number as \fIgroup\fR. Otherwise,
427 if \fIgroup\fR is omitted, or if it is specified as \fBALL\fR, then
428 all groups are printed.
429 .IP
430 Only OpenFlow 1.5 and later support dumping a specific group. Earlier
431 versions of OpenFlow always dump all groups.
432 .
433 .IP "\fBdump\-group\-features \fIswitch"
434 Prints to the console the group features of the \fIswitch\fR.
435 .
436 .IP "\fBdump\-group\-stats \fIswitch \fR[\fIgroup\fR]"
437 Prints to the console statistics for the specified \fIgroup\fR in
438 \fIswitch\fR's tables. If \fIgroup\fR is omitted then statistics for all
439 groups are printed.
440 .
441 .SS "OpenFlow 1.3+ Switch Meter Table Commands"
442 .
443 These commands manage the meter table in an OpenFlow switch. In each
444 case, \fImeter\fR specifies a meter entry in the format described in
445 \fBMeter Syntax\fR, below.
446 .
447 .PP
448 OpenFlow 1.3 introduced support for meters, so these commands only work
449 with switches that support OpenFlow 1.3 or later. It is necessary to
450 explicitly enable these protocol versions in \fBovs\-ofctl\fR (using
451 \fB\-O\fR) and in the switch itself (with the \fBprotocols\fR column in
452 the \fBBridge\fR table). For more information, see ``Q: What versions
453 of OpenFlow does Open vSwitch support?'' in the Open vSwitch FAQ.
454 .
455 .IP "\fBadd\-meter \fIswitch meter\fR"
456 Add a meter entry to \fIswitch\fR's tables. The \fImeter\fR syntax is
457 described in section \fBMeter Syntax\fR, below.
458 .
459 .IP "\fBmod\-meter \fIswitch meter\fR"
460 Modify an existing meter.
461 .
462 .IP "\fBdel\-meters \fIswitch\fR [\fImeter\fR]"
463 Delete entries from \fIswitch\fR's meter table. To delete only a
464 specific meter, specify its number as \fImeter\fR. Otherwise, if
465 \fImeter\fR is omitted, or if it is specified as \fBall\fR, then all
466 meters are deleted.
467 .
468 .IP "\fBdump\-meters \fIswitch\fR [\fImeter\fR]"
469 Print entries from \fIswitch\fR's meter table. To print only a
470 specific meter, specify its number as \fImeter\fR. Otherwise, if
471 \fImeter\fR is omitted, or if it is specified as \fBall\fR, then all
472 meters are printed.
473 .
474 .IP "\fBmeter\-stats \fIswitch\fR [\fImeter\fR]"
475 Print meter statistics. \fImeter\fR can specify a single meter with
476 syntax \fBmeter=\fIid\fR, or all meters with syntax \fBmeter=all\fR.
477 .
478 .IP "\fBmeter\-features \fIswitch\fR"
479 Print meter features.
480 .
481 .SS OpenFlow Switch Bundle Command
482 .
483 Transactional updates to both flow and group tables can be made with
484 the \fBbundle\fR command. \fIfile\fR is a text file that contains
485 zero or more flow mods, group mods, or packet-outs in \fBFlow
486 Syntax\fR, \fBGroup Syntax\fR, or \fBPacket\-Out Syntax\fR, each line
487 preceded by \fBflow\fR, \fBgroup\fR, or \fBpacket\-out\fR keyword,
488 correspondingly. The \fBflow\fR keyword may be optionally followed by
489 one of the keywords \fBadd\fR, \fBmodify\fR, \fBmodify_strict\fR,
490 \fBdelete\fR, or \fBdelete_strict\fR, of which the \fBadd\fR is
491 assumed if a bare \fBflow\fR is given. Similarly, the \fBgroup\fR
492 keyword may be optionally followed by one of the keywords \fBadd\fR,
493 \fBmodify\fR, \fBadd_or_mod\fR, \fBdelete\fR, \fBinsert_bucket\fR, or
494 \fBremove_bucket\fR, of which the \fBadd\fR is assumed if a bare
495 \fBgroup\fR is given.
496 .
497 .IP "\fBbundle \fIswitch file\fR"
498 Execute all flow and group mods in \fIfile\fR as a single atomic
499 transaction against \fIswitch\fR's tables. All bundled mods are
500 executed in the order specified.
501 .
502 .SS "OpenFlow Switch Tunnel TLV Table Commands"
503 .
504 Open vSwitch maintains a mapping table between tunnel option TLVs (defined
505 by <class, type, length>) and NXM fields \fBtun_metadata\fIn\fR,
506 where \fIn\fR ranges from 0 to 63, that can be operated on for the
507 purposes of matches, actions, etc. This TLV table can be used for
508 Geneve option TLVs or other protocols with options in same TLV format
509 as Geneve options. This mapping must be explicitly specified by the user
510 through the following commands.
511
512 A TLV mapping is specified with the syntax
513 \fB{class=\fIclass\fB,type=\fItype\fB,len=\fIlength\fB}->tun_metadata\fIn\fR.
514 When an option mapping exists for a given \fBtun_metadata\fIn\fR,
515 matching on the defined field becomes possible, e.g.:
516
517 .RS
518 ovs-ofctl add-tlv-map br0 "{class=0xffff,type=0,len=4}->tun_metadata0"
519 .PP
520 ovs-ofctl add-flow br0 tun_metadata0=1234,actions=controller
521 .RE
522
523 A mapping should not be changed while it is in active
524 use by a flow. The result of doing so is undefined.
525
526 These commands are Nicira extensions to OpenFlow and require Open vSwitch
527 2.5 or later.
528
529 .IP "\fBadd\-tlv\-map \fIswitch option\fR[\fB,\fIoption\fR]..."
530 Add each \fIoption\fR to \fIswitch\fR's tables. Duplicate fields are
531 rejected.
532 .
533 .IP "\fBdel\-tlv\-map \fIswitch \fR[\fIoption\fR[\fB,\fIoption\fR]]..."
534 Delete each \fIoption\fR from \fIswitch\fR's table, or all option TLV
535 mapping if no \fIoption\fR is specified.
536 Fields that aren't mapped are ignored.
537 .
538 .IP "\fBdump\-tlv\-map \fIswitch\fR"
539 Show the currently mapped fields in the switch's option table as well
540 as switch capabilities.
541 .
542 .SS "OpenFlow Switch Monitoring Commands"
543 .
544 .IP "\fBsnoop \fIswitch\fR"
545 Connects to \fIswitch\fR and prints to the console all OpenFlow
546 messages received. Unlike other \fBovs\-ofctl\fR commands, if
547 \fIswitch\fR is the name of a bridge, then the \fBsnoop\fR command
548 connects to a Unix domain socket named
549 \fB@RUNDIR@/\fIswitch\fB.snoop\fR. \fBovs\-vswitchd\fR listens on
550 such a socket for each bridge and sends to it all of the OpenFlow
551 messages sent to or received from its configured OpenFlow controller.
552 Thus, this command can be used to view OpenFlow protocol activity
553 between a switch and its controller.
554 .IP
555 When a switch has more than one controller configured, only the
556 traffic to and from a single controller is output. If none of the
557 controllers is configured as a master or a slave (using a Nicira
558 extension to OpenFlow 1.0 or 1.1, or a standard request in OpenFlow
559 1.2 or later), then a controller is chosen arbitrarily among
560 them. If there is a master controller, it is chosen; otherwise, if
561 there are any controllers that are not masters or slaves, one is
562 chosen arbitrarily; otherwise, a slave controller is chosen
563 arbitrarily. This choice is made once at connection time and does not
564 change as controllers reconfigure their roles.
565 .IP
566 If a switch has no controller configured, or if
567 the configured controller is disconnected, no traffic is sent, so
568 monitoring will not show any traffic.
569 .
570 .IP "\fBmonitor \fIswitch\fR [\fImiss-len\fR] [\fBinvalid_ttl\fR] [\fBwatch:\fR[\fIspec\fR...]]"
571 Connects to \fIswitch\fR and prints to the console all OpenFlow
572 messages received. Usually, \fIswitch\fR should specify the name of a
573 bridge in the \fBovs\-vswitchd\fR database.
574 .IP
575 If \fImiss-len\fR is provided, \fBovs\-ofctl\fR sends an OpenFlow ``set
576 configuration'' message at connection setup time that requests
577 \fImiss-len\fR bytes of each packet that misses the flow table. Open vSwitch
578 does not send these and other asynchronous messages to an
579 \fBovs\-ofctl monitor\fR client connection unless a nonzero value is
580 specified on this argument. (Thus, if \fImiss\-len\fR is not
581 specified, very little traffic will ordinarily be printed.)
582 .IP
583 If \fBinvalid_ttl\fR is passed, \fBovs\-ofctl\fR sends an OpenFlow ``set
584 configuration'' message at connection setup time that requests
585 \fBINVALID_TTL_TO_CONTROLLER\fR, so that \fBovs\-ofctl monitor\fR can
586 receive ``packet-in'' messages when TTL reaches zero on \fBdec_ttl\fR action.
587 Only OpenFlow 1.1 and 1.2 support \fBinvalid_ttl\fR; Open vSwitch also
588 implements it for OpenFlow 1.0 as an extension.
589 .IP
590 \fBwatch:\fR[\fB\fIspec\fR...] causes \fBovs\-ofctl\fR to send a
591 ``monitor request'' Nicira extension message to the switch at
592 connection setup time. This message causes the switch to send
593 information about flow table changes as they occur. The following
594 comma-separated \fIspec\fR syntax is available:
595 .RS
596 .IP "\fB!initial\fR"
597 Do not report the switch's initial flow table contents.
598 .IP "\fB!add\fR"
599 Do not report newly added flows.
600 .IP "\fB!delete\fR"
601 Do not report deleted flows.
602 .IP "\fB!modify\fR"
603 Do not report modifications to existing flows.
604 .IP "\fB!own\fR"
605 Abbreviate changes made to the flow table by \fBovs\-ofctl\fR's own
606 connection to the switch. (These could only occur using the
607 \fBofctl/send\fR command described below under \fBRUNTIME MANAGEMENT
608 COMMANDS\fR.)
609 .IP "\fB!actions\fR"
610 Do not report actions as part of flow updates.
611 .IP "\fBtable=\fItable\fR"
612 Limits the monitoring to the table with the given \fItable\fR, which
613 may be expressed as a number between 0 and 254 or (unless
614 \fB\-\-no\-names\fR is specified) a name. By default, all tables are
615 monitored.
616 .IP "\fBout_port=\fIport\fR"
617 If set, only flows that output to \fIport\fR are monitored. The
618 \fIport\fR may be an OpenFlow port number or keyword
619 (e.g. \fBLOCAL\fR).
620 .IP "\fIfield\fB=\fIvalue\fR"
621 Monitors only flows that have \fIfield\fR specified as the given
622 \fIvalue\fR. Any syntax valid for matching on \fBdump\-flows\fR may
623 be used.
624 .RE
625 .IP
626 This command may be useful for debugging switch or controller
627 implementations. With \fBwatch:\fR, it is particularly useful for
628 observing how a controller updates flow tables.
629 .
630 .SS "OpenFlow Switch and Controller Commands"
631 .
632 The following commands, like those in the previous section, may be
633 applied to OpenFlow switches, using any of the connection methods
634 described in that section. Unlike those commands, these may also be
635 applied to OpenFlow controllers.
636 .
637 .TP
638 \fBprobe \fItarget\fR
639 Sends a single OpenFlow echo-request message to \fItarget\fR and waits
640 for the response. With the \fB\-t\fR or \fB\-\-timeout\fR option, this
641 command can test whether an OpenFlow switch or controller is up and
642 running.
643 .
644 .TP
645 \fBping \fItarget \fR[\fIn\fR]
646 Sends a series of 10 echo request packets to \fItarget\fR and times
647 each reply. The echo request packets consist of an OpenFlow header
648 plus \fIn\fR bytes (default: 64) of randomly generated payload. This
649 measures the latency of individual requests.
650 .
651 .TP
652 \fBbenchmark \fItarget n count\fR
653 Sends \fIcount\fR echo request packets that each consist of an
654 OpenFlow header plus \fIn\fR bytes of payload and waits for each
655 response. Reports the total time required. This is a measure of the
656 maximum bandwidth to \fItarget\fR for round-trips of \fIn\fR-byte
657 messages.
658 .
659 .SS "Other Commands"
660 .
661 .IP "\fBofp\-parse\fR \fIfile\fR"
662 Reads \fIfile\fR (or \fBstdin\fR if \fIfile\fR is \fB\-\fR) as a
663 series of OpenFlow messages in the binary format used on an OpenFlow
664 connection, and prints them to the console. This can be useful for
665 printing OpenFlow messages captured from a TCP stream.
666 .
667 .IP "\fBofp\-parse\-pcap\fR \fIfile\fR [\fIport\fR...]"
668 Reads \fIfile\fR, which must be in the PCAP format used by network
669 capture tools such as \fBtcpdump\fR or \fBwireshark\fR, extracts all
670 the TCP streams for OpenFlow connections, and prints the OpenFlow
671 messages in those connections in human-readable format on
672 \fBstdout\fR.
673 .IP
674 OpenFlow connections are distinguished by TCP port number.
675 Non-OpenFlow packets are ignored. By default, data on TCP ports 6633
676 and 6653 are considered to be OpenFlow. Specify one or more
677 \fIport\fR arguments to override the default.
678 .IP
679 This command cannot usefully print SSL encrypted traffic. It does not
680 understand IPv6.
681 .
682 .SS "Flow Syntax"
683 .PP
684 Some \fBovs\-ofctl\fR commands accept an argument that describes a flow or
685 flows. Such flow descriptions comprise a series of
686 \fIfield\fB=\fIvalue\fR assignments, separated by commas or white
687 space. (Embedding spaces into a flow description normally requires
688 quoting to prevent the shell from breaking the description into
689 multiple arguments.)
690 .PP
691 Flow descriptions should be in \fBnormal form\fR. This means that a
692 flow may only specify a value for an L3 field if it also specifies a
693 particular L2 protocol, and that a flow may only specify an L4 field
694 if it also specifies particular L2 and L3 protocol types. For
695 example, if the L2 protocol type \fBdl_type\fR is wildcarded, then L3
696 fields \fBnw_src\fR, \fBnw_dst\fR, and \fBnw_proto\fR must also be
697 wildcarded. Similarly, if \fBdl_type\fR or \fBnw_proto\fR (the L3
698 protocol type) is wildcarded, so must be the L4 fields \fBtcp_dst\fR and
699 \fBtcp_src\fR. \fBovs\-ofctl\fR will warn about
700 flows not in normal form.
701 .PP
702 \fBovs\-fields\fR(7) describes the supported fields and how to match
703 them. In addition to match fields, commands that operate on flows
704 accept a few additional key-value pairs:
705 .
706 .IP \fBtable=\fItable\fR
707 For flow dump commands, limits the flows dumped to those in
708 \fItable\fR, which may be expressed as a number between 0 and 255 or
709 (unless \fB\-\-no\-names\fR is specified) a name. If not specified
710 (or if 255 is specified as \fItable\fR), then flows in all tables are
711 dumped.
712 .
713 .IP
714 For flow table modification commands, behavior varies based on the
715 OpenFlow version used to connect to the switch:
716 .
717 .RS
718 .IP "OpenFlow 1.0"
719 OpenFlow 1.0 does not support \fBtable\fR for modifying flows.
720 \fBovs\-ofctl\fR will exit with an error if \fBtable\fR (other than
721 \fBtable=255\fR) is specified for a switch that only supports OpenFlow
722 1.0.
723 .IP
724 In OpenFlow 1.0, the switch chooses the table into which to insert a
725 new flow. The Open vSwitch software switch always chooses table 0.
726 Other Open vSwitch datapaths and other OpenFlow implementations may
727 choose different tables.
728 .IP
729 The OpenFlow 1.0 behavior in Open vSwitch for modifying or removing
730 flows depends on whether \fB\-\-strict\fR is used. Without
731 \fB\-\-strict\fR, the command applies to matching flows in all tables.
732 With \fB\-\-strict\fR, the command will operate on any single matching
733 flow in any table; it will do nothing if there are matches in more
734 than one table. (The distinction between these behaviors only matters
735 if non-OpenFlow 1.0 commands were also used, because OpenFlow 1.0
736 alone cannot add flows with the same matching criteria to multiple
737 tables.)
738 .
739 .IP "OpenFlow 1.0 with table_id extension"
740 Open vSwitch implements an OpenFlow extension that allows the
741 controller to specify the table on which to operate. \fBovs\-ofctl\fR
742 automatically enables the extension when \fBtable\fR is specified and
743 OpenFlow 1.0 is used. \fBovs\-ofctl\fR automatically detects whether
744 the switch supports the extension. As of this writing, this extension
745 is only known to be implemented by Open vSwitch.
746 .
747 .IP
748 With this extension, \fBovs\-ofctl\fR operates on the requested table
749 when \fBtable\fR is specified, and acts as described for OpenFlow 1.0
750 above when no \fBtable\fR is specified (or for \fBtable=255\fR).
751 .
752 .IP "OpenFlow 1.1"
753 OpenFlow 1.1 requires flow table modification commands to specify a
754 table. When \fBtable\fR is not specified (or \fBtable=255\fR is
755 specified), \fBovs\-ofctl\fR defaults to table 0.
756 .
757 .IP "OpenFlow 1.2 and later"
758 OpenFlow 1.2 and later allow flow deletion commands, but not other
759 flow table modification commands, to operate on all flow tables, with
760 the behavior described above for OpenFlow 1.0.
761 .RE
762 .IP "\fBduration=\fR..."
763 .IQ "\fBn_packet=\fR..."
764 .IQ "\fBn_bytes=\fR..."
765 \fBovs\-ofctl\fR ignores assignments to these ``fields'' to allow
766 output from the \fBdump\-flows\fR command to be used as input for
767 other commands that parse flows.
768 .
769 .PP
770 The \fBadd\-flow\fR, \fBadd\-flows\fR, and \fBmod\-flows\fR commands
771 require an additional field, which must be the final field specified:
772 .
773 .IP \fBactions=\fR[\fIaction\fR][\fB,\fIaction\fR...]\fR
774 Specifies a comma-separated list of actions to take on a packet when the
775 flow entry matches. If no \fIaction\fR is specified, then packets
776 matching the flow are dropped. The following forms of \fIaction\fR
777 are supported:
778 .
779 .RS
780 .IP \fIport\fR
781 .IQ \fBoutput:\fIport\fR
782 Outputs the packet to OpenFlow port number \fIport\fR. If \fIport\fR
783 is the packet's input port, the packet is not output.
784 .
785 .IP \fBoutput:\fIsrc\fB[\fIstart\fB..\fIend\fB]
786 Outputs the packet to the OpenFlow port number read from \fIsrc\fR,
787 which may be an NXM field name, as described above, or a match field name.
788 \fBoutput:reg0[16..31]\fR outputs to the OpenFlow port number
789 written in the upper half of register 0. If the port number is the
790 packet's input port, the packet is not output.
791 .IP
792 This form of \fBoutput\fR was added in Open vSwitch 1.3.0. This form
793 of \fBoutput\fR uses an OpenFlow extension that is not supported by
794 standard OpenFlow switches.
795 .
796 .IP \fBoutput(port=\fIport\fR\fB,max_len=\fInbytes\fR)
797 Outputs the packet to the OpenFlow port number read from \fIport\fR,
798 with maximum packet size set to \fInbytes\fR. \fIport\fR may be OpenFlow
799 port number, \fBlocal\fR, or \fBin_port\fR. Patch port is not supported.
800 Packets larger than \fInbytes\fR will be trimmed to \fInbytes\fR while
801 packets smaller than \fInbytes\fR remains the original size.
802 .
803 .IP \fBgroup:\fIgroup_id\fR
804 Outputs the packet to the OpenFlow group \fIgroup_id\fR. OpenFlow 1.1
805 introduced support for groups; Open vSwitch 2.6 and later also
806 supports output to groups as an extension to OpenFlow 1.0. See
807 \fBGroup Syntax\fR for more details.
808 .
809 .IP \fBnormal\fR
810 Subjects the packet to the device's normal L2/L3 processing. (This
811 action is not implemented by all OpenFlow switches.)
812 .
813 .IP \fBflood\fR
814 Outputs the packet on all switch physical ports other than the port on
815 which it was received and any ports on which flooding is disabled
816 (typically, these would be ports disabled by the IEEE 802.1D spanning
817 tree protocol).
818 .
819 .IP \fBall\fR
820 Outputs the packet on all switch physical ports other than the port on
821 which it was received.
822 .
823 .IP \fBlocal\fR
824 Outputs the packet on the ``local port,'' which corresponds to the
825 network device that has the same name as the bridge.
826 .
827 .IP \fBin_port\fR
828 Outputs the packet on the port from which it was received.
829 .
830 .IP \fBcontroller(\fIkey\fB=\fIvalue\fR...\fB)
831 Sends the packet and its metadata to the OpenFlow controller as a ``packet in''
832 message. The supported key-value pairs are:
833 .RS
834 .IP "\fBmax_len=\fInbytes\fR"
835 Limit to \fInbytes\fR the number of bytes of the packet to send to
836 the controller. By default the entire packet is sent.
837 .IP "\fBreason=\fIreason\fR"
838 Specify \fIreason\fR as the reason for sending the message in the
839 ``packet in'' message. The supported reasons are \fBaction\fR (the
840 default), \fBno_match\fR, and \fBinvalid_ttl\fR.
841 .IP "\fBid=\fIcontroller-id\fR"
842 Specify \fIcontroller-id\fR, a 16-bit integer, as the connection ID of
843 the OpenFlow controller or controllers to which the ``packet in''
844 message should be sent. The default is zero. Zero is also the
845 default connection ID for each controller connection, and a given
846 controller connection will only have a nonzero connection ID if its
847 controller uses the \fBNXT_SET_CONTROLLER_ID\fR Nicira extension to
848 OpenFlow.
849 .IP "\fBuserdata=\fIhh\fR...\fR"
850 Supplies the bytes represented as hex digits \fIhh\fR as additional
851 data to the controller in the packet-in message. Pairs of hex digits
852 may be separated by periods for readability.
853 .IP "\fBpause\fR"
854 Causes the switch to freeze the packet's trip through Open vSwitch
855 flow tables and serializes that state into the packet-in message as a
856 ``continuation,'' an additional property in the \fBNXT_PACKET_IN2\fR
857 message. The controller can later send the continuation back to the
858 switch in an \fBNXT_RESUME\fR message, which will restart the packet's
859 traversal from the point where it was interrupted. This permits an
860 OpenFlow controller to interpose on a packet midway through processing
861 in Open vSwitch.
862 .IP "\fBmeter_id=\fIid\fR"
863 Use meter \fIid\fR to rate-limit the OpenFlow packet-in messages that
864 this action sends to the controller. By default, packets sent to the
865 controller are associated with the "controller" virtual meter, if one
866 was configured.
867 .
868 .RE
869 .IP
870 If any \fIreason\fR other than \fBaction\fR or any nonzero
871 \fIcontroller-id\fR is supplied, Open vSwitch extension
872 \fBNXAST_CONTROLLER\fR, supported by Open vSwitch 1.6 and later, is
873 used. If \fBuserdata\fR is supplied, then \fBNXAST_CONTROLLER2\fR,
874 supported by Open vSwitch 2.6 and later, is used.
875 .
876 .IP \fBcontroller\fR
877 .IQ \fBcontroller\fR[\fB:\fInbytes\fR]
878 Shorthand for \fBcontroller()\fR or
879 \fBcontroller(max_len=\fInbytes\fB)\fR, respectively.
880 .
881 .IP \fBenqueue(\fIport\fB,\fIqueue\fB)\fR
882 Enqueues the packet on the specified \fIqueue\fR within port
883 \fIport\fR, which must be an OpenFlow port number or keyword
884 (e.g. \fBLOCAL\fR). The number of supported queues depends on the
885 switch; some OpenFlow implementations do not support queuing at all.
886 .
887 .IP \fBdrop\fR
888 Discards the packet, so no further processing or forwarding takes place.
889 If a drop action is used, no other actions may be specified.
890 .
891 .IP \fBmod_vlan_vid\fR:\fIvlan_vid\fR
892 Modifies the VLAN id on a packet. The VLAN tag is added or modified
893 as necessary to match the value specified. If the VLAN tag is added,
894 a priority of zero is used (see the \fBmod_vlan_pcp\fR action to set
895 this).
896 .
897 .IP \fBmod_vlan_pcp\fR:\fIvlan_pcp\fR
898 Modifies the VLAN priority on a packet. The VLAN tag is added or modified
899 as necessary to match the value specified. Valid values are between 0
900 (lowest) and 7 (highest). If the VLAN tag is added, a vid of zero is used
901 (see the \fBmod_vlan_vid\fR action to set this).
902 .
903 .IP \fBstrip_vlan\fR
904 Strips the VLAN tag from a packet if it is present.
905 .
906 .IP \fBpush_vlan\fR:\fIethertype\fR
907 Push a new VLAN tag onto the packet. Ethertype is used as the Ethertype
908 for the tag. Only ethertype 0x8100 should be used. (0x88a8 which the spec
909 allows isn't supported at the moment.)
910 A priority of zero and the tag of zero are used for the new tag.
911 .
912 .IP \fBpush_mpls\fR:\fIethertype\fR
913 Changes the packet's Ethertype to \fIethertype\fR, which must be either
914 \fB0x8847\fR or \fB0x8848\fR, and pushes an MPLS LSE.
915 .IP
916 If the packet does not already contain any MPLS labels then an initial
917 label stack entry is pushed. The label stack entry's label is 2 if the
918 packet contains IPv6 and 0 otherwise, its default traffic control value is
919 the low 3 bits of the packet's DSCP value (0 if the packet is not IP), and
920 its TTL is copied from the IP TTL (64 if the packet is not IP).
921 .IP
922 If the packet does already contain an MPLS label, pushes a new
923 outermost label as a copy of the existing outermost label.
924 .IP
925 A limitation of the implementation is that processing of actions will stop
926 if \fBpush_mpls\fR follows another \fBpush_mpls\fR unless there is a
927 \fBpop_mpls\fR in between.
928 .
929 .IP \fBpop_mpls\fR:\fIethertype\fR
930 Strips the outermost MPLS label stack entry.
931 Currently the implementation restricts \fIethertype\fR to a non-MPLS Ethertype
932 and thus \fBpop_mpls\fR should only be applied to packets with
933 an MPLS label stack depth of one. A further limitation is that processing of
934 actions will stop if \fBpop_mpls\fR follows another \fBpop_mpls\fR unless
935 there is a \fBpush_mpls\fR in between.
936 .
937 .IP \fBmod_dl_src\fB:\fImac\fR
938 Sets the source Ethernet address to \fImac\fR.
939 .
940 .IP \fBmod_dl_dst\fB:\fImac\fR
941 Sets the destination Ethernet address to \fImac\fR.
942 .
943 .IP \fBmod_nw_src\fB:\fIip\fR
944 Sets the IPv4 source address to \fIip\fR.
945 .
946 .IP \fBmod_nw_dst\fB:\fIip\fR
947 Sets the IPv4 destination address to \fIip\fR.
948 .
949 .IP \fBmod_tp_src\fB:\fIport\fR
950 Sets the TCP or UDP or SCTP source port to \fIport\fR.
951 .
952 .IP \fBmod_tp_dst\fB:\fIport\fR
953 Sets the TCP or UDP or SCTP destination port to \fIport\fR.
954 .
955 .IP \fBmod_nw_tos\fB:\fItos\fR
956 Sets the DSCP bits in the IPv4 ToS/DSCP or IPv6 traffic class field to
957 \fItos\fR, which must be a multiple of 4 between 0 and 255. This action
958 does not modify the two least significant bits of the ToS field (the ECN bits).
959 .
960 .IP \fBmod_nw_ecn\fB:\fIecn\fR
961 Sets the ECN bits in the IPv4 ToS or IPv6 traffic class field to \fIecn\fR,
962 which must be a value between 0 and 3, inclusive. This action does not modify
963 the six most significant bits of the field (the DSCP bits).
964 .IP
965 Requires OpenFlow 1.1 or later.
966 .
967 .IP \fBmod_nw_ttl\fB:\fIttl\fR
968 Sets the IPv4 TTL or IPv6 hop limit field to \fIttl\fR, which is specified as
969 a decimal number between 0 and 255, inclusive. Switch behavior when setting
970 \fIttl\fR to zero is not well specified, though.
971 .IP
972 Requires OpenFlow 1.1 or later.
973 .RE
974 .IP
975 The following actions are Nicira vendor extensions that, as of this writing, are
976 only known to be implemented by Open vSwitch:
977 .
978 .RS
979 .
980 .IP \fBresubmit\fB:\fIport\fR
981 .IQ \fBresubmit\fB(\fR[\fIport\fR]\fB,\fR[\fItable\fR]\fB)
982 .IQ \fBresubmit\fB(\fR[\fIport\fR]\fB,\fR[\fItable\fR]\fB,ct)
983 Re-searches this OpenFlow flow table (or table \fItable\fR, if
984 specified) with the \fBin_port\fR field replaced by
985 \fIport\fR (if \fIport\fR is specified) and the packet 5-tuple fields
986 swapped with the corresponding conntrack original direction tuple
987 fields (if \fBct\fR is specified, see \fBct_nw_src\fR above), and
988 executes the actions found, if any, in addition to any other actions
989 in this flow entry. The \fBin_port\fR and swapped 5-tuple fields are
990 restored immediately after the search, before any actions are
991 executed.
992 .IP
993 The \fItable\fR may be expressed as a number between 0 and 254 or
994 (unless \fB\-\-no\-names\fR is specified) a name.
995 .IP
996 The \fBct\fR option requires a valid connection tracking state as a
997 match prerequisite in the flow where this action is placed. Examples
998 of valid connection tracking state matches include
999 \fBct_state=+new\fR, \fBct_state=+est\fR, \fBct_state=+rel\fR, and
1000 \fBct_state=+trk-inv\fR.
1001 .IP
1002 Recursive \fBresubmit\fR actions are obeyed up to
1003 implementation-defined limits:
1004 .RS
1005 .IP \(bu
1006 Open vSwitch 1.0.1 and earlier did not support recursion.
1007 .IP \(bu
1008 Open vSwitch 1.0.2 and 1.0.3 limited recursion to 8 levels.
1009 .IP \(bu
1010 Open vSwitch 1.1 and 1.2 limited recursion to 16 levels.
1011 .IP \(bu
1012 Open vSwitch 1.2 through 1.8 limited recursion to 32 levels.
1013 .IP \(bu
1014 Open vSwitch 1.9 through 2.0 limited recursion to 64 levels.
1015 .IP \(bu
1016 Open vSwitch 2.1 through 2.5 limited recursion to 64 levels and impose
1017 a total limit of 4,096 resubmits per flow translation (earlier versions
1018 did not impose any total limit).
1019 .IP \(bu
1020 Open vSwitch 2.6 and later imposes the same limits as 2.5, with one
1021 exception: \fBresubmit\fR from table \fIx\fR to any table \fIy\fR >
1022 \fIx\fR does not count against the recursion limit.
1023 .RE
1024 .IP
1025 Open vSwitch before 1.2.90 did not support \fItable\fR. Open vSwitch
1026 before 2.7 did not support \fBct\fR.
1027 .
1028 .IP \fBset_tunnel\fB:\fIid\fR
1029 .IQ \fBset_tunnel64\fB:\fIid\fR
1030 If outputting to a port that encapsulates the packet in a tunnel and
1031 supports an identifier (such as GRE), sets the identifier to \fIid\fR.
1032 If the \fBset_tunnel\fR form is used and \fIid\fR fits in 32 bits,
1033 then this uses an action extension that is supported by Open vSwitch
1034 1.0 and later. Otherwise, if \fIid\fR is a 64-bit value, it requires
1035 Open vSwitch 1.1 or later.
1036 .
1037 .IP \fBset_queue\fB:\fIqueue\fR
1038 Sets the queue that should be used to \fIqueue\fR when packets are
1039 output. The number of supported queues depends on the switch; some
1040 OpenFlow implementations do not support queuing at all.
1041 .
1042 .IP \fBpop_queue\fR
1043 Restores the queue to the value it was before any \fBset_queue\fR
1044 actions were applied.
1045 .
1046 .IP \fBct\fR
1047 .IQ \fBct(\fR[\fIargument\fR][\fB,\fIargument\fR...]\fB)
1048 Send the packet through the connection tracker. Refer to the \fBct_state\fR
1049 documentation above for possible packet and connection states. A \fBct\fR
1050 action always sets the packet to an untracked state and clears out the
1051 \fBct_state\fR fields for the current processing path. Those fields are
1052 only available for the processing path pointed to by the \fBtable\fR
1053 argument. The following arguments are supported:
1054 .RS
1055 .IP \fBcommit\fR
1056 .RS
1057 Commit the connection to the connection tracking module. Information about the
1058 connection will be stored beyond the lifetime of the packet in the pipeline.
1059 Some \fBct_state\fR flags are only available for committed connections.
1060 .RE
1061 .IP \fBforce\fR
1062 .RS
1063 A committed connection always has the directionality of the packet
1064 that caused the connection to be committed in the first place. This
1065 is the ``original direction'' of the connection, and the opposite
1066 direction is the ``reply direction''. If a connection is already
1067 committed, but it is in the wrong direction, \fBforce\fR flag may be
1068 used in addition to \fBcommit\fR flag to effectively terminate the
1069 existing connection and start a new one in the current direction.
1070 This flag has no effect if the original direction of the connection is
1071 already the same as that of the current packet.
1072 .RE
1073 .IP \fBtable=\fItable\fR
1074 Fork pipeline processing in two. The original instance of the packet will
1075 continue processing the current actions list as an untracked packet. An
1076 additional instance of the packet will be sent to the connection tracker, which
1077 will be re-injected into the OpenFlow pipeline to resume processing in table
1078 \fInumber\fR (which may be specified as a number between 0 and 254 or,
1079 unless \fB\-\-no\-names\fR is specified, a name), with the
1080 \fBct_state\fR and other ct match fields set. If
1081 \fBtable\fR is not specified, then the packet which is submitted to the
1082 connection tracker is not re-injected into the OpenFlow pipeline. It is
1083 strongly recommended to specify a table later than the current table to prevent
1084 loops.
1085 .IP \fBzone=\fIvalue\fR
1086 .IQ \fBzone=\fIsrc\fB[\fIstart\fB..\fIend\fB]\fR
1087 A 16-bit context id that can be used to isolate connections into separate
1088 domains, allowing overlapping network addresses in different zones. If a zone
1089 is not provided, then the default is to use zone zero. The \fBzone\fR may be
1090 specified either as an immediate 16-bit \fIvalue\fR, or may be provided from an
1091 NXM field \fIsrc\fR. The \fIstart\fR and \fIend\fR pair are inclusive, and must
1092 specify a 16-bit range within the field. This value is copied to the
1093 \fBct_zone\fR match field for packets which are re-injected into the pipeline
1094 using the \fBtable\fR option.
1095 .IP \fBexec\fB(\fR[\fIaction\fR][\fB,\fIaction\fR...]\fB)\fR
1096 Perform actions within the context of connection tracking. This is a restricted
1097 set of actions which are in the same format as their specifications as part
1098 of a flow. Only actions which modify the \fBct_mark\fR or \fBct_label\fR
1099 fields are accepted within the \fBexec\fR action, and these fields may only be
1100 modified with this option. For example:
1101 .
1102 .RS
1103 .IP \fBset_field:\fIvalue\fR[\fB/\fImask\fR]->ct_mark\fR
1104 Store a 32-bit metadata value with the connection. Subsequent lookups
1105 for packets in this connection will populate the \fBct_mark\fR flow
1106 field when the packet is sent to the connection tracker with the
1107 \fBtable\fR specified.
1108 .IP \fBset_field:\fIvalue\fR[\fB/\fImask\fR]->ct_label\fR
1109 Store a 128-bit metadata value with the connection. Subsequent
1110 lookups for packets in this connection will populate the
1111 \fBct_label\fR flow field when the packet is sent to the connection
1112 tracker with the \fBtable\fR specified.
1113 .RE
1114 .IP
1115 The \fBcommit\fR parameter must be specified to use \fBexec(...)\fR.
1116 .
1117 .IP \fBalg=\fIalg\fR
1118 Specify application layer gateway \fIalg\fR to track specific connection
1119 types. If subsequent related connections are sent through the \fBct\fR
1120 action, then the \fBrel\fR flag in the \fBct_state\fR field will be set.
1121 Supported types include:
1122 .RS
1123 .IP \fBftp\fR
1124 Look for negotiation of FTP data connections. Specify this option for FTP
1125 control connections to detect related data connections and populate the
1126 \fBrel\fR flag for the data connections.
1127 .
1128 .IP \fBtftp\fR
1129 Look for negotiation of TFTP data connections. Specify this option for TFTP
1130 control connections to detect related data connections and populate the
1131 \fBrel\fR flag for the data connections.
1132 .RE
1133 .
1134 .IP
1135 The \fBcommit\fR parameter must be specified to use \fBalg=\fIalg\fR.
1136 .
1137 .IP
1138 When committing related connections, the \fBct_mark\fR for that connection is
1139 inherited from the current \fBct_mark\fR stored with the original connection
1140 (ie, the connection created by \fBct(alg=...)\fR).
1141 .
1142 .IP
1143 Note that with the Linux datapath, global sysctl options affect the usage of
1144 the \fBct\fR action. In particular, if \fBnet.netfilter.nf_conntrack_helper\fR
1145 is enabled then application layer gateway helpers may be executed even if the
1146 \fBalg\fR option is not specified. This is the default setting until Linux 4.7.
1147 For security reasons, the netfilter team recommends users to disable this
1148 option. See this blog post for further details:
1149 .
1150 http://www.netfilter.org/news.html#2012-04-03
1151 .
1152 .IP \fBnat\fR[\fB(\fR(\fBsrc\fR|\fBdst\fR)\fB=\fIaddr1\fR[\fB-\fIaddr2\fR][\fB:\fIport1\fR[\fB-\fIport2\fR]][\fB,\fIflags\fR]\fB)\fR]
1153 .
1154 Specify address and port translation for the connection being tracked.
1155 For new connections either \fBsrc\fR or \fBdst\fR argument must be
1156 provided to set up either source address/port translation (SNAT) or
1157 destination address/port translation (DNAT), respectively. Setting up
1158 address translation for a new connection takes effect only if the
1159 \fBcommit\fR flag is also provided for the enclosing \fBct\fR action.
1160 A bare \fBnat\fR action will only translate the packet being processed
1161 in the way the connection has been set up with an earlier \fBct\fR
1162 action. Also a \fBnat\fR action with \fBsrc\fR or \fBdst\fR, when
1163 applied to a packet belonging to an established (rather than new)
1164 connection, will behave the same as a bare \fBnat\fR.
1165 .IP
1166 \fBsrc\fR and \fBdst\fR options take the following arguments:
1167 .RS
1168 .IP \fIaddr1\fR[\fB-\fIaddr2\fR]
1169 The address range from which the translated address should be
1170 selected. If only one address is given, then that address will always
1171 be selected, otherwise the address selection can be informed by the
1172 optional \fBpersistent\fR flag as described below. Either IPv4 or
1173 IPv6 addresses can be provided, but both addresses must be of the same
1174 type, and the datapath behavior is undefined in case of providing IPv4
1175 address range for an IPv6 packet, or IPv6 address range for an IPv4
1176 packet. IPv6 addresses must be bracketed with '[' and ']' if a port
1177 range is also given.
1178 .RE
1179 .
1180 .RS
1181 .IP \fIport1\fR[\fB-\fIport2\fR]
1182 The port range from which the translated port should be selected. If
1183 only one port number is provided, then that should be selected. In
1184 case of a mapping conflict the datapath may choose any other
1185 non-conflicting port number instead, even when no port range is
1186 specified. The port number selection can be informed by the optional
1187 \fBrandom\fR and \fBhash\fR flags as described below.
1188 .RE
1189 .IP
1190 The optional flags are:
1191 .RS
1192 .IP \fBrandom\fR
1193 The selection of the port from the given range should be done using a
1194 fresh random number. This flag is mutually exclusive with \fBhash\fR.
1195 .RE
1196 .
1197 .RS
1198 .IP \fBhash\fR
1199 The selection of the port from the given range should be done using a
1200 datapath specific hash of the packet's IP addresses and the other,
1201 non-mapped port number. This flag is mutually exclusive with
1202 \fBrandom\fR.
1203 .RE
1204 .
1205 .RS
1206 .IP \fBpersistent\fR
1207 The selection of the IP address from the given range should be done so
1208 that the same mapping can be provided after the system restarts.
1209 .RE
1210 .IP
1211 If an \fBalg\fR is specified for the committing \fBct\fR action that
1212 also includes \fBnat\fR with a \fBsrc\fR or \fBdst\fR attribute,
1213 then the datapath tries to set up the helper to be NAT aware. This
1214 functionality is datapath specific and may not be supported by all
1215 datapaths.
1216 .IP
1217 \fBnat\fR was introduced in Open vSwitch 2.6. The first datapath that
1218 implements \fBct nat\fR support is the one that ships with Linux 4.6.
1219 .RE
1220 .IP
1221 The \fBct\fR action may be used as a primitive to construct stateful firewalls
1222 by selectively committing some traffic, then matching the \fBct_state\fR to
1223 allow established connections while denying new connections. The following
1224 flows provide an example of how to implement a simple firewall that allows new
1225 connections from port 1 to port 2, and only allows established connections to
1226 send traffic from port 2 to port 1:
1227 \fBtable=0,priority=1,action=drop
1228 table=0,priority=10,arp,action=normal
1229 table=0,priority=100,ip,ct_state=-trk,action=ct(table=1)
1230 table=1,in_port=1,ip,ct_state=+trk+new,action=ct(commit),2
1231 table=1,in_port=1,ip,ct_state=+trk+est,action=2
1232 table=1,in_port=2,ip,ct_state=+trk+new,action=drop
1233 table=1,in_port=2,ip,ct_state=+trk+est,action=1\fR
1234 .IP
1235 If \fBct\fR is executed on IP (or IPv6) fragments, then the message is
1236 implicitly reassembled before sending to the connection tracker and
1237 refragmented upon \fBoutput\fR, to the original maximum received fragment size.
1238 Reassembly occurs within the context of the \fBzone\fR, meaning that IP
1239 fragments in different zones are not assembled together. Pipeline processing
1240 for the initial fragments is halted; When the final fragment is received, the
1241 message is assembled and pipeline processing will continue for that flow.
1242 Because packet ordering is not guaranteed by IP protocols, it is not possible
1243 to determine which IP fragment will cause message reassembly (and therefore
1244 continue pipeline processing). As such, it is strongly recommended that
1245 multiple flows should not execute \fBct\fR to reassemble fragments from the
1246 same IP message.
1247 .IP
1248 The \fBct\fR action was introduced in Open vSwitch 2.5.
1249 .
1250 .IP \fBct_clear\fR
1251 Clears connection tracking state from the flow, zeroing
1252 \fBct_state\fR, \fBct_zone\fR, \fBct_mark\fR, and \fBct_label\fR.
1253 .IP
1254 This action was introduced in Open vSwitch 2.6.90.
1255 .
1256 .IP \fBdec_ttl\fR
1257 .IQ \fBdec_ttl(\fIid1\fR[\fB,\fIid2\fR]...\fB)\fR
1258 Decrement TTL of IPv4 packet or hop limit of IPv6 packet. If the
1259 TTL or hop limit is initially zero or decrementing would make it so, no
1260 decrement occurs, as packets reaching TTL zero must be rejected. Instead,
1261 a ``packet-in'' message with reason code \fBOFPR_INVALID_TTL\fR is
1262 sent to each connected controller that has enabled receiving them,
1263 if any. Processing the current set of actions then stops. However,
1264 if the current set of actions was reached through ``resubmit'' then
1265 remaining actions in outer levels resume processing.
1266 .IP
1267 This action also optionally supports the ability to specify a list of
1268 valid controller ids. Each of the controllers in the list will receive
1269 the ``packet_in'' message only if they have registered to receive the
1270 invalid ttl packets. If controller ids are not specified, the
1271 ``packet_in'' message will be sent only to the controllers having
1272 controller id zero which have registered for the invalid ttl packets.
1273 .
1274 .IP \fBset_mpls_label\fR:\fIlabel\fR
1275 Set the label of the outer MPLS label stack entry of a packet.
1276 \fIlabel\fR should be a 20-bit value that is decimal by default;
1277 use a \fB0x\fR prefix to specify them in hexadecimal.
1278 .
1279 .IP \fBset_mpls_tc\fR:\fItc\fR
1280 Set the traffic-class of the outer MPLS label stack entry of a packet.
1281 \fItc\fR should be a in the range 0 to 7 inclusive.
1282 .
1283 .IP \fBset_mpls_ttl\fR:\fIttl\fR
1284 Set the TTL of the outer MPLS label stack entry of a packet.
1285 \fIttl\fR should be in the range 0 to 255 inclusive.
1286 .
1287 .IP \fBdec_mpls_ttl\fR
1288 Decrement TTL of the outer MPLS label stack entry of a packet. If the TTL
1289 is initially zero or decrementing would make it so, no decrement occurs.
1290 Instead, a ``packet-in'' message with reason code \fBOFPR_INVALID_TTL\fR
1291 is sent to the main controller (id zero), if it has enabled receiving them.
1292 Processing the current set of actions then stops. However, if the current
1293 set of actions was reached through ``resubmit'' then remaining actions in
1294 outer levels resume processing.
1295 .
1296 .IP \fBdec_nsh_ttl\fR
1297 Decrement TTL of the outer NSH header of a packet. If the TTL
1298 is initially zero or decrementing would make it so, no decrement occurs.
1299 Instead, a ``packet-in'' message with reason code \fBOFPR_INVALID_TTL\fR
1300 is sent to the main controller (id zero), if it has enabled receiving them.
1301 Processing the current set of actions then stops. However, if the current
1302 set of actions was reached through ``resubmit'' then remaining actions in
1303 outer levels resume processing.
1304 .
1305 .IP \fBnote:\fR[\fIhh\fR]...
1306 Does nothing at all. Any number of bytes represented as hex digits
1307 \fIhh\fR may be included. Pairs of hex digits may be separated by
1308 periods for readability.
1309 The \fBnote\fR action's format doesn't include an exact length for its
1310 payload, so the provided bytes will be padded on the right by enough
1311 bytes with value 0 to make the total number 6 more than a multiple of
1312 8.
1313 .
1314 .IP "\fBmove:\fIsrc\fB[\fIstart\fB..\fIend\fB]\->\fIdst\fB[\fIstart\fB..\fIend\fB]\fR"
1315 Copies the named bits from field \fIsrc\fR to field \fIdst\fR.
1316 \fIsrc\fR and \fIdst\fR may be NXM field names as defined in
1317 \fBnicira\-ext.h\fR, e.g. \fBNXM_OF_UDP_SRC\fR or \fBNXM_NX_REG0\fR,
1318 or a match field name, e.g. \fBreg0\fR. Each
1319 \fIstart\fR and \fIend\fR pair, which are inclusive, must specify the
1320 same number of bits and must fit within its respective field.
1321 Shorthands for \fB[\fIstart\fB..\fIend\fB]\fR exist: use
1322 \fB[\fIbit\fB]\fR to specify a single bit or \fB[]\fR to specify an
1323 entire field (in the latter case the brackets can also be left off).
1324 .IP
1325 Examples: \fBmove:NXM_NX_REG0[0..5]\->NXM_NX_REG1[26..31]\fR copies the
1326 six bits numbered 0 through 5, inclusive, in register 0 into bits 26
1327 through 31, inclusive;
1328 \fBmove:reg0[0..15]\->vlan_tci\fR copies the least
1329 significant 16 bits of register 0 into the VLAN TCI field.
1330 .IP
1331 In OpenFlow 1.0 through 1.4, \fBmove\fR ordinarily uses an Open
1332 vSwitch extension to OpenFlow. In OpenFlow 1.5, \fBmove\fR uses the
1333 OpenFlow 1.5 standard \fBcopy_field\fR action. The ONF has
1334 also made \fBcopy_field\fR available as an extension to OpenFlow 1.3.
1335 Open vSwitch 2.4 and later understands this extension and uses it if a
1336 controller uses it, but for backward compatibility with older versions
1337 of Open vSwitch, \fBovs\-ofctl\fR does not use it.
1338 .
1339 .IP "\fBset_field:\fIvalue\fR[/\fImask\fR]\fB\->\fIdst"
1340 .IQ "\fBload:\fIvalue\fB\->\fIdst\fB[\fIstart\fB..\fIend\fB]"
1341 Loads a literal value into a field or part of a field. With
1342 \fBset_field\fR, \fBvalue\fR and the optional \fBmask\fR are given in
1343 the customary syntax for field \fIdst\fR, which is expressed as a
1344 field name. For example, \fBset_field:00:11:22:33:44:55->eth_src\fR
1345 sets the Ethernet source address to 00:11:22:33:44:55. With
1346 \fBload\fR, \fIvalue\fR must be an integer value (in decimal or
1347 prefixed by \fB0x\fR for hexadecimal) and \fIdst\fR can also be the
1348 NXM or OXM name for the field. For example,
1349 \fBload:0x001122334455->OXM_OF_ETH_SRC[]\fR has the same effect as the
1350 prior \fBset_field\fR example.
1351 .IP
1352 The two forms exist for historical reasons. Open vSwitch 1.1
1353 introduced \fBNXAST_REG_LOAD\fR as a Nicira extension to OpenFlow 1.0
1354 and used \fBload\fR to express it. Later, OpenFlow 1.2 introduced a
1355 standard \fBOFPAT_SET_FIELD\fR action that was restricted to loading
1356 entire fields, so Open vSwitch added the form \fBset_field\fR with
1357 this restriction. OpenFlow 1.5 extended \fBOFPAT_SET_FIELD\fR to the
1358 point that it became a superset of \fBNXAST_REG_LOAD\fR. Open vSwitch
1359 translates either syntax as necessary for the OpenFlow version in use:
1360 in OpenFlow 1.0 and 1.1, \fBNXAST_REG_LOAD\fR; in OpenFlow 1.2, 1.3,
1361 and 1.4, \fBNXAST_REG_LOAD\fR for \fBload\fR or for loading a
1362 subfield, \fBOFPAT_SET_FIELD\fR otherwise; and OpenFlow 1.5 and later,
1363 \fBOFPAT_SET_FIELD\fR.
1364 .
1365 .IP "\fBpush:\fIsrc\fB[\fIstart\fB..\fIend\fB]"
1366 .IQ "\fBpop:\fIdst\fB[\fIstart\fB..\fIend\fB]"
1367 These Open vSwitch extension actions act on bits \fIstart\fR to
1368 \fIend\fR, inclusive, in the named field, pushing or popping the bits
1369 on a general-purpose stack of fields or subfields. Controllers can
1370 use this stack for saving and restoring data or metadata around
1371 \fBresubmit\fR actions, for swapping or rearranging data and metadata,
1372 or for other purposes. Any data or metadata field, or part of one,
1373 may be pushed, and any modifiable field or subfield may be popped.
1374 .IP
1375 The number of bits pushed in a stack entry do not have to match the
1376 number of bits later popped from that entry. If more bits are popped
1377 from an entry than were pushed, then the entry is conceptually
1378 left-padded with 0-bits as needed. If fewer bits are popped than
1379 pushed, then bits are conceptually trimmed from the left side of the
1380 entry.
1381 .IP
1382 The stack's size is intended to have a large enough limit that
1383 ``normal'' use will not pose problems. Stack overflow or underflow is
1384 an error that causes action execution to stop.
1385 .IP
1386 Example: \fBpush:NXM_NX_REG2[0..5]\fR or \fBpush:reg2[0..5]\fR push
1387 the value stored in register 2 bits 0 through 5, inclusive, on the
1388 internal stack, and \fBpop:NXM_NX_REG2[0..5]\fR or
1389 \fBpop:reg2[0..5]\fR pops the value from top of the stack and sets
1390 register 2 bits 0 through 5, inclusive, based on bits 0 through 5 from
1391 the value just popped.
1392 .
1393 .IP "\fBmultipath(\fIfields\fB, \fIbasis\fB, \fIalgorithm\fB, \fIn_links\fB, \fIarg\fB, \fIdst\fB[\fIstart\fB..\fIend\fB])\fR"
1394 Hashes \fIfields\fR using \fIbasis\fR as a universal hash parameter,
1395 then the applies multipath link selection \fIalgorithm\fR (with
1396 parameter \fIarg\fR) to choose one of \fIn_links\fR output links
1397 numbered 0 through \fIn_links\fR minus 1, and stores the link into
1398 \fIdst\fB[\fIstart\fB..\fIend\fB]\fR, which must be an NXM field as
1399 described above.
1400 .IP
1401 \fIfields\fR must be one of the following:
1402 .RS
1403 .IP \fBeth_src\fR
1404 Hashes Ethernet source address only.
1405 .IP \fBsymmetric_l4\fR
1406 Hashes Ethernet source, destination, and type, VLAN ID, IPv4/IPv6
1407 source, destination, and protocol, and TCP or SCTP (but not UDP)
1408 ports. The hash is computed so that pairs of corresponding flows in
1409 each direction hash to the same value, in environments where L2 paths
1410 are the same in each direction. UDP ports are not included in the
1411 hash to support protocols such as VXLAN that use asymmetric ports in
1412 each direction.
1413 .IP \fBsymmetric_l3l4\fR
1414 Hashes IPv4/IPv6 source, destination, and protocol, and TCP or SCTP
1415 (but not UDP) ports. Like \fBsymmetric_l4\fR, this is a symmetric
1416 hash, but by excluding L2 headers it is more effective in environments
1417 with asymmetric L2 paths (e.g. paths involving VRRP IP addresses on a
1418 router). Not an effective hash function for protocols other than IPv4
1419 and IPv6, which hash to a constant zero.
1420 .IP \fBsymmetric_l3l4+udp\fR
1421 Like \fBsymmetric_l3l4+udp\fR, but UDP ports are included in the hash.
1422 This is a more effective hash when asymmetric UDP protocols such as
1423 VXLAN are not a consideration.
1424 .IP \fBnw_src\fR
1425 Hashes Network source address only.
1426 .IP \fBnw_dst\fR
1427 Hashes Network destination address only.
1428 .RE
1429 .IP
1430 \fIalgorithm\fR must be one of \fBmodulo_n\fR,
1431 \fBhash_threshold\fR, \fBhrw\fR, and \fBiter_hash\fR. Only
1432 the \fBiter_hash\fR algorithm uses \fIarg\fR.
1433 .IP
1434 Refer to \fBnicira\-ext.h\fR for more details.
1435 .
1436 .IP "\fBbundle(\fIfields\fB, \fIbasis\fB, \fIalgorithm\fB, \fIslave_type\fB, slaves:[\fIs1\fB, \fIs2\fB, ...])\fR"
1437 Hashes \fIfields\fR using \fIbasis\fR as a universal hash parameter, then
1438 applies the bundle link selection \fIalgorithm\fR to choose one of the listed
1439 slaves represented as \fIslave_type\fR. Currently the only supported
1440 \fIslave_type\fR is \fBofport\fR. Thus, each \fIs1\fR through \fIsN\fR should
1441 be an OpenFlow port number. Outputs to the selected slave.
1442 .IP
1443 Currently, \fIfields\fR must be either \fBeth_src\fR, \fBsymmetric_l4\fR, \fBsymmetric_l3l4\fR, \fBsymmetric_l3l4+udp\fR,
1444 \fBnw_src\fR, or \fBnw_dst\fR, and \fIalgorithm\fR must be one of \fBhrw\fR and \fBactive_backup\fR.
1445 .IP
1446 Example: \fBbundle(eth_src,0,hrw,ofport,slaves:4,8)\fR uses an Ethernet source
1447 hash with basis 0, to select between OpenFlow ports 4 and 8 using the Highest
1448 Random Weight algorithm.
1449 .IP
1450 Refer to \fBnicira\-ext.h\fR for more details.
1451 .
1452 .IP "\fBbundle_load(\fIfields\fB, \fIbasis\fB, \fIalgorithm\fB, \fIslave_type\fB, \fIdst\fB[\fIstart\fB..\fIend\fB], slaves:[\fIs1\fB, \fIs2\fB, ...])\fR"
1453 Has the same behavior as the \fBbundle\fR action, with one exception. Instead
1454 of outputting to the selected slave, it writes its selection to
1455 \fIdst\fB[\fIstart\fB..\fIend\fB]\fR, which must be an NXM field as described
1456 above.
1457 .IP
1458 Example: \fBbundle_load(eth_src, 0, hrw, ofport, NXM_NX_REG0[],
1459 slaves:4, 8)\fR uses an Ethernet source hash with basis 0, to select
1460 between OpenFlow ports 4 and 8 using the Highest Random Weight
1461 algorithm, and writes the selection to \fBNXM_NX_REG0[]\fR. Also the
1462 match field name can be used, for example, instead of 'NXM_NX_REG0'
1463 the name 'reg0' can be used. When the while field is indicated the
1464 empty brackets can also be left off.
1465 .IP
1466 Refer to \fBnicira\-ext.h\fR for more details.
1467 .
1468 .IP "\fBlearn(\fIargument\fR[\fB,\fIargument\fR]...\fB)\fR"
1469 This action adds or modifies a flow in an OpenFlow table, similar to
1470 \fBovs\-ofctl \-\-strict mod\-flows\fR. The arguments specify the
1471 flow's match fields, actions, and other properties, as follows. At
1472 least one match criterion and one action argument should ordinarily be
1473 specified.
1474 .RS
1475 .IP \fBidle_timeout=\fIseconds\fR
1476 .IQ \fBhard_timeout=\fIseconds\fR
1477 .IQ \fBpriority=\fIvalue\fR
1478 .IQ \fBcookie=\fIvalue\fR
1479 .IQ \fBsend_flow_rem\fR
1480 These arguments have the same meaning as in the usual \fBovs\-ofctl\fR
1481 flow syntax.
1482 .
1483 .IP \fBfin_idle_timeout=\fIseconds\fR
1484 .IQ \fBfin_hard_timeout=\fIseconds\fR
1485 Adds a \fBfin_timeout\fR action with the specified arguments to the
1486 new flow. This feature was added in Open vSwitch 1.5.90.
1487 .
1488 .IP \fBtable=\fItable\fR
1489 The table in which the new flow should be inserted. Specify a decimal
1490 number between 0 and 254 or (unless \fB\-\-no\-names\fR is specified)
1491 a name. The default, if \fBtable\fR is unspecified, is table 1.
1492 .
1493 .IP \fBdelete_learned\fR
1494 This flag enables deletion of the learned flows when the flow with the
1495 \fBlearn\fR action is removed. Specifically, when the last
1496 \fBlearn\fR action with this flag and particular \fBtable\fR and
1497 \fBcookie\fR values is removed, the switch deletes all of the flows in
1498 the specified table with the specified cookie.
1499 .
1500 .IP
1501 This flag was added in Open vSwitch 2.4.
1502 .
1503 .IP \fBlimit=\fInumber\fR
1504 If the number of flows in table \fBtable\fR with cookie id \fBcookie\fR exceeds
1505 \fInumber\fR, a new flow will not be learned by this action. By default
1506 there's no limit. limit=0 is a long-hand for no limit.
1507 .
1508 .IP
1509 This flag was added in Open vSwitch 2.8.
1510 .
1511 .IP \fBresult_dst=\fIfield\fB[\fIbit\fB]\fR
1512 If learning failed (because the number of flows exceeds \fBlimit\fR),
1513 the action sets \fIfield\fB[\fIbit\fB]\fR to 0, otherwise it will be set to 1.
1514 \fIfield\fB[\fIbit\fB]\fR must be a single bit.
1515 .
1516 .IP
1517 This flag was added in Open vSwitch 2.8.
1518 .
1519 .IP \fIfield\fB=\fIvalue\fR
1520 .IQ \fIfield\fB[\fIstart\fB..\fIend\fB]=\fIsrc\fB[\fIstart\fB..\fIend\fB]\fR
1521 .IQ \fIfield\fB[\fIstart\fB..\fIend\fB]\fR
1522 Adds a match criterion to the new flow.
1523 .IP
1524 The first form specifies that \fIfield\fR must match the literal
1525 \fIvalue\fR, e.g. \fBdl_type=0x0800\fR. All of the fields and values
1526 for \fBovs\-ofctl\fR flow syntax are available with their usual
1527 meanings. Shorthand notation matchers (e.g. \fBip\fR in place of
1528 \fBdl_type=0x0800\fR) are not currently implemented.
1529 .IP
1530 The second form specifies that \fIfield\fB[\fIstart\fB..\fIend\fB]\fR
1531 in the new flow must match \fIsrc\fB[\fIstart\fB..\fIend\fB]\fR taken
1532 from the flow currently being processed.
1533 For example, \fINXM_OF_UDP_DST\fB[]\fR=\fINXM_OF_UDP_SRC\fB[]\fR on a
1534 TCP packet for which the UDP src port is \fB53\fR, creates a flow which
1535 matches \fINXM_OF_UDP_DST\fB[]\fR=\fB53\fR.
1536 .IP
1537 The third form is a shorthand for the second form. It specifies that
1538 \fIfield\fB[\fIstart\fB..\fIend\fB]\fR in the new flow must match the same
1539 \fIfield\fB[\fIstart\fB..\fIend\fB]\fR taken from the flow currently
1540 being processed.
1541 For example, \fINXM_OF_TCP_DST\fB[]\fR on a TCP packet
1542 for which the TCP dst port is \fB80\fR, creates a flow which
1543 matches \fINXM_OF_TCP_DST\fB[]\fR=\fB80\fR.
1544 .
1545 .IP \fBload:\fIvalue\fB\->\fIdst\fB[\fIstart\fB..\fIend\fB]
1546 .IQ \fBload:\fIsrc\fB[\fIstart\fB..\fIend\fB]\->\fIdst\fB[\fIstart\fB..\fIend\fB]
1547 .
1548 Adds a \fBload\fR action to the new flow.
1549 .IP
1550 The first form loads the literal \fIvalue\fR into bits \fIstart\fR
1551 through \fIend\fR, inclusive, in field \fIdst\fR. Its syntax is the
1552 same as the \fBload\fR action described earlier in this section.
1553 .IP
1554 The second form loads \fIsrc\fB[\fIstart\fB..\fIend\fB]\fR, a value
1555 from the flow currently being processed, into bits \fIstart\fR
1556 through \fIend\fR, inclusive, in field \fIdst\fR.
1557 .
1558 .IP \fBoutput:\fIfield\fB[\fIstart\fB..\fIend\fB]\fR
1559 Add an \fBoutput\fR action to the new flow's actions, that outputs to
1560 the OpenFlow port taken from \fIfield\fB[\fIstart\fB..\fIend\fB]\fR,
1561 which must be an NXM field as described above.
1562 .RE
1563 .RE
1564 .
1565 .RS
1566 .
1567 .IP \fBclear_actions\fR
1568 Clears all the actions in the action set immediately.
1569 .
1570 .IP \fBwrite_actions(\fR[\fIaction\fR][\fB,\fIaction\fR...]\fB)
1571 Add the specific actions to the action set. The syntax of
1572 \fIactions\fR is the same as in the \fBactions=\fR field. The action
1573 set is carried between flow tables and then executed at the end of the
1574 pipeline.
1575 .
1576 .IP
1577 The actions in the action set are applied in the following order, as
1578 required by the OpenFlow specification, regardless of the order in
1579 which they were added to the action set. Except as specified
1580 otherwise below, the action set only holds at most a single action of
1581 each type. When more than one action of a single type is written to
1582 the action set, the one written later replaces the earlier action:
1583 .
1584 .RS
1585 .IP 1.
1586 \fBstrip_vlan\fR
1587 .IQ
1588 \fBpop_mpls\fR
1589 .
1590 .IP 2.
1591 \fBdecap\fR
1592 .
1593 .IP 3.
1594 \fBencap\fR
1595 .
1596 .IP 4.
1597 \fBpush_mpls\fR
1598 .
1599 .IP 5.
1600 \fBpush_vlan\fR
1601 .
1602 .IP 6.
1603 \fBdec_ttl\fR
1604 .IQ
1605 \fBdec_mpls_ttl\fR
1606 .IQ
1607 \fBdec_nsh_ttl\fR
1608 .
1609 .IP 7.
1610 \fBload\fR
1611 .IQ
1612 \fBmove\fR
1613 .IQ
1614 \fBmod_dl_dst\fR
1615 .IQ
1616 \fBmod_dl_src\fR
1617 .IQ
1618 \fBmod_nw_dst\fR
1619 .IQ
1620 \fBmod_nw_src\fR
1621 .IQ
1622 \fBmod_nw_tos\fR
1623 .IQ
1624 \fBmod_nw_ecn\fR
1625 .IQ
1626 \fBmod_nw_ttl\fR
1627 .IQ
1628 \fBmod_tp_dst\fR
1629 .IQ
1630 \fBmod_tp_src\fR
1631 .IQ
1632 \fBmod_vlan_pcp\fR
1633 .IQ
1634 \fBmod_vlan_vid\fR
1635 .IQ
1636 \fBset_field\fR
1637 .IQ
1638 \fBset_tunnel\fR
1639 .IQ
1640 \fBset_tunnel64\fR
1641 .IQ
1642 The action set can contain any number of these actions, with
1643 cumulative effect. They will be applied in the order as added.
1644 That is, when multiple actions modify the same part of a field,
1645 the later modification takes effect, and when they modify
1646 different parts of a field (or different fields), then both
1647 modifications are applied.
1648 .
1649 .IP 8.
1650 \fBset_queue\fR
1651 .
1652 .IP 9.
1653 \fBgroup\fR
1654 .IQ
1655 \fBoutput\fR
1656 .IQ
1657 \fBresubmit\fR
1658 .IQ
1659 If more than one of these actions is present, then the one listed
1660 earliest above is executed and the others are ignored, regardless of
1661 the order in which they were added to the action set. (If none of these
1662 actions is present, the action set has no real effect, because the
1663 modified packet is not sent anywhere and thus the modifications are
1664 not visible.)
1665 .RE
1666 .IP
1667 Only the actions listed above may be written to the action set.
1668 \fBencap\fR, \fBdecap\fR and \fBdec_nsh_ttl\fR actions are nonstandard.
1669 .
1670 .IP \fBwrite_metadata\fB:\fIvalue\fR[/\fImask\fR]
1671 Updates the metadata field for the flow. If \fImask\fR is omitted, the
1672 metadata field is set exactly to \fIvalue\fR; if \fImask\fR is specified, then
1673 a 1-bit in \fImask\fR indicates that the corresponding bit in the metadata
1674 field will be replaced with the corresponding bit from \fIvalue\fR. Both
1675 \fIvalue\fR and \fImask\fR are 64-bit values that are decimal by default; use
1676 a \fB0x\fR prefix to specify them in hexadecimal.
1677 .
1678 .IP \fBmeter\fR:\fImeter_id\fR
1679 Apply the \fImeter_id\fR before any other actions. If a meter band rate is
1680 exceeded, the packet may be dropped, or modified, depending on the meter
1681 band type. See the description of the \fBMeter Table Commands\fR, above,
1682 for more details.
1683 .
1684 .IP \fBgoto_table\fR:\fItable\fR
1685 Jumps to \fItable\Fr as the next table in the process pipeline. The
1686 \fItable\fR may be a number between 0 and 254 or (unless
1687 \fB\-\-no\-names\fR is specified) a name.
1688 .
1689 .IP "\fBfin_timeout(\fIargument\fR[\fB,\fIargument\fR]\fB)"
1690 This action changes the idle timeout or hard timeout, or both, of this
1691 OpenFlow rule when the rule matches a TCP packet with the FIN or RST
1692 flag. When such a packet is observed, the action reduces the rule's
1693 timeouts to those specified on the action. If the rule's existing
1694 timeout is already shorter than the one that the action specifies,
1695 then that timeout is unaffected.
1696 .IP
1697 \fIargument\fR takes the following forms:
1698 .RS
1699 .IP "\fBidle_timeout=\fIseconds\fR"
1700 Causes the flow to expire after the given number of seconds of
1701 inactivity.
1702 .
1703 .IP "\fBhard_timeout=\fIseconds\fR"
1704 Causes the flow to expire after the given number of seconds,
1705 regardless of activity. (\fIseconds\fR specifies time since the
1706 flow's creation, not since the receipt of the FIN or RST.)
1707 .RE
1708 .IP
1709 This action was added in Open vSwitch 1.5.90.
1710 .
1711 .IP "\fBsample(\fIargument\fR[\fB,\fIargument\fR]...\fB)\fR"
1712 Samples packets and sends one sample for every sampled packet.
1713 .IP
1714 \fIargument\fR takes the following forms:
1715 .RS
1716 .IP "\fBprobability=\fIpackets\fR"
1717 The number of sampled packets out of 65535. Must be greater or equal to 1.
1718 .IP "\fBcollector_set_id=\fIid\fR"
1719 The unsigned 32-bit integer identifier of the set of sample collectors
1720 to send sampled packets to. Defaults to 0.
1721 .IP "\fBobs_domain_id=\fIid\fR"
1722 When sending samples to IPFIX collectors, the unsigned 32-bit integer
1723 Observation Domain ID sent in every IPFIX flow record. Defaults to 0.
1724 .IP "\fBobs_point_id=\fIid\fR"
1725 When sending samples to IPFIX collectors, the unsigned 32-bit integer
1726 Observation Point ID sent in every IPFIX flow record. Defaults to 0.
1727 .IP "\fBsampling_port=\fIport\fR"
1728 Sample packets on \fIport\fR, which should be the ingress or egress
1729 port. This option, which was added in Open vSwitch 2.5.90, allows the
1730 IPFIX implementation to export egress tunnel information.
1731 .IP "\fBingress\fR"
1732 .IQ "\fBegress\fR"
1733 Specifies explicitly that the packet is being sampled on ingress to or
1734 egress from the switch. IPFIX reports sent by Open vSwitch before
1735 version 2.5.90 did not include a direction. From 2.5.90 until 2.6.90,
1736 IPFIX reports inferred a direction from \fBsampling_port\fR: if it was
1737 the packet's output port, then the direction was reported as egress,
1738 otherwise as ingress. Open vSwitch 2.6.90 introduced these options,
1739 which allow the inferred direction to be overridden. This is
1740 particularly useful when the ingress (or egress) port is not a tunnel.
1741 .RE
1742 .IP
1743 Refer to \fBovs\-vswitchd.conf.db\fR(5) for more details on
1744 configuring sample collector sets.
1745 .IP
1746 This action was added in Open vSwitch 1.10.90.
1747 .
1748 .IP "\fBexit\fR"
1749 This action causes Open vSwitch to immediately halt execution of
1750 further actions. Those actions which have already been executed are
1751 unaffected. Any further actions, including those which may be in
1752 other tables, or different levels of the \fBresubmit\fR call stack,
1753 are ignored. Actions in the action set is still executed (specify
1754 \fBclear_actions\fR before \fBexit\fR to discard them).
1755 .
1756 .IP "\fBconjunction(\fIid\fB, \fIk\fB/\fIn\fR\fB)\fR"
1757 This action allows for sophisticated ``conjunctive match'' flows.
1758 Refer to \fBCONJUNCTIVE MATCH FIELDS\fR in \fBovs\-fields\fR(7) for details.
1759 .IP
1760 The \fBconjunction\fR action and \fBconj_id\fR field were introduced
1761 in Open vSwitch 2.4.
1762 .
1763 .IP "\fBclone(\fR[\fIaction\fR][\fB,\fIaction\fR...]\fB)\fR"
1764 Executes each nested \fIaction\fR, saving much of the packet and
1765 pipeline state beforehand and then restoring it afterward. The state
1766 that is saved and restored includes all flow data and metadata
1767 (including, for example, \fBct_state\fR), the stack accessed by
1768 \fBpush\fR and \fBpop\fR actions, and the OpenFlow action set.
1769 .IP
1770 This action was added in Open vSwitch 2.6.90.
1771 .
1772 .IP "\fBencap(\fR\fIheader\fR[\fB(\fR\fIprop\fR\fB=\fR\fIvalue\fR,\fItlv\fR\fB(\fR\fIclass\fR,\fItype\fR,\fIvalue\fB)\fR,...\fB)\fR]\fB)\fR"
1773 Encapsulates the packet with a new packet header, e.g., ethernet
1774 or nsh.
1775 .
1776 .RS
1777 .IP "\fIheader\fR"
1778 Used to specify encapsulation header type.
1779 .
1780 .IP "\fIprop\fR\fB=\fR\fIvalue\fR"
1781 Used to specify the initial value for the property in the encapsulation header.
1782 .
1783 .IP "\fItlv\fR\fB(\fR\fIclass\fR,\fItype\fR,\fIvalue\fB)\fR"
1784 Used to specify the initial value for the TLV (Type Length Value)
1785 in the encapsulation header.
1786 .RE
1787 .IP
1788 For example, \fBencap(ethernet)\fR will encapsulate the L3 packet with
1789 Ethernet header.
1790 .IP
1791 \fBencap(nsh(md_type=1))\fR will encapsulate the packet with nsh header
1792 and nsh metadata type 1.
1793 .IP
1794 \fBencap(nsh(md_type=2,tlv(0x1000,10,0x12345678)))\fR will encapsulate
1795 the packet with nsh header and nsh metadata type 2, and the nsh TLV with
1796 class 0x1000 and type 10 is set to 0x12345678.
1797 .IP
1798 \fIprop\fR\fB=\fR\fIvalue\fR is just used to set some
1799 necessary fields for encapsulation header initialization. Other fields
1800 in the encapsulation header must be set by \fBset_field\fR action. New
1801 encapsulation header implementation must add new match fields and
1802 corresponding \fBset\fR action in order that \fBset_field\fR action can
1803 change the fields in the encapsulation header on demand.
1804 .IP
1805 \fBencap(nsh(md_type=1)),\fR
1806 \fBset_field:0x1234->nsh_spi,set_field:0x11223344->nsh_c1\fR
1807 is an example to encapsulate nsh header and set nsh spi and c1.
1808 .IP
1809 This action was added in Open vSwitch 2.8.
1810 .
1811 .IP "\fBdecap(\fR[\fBpacket_type(ns=\fR\fInamespace\fR\fB,type=\fR\fItype\fR\fB)\fR]\fB)\fR"
1812 Decapsulates the outer packet header.
1813 .
1814 .RS
1815 .IP "\fBpacket_type(ns=\fR\fInamespace\fR\fB,type=\fR\fItype\fR\fB)\fR"
1816 It is optional and used to specify the outer header type of the
1817 decapsulated packet. \fInamespace\fR is 0 for Ethernet packet,
1818 1 for L3 packet, \fItype\fR\ is L3 protocol type, e.g.,
1819 0x894f for nsh, 0x0 for Ethernet.
1820 .RE
1821 .IP
1822 By default, \fBdecap()\fR will decapsulate the outer packet header
1823 according to the packet header type, if
1824 \fBpacket_type(ns=\fR\fInamespace\fR\fB,type=\fR\fItype\fR\fB)\fR
1825 is given, it will decapsulate the given packet header, it will fail
1826 if the actual outer packet header type is not of
1827 \fBpacket_type(ns=\fR\fInamespace\fR\fB,type=\fR\fItype\fR\fB)\fR.
1828 .IP
1829 This action was added in Open vSwitch 2.8.
1830 .RE
1831 .
1832 .PP
1833 An opaque identifier called a cookie can be used as a handle to identify
1834 a set of flows:
1835 .
1836 .IP \fBcookie=\fIvalue\fR
1837 .
1838 A cookie can be associated with a flow using the \fBadd\-flow\fR,
1839 \fBadd\-flows\fR, and \fBmod\-flows\fR commands. \fIvalue\fR can be any
1840 64-bit number and need not be unique among flows. If this field is
1841 omitted, a default cookie value of 0 is used.
1842 .
1843 .IP \fBcookie=\fIvalue\fR\fB/\fImask\fR
1844 .
1845 When using NXM, the cookie can be used as a handle for querying,
1846 modifying, and deleting flows. \fIvalue\fR and \fImask\fR may be
1847 supplied for the \fBdel\-flows\fR, \fBmod\-flows\fR, \fBdump\-flows\fR, and
1848 \fBdump\-aggregate\fR commands to limit matching cookies. A 1-bit in
1849 \fImask\fR indicates that the corresponding bit in \fIcookie\fR must
1850 match exactly, and a 0-bit wildcards that bit. A mask of \-1 may be used
1851 to exactly match a cookie.
1852 .IP
1853 The \fBmod\-flows\fR command can update the cookies of flows that
1854 match a cookie by specifying the \fIcookie\fR field twice (once with a
1855 mask for matching and once without to indicate the new value):
1856 .RS
1857 .IP "\fBovs\-ofctl mod\-flows br0 cookie=1,actions=normal\fR"
1858 Change all flows' cookies to 1 and change their actions to \fBnormal\fR.
1859 .IP "\fBovs\-ofctl mod\-flows br0 cookie=1/\-1,cookie=2,actions=normal\fR"
1860 Update cookies with a value of 1 to 2 and change their actions to
1861 \fBnormal\fR.
1862 .RE
1863 .IP
1864 The ability to match on cookies was added in Open vSwitch 1.5.0.
1865 .
1866 .PP
1867 The following additional field sets the priority for flows added by
1868 the \fBadd\-flow\fR and \fBadd\-flows\fR commands. For
1869 \fBmod\-flows\fR and \fBdel\-flows\fR when \fB\-\-strict\fR is
1870 specified, priority must match along with the rest of the flow
1871 specification. For \fBmod-flows\fR without \fB\-\-strict\fR,
1872 priority is only significant if the command creates a new flow, that
1873 is, non-strict \fBmod\-flows\fR does not match on priority and will
1874 not change the priority of existing flows. Other commands do not
1875 allow priority to be specified.
1876 .
1877 .IP \fBpriority=\fIvalue\fR
1878 The priority at which a wildcarded entry will match in comparison to
1879 others. \fIvalue\fR is a number between 0 and 65535, inclusive. A higher
1880 \fIvalue\fR will match before a lower one. An exact-match entry will always
1881 have priority over an entry containing wildcards, so it has an implicit
1882 priority value of 65535. When adding a flow, if the field is not specified,
1883 the flow's priority will default to 32768.
1884 .IP
1885 OpenFlow leaves behavior undefined when two or more flows with the
1886 same priority can match a single packet. Some users expect
1887 ``sensible'' behavior, such as more specific flows taking precedence
1888 over less specific flows, but OpenFlow does not specify this and Open
1889 vSwitch does not implement it. Users should therefore take care to
1890 use priorities to ensure the behavior that they expect.
1891 .
1892 .PP
1893 The \fBadd\-flow\fR, \fBadd\-flows\fR, and \fBmod\-flows\fR commands
1894 support the following additional options. These options affect only
1895 new flows. Thus, for \fBadd\-flow\fR and \fBadd\-flows\fR, these
1896 options are always significant, but for \fBmod\-flows\fR they are
1897 significant only if the command creates a new flow, that is, their
1898 values do not update or affect existing flows.
1899 .
1900 .IP "\fBidle_timeout=\fIseconds\fR"
1901 Causes the flow to expire after the given number of seconds of
1902 inactivity. A value of 0 (the default) prevents a flow from expiring
1903 due to inactivity.
1904 .
1905 .IP \fBhard_timeout=\fIseconds\fR
1906 Causes the flow to expire after the given number of seconds,
1907 regardless of activity. A value of 0 (the default) gives the flow no
1908 hard expiration deadline.
1909 .
1910 .IP "\fBimportance=\fIvalue\fR"
1911 Sets the importance of a flow. The flow entry eviction mechanism can
1912 use importance as a factor in deciding which flow to evict. A value
1913 of 0 (the default) makes the flow non-evictable on the basis of
1914 importance. Specify a value between 0 and 65535.
1915 .IP
1916 Only OpenFlow 1.4 and later support \fBimportance\fR.
1917 .
1918 .IP "\fBsend_flow_rem\fR"
1919 Marks the flow with a flag that causes the switch to generate a ``flow
1920 removed'' message and send it to interested controllers when the flow
1921 later expires or is removed.
1922 .
1923 .IP "\fBcheck_overlap\fR"
1924 Forces the switch to check that the flow match does not overlap that
1925 of any different flow with the same priority in the same table. (This
1926 check is expensive so it is best to avoid it.)
1927 .
1928 .IP "\fBreset_counts\fR"
1929 When this flag is specified on a flow being added to a switch, and the
1930 switch already has a flow with an identical match, an OpenFlow 1.2 (or
1931 later) switch resets the flow's packet and byte counters to 0.
1932 Without the flag, the packet and byte counters are preserved.
1933 .IP
1934 OpenFlow 1.0 and 1.1 switches always reset counters in this situation,
1935 as if \fBreset_counts\fR were always specified.
1936 .IP
1937 Open vSwitch 1.10 added support for \fBreset_counts\fR.
1938 .
1939 .IP "\fBno_packet_counts\fR"
1940 .IQ "\fBno_byte_counts\fR"
1941 Adding these flags to a flow advises an OpenFlow 1.3 (or later) switch
1942 that the controller does not need packet or byte counters,
1943 respectively, for the flow. Some switch implementations might achieve
1944 higher performance or reduce resource consumption when these flags are
1945 used. These flags provide no benefit to the Open vSwitch software
1946 switch implementation.
1947 .IP
1948 OpenFlow 1.2 and earlier do not support these flags.
1949 .IP
1950 Open vSwitch 1.10 added support for \fBno_packet_counts\fR and
1951 \fBno_byte_counts\fR.
1952 .
1953 .PP
1954 The \fBdump\-flows\fR, \fBdump\-aggregate\fR, \fBdel\-flow\fR
1955 and \fBdel\-flows\fR commands support these additional optional fields:
1956 .
1957 .TP
1958 \fBout_port=\fIport\fR
1959 If set, a matching flow must include an output action to \fIport\fR,
1960 which must be an OpenFlow port number or name (e.g. \fBlocal\fR).
1961 .
1962 .TP
1963 \fBout_group=\fIport\fR
1964 If set, a matching flow must include an \fBgroup\fR action naming
1965 \fIgroup\fR, which must be an OpenFlow group number. This field
1966 is supported in Open vSwitch 2.5 and later and requires OpenFlow 1.1
1967 or later.
1968 .
1969 .SS "Table Entry Output"
1970 .
1971 The \fBdump\-tables\fR and \fBdump\-aggregate\fR commands print information
1972 about the entries in a datapath's tables. Each line of output is a
1973 flow entry as described in \fBFlow Syntax\fR, above, plus some
1974 additional fields:
1975 .
1976 .IP \fBduration=\fIsecs\fR
1977 The time, in seconds, that the entry has been in the table.
1978 \fIsecs\fR includes as much precision as the switch provides, possibly
1979 to nanosecond resolution.
1980 .
1981 .IP \fBn_packets\fR
1982 The number of packets that have matched the entry.
1983 .
1984 .IP \fBn_bytes\fR
1985 The total number of bytes from packets that have matched the entry.
1986 .
1987 .PP
1988 The following additional fields are included only if the switch is
1989 Open vSwitch 1.6 or later and the NXM flow format is used to dump the
1990 flow (see the description of the \fB\-\-flow-format\fR option below).
1991 The values of these additional fields are approximations only and in
1992 particular \fBidle_age\fR will sometimes become nonzero even for busy
1993 flows.
1994 .
1995 .IP \fBhard_age=\fIsecs\fR
1996 The integer number of seconds since the flow was added or modified.
1997 \fBhard_age\fR is displayed only if it differs from the integer part
1998 of \fBduration\fR. (This is separate from \fBduration\fR because
1999 \fBmod\-flows\fR restarts the \fBhard_timeout\fR timer without zeroing
2000 \fBduration\fR.)
2001 .
2002 .IP \fBidle_age=\fIsecs\fR
2003 The integer number of seconds that have passed without any packets
2004 passing through the flow.
2005 .
2006 .SS "Packet\-Out Syntax"
2007 .PP
2008 \fBovs\-ofctl bundle\fR command accepts packet-outs to be specified in
2009 the bundle file. Each packet-out comprises of a series of
2010 \fIfield\fB=\fIvalue\fR assignments, separated by commas or white
2011 space. (Embedding spaces into a packet-out description normally
2012 requires quoting to prevent the shell from breaking the description
2013 into multiple arguments.). Unless noted otherwise only the last
2014 instance of each field is honoured. This same syntax is also
2015 supported by the \fBovs\-ofctl packet-out\fR command.
2016 .PP
2017 .IP \fBin_port=\fIport\fR
2018 The port number to be considered the in_port when processing actions.
2019 This can be any valid OpenFlow port number, or any of the \fBLOCAL\fR,
2020 \fBCONTROLLER\fR, or \fBNONE\fR.
2021 .
2022 This field is required.
2023
2024 .IP \fIpipeline_field\fR=\fIvalue\fR
2025 Optionally, user can specify a list of pipeline fields for a packet-out
2026 message. The supported pipeline fields includes \fBtunnel fields\fR and
2027 \fBregister fields\fR as defined in \fBovs\-fields\fR(7).
2028
2029 .IP \fBpacket=\fIhex-string\fR
2030 The actual packet to send, expressed as a string of hexadecimal bytes.
2031 .
2032 This field is required.
2033
2034 .IP \fBactions=\fR[\fIaction\fR][\fB,\fIaction\fR...]\fR
2035 The syntax of actions are identical to the \fBactions=\fR field
2036 described in \fBFlow Syntax\fR above. Specifying \fBactions=\fR is
2037 optional, but omitting actions is interpreted as a drop, so the packet
2038 will not be sent anywhere from the switch.
2039 .
2040 \fBactions\fR must be specified at the end of each line, like for flow mods.
2041 .RE
2042 .
2043 .SS "Group Syntax"
2044 .PP
2045 Some \fBovs\-ofctl\fR commands accept an argument that describes a group or
2046 groups. Such flow descriptions comprise a series
2047 \fIfield\fB=\fIvalue\fR assignments, separated by commas or white
2048 space. (Embedding spaces into a group description normally requires
2049 quoting to prevent the shell from breaking the description into
2050 multiple arguments.). Unless noted otherwise only the last instance
2051 of each field is honoured.
2052 .PP
2053 .IP \fBgroup_id=\fIid\fR
2054 The integer group id of group.
2055 When this field is specified in \fBdel\-groups\fR or \fBdump\-groups\fR,
2056 the keyword "all" may be used to designate all groups.
2057 .
2058 This field is required.
2059
2060
2061 .IP \fBtype=\fItype\fR
2062 The type of the group. The \fBadd-group\fR, \fBadd-groups\fR and
2063 \fBmod-groups\fR commands require this field. It is prohibited for
2064 other commands. The following keywords designated the allowed types:
2065 .RS
2066 .IP \fBall\fR
2067 Execute all buckets in the group.
2068 .IP \fBselect\fR
2069 Execute one bucket in the group, balancing across the buckets
2070 according to their weights. To select a bucket, for each live bucket,
2071 Open vSwitch hashes flow data with the bucket ID and multiplies by the
2072 bucket weight to obtain a ``score,'' and then selects the bucket with
2073 the highest score. Use \fBselection_method\fR to control the flow
2074 data used for selection.
2075 .IP \fBindirect\fR
2076 Executes the one bucket in the group.
2077 .IP \fBff\fR
2078 .IQ \fBfast_failover\fR
2079 Executes the first live bucket in the group which is associated with
2080 a live port or group.
2081 .RE
2082
2083 .IP \fBcommand_bucket_id=\fIid\fR
2084 The bucket to operate on. The \fBinsert-buckets\fR and \fBremove-buckets\fR
2085 commands require this field. It is prohibited for other commands.
2086 \fIid\fR may be an integer or one of the following keywords:
2087 .RS
2088 .IP \fBall\fR
2089 Operate on all buckets in the group.
2090 Only valid when used with the \fBremove-buckets\fR command in which
2091 case the effect is to remove all buckets from the group.
2092 .IP \fBfirst\fR
2093 Operate on the first bucket present in the group.
2094 In the case of the \fBinsert-buckets\fR command the effect is to
2095 insert new bucets just before the first bucket already present in the group;
2096 or to replace the buckets of the group if there are no buckets already present
2097 in the group.
2098 In the case of the \fBremove-buckets\fR command the effect is to
2099 remove the first bucket of the group; or do nothing if there are no
2100 buckets present in the group.
2101 .IP \fBlast\fR
2102 Operate on the last bucket present in the group.
2103 In the case of the \fBinsert-buckets\fR command the effect is to
2104 insert new bucets just after the last bucket already present in the group;
2105 or to replace the buckets of the group if there are no buckets already present
2106 in the group.
2107 In the case of the \fBremove-buckets\fR command the effect is to
2108 remove the last bucket of the group; or do nothing if there are no
2109 buckets present in the group.
2110 .RE
2111 .IP
2112 If \fIid\fR is an integer then it should correspond to the \fBbucket_id\fR
2113 of a bucket present in the group.
2114 In case of the \fBinsert-buckets\fR command the effect is to
2115 insert buckets just before the bucket in the group whose \fBbucket_id\fR is
2116 \fIid\fR.
2117 In case of the \fBiremove-buckets\fR command the effect is to
2118 remove the in the group whose \fBbucket_id\fR is \fIid\fR.
2119 It is an error if there is no bucket persent group in whose \fBbucket_id\fR is
2120 \fIid\fR.
2121
2122 .IP \fBselection_method\fR=\fImethod\fR
2123 The selection method used to select a bucket for a select group.
2124 This is a string of 1 to 15 bytes in length known to lower layers.
2125 This field is optional for \fBadd\-group\fR, \fBadd\-groups\fR and
2126 \fBmod\-group\fR commands on groups of type \fBselect\fR. Prohibited
2127 otherwise. If no selection method is specified, Open vSwitch up to
2128 release 2.9 applies the \fBhash\fR method with default fields. From
2129 2.10 onwards Open vSwitch defaults to the \fBdp_hash\fR method with symmetric
2130 L3/L4 hash algorithm, unless the weighted group buckets cannot be mapped to
2131 a maximum of 64 dp_hash values with sufficient accuracy.
2132 In those rare cases Open vSwitch 2.10 and later fall back to the \fBhash\fR
2133 method with the default set of hash fields.
2134 .RS
2135 .IP \fBdp_hash\fR
2136 Use a datapath computed hash value. The hash algorithm varies accross
2137 different datapath implementations. \fBdp_hash\fR uses the upper 32
2138 bits of the \fBselection_method_param\fR as the datapath hash
2139 algorithm selector. The supported values are \fB0\fR (corresponding to
2140 hash computation over the IP 5-tuple) and \fB1\fR (corresponding to a
2141 \fIsymmetric\fR hash computation over the IP 5-tuple). Selecting specific
2142 fields with the \fBfields\fR option is not supported with \fBdp_hash\fR).
2143 The lower 32 bits are used as the hash basis.
2144 .IP
2145 Using \fBdp_hash\fR has the advantage that it does not require the
2146 generated datapath flows to exact match any additional packet header
2147 fields. For example, even if multiple TCP connections thus hashed to
2148 different select group buckets have different source port numbers,
2149 generally all of them would be handled with a small set of already
2150 established datapath flows, resulting in less latency for TCP SYN
2151 packets. The downside is that the shared datapath flows must match
2152 each packet twice, as the datapath hash value calculation happens only
2153 when needed, and a second match is required to match some bits of its
2154 value. This double-matching incurs a small additional latency cost
2155 for each packet, but this latency is orders of magnitude less than the
2156 latency of creating new datapath flows for new TCP connections.
2157 .IP \fBhash\fR
2158 Use a hash computed over the fields specified with the \fBfields\fR
2159 option, see below. If no hash fields are specified, \fBhash\fR defaults
2160 to a symmetric hash over the combination of MAC addresses, VLAN tags,
2161 Ether type, IP addresses and L4 port numbers. \fBhash\fR uses the
2162 \fBselection_method_param\fR as the hash basis.
2163 .IP
2164 Note that the hashed fields become exact matched by the datapath
2165 flows. For example, if the TCP source port is hashed, the created
2166 datapath flows will match the specific TCP source port value present
2167 in the packet received. Since each TCP connection generally has a
2168 different source port value, a separate datapath flow will be need to
2169 be inserted for each TCP connection thus hashed to a select group
2170 bucket.
2171 .RE
2172 .IP
2173 This option uses a Netronome OpenFlow extension which is only supported
2174 when using Open vSwitch 2.4 and later with OpenFlow 1.5 and later.
2175
2176 .IP \fBselection_method_param\fR=\fIparam\fR
2177 64-bit integer parameter to the selection method selected by the
2178 \fBselection_method\fR field. The parameter's use is defined by the
2179 lower-layer that implements the \fBselection_method\fR. It is optional if
2180 the \fBselection_method\fR field is specified as a non-empty string.
2181 Prohibited otherwise. The default value is zero.
2182 .IP
2183 This option uses a Netronome OpenFlow extension which is only supported
2184 when using Open vSwitch 2.4 and later with OpenFlow 1.5 and later.
2185
2186 .IP \fBfields\fR=\fIfield\fR
2187 .IQ \fBfields(\fIfield\fR[\fB=\fImask\fR]\fR...\fB)\fR
2188 The field parameters to selection method selected by the
2189 \fBselection_method\fR field. The syntax is described in \fBFlow
2190 Syntax\fR with the additional restrictions that if a value is provided
2191 it is treated as a wildcard mask and wildcard masks following a slash
2192 are prohibited. The pre-requisites of fields must be provided by any
2193 flows that output to the group. The use of the fields is defined by
2194 the lower-layer that implements the \fBselection_method\fR. They are
2195 optional if the \fBselection_method\fR field is specified as ``hash',
2196 prohibited otherwise. The default is no fields.
2197 .IP
2198 This option will use a Netronome OpenFlow extension which is only supported
2199 when using Open vSwitch 2.4 and later with OpenFlow 1.5 and later.
2200
2201 .IP \fBbucket\fR=\fIbucket_parameters\fR
2202 The \fBadd-group\fR, \fBadd-groups\fR and \fBmod-group\fR commands
2203 require at least one bucket field. Bucket fields must appear after
2204 all other fields.
2205 .
2206 Multiple bucket fields to specify multiple buckets.
2207 The order in which buckets are specified corresponds to their order in
2208 the group. If the type of the group is "indirect" then only one group may
2209 be specified.
2210 .
2211 \fIbucket_parameters\fR consists of a list of \fIfield\fB=\fIvalue\fR
2212 assignments, separated by commas or white space followed by a
2213 comma-separated list of actions.
2214 The fields for \fIbucket_parameters\fR are:
2215 .
2216 .RS
2217 .IP \fBbucket_id=\fIid\fR
2218 The 32-bit integer group id of the bucket. Values greater than
2219 0xffffff00 are reserved.
2220 .
2221 This field was added in Open vSwitch 2.4 to conform with the OpenFlow
2222 1.5 specification. It is not supported when earlier versions
2223 of OpenFlow are used. Open vSwitch will automatically allocate bucket
2224 ids when they are not specified.
2225 .IP \fBactions=\fR[\fIaction\fR][\fB,\fIaction\fR...]\fR
2226 The syntax of actions are identical to the \fBactions=\fR field described in
2227 \fBFlow Syntax\fR above. Specifying \fBactions=\fR is optional, any unknown
2228 bucket parameter will be interpreted as an action.
2229 .IP \fBweight=\fIvalue\fR
2230 The relative weight of the bucket as an integer. This may be used by the switch
2231 during bucket select for groups whose \fBtype\fR is \fBselect\fR.
2232 .IP \fBwatch_port=\fIport\fR
2233 Port used to determine liveness of group.
2234 This or the \fBwatch_group\fR field is required
2235 for groups whose \fBtype\fR is \fBff\fR or \fBfast_failover\fR.
2236 .IP \fBwatch_group=\fIgroup_id\fR
2237 Group identifier of group used to determine liveness of group.
2238 This or the \fBwatch_port\fR field is required
2239 for groups whose \fBtype\fR is \fBff\fR or \fBfast_failover\fR.
2240 .RE
2241 .
2242 .SS "Meter Syntax"
2243 .PP
2244 The meter table commands accept an argument that describes a meter.
2245 Such meter descriptions comprise a series \fIfield\fB=\fIvalue\fR
2246 assignments, separated by commas or white space.
2247 (Embedding spaces into a group description normally requires
2248 quoting to prevent the shell from breaking the description into
2249 multiple arguments.). Unless noted otherwise only the last instance
2250 of each field is honoured.
2251 .PP
2252 .IP \fBmeter=\fIid\fR
2253 The identifier for the meter. An integer is used to specify a
2254 user-defined meter. In addition, the keywords "all", "controller", and
2255 "slowpath", are also supported as virtual meters. The "controller" and
2256 "slowpath" virtual meters apply to packets sent to the controller and to
2257 the OVS userspace, respectively.
2258 .IP
2259 When this field is specified in \fBdel-meter\fR, \fBdump-meter\fR, or
2260 \fBmeter-stats\fR, the keyword "all" may be used to designate all
2261 meters. This field is required, except for \fBmeter-stats\fR, which
2262 dumps all stats when this field is not specified.
2263 .IP \fBkbps\fR
2264 .IQ \fBpktps\fR
2265 The unit for the \fBrate\fR and \fBburst_size\fR band parameters.
2266 \fBkbps\fR specifies kilobits per second, and \fBpktps\fR specifies
2267 packets per second. A unit is required for the \fBadd-meter\fR and
2268 \fBmod-meter\fR commands.
2269
2270 .IP \fBburst\fR
2271 If set, enables burst support for meter bands through the \fBburst_size\fR
2272 parameter.
2273
2274 .IP \fBstats\fR
2275 If set, enables the collection of meter and band statistics.
2276
2277 .IP \fBbands\fR=\fIband_parameters\fR
2278 The \fBadd-meter\fR and \fBmod-meter\fR commands require at least one
2279 band specification. Bands must appear after all other fields.
2280 .RS
2281 .IP \fBtype=\fItype\fR
2282 The type of the meter band. This keyword starts a new band specification.
2283 Each band specifies a rate above which the band is to take some action. The
2284 action depends on the band type. If multiple bands' rate is exceeded, then
2285 the band with the highest rate among the exceeded bands is selected.
2286 The following keywords designate the allowed
2287 meter band types:
2288 .RS
2289 .IP \fBdrop\fR
2290 Drop packets exceeding the band's rate limit.
2291 .RE
2292 .
2293 .IP "The other \fIband_parameters\fR are:"
2294 .IP \fBrate=\fIvalue\fR
2295 The relative rate limit for this band, in kilobits per second or packets per
2296 second, depending on whether \fBkbps\fR or \fBpktps\fR was specified.
2297 .IP \fBburst_size=\fIsize\fR
2298 If \fBburst\fR is specified for the meter entry, configures the maximum
2299 burst allowed for the band in kilobits or packets, depending on whether
2300 \fBkbps\fR or \fBpktps\fR was specified. If unspecified, the switch is
2301 free to select some reasonable value depending on its configuration.
2302 .RE
2303 .
2304 .SH OPTIONS
2305 .TP
2306 \fB\-\-strict\fR
2307 Uses strict matching when running flow modification commands.
2308 .
2309 .IP "\fB\-\-names\fR"
2310 .IQ "\fB\-\-no\-names\fR"
2311 Every OpenFlow port has a name and a number, and every OpenFlow flow
2312 table has a number and sometimes a name. By default, \fBovs\-ofctl\fR
2313 commands accept both port and table names and numbers, and they
2314 display port and table names if \fBovs\-ofctl\fR is running on an
2315 interactive console, numbers otherwise. With \fB\-\-names\fR,
2316 \fBovs\-ofctl\fR commands both accept and display port and table
2317 names; with \fB\-\-no\-names\fR, commands neither accept nor display
2318 port and table names.
2319 .IP
2320 If a port or table name contains special characters or might be
2321 confused with a keyword within a flow, it may be enclosed in double
2322 quotes (escaped from the shell). If necessary, JSON-style escape
2323 sequences may be used inside quotes, as specified in RFC 7159. When
2324 it displays port and table names, \fBovs\-ofctl\fR quotes any name
2325 that does not start with a letter followed by letters or digits.
2326 .IP
2327 Open vSwitch added support for port names and these options. Open
2328 vSwitch 2.10 added support for table names. Earlier versions always
2329 behaved as if \fB\-\-no\-names\fR were specified.
2330 .IP
2331 Open vSwitch does not place its own limit on the length of port names,
2332 but OpenFlow 1.0 to 1.5 limit port names to 15 bytes and OpenFlow 1.6
2333 limits them to 63 bytes. Because \fRovs\-ofctl\fR uses OpenFlow to
2334 retrieve the mapping between port names and numbers, names longer than
2335 this limit will be truncated for both display and acceptance.
2336 Truncation can also cause long names that are different to appear to
2337 be the same; when a switch has two ports with the same (truncated)
2338 name, \fBovs\-ofctl\fR refuses to display or accept the name, using
2339 the number instead.
2340 .IP
2341 OpenFlow and Open vSwitch limit table names to 32 bytes.
2342 .
2343 .IP "\fB\-\-stats\fR"
2344 .IQ "\fB\-\-no\-stats\fR"
2345 The \fBdump\-flows\fR command by default, or with \fB\-\-stats\fR,
2346 includes flow duration, packet and byte counts, and idle and hard age
2347 in its output. With \fB\-\-no\-stats\fR, it omits all of these, as
2348 well as cookie values and table IDs if they are zero.
2349 .
2350 .IP "\fB\-\-read-only\fR"
2351 Do not execute read/write commands.
2352 .
2353 .IP "\fB\-\-bundle\fR"
2354 Execute flow mods as an OpenFlow 1.4 atomic bundle transaction.
2355 .RS
2356 .IP \(bu
2357 Within a bundle, all flow mods are processed in the order they appear
2358 and as a single atomic transaction, meaning that if one of them fails,
2359 the whole transaction fails and none of the changes are made to the
2360 \fIswitch\fR's flow table, and that each given datapath packet
2361 traversing the OpenFlow tables sees the flow tables either as before
2362 the transaction, or after all the flow mods in the bundle have been
2363 successfully applied.
2364 .IP \(bu
2365 The beginning and the end of the flow table modification commands in a
2366 bundle are delimited with OpenFlow 1.4 bundle control messages, which
2367 makes it possible to stream the included commands without explicit
2368 OpenFlow barriers, which are otherwise used after each flow table
2369 modification command. This may make large modifications execute
2370 faster as a bundle.
2371 .IP \(bu
2372 Bundles require OpenFlow 1.4 or higher. An explicit \fB-O
2373 OpenFlow14\fR option is not needed, but you may need to enable
2374 OpenFlow 1.4 support for OVS by setting the OVSDB \fIprotocols\fR
2375 column in the \fIbridge\fR table.
2376 .RE
2377 .
2378 .so lib/ofp-version.man
2379 .
2380 .IP "\fB\-F \fIformat\fR[\fB,\fIformat\fR...]"
2381 .IQ "\fB\-\-flow\-format=\fIformat\fR[\fB,\fIformat\fR...]"
2382 \fBovs\-ofctl\fR supports the following individual flow formats, any
2383 number of which may be listed as \fIformat\fR:
2384 .RS
2385 .IP "\fBOpenFlow10\-table_id\fR"
2386 This is the standard OpenFlow 1.0 flow format. All OpenFlow switches
2387 and all versions of Open vSwitch support this flow format.
2388 .
2389 .IP "\fBOpenFlow10+table_id\fR"
2390 This is the standard OpenFlow 1.0 flow format plus a Nicira extension
2391 that allows \fBovs\-ofctl\fR to specify the flow table in which a
2392 particular flow should be placed. Open vSwitch 1.2 and later supports
2393 this flow format.
2394 .
2395 .IP "\fBNXM\-table_id\fR (Nicira Extended Match)"
2396 This Nicira extension to OpenFlow is flexible and extensible. It
2397 supports all of the Nicira flow extensions, such as \fBtun_id\fR and
2398 registers. Open vSwitch 1.1 and later supports this flow format.
2399 .
2400 .IP "\fBNXM+table_id\fR (Nicira Extended Match)"
2401 This combines Nicira Extended match with the ability to place a flow
2402 in a specific table. Open vSwitch 1.2 and later supports this flow
2403 format.
2404 .
2405 .IP "\fBOXM-OpenFlow12\fR"
2406 .IQ "\fBOXM-OpenFlow13\fR"
2407 .IQ "\fBOXM-OpenFlow14\fR"
2408 .IQ "\fBOXM-OpenFlow15\fR"
2409 .IQ "\fBOXM-OpenFlow16\fR"
2410 These are the standard OXM (OpenFlow Extensible Match) flow format in
2411 OpenFlow 1.2 and later.
2412 .RE
2413 .
2414 .IP
2415 \fBovs\-ofctl\fR also supports the following abbreviations for
2416 collections of flow formats:
2417 .RS
2418 .IP "\fBany\fR"
2419 Any supported flow format.
2420 .IP "\fBOpenFlow10\fR"
2421 \fBOpenFlow10\-table_id\fR or \fBOpenFlow10+table_id\fR.
2422 .IP "\fBNXM\fR"
2423 \fBNXM\-table_id\fR or \fBNXM+table_id\fR.
2424 .IP "\fBOXM\fR"
2425 \fBOXM-OpenFlow12\fR, \fBOXM-OpenFlow13\fR, or \fBOXM-OpenFlow14\fR.
2426 .RE
2427 .
2428 .IP
2429 For commands that modify the flow table, \fBovs\-ofctl\fR by default
2430 negotiates the most widely supported flow format that supports the
2431 flows being added. For commands that query the flow table,
2432 \fBovs\-ofctl\fR by default uses the most advanced format supported by
2433 the switch.
2434 .IP
2435 This option, where \fIformat\fR is a comma-separated list of one or
2436 more of the formats listed above, limits \fBovs\-ofctl\fR's choice of
2437 flow format. If a command cannot work as requested using one of the
2438 specified flow formats, \fBovs\-ofctl\fR will report a fatal error.
2439 .
2440 .IP "\fB\-P \fIformat\fR"
2441 .IQ "\fB\-\-packet\-in\-format=\fIformat\fR"
2442 \fBovs\-ofctl\fR supports the following ``packet-in'' formats, in order of
2443 increasing capability:
2444 .RS
2445 .IP "\fBstandard\fR"
2446 This uses the \fBOFPT_PACKET_IN\fR message, the standard ``packet-in''
2447 message for any given OpenFlow version. Every OpenFlow switch that
2448 supports a given OpenFlow version supports this format.
2449 .
2450 .IP "\fBnxt_packet_in\fR"
2451 This uses the \fBNXT_PACKET_IN\fR message, which adds many of the
2452 capabilities of the OpenFlow 1.1 and later ``packet-in'' messages
2453 before those OpenFlow versions were available in Open vSwitch. Open
2454 vSwitch 1.1 and later support this format. Only Open vSwitch 2.6 and
2455 later, however, support it for OpenFlow 1.1 and later (but there is
2456 little reason to use it with those versions of OpenFlow).
2457 .
2458 .IP "\fBnxt_packet_in2\fR"
2459 This uses the \fBNXT_PACKET_IN2\fR message, which is extensible and
2460 should avoid the need to define new formats later. In particular,
2461 this format supports passing arbitrary user-provided data to a
2462 controller using the \fBuserdata\fB option on the \fBcontroller\fR
2463 action. Open vSwitch 2.6 and later support this format.
2464 .
2465 .RE
2466 .IP
2467 Without this option, \fBovs\-ofctl\fR prefers \fBnxt_packet_in2\fR if
2468 the switch supports it. Otherwise, if OpenFlow 1.0 is in use,
2469 \fBovs\-ofctl\fR prefers \fBnxt_packet_in\fR if the switch supports
2470 it. Otherwise, \fBovs\-ofctl\fR falls back to the \fBstandard\fR
2471 packet-in format. When this option is specified, \fBovs\-ofctl\fR
2472 insists on the selected format. If the switch does not support the
2473 requested format, \fBovs\-ofctl\fR will report a fatal error.
2474 .IP
2475 Before version 2.6, Open vSwitch called \fBstandard\fR format
2476 \fBopenflow10\fR and \fBnxt_packet_in\fR format \fBnxm\fR, and
2477 \fBovs\-ofctl\fR still accepts these names as synonyms. (The name
2478 \fBopenflow10\fR was a misnomer because this format actually varies
2479 from one OpenFlow version to another; it is not consistently OpenFlow
2480 1.0 format. Similarly, when \fBnxt_packet_in2\fR was introduced, the
2481 name \fBnxm\fR became confusing because it also uses OXM/NXM.)
2482 .
2483 .IP
2484 This option affects only the \fBmonitor\fR command.
2485 .
2486 .IP "\fB\-\-timestamp\fR"
2487 Print a timestamp before each received packet. This option only
2488 affects the \fBmonitor\fR, \fBsnoop\fR, and \fBofp\-parse\-pcap\fR
2489 commands.
2490 .
2491 .IP "\fB\-m\fR"
2492 .IQ "\fB\-\-more\fR"
2493 Increases the verbosity of OpenFlow messages printed and logged by
2494 \fBovs\-ofctl\fR commands. Specify this option more than once to
2495 increase verbosity further.
2496 .
2497 .IP \fB\-\-sort\fR[\fB=\fIfield\fR]
2498 .IQ \fB\-\-rsort\fR[\fB=\fIfield\fR]
2499 Display output sorted by flow \fIfield\fR in ascending
2500 (\fB\-\-sort\fR) or descending (\fB\-\-rsort\fR) order, where
2501 \fIfield\fR is any of the fields that are allowed for matching or
2502 \fBpriority\fR to sort by priority. When \fIfield\fR is omitted, the
2503 output is sorted by priority. Specify these options multiple times to
2504 sort by multiple fields.
2505 .IP
2506 Any given flow will not necessarily specify a value for a given
2507 field. This requires special treatement:
2508 .RS
2509 .IP \(bu
2510 A flow that does not specify any part of a field that is used for sorting is
2511 sorted after all the flows that do specify the field. For example,
2512 \fB\-\-sort=tcp_src\fR will sort all the flows that specify a TCP
2513 source port in ascending order, followed by the flows that do not
2514 specify a TCP source port at all.
2515 .IP \(bu
2516 A flow that only specifies some bits in a field is sorted as if the
2517 wildcarded bits were zero. For example, \fB\-\-sort=nw_src\fR would
2518 sort a flow that specifies \fBnw_src=192.168.0.0/24\fR the same as
2519 \fBnw_src=192.168.0.0\fR.
2520 .RE
2521 .IP
2522 These options currently affect only \fBdump\-flows\fR output.
2523 .
2524 .SS "Daemon Options"
2525 .ds DD \
2526 \fBovs\-ofctl\fR detaches only when executing the \fBmonitor\fR or \
2527 \fBsnoop\fR commands.
2528 .so lib/daemon.man
2529 .so lib/unixctl.man
2530 .SS "Public Key Infrastructure Options"
2531 .so lib/ssl.man
2532 .so lib/vlog.man
2533 .so lib/colors.man
2534 .so lib/common.man
2535 .
2536 .SH "RUNTIME MANAGEMENT COMMANDS"
2537 \fBovs\-appctl\fR(8) can send commands to a running \fBovs\-ofctl\fR
2538 process. The supported commands are listed below.
2539 .
2540 .IP "\fBexit\fR"
2541 Causes \fBovs\-ofctl\fR to gracefully terminate. This command applies
2542 only when executing the \fBmonitor\fR or \fBsnoop\fR commands.
2543 .
2544 .IP "\fBofctl/set\-output\-file \fIfile\fR"
2545 Causes all subsequent output to go to \fIfile\fR instead of stderr.
2546 This command applies only when executing the \fBmonitor\fR or
2547 \fBsnoop\fR commands.
2548 .
2549 .IP "\fBofctl/send \fIofmsg\fR..."
2550 Sends each \fIofmsg\fR, specified as a sequence of hex digits that
2551 express an OpenFlow message, on the OpenFlow connection. This command
2552 is useful only when executing the \fBmonitor\fR command.
2553 .
2554 .IP "\fBofctl/packet\-out \fIpacket-out\fR"
2555 Sends an OpenFlow PACKET_OUT message specified in \fBPacket\-Out
2556 Syntax\fR, on the OpenFlow connection. See \fBPacket\-Out Syntax\fR
2557 section for more information. This command is useful only when
2558 executing the \fBmonitor\fR command.
2559 .
2560 .IP "\fBofctl/barrier\fR"
2561 Sends an OpenFlow barrier request on the OpenFlow connection and waits
2562 for a reply. This command is useful only for the \fBmonitor\fR
2563 command.
2564 .
2565 .SH EXAMPLES
2566 .
2567 The following examples assume that \fBovs\-vswitchd\fR has a bridge
2568 named \fBbr0\fR configured.
2569 .
2570 .TP
2571 \fBovs\-ofctl dump\-tables br0\fR
2572 Prints out the switch's table stats. (This is more interesting after
2573 some traffic has passed through.)
2574 .
2575 .TP
2576 \fBovs\-ofctl dump\-flows br0\fR
2577 Prints the flow entries in the switch.
2578 .
2579 .TP
2580 \fBovs\-ofctl add\-flow table=0 actions=learn(table=1,hard_timeout=10, NXM_OF_VLAN_TCI[0..11],output:NXM_OF_IN_PORT[]), resubmit(,1)\fR
2581 \fBovs\-ofctl add\-flow table=1 priority=0 actions=flood\fR
2582 Implements a level 2 MAC learning switch using the learn.
2583 .
2584 .TP
2585 \fBovs\-ofctl add\-flow br0 'table=0,priority=0 actions=load:3->NXM_NX_REG0[0..15],learn(table=0,priority=1,idle_timeout=10,NXM_OF_ETH_SRC[],NXM_OF_VLAN_TCI[0..11],output:NXM_NX_REG0[0..15]),output:2\fR
2586 In this use of a learn action, the first packet from each source MAC
2587 will be sent to port 2. Subsequent packets will be output to port 3,
2588 with an idle timeout of 10 seconds. NXM field names and match field
2589 names are both accepted, e.g. \fBNXM_NX_REG0\fR or \fBreg0\fR for the
2590 first register, and empty brackets may be omitted.
2591 .IP
2592 Additional examples may be found documented as part of related sections.
2593 .
2594 .SH "SEE ALSO"
2595 .
2596 .BR ovs\-fields (7),
2597 .BR ovs\-appctl (8),
2598 .BR ovs\-vswitchd (8),
2599 .BR ovs\-vswitchd.conf.db (8)