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