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