]> git.proxmox.com Git - mirror_ovs.git/blame_incremental - utilities/ovs-ofctl.8.in
connmgr: Make treatment of active and passive connections more uniform.
[mirror_ovs.git] / utilities / ovs-ofctl.8.in
... / ...
CommitLineData
1.\" -*- nroff -*-
2.so lib/ovs.tmac
3.TH ovs\-ofctl 8 "@VERSION@" "Open vSwitch" "Open vSwitch Manual"
4.ds PN ovs\-ofctl
5.
6.SH NAME
7ovs\-ofctl \- administer OpenFlow switches
8.
9.SH SYNOPSIS
10.B ovs\-ofctl
11[\fIoptions\fR] \fIcommand \fR[\fIswitch\fR] [\fIargs\fR\&...]
12.
13.SH DESCRIPTION
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.
19It should work with any OpenFlow switch, not just Open vSwitch.
20.
21.SS "OpenFlow Switch Management Commands"
22.PP
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.
26.PP
27Most of these commands take an argument that specifies the method for
28connecting to an OpenFlow switch. The following connection methods
29are supported:
30.
31.RS
32.so lib/vconn-active.man
33.
34.IP "\fIfile\fR"
35This is short for \fBunix:\fIfile\fR, as long as \fIfile\fR does not
36contain a colon.
37.
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.
46.RE
47.
48.TP
49\fBshow \fIswitch\fR
50Prints to the console information on \fIswitch\fR, including
51information on its flow tables and ports.
52.
53.TP
54\fBdump\-tables \fIswitch\fR
55Prints to the console statistics for each of the flow tables used by
56\fIswitch\fR.
57.TP
58\fBdump\-table\-features \fIswitch\fR
59Prints to the console features for each of the flow tables used by
60\fIswitch\fR.
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+.
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
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:
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
86.IP
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
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
110the \fBoverflow_policy\fR column in the \fBFlow_Table\fR table
111documented in \fBovs-vswitchd.conf.db\fR(5).)
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.
117.RE
118.
119.TP
120\fBdump\-ports \fIswitch\fR [\fInetdev\fR]
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.
125.
126.IP "\fBdump\-ports\-desc \fIswitch\fR [\fIport\fR]"
127Prints to the console detailed information about network devices
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.
139.
140.IP "\fBmod\-port \fIswitch\fR \fIport\fR \fIaction\fR"
141Modify characteristics of port \fBport\fR in \fIswitch\fR. \fIport\fR
142may be an OpenFlow port number or name (unless \fB\-\-no\-names\fR is
143specified) or the keyword \fBLOCAL\fR (the
144preferred way to refer to the OpenFlow local port). The \fIaction\fR
145may be any one of the following:
146.
147.RS
148.IQ \fBup\fR
149.IQ \fBdown\fR
150Enable or disable the interface. This is equivalent to \fBip
151link set up\fR or \fBip link set down\fR on a Unix system.
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.
169.
170.IP \fBforward\fR
171.IQ \fBno\-forward\fR
172Allow or disallow forwarding of traffic to this interface. By
173default, forwarding is enabled.
174.
175.IP \fBflood\fR
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.
187.RE
188.IP
189The \fBshow\fR command displays (among other information) the
190configuration that \fBmod\-port\fR changes.
191.
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
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.
224.
225.TP
226\fBdump\-flows \fIswitch \fR[\fIflows\fR]
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
230syntax of \fIflows\fR. The output format is described in
231\fBTable Entry Output\fR.
232.
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
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
241.
242.TP
243\fBdump\-aggregate \fIswitch \fR[\fIflows\fR]
244Prints to the console aggregate statistics for flows in
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.
248The output format is described in \fBTable Entry Output\fR.
249.
250.IP "\fBqueue\-stats \fIswitch \fR[\fIport \fR[\fIqueue\fR]]"
251Prints to the console statistics for the specified \fIqueue\fR on
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.
261.
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.
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.
273.IP "\fBdump\-ipfix\-bridge \fIswitch\fR"
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.
281.IP "\fBdump\-ipfix\-flow \fIswitch\fR"
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
287Refer to \fBovs\-vswitchd.conf.db\fR(5) for more details on configuring
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.
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.
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
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
305\fB\-\-bundle\fR option operates the command as a single atomic
306transation, see option \fB\-\-bundle\fR, below.
307.
308.IP "[\fB\-\-bundle\fR] \fBadd\-flow \fIswitch flow\fR"
309.IQ "[\fB\-\-bundle\fR] \fBadd\-flow \fIswitch \fB\- < \fIfile\fR"
310.IQ "[\fB\-\-bundle\fR] \fBadd\-flows \fIswitch file\fR"
311Add each flow entry to \fIswitch\fR's tables.
312.
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"
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.
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"
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.
334.
335.IP "[\fB\-\-bundle\fR] [\fB\-\-readd\fR] \fBreplace\-flows \fIswitch file\fR"
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.
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
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.
350.
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.
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.
374.
375.SS "Group Table Commands"
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
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.
383.PP
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.
390.
391.IP "[\fB\-\-bundle\fR] \fBadd\-group \fIswitch group\fR"
392.IQ "[\fB\-\-bundle\fR] \fBadd\-group \fIswitch \fB\- < \fIfile\fR"
393.IQ "[\fB\-\-bundle\fR] \fBadd\-groups \fIswitch file\fR"
394Add each group entry to \fIswitch\fR's tables.
395.
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"
406Modify the action buckets in entries from \fIswitch\fR's tables for
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.
412.
413.IP "[\fB\-\-bundle\fR] \fBdel\-groups \fIswitch\fR"
414.IQ "[\fB\-\-bundle\fR] \fBdel\-groups \fIswitch \fR[\fIgroup\fR]"
415.IQ "[\fB\-\-bundle\fR] \fBdel\-groups \fIswitch \fB\- < \fIfile\fR"
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.
420.IP "[\fB\-\-bundle\fR] \fBinsert\-buckets \fIswitch group\fR"
421.IQ "[\fB\-\-bundle\fR] \fBinsert\-buckets \fIswitch \fB\- < \fIfile\fR"
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.
426.IP "[\fB\-\-bundle\fR] \fBremove\-buckets \fIswitch group\fR"
427.IQ "[\fB\-\-bundle\fR] \fBremove\-buckets \fIswitch \fB\- < \fIfile\fR"
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.
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.
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.
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.
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
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,
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.
510.SS "OpenFlow Switch Tunnel TLV Table Commands"
511.
512Open vSwitch maintains a mapping table between tunnel option TLVs (defined
513by <class, type, length>) and NXM fields \fBtun_metadata\fIn\fR,
514where \fIn\fR ranges from 0 to 63, that can be operated on for the
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.
519
520A TLV mapping is specified with the syntax
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
526ovs-ofctl add-tlv-map br0 "{class=0xffff,type=0,len=4}->tun_metadata0"
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.
533
534These commands are Nicira extensions to OpenFlow and require Open vSwitch
5352.5 or later.
536
537.IP "\fBadd\-tlv\-map \fIswitch option\fR[\fB,\fIoption\fR]..."
538Add each \fIoption\fR to \fIswitch\fR's tables. Duplicate fields are
539rejected.
540.
541.IP "\fBdel\-tlv\-map \fIswitch \fR[\fIoption\fR[\fB,\fIoption\fR]]..."
542Delete each \fIoption\fR from \fIswitch\fR's table, or all option TLV
543mapping if no \fIoption\fR is specified.
544Fields that aren't mapped are ignored.
545.
546.IP "\fBdump\-tlv\-map \fIswitch\fR"
547Show the currently mapped fields in the switch's option table as well
548as switch capabilities.
549.
550.SS "OpenFlow Switch Monitoring Commands"
551.
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
557\fB@RUNDIR@/\fIswitch\fB.snoop\fR. \fBovs\-vswitchd\fR listens on
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
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
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
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
575the configured controller is disconnected, no traffic is sent, so
576monitoring will not show any traffic.
577.
578.IP "\fBmonitor \fIswitch\fR [\fImiss-len\fR] [\fBinvalid_ttl\fR] [\fBwatch:\fR[\fIspec\fR...]]"
579Connects to \fIswitch\fR and prints to the console all OpenFlow
580messages received. Usually, \fIswitch\fR should specify the name of a
581bridge in the \fBovs\-vswitchd\fR database.
582.IP
583If \fImiss-len\fR is provided, \fBovs\-ofctl\fR sends an OpenFlow ``set
584configuration'' message at connection setup time that requests
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
587\fBovs\-ofctl monitor\fR client connection unless a nonzero value is
588specified on this argument. (Thus, if \fImiss\-len\fR is not
589specified, very little traffic will ordinarily be printed.)
590.IP
591If \fBinvalid_ttl\fR is passed, \fBovs\-ofctl\fR sends an OpenFlow ``set
592configuration'' message at connection setup time that requests
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.
595Only OpenFlow 1.1 and 1.2 support \fBinvalid_ttl\fR; Open vSwitch also
596implements it for OpenFlow 1.0 as an extension.
597.IP
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.
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.
624.IP "\fBout_port=\fIport\fR"
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).
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
634This command may be useful for debugging switch or controller
635implementations. With \fBwatch:\fR, it is particularly useful for
636observing how a controller updates flow tables.
637.
638.SS "OpenFlow Switch and Controller Commands"
639.
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.
644.
645.TP
646\fBprobe \fItarget\fR
647Sends a single OpenFlow echo-request message to \fItarget\fR and waits
648for the response. With the \fB\-t\fR or \fB\-\-timeout\fR option, this
649command can test whether an OpenFlow switch or controller is up and
650running.
651.
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.
658.
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.
666.
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.
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.
690.SS "Flow Syntax"
691.PP
692Some \fBovs\-ofctl\fR commands accept an argument that describes a flow or
693flows. Such flow descriptions comprise a series of
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.)
698.PP
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
706protocol type) is wildcarded, so must be the L4 fields \fBtcp_dst\fR and
707\fBtcp_src\fR. \fBovs\-ofctl\fR will warn about
708flows not in normal form.
709.PP
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:
713.
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
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
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.
776.
777.PP
778The \fBadd\-flow\fR, \fBadd\-flows\fR, and \fBmod\-flows\fR commands
779require an additional field, which must be the final field specified:
780.
781.IP \fBactions=\fR[\fIaction\fR][\fB,\fIaction\fR...]\fR
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
787.PP
788An opaque identifier called a cookie can be used as a handle to identify
789a set of flows:
790.
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
799.
800When using NXM, the cookie can be used as a handle for querying,
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.
820.
821.PP
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
826specification. For \fBmod-flows\fR without \fB\-\-strict\fR,
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.
831.
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.
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.
846.
847.PP
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
853values do not update or affect existing flows.
854.
855.IP "\fBidle_timeout=\fIseconds\fR"
856Causes the flow to expire after the given number of seconds of
857inactivity. A value of 0 (the default) prevents a flow from expiring
858due to inactivity.
859.
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.
864.
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.
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.
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.
908.PP
909The \fBdump\-flows\fR, \fBdump\-aggregate\fR, \fBdel\-flow\fR
910and \fBdel\-flows\fR commands support these additional optional fields:
911.
912.TP
913\fBout_port=\fIport\fR
914If set, a matching flow must include an output action to \fIport\fR,
915which must be an OpenFlow port number or name (e.g. \fBlocal\fR).
916.
917.TP
918\fBout_group=\fIgroup\fR
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.
924.SS "Table Entry Output"
925.
926The \fBdump\-tables\fR and \fBdump\-aggregate\fR commands print information
927about the entries in a datapath's tables. Each line of output is a
928flow entry as described in \fBFlow Syntax\fR, above, plus some
929additional fields:
930.
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.
935.
936.IP \fBn_packets\fR
937The number of packets that have matched the entry.
938.
939.IP \fBn_bytes\fR
940The total number of bytes from packets that have matched the entry.
941.
942.PP
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.
960.
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
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
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.
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.
1010When this field is specified in \fBdel\-groups\fR or \fBdump\-groups\fR,
1011the keyword "all" may be used to designate all groups.
1012.
1013This field is required.
1014
1015
1016.IP \fBtype=\fItype\fR
1017The type of the group. The \fBadd-group\fR, \fBadd-groups\fR and
1018\fBmod-groups\fR commands require this field. It is prohibited for
1019other commands. The following keywords designated the allowed types:
1020.RS
1021.IP \fBall\fR
1022Execute all buckets in the group.
1023.IP \fBselect\fR
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.
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
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
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
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.
1089.RS
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
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.
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.
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.
1126.RE
1127.IP
1128This option uses a Netronome OpenFlow extension which is only supported
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
1138This option uses a Netronome OpenFlow extension which is only supported
1139when using Open vSwitch 2.4 and later with OpenFlow 1.5 and later.
1140
1141.IP \fBfields\fR=\fIfield\fR
1142.IQ \fBfields(\fIfield\fR[\fB=\fImask\fR]\fR...\fB)\fR
1143The field parameters to selection method selected by the
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.
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
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.
1169The fields for \fIbucket_parameters\fR are:
1170.
1171.RS
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
11771.5 specification. It is not supported when earlier versions
1178of OpenFlow are used. Open vSwitch will automatically allocate bucket
1179ids when they are not specified.
1180.IP \fBactions=\fR[\fIaction\fR][\fB,\fIaction\fR...]\fR
1181The syntax of actions are identical to the \fBactions=\fR field described in
1182\fBFlow Syntax\fR above. Specifying \fBactions=\fR is optional, any unknown
1183bucket parameter will be interpreted as an action.
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.
1191This or the \fBwatch_group\fR field can also be used
1192for groups whose \fBtype\fR is \fBselect\fR.
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.
1197This or the \fBwatch_port\fR field can also be used
1198for groups whose \fBtype\fR is \fBselect\fR.
1199.RE
1200.
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
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
1218When this field is specified in \fBdel-meter\fR, \fBdump-meter\fR, or
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.
1222.IP \fBkbps\fR
1223.IQ \fBpktps\fR
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.
1228
1229.IP \fBburst\fR
1230If set, enables burst support for meter bands through the \fBburst_size\fR
1231parameter.
1232
1233.IP \fBstats\fR
1234If set, enables the collection of meter and band statistics.
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
1255second, depending on whether \fBkbps\fR or \fBpktps\fR was specified.
1256.IP \fBburst_size=\fIsize\fR
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.
1261.RE
1262.
1263.SH OPTIONS
1264.TP
1265\fB\-\-strict\fR
1266Uses strict matching when running flow modification commands.
1267.
1268.IP "\fB\-\-names\fR"
1269.IQ "\fB\-\-no\-names\fR"
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
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,
1291but OpenFlow 1.0 to 1.5 limit port names to 15 bytes and OpenFlow 1.6
1292limits them to 63 bytes. Because \fRovs\-ofctl\fR uses OpenFlow to
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.
1299.IP
1300OpenFlow and Open vSwitch limit table names to 32 bytes.
1301.
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.
1309.IP "\fB\-\-read-only\fR"
1310Do not execute read/write commands.
1311.
1312.IP "\fB\-\-bundle\fR"
1313Execute flow mods as an OpenFlow 1.4 atomic bundle transaction.
1314.RS
1315.IP \(bu
1316Within a bundle, all flow mods are processed in the order they appear
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.
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.
1335.RE
1336.
1337.so lib/ofp-version.man
1338.
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:
1343.RS
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.
1347.
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)"
1355This Nicira extension to OpenFlow is flexible and extensible. It
1356supports all of the Nicira flow extensions, such as \fBtun_id\fR and
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.
1363.
1364.IP "\fBOXM-OpenFlow12\fR"
1365.IQ "\fBOXM-OpenFlow13\fR"
1366.IQ "\fBOXM-OpenFlow14\fR"
1367.IQ "\fBOXM-OpenFlow15\fR"
1368.IQ "\fBOXM-OpenFlow16\fR"
1369These are the standard OXM (OpenFlow Extensible Match) flow format in
1370OpenFlow 1.2 and later.
1371.RE
1372.
1373.IP
1374\fBovs\-ofctl\fR also supports the following abbreviations for
1375collections of flow formats:
1376.RS
1377.IP "\fBany\fR"
1378Any supported flow format.
1379.IP "\fBOpenFlow10\fR"
1380\fBOpenFlow10\-table_id\fR or \fBOpenFlow10+table_id\fR.
1381.IP "\fBNXM\fR"
1382\fBNXM\-table_id\fR or \fBNXM+table_id\fR.
1383.IP "\fBOXM\fR"
1384\fBOXM-OpenFlow12\fR, \fBOXM-OpenFlow13\fR, or \fBOXM-OpenFlow14\fR.
1385.RE
1386.
1387.IP
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.
1398.
1399.IP "\fB\-P \fIformat\fR"
1400.IQ "\fB\-\-packet\-in\-format=\fIformat\fR"
1401\fBovs\-ofctl\fR supports the following ``packet-in'' formats, in order of
1402increasing capability:
1403.RS
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
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.
1423.
1424.RE
1425.IP
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.
1444.
1445.IP "\fB\-\-timestamp\fR"
1446Print a timestamp before each received packet. This option only
1447affects the \fBmonitor\fR, \fBsnoop\fR, and \fBofp\-parse\-pcap\fR
1448commands.
1449.
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.
1455.
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
1473specify a TCP source port at all.
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.
1483.SS "Daemon Options"
1484.ds DD \
1485\fBovs\-ofctl\fR detaches only when executing the \fBmonitor\fR or \
1486\fBsnoop\fR commands.
1487.so lib/daemon.man
1488.so lib/unixctl.man
1489.SS "Public Key Infrastructure Options"
1490.so lib/ssl.man
1491.so lib/vlog.man
1492.so lib/colors.man
1493.so lib/common.man
1494.
1495.SH "RUNTIME MANAGEMENT COMMANDS"
1496\fBovs\-appctl\fR(8) can send commands to a running \fBovs\-ofctl\fR
1497process. The supported commands are listed below.
1498.
1499.IP "\fBexit\fR"
1500Causes \fBovs\-ofctl\fR to gracefully terminate. This command applies
1501only when executing the \fBmonitor\fR or \fBsnoop\fR commands.
1502.
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.
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.
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.
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.
1524.SH EXAMPLES
1525.
1526The following examples assume that \fBovs\-vswitchd\fR has a bridge
1527named \fBbr0\fR configured.
1528.
1529.TP
1530\fBovs\-ofctl dump\-tables br0\fR
1531Prints out the switch's table stats. (This is more interesting after
1532some traffic has passed through.)
1533.
1534.TP
1535\fBovs\-ofctl dump\-flows br0\fR
1536Prints the flow entries in the switch.
1537.
1538.TP
1539\fBovs\-ofctl add\-flow table=0 actions=learn(table=1,hard_timeout=10, NXM_OF_VLAN_TCI[0..11],output:NXM_OF_IN_PORT[]), resubmit(,1)\fR
1540\fBovs\-ofctl add\-flow table=1 priority=0 actions=flood\fR
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,
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
1551Additional examples may be found documented as part of related sections.
1552.
1553.SH "SEE ALSO"
1554.
1555.BR ovs\-fields (7),
1556.BR ovs\-actions (7),
1557.BR ovs\-appctl (8),
1558.BR ovs\-vswitchd (8),
1559.BR ovs\-vswitchd.conf.db (8)