]> git.proxmox.com Git - mirror_ovs.git/blob - utilities/ovs-ofctl.8.in
rhel: Add option to enable AF_XDP on rpm package.
[mirror_ovs.git] / utilities / ovs-ofctl.8.in
1 .\" -*- nroff -*-
2 .so lib/ovs.tmac
3 .TH ovs\-ofctl 8 "@VERSION@" "Open vSwitch" "Open vSwitch Manual"
4 .ds PN ovs\-ofctl
5 .
6 .SH NAME
7 ovs\-ofctl \- administer OpenFlow switches
8 .
9 .SH SYNOPSIS
10 .B ovs\-ofctl
11 [\fIoptions\fR] \fIcommand \fR[\fIswitch\fR] [\fIargs\fR\&...]
12 .
13 .SH DESCRIPTION
14 The
15 .B ovs\-ofctl
16 program is a command line tool for monitoring and administering
17 OpenFlow switches. It can also show the current state of an OpenFlow
18 switch, including features, configuration, and table entries.
19 It should work with any OpenFlow switch, not just Open vSwitch.
20 .
21 .SS "OpenFlow Switch Management Commands"
22 .PP
23 These commands allow \fBovs\-ofctl\fR to monitor and administer an OpenFlow
24 switch. It is able to show the current state of a switch, including
25 features, configuration, and table entries.
26 .PP
27 Most of these commands take an argument that specifies the method for
28 connecting to an OpenFlow switch. The following connection methods
29 are supported:
30 .
31 .RS
32 .so lib/vconn-active.man
33 .
34 .IP "\fIfile\fR"
35 This is short for \fBunix:\fIfile\fR, as long as \fIfile\fR does not
36 contain a colon.
37 .
38 .IP \fIbridge\fR
39 This is short for \fBunix:@RUNDIR@/\fIbridge\fB.mgmt\fR, as long as
40 \fIbridge\fR does not contain a colon.
41 .
42 .IP [\fItype\fB@\fR]\fIdp\fR
43 Attempts to look up the bridge associated with \fIdp\fR and open as
44 above. If \fItype\fR is given, it specifies the datapath provider of
45 \fIdp\fR, otherwise the default provider \fBsystem\fR is assumed.
46 .RE
47 .
48 .TP
49 \fBshow \fIswitch\fR
50 Prints to the console information on \fIswitch\fR, including
51 information on its flow tables and ports.
52 .
53 .TP
54 \fBdump\-tables \fIswitch\fR
55 Prints to the console statistics for each of the flow tables used by
56 \fIswitch\fR.
57 .TP
58 \fBdump\-table\-features \fIswitch\fR
59 Prints to the console features for each of the flow tables used by
60 \fIswitch\fR.
61 .TP
62 \fBdump\-table\-desc \fIswitch\fR
63 Prints to the console configuration for each of the flow tables used
64 by \fIswitch\fR for OpenFlow 1.4+.
65 .IP "\fBmod\-table \fIswitch\fR \fItable\fR \fIsetting\fR"
66 This command configures flow table settings in \fIswitch\fR for
67 OpenFlow table \fItable\fR, which may be expressed as a number or
68 (unless \fB\-\-no\-names\fR is specified) a name.
69 .IP
70 The available settings depend on
71 the OpenFlow version in use. In OpenFlow 1.1 and 1.2 (which must be
72 enabled with the \fB\-O\fR option) only, \fBmod\-table\fR configures
73 behavior when no flow is found when a packet is looked up in a flow
74 table. The following \fIsetting\fR values are available:
75 .RS
76 .IP \fBdrop\fR
77 Drop the packet.
78 .IP \fBcontinue\fR
79 Continue to the next table in the pipeline. (This is how an OpenFlow
80 1.0 switch always handles packets that do not match any flow, in
81 tables other than the last one.)
82 .IP \fBcontroller\fR
83 Send to controller. (This is how an OpenFlow 1.0 switch always
84 handles packets that do not match any flow in the last table.)
85 .RE
86 .IP
87 In OpenFlow 1.3 and later (which must be enabled with the \fB\-O\fR
88 option) and Open vSwitch 2.11 and later only, \fBmod\-table\fR can
89 change the name of a table:
90 .RS
91 .IP \fBname:\fInew-name\fR
92 Changes the name of the table to \fInew-name\fR. Use an empty
93 \fInew-name\fR to clear the name. (This will be ineffective if the
94 name is set via the \fBname\fR column in the \fBFlow_Table\fR table in
95 the \fBOpen_vSwitch\fR database as described in
96 \fBovs\-vswitchd.conf.db\fR(5).)
97 .RE
98 .IP
99 In OpenFlow 1.4 and later (which must be enabled with the \fB\-O\fR
100 option) only, \fBmod\-table\fR configures the behavior when a
101 controller attempts to add a flow to a flow table that is full. The
102 following \fIsetting\fR values are available:
103 .RS
104 .IP \fBevict\fR
105 Delete some existing flow from the flow table, according to the
106 algorithm described for the \fBFlow_Table\fR table in
107 \fBovs-vswitchd.conf.db\fR(5).
108 .IP \fBnoevict\fR
109 Refuse to add the new flow. (Eviction might still be enabled through
110 the \fBoverflow_policy\fR column in the \fBFlow_Table\fR table
111 documented in \fBovs-vswitchd.conf.db\fR(5).)
112 .IP \fBvacancy:\fIlow\fB,\fIhigh\fR
113 Enables sending vacancy events to controllers using \fBTABLE_STATUS\fR
114 messages, based on percentage thresholds \fIlow\fR and \fIhigh\fR.
115 .IP \fBnovacancy\fR
116 Disables vacancy events.
117 .RE
118 .
119 .TP
120 \fBdump\-ports \fIswitch\fR [\fInetdev\fR]
121 Prints to the console statistics for network devices associated with
122 \fIswitch\fR. If \fInetdev\fR is specified, only the statistics
123 associated with that device will be printed. \fInetdev\fR can be an
124 OpenFlow assigned port number or device name, e.g. \fBeth0\fR.
125 .
126 .IP "\fBdump\-ports\-desc \fIswitch\fR [\fIport\fR]"
127 Prints to the console detailed information about network devices
128 associated with \fIswitch\fR. To dump only a specific port, specify
129 its number as \fIport\fR. Otherwise, if \fIport\fR is omitted, or if
130 it is specified as \fBANY\fR, then all ports are printed. This is a
131 subset of the information provided by the \fBshow\fR command.
132 .IP
133 If the connection to \fIswitch\fR negotiates OpenFlow 1.0, 1.2, or
134 1.2, this command uses an OpenFlow extension only implemented in Open
135 vSwitch (version 1.7 and later).
136 .IP
137 Only OpenFlow 1.5 and later support dumping a specific port. Earlier
138 versions of OpenFlow always dump all ports.
139 .
140 .IP "\fBmod\-port \fIswitch\fR \fIport\fR \fIaction\fR"
141 Modify characteristics of port \fBport\fR in \fIswitch\fR. \fIport\fR
142 may be an OpenFlow port number or name (unless \fB\-\-no\-names\fR is
143 specified) or the keyword \fBLOCAL\fR (the
144 preferred way to refer to the OpenFlow local port). The \fIaction\fR
145 may be any one of the following:
146 .
147 .RS
148 .IQ \fBup\fR
149 .IQ \fBdown\fR
150 Enable or disable the interface. This is equivalent to \fBip
151 link set up\fR or \fBip link set down\fR on a Unix system.
152 .
153 .IP \fBstp\fR
154 .IQ \fBno\-stp\fR
155 Enable or disable 802.1D spanning tree protocol (STP) on the
156 interface. OpenFlow implementations that don't support STP will
157 refuse to enable it.
158 .
159 .IP \fBreceive\fR
160 .IQ \fBno\-receive\fR
161 .IQ \fBreceive\-stp\fR
162 .IQ \fBno\-receive\-stp\fR
163 Enable or disable OpenFlow processing of packets received on this
164 interface. When packet processing is disabled, packets will be
165 dropped instead of being processed through the OpenFlow table. The
166 \fBreceive\fR or \fBno\-receive\fR setting applies to all packets
167 except 802.1D spanning tree packets, which are separately controlled
168 by \fBreceive\-stp\fR or \fBno\-receive\-stp\fR.
169 .
170 .IP \fBforward\fR
171 .IQ \fBno\-forward\fR
172 Allow or disallow forwarding of traffic to this interface. By
173 default, forwarding is enabled.
174 .
175 .IP \fBflood\fR
176 .IQ \fBno\-flood\fR
177 Controls whether an OpenFlow \fBflood\fR action will send traffic out
178 this interface. By default, flooding is enabled. Disabling flooding
179 is primarily useful to prevent loops when a spanning tree protocol is
180 not in use.
181 .
182 .IP \fBpacket\-in\fR
183 .IQ \fBno\-packet\-in\fR
184 Controls whether packets received on this interface that do not match
185 a flow table entry generate a ``packet in'' message to the OpenFlow
186 controller. By default, ``packet in'' messages are enabled.
187 .RE
188 .IP
189 The \fBshow\fR command displays (among other information) the
190 configuration that \fBmod\-port\fR changes.
191 .
192 .IP "\fBget\-frags \fIswitch\fR"
193 Prints \fIswitch\fR's fragment handling mode. See \fBset\-frags\fR,
194 below, for a description of each fragment handling mode.
195 .IP
196 The \fBshow\fR command also prints the fragment handling mode among
197 its other output.
198 .
199 .IP "\fBset\-frags \fIswitch frag_mode\fR"
200 Configures \fIswitch\fR's treatment of IPv4 and IPv6 fragments. The
201 choices for \fIfrag_mode\fR are:
202 .RS
203 .IP "\fBnormal\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 always set
206 to 0, even for fragments where that information would otherwise be
207 available (fragments with offset 0). This is the default fragment
208 handling mode for an OpenFlow switch.
209 .IP "\fBdrop\fR"
210 Fragments are dropped without passing through the flow table.
211 .IP "\fBreassemble\fR"
212 The switch reassembles fragments into full IP packets before passing
213 them through the flow table. Open vSwitch does not implement this
214 fragment handling mode.
215 .IP "\fBnx\-match\fR"
216 Fragments pass through the flow table like non-fragmented packets.
217 The TCP ports, UDP ports, and ICMP type and code fields are available
218 for matching for fragments with offset 0, and set to 0 in fragments
219 with nonzero offset. This mode is a Nicira extension.
220 .RE
221 .IP
222 See the description of \fBip_frag\fR, in \fBovs\-fields\fR(7), for a way to
223 match on whether a packet is a fragment and on its fragment offset.
224 .
225 .TP
226 \fBdump\-flows \fIswitch \fR[\fIflows\fR]
227 Prints to the console all flow entries in \fIswitch\fR's
228 tables that match \fIflows\fR. If \fIflows\fR is omitted, all flows
229 in the switch are retrieved. See \fBFlow Syntax\fR, below, for the
230 syntax of \fIflows\fR. The output format is described in
231 \fBTable Entry Output\fR.
232 .
233 .IP
234 By default, \fBovs\-ofctl\fR prints flow entries in the same order
235 that the switch sends them, which is unlikely to be intuitive or
236 consistent. Use \fB\-\-sort\fR and \fB\-\-rsort\fR to control display
237 order. The \fB\-\-names\fR/\fB\-\-no\-names\fR and
238 \fB\-\-stats\fR/\fB\-\-no\-stats\fR options also affect output
239 formatting. See the descriptions of these options, under
240 \fBOPTIONS\fR below, for more information
241 .
242 .TP
243 \fBdump\-aggregate \fIswitch \fR[\fIflows\fR]
244 Prints to the console aggregate statistics for flows in
245 \fIswitch\fR's tables that match \fIflows\fR. If \fIflows\fR is omitted,
246 the statistics are aggregated across all flows in the switch's flow
247 tables. See \fBFlow Syntax\fR, below, for the syntax of \fIflows\fR.
248 The output format is described in \fBTable Entry Output\fR.
249 .
250 .IP "\fBqueue\-stats \fIswitch \fR[\fIport \fR[\fIqueue\fR]]"
251 Prints to the console statistics for the specified \fIqueue\fR on
252 \fIport\fR within \fIswitch\fR. \fIport\fR can be an OpenFlow port
253 number or name, the keyword \fBLOCAL\fR (the preferred way to refer to
254 the OpenFlow local port), or the keyword \fBALL\fR. Either of
255 \fIport\fR or \fIqueue\fR or both may be omitted (or equivalently the
256 keyword \fBALL\fR). If both are omitted, statistics are printed for
257 all queues on all ports. If only \fIqueue\fR is omitted, then
258 statistics are printed for all queues on \fIport\fR; if only
259 \fIport\fR is omitted, then statistics are printed for \fIqueue\fR on
260 every port where it exists.
261 .
262 .IP "\fBqueue\-get\-config \fIswitch [\fIport \fR[\fIqueue\fR]]"
263 Prints to the console the configuration of \fIqueue\fR on \fIport\fR
264 in \fIswitch\fR. If \fIport\fR is omitted or \fBANY\fR, reports
265 queues for all port. If \fIqueue\fR is omitted or \fBANY\fR, reports
266 all queues. For OpenFlow 1.3 and earlier, the output always includes
267 all queues, ignoring \fIqueue\fR if specified.
268 .IP
269 This command has limited usefulness, because ports often have no
270 configured queues and because the OpenFlow protocol provides only very
271 limited information about the configuration of a queue.
272 .
273 .IP "\fBdump\-ipfix\-bridge \fIswitch\fR"
274 Prints to the console the statistics of bridge IPFIX for \fIswitch\fR.
275 If bridge IPFIX is configured on the \fIswitch\fR, IPFIX statistics
276 can be retrieved. Otherwise, error message will be printed.
277 .IP
278 This command uses an Open vSwitch extension that is only in Open
279 vSwitch 2.6 and later.
280 .
281 .IP "\fBdump\-ipfix\-flow \fIswitch\fR"
282 Prints to the console the statistics of flow-based IPFIX for
283 \fIswitch\fR. If flow-based IPFIX is configured on the \fIswitch\fR,
284 statistics of all the collector set ids on the \fIswitch\fR will be
285 printed. Otherwise, print error message.
286 .IP
287 Refer to \fBovs\-vswitchd.conf.db\fR(5) for more details on configuring
288 flow based IPFIX and collector set ids.
289 .IP
290 This command uses an Open vSwitch extension that is only in Open
291 vSwitch 2.6 and later.
292 .
293 .IP "\fBct\-flush\-zone \fIswitch zone\fR
294 Flushes the connection tracking entries in \fIzone\fR on \fIswitch\fR.
295 .IP
296 This command uses an Open vSwitch extension that is only in Open
297 vSwitch 2.6 and later.
298 .
299 .SS "OpenFlow Switch Flow Table Commands"
300 .
301 These commands manage the flow table in an OpenFlow switch. In each
302 case, \fIflow\fR specifies a flow entry in the format described in
303 \fBFlow Syntax\fR, below, \fIfile\fR is a text file that contains zero
304 or more flows in the same syntax, one per line, and the optional
305 \fB\-\-bundle\fR option operates the command as a single atomic
306 transation, see option \fB\-\-bundle\fR, below.
307 .
308 .IP "[\fB\-\-bundle\fR] \fBadd\-flow \fIswitch flow\fR"
309 .IQ "[\fB\-\-bundle\fR] \fBadd\-flow \fIswitch \fB\- < \fIfile\fR"
310 .IQ "[\fB\-\-bundle\fR] \fBadd\-flows \fIswitch file\fR"
311 Add each flow entry to \fIswitch\fR's tables.
312 .
313 Each flow specification (e.g., each line in \fIfile\fR) may start with
314 \fBadd\fR, \fBmodify\fR, \fBdelete\fR, \fBmodify_strict\fR, or
315 \fBdelete_strict\fR keyword to specify whether a flow is to be added,
316 modified, or deleted, and whether the modify or delete is strict or
317 not. For backwards compatibility a flow specification without one of
318 these keywords is treated as a flow add. All flow mods are executed
319 in the order specified.
320 .
321 .IP "[\fB\-\-bundle\fR] [\fB\-\-strict\fR] \fBmod\-flows \fIswitch flow\fR"
322 .IQ "[\fB\-\-bundle\fR] [\fB\-\-strict\fR] \fBmod\-flows \fIswitch \fB\- < \fIfile\fR"
323 Modify the actions in entries from \fIswitch\fR's tables that match
324 the specified flows. With \fB\-\-strict\fR, wildcards are not treated
325 as active for matching purposes.
326 .
327 .IP "[\fB\-\-bundle\fR] \fBdel\-flows \fIswitch\fR"
328 .IQ "[\fB\-\-bundle\fR] [\fB\-\-strict\fR] \fBdel\-flows \fIswitch \fR[\fIflow\fR]"
329 .IQ "[\fB\-\-bundle\fR] [\fB\-\-strict\fR] \fBdel\-flows \fIswitch \fB\- < \fIfile\fR"
330 Deletes entries from \fIswitch\fR's flow table. With only a
331 \fIswitch\fR argument, deletes all flows. Otherwise, deletes flow
332 entries that match the specified flows. With \fB\-\-strict\fR,
333 wildcards are not treated as active for matching purposes.
334 .
335 .IP "[\fB\-\-bundle\fR] [\fB\-\-readd\fR] \fBreplace\-flows \fIswitch file\fR"
336 Reads flow entries from \fIfile\fR (or \fBstdin\fR if \fIfile\fR is
337 \fB\-\fR) and queries the flow table from \fIswitch\fR. Then it fixes
338 up any differences, adding flows from \fIflow\fR that are missing on
339 \fIswitch\fR, deleting flows from \fIswitch\fR that are not in
340 \fIfile\fR, and updating flows in \fIswitch\fR whose actions, cookie,
341 or timeouts differ in \fIfile\fR.
342 .
343 .IP
344 With \fB\-\-readd\fR, \fBovs\-ofctl\fR adds all the flows from
345 \fIfile\fR, even those that exist with the same actions, cookie, and
346 timeout in \fIswitch\fR. In OpenFlow 1.0 and 1.1, re-adding a flow
347 always resets the flow's packet and byte counters to 0, and in
348 OpenFlow 1.2 and later, it does so only if the \fBreset_counts\fR flag
349 is set.
350 .
351 .IP "\fBdiff\-flows \fIsource1 source2\fR"
352 Reads flow entries from \fIsource1\fR and \fIsource2\fR and prints the
353 differences. A flow that is in \fIsource1\fR but not in \fIsource2\fR
354 is printed preceded by a \fB\-\fR, and a flow that is in \fIsource2\fR
355 but not in \fIsource1\fR is printed preceded by a \fB+\fR. If a flow
356 exists in both \fIsource1\fR and \fIsource2\fR with different actions,
357 cookie, or timeouts, then both versions are printed preceded by
358 \fB\-\fR and \fB+\fR, respectively.
359 .IP
360 \fIsource1\fR and \fIsource2\fR may each name a file or a switch. If
361 a name begins with \fB/\fR or \fB.\fR, then it is considered to be a
362 file name. A name that contains \fB:\fR is considered to be a switch.
363 Otherwise, it is a file if a file by that name exists, a switch if
364 not.
365 .IP
366 For this command, an exit status of 0 means that no differences were
367 found, 1 means that an error occurred, and 2 means that some
368 differences were found.
369 .
370 .IP "\fBpacket\-out \fIswitch\fR \fIpacket-out\fR"
371 Connects to \fIswitch\fR and instructs it to execute the
372 \fIpacket-out\fR OpenFlow message, specified as defined in
373 \fBPacket\-Out Syntax\fR section.
374 .
375 .SS "Group Table Commands"
376 .
377 These commands manage the group table in an OpenFlow switch. In each
378 case, \fIgroup\fR specifies a group entry in the format described in
379 \fBGroup Syntax\fR, below, and \fIfile\fR is a text file that contains
380 zero or more groups in the same syntax, one per line, and the optional
381 \fB\-\-bundle\fR option operates the command as a single atomic
382 transation, see option \fB\-\-bundle\fR, below.
383 .PP
384 The group commands work only with switches that support OpenFlow 1.1
385 or later or the Open vSwitch group extensions to OpenFlow 1.0 (added
386 in Open vSwitch 2.9.90). For OpenFlow 1.1 or later, it is necessary
387 to explicitly enable these protocol versions in \fBovs\-ofctl\fR
388 (using \fB\-O\fR). For more information, see ``Q: What versions of
389 OpenFlow does Open vSwitch support?'' in the Open vSwitch FAQ.
390 .
391 .IP "[\fB\-\-bundle\fR] \fBadd\-group \fIswitch group\fR"
392 .IQ "[\fB\-\-bundle\fR] \fBadd\-group \fIswitch \fB\- < \fIfile\fR"
393 .IQ "[\fB\-\-bundle\fR] \fBadd\-groups \fIswitch file\fR"
394 Add each group entry to \fIswitch\fR's tables.
395 .
396 Each group specification (e.g., each line in \fIfile\fR) may start
397 with \fBadd\fR, \fBmodify\fR, \fBadd_or_mod\fR, \fBdelete\fR,
398 \fBinsert_bucket\fR, or \fBremove_bucket\fR keyword to specify whether
399 a flow is to be added, modified, or deleted, or whether a group bucket
400 is to be added or removed. For backwards compatibility a group
401 specification without one of these keywords is treated as a group add.
402 All group mods are executed in the order specified.
403 .
404 .IP "[\fB\-\-bundle\fR] [\fB\-\-may\-create\fR] \fBmod\-group \fIswitch group\fR"
405 .IQ "[\fB\-\-bundle\fR] [\fB\-\-may\-create\fR] \fBmod\-group \fIswitch \fB\- < \fIfile\fR"
406 Modify the action buckets in entries from \fIswitch\fR's tables for
407 each group entry. If a specified group does not already exist, then
408 without \fB\-\-may\-create\fR, this command has no effect; with
409 \fB\-\-may\-create\fR, it creates a new group. The
410 \fB\-\-may\-create\fR option uses an Open vSwitch extension to
411 OpenFlow only implemented in Open vSwitch 2.6 and later.
412 .
413 .IP "[\fB\-\-bundle\fR] \fBdel\-groups \fIswitch\fR"
414 .IQ "[\fB\-\-bundle\fR] \fBdel\-groups \fIswitch \fR[\fIgroup\fR]"
415 .IQ "[\fB\-\-bundle\fR] \fBdel\-groups \fIswitch \fB\- < \fIfile\fR"
416 Deletes entries from \fIswitch\fR's group table. With only a
417 \fIswitch\fR argument, deletes all groups. Otherwise, deletes the group
418 for each group entry.
419 .
420 .IP "[\fB\-\-bundle\fR] \fBinsert\-buckets \fIswitch group\fR"
421 .IQ "[\fB\-\-bundle\fR] \fBinsert\-buckets \fIswitch \fB\- < \fIfile\fR"
422 Add buckets to an existing group present in the \fIswitch\fR's group table.
423 If no \fIcommand_bucket_id\fR is present in the group specification then all
424 buckets of the group are removed.
425 .
426 .IP "[\fB\-\-bundle\fR] \fBremove\-buckets \fIswitch group\fR"
427 .IQ "[\fB\-\-bundle\fR] \fBremove\-buckets \fIswitch \fB\- < \fIfile\fR"
428 Remove buckets to an existing group present in the \fIswitch\fR's group table.
429 If no \fIcommand_bucket_id\fR is present in the group specification then all
430 buckets of the group are removed.
431 .
432 .IP "\fBdump\-groups \fIswitch\fR [\fIgroup\fR]"
433 Prints group entries in \fIswitch\fR's tables to console. To dump
434 only a specific group, specify its number as \fIgroup\fR. Otherwise,
435 if \fIgroup\fR is omitted, or if it is specified as \fBALL\fR, then
436 all groups are printed.
437 .IP
438 Only OpenFlow 1.5 and later support dumping a specific group. Earlier
439 versions of OpenFlow always dump all groups.
440 .
441 .IP "\fBdump\-group\-features \fIswitch"
442 Prints to the console the group features of the \fIswitch\fR.
443 .
444 .IP "\fBdump\-group\-stats \fIswitch \fR[\fIgroup\fR]"
445 Prints to the console statistics for the specified \fIgroup\fR in
446 \fIswitch\fR's tables. If \fIgroup\fR is omitted then statistics for all
447 groups are printed.
448 .
449 .SS "OpenFlow 1.3+ Switch Meter Table Commands"
450 .
451 These commands manage the meter table in an OpenFlow switch. In each
452 case, \fImeter\fR specifies a meter entry in the format described in
453 \fBMeter Syntax\fR, below.
454 .
455 .PP
456 OpenFlow 1.3 introduced support for meters, so these commands only work
457 with switches that support OpenFlow 1.3 or later. It is necessary to
458 explicitly enable these protocol versions in \fBovs\-ofctl\fR (using
459 \fB\-O\fR) and in the switch itself (with the \fBprotocols\fR column in
460 the \fBBridge\fR table). For more information, see ``Q: What versions
461 of OpenFlow does Open vSwitch support?'' in the Open vSwitch FAQ.
462 .
463 .IP "\fBadd\-meter \fIswitch meter\fR"
464 Add a meter entry to \fIswitch\fR's tables. The \fImeter\fR syntax is
465 described in section \fBMeter Syntax\fR, below.
466 .
467 .IP "\fBmod\-meter \fIswitch meter\fR"
468 Modify an existing meter.
469 .
470 .IP "\fBdel\-meters \fIswitch\fR [\fImeter\fR]"
471 Delete entries from \fIswitch\fR's meter table. To delete only a
472 specific meter, specify its number as \fImeter\fR. Otherwise, if
473 \fImeter\fR is omitted, or if it is specified as \fBall\fR, then all
474 meters are deleted.
475 .
476 .IP "\fBdump\-meters \fIswitch\fR [\fImeter\fR]"
477 Print entries from \fIswitch\fR's meter table. To print only a
478 specific meter, specify its number as \fImeter\fR. Otherwise, if
479 \fImeter\fR is omitted, or if it is specified as \fBall\fR, then all
480 meters are printed.
481 .
482 .IP "\fBmeter\-stats \fIswitch\fR [\fImeter\fR]"
483 Print meter statistics. \fImeter\fR can specify a single meter with
484 syntax \fBmeter=\fIid\fR, or all meters with syntax \fBmeter=all\fR.
485 .
486 .IP "\fBmeter\-features \fIswitch\fR"
487 Print meter features.
488 .
489 .SS OpenFlow Switch Bundle Command
490 .
491 Transactional updates to both flow and group tables can be made with
492 the \fBbundle\fR command. \fIfile\fR is a text file that contains
493 zero or more flow mods, group mods, or packet-outs in \fBFlow
494 Syntax\fR, \fBGroup Syntax\fR, or \fBPacket\-Out Syntax\fR, each line
495 preceded by \fBflow\fR, \fBgroup\fR, or \fBpacket\-out\fR keyword,
496 correspondingly. The \fBflow\fR keyword may be optionally followed by
497 one of the keywords \fBadd\fR, \fBmodify\fR, \fBmodify_strict\fR,
498 \fBdelete\fR, or \fBdelete_strict\fR, of which the \fBadd\fR is
499 assumed if a bare \fBflow\fR is given. Similarly, the \fBgroup\fR
500 keyword may be optionally followed by one of the keywords \fBadd\fR,
501 \fBmodify\fR, \fBadd_or_mod\fR, \fBdelete\fR, \fBinsert_bucket\fR, or
502 \fBremove_bucket\fR, of which the \fBadd\fR is assumed if a bare
503 \fBgroup\fR is given.
504 .
505 .IP "\fBbundle \fIswitch file\fR"
506 Execute all flow and group mods in \fIfile\fR as a single atomic
507 transaction against \fIswitch\fR's tables. All bundled mods are
508 executed in the order specified.
509 .
510 .SS "OpenFlow Switch Tunnel TLV Table Commands"
511 .
512 Open vSwitch maintains a mapping table between tunnel option TLVs (defined
513 by <class, type, length>) and NXM fields \fBtun_metadata\fIn\fR,
514 where \fIn\fR ranges from 0 to 63, that can be operated on for the
515 purposes of matches, actions, etc. This TLV table can be used for
516 Geneve option TLVs or other protocols with options in same TLV format
517 as Geneve options. This mapping must be explicitly specified by the user
518 through the following commands.
519
520 A TLV mapping is specified with the syntax
521 \fB{class=\fIclass\fB,type=\fItype\fB,len=\fIlength\fB}->tun_metadata\fIn\fR.
522 When an option mapping exists for a given \fBtun_metadata\fIn\fR,
523 matching on the defined field becomes possible, e.g.:
524
525 .RS
526 ovs-ofctl add-tlv-map br0 "{class=0xffff,type=0,len=4}->tun_metadata0"
527 .PP
528 ovs-ofctl add-flow br0 tun_metadata0=1234,actions=controller
529 .RE
530
531 A mapping should not be changed while it is in active
532 use by a flow. The result of doing so is undefined.
533
534 These commands are Nicira extensions to OpenFlow and require Open vSwitch
535 2.5 or later.
536
537 .IP "\fBadd\-tlv\-map \fIswitch option\fR[\fB,\fIoption\fR]..."
538 Add each \fIoption\fR to \fIswitch\fR's tables. Duplicate fields are
539 rejected.
540 .
541 .IP "\fBdel\-tlv\-map \fIswitch \fR[\fIoption\fR[\fB,\fIoption\fR]]..."
542 Delete each \fIoption\fR from \fIswitch\fR's table, or all option TLV
543 mapping if no \fIoption\fR is specified.
544 Fields that aren't mapped are ignored.
545 .
546 .IP "\fBdump\-tlv\-map \fIswitch\fR"
547 Show the currently mapped fields in the switch's option table as well
548 as switch capabilities.
549 .
550 .SS "OpenFlow Switch Monitoring Commands"
551 .
552 .IP "\fBsnoop \fIswitch\fR"
553 Connects to \fIswitch\fR and prints to the console all OpenFlow
554 messages received. Unlike other \fBovs\-ofctl\fR commands, if
555 \fIswitch\fR is the name of a bridge, then the \fBsnoop\fR command
556 connects to a Unix domain socket named
557 \fB@RUNDIR@/\fIswitch\fB.snoop\fR. \fBovs\-vswitchd\fR listens on
558 such a socket for each bridge and sends to it all of the OpenFlow
559 messages sent to or received from its configured OpenFlow controller.
560 Thus, this command can be used to view OpenFlow protocol activity
561 between a switch and its controller.
562 .IP
563 When a switch has more than one controller configured, only the
564 traffic to and from a single controller is output. If none of the
565 controllers is configured as a primary or a secondary (using a Nicira
566 extension to OpenFlow 1.0 or 1.1, or a standard request in OpenFlow
567 1.2 or later), then a controller is chosen arbitrarily among
568 them. If there is a primary controller, it is chosen; otherwise, if
569 there are any controllers that are not primaries or secondaries, one is
570 chosen arbitrarily; otherwise, a secondary controller is chosen
571 arbitrarily. This choice is made once at connection time and does not
572 change as controllers reconfigure their roles.
573 .IP
574 If a switch has no controller configured, or if
575 the configured controller is disconnected, no traffic is sent, so
576 monitoring will not show any traffic.
577 .
578 .IP "\fBmonitor \fIswitch\fR [\fImiss-len\fR] [\fBinvalid_ttl\fR] [\fBwatch:\fR[\fIspec\fR...]]"
579 Connects to \fIswitch\fR and prints to the console all OpenFlow
580 messages received. Usually, \fIswitch\fR should specify the name of a
581 bridge in the \fBovs\-vswitchd\fR database. This is available only in
582 OpenFlow 1.0 as Nicira extension.
583 .IP
584 If \fImiss-len\fR is provided, \fBovs\-ofctl\fR sends an OpenFlow ``set
585 configuration'' message at connection setup time that requests
586 \fImiss-len\fR bytes of each packet that misses the flow table. Open vSwitch
587 does not send these and other asynchronous messages to an
588 \fBovs\-ofctl monitor\fR client connection unless a nonzero value is
589 specified on this argument. (Thus, if \fImiss\-len\fR is not
590 specified, very little traffic will ordinarily be printed.)
591 .IP
592 If \fBinvalid_ttl\fR is passed, \fBovs\-ofctl\fR sends an OpenFlow ``set
593 configuration'' message at connection setup time that requests
594 \fBINVALID_TTL_TO_CONTROLLER\fR, so that \fBovs\-ofctl monitor\fR can
595 receive ``packet-in'' messages when TTL reaches zero on \fBdec_ttl\fR action.
596 Only OpenFlow 1.1 and 1.2 support \fBinvalid_ttl\fR; Open vSwitch also
597 implements it for OpenFlow 1.0 as an extension.
598 .IP
599 \fBwatch:\fR[\fB\fIspec\fR...] causes \fBovs\-ofctl\fR to send a
600 ``monitor request'' Nicira extension message to the switch at
601 connection setup time. This message causes the switch to send
602 information about flow table changes as they occur. The following
603 comma-separated \fIspec\fR syntax is available:
604 .RS
605 .IP "\fB!initial\fR"
606 Do not report the switch's initial flow table contents.
607 .IP "\fB!add\fR"
608 Do not report newly added flows.
609 .IP "\fB!delete\fR"
610 Do not report deleted flows.
611 .IP "\fB!modify\fR"
612 Do not report modifications to existing flows.
613 .IP "\fB!own\fR"
614 Abbreviate changes made to the flow table by \fBovs\-ofctl\fR's own
615 connection to the switch. (These could only occur using the
616 \fBofctl/send\fR command described below under \fBRUNTIME MANAGEMENT
617 COMMANDS\fR.)
618 .IP "\fB!actions\fR"
619 Do not report actions as part of flow updates.
620 .IP "\fBtable=\fItable\fR"
621 Limits the monitoring to the table with the given \fItable\fR, which
622 may be expressed as a number between 0 and 254 or (unless
623 \fB\-\-no\-names\fR is specified) a name. By default, all tables are
624 monitored.
625 .IP "\fBout_port=\fIport\fR"
626 If set, only flows that output to \fIport\fR are monitored. The
627 \fIport\fR may be an OpenFlow port number or keyword
628 (e.g. \fBLOCAL\fR).
629 .IP "\fIfield\fB=\fIvalue\fR"
630 Monitors only flows that have \fIfield\fR specified as the given
631 \fIvalue\fR. Any syntax valid for matching on \fBdump\-flows\fR may
632 be used.
633 .RE
634 .IP
635 This command may be useful for debugging switch or controller
636 implementations. With \fBwatch:\fR, it is particularly useful for
637 observing how a controller updates flow tables.
638 .
639 .SS "OpenFlow Switch and Controller Commands"
640 .
641 The following commands, like those in the previous section, may be
642 applied to OpenFlow switches, using any of the connection methods
643 described in that section. Unlike those commands, these may also be
644 applied to OpenFlow controllers.
645 .
646 .TP
647 \fBprobe \fItarget\fR
648 Sends a single OpenFlow echo-request message to \fItarget\fR and waits
649 for the response. With the \fB\-t\fR or \fB\-\-timeout\fR option, this
650 command can test whether an OpenFlow switch or controller is up and
651 running.
652 .
653 .TP
654 \fBping \fItarget \fR[\fIn\fR]
655 Sends a series of 10 echo request packets to \fItarget\fR and times
656 each reply. The echo request packets consist of an OpenFlow header
657 plus \fIn\fR bytes (default: 64) of randomly generated payload. This
658 measures the latency of individual requests.
659 .
660 .TP
661 \fBbenchmark \fItarget n count\fR
662 Sends \fIcount\fR echo request packets that each consist of an
663 OpenFlow header plus \fIn\fR bytes of payload and waits for each
664 response. Reports the total time required. This is a measure of the
665 maximum bandwidth to \fItarget\fR for round-trips of \fIn\fR-byte
666 messages.
667 .
668 .SS "Other Commands"
669 .
670 .IP "\fBofp\-parse\fR \fIfile\fR"
671 Reads \fIfile\fR (or \fBstdin\fR if \fIfile\fR is \fB\-\fR) as a
672 series of OpenFlow messages in the binary format used on an OpenFlow
673 connection, and prints them to the console. This can be useful for
674 printing OpenFlow messages captured from a TCP stream.
675 .
676 .IP "\fBofp\-parse\-pcap\fR \fIfile\fR [\fIport\fR...]"
677 Reads \fIfile\fR, which must be in the PCAP format used by network
678 capture tools such as \fBtcpdump\fR or \fBwireshark\fR, extracts all
679 the TCP streams for OpenFlow connections, and prints the OpenFlow
680 messages in those connections in human-readable format on
681 \fBstdout\fR.
682 .IP
683 OpenFlow connections are distinguished by TCP port number.
684 Non-OpenFlow packets are ignored. By default, data on TCP ports 6633
685 and 6653 are considered to be OpenFlow. Specify one or more
686 \fIport\fR arguments to override the default.
687 .IP
688 This command cannot usefully print SSL encrypted traffic. It does not
689 understand IPv6.
690 .
691 .SS "Flow Syntax"
692 .PP
693 Some \fBovs\-ofctl\fR commands accept an argument that describes a flow or
694 flows. Such flow descriptions comprise a series of
695 \fIfield\fB=\fIvalue\fR assignments, separated by commas or white
696 space. (Embedding spaces into a flow description normally requires
697 quoting to prevent the shell from breaking the description into
698 multiple arguments.)
699 .PP
700 Flow descriptions should be in \fBnormal form\fR. This means that a
701 flow may only specify a value for an L3 field if it also specifies a
702 particular L2 protocol, and that a flow may only specify an L4 field
703 if it also specifies particular L2 and L3 protocol types. For
704 example, if the L2 protocol type \fBdl_type\fR is wildcarded, then L3
705 fields \fBnw_src\fR, \fBnw_dst\fR, and \fBnw_proto\fR must also be
706 wildcarded. Similarly, if \fBdl_type\fR or \fBnw_proto\fR (the L3
707 protocol type) is wildcarded, so must be the L4 fields \fBtcp_dst\fR and
708 \fBtcp_src\fR. \fBovs\-ofctl\fR will warn about
709 flows not in normal form.
710 .PP
711 \fBovs\-fields\fR(7) describes the supported fields and how to match
712 them. In addition to match fields, commands that operate on flows
713 accept a few additional key-value pairs:
714 .
715 .IP \fBtable=\fItable\fR
716 For flow dump commands, limits the flows dumped to those in
717 \fItable\fR, which may be expressed as a number between 0 and 255 or
718 (unless \fB\-\-no\-names\fR is specified) a name. If not specified
719 (or if 255 is specified as \fItable\fR), then flows in all tables are
720 dumped.
721 .
722 .IP
723 For flow table modification commands, behavior varies based on the
724 OpenFlow version used to connect to the switch:
725 .
726 .RS
727 .IP "OpenFlow 1.0"
728 OpenFlow 1.0 does not support \fBtable\fR for modifying flows.
729 \fBovs\-ofctl\fR will exit with an error if \fBtable\fR (other than
730 \fBtable=255\fR) is specified for a switch that only supports OpenFlow
731 1.0.
732 .IP
733 In OpenFlow 1.0, the switch chooses the table into which to insert a
734 new flow. The Open vSwitch software switch always chooses table 0.
735 Other Open vSwitch datapaths and other OpenFlow implementations may
736 choose different tables.
737 .IP
738 The OpenFlow 1.0 behavior in Open vSwitch for modifying or removing
739 flows depends on whether \fB\-\-strict\fR is used. Without
740 \fB\-\-strict\fR, the command applies to matching flows in all tables.
741 With \fB\-\-strict\fR, the command will operate on any single matching
742 flow in any table; it will do nothing if there are matches in more
743 than one table. (The distinction between these behaviors only matters
744 if non-OpenFlow 1.0 commands were also used, because OpenFlow 1.0
745 alone cannot add flows with the same matching criteria to multiple
746 tables.)
747 .
748 .IP "OpenFlow 1.0 with table_id extension"
749 Open vSwitch implements an OpenFlow extension that allows the
750 controller to specify the table on which to operate. \fBovs\-ofctl\fR
751 automatically enables the extension when \fBtable\fR is specified and
752 OpenFlow 1.0 is used. \fBovs\-ofctl\fR automatically detects whether
753 the switch supports the extension. As of this writing, this extension
754 is only known to be implemented by Open vSwitch.
755 .
756 .IP
757 With this extension, \fBovs\-ofctl\fR operates on the requested table
758 when \fBtable\fR is specified, and acts as described for OpenFlow 1.0
759 above when no \fBtable\fR is specified (or for \fBtable=255\fR).
760 .
761 .IP "OpenFlow 1.1"
762 OpenFlow 1.1 requires flow table modification commands to specify a
763 table. When \fBtable\fR is not specified (or \fBtable=255\fR is
764 specified), \fBovs\-ofctl\fR defaults to table 0.
765 .
766 .IP "OpenFlow 1.2 and later"
767 OpenFlow 1.2 and later allow flow deletion commands, but not other
768 flow table modification commands, to operate on all flow tables, with
769 the behavior described above for OpenFlow 1.0.
770 .RE
771 .IP "\fBduration=\fR..."
772 .IQ "\fBn_packet=\fR..."
773 .IQ "\fBn_bytes=\fR..."
774 \fBovs\-ofctl\fR ignores assignments to these ``fields'' to allow
775 output from the \fBdump\-flows\fR command to be used as input for
776 other commands that parse flows.
777 .
778 .PP
779 The \fBadd\-flow\fR, \fBadd\-flows\fR, and \fBmod\-flows\fR commands
780 require an additional field, which must be the final field specified:
781 .
782 .IP \fBactions=\fR[\fIaction\fR][\fB,\fIaction\fR...]\fR
783 Specifies a comma-separated list of actions to take on a packet when
784 the flow entry matches. If no \fIaction\fR is specified, then packets
785 matching the flow are dropped. See \fBovs\-actions\fR(7) for details
786 on the syntax and semantics of actions.
787 K
788 .PP
789 An opaque identifier called a cookie can be used as a handle to identify
790 a set of flows:
791 .
792 .IP \fBcookie=\fIvalue\fR
793 .
794 A cookie can be associated with a flow using the \fBadd\-flow\fR,
795 \fBadd\-flows\fR, and \fBmod\-flows\fR commands. \fIvalue\fR can be any
796 64-bit number and need not be unique among flows. If this field is
797 omitted, a default cookie value of 0 is used.
798 .
799 .IP \fBcookie=\fIvalue\fR\fB/\fImask\fR
800 .
801 When using NXM, the cookie can be used as a handle for querying,
802 modifying, and deleting flows. \fIvalue\fR and \fImask\fR may be
803 supplied for the \fBdel\-flows\fR, \fBmod\-flows\fR, \fBdump\-flows\fR, and
804 \fBdump\-aggregate\fR commands to limit matching cookies. A 1-bit in
805 \fImask\fR indicates that the corresponding bit in \fIcookie\fR must
806 match exactly, and a 0-bit wildcards that bit. A mask of \-1 may be used
807 to exactly match a cookie.
808 .IP
809 The \fBmod\-flows\fR command can update the cookies of flows that
810 match a cookie by specifying the \fIcookie\fR field twice (once with a
811 mask for matching and once without to indicate the new value):
812 .RS
813 .IP "\fBovs\-ofctl mod\-flows br0 cookie=1,actions=normal\fR"
814 Change all flows' cookies to 1 and change their actions to \fBnormal\fR.
815 .IP "\fBovs\-ofctl mod\-flows br0 cookie=1/\-1,cookie=2,actions=normal\fR"
816 Update cookies with a value of 1 to 2 and change their actions to
817 \fBnormal\fR.
818 .RE
819 .IP
820 The ability to match on cookies was added in Open vSwitch 1.5.0.
821 .
822 .PP
823 The following additional field sets the priority for flows added by
824 the \fBadd\-flow\fR and \fBadd\-flows\fR commands. For
825 \fBmod\-flows\fR and \fBdel\-flows\fR when \fB\-\-strict\fR is
826 specified, priority must match along with the rest of the flow
827 specification. For \fBmod-flows\fR without \fB\-\-strict\fR,
828 priority is only significant if the command creates a new flow, that
829 is, non-strict \fBmod\-flows\fR does not match on priority and will
830 not change the priority of existing flows. Other commands do not
831 allow priority to be specified.
832 .
833 .IP \fBpriority=\fIvalue\fR
834 The priority at which a wildcarded entry will match in comparison to
835 others. \fIvalue\fR is a number between 0 and 65535, inclusive. A higher
836 \fIvalue\fR will match before a lower one. An exact-match entry will always
837 have priority over an entry containing wildcards, so it has an implicit
838 priority value of 65535. When adding a flow, if the field is not specified,
839 the flow's priority will default to 32768.
840 .IP
841 OpenFlow leaves behavior undefined when two or more flows with the
842 same priority can match a single packet. Some users expect
843 ``sensible'' behavior, such as more specific flows taking precedence
844 over less specific flows, but OpenFlow does not specify this and Open
845 vSwitch does not implement it. Users should therefore take care to
846 use priorities to ensure the behavior that they expect.
847 .
848 .PP
849 The \fBadd\-flow\fR, \fBadd\-flows\fR, and \fBmod\-flows\fR commands
850 support the following additional options. These options affect only
851 new flows. Thus, for \fBadd\-flow\fR and \fBadd\-flows\fR, these
852 options are always significant, but for \fBmod\-flows\fR they are
853 significant only if the command creates a new flow, that is, their
854 values do not update or affect existing flows.
855 .
856 .IP "\fBidle_timeout=\fIseconds\fR"
857 Causes the flow to expire after the given number of seconds of
858 inactivity. A value of 0 (the default) prevents a flow from expiring
859 due to inactivity.
860 .
861 .IP \fBhard_timeout=\fIseconds\fR
862 Causes the flow to expire after the given number of seconds,
863 regardless of activity. A value of 0 (the default) gives the flow no
864 hard expiration deadline.
865 .
866 .IP "\fBimportance=\fIvalue\fR"
867 Sets the importance of a flow. The flow entry eviction mechanism can
868 use importance as a factor in deciding which flow to evict. A value
869 of 0 (the default) makes the flow non-evictable on the basis of
870 importance. Specify a value between 0 and 65535.
871 .IP
872 Only OpenFlow 1.4 and later support \fBimportance\fR.
873 .
874 .IP "\fBsend_flow_rem\fR"
875 Marks the flow with a flag that causes the switch to generate a ``flow
876 removed'' message and send it to interested controllers when the flow
877 later expires or is removed.
878 .
879 .IP "\fBcheck_overlap\fR"
880 Forces the switch to check that the flow match does not overlap that
881 of any different flow with the same priority in the same table. (This
882 check is expensive so it is best to avoid it.)
883 .
884 .IP "\fBreset_counts\fR"
885 When this flag is specified on a flow being added to a switch, and the
886 switch already has a flow with an identical match, an OpenFlow 1.2 (or
887 later) switch resets the flow's packet and byte counters to 0.
888 Without the flag, the packet and byte counters are preserved.
889 .IP
890 OpenFlow 1.0 and 1.1 switches always reset counters in this situation,
891 as if \fBreset_counts\fR were always specified.
892 .IP
893 Open vSwitch 1.10 added support for \fBreset_counts\fR.
894 .
895 .IP "\fBno_packet_counts\fR"
896 .IQ "\fBno_byte_counts\fR"
897 Adding these flags to a flow advises an OpenFlow 1.3 (or later) switch
898 that the controller does not need packet or byte counters,
899 respectively, for the flow. Some switch implementations might achieve
900 higher performance or reduce resource consumption when these flags are
901 used. These flags provide no benefit to the Open vSwitch software
902 switch implementation.
903 .IP
904 OpenFlow 1.2 and earlier do not support these flags.
905 .IP
906 Open vSwitch 1.10 added support for \fBno_packet_counts\fR and
907 \fBno_byte_counts\fR.
908 .
909 .PP
910 The \fBdump\-flows\fR, \fBdump\-aggregate\fR, \fBdel\-flow\fR
911 and \fBdel\-flows\fR commands support these additional optional fields:
912 .
913 .TP
914 \fBout_port=\fIport\fR
915 If set, a matching flow must include an output action to \fIport\fR,
916 which must be an OpenFlow port number or name (e.g. \fBlocal\fR).
917 .
918 .TP
919 \fBout_group=\fIgroup\fR
920 If set, a matching flow must include an \fBgroup\fR action naming
921 \fIgroup\fR, which must be an OpenFlow group number. This field
922 is supported in Open vSwitch 2.5 and later and requires OpenFlow 1.1
923 or later.
924 .
925 .SS "Table Entry Output"
926 .
927 The \fBdump\-tables\fR and \fBdump\-aggregate\fR commands print information
928 about the entries in a datapath's tables. Each line of output is a
929 flow entry as described in \fBFlow Syntax\fR, above, plus some
930 additional fields:
931 .
932 .IP \fBduration=\fIsecs\fR
933 The time, in seconds, that the entry has been in the table.
934 \fIsecs\fR includes as much precision as the switch provides, possibly
935 to nanosecond resolution.
936 .
937 .IP \fBn_packets\fR
938 The number of packets that have matched the entry.
939 .
940 .IP \fBn_bytes\fR
941 The total number of bytes from packets that have matched the entry.
942 .
943 .PP
944 The following additional fields are included only if the switch is
945 Open vSwitch 1.6 or later and the NXM flow format is used to dump the
946 flow (see the description of the \fB\-\-flow-format\fR option below).
947 The values of these additional fields are approximations only and in
948 particular \fBidle_age\fR will sometimes become nonzero even for busy
949 flows.
950 .
951 .IP \fBhard_age=\fIsecs\fR
952 The integer number of seconds since the flow was added or modified.
953 \fBhard_age\fR is displayed only if it differs from the integer part
954 of \fBduration\fR. (This is separate from \fBduration\fR because
955 \fBmod\-flows\fR restarts the \fBhard_timeout\fR timer without zeroing
956 \fBduration\fR.)
957 .
958 .IP \fBidle_age=\fIsecs\fR
959 The integer number of seconds that have passed without any packets
960 passing through the flow.
961 .
962 .SS "Packet\-Out Syntax"
963 .PP
964 \fBovs\-ofctl bundle\fR command accepts packet-outs to be specified in
965 the bundle file. Each packet-out comprises of a series of
966 \fIfield\fB=\fIvalue\fR assignments, separated by commas or white
967 space. (Embedding spaces into a packet-out description normally
968 requires quoting to prevent the shell from breaking the description
969 into multiple arguments.). Unless noted otherwise only the last
970 instance of each field is honoured. This same syntax is also
971 supported by the \fBovs\-ofctl packet-out\fR command.
972 .PP
973 .IP \fBin_port=\fIport\fR
974 The port number to be considered the in_port when processing actions.
975 This can be any valid OpenFlow port number, or any of the \fBLOCAL\fR,
976 \fBCONTROLLER\fR, or \fBNONE\fR.
977 .
978 This field is required.
979
980 .IP \fIpipeline_field\fR=\fIvalue\fR
981 Optionally, user can specify a list of pipeline fields for a packet-out
982 message. The supported pipeline fields includes \fBtunnel fields\fR and
983 \fBregister fields\fR as defined in \fBovs\-fields\fR(7).
984
985 .IP \fBpacket=\fIhex-string\fR
986 The actual packet to send, expressed as a string of hexadecimal bytes.
987 .
988 This field is required.
989
990 .IP \fBactions=\fR[\fIaction\fR][\fB,\fIaction\fR...]\fR
991 The syntax of actions are identical to the \fBactions=\fR field
992 described in \fBFlow Syntax\fR above. Specifying \fBactions=\fR is
993 optional, but omitting actions is interpreted as a drop, so the packet
994 will not be sent anywhere from the switch.
995 .
996 \fBactions\fR must be specified at the end of each line, like for flow mods.
997 .RE
998 .
999 .SS "Group Syntax"
1000 .PP
1001 Some \fBovs\-ofctl\fR commands accept an argument that describes a group or
1002 groups. Such flow descriptions comprise a series
1003 \fIfield\fB=\fIvalue\fR assignments, separated by commas or white
1004 space. (Embedding spaces into a group description normally requires
1005 quoting to prevent the shell from breaking the description into
1006 multiple arguments.). Unless noted otherwise only the last instance
1007 of each field is honoured.
1008 .PP
1009 .IP \fBgroup_id=\fIid\fR
1010 The integer group id of group.
1011 When this field is specified in \fBdel\-groups\fR or \fBdump\-groups\fR,
1012 the keyword "all" may be used to designate all groups.
1013 .
1014 This field is required.
1015
1016
1017 .IP \fBtype=\fItype\fR
1018 The type of the group. The \fBadd-group\fR, \fBadd-groups\fR and
1019 \fBmod-groups\fR commands require this field. It is prohibited for
1020 other commands. The following keywords designated the allowed types:
1021 .RS
1022 .IP \fBall\fR
1023 Execute all buckets in the group.
1024 .IP \fBselect\fR
1025 Execute one bucket in the group, balancing across the buckets
1026 according to their weights. To select a bucket, for each live bucket,
1027 Open vSwitch hashes flow data with the bucket ID and multiplies by the
1028 bucket weight to obtain a ``score,'' and then selects the bucket with
1029 the highest score. Use \fBselection_method\fR to control the flow
1030 data used for selection.
1031 .IP \fBindirect\fR
1032 Executes the one bucket in the group.
1033 .IP \fBff\fR
1034 .IQ \fBfast_failover\fR
1035 Executes the first live bucket in the group which is associated with
1036 a live port or group.
1037 .RE
1038
1039 .IP \fBcommand_bucket_id=\fIid\fR
1040 The bucket to operate on. The \fBinsert-buckets\fR and \fBremove-buckets\fR
1041 commands require this field. It is prohibited for other commands.
1042 \fIid\fR may be an integer or one of the following keywords:
1043 .RS
1044 .IP \fBall\fR
1045 Operate on all buckets in the group.
1046 Only valid when used with the \fBremove-buckets\fR command in which
1047 case the effect is to remove all buckets from the group.
1048 .IP \fBfirst\fR
1049 Operate on the first bucket present in the group.
1050 In the case of the \fBinsert-buckets\fR command the effect is to
1051 insert new bucets just before the first bucket already present in the group;
1052 or to replace the buckets of the group if there are no buckets already present
1053 in the group.
1054 In the case of the \fBremove-buckets\fR command the effect is to
1055 remove the first bucket of the group; or do nothing if there are no
1056 buckets present in the group.
1057 .IP \fBlast\fR
1058 Operate on the last bucket present in the group.
1059 In the case of the \fBinsert-buckets\fR command the effect is to
1060 insert new bucets just after the last bucket already present in the group;
1061 or to replace the buckets of the group if there are no buckets already present
1062 in the group.
1063 In the case of the \fBremove-buckets\fR command the effect is to
1064 remove the last bucket of the group; or do nothing if there are no
1065 buckets present in the group.
1066 .RE
1067 .IP
1068 If \fIid\fR is an integer then it should correspond to the \fBbucket_id\fR
1069 of a bucket present in the group.
1070 In case of the \fBinsert-buckets\fR command the effect is to
1071 insert buckets just before the bucket in the group whose \fBbucket_id\fR is
1072 \fIid\fR.
1073 In case of the \fBiremove-buckets\fR command the effect is to
1074 remove the in the group whose \fBbucket_id\fR is \fIid\fR.
1075 It is an error if there is no bucket persent group in whose \fBbucket_id\fR is
1076 \fIid\fR.
1077
1078 .IP \fBselection_method\fR=\fImethod\fR
1079 The selection method used to select a bucket for a select group.
1080 This is a string of 1 to 15 bytes in length known to lower layers.
1081 This field is optional for \fBadd\-group\fR, \fBadd\-groups\fR and
1082 \fBmod\-group\fR commands on groups of type \fBselect\fR. Prohibited
1083 otherwise. If no selection method is specified, Open vSwitch up to
1084 release 2.9 applies the \fBhash\fR method with default fields. From
1085 2.10 onwards Open vSwitch defaults to the \fBdp_hash\fR method with symmetric
1086 L3/L4 hash algorithm, unless the weighted group buckets cannot be mapped to
1087 a maximum of 64 dp_hash values with sufficient accuracy.
1088 In those rare cases Open vSwitch 2.10 and later fall back to the \fBhash\fR
1089 method with the default set of hash fields.
1090 .RS
1091 .IP \fBdp_hash\fR
1092 Use a datapath computed hash value. The hash algorithm varies accross
1093 different datapath implementations. \fBdp_hash\fR uses the upper 32
1094 bits of the \fBselection_method_param\fR as the datapath hash
1095 algorithm selector. The supported values are \fB0\fR (corresponding to
1096 hash computation over the IP 5-tuple) and \fB1\fR (corresponding to a
1097 \fIsymmetric\fR hash computation over the IP 5-tuple). Selecting specific
1098 fields with the \fBfields\fR option is not supported with \fBdp_hash\fR).
1099 The lower 32 bits are used as the hash basis.
1100 .IP
1101 Using \fBdp_hash\fR has the advantage that it does not require the
1102 generated datapath flows to exact match any additional packet header
1103 fields. For example, even if multiple TCP connections thus hashed to
1104 different select group buckets have different source port numbers,
1105 generally all of them would be handled with a small set of already
1106 established datapath flows, resulting in less latency for TCP SYN
1107 packets. The downside is that the shared datapath flows must match
1108 each packet twice, as the datapath hash value calculation happens only
1109 when needed, and a second match is required to match some bits of its
1110 value. This double-matching incurs a small additional latency cost
1111 for each packet, but this latency is orders of magnitude less than the
1112 latency of creating new datapath flows for new TCP connections.
1113 .IP \fBhash\fR
1114 Use a hash computed over the fields specified with the \fBfields\fR
1115 option, see below. If no hash fields are specified, \fBhash\fR defaults
1116 to a symmetric hash over the combination of MAC addresses, VLAN tags,
1117 Ether type, IP addresses and L4 port numbers. \fBhash\fR uses the
1118 \fBselection_method_param\fR as the hash basis.
1119 .IP
1120 Note that the hashed fields become exact matched by the datapath
1121 flows. For example, if the TCP source port is hashed, the created
1122 datapath flows will match the specific TCP source port value present
1123 in the packet received. Since each TCP connection generally has a
1124 different source port value, a separate datapath flow will be need to
1125 be inserted for each TCP connection thus hashed to a select group
1126 bucket.
1127 .RE
1128 .IP
1129 This option uses a Netronome OpenFlow extension which is only supported
1130 when using Open vSwitch 2.4 and later with OpenFlow 1.5 and later.
1131
1132 .IP \fBselection_method_param\fR=\fIparam\fR
1133 64-bit integer parameter to the selection method selected by the
1134 \fBselection_method\fR field. The parameter's use is defined by the
1135 lower-layer that implements the \fBselection_method\fR. It is optional if
1136 the \fBselection_method\fR field is specified as a non-empty string.
1137 Prohibited otherwise. The default value is zero.
1138 .IP
1139 This option uses a Netronome OpenFlow extension which is only supported
1140 when using Open vSwitch 2.4 and later with OpenFlow 1.5 and later.
1141
1142 .IP \fBfields\fR=\fIfield\fR
1143 .IQ \fBfields(\fIfield\fR[\fB=\fImask\fR]\fR...\fB)\fR
1144 The field parameters to selection method selected by the
1145 \fBselection_method\fR field. The syntax is described in \fBFlow
1146 Syntax\fR with the additional restrictions that if a value is provided
1147 it is treated as a wildcard mask and wildcard masks following a slash
1148 are prohibited. The pre-requisites of fields must be provided by any
1149 flows that output to the group. The use of the fields is defined by
1150 the lower-layer that implements the \fBselection_method\fR. They are
1151 optional if the \fBselection_method\fR field is specified as ``hash',
1152 prohibited otherwise. The default is no fields.
1153 .IP
1154 This option will use a Netronome OpenFlow extension which is only supported
1155 when using Open vSwitch 2.4 and later with OpenFlow 1.5 and later.
1156
1157 .IP \fBbucket\fR=\fIbucket_parameters\fR
1158 The \fBadd-group\fR, \fBadd-groups\fR and \fBmod-group\fR commands
1159 require at least one bucket field. Bucket fields must appear after
1160 all other fields.
1161 .
1162 Multiple bucket fields to specify multiple buckets.
1163 The order in which buckets are specified corresponds to their order in
1164 the group. If the type of the group is "indirect" then only one group may
1165 be specified.
1166 .
1167 \fIbucket_parameters\fR consists of a list of \fIfield\fB=\fIvalue\fR
1168 assignments, separated by commas or white space followed by a
1169 comma-separated list of actions.
1170 The fields for \fIbucket_parameters\fR are:
1171 .
1172 .RS
1173 .IP \fBbucket_id=\fIid\fR
1174 The 32-bit integer group id of the bucket. Values greater than
1175 0xffffff00 are reserved.
1176 .
1177 This field was added in Open vSwitch 2.4 to conform with the OpenFlow
1178 1.5 specification. It is not supported when earlier versions
1179 of OpenFlow are used. Open vSwitch will automatically allocate bucket
1180 ids when they are not specified.
1181 .IP \fBactions=\fR[\fIaction\fR][\fB,\fIaction\fR...]\fR
1182 The syntax of actions are identical to the \fBactions=\fR field described in
1183 \fBFlow Syntax\fR above. Specifying \fBactions=\fR is optional, any unknown
1184 bucket parameter will be interpreted as an action.
1185 .IP \fBweight=\fIvalue\fR
1186 The relative weight of the bucket as an integer. This may be used by the switch
1187 during bucket select for groups whose \fBtype\fR is \fBselect\fR.
1188 .IP \fBwatch_port=\fIport\fR
1189 Port used to determine liveness of group.
1190 This or the \fBwatch_group\fR field is required
1191 for groups whose \fBtype\fR is \fBff\fR or \fBfast_failover\fR.
1192 This or the \fBwatch_group\fR field can also be used
1193 for groups whose \fBtype\fR is \fBselect\fR.
1194 .IP \fBwatch_group=\fIgroup_id\fR
1195 Group identifier of group used to determine liveness of group.
1196 This or the \fBwatch_port\fR field is required
1197 for groups whose \fBtype\fR is \fBff\fR or \fBfast_failover\fR.
1198 This or the \fBwatch_port\fR field can also be used
1199 for groups whose \fBtype\fR is \fBselect\fR.
1200 .RE
1201 .
1202 .SS "Meter Syntax"
1203 .PP
1204 The meter table commands accept an argument that describes a meter.
1205 Such meter descriptions comprise a series \fIfield\fB=\fIvalue\fR
1206 assignments, separated by commas or white space.
1207 (Embedding spaces into a group description normally requires
1208 quoting to prevent the shell from breaking the description into
1209 multiple arguments.). Unless noted otherwise only the last instance
1210 of each field is honoured.
1211 .PP
1212 .IP \fBmeter=\fIid\fR
1213 The identifier for the meter. An integer is used to specify a
1214 user-defined meter. In addition, the keywords "all", "controller", and
1215 "slowpath", are also supported as virtual meters. The "controller" and
1216 "slowpath" virtual meters apply to packets sent to the controller and to
1217 the OVS userspace, respectively.
1218 .IP
1219 When this field is specified in \fBdel-meter\fR, \fBdump-meter\fR, or
1220 \fBmeter-stats\fR, the keyword "all" may be used to designate all
1221 meters. This field is required, except for \fBmeter-stats\fR, which
1222 dumps all stats when this field is not specified.
1223 .IP \fBkbps\fR
1224 .IQ \fBpktps\fR
1225 The unit for the \fBrate\fR and \fBburst_size\fR band parameters.
1226 \fBkbps\fR specifies kilobits per second, and \fBpktps\fR specifies
1227 packets per second. A unit is required for the \fBadd-meter\fR and
1228 \fBmod-meter\fR commands.
1229
1230 .IP \fBburst\fR
1231 If set, enables burst support for meter bands through the \fBburst_size\fR
1232 parameter.
1233
1234 .IP \fBstats\fR
1235 If set, enables the collection of meter and band statistics.
1236
1237 .IP \fBbands\fR=\fIband_parameters\fR
1238 The \fBadd-meter\fR and \fBmod-meter\fR commands require at least one
1239 band specification. Bands must appear after all other fields.
1240 .RS
1241 .IP \fBtype=\fItype\fR
1242 The type of the meter band. This keyword starts a new band specification.
1243 Each band specifies a rate above which the band is to take some action. The
1244 action depends on the band type. If multiple bands' rate is exceeded, then
1245 the band with the highest rate among the exceeded bands is selected.
1246 The following keywords designate the allowed
1247 meter band types:
1248 .RS
1249 .IP \fBdrop\fR
1250 Drop packets exceeding the band's rate limit.
1251 .RE
1252 .
1253 .IP "The other \fIband_parameters\fR are:"
1254 .IP \fBrate=\fIvalue\fR
1255 The relative rate limit for this band, in kilobits per second or packets per
1256 second, depending on whether \fBkbps\fR or \fBpktps\fR was specified.
1257 .IP \fBburst_size=\fIsize\fR
1258 If \fBburst\fR is specified for the meter entry, configures the maximum
1259 burst allowed for the band in kilobits or packets, depending on whether
1260 \fBkbps\fR or \fBpktps\fR was specified. If unspecified, the switch is
1261 free to select some reasonable value depending on its configuration.
1262 .RE
1263 .
1264 .SH OPTIONS
1265 .TP
1266 \fB\-\-strict\fR
1267 Uses strict matching when running flow modification commands.
1268 .
1269 .IP "\fB\-\-names\fR"
1270 .IQ "\fB\-\-no\-names\fR"
1271 Every OpenFlow port has a name and a number, and every OpenFlow flow
1272 table has a number and sometimes a name. By default, \fBovs\-ofctl\fR
1273 commands accept both port and table names and numbers, and they
1274 display port and table names if \fBovs\-ofctl\fR is running on an
1275 interactive console, numbers otherwise. With \fB\-\-names\fR,
1276 \fBovs\-ofctl\fR commands both accept and display port and table
1277 names; with \fB\-\-no\-names\fR, commands neither accept nor display
1278 port and table names.
1279 .IP
1280 If a port or table name contains special characters or might be
1281 confused with a keyword within a flow, it may be enclosed in double
1282 quotes (escaped from the shell). If necessary, JSON-style escape
1283 sequences may be used inside quotes, as specified in RFC 7159. When
1284 it displays port and table names, \fBovs\-ofctl\fR quotes any name
1285 that does not start with a letter followed by letters or digits.
1286 .IP
1287 Open vSwitch added support for port names and these options. Open
1288 vSwitch 2.10 added support for table names. Earlier versions always
1289 behaved as if \fB\-\-no\-names\fR were specified.
1290 .IP
1291 Open vSwitch does not place its own limit on the length of port names,
1292 but OpenFlow limits port names to 15 bytes.
1293 Because \fRovs\-ofctl\fR uses OpenFlow to
1294 retrieve the mapping between port names and numbers, names longer than
1295 this limit will be truncated for both display and acceptance.
1296 Truncation can also cause long names that are different to appear to
1297 be the same; when a switch has two ports with the same (truncated)
1298 name, \fBovs\-ofctl\fR refuses to display or accept the name, using
1299 the number instead.
1300 .IP
1301 OpenFlow and Open vSwitch limit table names to 32 bytes.
1302 .
1303 .IP "\fB\-\-stats\fR"
1304 .IQ "\fB\-\-no\-stats\fR"
1305 The \fBdump\-flows\fR command by default, or with \fB\-\-stats\fR,
1306 includes flow duration, packet and byte counts, and idle and hard age
1307 in its output. With \fB\-\-no\-stats\fR, it omits all of these, as
1308 well as cookie values and table IDs if they are zero.
1309 .
1310 .IP "\fB\-\-read-only\fR"
1311 Do not execute read/write commands.
1312 .
1313 .IP "\fB\-\-bundle\fR"
1314 Execute flow mods as an OpenFlow 1.4 atomic bundle transaction.
1315 .RS
1316 .IP \(bu
1317 Within a bundle, all flow mods are processed in the order they appear
1318 and as a single atomic transaction, meaning that if one of them fails,
1319 the whole transaction fails and none of the changes are made to the
1320 \fIswitch\fR's flow table, and that each given datapath packet
1321 traversing the OpenFlow tables sees the flow tables either as before
1322 the transaction, or after all the flow mods in the bundle have been
1323 successfully applied.
1324 .IP \(bu
1325 The beginning and the end of the flow table modification commands in a
1326 bundle are delimited with OpenFlow 1.4 bundle control messages, which
1327 makes it possible to stream the included commands without explicit
1328 OpenFlow barriers, which are otherwise used after each flow table
1329 modification command. This may make large modifications execute
1330 faster as a bundle.
1331 .IP \(bu
1332 Bundles require OpenFlow 1.4 or higher. An explicit \fB-O
1333 OpenFlow14\fR option is not needed, but you may need to enable
1334 OpenFlow 1.4 support for OVS by setting the OVSDB \fIprotocols\fR
1335 column in the \fIbridge\fR table.
1336 .RE
1337 .
1338 .so lib/ofp-version.man
1339 .
1340 .IP "\fB\-F \fIformat\fR[\fB,\fIformat\fR...]"
1341 .IQ "\fB\-\-flow\-format=\fIformat\fR[\fB,\fIformat\fR...]"
1342 \fBovs\-ofctl\fR supports the following individual flow formats, any
1343 number of which may be listed as \fIformat\fR:
1344 .RS
1345 .IP "\fBOpenFlow10\-table_id\fR"
1346 This is the standard OpenFlow 1.0 flow format. All OpenFlow switches
1347 and all versions of Open vSwitch support this flow format.
1348 .
1349 .IP "\fBOpenFlow10+table_id\fR"
1350 This is the standard OpenFlow 1.0 flow format plus a Nicira extension
1351 that allows \fBovs\-ofctl\fR to specify the flow table in which a
1352 particular flow should be placed. Open vSwitch 1.2 and later supports
1353 this flow format.
1354 .
1355 .IP "\fBNXM\-table_id\fR (Nicira Extended Match)"
1356 This Nicira extension to OpenFlow is flexible and extensible. It
1357 supports all of the Nicira flow extensions, such as \fBtun_id\fR and
1358 registers. Open vSwitch 1.1 and later supports this flow format.
1359 .
1360 .IP "\fBNXM+table_id\fR (Nicira Extended Match)"
1361 This combines Nicira Extended match with the ability to place a flow
1362 in a specific table. Open vSwitch 1.2 and later supports this flow
1363 format.
1364 .
1365 .IP "\fBOXM-OpenFlow12\fR"
1366 .IQ "\fBOXM-OpenFlow13\fR"
1367 .IQ "\fBOXM-OpenFlow14\fR"
1368 .IQ "\fBOXM-OpenFlow15\fR"
1369 These are the standard OXM (OpenFlow Extensible Match) flow format in
1370 OpenFlow 1.2 and later.
1371 .RE
1372 .
1373 .IP
1374 \fBovs\-ofctl\fR also supports the following abbreviations for
1375 collections of flow formats:
1376 .RS
1377 .IP "\fBany\fR"
1378 Any supported flow format.
1379 .IP "\fBOpenFlow10\fR"
1380 \fBOpenFlow10\-table_id\fR or \fBOpenFlow10+table_id\fR.
1381 .IP "\fBNXM\fR"
1382 \fBNXM\-table_id\fR or \fBNXM+table_id\fR.
1383 .IP "\fBOXM\fR"
1384 \fBOXM-OpenFlow12\fR, \fBOXM-OpenFlow13\fR, or \fBOXM-OpenFlow14\fR.
1385 .RE
1386 .
1387 .IP
1388 For commands that modify the flow table, \fBovs\-ofctl\fR by default
1389 negotiates the most widely supported flow format that supports the
1390 flows being added. For commands that query the flow table,
1391 \fBovs\-ofctl\fR by default uses the most advanced format supported by
1392 the switch.
1393 .IP
1394 This option, where \fIformat\fR is a comma-separated list of one or
1395 more of the formats listed above, limits \fBovs\-ofctl\fR's choice of
1396 flow format. If a command cannot work as requested using one of the
1397 specified flow formats, \fBovs\-ofctl\fR will report a fatal error.
1398 .
1399 .IP "\fB\-P \fIformat\fR"
1400 .IQ "\fB\-\-packet\-in\-format=\fIformat\fR"
1401 \fBovs\-ofctl\fR supports the following ``packet-in'' formats, in order of
1402 increasing capability:
1403 .RS
1404 .IP "\fBstandard\fR"
1405 This uses the \fBOFPT_PACKET_IN\fR message, the standard ``packet-in''
1406 message for any given OpenFlow version. Every OpenFlow switch that
1407 supports a given OpenFlow version supports this format.
1408 .
1409 .IP "\fBnxt_packet_in\fR"
1410 This uses the \fBNXT_PACKET_IN\fR message, which adds many of the
1411 capabilities of the OpenFlow 1.1 and later ``packet-in'' messages
1412 before those OpenFlow versions were available in Open vSwitch. Open
1413 vSwitch 1.1 and later support this format. Only Open vSwitch 2.6 and
1414 later, however, support it for OpenFlow 1.1 and later (but there is
1415 little reason to use it with those versions of OpenFlow).
1416 .
1417 .IP "\fBnxt_packet_in2\fR"
1418 This uses the \fBNXT_PACKET_IN2\fR message, which is extensible and
1419 should avoid the need to define new formats later. In particular,
1420 this format supports passing arbitrary user-provided data to a
1421 controller using the \fBuserdata\fB option on the \fBcontroller\fR
1422 action. Open vSwitch 2.6 and later support this format.
1423 .
1424 .RE
1425 .IP
1426 Without this option, \fBovs\-ofctl\fR prefers \fBnxt_packet_in2\fR if
1427 the switch supports it. Otherwise, if OpenFlow 1.0 is in use,
1428 \fBovs\-ofctl\fR prefers \fBnxt_packet_in\fR if the switch supports
1429 it. Otherwise, \fBovs\-ofctl\fR falls back to the \fBstandard\fR
1430 packet-in format. When this option is specified, \fBovs\-ofctl\fR
1431 insists on the selected format. If the switch does not support the
1432 requested format, \fBovs\-ofctl\fR will report a fatal error.
1433 .IP
1434 Before version 2.6, Open vSwitch called \fBstandard\fR format
1435 \fBopenflow10\fR and \fBnxt_packet_in\fR format \fBnxm\fR, and
1436 \fBovs\-ofctl\fR still accepts these names as synonyms. (The name
1437 \fBopenflow10\fR was a misnomer because this format actually varies
1438 from one OpenFlow version to another; it is not consistently OpenFlow
1439 1.0 format. Similarly, when \fBnxt_packet_in2\fR was introduced, the
1440 name \fBnxm\fR became confusing because it also uses OXM/NXM.)
1441 .
1442 .IP
1443 This option affects only the \fBmonitor\fR command.
1444 .
1445 .IP "\fB\-\-timestamp\fR"
1446 Print a timestamp before each received packet. This option only
1447 affects the \fBmonitor\fR, \fBsnoop\fR, and \fBofp\-parse\-pcap\fR
1448 commands.
1449 .
1450 .IP "\fB\-m\fR"
1451 .IQ "\fB\-\-more\fR"
1452 Increases the verbosity of OpenFlow messages printed and logged by
1453 \fBovs\-ofctl\fR commands. Specify this option more than once to
1454 increase verbosity further.
1455 .
1456 .IP \fB\-\-sort\fR[\fB=\fIfield\fR]
1457 .IQ \fB\-\-rsort\fR[\fB=\fIfield\fR]
1458 Display output sorted by flow \fIfield\fR in ascending
1459 (\fB\-\-sort\fR) or descending (\fB\-\-rsort\fR) order, where
1460 \fIfield\fR is any of the fields that are allowed for matching or
1461 \fBpriority\fR to sort by priority. When \fIfield\fR is omitted, the
1462 output is sorted by priority. Specify these options multiple times to
1463 sort by multiple fields.
1464 .IP
1465 Any given flow will not necessarily specify a value for a given
1466 field. This requires special treatement:
1467 .RS
1468 .IP \(bu
1469 A flow that does not specify any part of a field that is used for sorting is
1470 sorted after all the flows that do specify the field. For example,
1471 \fB\-\-sort=tcp_src\fR will sort all the flows that specify a TCP
1472 source port in ascending order, followed by the flows that do not
1473 specify a TCP source port at all.
1474 .IP \(bu
1475 A flow that only specifies some bits in a field is sorted as if the
1476 wildcarded bits were zero. For example, \fB\-\-sort=nw_src\fR would
1477 sort a flow that specifies \fBnw_src=192.168.0.0/24\fR the same as
1478 \fBnw_src=192.168.0.0\fR.
1479 .RE
1480 .IP
1481 These options currently affect only \fBdump\-flows\fR output.
1482 .
1483 .SS "Daemon Options"
1484 .ds DD \
1485 \fBovs\-ofctl\fR detaches only when executing the \fBmonitor\fR or \
1486 \fBsnoop\fR commands.
1487 .so lib/daemon.man
1488 .so lib/unixctl.man
1489 .SS "Public Key Infrastructure Options"
1490 .so lib/ssl.man
1491 .so lib/vlog.man
1492 .so lib/colors.man
1493 .so lib/common.man
1494 .
1495 .SH "RUNTIME MANAGEMENT COMMANDS"
1496 \fBovs\-appctl\fR(8) can send commands to a running \fBovs\-ofctl\fR
1497 process. The supported commands are listed below.
1498 .
1499 .IP "\fBexit\fR"
1500 Causes \fBovs\-ofctl\fR to gracefully terminate. This command applies
1501 only when executing the \fBmonitor\fR or \fBsnoop\fR commands.
1502 .
1503 .IP "\fBofctl/set\-output\-file \fIfile\fR"
1504 Causes all subsequent output to go to \fIfile\fR instead of stderr.
1505 This command applies only when executing the \fBmonitor\fR or
1506 \fBsnoop\fR commands.
1507 .
1508 .IP "\fBofctl/send \fIofmsg\fR..."
1509 Sends each \fIofmsg\fR, specified as a sequence of hex digits that
1510 express an OpenFlow message, on the OpenFlow connection. This command
1511 is useful only when executing the \fBmonitor\fR command.
1512 .
1513 .IP "\fBofctl/packet\-out \fIpacket-out\fR"
1514 Sends an OpenFlow PACKET_OUT message specified in \fBPacket\-Out
1515 Syntax\fR, on the OpenFlow connection. See \fBPacket\-Out Syntax\fR
1516 section for more information. This command is useful only when
1517 executing the \fBmonitor\fR command.
1518 .
1519 .IP "\fBofctl/barrier\fR"
1520 Sends an OpenFlow barrier request on the OpenFlow connection and waits
1521 for a reply. This command is useful only for the \fBmonitor\fR
1522 command.
1523 .
1524 .SH EXAMPLES
1525 .
1526 The following examples assume that \fBovs\-vswitchd\fR has a bridge
1527 named \fBbr0\fR configured.
1528 .
1529 .TP
1530 \fBovs\-ofctl dump\-tables br0\fR
1531 Prints out the switch's table stats. (This is more interesting after
1532 some traffic has passed through.)
1533 .
1534 .TP
1535 \fBovs\-ofctl dump\-flows br0\fR
1536 Prints the flow entries in the switch.
1537 .
1538 .TP
1539 \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
1540 \fBovs\-ofctl add\-flow table=1 priority=0 actions=flood\fR
1541 Implements a level 2 MAC learning switch using the learn.
1542 .
1543 .TP
1544 \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
1545 In this use of a learn action, the first packet from each source MAC
1546 will be sent to port 2. Subsequent packets will be output to port 3,
1547 with an idle timeout of 10 seconds. NXM field names and match field
1548 names are both accepted, e.g. \fBNXM_NX_REG0\fR or \fBreg0\fR for the
1549 first register, and empty brackets may be omitted.
1550 .IP
1551 Additional examples may be found documented as part of related sections.
1552 .
1553 .SH "SEE ALSO"
1554 .
1555 .BR ovs\-fields (7),
1556 .BR ovs\-actions (7),
1557 .BR ovs\-appctl (8),
1558 .BR ovs\-vswitchd (8),
1559 .BR ovs\-vswitchd.conf.db (8)