]> git.proxmox.com Git - ovs.git/blame - utilities/ovs-ofctl.8.in
Fix renaming: libopenvswitch-2.14.so.0.0.90 -> libopenvswitch-2.15.so.0.0.0
[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 564traffic to and from a single controller is output. If none of the
807152a4 565controllers is configured as a primary or a secondary (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
807152a4
BP
568them. If there is a primary controller, it is chosen; otherwise, if
569there are any controllers that are not primaries or secondaries, one is
570chosen arbitrarily; otherwise, a secondary controller is chosen
e2bfacb6
BP
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 580messages received. Usually, \fIswitch\fR should specify the name of a
3e613cd8
AV
581bridge in the \fBovs\-vswitchd\fR database. This is available only in
582OpenFlow 1.0 as Nicira extension.
a9b4a41a 583.IP
064af421
BP
584If \fImiss-len\fR is provided, \fBovs\-ofctl\fR sends an OpenFlow ``set
585configuration'' message at connection setup time that requests
0caf6bde
BP
586\fImiss-len\fR bytes of each packet that misses the flow table. Open vSwitch
587does not send these and other asynchronous messages to an
064af421 588\fBovs\-ofctl monitor\fR client connection unless a nonzero value is
0caf6bde
BP
589specified on this argument. (Thus, if \fImiss\-len\fR is not
590specified, very little traffic will ordinarily be printed.)
a9b4a41a 591.IP
f0fd1a17
PS
592If \fBinvalid_ttl\fR is passed, \fBovs\-ofctl\fR sends an OpenFlow ``set
593configuration'' message at connection setup time that requests
5484c47a
BP
594\fBINVALID_TTL_TO_CONTROLLER\fR, so that \fBovs\-ofctl monitor\fR can
595receive ``packet-in'' messages when TTL reaches zero on \fBdec_ttl\fR action.
ad99e2ed
BP
596Only OpenFlow 1.1 and 1.2 support \fBinvalid_ttl\fR; Open vSwitch also
597implements it for OpenFlow 1.0 as an extension.
f0fd1a17 598.IP
2b07c8b1
BP
599\fBwatch:\fR[\fB\fIspec\fR...] causes \fBovs\-ofctl\fR to send a
600``monitor request'' Nicira extension message to the switch at
601connection setup time. This message causes the switch to send
602information about flow table changes as they occur. The following
603comma-separated \fIspec\fR syntax is available:
604.RS
605.IP "\fB!initial\fR"
606Do not report the switch's initial flow table contents.
607.IP "\fB!add\fR"
608Do not report newly added flows.
609.IP "\fB!delete\fR"
610Do not report deleted flows.
611.IP "\fB!modify\fR"
612Do not report modifications to existing flows.
613.IP "\fB!own\fR"
614Abbreviate changes made to the flow table by \fBovs\-ofctl\fR's own
615connection to the switch. (These could only occur using the
616\fBofctl/send\fR command described below under \fBRUNTIME MANAGEMENT
617COMMANDS\fR.)
618.IP "\fB!actions\fR"
619Do not report actions as part of flow updates.
4bc938cc
BP
620.IP "\fBtable=\fItable\fR"
621Limits the monitoring to the table with the given \fItable\fR, which
622may 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
624monitored.
2b07c8b1 625.IP "\fBout_port=\fIport\fR"
c6100d92
BP
626If 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).
2b07c8b1
BP
629.IP "\fIfield\fB=\fIvalue\fR"
630Monitors only flows that have \fIfield\fR specified as the given
631\fIvalue\fR. Any syntax valid for matching on \fBdump\-flows\fR may
632be used.
633.RE
634.IP
064af421 635This command may be useful for debugging switch or controller
2b07c8b1
BP
636implementations. With \fBwatch:\fR, it is particularly useful for
637observing how a controller updates flow tables.
a9b4a41a 638.
064af421 639.SS "OpenFlow Switch and Controller Commands"
a9b4a41a 640.
064af421
BP
641The following commands, like those in the previous section, may be
642applied to OpenFlow switches, using any of the connection methods
643described in that section. Unlike those commands, these may also be
644applied to OpenFlow controllers.
a9b4a41a 645.
064af421
BP
646.TP
647\fBprobe \fItarget\fR
648Sends a single OpenFlow echo-request message to \fItarget\fR and waits
4e312e69 649for the response. With the \fB\-t\fR or \fB\-\-timeout\fR option, this
064af421
BP
650command can test whether an OpenFlow switch or controller is up and
651running.
a9b4a41a 652.
064af421
BP
653.TP
654\fBping \fItarget \fR[\fIn\fR]
655Sends a series of 10 echo request packets to \fItarget\fR and times
656each reply. The echo request packets consist of an OpenFlow header
657plus \fIn\fR bytes (default: 64) of randomly generated payload. This
658measures the latency of individual requests.
a9b4a41a 659.
064af421
BP
660.TP
661\fBbenchmark \fItarget n count\fR
662Sends \fIcount\fR echo request packets that each consist of an
663OpenFlow header plus \fIn\fR bytes of payload and waits for each
664response. Reports the total time required. This is a measure of the
665maximum bandwidth to \fItarget\fR for round-trips of \fIn\fR-byte
666messages.
a9b4a41a 667.
1ac0e975
BP
668.SS "Other Commands"
669.
670.IP "\fBofp\-parse\fR \fIfile\fR"
671Reads \fIfile\fR (or \fBstdin\fR if \fIfile\fR is \fB\-\fR) as a
672series of OpenFlow messages in the binary format used on an OpenFlow
673connection, and prints them to the console. This can be useful for
674printing OpenFlow messages captured from a TCP stream.
675.
f3dd1419
BP
676.IP "\fBofp\-parse\-pcap\fR \fIfile\fR [\fIport\fR...]"
677Reads \fIfile\fR, which must be in the PCAP format used by network
678capture tools such as \fBtcpdump\fR or \fBwireshark\fR, extracts all
679the TCP streams for OpenFlow connections, and prints the OpenFlow
680messages in those connections in human-readable format on
681\fBstdout\fR.
682.IP
683OpenFlow connections are distinguished by TCP port number.
684Non-OpenFlow packets are ignored. By default, data on TCP ports 6633
685and 6653 are considered to be OpenFlow. Specify one or more
686\fIport\fR arguments to override the default.
687.IP
688This command cannot usefully print SSL encrypted traffic. It does not
689understand IPv6.
690.
064af421 691.SS "Flow Syntax"
a9b4a41a 692.PP
064af421 693Some \fBovs\-ofctl\fR commands accept an argument that describes a flow or
96fee5e0 694flows. Such flow descriptions comprise a series of
064af421
BP
695\fIfield\fB=\fIvalue\fR assignments, separated by commas or white
696space. (Embedding spaces into a flow description normally requires
697quoting to prevent the shell from breaking the description into
698multiple arguments.)
a9b4a41a 699.PP
0b3f2725
BP
700Flow descriptions should be in \fBnormal form\fR. This means that a
701flow may only specify a value for an L3 field if it also specifies a
702particular L2 protocol, and that a flow may only specify an L4 field
703if it also specifies particular L2 and L3 protocol types. For
704example, if the L2 protocol type \fBdl_type\fR is wildcarded, then L3
705fields \fBnw_src\fR, \fBnw_dst\fR, and \fBnw_proto\fR must also be
706wildcarded. Similarly, if \fBdl_type\fR or \fBnw_proto\fR (the L3
1c58a78b
BP
707protocol type) is wildcarded, so must be the L4 fields \fBtcp_dst\fR and
708\fBtcp_src\fR. \fBovs\-ofctl\fR will warn about
0b3f2725
BP
709flows not in normal form.
710.PP
96fee5e0
BP
711\fBovs\-fields\fR(7) describes the supported fields and how to match
712them. In addition to match fields, commands that operate on flows
713accept a few additional key-value pairs:
71e17a7a 714.
4bc938cc
BP
715.IP \fBtable=\fItable\fR
716For 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
0e197060
BP
720dumped.
721.
722.IP
723For flow table modification commands, behavior varies based on the
724OpenFlow version used to connect to the switch:
725.
726.RS
727.IP "OpenFlow 1.0"
728OpenFlow 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
7311.0.
732.IP
733In OpenFlow 1.0, the switch chooses the table into which to insert a
734new flow. The Open vSwitch software switch always chooses table 0.
735Other Open vSwitch datapaths and other OpenFlow implementations may
736choose different tables.
737.IP
738The OpenFlow 1.0 behavior in Open vSwitch for modifying or removing
739flows depends on whether \fB\-\-strict\fR is used. Without
740\fB\-\-strict\fR, the command applies to matching flows in all tables.
741With \fB\-\-strict\fR, the command will operate on any single matching
742flow in any table; it will do nothing if there are matches in more
743than one table. (The distinction between these behaviors only matters
744if non-OpenFlow 1.0 commands were also used, because OpenFlow 1.0
745alone cannot add flows with the same matching criteria to multiple
746tables.)
747.
748.IP "OpenFlow 1.0 with table_id extension"
749Open vSwitch implements an OpenFlow extension that allows the
750controller to specify the table on which to operate. \fBovs\-ofctl\fR
751automatically enables the extension when \fBtable\fR is specified and
752OpenFlow 1.0 is used. \fBovs\-ofctl\fR automatically detects whether
753the switch supports the extension. As of this writing, this extension
754is only known to be implemented by Open vSwitch.
755.
756.IP
757With this extension, \fBovs\-ofctl\fR operates on the requested table
758when \fBtable\fR is specified, and acts as described for OpenFlow 1.0
759above when no \fBtable\fR is specified (or for \fBtable=255\fR).
760.
761.IP "OpenFlow 1.1"
762OpenFlow 1.1 requires flow table modification commands to specify a
763table. When \fBtable\fR is not specified (or \fBtable=255\fR is
764specified), \fBovs\-ofctl\fR defaults to table 0.
765.
766.IP "OpenFlow 1.2 and later"
767OpenFlow 1.2 and later allow flow deletion commands, but not other
768flow table modification commands, to operate on all flow tables, with
769the behavior described above for OpenFlow 1.0.
770.RE
96fee5e0
BP
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
775output from the \fBdump\-flows\fR command to be used as input for
776other commands that parse flows.
2c6d8411
BP
777.
778.PP
c821124b
BP
779The \fBadd\-flow\fR, \fBadd\-flows\fR, and \fBmod\-flows\fR commands
780require an additional field, which must be the final field specified:
a9b4a41a 781.
d1ba66e9 782.IP \fBactions=\fR[\fIaction\fR][\fB,\fIaction\fR...]\fR
be51cd41
BP
783Specifies a comma-separated list of actions to take on a packet when
784the flow entry matches. If no \fIaction\fR is specified, then packets
785matching the flow are dropped. See \fBovs\-actions\fR(7) for details
786on the syntax and semantics of actions.
787K
064af421 788.PP
e729e793
JP
789An opaque identifier called a cookie can be used as a handle to identify
790a set of flows:
791.
623e1caf
JP
792.IP \fBcookie=\fIvalue\fR
793.
794A 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
79664-bit number and need not be unique among flows. If this field is
797omitted, a default cookie value of 0 is used.
798.
799.IP \fBcookie=\fIvalue\fR\fB/\fImask\fR
e729e793 800.
e729e793 801When using NXM, the cookie can be used as a handle for querying,
623e1caf
JP
802modifying, and deleting flows. \fIvalue\fR and \fImask\fR may be
803supplied 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
806match exactly, and a 0-bit wildcards that bit. A mask of \-1 may be used
807to exactly match a cookie.
808.IP
809The \fBmod\-flows\fR command can update the cookies of flows that
810match a cookie by specifying the \fIcookie\fR field twice (once with a
811mask for matching and once without to indicate the new value):
812.RS
813.IP "\fBovs\-ofctl mod\-flows br0 cookie=1,actions=normal\fR"
814Change 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"
816Update cookies with a value of 1 to 2 and change their actions to
817\fBnormal\fR.
818.RE
819.IP
820The ability to match on cookies was added in Open vSwitch 1.5.0.
8cce2125
JP
821.
822.PP
4b6b46ce
BP
823The following additional field sets the priority for flows added by
824the \fBadd\-flow\fR and \fBadd\-flows\fR commands. For
825\fBmod\-flows\fR and \fBdel\-flows\fR when \fB\-\-strict\fR is
826specified, priority must match along with the rest of the flow
623e1caf 827specification. For \fBmod-flows\fR without \fB\-\-strict\fR,
fdb3539e
BP
828priority is only significant if the command creates a new flow, that
829is, non-strict \fBmod\-flows\fR does not match on priority and will
830not change the priority of existing flows. Other commands do not
831allow priority to be specified.
a9b4a41a 832.
064af421
BP
833.IP \fBpriority=\fIvalue\fR
834The priority at which a wildcarded entry will match in comparison to
835others. \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
837have priority over an entry containing wildcards, so it has an implicit
838priority value of 65535. When adding a flow, if the field is not specified,
839the flow's priority will default to 32768.
4530afba
BP
840.IP
841OpenFlow leaves behavior undefined when two or more flows with the
842same priority can match a single packet. Some users expect
843``sensible'' behavior, such as more specific flows taking precedence
844over less specific flows, but OpenFlow does not specify this and Open
845vSwitch does not implement it. Users should therefore take care to
846use priorities to ensure the behavior that they expect.
a9b4a41a 847.
064af421 848.PP
fdb3539e
BP
849The \fBadd\-flow\fR, \fBadd\-flows\fR, and \fBmod\-flows\fR commands
850support the following additional options. These options affect only
851new flows. Thus, for \fBadd\-flow\fR and \fBadd\-flows\fR, these
852options are always significant, but for \fBmod\-flows\fR they are
853significant only if the command creates a new flow, that is, their
a993007b 854values do not update or affect existing flows.
a9b4a41a 855.
fdb3539e 856.IP "\fBidle_timeout=\fIseconds\fR"
064af421 857Causes the flow to expire after the given number of seconds of
fdb3539e
BP
858inactivity. A value of 0 (the default) prevents a flow from expiring
859due to inactivity.
a9b4a41a 860.
064af421
BP
861.IP \fBhard_timeout=\fIseconds\fR
862Causes the flow to expire after the given number of seconds,
863regardless of activity. A value of 0 (the default) gives the flow no
864hard expiration deadline.
a9b4a41a 865.
ca26eb44
RB
866.IP "\fBimportance=\fIvalue\fR"
867Sets the importance of a flow. The flow entry eviction mechanism can
868use importance as a factor in deciding which flow to evict. A value
869of 0 (the default) makes the flow non-evictable on the basis of
870importance. Specify a value between 0 and 65535.
871.IP
872Only OpenFlow 1.4 and later support \fBimportance\fR.
873.
a993007b
BP
874.IP "\fBsend_flow_rem\fR"
875Marks the flow with a flag that causes the switch to generate a ``flow
876removed'' message and send it to interested controllers when the flow
877later expires or is removed.
878.
879.IP "\fBcheck_overlap\fR"
880Forces the switch to check that the flow match does not overlap that
881of any different flow with the same priority in the same table. (This
882check is expensive so it is best to avoid it.)
883.
b6dc6b93
BP
884.IP "\fBreset_counts\fR"
885When this flag is specified on a flow being added to a switch, and the
886switch already has a flow with an identical match, an OpenFlow 1.2 (or
887later) switch resets the flow's packet and byte counters to 0.
888Without the flag, the packet and byte counters are preserved.
889.IP
890OpenFlow 1.0 and 1.1 switches always reset counters in this situation,
891as if \fBreset_counts\fR were always specified.
892.IP
893Open vSwitch 1.10 added support for \fBreset_counts\fR.
894.
895.IP "\fBno_packet_counts\fR"
896.IQ "\fBno_byte_counts\fR"
897Adding these flags to a flow advises an OpenFlow 1.3 (or later) switch
898that the controller does not need packet or byte counters,
899respectively, for the flow. Some switch implementations might achieve
900higher performance or reduce resource consumption when these flags are
901used. These flags provide no benefit to the Open vSwitch software
902switch implementation.
903.IP
904OpenFlow 1.2 and earlier do not support these flags.
905.IP
906Open vSwitch 1.10 added support for \fBno_packet_counts\fR and
907\fBno_byte_counts\fR.
908.
064af421 909.PP
4e312e69 910The \fBdump\-flows\fR, \fBdump\-aggregate\fR, \fBdel\-flow\fR
6d5d1f3b 911and \fBdel\-flows\fR commands support these additional optional fields:
a9b4a41a 912.
064af421
BP
913.TP
914\fBout_port=\fIport\fR
c6100d92 915If set, a matching flow must include an output action to \fIport\fR,
60a0b9e5 916which must be an OpenFlow port number or name (e.g. \fBlocal\fR).
a9b4a41a 917.
6d5d1f3b 918.TP
640c2f0d 919\fBout_group=\fIgroup\fR
6d5d1f3b
BP
920If set, a matching flow must include an \fBgroup\fR action naming
921\fIgroup\fR, which must be an OpenFlow group number. This field
922is supported in Open vSwitch 2.5 and later and requires OpenFlow 1.1
923or later.
924.
064af421 925.SS "Table Entry Output"
a9b4a41a 926.
4e312e69 927The \fBdump\-tables\fR and \fBdump\-aggregate\fR commands print information
064af421 928about the entries in a datapath's tables. Each line of output is a
f27f2134
BP
929flow entry as described in \fBFlow Syntax\fR, above, plus some
930additional fields:
a9b4a41a 931.
f27f2134
BP
932.IP \fBduration=\fIsecs\fR
933The time, in seconds, that the entry has been in the table.
934\fIsecs\fR includes as much precision as the switch provides, possibly
935to nanosecond resolution.
a9b4a41a 936.
064af421
BP
937.IP \fBn_packets\fR
938The number of packets that have matched the entry.
a9b4a41a 939.
064af421
BP
940.IP \fBn_bytes\fR
941The total number of bytes from packets that have matched the entry.
a9b4a41a 942.
064af421 943.PP
f27f2134
BP
944The following additional fields are included only if the switch is
945Open vSwitch 1.6 or later and the NXM flow format is used to dump the
946flow (see the description of the \fB\-\-flow-format\fR option below).
947The values of these additional fields are approximations only and in
948particular \fBidle_age\fR will sometimes become nonzero even for busy
949flows.
950.
951.IP \fBhard_age=\fIsecs\fR
952The 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
954of \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
959The integer number of seconds that have passed without any packets
960passing through the flow.
a9b4a41a 961.
6dd3c787
JR
962.SS "Packet\-Out Syntax"
963.PP
964\fBovs\-ofctl bundle\fR command accepts packet-outs to be specified in
965the bundle file. Each packet-out comprises of a series of
966\fIfield\fB=\fIvalue\fR assignments, separated by commas or white
967space. (Embedding spaces into a packet-out description normally
968requires quoting to prevent the shell from breaking the description
969into multiple arguments.). Unless noted otherwise only the last
970instance of each field is honoured. This same syntax is also
971supported by the \fBovs\-ofctl packet-out\fR command.
972.PP
973.IP \fBin_port=\fIport\fR
974The port number to be considered the in_port when processing actions.
975This can be any valid OpenFlow port number, or any of the \fBLOCAL\fR,
976\fBCONTROLLER\fR, or \fBNONE\fR.
977.
978This field is required.
979
880b1458
YHW
980.IP \fIpipeline_field\fR=\fIvalue\fR
981Optionally, user can specify a list of pipeline fields for a packet-out
982message. The supported pipeline fields includes \fBtunnel fields\fR and
983\fBregister fields\fR as defined in \fBovs\-fields\fR(7).
984
6dd3c787
JR
985.IP \fBpacket=\fIhex-string\fR
986The actual packet to send, expressed as a string of hexadecimal bytes.
987.
988This field is required.
989
990.IP \fBactions=\fR[\fIaction\fR][\fB,\fIaction\fR...]\fR
991The syntax of actions are identical to the \fBactions=\fR field
992described in \fBFlow Syntax\fR above. Specifying \fBactions=\fR is
993optional, but omitting actions is interpreted as a drop, so the packet
994will 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.
7395c052
NZ
999.SS "Group Syntax"
1000.PP
1001Some \fBovs\-ofctl\fR commands accept an argument that describes a group or
1002groups. Such flow descriptions comprise a series
1003\fIfield\fB=\fIvalue\fR assignments, separated by commas or white
1004space. (Embedding spaces into a group description normally requires
1005quoting to prevent the shell from breaking the description into
1006multiple arguments.). Unless noted otherwise only the last instance
1007of each field is honoured.
1008.PP
1009.IP \fBgroup_id=\fIid\fR
1010The integer group id of group.
19187a71 1011When this field is specified in \fBdel\-groups\fR or \fBdump\-groups\fR,
7395c052
NZ
1012the keyword "all" may be used to designate all groups.
1013.
1014This field is required.
1015
1016
1017.IP \fBtype=\fItype\fR
bdbb8426 1018The type of the group. The \fBadd-group\fR, \fBadd-groups\fR and
ed1d5ef3 1019\fBmod-groups\fR commands require this field. It is prohibited for
bdbb8426 1020other commands. The following keywords designated the allowed types:
7395c052
NZ
1021.RS
1022.IP \fBall\fR
1023Execute all buckets in the group.
1024.IP \fBselect\fR
9a84f468
BP
1025Execute one bucket in the group, balancing across the buckets
1026according to their weights. To select a bucket, for each live bucket,
1027Open vSwitch hashes flow data with the bucket ID and multiplies by the
1028bucket weight to obtain a ``score,'' and then selects the bucket with
1029the highest score. Use \fBselection_method\fR to control the flow
1030data used for selection.
7395c052
NZ
1031.IP \fBindirect\fR
1032Executes the one bucket in the group.
1033.IP \fBff\fR
1034.IQ \fBfast_failover\fR
1035Executes the first live bucket in the group which is associated with
1036a live port or group.
1037.RE
1038
bdbb8426
SH
1039.IP \fBcommand_bucket_id=\fIid\fR
1040The bucket to operate on. The \fBinsert-buckets\fR and \fBremove-buckets\fR
1041commands 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
1045Operate on all buckets in the group.
1046Only valid when used with the \fBremove-buckets\fR command in which
1047case the effect is to remove all buckets from the group.
1048.IP \fBfirst\fR
1049Operate on the first bucket present in the group.
1050In the case of the \fBinsert-buckets\fR command the effect is to
1051insert new bucets just before the first bucket already present in the group;
1052or to replace the buckets of the group if there are no buckets already present
1053in the group.
1054In the case of the \fBremove-buckets\fR command the effect is to
1055remove the first bucket of the group; or do nothing if there are no
1056buckets present in the group.
1057.IP \fBlast\fR
1058Operate on the last bucket present in the group.
1059In the case of the \fBinsert-buckets\fR command the effect is to
1060insert new bucets just after the last bucket already present in the group;
1061or to replace the buckets of the group if there are no buckets already present
1062in the group.
1063In the case of the \fBremove-buckets\fR command the effect is to
1064remove the last bucket of the group; or do nothing if there are no
1065buckets present in the group.
1066.RE
1067.IP
1068If \fIid\fR is an integer then it should correspond to the \fBbucket_id\fR
1069of a bucket present in the group.
1070In case of the \fBinsert-buckets\fR command the effect is to
1071insert buckets just before the bucket in the group whose \fBbucket_id\fR is
1072\fIid\fR.
1073In case of the \fBiremove-buckets\fR command the effect is to
1074remove the in the group whose \fBbucket_id\fR is \fIid\fR.
1075It is an error if there is no bucket persent group in whose \fBbucket_id\fR is
1076\fIid\fR.
1077
b879391e
SH
1078.IP \fBselection_method\fR=\fImethod\fR
1079The selection method used to select a bucket for a select group.
1080This is a string of 1 to 15 bytes in length known to lower layers.
1081This field is optional for \fBadd\-group\fR, \fBadd\-groups\fR and
1082\fBmod\-group\fR commands on groups of type \fBselect\fR. Prohibited
06db81cc
JS
1083otherwise. If no selection method is specified, Open vSwitch up to
1084release 2.9 applies the \fBhash\fR method with default fields. From
10852.10 onwards Open vSwitch defaults to the \fBdp_hash\fR method with symmetric
1086L3/L4 hash algorithm, unless the weighted group buckets cannot be mapped to
1087a maximum of 64 dp_hash values with sufficient accuracy.
1088In those rare cases Open vSwitch 2.10 and later fall back to the \fBhash\fR
1089method with the default set of hash fields.
53cc166a 1090.RS
53cc166a
JR
1091.IP \fBdp_hash\fR
1092Use a datapath computed hash value. The hash algorithm varies accross
1093different datapath implementations. \fBdp_hash\fR uses the upper 32
1094bits of the \fBselection_method_param\fR as the datapath hash
06db81cc
JS
1095algorithm selector. The supported values are \fB0\fR (corresponding to
1096hash computation over the IP 5-tuple) and \fB1\fR (corresponding to a
1097\fIsymmetric\fR hash computation over the IP 5-tuple). Selecting specific
1098fields with the \fBfields\fR option is not supported with \fBdp_hash\fR).
1099The lower 32 bits are used as the hash basis.
53cc166a
JR
1100.IP
1101Using \fBdp_hash\fR has the advantage that it does not require the
1102generated datapath flows to exact match any additional packet header
1103fields. For example, even if multiple TCP connections thus hashed to
1104different select group buckets have different source port numbers,
1105generally all of them would be handled with a small set of already
1106established datapath flows, resulting in less latency for TCP SYN
1107packets. The downside is that the shared datapath flows must match
1108each packet twice, as the datapath hash value calculation happens only
1109when needed, and a second match is required to match some bits of its
1110value. This double-matching incurs a small additional latency cost
1111for each packet, but this latency is orders of magnitude less than the
1112latency of creating new datapath flows for new TCP connections.
06db81cc
JS
1113.IP \fBhash\fR
1114Use a hash computed over the fields specified with the \fBfields\fR
1115option, see below. If no hash fields are specified, \fBhash\fR defaults
1116to a symmetric hash over the combination of MAC addresses, VLAN tags,
1117Ether type, IP addresses and L4 port numbers. \fBhash\fR uses the
1118\fBselection_method_param\fR as the hash basis.
1119.IP
1120Note that the hashed fields become exact matched by the datapath
1121flows. For example, if the TCP source port is hashed, the created
1122datapath flows will match the specific TCP source port value present
1123in the packet received. Since each TCP connection generally has a
1124different source port value, a separate datapath flow will be need to
1125be inserted for each TCP connection thus hashed to a select group
1126bucket.
53cc166a 1127.RE
68dfc25b 1128.IP
06db81cc 1129This option uses a Netronome OpenFlow extension which is only supported
b879391e
SH
1130when using Open vSwitch 2.4 and later with OpenFlow 1.5 and later.
1131
1132.IP \fBselection_method_param\fR=\fIparam\fR
113364-bit integer parameter to the selection method selected by the
1134\fBselection_method\fR field. The parameter's use is defined by the
1135lower-layer that implements the \fBselection_method\fR. It is optional if
1136the \fBselection_method\fR field is specified as a non-empty string.
1137Prohibited otherwise. The default value is zero.
1138.IP
06db81cc 1139This option uses a Netronome OpenFlow extension which is only supported
b879391e
SH
1140when using Open vSwitch 2.4 and later with OpenFlow 1.5 and later.
1141
68dfc25b
BP
1142.IP \fBfields\fR=\fIfield\fR
1143.IQ \fBfields(\fIfield\fR[\fB=\fImask\fR]\fR...\fB)\fR
b879391e 1144The field parameters to selection method selected by the
60dfb5ed
JR
1145\fBselection_method\fR field. The syntax is described in \fBFlow
1146Syntax\fR with the additional restrictions that if a value is provided
1147it is treated as a wildcard mask and wildcard masks following a slash
1148are prohibited. The pre-requisites of fields must be provided by any
1149flows that output to the group. The use of the fields is defined by
1150the lower-layer that implements the \fBselection_method\fR. They are
1151optional if the \fBselection_method\fR field is specified as ``hash',
1152prohibited otherwise. The default is no fields.
b879391e
SH
1153.IP
1154This option will use a Netronome OpenFlow extension which is only supported
1155when using Open vSwitch 2.4 and later with OpenFlow 1.5 and later.
1156
7395c052
NZ
1157.IP \fBbucket\fR=\fIbucket_parameters\fR
1158The \fBadd-group\fR, \fBadd-groups\fR and \fBmod-group\fR commands
1159require at least one bucket field. Bucket fields must appear after
1160all other fields.
1161.
1162Multiple bucket fields to specify multiple buckets.
1163The order in which buckets are specified corresponds to their order in
1164the group. If the type of the group is "indirect" then only one group may
1165be specified.
1166.
1167\fIbucket_parameters\fR consists of a list of \fIfield\fB=\fIvalue\fR
1168assignments, separated by commas or white space followed by a
1169comma-separated list of actions.
7395c052
NZ
1170The fields for \fIbucket_parameters\fR are:
1171.
1172.RS
2d5d050c
SH
1173.IP \fBbucket_id=\fIid\fR
1174The 32-bit integer group id of the bucket. Values greater than
11750xffffff00 are reserved.
1176.
1177This field was added in Open vSwitch 2.4 to conform with the OpenFlow
d3cb080e 11781.5 specification. It is not supported when earlier versions
2d5d050c
SH
1179of OpenFlow are used. Open vSwitch will automatically allocate bucket
1180ids when they are not specified.
f1457c26
TG
1181.IP \fBactions=\fR[\fIaction\fR][\fB,\fIaction\fR...]\fR
1182The syntax of actions are identical to the \fBactions=\fR field described in
6dd3c787 1183\fBFlow Syntax\fR above. Specifying \fBactions=\fR is optional, any unknown
f1457c26 1184bucket parameter will be interpreted as an action.
7395c052
NZ
1185.IP \fBweight=\fIvalue\fR
1186The relative weight of the bucket as an integer. This may be used by the switch
1187during bucket select for groups whose \fBtype\fR is \fBselect\fR.
1188.IP \fBwatch_port=\fIport\fR
1189Port used to determine liveness of group.
1190This or the \fBwatch_group\fR field is required
1191for groups whose \fBtype\fR is \fBff\fR or \fBfast_failover\fR.
2df300c5
NM
1192This or the \fBwatch_group\fR field can also be used
1193for groups whose \fBtype\fR is \fBselect\fR.
7395c052
NZ
1194.IP \fBwatch_group=\fIgroup_id\fR
1195Group identifier of group used to determine liveness of group.
1196This or the \fBwatch_port\fR field is required
1197for groups whose \fBtype\fR is \fBff\fR or \fBfast_failover\fR.
2df300c5
NM
1198This or the \fBwatch_port\fR field can also be used
1199for groups whose \fBtype\fR is \fBselect\fR.
7395c052
NZ
1200.RE
1201.
3200ed58
JR
1202.SS "Meter Syntax"
1203.PP
1204The meter table commands accept an argument that describes a meter.
1205Such meter descriptions comprise a series \fIfield\fB=\fIvalue\fR
1206assignments, separated by commas or white space.
1207(Embedding spaces into a group description normally requires
1208quoting to prevent the shell from breaking the description into
1209multiple arguments.). Unless noted otherwise only the last instance
1210of each field is honoured.
1211.PP
1212.IP \fBmeter=\fIid\fR
76b05258
JP
1213The identifier for the meter. An integer is used to specify a
1214user-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
1217the OVS userspace, respectively.
1218.IP
3200ed58 1219When this field is specified in \fBdel-meter\fR, \fBdump-meter\fR, or
76b05258
JP
1220\fBmeter-stats\fR, the keyword "all" may be used to designate all
1221meters. This field is required, except for \fBmeter-stats\fR, which
1222dumps all stats when this field is not specified.
3200ed58
JR
1223.IP \fBkbps\fR
1224.IQ \fBpktps\fR
330f6f53
JP
1225The unit for the \fBrate\fR and \fBburst_size\fR band parameters.
1226\fBkbps\fR specifies kilobits per second, and \fBpktps\fR specifies
1227packets per second. A unit is required for the \fBadd-meter\fR and
1228\fBmod-meter\fR commands.
3200ed58
JR
1229
1230.IP \fBburst\fR
330f6f53
JP
1231If set, enables burst support for meter bands through the \fBburst_size\fR
1232parameter.
3200ed58
JR
1233
1234.IP \fBstats\fR
330f6f53 1235If set, enables the collection of meter and band statistics.
3200ed58
JR
1236
1237.IP \fBbands\fR=\fIband_parameters\fR
1238The \fBadd-meter\fR and \fBmod-meter\fR commands require at least one
1239band specification. Bands must appear after all other fields.
1240.RS
1241.IP \fBtype=\fItype\fR
1242The type of the meter band. This keyword starts a new band specification.
1243Each band specifies a rate above which the band is to take some action. The
1244action depends on the band type. If multiple bands' rate is exceeded, then
1245the band with the highest rate among the exceeded bands is selected.
1246The following keywords designate the allowed
1247meter band types:
1248.RS
1249.IP \fBdrop\fR
1250Drop packets exceeding the band's rate limit.
1251.RE
1252.
1253.IP "The other \fIband_parameters\fR are:"
1254.IP \fBrate=\fIvalue\fR
1255The relative rate limit for this band, in kilobits per second or packets per
330f6f53 1256second, depending on whether \fBkbps\fR or \fBpktps\fR was specified.
96660ed1 1257.IP \fBburst_size=\fIsize\fR
330f6f53
JP
1258If \fBburst\fR is specified for the meter entry, configures the maximum
1259burst allowed for the band in kilobits or packets, depending on whether
1260\fBkbps\fR or \fBpktps\fR was specified. If unspecified, the switch is
1261free to select some reasonable value depending on its configuration.
3200ed58
JR
1262.RE
1263.
064af421
BP
1264.SH OPTIONS
1265.TP
4e312e69 1266\fB\-\-strict\fR
064af421 1267Uses strict matching when running flow modification commands.
a9b4a41a 1268.
50f96b10
BP
1269.IP "\fB\-\-names\fR"
1270.IQ "\fB\-\-no\-names\fR"
4bc938cc
BP
1271Every OpenFlow port has a name and a number, and every OpenFlow flow
1272table has a number and sometimes a name. By default, \fBovs\-ofctl\fR
1273commands accept both port and table names and numbers, and they
1274display port and table names if \fBovs\-ofctl\fR is running on an
1275interactive console, numbers otherwise. With \fB\-\-names\fR,
1276\fBovs\-ofctl\fR commands both accept and display port and table
1277names; with \fB\-\-no\-names\fR, commands neither accept nor display
1278port and table names.
1279.IP
1280If a port or table name contains special characters or might be
1281confused with a keyword within a flow, it may be enclosed in double
1282quotes (escaped from the shell). If necessary, JSON-style escape
1283sequences may be used inside quotes, as specified in RFC 7159. When
1284it displays port and table names, \fBovs\-ofctl\fR quotes any name
1285that does not start with a letter followed by letters or digits.
1286.IP
1287Open vSwitch added support for port names and these options. Open
1288vSwitch 2.10 added support for table names. Earlier versions always
50f96b10
BP
1289behaved as if \fB\-\-no\-names\fR were specified.
1290.IP
1291Open vSwitch does not place its own limit on the length of port names,
29718ad4
BP
1292but OpenFlow limits port names to 15 bytes.
1293Because \fRovs\-ofctl\fR uses OpenFlow to
50f96b10
BP
1294retrieve the mapping between port names and numbers, names longer than
1295this limit will be truncated for both display and acceptance.
1296Truncation can also cause long names that are different to appear to
1297be the same; when a switch has two ports with the same (truncated)
1298name, \fBovs\-ofctl\fR refuses to display or accept the name, using
1299the number instead.
4bc938cc
BP
1300.IP
1301OpenFlow and Open vSwitch limit table names to 32 bytes.
50f96b10 1302.
1b3758c3
BP
1303.IP "\fB\-\-stats\fR"
1304.IQ "\fB\-\-no\-stats\fR"
1305The \fBdump\-flows\fR command by default, or with \fB\-\-stats\fR,
1306includes flow duration, packet and byte counts, and idle and hard age
1307in its output. With \fB\-\-no\-stats\fR, it omits all of these, as
1308well as cookie values and table IDs if they are zero.
1309.
1f4a7252
RM
1310.IP "\fB\-\-read-only\fR"
1311Do not execute read/write commands.
1312.
db5076ee 1313.IP "\fB\-\-bundle\fR"
39c94593 1314Execute flow mods as an OpenFlow 1.4 atomic bundle transaction.
db5076ee
JR
1315.RS
1316.IP \(bu
1317Within a bundle, all flow mods are processed in the order they appear
39c94593
JR
1318and as a single atomic transaction, meaning that if one of them fails,
1319the whole transaction fails and none of the changes are made to the
1320\fIswitch\fR's flow table, and that each given datapath packet
1321traversing the OpenFlow tables sees the flow tables either as before
1322the transaction, or after all the flow mods in the bundle have been
1323successfully applied.
db5076ee
JR
1324.IP \(bu
1325The beginning and the end of the flow table modification commands in a
1326bundle are delimited with OpenFlow 1.4 bundle control messages, which
1327makes it possible to stream the included commands without explicit
1328OpenFlow barriers, which are otherwise used after each flow table
1329modification command. This may make large modifications execute
1330faster as a bundle.
1331.IP \(bu
1332Bundles require OpenFlow 1.4 or higher. An explicit \fB-O
1333OpenFlow14\fR option is not needed, but you may need to enable
1334OpenFlow 1.4 support for OVS by setting the OVSDB \fIprotocols\fR
1335column in the \fIbridge\fR table.
db5076ee
JR
1336.RE
1337.
a53a8efa
SH
1338.so lib/ofp-version.man
1339.
27527aa0
BP
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
1343number of which may be listed as \fIformat\fR:
88ca35ee 1344.RS
27527aa0
BP
1345.IP "\fBOpenFlow10\-table_id\fR"
1346This is the standard OpenFlow 1.0 flow format. All OpenFlow switches
1347and all versions of Open vSwitch support this flow format.
88ca35ee 1348.
27527aa0
BP
1349.IP "\fBOpenFlow10+table_id\fR"
1350This is the standard OpenFlow 1.0 flow format plus a Nicira extension
1351that allows \fBovs\-ofctl\fR to specify the flow table in which a
1352particular flow should be placed. Open vSwitch 1.2 and later supports
1353this flow format.
1354.
1355.IP "\fBNXM\-table_id\fR (Nicira Extended Match)"
88ca35ee
BP
1356This Nicira extension to OpenFlow is flexible and extensible. It
1357supports all of the Nicira flow extensions, such as \fBtun_id\fR and
27527aa0
BP
1358registers. Open vSwitch 1.1 and later supports this flow format.
1359.
1360.IP "\fBNXM+table_id\fR (Nicira Extended Match)"
1361This combines Nicira Extended match with the ability to place a flow
1362in a specific table. Open vSwitch 1.2 and later supports this flow
1363format.
e71bff1b
BP
1364.
1365.IP "\fBOXM-OpenFlow12\fR"
1366.IQ "\fBOXM-OpenFlow13\fR"
aa233d57 1367.IQ "\fBOXM-OpenFlow14\fR"
8d348579 1368.IQ "\fBOXM-OpenFlow15\fR"
e71bff1b 1369These are the standard OXM (OpenFlow Extensible Match) flow format in
8d348579 1370OpenFlow 1.2 and later.
88ca35ee 1371.RE
27527aa0 1372.
88ca35ee 1373.IP
27527aa0
BP
1374\fBovs\-ofctl\fR also supports the following abbreviations for
1375collections of flow formats:
1376.RS
1377.IP "\fBany\fR"
aa233d57 1378Any supported flow format.
27527aa0
BP
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.
e71bff1b 1383.IP "\fBOXM\fR"
aa233d57 1384\fBOXM-OpenFlow12\fR, \fBOXM-OpenFlow13\fR, or \fBOXM-OpenFlow14\fR.
27527aa0 1385.RE
4f564f8d 1386.
27527aa0
BP
1387.IP
1388For commands that modify the flow table, \fBovs\-ofctl\fR by default
1389negotiates the most widely supported flow format that supports the
1390flows being added. For commands that query the flow table,
1391\fBovs\-ofctl\fR by default uses the most advanced format supported by
1392the switch.
1393.IP
1394This option, where \fIformat\fR is a comma-separated list of one or
1395more of the formats listed above, limits \fBovs\-ofctl\fR's choice of
1396flow format. If a command cannot work as requested using one of the
1397specified flow formats, \fBovs\-ofctl\fR will report a fatal error.
54834960
EJ
1398.
1399.IP "\fB\-P \fIformat\fR"
1400.IQ "\fB\-\-packet\-in\-format=\fIformat\fR"
6409e008 1401\fBovs\-ofctl\fR supports the following ``packet-in'' formats, in order of
54834960
EJ
1402increasing capability:
1403.RS
6409e008
BP
1404.IP "\fBstandard\fR"
1405This uses the \fBOFPT_PACKET_IN\fR message, the standard ``packet-in''
1406message for any given OpenFlow version. Every OpenFlow switch that
1407supports a given OpenFlow version supports this format.
1408.
1409.IP "\fBnxt_packet_in\fR"
1410This uses the \fBNXT_PACKET_IN\fR message, which adds many of the
1411capabilities of the OpenFlow 1.1 and later ``packet-in'' messages
1412before those OpenFlow versions were available in Open vSwitch. Open
1413vSwitch 1.1 and later support this format. Only Open vSwitch 2.6 and
1414later, however, support it for OpenFlow 1.1 and later (but there is
1415little reason to use it with those versions of OpenFlow).
1416.
1417.IP "\fBnxt_packet_in2\fR"
1418This uses the \fBNXT_PACKET_IN2\fR message, which is extensible and
bdcad671
BP
1419should avoid the need to define new formats later. In particular,
1420this format supports passing arbitrary user-provided data to a
1421controller using the \fBuserdata\fB option on the \fBcontroller\fR
1422action. Open vSwitch 2.6 and later support this format.
54834960
EJ
1423.
1424.RE
1425.IP
6409e008
BP
1426Without this option, \fBovs\-ofctl\fR prefers \fBnxt_packet_in2\fR if
1427the switch supports it. Otherwise, if OpenFlow 1.0 is in use,
1428\fBovs\-ofctl\fR prefers \fBnxt_packet_in\fR if the switch supports
1429it. Otherwise, \fBovs\-ofctl\fR falls back to the \fBstandard\fR
1430packet-in format. When this option is specified, \fBovs\-ofctl\fR
1431insists on the selected format. If the switch does not support the
1432requested format, \fBovs\-ofctl\fR will report a fatal error.
1433.IP
1434Before 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
1438from one OpenFlow version to another; it is not consistently OpenFlow
14391.0 format. Similarly, when \fBnxt_packet_in2\fR was introduced, the
1440name \fBnxm\fR became confusing because it also uses OXM/NXM.)
1441.
1442.IP
1443This option affects only the \fBmonitor\fR command.
54834960 1444.
0c9560b7
BP
1445.IP "\fB\-\-timestamp\fR"
1446Print a timestamp before each received packet. This option only
f3dd1419
BP
1447affects the \fBmonitor\fR, \fBsnoop\fR, and \fBofp\-parse\-pcap\fR
1448commands.
0c9560b7 1449.
4f564f8d
BP
1450.IP "\fB\-m\fR"
1451.IQ "\fB\-\-more\fR"
1452Increases the verbosity of OpenFlow messages printed and logged by
1453\fBovs\-ofctl\fR commands. Specify this option more than once to
1454increase verbosity further.
1eb85ef5 1455.
bdcc5925
BP
1456.IP \fB\-\-sort\fR[\fB=\fIfield\fR]
1457.IQ \fB\-\-rsort\fR[\fB=\fIfield\fR]
1458Display 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
1462output is sorted by priority. Specify these options multiple times to
1463sort by multiple fields.
1464.IP
1465Any given flow will not necessarily specify a value for a given
1466field. This requires special treatement:
1467.RS
1468.IP \(bu
1469A flow that does not specify any part of a field that is used for sorting is
1470sorted 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
1472source port in ascending order, followed by the flows that do not
0d56eaf2 1473specify a TCP source port at all.
bdcc5925
BP
1474.IP \(bu
1475A flow that only specifies some bits in a field is sorted as if the
1476wildcarded bits were zero. For example, \fB\-\-sort=nw_src\fR would
1477sort 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
1481These options currently affect only \fBdump\-flows\fR output.
1482.
679d3475 1483.SS "Daemon Options"
1eb85ef5
EJ
1484.ds DD \
1485\fBovs\-ofctl\fR detaches only when executing the \fBmonitor\fR or \
1486\fBsnoop\fR commands.
1487.so lib/daemon.man
19945013 1488.so lib/unixctl.man
ac300505 1489.SS "Public Key Infrastructure Options"
84ee7bcf 1490.so lib/ssl.man
064af421 1491.so lib/vlog.man
e7019d99 1492.so lib/colors.man
064af421 1493.so lib/common.man
a9b4a41a 1494.
1eb85ef5 1495.SH "RUNTIME MANAGEMENT COMMANDS"
96761f58
BP
1496\fBovs\-appctl\fR(8) can send commands to a running \fBovs\-ofctl\fR
1497process. The supported commands are listed below.
1498.
1eb85ef5 1499.IP "\fBexit\fR"
96761f58
BP
1500Causes \fBovs\-ofctl\fR to gracefully terminate. This command applies
1501only when executing the \fBmonitor\fR or \fBsnoop\fR commands.
1502.
1e1d00a5
BP
1503.IP "\fBofctl/set\-output\-file \fIfile\fR"
1504Causes all subsequent output to go to \fIfile\fR instead of stderr.
1505This command applies only when executing the \fBmonitor\fR or
1506\fBsnoop\fR commands.
1507.
96761f58
BP
1508.IP "\fBofctl/send \fIofmsg\fR..."
1509Sends each \fIofmsg\fR, specified as a sequence of hex digits that
1510express an OpenFlow message, on the OpenFlow connection. This command
1511is useful only when executing the \fBmonitor\fR command.
1512.
6dd3c787
JR
1513.IP "\fBofctl/packet\-out \fIpacket-out\fR"
1514Sends an OpenFlow PACKET_OUT message specified in \fBPacket\-Out
1515Syntax\fR, on the OpenFlow connection. See \fBPacket\-Out Syntax\fR
1516section for more information. This command is useful only when
1517executing the \fBmonitor\fR command.
1518.
bb638b9a
BP
1519.IP "\fBofctl/barrier\fR"
1520Sends an OpenFlow barrier request on the OpenFlow connection and waits
1521for a reply. This command is useful only for the \fBmonitor\fR
1522command.
1523.
064af421 1524.SH EXAMPLES
a9b4a41a 1525.
045b2e5c
BP
1526The following examples assume that \fBovs\-vswitchd\fR has a bridge
1527named \fBbr0\fR configured.
a9b4a41a 1528.
064af421 1529.TP
045b2e5c 1530\fBovs\-ofctl dump\-tables br0\fR
064af421
BP
1531Prints out the switch's table stats. (This is more interesting after
1532some traffic has passed through.)
a9b4a41a 1533.
064af421 1534.TP
045b2e5c 1535\fBovs\-ofctl dump\-flows br0\fR
064af421 1536Prints the flow entries in the switch.
a9b4a41a 1537.
5b10f305
OS
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
1541Implements 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
1545In this use of a learn action, the first packet from each source MAC
1546will be sent to port 2. Subsequent packets will be output to port 3,
21b2fa61
JR
1547with an idle timeout of 10 seconds. NXM field names and match field
1548names are both accepted, e.g. \fBNXM_NX_REG0\fR or \fBreg0\fR for the
1549first register, and empty brackets may be omitted.
1550.IP
5b10f305
OS
1551Additional examples may be found documented as part of related sections.
1552.
064af421 1553.SH "SEE ALSO"
a9b4a41a 1554.
96fee5e0 1555.BR ovs\-fields (7),
be51cd41 1556.BR ovs\-actions (7),
064af421 1557.BR ovs\-appctl (8),
96fee5e0 1558.BR ovs\-vswitchd (8),
29089a54 1559.BR ovs\-vswitchd.conf.db (8)