]> git.proxmox.com Git - mirror_ovs.git/blame - utilities/ovs-ofctl.8.in
Introduce 128-bit xxregs.
[mirror_ovs.git] / utilities / ovs-ofctl.8.in
CommitLineData
a9b4a41a
BP
1.\" -*- nroff -*-
2.de IQ
3. br
4. ns
5. IP "\\$1"
6..
d2cb6c95 7.TH ovs\-ofctl 8 "@VERSION@" "Open vSwitch" "Open vSwitch Manual"
064af421 8.ds PN ovs\-ofctl
a9b4a41a 9.
064af421
BP
10.SH NAME
11ovs\-ofctl \- administer OpenFlow switches
a9b4a41a 12.
064af421
BP
13.SH SYNOPSIS
14.B ovs\-ofctl
15[\fIoptions\fR] \fIcommand \fR[\fIswitch\fR] [\fIargs\fR\&...]
a9b4a41a 16.
064af421
BP
17.SH DESCRIPTION
18The
19.B ovs\-ofctl
20program is a command line tool for monitoring and administering
21OpenFlow switches. It can also show the current state of an OpenFlow
22switch, including features, configuration, and table entries.
0d8e9638 23It should work with any OpenFlow switch, not just Open vSwitch.
a9b4a41a 24.
064af421 25.SS "OpenFlow Switch Management Commands"
a9b4a41a 26.PP
064af421
BP
27These commands allow \fBovs\-ofctl\fR to monitor and administer an OpenFlow
28switch. It is able to show the current state of a switch, including
29features, configuration, and table entries.
a9b4a41a 30.PP
064af421
BP
31Most of these commands take an argument that specifies the method for
32connecting to an OpenFlow switch. The following connection methods
33are supported:
a9b4a41a 34.
064af421 35.RS
84ee7bcf
BP
36.so lib/vconn-active.man
37.
064af421
BP
38.IP "\fIfile\fR"
39This is short for \fBunix:\fIfile\fR, as long as \fIfile\fR does not
40contain a colon.
84ee7bcf 41.
1a6f1e2a
JG
42.IP \fIbridge\fR
43This is short for \fBunix:@RUNDIR@/\fIbridge\fB.mgmt\fR, as long as
44\fIbridge\fR does not contain a colon.
45.
46.IP [\fItype\fB@\fR]\fIdp\fR
47Attempts to look up the bridge associated with \fIdp\fR and open as
48above. If \fItype\fR is given, it specifies the datapath provider of
49\fIdp\fR, otherwise the default provider \fBsystem\fR is assumed.
064af421 50.RE
a9b4a41a 51.
064af421
BP
52.TP
53\fBshow \fIswitch\fR
54Prints to the console information on \fIswitch\fR, including
55information on its flow tables and ports.
a9b4a41a 56.
064af421 57.TP
4e312e69 58\fBdump\-tables \fIswitch\fR
064af421
BP
59Prints to the console statistics for each of the flow tables used by
60\fIswitch\fR.
5deff5aa
AW
61.TP
62\fBdump\-table\-features \fIswitch\fR
63Prints to the console features for each of the flow tables used by
64\fIswitch\fR.
03c72922
BP
65.TP
66\fBdump\-table\-desc \fIswitch\fR
67Prints to the console configuration for each of the flow tables used
68by \fIswitch\fR for OpenFlow 1.4+.
82c22d34
BP
69.IP "\fBmod\-table \fIswitch\fR \fItable_id\fR \fIsetting\fR"
70This command configures flow table settings for OpenFlow table
71\fItable_id\fR within \fIswitch\fR. The available settings depend on
72the OpenFlow version in use. In OpenFlow 1.1 and 1.2 (which must be
73enabled with the \fB\-O\fR option) only, \fBmod\-table\fR configures
74behavior when no flow is found when a packet is looked up in a flow
75table. The following \fIsetting\fR values are available:
c354fcc5
TG
76.RS
77.IP \fBdrop\fR
78Drop the packet.
79.IP \fBcontinue\fR
80Continue to the next table in the pipeline. (This is how an OpenFlow
811.0 switch always handles packets that do not match any flow, in
82tables other than the last one.)
83.IP \fBcontroller\fR
84Send to controller. (This is how an OpenFlow 1.0 switch always
85handles packets that do not match any flow in the last table.)
86.RE
82c22d34
BP
87.IP
88In OpenFlow 1.4 and later (which must be enabled with the \fB\-O\fR
89option) only, \fBmod\-table\fR configures the behavior when a
90controller attempts to add a flow to a flow table that is full. The
91following \fIsetting\fR values are available:
92.RS
93.IP \fBevict\fR
94Delete some existing flow from the flow table, according to the
95algorithm described for the \fBFlow_Table\fR table in
96\fBovs-vswitchd.conf.db\fR(5).
97.IP \fBnoevict\fR
98Refuse to add the new flow. (Eviction might still be enabled through
de7d3c07 99the \fBoverflow_policy\fR column in the \fBFlow_Table\fR table
82c22d34 100documented in \fBovs-vswitchd.conf.db\fR(5).)
de7d3c07
SJ
101.IP \fBvacancy:\fIlow\fB,\fIhigh\fR
102Enables sending vacancy events to controllers using \fBTABLE_STATUS\fR
103messages, based on percentage thresholds \fIlow\fR and \fIhigh\fR.
104.IP \fBnovacancy\fR
105Disables vacancy events.
82c22d34 106.RE
c354fcc5 107.
064af421 108.TP
4e312e69 109\fBdump\-ports \fIswitch\fR [\fInetdev\fR]
abaad8cf
JP
110Prints to the console statistics for network devices associated with
111\fIswitch\fR. If \fInetdev\fR is specified, only the statistics
112associated with that device will be printed. \fInetdev\fR can be an
113OpenFlow assigned port number or device name, e.g. \fBeth0\fR.
a9b4a41a 114.
70ae4f93 115.IP "\fBdump\-ports\-desc \fIswitch\fR [\fIport\fR]"
2be393ed 116Prints to the console detailed information about network devices
70ae4f93
BP
117associated with \fIswitch\fR. To dump only a specific port, specify
118its number as \fIport\fR. Otherwise, if \fIport\fR is omitted, or if
119it is specified as \fBANY\fR, then all ports are printed. This is a
120subset of the information provided by the \fBshow\fR command.
121.IP
122If the connection to \fIswitch\fR negotiates OpenFlow 1.0, 1.2, or
1231.2, this command uses an OpenFlow extension only implemented in Open
124vSwitch (version 1.7 and later).
125.IP
126Only OpenFlow 1.5 and later support dumping a specific port. Earlier
127versions of OpenFlow always dump all ports.
2be393ed 128.
c6100d92
BP
129.IP "\fBmod\-port \fIswitch\fR \fIport\fR \fIaction\fR"
130Modify characteristics of port \fBport\fR in \fIswitch\fR. \fIport\fR
131may be an OpenFlow port number or name or the keyword \fBLOCAL\fR (the
132preferred way to refer to the OpenFlow local port). The \fIaction\fR
133may be any one of the following:
a9b4a41a 134.
064af421 135.RS
28124950
BP
136.IQ \fBup\fR
137.IQ \fBdown\fR
138Enable or disable the interface. This is equivalent to \fBifconfig
139up\fR or \fBifconfig down\fR on a Unix system.
140.
141.IP \fBstp\fR
142.IQ \fBno\-stp\fR
143Enable or disable 802.1D spanning tree protocol (STP) on the
144interface. OpenFlow implementations that don't support STP will
145refuse to enable it.
146.
147.IP \fBreceive\fR
148.IQ \fBno\-receive\fR
149.IQ \fBreceive\-stp\fR
150.IQ \fBno\-receive\-stp\fR
151Enable or disable OpenFlow processing of packets received on this
152interface. When packet processing is disabled, packets will be
153dropped instead of being processed through the OpenFlow table. The
154\fBreceive\fR or \fBno\-receive\fR setting applies to all packets
155except 802.1D spanning tree packets, which are separately controlled
156by \fBreceive\-stp\fR or \fBno\-receive\-stp\fR.
a9b4a41a 157.
451256f6 158.IP \fBforward\fR
28124950
BP
159.IQ \fBno\-forward\fR
160Allow or disallow forwarding of traffic to this interface. By
161default, forwarding is enabled.
451256f6 162.
064af421 163.IP \fBflood\fR
28124950
BP
164.IQ \fBno\-flood\fR
165Controls whether an OpenFlow \fBflood\fR action will send traffic out
166this interface. By default, flooding is enabled. Disabling flooding
167is primarily useful to prevent loops when a spanning tree protocol is
168not in use.
169.
170.IP \fBpacket\-in\fR
171.IQ \fBno\-packet\-in\fR
172Controls whether packets received on this interface that do not match
173a flow table entry generate a ``packet in'' message to the OpenFlow
174controller. By default, ``packet in'' messages are enabled.
064af421 175.RE
28124950
BP
176.IP
177The \fBshow\fR command displays (among other information) the
178configuration that \fBmod\-port\fR changes.
a9b4a41a 179.
7257b535
BP
180.IP "\fBget\-frags \fIswitch\fR"
181Prints \fIswitch\fR's fragment handling mode. See \fBset\-frags\fR,
182below, for a description of each fragment handling mode.
183.IP
184The \fBshow\fR command also prints the fragment handling mode among
185its other output.
186.
187.IP "\fBset\-frags \fIswitch frag_mode\fR"
188Configures \fIswitch\fR's treatment of IPv4 and IPv6 fragments. The
189choices for \fIfrag_mode\fR are:
190.RS
191.IP "\fBnormal\fR"
192Fragments pass through the flow table like non-fragmented packets.
193The TCP ports, UDP ports, and ICMP type and code fields are always set
194to 0, even for fragments where that information would otherwise be
195available (fragments with offset 0). This is the default fragment
196handling mode for an OpenFlow switch.
197.IP "\fBdrop\fR"
198Fragments are dropped without passing through the flow table.
199.IP "\fBreassemble\fR"
200The switch reassembles fragments into full IP packets before passing
201them through the flow table. Open vSwitch does not implement this
202fragment handling mode.
203.IP "\fBnx\-match\fR"
204Fragments pass through the flow table like non-fragmented packets.
205The TCP ports, UDP ports, and ICMP type and code fields are available
206for matching for fragments with offset 0, and set to 0 in fragments
207with nonzero offset. This mode is a Nicira extension.
208.RE
209.IP
210See the description of \fBip_frag\fR, below, for a way to match on
211whether a packet is a fragment and on its fragment offset.
212.
064af421 213.TP
4e312e69 214\fBdump\-flows \fIswitch \fR[\fIflows\fR]
064af421
BP
215Prints to the console all flow entries in \fIswitch\fR's
216tables that match \fIflows\fR. If \fIflows\fR is omitted, all flows
217in the switch are retrieved. See \fBFlow Syntax\fR, below, for the
bdcc5925 218syntax of \fIflows\fR. The output format is described in
064af421 219\fBTable Entry Output\fR.
a9b4a41a 220.
bdcc5925
BP
221.IP
222By default, \fBovs\-ofctl\fR prints flow entries in the same order
223that the switch sends them, which is unlikely to be intuitive or
224consistent. See the description of \fB\-\-sort\fR and \fB\-\-rsort\fR,
225under \fBOPTIONS\fR below, to influence the display order.
226.
064af421 227.TP
4e312e69 228\fBdump\-aggregate \fIswitch \fR[\fIflows\fR]
bdcc5925 229Prints to the console aggregate statistics for flows in
064af421
BP
230\fIswitch\fR's tables that match \fIflows\fR. If \fIflows\fR is omitted,
231the statistics are aggregated across all flows in the switch's flow
232tables. See \fBFlow Syntax\fR, below, for the syntax of \fIflows\fR.
3845a3fd 233The output format is described in \fBTable Entry Output\fR.
a9b4a41a 234.
d2805da2
BP
235.IP "\fBqueue\-stats \fIswitch \fR[\fIport \fR[\fIqueue\fR]]"
236Prints to the console statistics for the specified \fIqueue\fR on
c6100d92
BP
237\fIport\fR within \fIswitch\fR. \fIport\fR can be an OpenFlow port
238number or name, the keyword \fBLOCAL\fR (the preferred way to refer to
239the OpenFlow local port), or the keyword \fBALL\fR. Either of
240\fIport\fR or \fIqueue\fR or both may be omitted (or equivalently the
241keyword \fBALL\fR). If both are omitted, statistics are printed for
242all queues on all ports. If only \fIqueue\fR is omitted, then
243statistics are printed for all queues on \fIport\fR; if only
244\fIport\fR is omitted, then statistics are printed for \fIqueue\fR on
245every port where it exists.
d2805da2 246.
e016fb63
BP
247.IP "\fBqueue\-get\-config \fIswitch [\fIport \fR[\fIqueue\fR]]"
248Prints to the console the configuration of \fIqueue\fR on \fIport\fR
249in \fIswitch\fR. If \fIport\fR is omitted or \fBANY\fR, reports
250queues for all port. If \fIqueue\fR is omitted or \fBANY\fR, reports
251all queues. For OpenFlow 1.3 and earlier, the output always includes
252all queues, ignoring \fIqueue\fR if specified.
56085be5
BP
253.IP
254This command has limited usefulness, because ports often have no
255configured queues and because the OpenFlow protocol provides only very
256limited information about the configuration of a queue.
257.
fb8f22c1
BY
258.IP "\fBdump\-ipfix\-bridge \fIswitch
259Prints to the console the statistics of bridge IPFIX for \fIswitch\fR.
260If bridge IPFIX is configured on the \fIswitch\fR, IPFIX statistics
261can be retrieved. Otherwise, error message will be printed.
262.IP
263This command uses an Open vSwitch extension that is only in Open
264vSwitch 2.6 and later.
265.
266.IP "\fBdump\-ipfix\-flow \fIswitch
267Prints to the console the statistics of flow-based IPFIX for
268\fIswitch\fR. If flow-based IPFIX is configured on the \fIswitch\fR,
269statistics of all the collector set ids on the \fIswitch\fR will be
270printed. Otherwise, print error message.
271.IP
272Refer to \fBovs-vswitchd.conf.db\fR(5) for more details on configuring
273flow based IPFIX and collector set ids.
274.IP
275This command uses an Open vSwitch extension that is only in Open
276vSwitch 2.6 and later.
277.
3200ed58 278.SS "OpenFlow 1.1+ Group Table Commands"
7395c052
NZ
279.
280The following commands work only with switches that support OpenFlow
2811.1 or later. Because support for OpenFlow 1.1 and later is still
282experimental in Open vSwitch, it is necessary to explicitly enable
283these protocol versions in \fBovs\-ofctl\fR (using \fB\-O\fR) and in
284the switch itself (with the \fBprotocols\fR column in the \fBBridge\fR
285table). For more information, see ``Q: What versions of OpenFlow does
286Open vSwitch support?'' in the Open vSwitch FAQ.
287.
19187a71
BP
288.IP "\fBdump\-groups \fIswitch\fR [\fIgroup\fR]"
289Prints group entries in \fIswitch\fR's tables to console. To dump
290only a specific group, specify its number as \fIgroup\fR. Otherwise,
291if \fIgroup\fR is omitted, or if it is specified as \fBALL\fR, then
292all groups are printed. Each line of output is a group entry as
293described in \fBGroup Syntax\fR below.
294.IP
295Only OpenFlow 1.5 and later support dumping a specific group. Earlier
296versions of OpenFlow always dump all groups.
7395c052
NZ
297.
298.IP "\fBdump\-group\-features \fIswitch"
299Prints to the console the group features of the \fIswitch\fR.
300.
301.IP "\fBdump\-group-stats \fIswitch \fR[\fIgroups\fR]"
302Prints to the console statistics for the specified \fIgroups in the
303\fIswitch\fR's tables. If \fIgroups\fR is omitted then statistics for all
304groups are printed. See \fBGroup Syntax\fR, below, for the syntax of
305\fIgroups\fR.
306.
3200ed58
JR
307.SS "OpenFlow 1.3+ Switch Meter Table Commands"
308.
309These commands manage the meter table in an OpenFlow switch. In each
310case, \fImeter\fR specifies a meter entry in the format described in
311\fBMeter Syntax\fR, below.
312.
313.PP
314OpenFlow 1.3 introduced support for meters, so these commands only
315work with switches that support OpenFlow 1.3 or later. The caveats
316described for groups in the previous section also apply to meters.
317.
318.IP "\fBadd\-meter \fIswitch meter\fR"
319Add a meter entry to \fIswitch\fR's tables. The \fImeter\fR syntax is
320described in section \fBMeter Syntax\fR, below.
321.
322.IP "\fBmod\-meter \fIswitch meter\fR"
323Modify an existing meter.
324.
325.IP "\fBdel\-meters \fIswitch\fR"
326.IQ "\fBdel\-meter \fIswitch\fR [\fImeter\fR]"
327Delete entries from \fIswitch\fR's meter table. \fImeter\fR can specify
328a single meter with syntax \fBmeter=\fIid\fR, or all meters with syntax
329\fBmeter=all\fR.
330.
331.IP "\fBdump\-meters \fIswitch\fR"
332.IQ "\fBdump\-meter \fIswitch\fR [\fImeter\fR]"
333Print meter configuration. \fImeter\fR can specify a single meter with
334syntax \fBmeter=\fIid\fR, or all meters with syntax \fBmeter=all\fR.
335.
336.IP "\fBmeter\-stats \fIswitch\fR [\fImeter\fR]"
337Print meter statistics. \fImeter\fR can specify a single meter with
338syntax \fBmeter=\fIid\fR, or all meters with syntax \fBmeter=all\fR.
339.
340.IP "\fBmeter\-features \fIswitch\fR"
341Print meter features.
342.
4989c59f
BP
343.SS "OpenFlow Switch Flow Table Commands"
344.
345These commands manage the flow table in an OpenFlow switch. In each
346case, \fIflow\fR specifies a flow entry in the format described in
db5076ee
JR
347\fBFlow Syntax\fR, below, \fIfile\fR is a text file that contains zero
348or more flows in the same syntax, one per line, and the optional
39c94593
JR
349\fB\-\-bundle\fR option operates the command as a single atomic
350transation, see option \fB\-\-bundle\fR, below.
db5076ee
JR
351.
352.IP "[\fB\-\-bundle\fR] \fBadd\-flow \fIswitch flow\fR"
353.IQ "[\fB\-\-bundle\fR] \fBadd\-flow \fIswitch \fB\- < \fIfile\fR"
354.IQ "[\fB\-\-bundle\fR] \fBadd\-flows \fIswitch file\fR"
4989c59f
BP
355Add each flow entry to \fIswitch\fR's tables.
356.
db5076ee
JR
357Each flow specification (e.g., each line in \fIfile\fR) may start with
358\fBadd\fR, \fBmodify\fR, \fBdelete\fR, \fBmodify_strict\fR, or
359\fBdelete_strict\fR keyword to specify whether a flow is to be added,
360modified, or deleted, and whether the modify or delete is strict or
361not. For backwards compatibility a flow specification without one of
362these keywords is treated as a flow add. All flow mods are executed
363in the order specified.
364.
365.IP "[\fB\-\-bundle\fR] [\fB\-\-strict\fR] \fBmod\-flows \fIswitch flow\fR"
366.IQ "[\fB\-\-bundle\fR] [\fB\-\-strict\fR] \fBmod\-flows \fIswitch \fB\- < \fIfile\fR"
4989c59f
BP
367Modify the actions in entries from \fIswitch\fR's tables that match
368the specified flows. With \fB\-\-strict\fR, wildcards are not treated
369as active for matching purposes.
370.
db5076ee
JR
371.IP "[\fB\-\-bundle\fR] \fBdel\-flows \fIswitch\fR"
372.IQ "[\fB\-\-bundle\fR] [\fB\-\-strict\fR] \fBdel\-flows \fIswitch \fR[\fIflow\fR]"
373.IQ "[\fB\-\-bundle\fR] [\fB\-\-strict\fR] \fBdel\-flows \fIswitch \fB\- < \fIfile\fR"
4989c59f
BP
374Deletes entries from \fIswitch\fR's flow table. With only a
375\fIswitch\fR argument, deletes all flows. Otherwise, deletes flow
376entries that match the specified flows. With \fB\-\-strict\fR,
377wildcards are not treated as active for matching purposes.
a9b4a41a 378.
db5076ee 379.IP "[\fB\-\-bundle\fR] [\fB\-\-readd\fR] \fBreplace\-flows \fIswitch file\fR"
0199c526
BP
380Reads flow entries from \fIfile\fR (or \fBstdin\fR if \fIfile\fR is
381\fB\-\fR) and queries the flow table from \fIswitch\fR. Then it fixes
382up any differences, adding flows from \fIflow\fR that are missing on
383\fIswitch\fR, deleting flows from \fIswitch\fR that are not in
384\fIfile\fR, and updating flows in \fIswitch\fR whose actions, cookie,
385or timeouts differ in \fIfile\fR.
386.
c4ea79bf
BP
387.IP
388With \fB\-\-readd\fR, \fBovs\-ofctl\fR adds all the flows from
389\fIfile\fR, even those that exist with the same actions, cookie, and
390timeout in \fIswitch\fR. This resets all the flow packet and byte
391counters to 0, which can be useful for debugging.
392.
0199c526
BP
393.IP "\fBdiff\-flows \fIsource1 source2\fR"
394Reads flow entries from \fIsource1\fR and \fIsource2\fR and prints the
395differences. A flow that is in \fIsource1\fR but not in \fIsource2\fR
396is printed preceded by a \fB\-\fR, and a flow that is in \fIsource2\fR
397but not in \fIsource1\fR is printed preceded by a \fB+\fR. If a flow
398exists in both \fIsource1\fR and \fIsource2\fR with different actions,
399cookie, or timeouts, then both versions are printed preceded by
400\fB\-\fR and \fB+\fR, respectively.
401.IP
402\fIsource1\fR and \fIsource2\fR may each name a file or a switch. If
403a name begins with \fB/\fR or \fB.\fR, then it is considered to be a
404file name. A name that contains \fB:\fR is considered to be a switch.
405Otherwise, it is a file if a file by that name exists, a switch if
406not.
407.IP
408For this command, an exit status of 0 means that no differences were
409found, 1 means that an error occurred, and 2 means that some
410differences were found.
411.
0c3d5fc8
BP
412.IP "\fBpacket\-out \fIswitch in_port actions packet\fR..."
413Connects to \fIswitch\fR and instructs it to execute the OpenFlow
4eb58d34
BP
414\fIactions\fR on each \fIpacket\fR. Each \fBpacket\fR is specified as a
415series of hex digits. For the purpose of executing the
0c3d5fc8 416actions, the packets are considered to have arrived on \fIin_port\fR,
c6100d92
BP
417which may be an OpenFlow port number or name (e.g. \fBeth0\fR), the
418keyword \fBLOCAL\fR (the preferred way to refer to the OpenFlow
419``local'' port), or the keyword \fBNONE\fR to indicate that the packet
420was generated by the switch itself.
0c3d5fc8 421.
7395c052
NZ
422.SS "OpenFlow Switch Group Table Commands"
423.
424These commands manage the group table in an OpenFlow switch. In each
425case, \fIgroup\fR specifies a group entry in the format described in
426\fBGroup Syntax\fR, below, and \fIfile\fR is a text file that contains
427zero or more groups in the same syntax, one per line.
428
429.IP "\fBadd\-group \fIswitch group\fR"
430.IQ "\fBadd\-group \fIswitch \fB\- < \fIfile\fR"
431.IQ "\fBadd\-groups \fIswitch file\fR"
432Add each group entry to \fIswitch\fR's tables.
433.
88b87a36
JS
434.IP "[\fB\-\-may\-create\fR] \fBmod\-group \fIswitch group\fR"
435.IQ "[\fB\-\-may\-create\fR] \fBmod\-group \fIswitch \fB\- < \fIfile\fR"
7395c052 436Modify the action buckets in entries from \fIswitch\fR's tables for
88b87a36
JS
437each group entry. If a specified group does not already exist, then
438without \fB\-\-may\-create\fR, this command has no effect; with
439\fB\-\-may\-create\fR, it creates a new group. The
440\fB\-\-may\-create\fR option uses an Open vSwitch extension to
441OpenFlow only implemented in Open vSwitch 2.6 and later.
7395c052
NZ
442.
443.IP "\fBdel\-groups \fIswitch\fR"
444.IQ "\fBdel\-groups \fIswitch \fR[\fIgroup\fR]"
445.IQ "\fBdel\-groups \fIswitch \fB\- < \fIfile\fR"
446Deletes entries from \fIswitch\fR's group table. With only a
447\fIswitch\fR argument, deletes all groups. Otherwise, deletes the group
448for each group entry.
449.
bdbb8426
SH
450.IP "\fBinsert\-buckets \fIswitch group\fR"
451.IQ "\fBinsert\-buckets \fIswitch \fB\- < \fIfile\fR"
452Add buckets to an existing group present in the \fIswitch\fR's group table.
453If no \fIcommand_bucket_id\fR is present in the group specification then all
454buckets of the group are removed.
455.
456.IP "\fBremove\-buckets \fIswitch group\fR"
457.IQ "\fBremove\-buckets \fIswitch \fB\- < \fIfile\fR"
458Remove buckets to an existing group present in the \fIswitch\fR's group table.
459If no \fIcommand_bucket_id\fR is present in the group specification then all
460buckets of the group are removed.
461.
4e548ad9 462.SS "OpenFlow Switch Tunnel TLV Table Commands"
6159c531 463.
4e548ad9
ML
464Open vSwitch maintains a mapping table between tunnel option TLVs (defined
465by <class, type, length>) and NXM fields \fBtun_metadata\fIn\fR,
1e71b944 466where \fIn\fR ranges from 0 to 63, that can be operated on for the
4e548ad9
ML
467purposes of matches, actions, etc. This TLV table can be used for
468Geneve option TLVs or other protocols with options in same TLV format
469as Geneve options. This mapping must be explicitly specified by the user
470through the following commands.
6159c531 471
4e548ad9 472A TLV mapping is specified with the syntax
1e71b944
BP
473\fB{class=\fIclass\fB,type=\fItype\fB,len=\fIlength\fB}->tun_metadata\fIn\fR.
474When an option mapping exists for a given \fBtun_metadata\fIn\fR,
475matching on the defined field becomes possible, e.g.:
476
477.RS
4e548ad9 478ovs-ofctl add-tlv-map br0 "{class=0xffff,type=0,len=4}->tun_metadata0"
1e71b944
BP
479.PP
480ovs-ofctl add-flow br0 tun_metadata0=1234,actions=controller
481.RE
482
483A mapping should not be changed while it is in active
484use by a flow. The result of doing so is undefined.
6159c531 485
4e548ad9 486Currently, the TLV mapping table is shared between all OpenFlow
9558d2a5
JG
487switches in a given instance of Open vSwitch. This restriction will
488be lifted in the future to allow for easier management.
489
6159c531
JG
490These commands are Nicira extensions to OpenFlow and require Open vSwitch
4912.5 or later.
492
b8e2f655 493.IP "\fBadd\-tlv\-map \fIswitch option\fR[\fB,\fIoption\fR]..."
1e71b944 494Add each \fIoption\fR to \fIswitch\fR's tables. Duplicate fields are
6159c531
JG
495rejected.
496.
b8e2f655 497.IP "\fBdel\-tlv\-map \fIswitch \fR[\fIoption\fR[\fB,\fIoption\fR]]..."
4e548ad9 498Delete each \fIoption\fR from \fIswitch\fR's table, or all option TLV
1e71b944
BP
499mapping if no \fIoption\fR is specified.
500Fields that aren't mapped are ignored.
6159c531 501.
b8e2f655 502.IP "\fBdump\-tlv\-map \fIswitch\fR"
6159c531
JG
503Show the currently mapped fields in the switch's option table as well
504as switch capabilities.
505.
4989c59f
BP
506.SS "OpenFlow Switch Monitoring Commands"
507.
0caf6bde
BP
508.IP "\fBsnoop \fIswitch\fR"
509Connects to \fIswitch\fR and prints to the console all OpenFlow
510messages received. Unlike other \fBovs\-ofctl\fR commands, if
511\fIswitch\fR is the name of a bridge, then the \fBsnoop\fR command
512connects to a Unix domain socket named
421e818c 513\fB@RUNDIR@/\fIswitch\fB.snoop\fR. \fBovs\-vswitchd\fR listens on
0caf6bde
BP
514such a socket for each bridge and sends to it all of the OpenFlow
515messages sent to or received from its configured OpenFlow controller.
516Thus, this command can be used to view OpenFlow protocol activity
517between a switch and its controller.
518.IP
519When a switch has more than one controller configured, only the
e2bfacb6
BP
520traffic to and from a single controller is output. If none of the
521controllers is configured as a master or a slave (using a Nicira
70d0aed3
BP
522extension to OpenFlow 1.0 or 1.1, or a standard request in OpenFlow
5231.2 or later), then a controller is chosen arbitrarily among
e2bfacb6
BP
524them. If there is a master controller, it is chosen; otherwise, if
525there are any controllers that are not masters or slaves, one is
526chosen arbitrarily; otherwise, a slave controller is chosen
527arbitrarily. This choice is made once at connection time and does not
528change as controllers reconfigure their roles.
529.IP
530If a switch has no controller configured, or if
0caf6bde
BP
531the configured controller is disconnected, no traffic is sent, so
532monitoring will not show any traffic.
533.
2b07c8b1 534.IP "\fBmonitor \fIswitch\fR [\fImiss-len\fR] [\fBinvalid_ttl\fR] [\fBwatch:\fR[\fIspec\fR...]]"
064af421 535Connects to \fIswitch\fR and prints to the console all OpenFlow
045b2e5c
BP
536messages received. Usually, \fIswitch\fR should specify the name of a
537bridge in the \fBovs\-vswitchd\fR database.
a9b4a41a 538.IP
064af421
BP
539If \fImiss-len\fR is provided, \fBovs\-ofctl\fR sends an OpenFlow ``set
540configuration'' message at connection setup time that requests
0caf6bde
BP
541\fImiss-len\fR bytes of each packet that misses the flow table. Open vSwitch
542does not send these and other asynchronous messages to an
064af421 543\fBovs\-ofctl monitor\fR client connection unless a nonzero value is
0caf6bde
BP
544specified on this argument. (Thus, if \fImiss\-len\fR is not
545specified, very little traffic will ordinarily be printed.)
a9b4a41a 546.IP
f0fd1a17
PS
547If \fBinvalid_ttl\fR is passed, \fBovs\-ofctl\fR sends an OpenFlow ``set
548configuration'' message at connection setup time that requests
5484c47a
BP
549\fBINVALID_TTL_TO_CONTROLLER\fR, so that \fBovs\-ofctl monitor\fR can
550receive ``packet-in'' messages when TTL reaches zero on \fBdec_ttl\fR action.
ad99e2ed
BP
551Only OpenFlow 1.1 and 1.2 support \fBinvalid_ttl\fR; Open vSwitch also
552implements it for OpenFlow 1.0 as an extension.
f0fd1a17 553.IP
2b07c8b1
BP
554\fBwatch:\fR[\fB\fIspec\fR...] causes \fBovs\-ofctl\fR to send a
555``monitor request'' Nicira extension message to the switch at
556connection setup time. This message causes the switch to send
557information about flow table changes as they occur. The following
558comma-separated \fIspec\fR syntax is available:
559.RS
560.IP "\fB!initial\fR"
561Do not report the switch's initial flow table contents.
562.IP "\fB!add\fR"
563Do not report newly added flows.
564.IP "\fB!delete\fR"
565Do not report deleted flows.
566.IP "\fB!modify\fR"
567Do not report modifications to existing flows.
568.IP "\fB!own\fR"
569Abbreviate changes made to the flow table by \fBovs\-ofctl\fR's own
570connection to the switch. (These could only occur using the
571\fBofctl/send\fR command described below under \fBRUNTIME MANAGEMENT
572COMMANDS\fR.)
573.IP "\fB!actions\fR"
574Do not report actions as part of flow updates.
575.IP "\fBtable=\fInumber\fR"
576Limits the monitoring to the table with the given \fInumber\fR between
5770 and 254. By default, all tables are monitored.
578.IP "\fBout_port=\fIport\fR"
c6100d92
BP
579If set, only flows that output to \fIport\fR are monitored. The
580\fIport\fR may be an OpenFlow port number or keyword
581(e.g. \fBLOCAL\fR).
2b07c8b1
BP
582.IP "\fIfield\fB=\fIvalue\fR"
583Monitors only flows that have \fIfield\fR specified as the given
584\fIvalue\fR. Any syntax valid for matching on \fBdump\-flows\fR may
585be used.
586.RE
587.IP
064af421 588This command may be useful for debugging switch or controller
2b07c8b1
BP
589implementations. With \fBwatch:\fR, it is particularly useful for
590observing how a controller updates flow tables.
a9b4a41a 591.
064af421 592.SS "OpenFlow Switch and Controller Commands"
a9b4a41a 593.
064af421
BP
594The following commands, like those in the previous section, may be
595applied to OpenFlow switches, using any of the connection methods
596described in that section. Unlike those commands, these may also be
597applied to OpenFlow controllers.
a9b4a41a 598.
064af421
BP
599.TP
600\fBprobe \fItarget\fR
601Sends a single OpenFlow echo-request message to \fItarget\fR and waits
4e312e69 602for the response. With the \fB\-t\fR or \fB\-\-timeout\fR option, this
064af421
BP
603command can test whether an OpenFlow switch or controller is up and
604running.
a9b4a41a 605.
064af421
BP
606.TP
607\fBping \fItarget \fR[\fIn\fR]
608Sends a series of 10 echo request packets to \fItarget\fR and times
609each reply. The echo request packets consist of an OpenFlow header
610plus \fIn\fR bytes (default: 64) of randomly generated payload. This
611measures the latency of individual requests.
a9b4a41a 612.
064af421
BP
613.TP
614\fBbenchmark \fItarget n count\fR
615Sends \fIcount\fR echo request packets that each consist of an
616OpenFlow header plus \fIn\fR bytes of payload and waits for each
617response. Reports the total time required. This is a measure of the
618maximum bandwidth to \fItarget\fR for round-trips of \fIn\fR-byte
619messages.
a9b4a41a 620.
1ac0e975
BP
621.SS "Other Commands"
622.
623.IP "\fBofp\-parse\fR \fIfile\fR"
624Reads \fIfile\fR (or \fBstdin\fR if \fIfile\fR is \fB\-\fR) as a
625series of OpenFlow messages in the binary format used on an OpenFlow
626connection, and prints them to the console. This can be useful for
627printing OpenFlow messages captured from a TCP stream.
628.
f3dd1419
BP
629.IP "\fBofp\-parse\-pcap\fR \fIfile\fR [\fIport\fR...]"
630Reads \fIfile\fR, which must be in the PCAP format used by network
631capture tools such as \fBtcpdump\fR or \fBwireshark\fR, extracts all
632the TCP streams for OpenFlow connections, and prints the OpenFlow
633messages in those connections in human-readable format on
634\fBstdout\fR.
635.IP
636OpenFlow connections are distinguished by TCP port number.
637Non-OpenFlow packets are ignored. By default, data on TCP ports 6633
638and 6653 are considered to be OpenFlow. Specify one or more
639\fIport\fR arguments to override the default.
640.IP
641This command cannot usefully print SSL encrypted traffic. It does not
642understand IPv6.
643.
064af421 644.SS "Flow Syntax"
a9b4a41a 645.PP
064af421
BP
646Some \fBovs\-ofctl\fR commands accept an argument that describes a flow or
647flows. Such flow descriptions comprise a series
648\fIfield\fB=\fIvalue\fR assignments, separated by commas or white
649space. (Embedding spaces into a flow description normally requires
650quoting to prevent the shell from breaking the description into
651multiple arguments.)
a9b4a41a 652.PP
0b3f2725
BP
653Flow descriptions should be in \fBnormal form\fR. This means that a
654flow may only specify a value for an L3 field if it also specifies a
655particular L2 protocol, and that a flow may only specify an L4 field
656if it also specifies particular L2 and L3 protocol types. For
657example, if the L2 protocol type \fBdl_type\fR is wildcarded, then L3
658fields \fBnw_src\fR, \fBnw_dst\fR, and \fBnw_proto\fR must also be
659wildcarded. Similarly, if \fBdl_type\fR or \fBnw_proto\fR (the L3
1c58a78b
BP
660protocol type) is wildcarded, so must be the L4 fields \fBtcp_dst\fR and
661\fBtcp_src\fR. \fBovs\-ofctl\fR will warn about
0b3f2725
BP
662flows not in normal form.
663.PP
064af421
BP
664The following field assignments describe how a flow matches a packet.
665If any of these assignments is omitted from the flow syntax, the field
666is treated as a wildcard; thus, if all of them are omitted, the
bedde04c
GS
667resulting flow matches all packets. The string \fB*\fR may be specified
668to explicitly mark any of these fields as a wildcard.
064af421 669(\fB*\fR should be quoted to protect it from shell expansion.)
a9b4a41a 670.
c6100d92
BP
671.IP \fBin_port=\fIport\fR
672Matches OpenFlow port \fIport\fR, which may be an OpenFlow port number
673or keyword (e.g. \fBLOCAL\fR).
674\fBovs\-ofctl show\fR.
03a8a29e
BP
675.IP
676(The \fBresubmit\fR action can search OpenFlow flow tables with
677arbitrary \fBin_port\fR values, so flows that match port numbers that
678do not exist from an OpenFlow perspective can still potentially be
679matched.)
a9b4a41a 680.
064af421 681.IP \fBdl_vlan=\fIvlan\fR
f30f26be
JP
682Matches IEEE 802.1q Virtual LAN tag \fIvlan\fR. Specify \fB0xffff\fR
683as \fIvlan\fR to match packets that are not tagged with a Virtual LAN;
064af421
BP
684otherwise, specify a number between 0 and 4095, inclusive, as the
68512-bit VLAN ID to match.
a9b4a41a 686.
959a2ecd
JP
687.IP \fBdl_vlan_pcp=\fIpriority\fR
688Matches IEEE 802.1q Priority Code Point (PCP) \fIpriority\fR, which is
689specified as a value between 0 and 7, inclusive. A higher value
690indicates a higher frame priority level.
a9b4a41a 691.
ed951f15
BP
692.IP \fBdl_src=\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fR
693.IQ \fBdl_dst=\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fR
694Matches an Ethernet source (or destination) address specified as 6
695pairs of hexadecimal digits delimited by colons
696(e.g. \fB00:0A:E4:25:6B:B0\fR).
697.
73c0ce34
JS
698.IP \fBdl_src=\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB/\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fR
699.IQ \fBdl_dst=\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB/\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fR
cb8ca532
BP
700Matches an Ethernet destination address specified as 6 pairs of
701hexadecimal digits delimited by colons (e.g. \fB00:0A:E4:25:6B:B0\fR),
73c0ce34
JS
702with a wildcard mask following the slash. Open vSwitch 1.8 and later
703support arbitrary masks for source and/or destination. Earlier
704versions only support masking the destination with the following masks:
cb8ca532
BP
705.RS
706.IP \fB01:00:00:00:00:00\fR
707Match only the multicast bit. Thus,
708\fBdl_dst=01:00:00:00:00:00/01:00:00:00:00:00\fR matches all multicast
709(including broadcast) Ethernet packets, and
710\fBdl_dst=00:00:00:00:00:00/01:00:00:00:00:00\fR matches all unicast
711Ethernet packets.
712.IP \fBfe:ff:ff:ff:ff:ff\fR
713Match all bits except the multicast bit. This is probably not useful.
714.IP \fBff:ff:ff:ff:ff:ff\fR
715Exact match (equivalent to omitting the mask).
716.IP \fB00:00:00:00:00:00\fR
717Wildcard all bits (equivalent to \fBdl_dst=*\fR.)
718.RE
719.
064af421
BP
720.IP \fBdl_type=\fIethertype\fR
721Matches Ethernet protocol type \fIethertype\fR, which is specified as an
722integer between 0 and 65535, inclusive, either in decimal or as a
723hexadecimal number prefixed by \fB0x\fR (e.g. \fB0x0806\fR to match ARP
724packets).
a9b4a41a 725.
064af421 726.IP \fBnw_src=\fIip\fR[\fB/\fInetmask\fR]
ed951f15
BP
727.IQ \fBnw_dst=\fIip\fR[\fB/\fInetmask\fR]
728When \fBdl_type\fR is 0x0800 (possibly via shorthand, e.g. \fBip\fR
729or \fBtcp\fR), matches IPv4 source (or destination) address \fIip\fR,
730which may be specified as an IP address or host name
731(e.g. \fB192.168.1.1\fR or \fBwww.example.com\fR). The optional
732\fInetmask\fR allows restricting a match to an IPv4 address prefix.
733The netmask may be specified as a dotted quad
734(e.g. \fB192.168.1.0/255.255.255.0\fR) or as a CIDR block
c08201d6
BP
735(e.g. \fB192.168.1.0/24\fR). Open vSwitch 1.8 and later support
736arbitrary dotted quad masks; earlier versions support only CIDR masks,
737that is, the dotted quads that are equivalent to some CIDR block.
ed951f15
BP
738.IP
739When \fBdl_type=0x0806\fR or \fBarp\fR is specified, matches the
740\fBar_spa\fR or \fBar_tpa\fR field, respectively, in ARP packets for
741IPv4 and Ethernet.
742.IP
8087f5ff
MM
743When \fBdl_type=0x8035\fR or \fBrarp\fR is specified, matches the
744\fBar_spa\fR or \fBar_tpa\fR field, respectively, in RARP packets for
745IPv4 and Ethernet.
746.IP
747When \fBdl_type\fR is wildcarded or set to a value other than 0x0800,
7480x0806, or 0x8035, the values of \fBnw_src\fR and \fBnw_dst\fR are ignored
0b3f2725 749(see \fBFlow Syntax\fR above).
a9b4a41a 750.
064af421 751.IP \fBnw_proto=\fIproto\fR
44a7e26d 752.IQ \fBip_proto=\fIproto\fR
ed951f15
BP
753When \fBip\fR or \fBdl_type=0x0800\fR is specified, matches IP
754protocol type \fIproto\fR, which is specified as a decimal number
d31f1109
JP
755between 0 and 255, inclusive (e.g. 1 to match ICMP packets or 6 to match
756TCP packets).
757.IP
758When \fBipv6\fR or \fBdl_type=0x86dd\fR is specified, matches IPv6
759header type \fIproto\fR, which is specified as a decimal number between
7600 and 255, inclusive (e.g. 58 to match ICMPv6 packets or 6 to match
761TCP). The header type is the terminal header as described in the
762\fBDESIGN\fR document.
ed951f15
BP
763.IP
764When \fBarp\fR or \fBdl_type=0x0806\fR is specified, matches the lower
7658 bits of the ARP opcode. ARP opcodes greater than 255 are treated as
7660.
767.IP
8087f5ff
MM
768When \fBrarp\fR or \fBdl_type=0x8035\fR is specified, matches the lower
7698 bits of the ARP opcode. ARP opcodes greater than 255 are treated as
7700.
771.IP
d31f1109 772When \fBdl_type\fR is wildcarded or set to a value other than 0x0800,
8087f5ff
MM
7730x0806, 0x8035 or 0x86dd, the value of \fBnw_proto\fR is ignored (see
774\fBFlow Syntax\fR above).
a9b4a41a 775.
834377ea 776.IP \fBnw_tos=\fItos\fR
d31f1109
JP
777Matches IP ToS/DSCP or IPv6 traffic class field \fItos\fR, which is
778specified as a decimal number between 0 and 255, inclusive. Note that
779the two lower reserved bits are ignored for matching purposes.
ed951f15 780.IP
5c0ceb0a
JP
781When \fBdl_type\fR is wildcarded or set to a value other than 0x0800 or
7820x86dd, the value of \fBnw_tos\fR is ignored (see \fBFlow Syntax\fR
783above).
a9b4a41a 784.
44a7e26d
JR
785.IP \fBip_dscp=\fIdscp\fR
786Matches IP ToS/DSCP or IPv6 traffic class field \fIdscp\fR, which is
787specified as a decimal number between 0 and 63, inclusive.
788.IP
789When \fBdl_type\fR is wildcarded or set to a value other than 0x0800 or
7900x86dd, the value of \fBip_dscp\fR is ignored (see \fBFlow Syntax\fR
791above).
792.
530180fd 793.IP \fBnw_ecn=\fIecn\fR
44a7e26d 794.IQ \fBip_ecn=\fIecn\fR
530180fd
JP
795Matches \fIecn\fR bits in IP ToS or IPv6 traffic class fields, which is
796specified as a decimal number between 0 and 3, inclusive.
797.IP
798When \fBdl_type\fR is wildcarded or set to a value other than 0x0800 or
7990x86dd, the value of \fBnw_ecn\fR is ignored (see \fBFlow Syntax\fR
800above).
801.
a61680c6
JP
802.IP \fBnw_ttl=\fIttl\fR
803Matches IP TTL or IPv6 hop limit value \fIttl\fR, which is
804specified as a decimal number between 0 and 255, inclusive.
805.IP
806When \fBdl_type\fR is wildcarded or set to a value other than 0x0800 or
8070x86dd, the value of \fBnw_ttl\fR is ignored (see \fBFlow Syntax\fR
808above).
809.IP
810.
1c58a78b
BP
811.IP \fBtcp_src=\fIport\fR
812.IQ \fBtcp_dst=\fIport\fR
813.IQ \fBudp_src=\fIport\fR
814.IQ \fBudp_dst=\fIport\fR
815.IQ \fBsctp_src=\fIport\fR
816.IQ \fBsctp_dst=\fIport\fR
817Matches a TCP, UDP, or SCTP source or destination port \fIport\fR,
818which is specified as a decimal number between 0 and 65535, inclusive.
819.IP
820When \fBdl_type\fR and \fBnw_proto\fR are wildcarded or set to values
821that do not indicate an appropriate protocol, the values of these
822settings are ignored (see \fBFlow Syntax\fR above).
823.
824.IP \fBtcp_src=\fIport\fB/\fImask\fR
825.IQ \fBtcp_dst=\fIport\fB/\fImask\fR
826.IQ \fBudp_src=\fIport\fB/\fImask\fR
827.IQ \fBudp_dst=\fIport\fB/\fImask\fR
828.IQ \fBsctp_src=\fIport\fB/\fImask\fR
829.IQ \fBsctp_dst=\fIport\fB/\fImask\fR
830Bitwise match on TCP (or UDP or SCTP) source or destination port.
831The \fIport\fR and \fImask\fR are 16-bit numbers
73f33563
BP
832written in decimal or in hexadecimal prefixed by \fB0x\fR. Each 1-bit
833in \fImask\fR requires that the corresponding bit in \fIport\fR must
834match. Each 0-bit in \fImask\fR causes the corresponding bit to be
835ignored.
836.IP
837Bitwise matches on transport ports are rarely useful in isolation, but
838a group of them can be used to reduce the number of flows required to
839match on a range of transport ports. For example, suppose that the
840goal is to match TCP source ports 1000 to 1999, inclusive. One way is
edcbeb4d 841to insert 1000 flows, each of which matches on a single source port.
73f33563
BP
842Another way is to look at the binary representations of 1000 and 1999,
843as follows:
844.br
845.B "01111101000"
846.br
847.B "11111001111"
848.br
849and then to transform those into a series of bitwise matches that
850accomplish the same results:
851.br
852.B "01111101xxx"
853.br
854.B "0111111xxxx"
855.br
856.B "10xxxxxxxxx"
857.br
858.B "110xxxxxxxx"
859.br
860.B "1110xxxxxxx"
861.br
862.B "11110xxxxxx"
863.br
864.B "1111100xxxx"
865.br
866which become the following when written in the syntax required by
867\fBovs\-ofctl\fR:
868.br
1c58a78b 869.B "tcp,tcp_src=0x03e8/0xfff8"
73f33563 870.br
1c58a78b 871.B "tcp,tcp_src=0x03f0/0xfff0"
73f33563 872.br
1c58a78b 873.B "tcp,tcp_src=0x0400/0xfe00"
73f33563 874.br
1c58a78b 875.B "tcp,tcp_src=0x0600/0xff00"
73f33563 876.br
1c58a78b 877.B "tcp,tcp_src=0x0700/0xff80"
73f33563 878.br
1c58a78b 879.B "tcp,tcp_src=0x0780/0xffc0"
73f33563 880.br
1c58a78b 881.B "tcp,tcp_src=0x07c0/0xfff0"
73f33563
BP
882.IP
883Only Open vSwitch 1.6 and later supports bitwise matching on transport
884ports.
885.IP
1c58a78b 886Like the exact-match forms described
edcbeb4d 887above, the bitwise match forms apply only when \fBdl_type\fR and
0d56eaf2 888\fBnw_proto\fR specify TCP or UDP or SCTP.
73f33563 889.
1c58a78b
BP
890.IP \fBtp_src=\fIport\fR
891.IQ \fBtp_dst=\fIport\fR
892These are deprecated generic forms of L4 port matches. In new code,
893please use the TCP-, UDP-, or SCTP-specific forms described above.
894.
dc235f7f 895.IP \fBtcp_flags=\fIflags\fB/\fImask\fR
61bf6666 896.IQ \fBtcp_flags=\fR[\fB+\fIflag\fR...][\fB-\fIflag\fR...]
dc235f7f
JR
897Bitwise match on TCP flags. The \fIflags\fR and \fImask\fR are 16-bit
898numbers written in decimal or in hexadecimal prefixed by \fB0x\fR.
899Each 1-bit in \fImask\fR requires that the corresponding bit in
900\fIflags\fR must match. Each 0-bit in \fImask\fR causes the corresponding
901bit to be ignored.
902.IP
61bf6666
JR
903Alternatively, the flags can be specified by their symbolic names
904(listed below), each preceded by either \fB+\fR for a flag that must
905be set, or \fB\-\fR for a flag that must be unset, without any other
906delimiters between the flags. Flags not mentioned are wildcarded.
907For example, \fBtcp,tcp_flags=+syn\-ack\fR matches TCP SYNs that are
908not ACKs.
909.IP
dc235f7f
JR
910TCP protocol currently defines 9 flag bits, and additional 3 bits are
911reserved (must be transmitted as zero), see RFCs 793, 3168, and 3540.
912The flag bits are, numbering from the least significant bit:
913.RS
61bf6666 914.IP "\fB0: fin\fR"
dc235f7f 915No more data from sender.
61bf6666 916.IP "\fB1: syn\fR"
dc235f7f 917Synchronize sequence numbers.
61bf6666 918.IP "\fB2: rst\fR"
dc235f7f 919Reset the connection.
61bf6666 920.IP "\fB3: psh\fR"
dc235f7f 921Push function.
61bf6666 922.IP "\fB4: ack\fR"
dc235f7f 923Acknowledgement field significant.
61bf6666 924.IP "\fB5: urg\fR"
dc235f7f 925Urgent pointer field significant.
61bf6666 926.IP "\fB6: ece\fR"
dc235f7f 927ECN Echo.
61bf6666 928.IP "\fB7: cwr\fR"
dc235f7f 929Congestion Windows Reduced.
61bf6666 930.IP "\fB8: ns\fR"
dc235f7f
JR
931Nonce Sum.
932.IP "\fB9-11:\fR"
933Reserved.
934.IP "\fB12-15:\fR"
935Not matchable, must be zero.
936.RE
064af421 937.IP \fBicmp_type=\fItype\fR
ed951f15 938.IQ \fBicmp_code=\fIcode\fR
d31f1109
JP
939When \fBdl_type\fR and \fBnw_proto\fR specify ICMP or ICMPv6, \fItype\fR
940matches the ICMP type and \fIcode\fR matches the ICMP code. Each is
941specified as a decimal number between 0 and 255, inclusive.
ed951f15
BP
942.IP
943When \fBdl_type\fR and \fBnw_proto\fR take other values, the values of
0b3f2725 944these settings are ignored (see \fBFlow Syntax\fR above).
71e17a7a 945.
6c1491fb 946.IP \fBtable=\fInumber\fR
0e197060
BP
947For flow dump commands, limits the flows dumped to those in the table
948with the given \fInumber\fR between 0 and 254. If not specified (or if
949255 is specified as \fInumber\fR), then flows in all tables are
950dumped.
951.
952.IP
953For flow table modification commands, behavior varies based on the
954OpenFlow version used to connect to the switch:
955.
956.RS
957.IP "OpenFlow 1.0"
958OpenFlow 1.0 does not support \fBtable\fR for modifying flows.
959\fBovs\-ofctl\fR will exit with an error if \fBtable\fR (other than
960\fBtable=255\fR) is specified for a switch that only supports OpenFlow
9611.0.
962.IP
963In OpenFlow 1.0, the switch chooses the table into which to insert a
964new flow. The Open vSwitch software switch always chooses table 0.
965Other Open vSwitch datapaths and other OpenFlow implementations may
966choose different tables.
967.IP
968The OpenFlow 1.0 behavior in Open vSwitch for modifying or removing
969flows depends on whether \fB\-\-strict\fR is used. Without
970\fB\-\-strict\fR, the command applies to matching flows in all tables.
971With \fB\-\-strict\fR, the command will operate on any single matching
972flow in any table; it will do nothing if there are matches in more
973than one table. (The distinction between these behaviors only matters
974if non-OpenFlow 1.0 commands were also used, because OpenFlow 1.0
975alone cannot add flows with the same matching criteria to multiple
976tables.)
977.
978.IP "OpenFlow 1.0 with table_id extension"
979Open vSwitch implements an OpenFlow extension that allows the
980controller to specify the table on which to operate. \fBovs\-ofctl\fR
981automatically enables the extension when \fBtable\fR is specified and
982OpenFlow 1.0 is used. \fBovs\-ofctl\fR automatically detects whether
983the switch supports the extension. As of this writing, this extension
984is only known to be implemented by Open vSwitch.
985.
986.IP
987With this extension, \fBovs\-ofctl\fR operates on the requested table
988when \fBtable\fR is specified, and acts as described for OpenFlow 1.0
989above when no \fBtable\fR is specified (or for \fBtable=255\fR).
990.
991.IP "OpenFlow 1.1"
992OpenFlow 1.1 requires flow table modification commands to specify a
993table. When \fBtable\fR is not specified (or \fBtable=255\fR is
994specified), \fBovs\-ofctl\fR defaults to table 0.
995.
996.IP "OpenFlow 1.2 and later"
997OpenFlow 1.2 and later allow flow deletion commands, but not other
998flow table modification commands, to operate on all flow tables, with
999the behavior described above for OpenFlow 1.0.
1000.RE
6c1491fb 1001.
54fa24c5
JS
1002.IP \fBmetadata=\fIvalue\fR[\fB/\fImask\fR]
1003Matches \fIvalue\fR either exactly or with optional \fImask\fR in the metadata
1004field. \fIvalue\fR and \fImask\fR are 64-bit integers, by default in decimal
1005(use a \fB0x\fR prefix to specify hexadecimal). Arbitrary \fImask\fR values
1006are allowed: a 1-bit in \fImask\fR indicates that the corresponding bit in
1007\fIvalue\fR must match exactly, and a 0-bit wildcards that bit. Matching on
1008metadata was added in Open vSwitch 1.8.
1009.
71e17a7a 1010.PP
d31f1109
JP
1011The following shorthand notations are also available:
1012.
1013.IP \fBip\fR
1014Same as \fBdl_type=0x0800\fR.
1015.
c5a41255
JP
1016.IP \fBipv6\fR
1017Same as \fBdl_type=0x86dd\fR.
1018.
d31f1109
JP
1019.IP \fBicmp\fR
1020Same as \fBdl_type=0x0800,nw_proto=1\fR.
1021.
c5a41255
JP
1022.IP \fBicmp6\fR
1023Same as \fBdl_type=0x86dd,nw_proto=58\fR.
1024.
d31f1109
JP
1025.IP \fBtcp\fR
1026Same as \fBdl_type=0x0800,nw_proto=6\fR.
1027.
c5a41255
JP
1028.IP \fBtcp6\fR
1029Same as \fBdl_type=0x86dd,nw_proto=6\fR.
1030.
d31f1109
JP
1031.IP \fBudp\fR
1032Same as \fBdl_type=0x0800,nw_proto=17\fR.
1033.
c5a41255
JP
1034.IP \fBudp6\fR
1035Same as \fBdl_type=0x86dd,nw_proto=17\fR.
1036.
0d56eaf2
JS
1037.IP \fBsctp\fR
1038Same as \fBdl_type=0x0800,nw_proto=132\fR.
1039.
c5a41255
JP
1040.IP \fBsctp6\fR
1041Same as \fBdl_type=0x86dd,nw_proto=132\fR.
1042.
d31f1109
JP
1043.IP \fBarp\fR
1044Same as \fBdl_type=0x0806\fR.
1045.
8087f5ff
MM
1046.IP \fBrarp\fR
1047Same as \fBdl_type=0x8035\fR.
1048.
c5a41255
JP
1049.IP \fBmpls\fR
1050Same as \fBdl_type=0x8847\fR.
1051.
1052.IP \fBmplsm\fR
1053Same as \fBdl_type=0x8848\fR.
1054.
d31f1109 1055.PP
71e17a7a
JP
1056The following field assignments require support for the NXM (Nicira
1057Extended Match) extension to OpenFlow. When one of these is specified,
1058\fBovs\-ofctl\fR will automatically attempt to negotiate use of this
1059extension. If the switch does not support NXM, then \fBovs\-ofctl\fR
1060will report a fatal error.
1061.
33d8c6b4
BP
1062.IP \fBvlan_tci=\fItci\fR[\fB/\fImask\fR]
1063Matches modified VLAN TCI \fItci\fR. If \fImask\fR is omitted,
1064\fItci\fR is the exact VLAN TCI to match; if \fImask\fR is specified,
a8600e1a 1065then a 1-bit in \fImask\fR indicates that the corresponding bit in
33d8c6b4
BP
1066\fItci\fR must match exactly, and a 0-bit wildcards that bit. Both
1067\fItci\fR and \fImask\fR are 16-bit values that are decimal by
1068default; use a \fB0x\fR prefix to specify them in hexadecimal.
1069.
1070.IP
1071The value that \fBvlan_tci\fR matches against is 0 for a packet that
1072has no 802.1Q header. Otherwise, it is the TCI value from the 802.1Q
1073header with the CFI bit (with value \fB0x1000\fR) forced to 1.
1074.IP
1075Examples:
1076.RS
1077.IP \fBvlan_tci=0\fR
5fec03b1
BP
1078Match packets without an 802.1Q header.
1079.IP \fBvlan_tci=0x1000/0x1000\fR
1080Match packets with an 802.1Q header, regardless of VLAN and priority
1081values.
33d8c6b4
BP
1082.IP \fBvlan_tci=0xf123\fR
1083Match packets tagged with priority 7 in VLAN 0x123.
1084.IP \fBvlan_tci=0x1123/0x1fff\fR
1085Match packets tagged with VLAN 0x123 (and any priority).
1086.IP \fBvlan_tci=0x5000/0xf000\fR
1087Match packets tagged with priority 2 (in any VLAN).
1088.IP \fBvlan_tci=0/0xfff\fR
1089Match packets with no 802.1Q header or tagged with VLAN 0 (and any
1090priority).
1091.IP \fBvlan_tci=0x5000/0xe000\fR
1092Match packets with no 802.1Q header or tagged with priority 2 (in any
1093VLAN).
1094.IP \fBvlan_tci=0/0xefff\fR
1095Match packets with no 802.1Q header or tagged with VLAN 0 and priority
10960.
1097.RE
1098.IP
1099Some of these matching possibilities can also be achieved with
1100\fBdl_vlan\fR and \fBdl_vlan_pcp\fR.
1101.
7257b535
BP
1102.IP \fBip_frag=\fIfrag_type\fR
1103When \fBdl_type\fR specifies IP or IPv6, \fIfrag_type\fR
1104specifies what kind of IP fragments or non-fragments to match. The
1105following values of \fIfrag_type\fR are supported:
1106.RS
1107.IP "\fBno\fR"
1108Matches only non-fragmented packets.
1109.IP "\fByes\fR"
1110Matches all fragments.
1111.IP "\fBfirst\fR"
1112Matches only fragments with offset 0.
1113.IP "\fBlater\fR"
1114Matches only fragments with nonzero offset.
1115.IP "\fBnot_later\fR"
1116Matches non-fragmented packets and fragments with zero offset.
1117.RE
1118.IP
1119The \fBip_frag\fR match type is likely to be most useful in
1120\fBnx\-match\fR mode. See the description of the \fBset\-frags\fR
1121command, above, for more details.
1122.
1e6fbba0
SH
1123.IP \fBarp_spa=\fIip\fR[\fB/\fInetmask\fR]
1124.IQ \fBarp_tpa=\fIip\fR[\fB/\fInetmask\fR]
1125When \fBdl_type\fR specifies either ARP or RARP, \fBarp_spa\fR and
e935fc32 1126\fBarp_tpa\fR match the source and target IPv4 address, respectively.
1e6fbba0
SH
1127An address may be specified as an IP address or host name
1128(e.g. \fB192.168.1.1\fR or \fBwww.example.com\fR). The optional
1129\fInetmask\fR allows restricting a match to an IPv4 address prefix.
1130The netmask may be specified as a dotted quad
1131(e.g. \fB192.168.1.0/255.255.255.0\fR) or as a CIDR block
1132(e.g. \fB192.168.1.0/24\fR).
1133.
bad68a99
JP
1134.IP \fBarp_sha=\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fR
1135.IQ \fBarp_tha=\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fR
8087f5ff
MM
1136When \fBdl_type\fR specifies either ARP or RARP, \fBarp_sha\fR and
1137\fBarp_tha\fR match the source and target hardware address, respectively. An
9183708a
SH
1138address is specified as 6 pairs of hexadecimal digits delimited by colons
1139(e.g. \fB00:0A:E4:25:6B:B0\fR).
bad68a99 1140.
9183708a
SH
1141.IP \fBarp_sha=\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB/\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fR
1142.IQ \fBarp_tha=\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB/\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fR
1143When \fBdl_type\fR specifies either ARP or RARP, \fBarp_sha\fR and
1144\fBarp_tha\fR match the source and target hardware address, respectively. An
1145address is specified as 6 pairs of hexadecimal digits delimited by colons
1146(e.g. \fB00:0A:E4:25:6B:B0\fR), with a wildcard mask following the slash.
1147.
2bd415dd
BP
1148.IP \fBarp_op=\fIopcode\fR
1149When \fBdl_type\fR specifies either ARP or RARP, \fBarp_op\fR matches the
1150ARP opcode. Only ARP opcodes between 1 and 255 should be specified for
1151matching.
1152.
d31f1109
JP
1153.IP \fBipv6_src=\fIipv6\fR[\fB/\fInetmask\fR]
1154.IQ \fBipv6_dst=\fIipv6\fR[\fB/\fInetmask\fR]
1155When \fBdl_type\fR is 0x86dd (possibly via shorthand, e.g., \fBipv6\fR
1156or \fBtcp6\fR), matches IPv6 source (or destination) address \fIipv6\fR,
1157which may be specified as defined in RFC 2373. The preferred format is
1158\fIx\fB:\fIx\fB:\fIx\fB:\fIx\fB:\fIx\fB:\fIx\fB:\fIx\fB:\fIx\fR, where
1159\fIx\fR are the hexadecimal values of the eight 16-bit pieces of the
1160address. A single instance of \fB::\fR may be used to indicate multiple
1161groups of 16-bits of zeros. The optional \fInetmask\fR allows
1162restricting a match to an IPv6 address prefix. A netmask is specified
ff0b06ee
BP
1163as an IPv6 address (e.g. \fB2001:db8:3c4d:1::/ffff:ffff:ffff:ffff::\fR)
1164or a CIDR block (e.g. \fB2001:db8:3c4d:1::/64\fR). Open vSwitch 1.8
1165and later support arbitrary masks; earlier versions support only CIDR
1166masks, that is, CIDR block and IPv6 addresses that are equivalent to
1167CIDR blocks.
d31f1109 1168.
fa8223b7
JP
1169.IP \fBipv6_label=\fIlabel\fR
1170When \fBdl_type\fR is 0x86dd (possibly via shorthand, e.g., \fBipv6\fR
1171or \fBtcp6\fR), matches IPv6 flow label \fIlabel\fR.
1172.
47284b1f 1173.IP \fBnd_target=\fIipv6\fR[\fB/\fInetmask\fR]
685a51a5
JP
1174When \fBdl_type\fR, \fBnw_proto\fR, and \fBicmp_type\fR specify
1175IPv6 Neighbor Discovery (ICMPv6 type 135 or 136), matches the target address
1176\fIipv6\fR. \fIipv6\fR is in the same format described earlier for the
1177\fBipv6_src\fR and \fBipv6_dst\fR fields.
1178.
1179.IP \fBnd_sll=\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fR
1180When \fBdl_type\fR, \fBnw_proto\fR, and \fBicmp_type\fR specify IPv6
1181Neighbor Solicitation (ICMPv6 type 135), matches the source link\-layer
1182address option. An address is specified as 6 pairs of hexadecimal
1183digits delimited by colons.
1184.
1185.IP \fBnd_tll=\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fR
1186When \fBdl_type\fR, \fBnw_proto\fR, and \fBicmp_type\fR specify IPv6
1187Neighbor Advertisement (ICMPv6 type 136), matches the target link\-layer
1188address option. An address is specified as 6 pairs of hexadecimal
1189digits delimited by colons.
1190.
b4dca848
SH
1191.IP \fBmpls_bos=\fIbos\fR
1192When \fBdl_type\fR is 0x8847 or 0x8848 (possibly via shorthand e.g.,
1193\fBmpls\fR or \fBmplsm\fR), matches the bottom-of-stack bit of the
1194outer-most MPLS label stack entry. Valid values are 0 and 1.
1195.IP
1196If 1 then for a packet with a well-formed MPLS label stack the
1197bottom-of-stack bit indicates that the outer label stack entry is also
1198the inner-most label stack entry and thus that is that there is only one
1199label stack entry present. Conversely, if 0 then for a packet with a
1200well-formed MPLS label stack the bottom-of-stack bit indicates that the
1201outer label stack entry is not the inner-most label stack entry and
1202thus there is more than one label stack entry present.
1203.
1204.IP \fBmpls_label=\fIlabel\fR
1205When \fBdl_type\fR is 0x8847 or 0x8848 (possibly via shorthand e.g.,
1206\fBmpls\fR or \fBmplsm\fR), matches the label of the outer
1207MPLS label stack entry. The label is a 20-bit value that is decimal by default;
1208use a \fB0x\fR prefix to specify them in hexadecimal.
1209.
1210.IP \fBmpls_tc=\fItc\fR
1211When \fBdl_type\fR is 0x8847 or 0x8848 (possibly via shorthand e.g.,
1212\fBmpls\fR or \fBmplsm\fR), matches the traffic-class of the outer
1213MPLS label stack entry. Valid values are between 0 (lowest) and 7 (highest).
1214.
8368c090 1215.IP \fBtun_id=\fItunnel-id\fR[\fB/\fImask\fR]
44a7e26d 1216.IQ \fBtunnel_id=\fItunnel-id\fR[\fB/\fImask\fR]
8368c090 1217Matches tunnel identifier \fItunnel-id\fR. Only packets that arrive
4c5df7f7 1218over a tunnel that carries a key (e.g. GRE with the RFC 2890 key
bcb90943
SH
1219extension and a nonzero key value) will have a nonzero tunnel ID.
1220If \fImask\fR is omitted, \fItunnel-id\fR is the exact tunnel ID to match;
1221if \fImask\fR is specified, then a 1-bit in \fImask\fR indicates that the
1222corresponding bit in \fItunnel-id\fR must match exactly, and a 0-bit
1223wildcards that bit.
71e17a7a 1224.
b666962b
JG
1225.IP \fBtun_flags=\fIflags\fR
1226Matches flags indicating various aspects of the tunnel encapsulation. Currently,
1227there is only one flag defined:
1228.IP
1229\fBoam\fR: The tunnel protocol indicated that this is an OAM control packet.
1230.IP
1231Flags can be prefixed by \fB+\fR or \fB-\fR to indicate that the flag should
1232be matched as either present or not present, respectively. In addition, flags
1233can be specified without a prefix and separated by \fB|\fR to indicate an exact
1234match.
1235.IP
1236Note that it is possible for newer version of Open vSwitch to introduce
1237additional flags with varying meaning. It is therefore not recommended to use
1238an exact match on this field since the behavior of these new flags is unknown
1239and should be ignored.
1240.IP
1241For non-tunneled packets, the value is 0.
1242.IP
1243This field was introduced in Open vSwitch 2.5.
1244.
80c4589a
PS
1245.IP \fBtun_src=\fIipv4\fR[\fB/\fInetmask\fR]
1246.IQ \fBtun_dst=\fIipv4\fR[\fB/\fInetmask\fR]
1247.IQ \fBtun_ipv6_src=\fIipv6\fR[\fB/\fInetmask\fR]
1248.IQ \fBtun_ipv6_dst=\fIipv6\fR[\fB/\fInetmask\fR]
1249Matches tunnel IP source (or destination) address \fIip\fR. Only packets
0ad90c84
JR
1250that arrive over a tunnel will have nonzero tunnel addresses.
1251The address may be specified as an IP address or host name
1252(e.g. \fB192.168.1.1\fR or \fBwww.example.com\fR). The optional
80c4589a 1253\fInetmask\fR allows restricting a match to a masked IP address.
0ad90c84
JR
1254The netmask may be specified as a dotted quad
1255(e.g. \fB192.168.1.0/255.255.255.0\fR) or as a CIDR block
1256(e.g. \fB192.168.1.0/24\fR).
1257.
ac6073e3
MC
1258.IP \fBtun_gbp_id=\fIvalue\fR[\fB/\fImask\fR]
1259.IQ \fBtun_gbp_flags=\fIvalue\fR[\fB/\fImask\fR]
1260Matches the group policy identifier and flags in the VXLAN header. Only
1261packets that arrive over a VXLAN tunnel with the "gbp" extension
1262enabled can have this field set. The fields may also be referred to by
1263NXM_NX_TUN_GBP_ID[] (16 bits) and NXM_NX_TUN_GBP_FLAGS[] (8 bits) in
1264the context of field manipulation actions. If these fields are set and
1265the packet matched by the flow is encapsulated in a VXLAN-GBP tunnel,
1266then the policy identifier and flags are transmitted to the destination
1267VXLAN tunnel endpoint.
1268.IP
1269The \fBtun_gbp_flags\fR field has the following format:
1270.IP
1271.in +2
1272\f(CR+-+-+-+-+-+-+-+-+\fR
1273.br
1274\f(CR|-|D|-|-|A|-|-|-|\fR
1275.br
1276\f(CR+-+-+-+-+-+-+-+-+\fR
1277
1278.B D :=
1279Don't Learn bit. When set, this bit indicates that the egress
1280tunnel endpoint MUST NOT learn the source address of the encapsulated
1281frame.
1282
1283.B A :=
1284Indicates that the group policy has already been applied to
1285this packet. Policies MUST NOT be applied by devices when the A bit is
1286set.
1287.in -2
1288.IP
1289For more information, please see the corresponding IETF draft:
1290https://tools.ietf.org/html/draft-smith-vxlan-group-policy
1291.
1cb20095 1292.IP "\fBtun_metadata\fIidx\fR[\fB=\fIvalue\fR[\fB/\fImask\fR]]"
9558d2a5
JG
1293Matches \fIvalue\fR either exactly or with optional \fImask\fR in
1294tunnel metadata field number \fIidx\fR (numbered from 0 to 63).
1cb20095
JG
1295The act of specifying a field implies a match on the existence
1296of that field in the packet in addition to the masked value. As
1297a shorthand, it is possible to specify only the field name to
1298simply match on an option being present.
1299.IP
9558d2a5 1300Tunnel metadata fields can be dynamically assigned onto the data
4e548ad9
ML
1301contained in the option TLVs of packets (e.g. Geneve variable
1302options stores zero or more options in TLV format and tunnel
1303metadata can be assigned onto these option TLVs) using the
1304commands described in the section \fBOpenFlow Switch Tunnel TLV Table
9558d2a5
JG
1305Commands\fR. Once assigned, the length of the field is variable
1306according to the size of the option. Before updating a mapping in
1307the option table, flows with references to it should be removed,
1308otherwise the result is non-deterministic.
1309.IP
1310These fields were introduced in Open vSwitch 2.5.
1311.
00b1c62f
BP
1312.IP "\fBreg\fIidx\fB=\fIvalue\fR[\fB/\fImask\fR]"
1313Matches \fIvalue\fR either exactly or with optional \fImask\fR in
1314register number \fIidx\fR. The valid range of \fIidx\fR depends on
1315the switch. \fIvalue\fR and \fImask\fR are 32-bit integers, by
1316default in decimal (use a \fB0x\fR prefix to specify hexadecimal).
1317Arbitrary \fImask\fR values are allowed: a 1-bit in \fImask\fR
1318indicates that the corresponding bit in \fIvalue\fR must match
1319exactly, and a 0-bit wildcards that bit.
1320.IP
1321When a packet enters an OpenFlow switch, all of the registers are set
79fe0f46
BP
1322to 0. Only explicit actions change register values.
1323.
1324.IP "\fBxreg\fIidx\fB=\fIvalue\fR[\fB/\fImask\fR]"
1325Matches \fIvalue\fR either exactly or with optional \fImask\fR in
132664-bit ``extended register'' number \fIidx\fR. Each of the 64-bit
1327extended registers overlays two of the 32-bit registers: \fBxreg0\fR
1328overlays \fBreg0\fR and \fBreg1\fR, with \fBreg0\fR supplying the
1329most-significant bits of \fBxreg0\fR and \fBreg1\fR the
5e0464a0 1330least-significant. \fBxreg1\fR similarly overlays \fBreg2\fR and
79fe0f46
BP
1331\fBreg3\fR, and so on.
1332.IP
1333These fields were added in Open vSwitch 2.3 to conform with the
d3cb080e 1334OpenFlow 1.5 specification. OpenFlow 1.5 calls these fields
79fe0f46
BP
1335just the ``packet registers,'' but Open vSwitch already had 32-bit
1336registers by that name, which is why Open vSwitch refers to the
1337standard registers as ``extended registers''.
a9b4a41a 1338.
b23ada8e
JP
1339.IP "\fBxxreg\fIidx\fB=\fIvalue\fR[\fB/\fImask\fR]"
1340Matches \fIvalue\fR either exactly or with optional \fImask\fR in
1341128-bit ``extended-extended register'' number \fIidx\fR. Each of the
1342128-bit extended registers overlays four of the 32-bit registers:
1343\fBxxreg0\fR overlays \fBreg0\fR through \fBreg3\fR, with \fBreg0\fR
1344supplying the most-significant bits of \fBxxreg0\fR and \fBreg3\fR the
1345least-significant. \fBxxreg1\fR similarly overlays \fBreg4\fR through
1346\fBreg7\fR, and so on.
1347.IP
1348These fields were added in Open vSwitch 2.6.
1349.
ac923e91
JG
1350.IP \fBpkt_mark=\fIvalue\fR[\fB/\fImask\fR]
1351Matches packet metadata mark \fIvalue\fR either exactly or with optional
1352\fImask\fR. The mark is associated data that may be passed into other
1353system components in order to facilitate interaction between subsystems.
1354On Linux this corresponds to the skb mark but the exact implementation is
1355platform-dependent.
1356.
c61f3870
BP
1357.IP \fBactset_output=\fIport\fR
1358Matches the output port currently in the OpenFlow action set, where
1359\fIport\fR may be an OpenFlow port number or keyword
1360(e.g. \fBLOCAL\fR). If there is no output port in the OpenFlow action
1361set, or if the output port will be ignored (e.g. because there is an
1362output group in the OpenFlow action set), then the value will be
1363\fBUNSET\fR.
1364.IP
1365This field was introduced in Open vSwitch 2.4 to conform with the
d3cb080e 1366OpenFlow 1.5 specification.
18080541
BP
1367.
1368.IP \fBconj_id=\fIvalue\fR
1369Matches the given 32-bit \fIvalue\fR against the conjunction ID. This
1370is used only with the \fBconjunction\fR action (see below).
1371.IP
1372This field was introduced in Open vSwitch 2.4.
1373.
07659514
JS
1374.IP \fBct_state=\fIflags\fB/\fImask\fR
1375.IQ \fBct_state=\fR[\fB+\fIflag\fR...][\fB-\fIflag\fR...]
1376Bitwise match on connection state flags. This is used with the \fBct\fR
1377action (see below).
1378.IP
1379The \fBct_state\fR field provides information from a connection tracking
1380module. It describes whether the packet has previously traversed the
1381connection tracker (tracked, or trk) and, if it has been tracked, any
1382additional information that the connection tracker was able to provide about
1383the connection that the current packet belongs to.
1384.IP
1385Individual packets may be in one of two states: Untracked or tracked. When the
1386\fBct\fR action is executed on a packet, it becomes tracked for the the
1387remainder of OpenFlow pipeline processing. Once a packet has become tracked,
1388the state of its corresponding connection may be determined. Note that the
1389\fBct_state\fR is only significant for the current \fBct_zone\fR.
1390.IP
1391Connections may be in one of two states: uncommitted or committed. Connections
1392are uncommitted by default. To determine ongoing information about a
1393connection, like whether the connection is established or not, the connection
1394must be committed. When the \fBct\fR action is executed on a packet with the
1395\fBcommit\fR parameter, the connection will become committed and will remain in
1396this state until the end of the connection. Committed connections store state
1397beyond the duration of packet processing.
1398.IP
1399The \fIflags\fR and \fImask\fR are 32-bit numbers written in decimal or
1400in hexadecimal prefixed by \fB0x\fR. Each 1-bit in \fImask\fR requires
1401that the corresponding bit in \fIflags\fR must match. Each 0-bit in
1402\fImask\fR causes the corresponding bit to be ignored.
1403.IP
1404Alternatively, the flags can be specified by their symbolic names
1405(listed below), each preceded by either \fB+\fR for a flag that must
1406be set, or \fB\-\fR for a flag that must be unset, without any other
1407delimiters between the flags. Flags not mentioned are wildcarded. For
1408example, \fBtcp,ct_state=+trk\-new\fR matches TCP packets that
1409have been run through the connection tracker and do not establish a new
54da48f4 1410connection.
07659514
JS
1411.IP
1412The following flags describe the state of the tracking:
1413.RS
fc038fbb
JS
1414.IP "\fB0x01: new\fR"
1415This is the beginning of a new connection. This flag may only be present for
1416uncommitted connections.
1417.IP "\fB0x02: est\fR"
1418This is part of an already existing connection. This flag may only be present
1419for committed connections.
1420.IP "\fB0x04: rel\fR"
1421This is a connection that is related to an existing connection, for
1422instance ICMP "destination unreachable" messages or FTP data connections. This
1423flag may only be present for committed connections.
1424.IP "\fB0x08: rpl\fR"
07659514
JS
1425The flow is in the reply direction, meaning it did not initiate the
1426connection. This flag may only be present for committed connections.
fc038fbb 1427.IP "\fB0x10: inv\fR"
07659514
JS
1428The state is invalid, meaning that the connection tracker couldn't identify the
1429connection. This flag is a catch-all for any problems that the connection
1430tracker may have, for example:
1431.RS
1432.PP
1433- L3/L4 protocol handler is not loaded/unavailable. With the Linux kernel
1434datapath, this may mean that the "nf_conntrack_ipv4" or "nf_conntrack_ipv6"
1435modules are not loaded.
1436.PP
1437- L3/L4 protocol handler determines that the packet is malformed.
1438.PP
1439- Packets are unexpected length for protocol.
1440.RE
fc038fbb
JS
1441.IP "\fB0x20: trk\fR"
1442This packet is tracked, meaning that it has previously traversed the connection
1443tracker. If this flag is not set, then no other flags will be set. If this flag
1444is set, then the packet is tracked and other flags may also be set.
ae8b9260
JR
1445.IP "\fB0x40: snat\fR"
1446This packet was transformed by source address/port translation by a
1447preceding \fBct\fR action.
1448.IP "\fB0x80: dnat\fR"
1449This packet was transformed by destination address/port translation by
1450a preceding \fBct\fR action.
07659514 1451.PP
ae8b9260
JR
1452This field was introduced in Open vSwitch 2.5. The \fBsnat\fR and
1453\fBdnat\fR bits were added in Open vSwitch 2.6.
07659514
JS
1454.RE
1455.
1456.PP
1457The following fields are associated with the connection tracker and will only
1458be populated for tracked packets. The \fBct\fR action will populate these
1459fields, and allows modification of some of the below fields.
1460.IP \fBct_zone=\fIzone
1461Matches the given 16-bit connection \fIzone\fR exactly. This represents the
1462most recent connection tracking context that \fBct\fR was executed in. Each
1463zone is an independent connection tracking context, so if you wish to track
1464the same packet in multiple contexts then you must use the \fBct\fR action
1465multiple times. Introduced in Open vSwitch 2.5.
1466.
8e53fe8c
JS
1467.IP \fBct_mark=\fIvalue\fR[\fB/\fImask\fR]
1468Matches the given 32-bit connection mark \fIvalue\fR either exactly or with
1469optional \fImask\fR. This represents metadata associated with the connection
1470that the current packet is part of. Introduced in Open vSwitch 2.5.
1471.
9daf2348
JS
1472.IP \fBct_label=\fIvalue\fR[\fB/\fImask\fR]
1473Matches the given 128-bit connection labels \fIvalue\fR either exactly or with
1474optional \fImask\fR. This represents metadata associated with the connection
1475that the current packet is part of. Introduced in Open vSwitch 2.5.
1476.
064af421 1477.PP
d31f1109
JP
1478Defining IPv6 flows (those with \fBdl_type\fR equal to 0x86dd) requires
1479support for NXM. The following shorthand notations are available for
1480IPv6-related flows:
a9b4a41a 1481.
d31f1109
JP
1482.IP \fBipv6\fR
1483Same as \fBdl_type=0x86dd\fR.
a9b4a41a 1484.
d31f1109
JP
1485.IP \fBtcp6\fR
1486Same as \fBdl_type=0x86dd,nw_proto=6\fR.
a9b4a41a 1487.
d31f1109
JP
1488.IP \fBudp6\fR
1489Same as \fBdl_type=0x86dd,nw_proto=17\fR.
a9b4a41a 1490.
0d56eaf2
JS
1491.IP \fBsctp6\fR
1492Same as \fBdl_type=0x86dd,nw_proto=132\fR.
1493.
d31f1109
JP
1494.IP \fBicmp6\fR
1495Same as \fBdl_type=0x86dd,nw_proto=58\fR.
a9b4a41a 1496.
064af421 1497.PP
2c6d8411
BP
1498Finally, field assignments to \fBduration\fR, \fBn_packets\fR, or
1499\fBn_bytes\fR are ignored to allow output from the \fBdump\-flows\fR
1500command to be used as input for other commands that parse flows.
1501.
1502.PP
c821124b
BP
1503The \fBadd\-flow\fR, \fBadd\-flows\fR, and \fBmod\-flows\fR commands
1504require an additional field, which must be the final field specified:
a9b4a41a 1505.
d1ba66e9 1506.IP \fBactions=\fR[\fIaction\fR][\fB,\fIaction\fR...]\fR
064af421 1507Specifies a comma-separated list of actions to take on a packet when the
d1ba66e9
BP
1508flow entry matches. If no \fIaction\fR is specified, then packets
1509matching the flow are dropped. The following forms of \fIaction\fR
1510are supported:
a9b4a41a 1511.
064af421 1512.RS
d1ba66e9
BP
1513.IP \fIport\fR
1514.IQ \fBoutput:\fIport\fR
1515Outputs the packet to OpenFlow port number \fIport\fR. If \fIport\fR
1516is the packet's input port, the packet is not output.
c6100d92
BP
1517.
1518.IP \fBoutput:\fIsrc\fB[\fIstart\fB..\fIend\fB]
1519Outputs the packet to the OpenFlow port number read from \fIsrc\fR,
1520which must be an NXM field as described above. For example,
1521\fBoutput:NXM_NX_REG0[16..31]\fR outputs to the OpenFlow port number
d1ba66e9
BP
1522written in the upper half of register 0. If the port number is the
1523packet's input port, the packet is not output.
1524.IP
1525This form of \fBoutput\fR was added in Open vSwitch 1.3.0. This form
1526of \fBoutput\fR uses an OpenFlow extension that is not supported by
1527standard OpenFlow switches.
5682f723 1528.
aaca4fe0
WT
1529.IP \fBoutput(port=\fIport\fR\fB,max_len=\fInbytes\fR)
1530Outputs the packet to the OpenFlow port number read from \fIport\fR,
1531with maximum packet size set to \fInbytes\fR. \fIport\fR may be OpenFlow
1532port number, \fBlocal\fR, or \fBin_port\fR. Patch port is not supported.
1533Packets larger than \fInbytes\fR will be trimmed to \fInbytes\fR while
1534packets smaller than \fInbytes\fR remains the original size.
1535.
b47e67c4
TG
1536.IP \fBgroup:\fIgroup_id\fR
1537Outputs the packet to the OpenFlow group \fIgroup_id\fR. Group tables
1538are only supported in OpenFlow 1.1+. See Group Syntax for more details.
1539.
064af421
BP
1540.IP \fBnormal\fR
1541Subjects the packet to the device's normal L2/L3 processing. (This
1542action is not implemented by all OpenFlow switches.)
a9b4a41a 1543.
064af421
BP
1544.IP \fBflood\fR
1545Outputs the packet on all switch physical ports other than the port on
1546which it was received and any ports on which flooding is disabled
1547(typically, these would be ports disabled by the IEEE 802.1D spanning
1548tree protocol).
a9b4a41a 1549.
064af421
BP
1550.IP \fBall\fR
1551Outputs the packet on all switch physical ports other than the port on
1552which it was received.
a9b4a41a 1553.
d1ba66e9
BP
1554.IP \fBlocal\fR
1555Outputs the packet on the ``local port,'' which corresponds to the
1556network device that has the same name as the bridge.
1557.
1558.IP \fBin_port\fR
1559Outputs the packet on the port from which it was received.
1560.
a7349929 1561.IP \fBcontroller(\fIkey\fB=\fIvalue\fR...\fB)
77ab5fd2 1562Sends the packet and its metadata to the OpenFlow controller as a ``packet in''
a7349929
BP
1563message. The supported key-value pairs are:
1564.RS
1565.IP "\fBmax_len=\fInbytes\fR"
1566Limit to \fInbytes\fR the number of bytes of the packet to send to
1567the controller. By default the entire packet is sent.
1568.IP "\fBreason=\fIreason\fR"
1569Specify \fIreason\fR as the reason for sending the message in the
1570``packet in'' message. The supported reasons are \fBaction\fR (the
1571default), \fBno_match\fR, and \fBinvalid_ttl\fR.
1572.IP "\fBid=\fIcontroller-id\fR"
1573Specify \fIcontroller-id\fR, a 16-bit integer, as the connection ID of
1574the OpenFlow controller or controllers to which the ``packet in''
1575message should be sent. The default is zero. Zero is also the
1576default connection ID for each controller connection, and a given
1577controller connection will only have a nonzero connection ID if its
1578controller uses the \fBNXT_SET_CONTROLLER_ID\fR Nicira extension to
1579OpenFlow.
bdcad671
BP
1580.IP "\fBuserdata=\fIhh\fR...\fR"
1581Supplies the bytes represented as hex digits \fIhh\fR as additional
1582data to the controller in the packet-in message. Pairs of hex digits
1583may be separated by periods for readability.
77ab5fd2
BP
1584.IP "\fBpause\fR"
1585Causes the switch to freeze the packet's trip through Open vSwitch
1586flow tables and serializes that state into the packet-in message as a
1587``continuation,'' an additional property in the \fBNXT_PACKET_IN2\fR
1588message. The controller can later send the continuation back to the
1589switch in an \fBNXT_RESUME\fR message, which will restart the packet's
1590traversal from the point where it was interrupted. This permits an
1591OpenFlow controller to interpose on a packet midway through processing
1592in Open vSwitch.
bdcad671 1593.
a7349929 1594.RE
d1ba66e9 1595.IP
bdcad671
BP
1596If any \fIreason\fR other than \fBaction\fR or any nonzero
1597\fIcontroller-id\fR is supplied, Open vSwitch extension
1598\fBNXAST_CONTROLLER\fR, supported by Open vSwitch 1.6 and later, is
1599used. If \fBuserdata\fR is supplied, then \fBNXAST_CONTROLLER2\fR,
1600supported by Open vSwitch 2.6 and later, is used.
a7349929
BP
1601.
1602.IP \fBcontroller\fR
1603.IQ \fBcontroller\fR[\fB:\fInbytes\fR]
1604Shorthand for \fBcontroller()\fR or
1605\fBcontroller(max_len=\fInbytes\fB)\fR, respectively.
a9b4a41a 1606.
d1ba66e9
BP
1607.IP \fBenqueue(\fIport\fB,\fIqueue\fB)\fR
1608Enqueues the packet on the specified \fIqueue\fR within port
1609\fIport\fR, which must be an OpenFlow port number or keyword
1610(e.g. \fBLOCAL\fR). The number of supported queues depends on the
1611switch; some OpenFlow implementations do not support queuing at all.
64c1e8af 1612.
064af421
BP
1613.IP \fBdrop\fR
1614Discards the packet, so no further processing or forwarding takes place.
1615If a drop action is used, no other actions may be specified.
a9b4a41a 1616.
064af421
BP
1617.IP \fBmod_vlan_vid\fR:\fIvlan_vid\fR
1618Modifies the VLAN id on a packet. The VLAN tag is added or modified
1619as necessary to match the value specified. If the VLAN tag is added,
1620a priority of zero is used (see the \fBmod_vlan_pcp\fR action to set
1621this).
a9b4a41a 1622.
064af421
BP
1623.IP \fBmod_vlan_pcp\fR:\fIvlan_pcp\fR
1624Modifies the VLAN priority on a packet. The VLAN tag is added or modified
1625as necessary to match the value specified. Valid values are between 0
1626(lowest) and 7 (highest). If the VLAN tag is added, a vid of zero is used
1627(see the \fBmod_vlan_vid\fR action to set this).
a9b4a41a 1628.
064af421
BP
1629.IP \fBstrip_vlan\fR
1630Strips the VLAN tag from a packet if it is present.
a9b4a41a 1631.
3e34fbdd 1632.IP \fBpush_vlan\fR:\fIethertype\fR
898dcef1 1633Push a new VLAN tag onto the packet. Ethertype is used as the Ethertype
3e34fbdd
IY
1634for the tag. Only ethertype 0x8100 should be used. (0x88a8 which the spec
1635allows isn't supported at the moment.)
1636A priority of zero and the tag of zero are used for the new tag.
1637.
b02475c5 1638.IP \fBpush_mpls\fR:\fIethertype\fR
912c1938
SH
1639Changes the packet's Ethertype to \fIethertype\fR, which must be either
1640\fB0x8847\fR or \fB0x8848\fR, and pushes an MPLS LSE.
1641.IP
1642If the packet does not already contain any MPLS labels then an initial
1643label stack entry is pushed. The label stack entry's label is 2 if the
1644packet contains IPv6 and 0 otherwise, its default traffic control value is
1645the low 3 bits of the packet's DSCP value (0 if the packet is not IP), and
1646its TTL is copied from the IP TTL (64 if the packet is not IP).
b02475c5
SH
1647.IP
1648If the packet does already contain an MPLS label, pushes a new
1649outermost label as a copy of the existing outermost label.
1650.IP
b0a17866
SH
1651A limitation of the implementation is that processing of actions will stop
1652if \fBpush_mpls\fR follows another \fBpush_mpls\fR unless there is a
1653\fBpop_mpls\fR in between.
b02475c5
SH
1654.
1655.IP \fBpop_mpls\fR:\fIethertype\fR
799a91bb
SH
1656Strips the outermost MPLS label stack entry.
1657Currently the implementation restricts \fIethertype\fR to a non-MPLS Ethertype
1658and thus \fBpop_mpls\fR should only be applied to packets with
b0a17866
SH
1659an MPLS label stack depth of one. A further limitation is that processing of
1660actions will stop if \fBpop_mpls\fR follows another \fBpop_mpls\fR unless
1661there is a \fBpush_mpls\fR in between.
b02475c5 1662.
064af421
BP
1663.IP \fBmod_dl_src\fB:\fImac\fR
1664Sets the source Ethernet address to \fImac\fR.
a9b4a41a 1665.
064af421
BP
1666.IP \fBmod_dl_dst\fB:\fImac\fR
1667Sets the destination Ethernet address to \fImac\fR.
a9b4a41a 1668.
e423eca6
JP
1669.IP \fBmod_nw_src\fB:\fIip\fR
1670Sets the IPv4 source address to \fIip\fR.
a9b4a41a 1671.
e423eca6
JP
1672.IP \fBmod_nw_dst\fB:\fIip\fR
1673Sets the IPv4 destination address to \fIip\fR.
a9b4a41a 1674.
e423eca6 1675.IP \fBmod_tp_src\fB:\fIport\fR
0d56eaf2 1676Sets the TCP or UDP or SCTP source port to \fIport\fR.
a9b4a41a 1677.
e423eca6 1678.IP \fBmod_tp_dst\fB:\fIport\fR
0d56eaf2 1679Sets the TCP or UDP or SCTP destination port to \fIport\fR.
a9b4a41a 1680.
959a2ecd 1681.IP \fBmod_nw_tos\fB:\fItos\fR
04f01c24
BP
1682Sets the DSCP bits in the IPv4 ToS/DSCP or IPv6 traffic class field to
1683\fItos\fR, which must be a multiple of 4 between 0 and 255. This action
1684does not modify the two least significant bits of the ToS field (the ECN bits).
ff14eb7a
JR
1685.
1686.IP \fBmod_nw_ecn\fB:\fIecn\fR
1687Sets the ECN bits in the IPv4 ToS or IPv6 traffic class field to \fIecn\fR,
1688which must be a value between 0 and 3, inclusive. This action does not modify
1689the six most significant bits of the field (the DSCP bits).
1690.IP
1691Requires OpenFlow 1.1 or later.
0c20dbe4
JR
1692.
1693.IP \fBmod_nw_ttl\fB:\fIttl\fR
1694Sets the IPv4 TTL or IPv6 hop limit field to \fIttl\fR, which is specified as
1695a decimal number between 0 and 255, inclusive. Switch behavior when setting
1696\fIttl\fR to zero is not well specified, though.
1697.IP
1698Requires OpenFlow 1.1 or later.
659586ef
JG
1699.RE
1700.IP
1701The following actions are Nicira vendor extensions that, as of this writing, are
1702only known to be implemented by Open vSwitch:
1703.
1704.RS
1705.
3a2fe1f3 1706.IP \fBresubmit\fB:\fIport\fR
29901626
BP
1707.IQ \fBresubmit\fB(\fR[\fIport\fR]\fB,\fR[\fItable\fR]\fB)
1708Re-searches this OpenFlow flow table (or the table whose number is
1709specified by \fItable\fR) with the \fBin_port\fR field replaced by
1710\fIport\fR (if \fIport\fR is specified) and executes the actions
1711found, if any, in addition to any other actions in this flow entry.
1712.IP
790c5d26
BP
1713Recursive \fBresubmit\fR actions are obeyed up to
1714implementation-defined limits:
1715.RS
1716.IP \(bu
1717Open vSwitch 1.0.1 and earlier did not support recursion.
1718.IP \(bu
1719Open vSwitch 1.0.2 and 1.0.3 limited recursion to 8 levels.
1720.IP \(bu
1721Open vSwitch 1.1 and 1.2 limited recursion to 16 levels.
1722.IP \(bu
1723Open vSwitch 1.2 through 1.8 limited recursion to 32 levels.
1724.IP \(bu
1725Open vSwitch 1.9 through 2.0 limited recursion to 64 levels.
1726.IP \(bu
1727Open vSwitch 2.1 through 2.5 limited recursion to 64 levels and impose
1728a total limit of 4,096 resubmits per flow translation (earlier versions
1729did not impose any total limit).
1730.IP \(bu
1731Open vSwitch 2.6 and later imposes the same limits as 2.5, with one
1732exception: \fBresubmit\fR from table \fIx\fR to any table \fIy\fR >
1733\fIx\fR does not count against the recursion limit.
1734.RE
1735.IP
1736Open vSwitch before 1.2.90 did not support \fItable\fR.
659586ef
JG
1737.
1738.IP \fBset_tunnel\fB:\fIid\fR
b9298d3f
BP
1739.IQ \fBset_tunnel64\fB:\fIid\fR
1740If outputting to a port that encapsulates the packet in a tunnel and
5a6861aa 1741supports an identifier (such as GRE), sets the identifier to \fIid\fR.
b9298d3f
BP
1742If the \fBset_tunnel\fR form is used and \fIid\fR fits in 32 bits,
1743then this uses an action extension that is supported by Open vSwitch
17441.0 and later. Otherwise, if \fIid\fR is a 64-bit value, it requires
1745Open vSwitch 1.1 or later.
3a2fe1f3 1746.
eedc0097
JP
1747.IP \fBset_queue\fB:\fIqueue\fR
1748Sets the queue that should be used to \fIqueue\fR when packets are
1749output. The number of supported queues depends on the switch; some
1750OpenFlow implementations do not support queuing at all.
1751.
1752.IP \fBpop_queue\fR
1753Restores the queue to the value it was before any \fBset_queue\fR
1754actions were applied.
1755.
07659514
JS
1756.IP \fBct\fR
1757.IQ \fBct\fB(\fR[\fIargument\fR][\fB,\fIargument\fR...]\fB)
1758Send the packet through the connection tracker. Refer to the \fBct_state\fR
1759documentation above for possible packet and connection states. The following
1760arguments are supported:
1761
1762.RS
1763.IP \fBcommit\fR
1764.RS
1765Commit the connection to the connection tracking module. Information about the
1766connection will be stored beyond the lifetime of the packet in the pipeline.
1767Some \fBct_state\fR flags are only available for committed connections.
1768.RE
1769.IP \fBtable=\fInumber\fR
1770Fork pipeline processing in two. The original instance of the packet will
1771continue processing the current actions list as an untracked packet. An
1772additional instance of the packet will be sent to the connection tracker, which
1773will be re-injected into the OpenFlow pipeline to resume processing in table
1774\fInumber\fR, with the \fBct_state\fR and other ct match fields set. If the
54da48f4
JS
1775\fBtable\fR is not specified, then the packet which is submitted to the
1776connection tracker is not re-injected into the OpenFlow pipeline. It is
1777strongly recommended to specify a table later than the current table to prevent
1778loops.
07659514
JS
1779.IP \fBzone=\fIvalue\fR
1780.IQ \fBzone=\fIsrc\fB[\fIstart\fB..\fIend\fB]\fR
1781A 16-bit context id that can be used to isolate connections into separate
1782domains, allowing overlapping network addresses in different zones. If a zone
1783is not provided, then the default is to use zone zero. The \fBzone\fR may be
1784specified either as an immediate 16-bit \fIvalue\fR, or may be provided from an
8e53fe8c 1785NXM field \fIsrc\fR. The \fIstart\fR and \fIend\fR pair are inclusive, and must
54da48f4
JS
1786specify a 16-bit range within the field. This value is copied to the
1787\fBct_zone\fR match field for packets which are re-injected into the pipeline
1788using the \fBtable\fR option.
8e53fe8c 1789.IP \fBexec\fB(\fR[\fIaction\fR][\fB,\fIaction\fR...]\fB)\fR
54da48f4
JS
1790Perform actions within the context of connection tracking. This is a restricted
1791set of actions which are in the same format as their specifications as part
1792of a flow. Only actions which modify the \fBct_mark\fR or \fBct_label\fR
1793fields are accepted within the \fBexec\fR action, and these fields may only be
1794modified with this option. For example:
8e53fe8c
JS
1795.
1796.RS
96f46bfc 1797.IP \fBset_field:\fIvalue\fR[\fB/\fImask\fR]->ct_mark\fR
91440329
JR
1798Store a 32-bit metadata value with the connection. Subsequent lookups
1799for packets in this connection will populate the \fBct_mark\fR flow
1800field when the packet is sent to the connection tracker with the
1801\fBtable\fR specified.
96f46bfc 1802.IP \fBset_field:\fIvalue\fR[\fB/\fImask\fR]->ct_label\fR
91440329
JR
1803Store a 128-bit metadata value with the connection. Subsequent
1804lookups for packets in this connection will populate the
1805\fBct_label\fR flow field when the packet is sent to the connection
1806tracker with the \fBtable\fR specified.
8e53fe8c
JS
1807.RE
1808.IP
3a103e4a 1809The \fBcommit\fR parameter must be specified to use \fBexec(...)\fR.
8e53fe8c 1810.
d787ad39
JS
1811.IP \fBalg=\fIalg\fR
1812Specify application layer gateway \fIalg\fR to track specific connection
1813types. Supported types include:
1814.RS
1815.IP \fBftp\fR
1816Look for negotiation of FTP data connections. If a subsequent FTP data
1817connection arrives which is related, the \fBct\fR action will set the
1818\fBrel\fR flag in the \fBct_state\fR field for packets sent through \fBct\fR.
1819.RE
1820.
54da48f4 1821.IP
3a103e4a
RB
1822The \fBcommit\fR parameter must be specified to use \fBalg=\fIalg\fR.
1823.
1824.IP
54da48f4
JS
1825When committing related connections, the \fBct_mark\fR for that connection is
1826inherited from the current \fBct_mark\fR stored with the original connection
1827(ie, the connection created by \fBct(alg=...)\fR).
ae8b9260
JR
1828.
1829.IP \fBnat\fR[\fB(\fR(\fBsrc\fR|\fBdst\fR)\fB=\fIaddr1\fR[\fB-\fIaddr2\fR][\fB:\fIport1\fR[\fB-\fIport2\fR]][\fB,\fIflags\fR]\fB)\fR]
1830.
1831Specify address and port translation for the connection being tracked.
1832For new connections either \fBsrc\fR or \fBdst\fR argument must be
1833provided to set up either source address/port translation (SNAT) or
1834destination address/port translation (DNAT), respectively. Setting up
1835address translation for a new connection takes effect only if the
1836\fBcommit\fR flag is also provided for the enclosing \fBct\fR action.
1837A bare \fBnat\fR action will only translate the packet being processed
1838in the way the connection has been set up with an earlier \fBct\fR
1839action. Also a \fBnat\fR action with \fBsrc\fR or \fBdst\fR, when
1840applied to a packet belonging to an established (rather than new)
1841connection, will behave the same as a bare \fBnat\fR.
1842.IP
1843\fBsrc\fR and \fBdst\fR options take the following arguments:
1844.RS
1845.IP \fIaddr1\fR[\fB-\fIaddr2\fR]
1846The address range from which the translated address should be
1847selected. If only one address is given, then that address will always
1848be selected, otherwise the address selection can be informed by the
1849optional \fBpersistent\fR flag as described below. Either IPv4 or
1850IPv6 addresses can be provided, but both addresses must be of the same
1851type, and the datapath behavior is undefined in case of providing IPv4
1852address range for an IPv6 packet, or IPv6 address range for an IPv4
1853packet. IPv6 addresses must be bracketed with '[' and ']' if a port
1854range is also given.
1855.RE
1856.
1857.RS
1858.IP \fIport1\fR[\fB-\fIport2\fR]
1859The port range from which the translated port should be selected. If
1860only one port number is provided, then that should be selected. In
1861case of a mapping conflict the datapath may choose any other
1862non-conflicting port number instead, even when no port range is
1863specified. The port number selection can be informed by the optional
1864\fBrandom\fR and \fBhash\fR flags as described below.
1865.RE
1866.IP
1867The optional flags are:
1868.RS
1869.IP \fBrandom\fR
1870The selection of the port from the given range should be done using a
1871fresh random number. This flag is mutually exclusive with \fBhash\fR.
1872.RE
1873.
1874.RS
1875.IP \fBhash\fR
1876The selection of the port from the given range should be done using a
1877datapath specific hash of the packet's IP addresses and the other,
1878non-mapped port number. This flag is mutually exclusive with
1879\fBrandom\fR.
1880.RE
1881.
1882.RS
1883.IP \fBpersistent\fR
1884The selection of the IP address from the given range should be done so
1885that the same mapping can be provided after the system restarts.
1886.RE
1887.IP
1888If an \fBalg\fR is specified for the committing \fBct\fR action that
1889also includes \fBnat\fR with a \fBsrc\fR or \fBdst\fR attribute,
1890then the datapath tries to set up the helper to be NAT aware. This
1891functionality is datapath specific and may not be supported by all
1892datapaths.
1893.IP
1894\fBnat\fR was introduced in Open vSwitch 2.6. The first datapath that
1895implements \fBct nat\fR support is the one that ships with Linux 4.6.
07659514
JS
1896.RE
1897.IP
1898The \fBct\fR action may be used as a primitive to construct stateful firewalls
1899by selectively committing some traffic, then matching the \fBct_state\fR to
1900allow established connections while denying new connections. The following
1901flows provide an example of how to implement a simple firewall that allows new
1902connections from port 1 to port 2, and only allows established connections to
1903send traffic from port 2 to port 1:
1904 \fBtable=0,priority=1,action=drop
1905 table=0,priority=10,arp,action=normal
1906 table=0,priority=100,ip,ct_state=-trk,action=ct(table=1)
1907 table=1,in_port=1,ip,ct_state=+trk+new,action=ct(commit),2
1908 table=1,in_port=1,ip,ct_state=+trk+est,action=2
1909 table=1,in_port=2,ip,ct_state=+trk+new,action=drop
1910 table=1,in_port=2,ip,ct_state=+trk+est,action=1\fR
1911.IP
1912If \fBct\fR is executed on IP (or IPv6) fragments, then the message is
1913implicitly reassembled before sending to the connection tracker and
1914refragmented upon \fBoutput\fR, to the original maximum received fragment size.
54da48f4
JS
1915Reassembly occurs within the context of the \fBzone\fR, meaning that IP
1916fragments in different zones are not assembled together. Pipeline processing
1917for the initial fragments is halted; When the final fragment is received, the
1918message is assembled and pipeline processing will continue for that flow.
07659514
JS
1919Because packet ordering is not guaranteed by IP protocols, it is not possible
1920to determine which IP fragment will cause message reassembly (and therefore
1921continue pipeline processing). As such, it is strongly recommended that
1922multiple flows should not execute \fBct\fR to reassemble fragments from the
1923same IP message.
1924.IP
1925Currently, connection tracking is only available on Linux kernels with the
54da48f4
JS
1926nf_conntrack module loaded. The \fBct\fR action was introduced in Open vSwitch
19272.5.
07659514 1928.
f0fd1a17 1929.IP \fBdec_ttl\fR
ef6d1b11 1930.IQ \fBdec_ttl(\fIid1\fR[\fB,\fIid2\fR]...\fB)\fR
f0fd1a17 1931Decrement TTL of IPv4 packet or hop limit of IPv6 packet. If the
972b5f38
JR
1932TTL or hop limit is initially zero or decrementing would make it so, no
1933decrement occurs, as packets reaching TTL zero must be rejected. Instead,
f0fd1a17
PS
1934a ``packet-in'' message with reason code \fBOFPR_INVALID_TTL\fR is
1935sent to each connected controller that has enabled receiving them,
c2d967a5
MM
1936if any. Processing the current set of actions then stops. However,
1937if the current set of actions was reached through ``resubmit'' then
ef6d1b11
JP
1938remaining actions in outer levels resume processing.
1939.IP
1940This action also optionally supports the ability to specify a list of
1941valid controller ids. Each of the controllers in the list will receive
1942the ``packet_in'' message only if they have registered to receive the
c2d967a5
MM
1943invalid ttl packets. If controller ids are not specified, the
1944``packet_in'' message will be sent only to the controllers having
1945controller id zero which have registered for the invalid ttl packets.
f0fd1a17 1946.
afd5ac06
SH
1947.IP \fBset_mpls_label\fR:\fIlabel\fR
1948Set the label of the outer MPLS label stack entry of a packet.
1949\fIlabel\fR should be a 20-bit value that is decimal by default;
1950use a \fB0x\fR prefix to specify them in hexadecimal.
1951.
1952.IP \fBset_mpls_tc\fR:\fItc\fR
1953Set the traffic-class of the outer MPLS label stack entry of a packet.
1954\fItc\fR should be a in the range 0 to 7 inclusive.
1955.
0f3f3c3d
SH
1956.IP \fBset_mpls_ttl\fR:\fIttl\fR
1957Set the TTL of the outer MPLS label stack entry of a packet.
1958\fIttl\fR should be in the range 0 to 255 inclusive.
1959.
b676167a
SH
1960.IP \fBdec_mpls_ttl\fR
1961Decrement TTL of the outer MPLS label stack entry of a packet. If the TTL
972b5f38
JR
1962is initially zero or decrementing would make it so, no decrement occurs.
1963Instead, a ``packet-in'' message with reason code \fBOFPR_INVALID_TTL\fR
1964is sent to the main controller (id zero), if it has enabled receiving them.
b676167a
SH
1965Processing the current set of actions then stops. However, if the current
1966set of actions was reached through ``resubmit'' then remaining actions in
1967outer levels resume processing.
1968.
96fc46e8
BP
1969.IP \fBnote:\fR[\fIhh\fR]...
1970Does nothing at all. Any number of bytes represented as hex digits
1971\fIhh\fR may be included. Pairs of hex digits may be separated by
1972periods for readability.
e0631927
BP
1973The \fBnote\fR action's format doesn't include an exact length for its
1974payload, so the provided bytes will be padded on the right by enough
1975bytes with value 0 to make the total number 6 more than a multiple of
19768.
f393f81e 1977.
5a6861aa 1978.IP "\fBmove:\fIsrc\fB[\fIstart\fB..\fIend\fB]\->\fIdst\fB[\fIstart\fB..\fIend\fB]\fR"
f393f81e
BP
1979Copies the named bits from field \fIsrc\fR to field \fIdst\fR.
1980\fIsrc\fR and \fIdst\fR must be NXM field names as defined in
1981\fBnicira\-ext.h\fR, e.g. \fBNXM_OF_UDP_SRC\fR or \fBNXM_NX_REG0\fR.
1982Each \fIstart\fR and \fIend\fR pair, which are inclusive, must specify
1983the same number of bits and must fit within its respective field.
1984Shorthands for \fB[\fIstart\fB..\fIend\fB]\fR exist: use
1985\fB[\fIbit\fB]\fR to specify a single bit or \fB[]\fR to specify an
1986entire field.
1987.IP
1988Examples: \fBmove:NXM_NX_REG0[0..5]\->NXM_NX_REG1[26..31]\fR copies the
1989six bits numbered 0 through 5, inclusive, in register 0 into bits 26
1990through 31, inclusive;
5a6861aa 1991\fBmove:NXM_NX_REG0[0..15]\->NXM_OF_VLAN_TCI[]\fR copies the least
f393f81e 1992significant 16 bits of register 0 into the VLAN TCI field.
1a12c419 1993.IP
914624f8
BP
1994In OpenFlow 1.0 through 1.4, \fBmove\fR ordinarily uses an Open
1995vSwitch extension to OpenFlow. In OpenFlow 1.5, \fBmove\fR uses the
d3cb080e 1996OpenFlow 1.5 standard \fBcopy_field\fR action. The ONF has
914624f8
BP
1997also made \fBcopy_field\fR available as an extension to OpenFlow 1.3.
1998Open vSwitch 2.4 and later understands this extension and uses it if a
1999controller uses it, but for backward compatibility with older versions
2000of Open vSwitch, \fBovs\-ofctl\fR does not use it.
f393f81e 2001.
7eb4b1f1
BP
2002.IP "\fBset_field:\fIvalue\fR[/\fImask\fR]\fB\->\fIdst"
2003.IQ "\fBload:\fIvalue\fB\->\fIdst\fB[\fIstart\fB..\fIend\fB]"
2004Loads a literal value into a field or part of a field. With
2005\fBset_field\fR, \fBvalue\fR and the optional \fBmask\fR are given in
2006the customary syntax for field \fIdst\fR, which is expressed as a
2007field name. For example, \fBset_field:00:11:22:33:44:55->eth_src\fR
2008sets the Ethernet source address to 00:11:22:33:44:55. With
2009\fBload\fR, \fIvalue\fR must be an integer value (in decimal or
2010prefixed by \fB0x\fR for hexadecimal) and \fIdst\fR is the NXM or OXM
2011name for the field. For example,
2012\fBload:0x001122334455->OXM_OF_ETH_DST[]\fR has the same effect as the
2013prior \fBset_field\fR example.
2014.IP
2015The two forms exist for historical reasons. Open vSwitch 1.1
2016introduced \fBNXAST_REG_LOAD\fR as a Nicira extension to OpenFlow 1.0
2017and used \fBload\fR to express it. Later, OpenFlow 1.2 introduced a
2018standard \fBOFPAT_SET_FIELD\fR action that was restricted to loading
2019entire fields, so Open vSwitch added the form \fBset_field\fR with
2020this restriction. OpenFlow 1.5 extended \fBOFPAT_SET_FIELD\fR to the
2021point that it became a superset of \fBNXAST_REG_LOAD\fR. Open vSwitch
2022translates either syntax as necessary for the OpenFlow version in use:
2023in OpenFlow 1.0 and 1.1, \fBNXAST_REG_LOAD\fR; in OpenFlow 1.2, 1.3,
2024and 1.4, \fBNXAST_REG_LOAD\fR for \fBload\fR or for loading a
2025subfield, \fBOFPAT_SET_FIELD\fR otherwise; and OpenFlow 1.5 and later,
2026\fBOFPAT_SET_FIELD\fR.
53ddd40a 2027.
bd85dac1
AZ
2028.IP "\fBpush:\fIsrc\fB[\fIstart\fB..\fIend\fB]"
2029Pushes \fIstart\fR to \fIend\fR bits inclusive, in fields
2030on top of the stack.
2031.IP
2032Example: \fBpush:NXM_NX_REG2[0..5]\fR push the value stored in register
20332 bits 0 through 5, inclusive, on to the internal stack.
2034.
2035.IP "\fBpop:\fIdst\fB[\fIstart\fB..\fIend\fB]"
2036Pops from the top of the stack, retrieves the \fIstart\fR to \fIend\fR bits
2037inclusive, from the value popped and store them into the corresponding
2038bits in \fIdst\fR.
2039.
2040.IP
2041Example: \fBpop:NXM_NX_REG2[0..5]\fR pops the value from top of the stack.
2042Set register 2 bits 0 through 5, inclusive, based on bits 0 through 5 from the
2043value just popped.
2044.
f5c45121 2045.
53ddd40a
BP
2046.IP "\fBmultipath(\fIfields\fB, \fIbasis\fB, \fIalgorithm\fB, \fIn_links\fB, \fIarg\fB, \fIdst\fB[\fIstart\fB..\fIend\fB])\fR"
2047Hashes \fIfields\fR using \fIbasis\fR as a universal hash parameter,
2048then the applies multipath link selection \fIalgorithm\fR (with
2049parameter \fIarg\fR) to choose one of \fIn_links\fR output links
2050numbered 0 through \fIn_links\fR minus 1, and stores the link into
43edca57 2051\fIdst\fB[\fIstart\fB..\fIend\fB]\fR, which must be an NXM field as
53ddd40a
BP
2052described above.
2053.IP
4249b547
JB
2054\fIfields\fR must be one of the following:
2055.RS
2056.IP \fBeth_src\fR
2057Hashes Ethernet source address only.
2058.IP \fBsymmetric_l4\fR
2059Hashes Ethernet source, destination, and type, VLAN ID, IPv4/IPv6
2060source, destination, and protocol, and TCP or SCTP (but not UDP)
2061ports. The hash is computed so that pairs of corresponding flows in
2062each direction hash to the same value, in environments where L2 paths
2063are the same in each direction. UDP ports are not included in the
2064hash to support protocols such as VXLAN that use asymmetric ports in
2065each direction.
2066.IP \fBsymmetric_l3l4\fR
2067Hashes IPv4/IPv6 source, destination, and protocol, and TCP or SCTP
2068(but not UDP) ports. Like \fBsymmetric_l4\fR, this is a symmetric
2069hash, but by excluding L2 headers it is more effective in environments
2070with asymmetric L2 paths (e.g. paths involving VRRP IP addresses on a
2071router). Not an effective hash function for protocols other than IPv4
2072and IPv6, which hash to a constant zero.
2073.IP \fBsymmetric_l3l4+udp\fR
2074Like \fBsymmetric_l3l4+udp\fR, but UDP ports are included in the hash.
2075This is a more effective hash when asymmetric UDP protocols such as
2076VXLAN are not a consideration.
2077.RE
2078.IP
2079\fIalgorithm\fR must be one of \fBmodulo_n\fR,
53ddd40a
BP
2080\fBhash_threshold\fR, \fBhrw\fR, and \fBiter_hash\fR. Only
2081the \fBiter_hash\fR algorithm uses \fIarg\fR.
2082.IP
2083Refer to \fBnicira\-ext.h\fR for more details.
3b6a2571 2084.
daff3353
EJ
2085.IP "\fBbundle(\fIfields\fB, \fIbasis\fB, \fIalgorithm\fB, \fIslave_type\fB, slaves:[\fIs1\fB, \fIs2\fB, ...])\fR"
2086Hashes \fIfields\fR using \fIbasis\fR as a universal hash parameter, then
2087applies the bundle link selection \fIalgorithm\fR to choose one of the listed
2088slaves represented as \fIslave_type\fR. Currently the only supported
2089\fIslave_type\fR is \fBofport\fR. Thus, each \fIs1\fR through \fIsN\fR should
2090be an OpenFlow port number. Outputs to the selected slave.
2091.IP
4249b547
JB
2092Currently, \fIfields\fR must be either \fBeth_src\fR, \fBsymmetric_l4\fR, \fBsymmetric_l3l4\fR, or \fBsymmetric_l3l4+udp\fR,
2093and \fIalgorithm\fR must be one of \fBhrw\fR and \fBactive_backup\fR.
daff3353
EJ
2094.IP
2095Example: \fBbundle(eth_src,0,hrw,ofport,slaves:4,8)\fR uses an Ethernet source
2096hash with basis 0, to select between OpenFlow ports 4 and 8 using the Highest
2097Random Weight algorithm.
2098.IP
2099Refer to \fBnicira\-ext.h\fR for more details.
a368bb53
EJ
2100.
2101.IP "\fBbundle_load(\fIfields\fB, \fIbasis\fB, \fIalgorithm\fB, \fIslave_type\fB, \fIdst\fB[\fIstart\fB..\fIend\fB], slaves:[\fIs1\fB, \fIs2\fB, ...])\fR"
2102Has the same behavior as the \fBbundle\fR action, with one exception. Instead
2103of outputting to the selected slave, it writes its selection to
2104\fIdst\fB[\fIstart\fB..\fIend\fB]\fR, which must be an NXM field as described
2105above.
2106.IP
2638c6dc
BP
2107Example: \fBbundle_load(eth_src, 0, hrw, ofport, NXM_NX_REG0[],
2108slaves:4, 8)\fR uses an Ethernet source hash with basis 0, to select
2109between OpenFlow ports 4 and 8 using the Highest Random Weight
2110algorithm, and writes the selection to \fBNXM_NX_REG0[]\fR.
a368bb53
EJ
2111.IP
2112Refer to \fBnicira\-ext.h\fR for more details.
75a75043
BP
2113.
2114.IP "\fBlearn(\fIargument\fR[\fB,\fIargument\fR]...\fB)\fR"
2115This action adds or modifies a flow in an OpenFlow table, similar to
2116\fBovs\-ofctl \-\-strict mod\-flows\fR. The arguments specify the
2117flow's match fields, actions, and other properties, as follows. At
2118least one match criterion and one action argument should ordinarily be
2119specified.
2120.RS
2121.IP \fBidle_timeout=\fIseconds\fR
2122.IQ \fBhard_timeout=\fIseconds\fR
2123.IQ \fBpriority=\fIvalue\fR
45d77538 2124.IQ \fBcookie=\fIvalue\fR
3d6832c2
BP
2125.IQ \fBsend_flow_rem\fR
2126These arguments have the same meaning as in the usual \fBovs\-ofctl\fR
2127flow syntax.
75a75043 2128.
0e553d9c
BP
2129.IP \fBfin_idle_timeout=\fIseconds\fR
2130.IQ \fBfin_hard_timeout=\fIseconds\fR
2131Adds a \fBfin_timeout\fR action with the specified arguments to the
2132new flow. This feature was added in Open vSwitch 1.5.90.
2133.
75a75043
BP
2134.IP \fBtable=\fInumber\fR
2135The table in which the new flow should be inserted. Specify a decimal
2136number between 0 and 254. The default, if \fBtable\fR is unspecified,
2137is table 1.
2138.
35f48b8b
BP
2139.IP \fBdelete_learned\fR
2140This flag enables deletion of the learned flows when the flow with the
2141\fBlearn\fR action is removed. Specifically, when the last
2142\fBlearn\fR action with this flag and particular \fBtable\fR and
2143\fBcookie\fR values is removed, the switch deletes all of the flows in
2144the specified table with the specified cookie.
2145.
2146.IP
2147This flag was added in Open vSwitch 2.4.
2148.
75a75043
BP
2149.IP \fIfield\fB=\fIvalue\fR
2150.IQ \fIfield\fB[\fIstart\fB..\fIend\fB]=\fIsrc\fB[\fIstart\fB..\fIend\fB]\fR
2151.IQ \fIfield\fB[\fIstart\fB..\fIend\fB]\fR
2152Adds a match criterion to the new flow.
2153.IP
2154The first form specifies that \fIfield\fR must match the literal
2155\fIvalue\fR, e.g. \fBdl_type=0x0800\fR. All of the fields and values
2156for \fBovs\-ofctl\fR flow syntax are available with their usual
2157meanings.
2158.IP
2159The second form specifies that \fIfield\fB[\fIstart\fB..\fIend\fB]\fR
2160in the new flow must match \fIsrc\fB[\fIstart\fB..\fIend\fB]\fR taken
2161from the flow currently being processed.
2162.IP
2163The third form is a shorthand for the second form. It specifies that
2164\fIfield\fB[\fIstart\fB..\fIend\fB]\fR in the new flow must match
2165\fIfield\fB[\fIstart\fB..\fIend\fB]\fR taken from the flow currently
2166being processed.
2167.
2168.IP \fBload:\fIvalue\fB\->\fIdst\fB[\fIstart\fB..\fIend\fB]
2169.IQ \fBload:\fIsrc\fB[\fIstart\fB..\fIend\fB]\->\fIdst\fB[\fIstart\fB..\fIend\fB]
2170.
2171Adds a \fBload\fR action to the new flow.
2172.IP
2173The first form loads the literal \fIvalue\fR into bits \fIstart\fR
2174through \fIend\fR, inclusive, in field \fIdst\fR. Its syntax is the
2175same as the \fBload\fR action described earlier in this section.
2176.IP
2177The second form loads \fIsrc\fB[\fIstart\fB..\fIend\fB]\fR, a value
2178from the flow currently being processed, into bits \fIstart\fR
2179through \fIend\fR, inclusive, in field \fIdst\fR.
2180.
2181.IP \fBoutput:\fIfield\fB[\fIstart\fB..\fIend\fB]\fR
2182Add an \fBoutput\fR action to the new flow's actions, that outputs to
2183the OpenFlow port taken from \fIfield\fB[\fIstart\fB..\fIend\fB]\fR,
2184which must be an NXM field as described above.
2185.RE
2186.IP
2187For best performance, segregate learned flows into a table (using
2188\fBtable=\fInumber\fR) that is not used for any other flows except
2189possibly for a lowest-priority ``catch-all'' flow, that is, a flow
2190with no match criteria. (This is why the default \fBtable\fR is 1, to
2191keep the learned flows separate from the primary flow table 0.)
c4f5d00b 2192.RE
a9b4a41a 2193.
8dd54666 2194.RS
8dd54666 2195.
b19e8793
IY
2196.IP \fBclear_actions\fR
2197Clears all the actions in the action set immediately.
2198.
7fdb60a7
SH
2199.IP \fBwrite_actions(\fR[\fIaction\fR][\fB,\fIaction\fR...]\fB)
2200Add the specific actions to the action set. The syntax of
2201\fIactions\fR is the same as in the \fBactions=\fR field. The action
2202set is carried between flow tables and then executed at the end of the
2203pipeline.
2204.
2205.IP
2206The actions in the action set are applied in the following order, as
2207required by the OpenFlow specification, regardless of the order in
2208which they were added to the action set. Except as specified
2209otherwise below, the action set only holds at most a single action of
2210each type. When more than one action of a single type is written to
2211the action set, the one written later replaces the earlier action:
2212.
2213.RS
2214.IP 1.
2215\fBstrip_vlan\fR
2216.IQ
2217\fBpop_mpls\fR
2218.
2219.IP 2.
2220\fBpush_mpls\fR
2221.
2222.IP 3.
2223\fBpush_vlan\fR
2224.
2225.IP 4.
2226\fBdec_ttl\fR
2227.IQ
2228\fBdec_mpls_ttl\fR
2229.
2230.IP 5.
2231\fBload\fR
2232.IQ
1b0ee636
TG
2233\fBmove\fR
2234.IQ
7fdb60a7
SH
2235\fBmod_dl_dst\fR
2236.IQ
2237\fBmod_dl_src\fR
2238.IQ
2239\fBmod_nw_dst\fR
2240.IQ
2241\fBmod_nw_src\fR
2242.IQ
2243\fBmod_nw_tos\fR
2244.IQ
ff14eb7a
JR
2245\fBmod_nw_ecn\fR
2246.IQ
0c20dbe4
JR
2247\fBmod_nw_ttl\fR
2248.IQ
7fdb60a7
SH
2249\fBmod_tp_dst\fR
2250.IQ
2251\fBmod_tp_src\fR
2252.IQ
2253\fBmod_vlan_pcp\fR
2254.IQ
2255\fBmod_vlan_vid\fR
2256.IQ
2257\fBset_field\fR
2258.IQ
2259\fBset_tunnel\fR
2260.IQ
2261\fBset_tunnel64\fR
2262.IQ
2263The action set can contain any number of these actions, with
1b0ee636
TG
2264cumulative effect. They will be applied in the order as added.
2265That is, when multiple actions modify the same part of a field,
2266the later modification takes effect, and when they modify
2267different parts of a field (or different fields), then both
7fdb60a7
SH
2268modifications are applied.
2269.
2270.IP 6.
2271\fBset_queue\fR
2272.
2273.IP 7.
2274\fBgroup\fR
2275.IQ
2276\fBoutput\fR
2277.IQ
2e34a6a3
SS
2278\fBresubmit\fR
2279.IQ
2280If more than one of these actions is present, then the one listed
2281earliest above is executed and the others are ignored, regardless of
2282the order in which they were added to the action set. (If none of these
2283actions is present, the action set has no real effect, because the
2284modified packet is not sent anywhere and thus the modifications are
2285not visible.)
7fdb60a7
SH
2286.RE
2287.IP
2288Only the actions listed above may be written to the action set.
2289.
4cceacb9
JS
2290.IP \fBwrite_metadata\fB:\fIvalue\fR[/\fImask\fR]
2291Updates the metadata field for the flow. If \fImask\fR is omitted, the
2292metadata field is set exactly to \fIvalue\fR; if \fImask\fR is specified, then
2293a 1-bit in \fImask\fR indicates that the corresponding bit in the metadata
2294field will be replaced with the corresponding bit from \fIvalue\fR. Both
2295\fIvalue\fR and \fImask\fR are 64-bit values that are decimal by default; use
2296a \fB0x\fR prefix to specify them in hexadecimal.
2297.
3200ed58
JR
2298.IP \fBmeter\fR:\fImeter_id\fR
2299Apply the \fImeter_id\fR before any other actions. If a meter band rate is
2300exceeded, the packet may be dropped, or modified, depending on the meter
2301band type. See the description of the \fBMeter Table Commands\fR, above,
2302for more details.
2303.
8dd54666
IY
2304.IP \fBgoto_table\fR:\fItable\fR
2305Indicates the next table in the process pipeline.
8dd54666 2306.
0e553d9c
BP
2307.IP "\fBfin_timeout(\fIargument\fR[\fB,\fIargument\fR]\fB)"
2308This action changes the idle timeout or hard timeout, or both, of this
2309OpenFlow rule when the rule matches a TCP packet with the FIN or RST
2310flag. When such a packet is observed, the action reduces the rule's
2311timeouts to those specified on the action. If the rule's existing
2312timeout is already shorter than the one that the action specifies,
2313then that timeout is unaffected.
2314.IP
2315\fIargument\fR takes the following forms:
2316.RS
2317.IP "\fBidle_timeout=\fIseconds\fR"
2318Causes the flow to expire after the given number of seconds of
2319inactivity.
2320.
2321.IP "\fBhard_timeout=\fIseconds\fR"
2322Causes the flow to expire after the given number of seconds,
2323regardless of activity. (\fIseconds\fR specifies time since the
2324flow's creation, not since the receipt of the FIN or RST.)
2325.RE
2326.IP
2327This action was added in Open vSwitch 1.5.90.
29089a54
RL
2328.
2329.IP "\fBsample(\fIargument\fR[\fB,\fIargument\fR]...\fB)\fR"
2330Samples packets and sends one sample for every sampled packet.
2331.IP
2332\fIargument\fR takes the following forms:
2333.RS
2334.IP "\fBprobability=\fIpackets\fR"
2335The number of sampled packets out of 65535. Must be greater or equal to 1.
2336.IP "\fBcollector_set_id=\fIid\fR"
2337The unsigned 32-bit integer identifier of the set of sample collectors
2338to send sampled packets to. Defaults to 0.
2339.IP "\fBobs_domain_id=\fIid\fR"
2340When sending samples to IPFIX collectors, the unsigned 32-bit integer
2341Observation Domain ID sent in every IPFIX flow record. Defaults to 0.
2342.IP "\fBobs_point_id=\fIid\fR"
2343When sending samples to IPFIX collectors, the unsigned 32-bit integer
2344Observation Point ID sent in every IPFIX flow record. Defaults to 0.
f69f713b
BY
2345.IP "\fBsampling_port=\fIport\fR"
2346Sample packets on the port. It can be set as input port or output
2347port. When this option is omitted, or specified as \fBNONE\fB, IPFIX
2348does not differentiate between ingress packets and egress packets and
2349does not export egress tunnel information. This option was added in
2350Open vSwitch 2.5.90.
29089a54
RL
2351.RE
2352.IP
fb8f22c1 2353Refer to \fBovs\-vswitchd.conf.db\fR(5) for more details on
29089a54
RL
2354configuring sample collector sets.
2355.IP
2356This action was added in Open vSwitch 1.10.90.
2357.
848e8809 2358.IP "\fBexit\fR"
7fdb60a7
SH
2359This action causes Open vSwitch to immediately halt execution of
2360further actions. Those actions which have already been executed are
2361unaffected. Any further actions, including those which may be in
2362other tables, or different levels of the \fBresubmit\fR call stack,
2363are ignored. Actions in the action set is still executed (specify
2364\fBclear_actions\fR before \fBexit\fR to discard them).
18080541
BP
2365.
2366.IP "\fBconjunction(\fIid\fB, \fIk\fB/\fIn\fR\fB)\fR"
2367An individual OpenFlow flow can match only a single value for each
2368field. However, situations often arise where one wants to match one
2369of a set of values within a field or fields. For matching a single
2370field against a set, it is straightforward and efficient to add
2371multiple flows to the flow table, one for each value in the set. For
2372example, one might use the following flows to send packets with IP
2373source address \fIa\fR, \fIb\fR, \fIc\fR, or \fId\fR to the OpenFlow
2374controller:
2375.RS +1in
2376.br
2377\fBip,ip_src=\fIa\fB actions=controller\fR
2378.br
2379\fBip,ip_src=\fIb\fB actions=controller\fR
2380.br
2381\fBip,ip_src=\fIc\fB actions=controller\fR
2382.br
2383\fBip,ip_src=\fId\fB actions=controller\fR
2384.br
2385.RE
2386.IP
2387Similarly, these flows send packets with IP destination address
2388\fIe\fR, \fIf\fR, \fIg\fR, or \fIh\fR to the OpenFlow controller:
2389.RS +1in
2390.br
2391\fBip,ip_dst=\fIe\fB actions=controller\fR
2392.br
2393\fBip,ip_dst=\fIf\fB actions=controller\fR
2394.br
2395\fBip,ip_dst=\fIg\fB actions=controller\fR
2396.br
2397\fBip,ip_dst=\fIh\fB actions=controller\fR
2398.br
2399.RE
2400.IP
2401Installing all of the above flows in a single flow table yields a
2402disjunctive effect: a packet is sent to the controller if \fBip_src\fR
2403\[mo] {\fIa\fR,\fIb\fR,\fIc\fR,\fId\fR} or \fBip_dst\fR \[mo]
2404{\fIe\fR,\fIf\fR,\fIg\fR,\fIh\fR} (or both). (Pedantically, if both
2405of the above sets of flows are present in the flow table, they should
2406have different priorities, because OpenFlow says that the results are
2407undefined when two flows with same priority can both match a single
2408packet.)
2409.IP
2410Suppose, on the other hand, one wishes to match conjunctively, that
2411is, to send a packet to the controller only if both \fBip_src\fR \[mo]
2412{\fIa\fR,\fIb\fR,\fIc\fR,\fId\fR} and \fBip_dst\fR \[mo]
2413{\fIe\fR,\fIf\fR,\fIg\fR,\fIh\fR}. This requires 4 \[mu] 4 = 16
2414flows, one for each possible pairing of \fBip_src\fR and \fBip_dst\fR.
2415That is acceptable for our small example, but it does not gracefully
2416extend to larger sets or greater numbers of dimensions.
2417.IP
2418The \fBconjunction\fR action is a solution for conjunctive matches
2419that is built into Open vSwitch. A \fBconjunction\fR action ties
2420groups of individual OpenFlow flows into higher-level ``conjunctive
2421flows''. Each group corresponds to one dimension, and each flow
2422within the group matches one possible value for the dimension. A
2423packet that matches one flow from each group matches the conjunctive
2424flow.
2425.IP
2426To implement a conjunctive flow with \fBconjunction\fR, assign the
2427conjunctive flow a 32-bit \fIid\fR, which must be unique within an
2428OpenFlow table. Assign each of the \fIn\fR \[>=] 2 dimensions a
2429unique number from 1 to \fIn\fR; the ordering is unimportant. Add one
2430flow to the OpenFlow flow table for each possible value of each
2431dimension with \fBconjunction(\fIid, \fIk\fB/\fIn\fB)\fR as the flow's
2432actions, where \fIk\fR is the number assigned to the flow's dimension.
2433Together, these flows specify the conjunctive flow's match condition.
2434When the conjunctive match condition is met, Open vSwitch looks up one
2435more flow that specifies the conjunctive flow's actions and receives
2436its statistics. This flow is found by setting \fBconj_id\fR to the
2437specified \fIid\fR and then again searching the flow table.
2438.IP
2439The following flows provide an example. Whenever the IP source is one
2440of the values in the flows that match on the IP source (dimension 1 of
24412), \fIand\fR the IP destination is one of the values in the flows
2442that match on IP destination (dimension 2 of 2), Open vSwitch searches
2443for a flow that matches \fBconj_id\fR against the conjunction ID
2444(1234), finding the first flow listed below.
2445.RS +1in
2446.br
2447.B "conj_id=1234 actions=controller"
2448.br
2449.B "ip,ip_src=10.0.0.1 actions=conjunction(1234, 1/2)"
2450.br
2451.B "ip,ip_src=10.0.0.4 actions=conjunction(1234, 1/2)"
2452.br
2453.B "ip,ip_src=10.0.0.6 actions=conjunction(1234, 1/2)"
2454.br
2455.B "ip,ip_src=10.0.0.7 actions=conjunction(1234, 1/2)"
2456.br
2457.B "ip,ip_dst=10.0.0.2 actions=conjunction(1234, 2/2)"
2458.br
2459.B "ip,ip_dst=10.0.0.5 actions=conjunction(1234, 2/2)"
2460.br
2461.B "ip,ip_dst=10.0.0.7 actions=conjunction(1234, 2/2)"
2462.br
2463.B "ip,ip_dst=10.0.0.8 actions=conjunction(1234, 2/2)"
2464.RE
2465.IP
2466Many subtleties exist:
2467.RS
2468.IP \(bu
2469In the example above, every flow in a single dimension has the same
2470form, that is, dimension 1 matches on \fBip_src\fR, dimension 2 on
2471\fBip_dst\fR, but this is not a requirement. Different flows within a
2472dimension may match on different bits within a field (e.g. IP network
2473prefixes of different lengths, or TCP/UDP port ranges as bitwise
2474matches), or even on entirely different fields (e.g. to match packets
2475for TCP source port 80 or TCP destination port 80).
2476.IP \(bu
2477The flows within a dimension can vary their matches across more than
2478one field, e.g. to match only specific pairs of IP source and
2479destination addresses or L4 port numbers.
2480.IP \(bu
2481A flow may have multiple \fBconjunction\fR actions, with different
2482\fIid\fR values. This is useful for multiple conjunctive flows with
2483overlapping sets. If one conjunctive flow matches packets with both
2484\fBip_src\fR \[mo] {\fIa\fR,\fIb\fR} and \fBip_dst\fR \[mo]
2485{\fId\fR,\fIe\fR} and a second conjunctive flow matches \fBip_src\fR
2486\[mo] {\fIb\fR,\fIc\fR} and \fBip_dst\fR \[mo] {\fIf\fR,\fIg\fR}, for
2487example, then the flow that matches \fBip_src=\fIb\fR would have two
2488\fBconjunction\fR actions, one for each conjunctive flow. The order
2489of \fBconjunction\fR actions within a list of actions is not
2490significant.
2491.IP \(bu
f08e39dd
BP
2492A flow with \fBconjunction\fR actions may also include \fBnote\fR
2493actions for annotations, but not any other kind of actions. (They
2494would not be useful because they would never be executed.)
18080541
BP
2495.IP \(bu
2496All of the flows that constitute a conjunctive flow with a given
2497\fIid\fR must have the same priority. (Flows with the same \fIid\fR
2498but different priorities are currently treated as different
2499conjunctive flows, that is, currently \fIid\fR values need only be
2500unique within an OpenFlow table at a given priority. This behavior
2501isn't guaranteed to stay the same in later releases, so please use
2502\fIid\fR values unique within an OpenFlow table.)
2503.IP \(bu
2504Conjunctive flows must not overlap with each other, at a given
2505priority, that is, any given packet must be able to match at most one
2506conjunctive flow at a given priority. Overlapping conjunctive flows
2507yield unpredictable results.
2508.IP \(bu
2509Following a conjunctive flow match, the search for the flow with
2510\fBconj_id=\fIid\fR is done in the same general-purpose way as other flow
2511table searches, so one can use flows with \fBconj_id=\fIid\fR to act
2512differently depending on circumstances. (One exception is that the
2513search for the \fBconj_id=\fIid\fR flow itself ignores conjunctive flows,
2514to avoid recursion.) If the search with \fBconj_id=\fIid\fR fails, Open
2515vSwitch acts as if the conjunctive flow had not matched at all, and
2516continues searching the flow table for other matching flows.
2517.IP \(bu
2518OpenFlow prerequisite checking occurs for the flow with
2519\fBconj_id=\fIid\fR in the same way as any other flow, e.g. in an
2520OpenFlow 1.1+ context, putting a \fBmod_nw_src\fR action into the
2521example above would require adding an \fBip\fR match, like this:
2522.RS +1in
2523.br
2524.B "conj_id=1234,ip actions=mod_nw_src:1.2.3.4,controller"
2525.br
2526.RE
2527.IP \(bu
2528OpenFlow prerequisite checking also occurs for the individual flows
2529that comprise a conjunctive match in the same way as any other flow.
2530.IP \(bu
2531The flows that constitute a conjunctive flow do not have useful
2532statistics. They are never updated with byte or packet counts, and so
2533on. (For such a flow, therefore, the idle and hard timeouts work much
2534the same way.)
2535.IP \(bu
2536Conjunctive flows can be a useful building block for negation, that
2537is, inequality matches like \fBtcp_src\fR \[!=] 80. To implement an
2538inequality match, convert it to a pair of range matches, e.g. 0 \[<=]
578b73e8 2539\fBtcp_src\fR < 80 and 80 < \fBtcp_src\fR \[<=] 65535, then convert each
18080541
BP
2540of the range matches into a collection of bitwise matches as explained
2541above in the description of \fBtcp_src\fR.
2542.IP \(bu
2543Sometimes there is a choice of which flows include a particular match.
2544For example, suppose that we added an extra constraint to our example,
2545to match on \fBip_src\fR \[mo] {\fIa\fR,\fIb\fR,\fIc\fR,\fId\fR} and
2546\fBip_dst\fR \[mo] {\fIe\fR,\fIf\fR,\fIg\fR,\fIh\fR} and \fBtcp_dst\fR
2547= \fIi\fR. One way to implement this is to add the new constraint to
2548the \fBconj_id\fR flow, like this:
2549.RS +1in
2550.br
2551\fBconj_id=1234,tcp,tcp_dst=\fIi\fB actions=mod_nw_src:1.2.3.4,controller\fR
2552.br
2553.RE
2554.IP
2555\fIbut this is not recommended\fR because of the cost of the extra
2556flow table lookup. Instead, add the constraint to the individual
2557flows, either in one of the dimensions or (slightly better) all of
2558them.
2559.IP \(bu
2560A conjunctive match must have \fIn\fR \[>=] 2 dimensions (otherwise a
2561conjunctive match is not necessary). Open vSwitch enforces this.
2562.IP \(bu
2563Each dimension within a conjunctive match should ordinarily have more
2564than one flow. Open vSwitch does not enforce this.
2565.RE
2566.IP
2567The \fBconjunction\fR action and \fBconj_id\fR field were introduced
2568in Open vSwitch 2.4.
24362cd6 2569.RE
848e8809 2570.
064af421 2571.PP
e729e793
JP
2572An opaque identifier called a cookie can be used as a handle to identify
2573a set of flows:
2574.
623e1caf
JP
2575.IP \fBcookie=\fIvalue\fR
2576.
2577A cookie can be associated with a flow using the \fBadd\-flow\fR,
2578\fBadd\-flows\fR, and \fBmod\-flows\fR commands. \fIvalue\fR can be any
257964-bit number and need not be unique among flows. If this field is
2580omitted, a default cookie value of 0 is used.
2581.
2582.IP \fBcookie=\fIvalue\fR\fB/\fImask\fR
e729e793 2583.
e729e793 2584When using NXM, the cookie can be used as a handle for querying,
623e1caf
JP
2585modifying, and deleting flows. \fIvalue\fR and \fImask\fR may be
2586supplied for the \fBdel\-flows\fR, \fBmod\-flows\fR, \fBdump\-flows\fR, and
2587\fBdump\-aggregate\fR commands to limit matching cookies. A 1-bit in
2588\fImask\fR indicates that the corresponding bit in \fIcookie\fR must
2589match exactly, and a 0-bit wildcards that bit. A mask of \-1 may be used
2590to exactly match a cookie.
2591.IP
2592The \fBmod\-flows\fR command can update the cookies of flows that
2593match a cookie by specifying the \fIcookie\fR field twice (once with a
2594mask for matching and once without to indicate the new value):
2595.RS
2596.IP "\fBovs\-ofctl mod\-flows br0 cookie=1,actions=normal\fR"
2597Change all flows' cookies to 1 and change their actions to \fBnormal\fR.
2598.IP "\fBovs\-ofctl mod\-flows br0 cookie=1/\-1,cookie=2,actions=normal\fR"
2599Update cookies with a value of 1 to 2 and change their actions to
2600\fBnormal\fR.
2601.RE
2602.IP
2603The ability to match on cookies was added in Open vSwitch 1.5.0.
8cce2125
JP
2604.
2605.PP
4b6b46ce
BP
2606The following additional field sets the priority for flows added by
2607the \fBadd\-flow\fR and \fBadd\-flows\fR commands. For
2608\fBmod\-flows\fR and \fBdel\-flows\fR when \fB\-\-strict\fR is
2609specified, priority must match along with the rest of the flow
623e1caf 2610specification. For \fBmod-flows\fR without \fB\-\-strict\fR,
fdb3539e
BP
2611priority is only significant if the command creates a new flow, that
2612is, non-strict \fBmod\-flows\fR does not match on priority and will
2613not change the priority of existing flows. Other commands do not
2614allow priority to be specified.
a9b4a41a 2615.
064af421
BP
2616.IP \fBpriority=\fIvalue\fR
2617The priority at which a wildcarded entry will match in comparison to
2618others. \fIvalue\fR is a number between 0 and 65535, inclusive. A higher
2619\fIvalue\fR will match before a lower one. An exact-match entry will always
2620have priority over an entry containing wildcards, so it has an implicit
2621priority value of 65535. When adding a flow, if the field is not specified,
2622the flow's priority will default to 32768.
4530afba
BP
2623.IP
2624OpenFlow leaves behavior undefined when two or more flows with the
2625same priority can match a single packet. Some users expect
2626``sensible'' behavior, such as more specific flows taking precedence
2627over less specific flows, but OpenFlow does not specify this and Open
2628vSwitch does not implement it. Users should therefore take care to
2629use priorities to ensure the behavior that they expect.
a9b4a41a 2630.
064af421 2631.PP
fdb3539e
BP
2632The \fBadd\-flow\fR, \fBadd\-flows\fR, and \fBmod\-flows\fR commands
2633support the following additional options. These options affect only
2634new flows. Thus, for \fBadd\-flow\fR and \fBadd\-flows\fR, these
2635options are always significant, but for \fBmod\-flows\fR they are
2636significant only if the command creates a new flow, that is, their
a993007b 2637values do not update or affect existing flows.
a9b4a41a 2638.
fdb3539e 2639.IP "\fBidle_timeout=\fIseconds\fR"
064af421 2640Causes the flow to expire after the given number of seconds of
fdb3539e
BP
2641inactivity. A value of 0 (the default) prevents a flow from expiring
2642due to inactivity.
a9b4a41a 2643.
064af421
BP
2644.IP \fBhard_timeout=\fIseconds\fR
2645Causes the flow to expire after the given number of seconds,
2646regardless of activity. A value of 0 (the default) gives the flow no
2647hard expiration deadline.
a9b4a41a 2648.
ca26eb44
RB
2649.IP "\fBimportance=\fIvalue\fR"
2650Sets the importance of a flow. The flow entry eviction mechanism can
2651use importance as a factor in deciding which flow to evict. A value
2652of 0 (the default) makes the flow non-evictable on the basis of
2653importance. Specify a value between 0 and 65535.
2654.IP
2655Only OpenFlow 1.4 and later support \fBimportance\fR.
2656.
a993007b
BP
2657.IP "\fBsend_flow_rem\fR"
2658Marks the flow with a flag that causes the switch to generate a ``flow
2659removed'' message and send it to interested controllers when the flow
2660later expires or is removed.
2661.
2662.IP "\fBcheck_overlap\fR"
2663Forces the switch to check that the flow match does not overlap that
2664of any different flow with the same priority in the same table. (This
2665check is expensive so it is best to avoid it.)
2666.
064af421 2667.PP
4e312e69 2668The \fBdump\-flows\fR, \fBdump\-aggregate\fR, \fBdel\-flow\fR
6d5d1f3b 2669and \fBdel\-flows\fR commands support these additional optional fields:
a9b4a41a 2670.
064af421
BP
2671.TP
2672\fBout_port=\fIport\fR
c6100d92 2673If set, a matching flow must include an output action to \fIport\fR,
60a0b9e5 2674which must be an OpenFlow port number or name (e.g. \fBlocal\fR).
a9b4a41a 2675.
6d5d1f3b
BP
2676.TP
2677\fBout_group=\fIport\fR
2678If set, a matching flow must include an \fBgroup\fR action naming
2679\fIgroup\fR, which must be an OpenFlow group number. This field
2680is supported in Open vSwitch 2.5 and later and requires OpenFlow 1.1
2681or later.
2682.
064af421 2683.SS "Table Entry Output"
a9b4a41a 2684.
4e312e69 2685The \fBdump\-tables\fR and \fBdump\-aggregate\fR commands print information
064af421 2686about the entries in a datapath's tables. Each line of output is a
f27f2134
BP
2687flow entry as described in \fBFlow Syntax\fR, above, plus some
2688additional fields:
a9b4a41a 2689.
f27f2134
BP
2690.IP \fBduration=\fIsecs\fR
2691The time, in seconds, that the entry has been in the table.
2692\fIsecs\fR includes as much precision as the switch provides, possibly
2693to nanosecond resolution.
a9b4a41a 2694.
064af421
BP
2695.IP \fBn_packets\fR
2696The number of packets that have matched the entry.
a9b4a41a 2697.
064af421
BP
2698.IP \fBn_bytes\fR
2699The total number of bytes from packets that have matched the entry.
a9b4a41a 2700.
064af421 2701.PP
f27f2134
BP
2702The following additional fields are included only if the switch is
2703Open vSwitch 1.6 or later and the NXM flow format is used to dump the
2704flow (see the description of the \fB\-\-flow-format\fR option below).
2705The values of these additional fields are approximations only and in
2706particular \fBidle_age\fR will sometimes become nonzero even for busy
2707flows.
2708.
2709.IP \fBhard_age=\fIsecs\fR
2710The integer number of seconds since the flow was added or modified.
2711\fBhard_age\fR is displayed only if it differs from the integer part
2712of \fBduration\fR. (This is separate from \fBduration\fR because
2713\fBmod\-flows\fR restarts the \fBhard_timeout\fR timer without zeroing
2714\fBduration\fR.)
2715.
2716.IP \fBidle_age=\fIsecs\fR
2717The integer number of seconds that have passed without any packets
2718passing through the flow.
a9b4a41a 2719.
7395c052
NZ
2720.SS "Group Syntax"
2721.PP
2722Some \fBovs\-ofctl\fR commands accept an argument that describes a group or
2723groups. Such flow descriptions comprise a series
2724\fIfield\fB=\fIvalue\fR assignments, separated by commas or white
2725space. (Embedding spaces into a group description normally requires
2726quoting to prevent the shell from breaking the description into
2727multiple arguments.). Unless noted otherwise only the last instance
2728of each field is honoured.
2729.PP
2730.IP \fBgroup_id=\fIid\fR
2731The integer group id of group.
19187a71 2732When this field is specified in \fBdel\-groups\fR or \fBdump\-groups\fR,
7395c052
NZ
2733the keyword "all" may be used to designate all groups.
2734.
2735This field is required.
2736
2737
2738.IP \fBtype=\fItype\fR
bdbb8426 2739The type of the group. The \fBadd-group\fR, \fBadd-groups\fR and
ed1d5ef3 2740\fBmod-groups\fR commands require this field. It is prohibited for
bdbb8426 2741other commands. The following keywords designated the allowed types:
7395c052
NZ
2742.RS
2743.IP \fBall\fR
2744Execute all buckets in the group.
2745.IP \fBselect\fR
2746Execute one bucket in the group.
2747The switch should select the bucket in such a way that should implement
2748equal load sharing is achieved. The switch may optionally select the
2749bucket based on bucket weights.
2750.IP \fBindirect\fR
2751Executes the one bucket in the group.
2752.IP \fBff\fR
2753.IQ \fBfast_failover\fR
2754Executes the first live bucket in the group which is associated with
2755a live port or group.
2756.RE
2757
bdbb8426
SH
2758.IP \fBcommand_bucket_id=\fIid\fR
2759The bucket to operate on. The \fBinsert-buckets\fR and \fBremove-buckets\fR
2760commands require this field. It is prohibited for other commands.
2761\fIid\fR may be an integer or one of the following keywords:
2762.RS
2763.IP \fBall\fR
2764Operate on all buckets in the group.
2765Only valid when used with the \fBremove-buckets\fR command in which
2766case the effect is to remove all buckets from the group.
2767.IP \fBfirst\fR
2768Operate on the first bucket present in the group.
2769In the case of the \fBinsert-buckets\fR command the effect is to
2770insert new bucets just before the first bucket already present in the group;
2771or to replace the buckets of the group if there are no buckets already present
2772in the group.
2773In the case of the \fBremove-buckets\fR command the effect is to
2774remove the first bucket of the group; or do nothing if there are no
2775buckets present in the group.
2776.IP \fBlast\fR
2777Operate on the last bucket present in the group.
2778In the case of the \fBinsert-buckets\fR command the effect is to
2779insert new bucets just after the last bucket already present in the group;
2780or to replace the buckets of the group if there are no buckets already present
2781in the group.
2782In the case of the \fBremove-buckets\fR command the effect is to
2783remove the last bucket of the group; or do nothing if there are no
2784buckets present in the group.
2785.RE
2786.IP
2787If \fIid\fR is an integer then it should correspond to the \fBbucket_id\fR
2788of a bucket present in the group.
2789In case of the \fBinsert-buckets\fR command the effect is to
2790insert buckets just before the bucket in the group whose \fBbucket_id\fR is
2791\fIid\fR.
2792In case of the \fBiremove-buckets\fR command the effect is to
2793remove the in the group whose \fBbucket_id\fR is \fIid\fR.
2794It is an error if there is no bucket persent group in whose \fBbucket_id\fR is
2795\fIid\fR.
2796
b879391e
SH
2797.IP \fBselection_method\fR=\fImethod\fR
2798The selection method used to select a bucket for a select group.
2799This is a string of 1 to 15 bytes in length known to lower layers.
2800This field is optional for \fBadd\-group\fR, \fBadd\-groups\fR and
2801\fBmod\-group\fR commands on groups of type \fBselect\fR. Prohibited
2802otherwise. The default value is the empty string.
2803.IP
68dfc25b
BP
2804Other than the empty string, \fBhash\fR is currently the only defined
2805selection method.
2806.IP
b879391e
SH
2807This option will use a Netronome OpenFlow extension which is only supported
2808when using Open vSwitch 2.4 and later with OpenFlow 1.5 and later.
2809
2810.IP \fBselection_method_param\fR=\fIparam\fR
281164-bit integer parameter to the selection method selected by the
2812\fBselection_method\fR field. The parameter's use is defined by the
2813lower-layer that implements the \fBselection_method\fR. It is optional if
2814the \fBselection_method\fR field is specified as a non-empty string.
2815Prohibited otherwise. The default value is zero.
2816.IP
2817This option will use a Netronome OpenFlow extension which is only supported
2818when using Open vSwitch 2.4 and later with OpenFlow 1.5 and later.
2819
68dfc25b
BP
2820.IP \fBfields\fR=\fIfield\fR
2821.IQ \fBfields(\fIfield\fR[\fB=\fImask\fR]\fR...\fB)\fR
b879391e
SH
2822The field parameters to selection method selected by the
2823\fBselection_method\fR field. The syntax is described in \fBFlow Syntax\fR
2824with the additional restrictions that if a value is provided it is
2825treated as a wildcard mask and wildcard masks following a slash are
2826prohibited. The pre-requisites of fields must be provided by any flows that
2827output to the group. The use of the fields is defined by the lower-layer
2828that implements the \fBselection_method\fR. They are optional if the
2829\fBselection_method\fR field is specified as a non-empty string.
2830Prohibited otherwise. The default is no fields.
2831.IP
2832This option will use a Netronome OpenFlow extension which is only supported
2833when using Open vSwitch 2.4 and later with OpenFlow 1.5 and later.
2834
7395c052
NZ
2835.IP \fBbucket\fR=\fIbucket_parameters\fR
2836The \fBadd-group\fR, \fBadd-groups\fR and \fBmod-group\fR commands
2837require at least one bucket field. Bucket fields must appear after
2838all other fields.
2839.
2840Multiple bucket fields to specify multiple buckets.
2841The order in which buckets are specified corresponds to their order in
2842the group. If the type of the group is "indirect" then only one group may
2843be specified.
2844.
2845\fIbucket_parameters\fR consists of a list of \fIfield\fB=\fIvalue\fR
2846assignments, separated by commas or white space followed by a
2847comma-separated list of actions.
7395c052
NZ
2848The fields for \fIbucket_parameters\fR are:
2849.
2850.RS
2d5d050c
SH
2851.IP \fBbucket_id=\fIid\fR
2852The 32-bit integer group id of the bucket. Values greater than
28530xffffff00 are reserved.
2854.
2855This field was added in Open vSwitch 2.4 to conform with the OpenFlow
d3cb080e 28561.5 specification. It is not supported when earlier versions
2d5d050c
SH
2857of OpenFlow are used. Open vSwitch will automatically allocate bucket
2858ids when they are not specified.
f1457c26
TG
2859.IP \fBactions=\fR[\fIaction\fR][\fB,\fIaction\fR...]\fR
2860The syntax of actions are identical to the \fBactions=\fR field described in
2861\fBFlow Syntax\fR above. Specyfing \fBactions=\fR is optional, any unknown
2862bucket parameter will be interpreted as an action.
7395c052
NZ
2863.IP \fBweight=\fIvalue\fR
2864The relative weight of the bucket as an integer. This may be used by the switch
2865during bucket select for groups whose \fBtype\fR is \fBselect\fR.
2866.IP \fBwatch_port=\fIport\fR
2867Port used to determine liveness of group.
2868This or the \fBwatch_group\fR field is required
2869for groups whose \fBtype\fR is \fBff\fR or \fBfast_failover\fR.
2870.IP \fBwatch_group=\fIgroup_id\fR
2871Group identifier of group used to determine liveness of group.
2872This or the \fBwatch_port\fR field is required
2873for groups whose \fBtype\fR is \fBff\fR or \fBfast_failover\fR.
2874.RE
2875.
3200ed58
JR
2876.SS "Meter Syntax"
2877.PP
2878The meter table commands accept an argument that describes a meter.
2879Such meter descriptions comprise a series \fIfield\fB=\fIvalue\fR
2880assignments, separated by commas or white space.
2881(Embedding spaces into a group description normally requires
2882quoting to prevent the shell from breaking the description into
2883multiple arguments.). Unless noted otherwise only the last instance
2884of each field is honoured.
2885.PP
2886.IP \fBmeter=\fIid\fR
2887The integer meter id of the meter.
2888When this field is specified in \fBdel-meter\fR, \fBdump-meter\fR, or
2889\fBmeter-stats\fR, the keyword "all" may be used to designate all meters.
2890.
2891This field is required, exept for \fBmeter-stats\fR, which dumps all stats
2892when this field is not specified.
2893
2894.IP \fBkbps\fR
2895.IQ \fBpktps\fR
2896The unit for the meter band rate parameters, either kilobits per second, or
2897packets per second, respectively. One of these must be specified. The burst
2898size unit corresponds to the rate unit by dropping the "per second", i.e.,
2899burst is in units of kilobits or packets, respectively.
2900
2901.IP \fBburst\fR
2902Specify burst size for all bands, or none of them, if this flag is not given.
2903
2904.IP \fBstats\fR
2905Collect meter and band statistics.
2906
2907.IP \fBbands\fR=\fIband_parameters\fR
2908The \fBadd-meter\fR and \fBmod-meter\fR commands require at least one
2909band specification. Bands must appear after all other fields.
2910.RS
2911.IP \fBtype=\fItype\fR
2912The type of the meter band. This keyword starts a new band specification.
2913Each band specifies a rate above which the band is to take some action. The
2914action depends on the band type. If multiple bands' rate is exceeded, then
2915the band with the highest rate among the exceeded bands is selected.
2916The following keywords designate the allowed
2917meter band types:
2918.RS
2919.IP \fBdrop\fR
2920Drop packets exceeding the band's rate limit.
2921.RE
2922.
2923.IP "The other \fIband_parameters\fR are:"
2924.IP \fBrate=\fIvalue\fR
2925The relative rate limit for this band, in kilobits per second or packets per
2926second, depending on the meter flags defined above.
96660ed1
BP
2927.IP \fBburst_size=\fIsize\fR
2928The maximum burst allowed for the band. If \fBpktps\fR is specified,
2929then \fIsize\fR is a packet count, otherwise it is in kilobits. If
2930unspecified, the switch is free to select some reasonable value
2931depending on its configuration.
3200ed58
JR
2932.RE
2933.
064af421
BP
2934.SH OPTIONS
2935.TP
4e312e69 2936\fB\-\-strict\fR
064af421 2937Uses strict matching when running flow modification commands.
a9b4a41a 2938.
db5076ee 2939.IP "\fB\-\-bundle\fR"
39c94593 2940Execute flow mods as an OpenFlow 1.4 atomic bundle transaction.
db5076ee
JR
2941.RS
2942.IP \(bu
2943Within a bundle, all flow mods are processed in the order they appear
39c94593
JR
2944and as a single atomic transaction, meaning that if one of them fails,
2945the whole transaction fails and none of the changes are made to the
2946\fIswitch\fR's flow table, and that each given datapath packet
2947traversing the OpenFlow tables sees the flow tables either as before
2948the transaction, or after all the flow mods in the bundle have been
2949successfully applied.
db5076ee
JR
2950.IP \(bu
2951The beginning and the end of the flow table modification commands in a
2952bundle are delimited with OpenFlow 1.4 bundle control messages, which
2953makes it possible to stream the included commands without explicit
2954OpenFlow barriers, which are otherwise used after each flow table
2955modification command. This may make large modifications execute
2956faster as a bundle.
2957.IP \(bu
2958Bundles require OpenFlow 1.4 or higher. An explicit \fB-O
2959OpenFlow14\fR option is not needed, but you may need to enable
2960OpenFlow 1.4 support for OVS by setting the OVSDB \fIprotocols\fR
2961column in the \fIbridge\fR table.
db5076ee
JR
2962.RE
2963.
a53a8efa
SH
2964.so lib/ofp-version.man
2965.
27527aa0
BP
2966.IP "\fB\-F \fIformat\fR[\fB,\fIformat\fR...]"
2967.IQ "\fB\-\-flow\-format=\fIformat\fR[\fB,\fIformat\fR...]"
2968\fBovs\-ofctl\fR supports the following individual flow formats, any
2969number of which may be listed as \fIformat\fR:
88ca35ee 2970.RS
27527aa0
BP
2971.IP "\fBOpenFlow10\-table_id\fR"
2972This is the standard OpenFlow 1.0 flow format. All OpenFlow switches
2973and all versions of Open vSwitch support this flow format.
88ca35ee 2974.
27527aa0
BP
2975.IP "\fBOpenFlow10+table_id\fR"
2976This is the standard OpenFlow 1.0 flow format plus a Nicira extension
2977that allows \fBovs\-ofctl\fR to specify the flow table in which a
2978particular flow should be placed. Open vSwitch 1.2 and later supports
2979this flow format.
2980.
2981.IP "\fBNXM\-table_id\fR (Nicira Extended Match)"
88ca35ee
BP
2982This Nicira extension to OpenFlow is flexible and extensible. It
2983supports all of the Nicira flow extensions, such as \fBtun_id\fR and
27527aa0
BP
2984registers. Open vSwitch 1.1 and later supports this flow format.
2985.
2986.IP "\fBNXM+table_id\fR (Nicira Extended Match)"
2987This combines Nicira Extended match with the ability to place a flow
2988in a specific table. Open vSwitch 1.2 and later supports this flow
2989format.
e71bff1b
BP
2990.
2991.IP "\fBOXM-OpenFlow12\fR"
2992.IQ "\fBOXM-OpenFlow13\fR"
aa233d57 2993.IQ "\fBOXM-OpenFlow14\fR"
e71bff1b 2994These are the standard OXM (OpenFlow Extensible Match) flow format in
aa233d57 2995OpenFlow 1.2, 1.3, and 1.4, respectively.
88ca35ee 2996.RE
27527aa0 2997.
88ca35ee 2998.IP
27527aa0
BP
2999\fBovs\-ofctl\fR also supports the following abbreviations for
3000collections of flow formats:
3001.RS
3002.IP "\fBany\fR"
aa233d57 3003Any supported flow format.
27527aa0
BP
3004.IP "\fBOpenFlow10\fR"
3005\fBOpenFlow10\-table_id\fR or \fBOpenFlow10+table_id\fR.
3006.IP "\fBNXM\fR"
3007\fBNXM\-table_id\fR or \fBNXM+table_id\fR.
e71bff1b 3008.IP "\fBOXM\fR"
aa233d57 3009\fBOXM-OpenFlow12\fR, \fBOXM-OpenFlow13\fR, or \fBOXM-OpenFlow14\fR.
27527aa0 3010.RE
4f564f8d 3011.
27527aa0
BP
3012.IP
3013For commands that modify the flow table, \fBovs\-ofctl\fR by default
3014negotiates the most widely supported flow format that supports the
3015flows being added. For commands that query the flow table,
3016\fBovs\-ofctl\fR by default uses the most advanced format supported by
3017the switch.
3018.IP
3019This option, where \fIformat\fR is a comma-separated list of one or
3020more of the formats listed above, limits \fBovs\-ofctl\fR's choice of
3021flow format. If a command cannot work as requested using one of the
3022specified flow formats, \fBovs\-ofctl\fR will report a fatal error.
54834960
EJ
3023.
3024.IP "\fB\-P \fIformat\fR"
3025.IQ "\fB\-\-packet\-in\-format=\fIformat\fR"
6409e008 3026\fBovs\-ofctl\fR supports the following ``packet-in'' formats, in order of
54834960
EJ
3027increasing capability:
3028.RS
6409e008
BP
3029.IP "\fBstandard\fR"
3030This uses the \fBOFPT_PACKET_IN\fR message, the standard ``packet-in''
3031message for any given OpenFlow version. Every OpenFlow switch that
3032supports a given OpenFlow version supports this format.
3033.
3034.IP "\fBnxt_packet_in\fR"
3035This uses the \fBNXT_PACKET_IN\fR message, which adds many of the
3036capabilities of the OpenFlow 1.1 and later ``packet-in'' messages
3037before those OpenFlow versions were available in Open vSwitch. Open
3038vSwitch 1.1 and later support this format. Only Open vSwitch 2.6 and
3039later, however, support it for OpenFlow 1.1 and later (but there is
3040little reason to use it with those versions of OpenFlow).
3041.
3042.IP "\fBnxt_packet_in2\fR"
3043This uses the \fBNXT_PACKET_IN2\fR message, which is extensible and
bdcad671
BP
3044should avoid the need to define new formats later. In particular,
3045this format supports passing arbitrary user-provided data to a
3046controller using the \fBuserdata\fB option on the \fBcontroller\fR
3047action. Open vSwitch 2.6 and later support this format.
54834960
EJ
3048.
3049.RE
3050.IP
6409e008
BP
3051Without this option, \fBovs\-ofctl\fR prefers \fBnxt_packet_in2\fR if
3052the switch supports it. Otherwise, if OpenFlow 1.0 is in use,
3053\fBovs\-ofctl\fR prefers \fBnxt_packet_in\fR if the switch supports
3054it. Otherwise, \fBovs\-ofctl\fR falls back to the \fBstandard\fR
3055packet-in format. When this option is specified, \fBovs\-ofctl\fR
3056insists on the selected format. If the switch does not support the
3057requested format, \fBovs\-ofctl\fR will report a fatal error.
3058.IP
3059Before version 2.6, Open vSwitch called \fBstandard\fR format
3060\fBopenflow10\fR and \fBnxt_packet_in\fR format \fBnxm\fR, and
3061\fBovs\-ofctl\fR still accepts these names as synonyms. (The name
3062\fBopenflow10\fR was a misnomer because this format actually varies
3063from one OpenFlow version to another; it is not consistently OpenFlow
30641.0 format. Similarly, when \fBnxt_packet_in2\fR was introduced, the
3065name \fBnxm\fR became confusing because it also uses OXM/NXM.)
3066.
3067.IP
3068This option affects only the \fBmonitor\fR command.
54834960 3069.
0c9560b7
BP
3070.IP "\fB\-\-timestamp\fR"
3071Print a timestamp before each received packet. This option only
f3dd1419
BP
3072affects the \fBmonitor\fR, \fBsnoop\fR, and \fBofp\-parse\-pcap\fR
3073commands.
0c9560b7 3074.
4f564f8d
BP
3075.IP "\fB\-m\fR"
3076.IQ "\fB\-\-more\fR"
3077Increases the verbosity of OpenFlow messages printed and logged by
3078\fBovs\-ofctl\fR commands. Specify this option more than once to
3079increase verbosity further.
1eb85ef5 3080.
bdcc5925
BP
3081.IP \fB\-\-sort\fR[\fB=\fIfield\fR]
3082.IQ \fB\-\-rsort\fR[\fB=\fIfield\fR]
3083Display output sorted by flow \fIfield\fR in ascending
3084(\fB\-\-sort\fR) or descending (\fB\-\-rsort\fR) order, where
3085\fIfield\fR is any of the fields that are allowed for matching or
3086\fBpriority\fR to sort by priority. When \fIfield\fR is omitted, the
3087output is sorted by priority. Specify these options multiple times to
3088sort by multiple fields.
3089.IP
3090Any given flow will not necessarily specify a value for a given
3091field. This requires special treatement:
3092.RS
3093.IP \(bu
3094A flow that does not specify any part of a field that is used for sorting is
3095sorted after all the flows that do specify the field. For example,
3096\fB\-\-sort=tcp_src\fR will sort all the flows that specify a TCP
3097source port in ascending order, followed by the flows that do not
0d56eaf2 3098specify a TCP source port at all.
bdcc5925
BP
3099.IP \(bu
3100A flow that only specifies some bits in a field is sorted as if the
3101wildcarded bits were zero. For example, \fB\-\-sort=nw_src\fR would
3102sort a flow that specifies \fBnw_src=192.168.0.0/24\fR the same as
3103\fBnw_src=192.168.0.0\fR.
3104.RE
3105.IP
3106These options currently affect only \fBdump\-flows\fR output.
3107.
1eb85ef5
EJ
3108.ds DD \
3109\fBovs\-ofctl\fR detaches only when executing the \fBmonitor\fR or \
3110\fBsnoop\fR commands.
3111.so lib/daemon.man
19945013 3112.so lib/unixctl.man
ac300505 3113.SS "Public Key Infrastructure Options"
84ee7bcf 3114.so lib/ssl.man
064af421 3115.so lib/vlog.man
e7019d99 3116.so lib/colors.man
064af421 3117.so lib/common.man
a9b4a41a 3118.
1eb85ef5 3119.SH "RUNTIME MANAGEMENT COMMANDS"
96761f58
BP
3120\fBovs\-appctl\fR(8) can send commands to a running \fBovs\-ofctl\fR
3121process. The supported commands are listed below.
3122.
1eb85ef5 3123.IP "\fBexit\fR"
96761f58
BP
3124Causes \fBovs\-ofctl\fR to gracefully terminate. This command applies
3125only when executing the \fBmonitor\fR or \fBsnoop\fR commands.
3126.
1e1d00a5
BP
3127.IP "\fBofctl/set\-output\-file \fIfile\fR"
3128Causes all subsequent output to go to \fIfile\fR instead of stderr.
3129This command applies only when executing the \fBmonitor\fR or
3130\fBsnoop\fR commands.
3131.
96761f58
BP
3132.IP "\fBofctl/send \fIofmsg\fR..."
3133Sends each \fIofmsg\fR, specified as a sequence of hex digits that
3134express an OpenFlow message, on the OpenFlow connection. This command
3135is useful only when executing the \fBmonitor\fR command.
3136.
bb638b9a
BP
3137.IP "\fBofctl/barrier\fR"
3138Sends an OpenFlow barrier request on the OpenFlow connection and waits
3139for a reply. This command is useful only for the \fBmonitor\fR
3140command.
3141.
064af421 3142.SH EXAMPLES
a9b4a41a 3143.
045b2e5c
BP
3144The following examples assume that \fBovs\-vswitchd\fR has a bridge
3145named \fBbr0\fR configured.
a9b4a41a 3146.
064af421 3147.TP
045b2e5c 3148\fBovs\-ofctl dump\-tables br0\fR
064af421
BP
3149Prints out the switch's table stats. (This is more interesting after
3150some traffic has passed through.)
a9b4a41a 3151.
064af421 3152.TP
045b2e5c 3153\fBovs\-ofctl dump\-flows br0\fR
064af421 3154Prints the flow entries in the switch.
a9b4a41a 3155.
064af421 3156.SH "SEE ALSO"
a9b4a41a 3157.
064af421 3158.BR ovs\-appctl (8),
064af421 3159.BR ovs\-vswitchd (8)
29089a54 3160.BR ovs\-vswitchd.conf.db (8)