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