]> git.proxmox.com Git - ovs.git/blame - utilities/ovs-ofctl.8.in
Better abstract wildcards for Ethernet destination field.
[ovs.git] / utilities / ovs-ofctl.8.in
CommitLineData
a9b4a41a
BP
1.\" -*- nroff -*-
2.de IQ
3. br
4. ns
5. IP "\\$1"
6..
71e17a7a 7.TH ovs\-ofctl 8 "January 2011" "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.
a9b4a41a 23.
064af421 24.SS "OpenFlow Switch Management Commands"
a9b4a41a 25.PP
064af421
BP
26These commands allow \fBovs\-ofctl\fR to monitor and administer an OpenFlow
27switch. It is able to show the current state of a switch, including
28features, configuration, and table entries.
a9b4a41a 29.PP
064af421
BP
30Most of these commands take an argument that specifies the method for
31connecting to an OpenFlow switch. The following connection methods
32are supported:
a9b4a41a 33.
064af421 34.RS
84ee7bcf
BP
35.so lib/vconn-active.man
36.
064af421
BP
37.IP "\fIfile\fR"
38This is short for \fBunix:\fIfile\fR, as long as \fIfile\fR does not
39contain a colon.
84ee7bcf 40.
1a6f1e2a
JG
41.IP \fIbridge\fR
42This is short for \fBunix:@RUNDIR@/\fIbridge\fB.mgmt\fR, as long as
43\fIbridge\fR does not contain a colon.
44.
45.IP [\fItype\fB@\fR]\fIdp\fR
46Attempts to look up the bridge associated with \fIdp\fR and open as
47above. If \fItype\fR is given, it specifies the datapath provider of
48\fIdp\fR, otherwise the default provider \fBsystem\fR is assumed.
064af421 49.RE
a9b4a41a 50.
064af421
BP
51.TP
52\fBshow \fIswitch\fR
53Prints to the console information on \fIswitch\fR, including
54information on its flow tables and ports.
a9b4a41a 55.
064af421 56.TP
4e312e69 57\fBdump\-tables \fIswitch\fR
064af421
BP
58Prints to the console statistics for each of the flow tables used by
59\fIswitch\fR.
a9b4a41a 60.
064af421 61.TP
4e312e69 62\fBdump\-ports \fIswitch\fR [\fInetdev\fR]
abaad8cf
JP
63Prints to the console statistics for network devices associated with
64\fIswitch\fR. If \fInetdev\fR is specified, only the statistics
65associated with that device will be printed. \fInetdev\fR can be an
66OpenFlow assigned port number or device name, e.g. \fBeth0\fR.
a9b4a41a 67.
064af421 68.TP
4e312e69 69\fBmod\-port \fIswitch\fR \fInetdev\fR \fIaction\fR
064af421
BP
70Modify characteristics of an interface monitored by \fIswitch\fR.
71\fInetdev\fR can be referred to by its OpenFlow assigned port number or
72the device name, e.g. \fBeth0\fR. The \fIaction\fR may be any one of the
73following:
a9b4a41a 74.
064af421
BP
75.RS
76.IP \fBup\fR
77Enables the interface. This is equivalent to ``ifconfig up'' on a Unix
78system.
a9b4a41a 79.
064af421
BP
80.IP \fBdown\fR
81Disables the interface. This is equivalent to ``ifconfig down'' on a Unix
82system.
a9b4a41a 83.
064af421
BP
84.IP \fBflood\fR
85When a \fIflood\fR action is specified, traffic will be sent out this
86interface. This is the default posture for monitored ports.
a9b4a41a 87.
064af421
BP
88.IP \fBnoflood\fR
89When a \fIflood\fR action is specified, traffic will not be sent out
90this interface. This is primarily useful to prevent loops when a
91spanning tree protocol is not in use.
a9b4a41a 92.
064af421 93.RE
a9b4a41a 94.
064af421 95.TP
4e312e69 96\fBdump\-flows \fIswitch \fR[\fIflows\fR]
064af421
BP
97Prints to the console all flow entries in \fIswitch\fR's
98tables that match \fIflows\fR. If \fIflows\fR is omitted, all flows
99in the switch are retrieved. See \fBFlow Syntax\fR, below, for the
100syntax of \fIflows\fR. The output format is described in
101\fBTable Entry Output\fR.
a9b4a41a 102.
064af421 103.TP
4e312e69 104\fBdump\-aggregate \fIswitch \fR[\fIflows\fR]
064af421
BP
105Prints to the console aggregate statistics for flows in
106\fIswitch\fR's tables that match \fIflows\fR. If \fIflows\fR is omitted,
107the statistics are aggregated across all flows in the switch's flow
108tables. See \fBFlow Syntax\fR, below, for the syntax of \fIflows\fR.
109The output format is descrbed in \fBTable Entry Output\fR.
a9b4a41a 110.
d2805da2
BP
111.IP "\fBqueue\-stats \fIswitch \fR[\fIport \fR[\fIqueue\fR]]"
112Prints to the console statistics for the specified \fIqueue\fR on
113\fIport\fR within \fIswitch\fR. Either of \fIport\fR or \fIqueue\fR
114or both may be omitted (or equivalently specified as \fBALL\fR). If
115both are omitted, statistics are printed for all queues on all ports.
116If only \fIqueue\fR is omitted, then statistics are printed for all
117queues on \fIport\fR; if only \fIport\fR is omitted, then statistics
118are printed for \fIqueue\fR on every port where it exists.
119.
4989c59f
BP
120.SS "OpenFlow Switch Flow Table Commands"
121.
122These commands manage the flow table in an OpenFlow switch. In each
123case, \fIflow\fR specifies a flow entry in the format described in
124\fBFlow Syntax\fR, below, and \fIfile\fR is a text file that contains
125zero or more flows in the same syntax, one per line.
126.
127.IP "\fBadd\-flow \fIswitch flow\fR"
128.IQ "\fBadd\-flow \fIswitch \fB\- < \fIfile\fR"
129.IQ "\fBadd\-flows \fIswitch file\fR"
130Add each flow entry to \fIswitch\fR's tables.
131.
132.IP "[\fB\-\-strict\fR] \fBmod\-flows \fIswitch flow\fR"
133.IQ "[\fB\-\-strict\fR] \fBmod\-flows \fIswitch \fB\- < \fIfile\fR"
134Modify the actions in entries from \fIswitch\fR's tables that match
135the specified flows. With \fB\-\-strict\fR, wildcards are not treated
136as active for matching purposes.
137.
138.IP "\fBdel\-flows \fIswitch\fR"
139.IQ "[\fB\-\-strict\fR] \fBdel\-flows \fIswitch \fR[\fIflow\fR]"
140.IQ "[\fB\-\-strict\fR] \fBdel\-flows \fIswitch \fB\- < \fIfile\fR"
141Deletes entries from \fIswitch\fR's flow table. With only a
142\fIswitch\fR argument, deletes all flows. Otherwise, deletes flow
143entries that match the specified flows. With \fB\-\-strict\fR,
144wildcards are not treated as active for matching purposes.
a9b4a41a 145.
0199c526
BP
146.IP "\fBreplace\-flows \fIswitch file\fR"
147Reads flow entries from \fIfile\fR (or \fBstdin\fR if \fIfile\fR is
148\fB\-\fR) and queries the flow table from \fIswitch\fR. Then it fixes
149up any differences, adding flows from \fIflow\fR that are missing on
150\fIswitch\fR, deleting flows from \fIswitch\fR that are not in
151\fIfile\fR, and updating flows in \fIswitch\fR whose actions, cookie,
152or timeouts differ in \fIfile\fR.
153.
154.IP "\fBdiff\-flows \fIsource1 source2\fR"
155Reads flow entries from \fIsource1\fR and \fIsource2\fR and prints the
156differences. A flow that is in \fIsource1\fR but not in \fIsource2\fR
157is printed preceded by a \fB\-\fR, and a flow that is in \fIsource2\fR
158but not in \fIsource1\fR is printed preceded by a \fB+\fR. If a flow
159exists in both \fIsource1\fR and \fIsource2\fR with different actions,
160cookie, or timeouts, then both versions are printed preceded by
161\fB\-\fR and \fB+\fR, respectively.
162.IP
163\fIsource1\fR and \fIsource2\fR may each name a file or a switch. If
164a name begins with \fB/\fR or \fB.\fR, then it is considered to be a
165file name. A name that contains \fB:\fR is considered to be a switch.
166Otherwise, it is a file if a file by that name exists, a switch if
167not.
168.IP
169For this command, an exit status of 0 means that no differences were
170found, 1 means that an error occurred, and 2 means that some
171differences were found.
172.
4989c59f
BP
173.SS "OpenFlow Switch Monitoring Commands"
174.
0caf6bde
BP
175.IP "\fBsnoop \fIswitch\fR"
176Connects to \fIswitch\fR and prints to the console all OpenFlow
177messages received. Unlike other \fBovs\-ofctl\fR commands, if
178\fIswitch\fR is the name of a bridge, then the \fBsnoop\fR command
179connects to a Unix domain socket named
180\fB@RUNDIR@/\fIbridge\fB.snoop\fR. \fBovs\-vswitchd\fR listens on
181such a socket for each bridge and sends to it all of the OpenFlow
182messages sent to or received from its configured OpenFlow controller.
183Thus, this command can be used to view OpenFlow protocol activity
184between a switch and its controller.
185.IP
186When a switch has more than one controller configured, only the
e2bfacb6
BP
187traffic to and from a single controller is output. If none of the
188controllers is configured as a master or a slave (using a Nicira
189extension to OpenFlow), then a controller is chosen arbitrarily among
190them. If there is a master controller, it is chosen; otherwise, if
191there are any controllers that are not masters or slaves, one is
192chosen arbitrarily; otherwise, a slave controller is chosen
193arbitrarily. This choice is made once at connection time and does not
194change as controllers reconfigure their roles.
195.IP
196If a switch has no controller configured, or if
0caf6bde
BP
197the configured controller is disconnected, no traffic is sent, so
198monitoring will not show any traffic.
199.
4989c59f 200.IP "\fBmonitor \fIswitch\fR [\fImiss-len\fR]"
064af421 201Connects to \fIswitch\fR and prints to the console all OpenFlow
045b2e5c
BP
202messages received. Usually, \fIswitch\fR should specify the name of a
203bridge in the \fBovs\-vswitchd\fR database.
a9b4a41a 204.IP
064af421
BP
205If \fImiss-len\fR is provided, \fBovs\-ofctl\fR sends an OpenFlow ``set
206configuration'' message at connection setup time that requests
0caf6bde
BP
207\fImiss-len\fR bytes of each packet that misses the flow table. Open vSwitch
208does not send these and other asynchronous messages to an
064af421 209\fBovs\-ofctl monitor\fR client connection unless a nonzero value is
0caf6bde
BP
210specified on this argument. (Thus, if \fImiss\-len\fR is not
211specified, very little traffic will ordinarily be printed.)
a9b4a41a 212.IP
064af421
BP
213This command may be useful for debugging switch or controller
214implementations.
a9b4a41a 215.
064af421 216.SS "OpenFlow Switch and Controller Commands"
a9b4a41a 217.
064af421
BP
218The following commands, like those in the previous section, may be
219applied to OpenFlow switches, using any of the connection methods
220described in that section. Unlike those commands, these may also be
221applied to OpenFlow controllers.
a9b4a41a 222.
064af421
BP
223.TP
224\fBprobe \fItarget\fR
225Sends a single OpenFlow echo-request message to \fItarget\fR and waits
4e312e69 226for the response. With the \fB\-t\fR or \fB\-\-timeout\fR option, this
064af421
BP
227command can test whether an OpenFlow switch or controller is up and
228running.
a9b4a41a 229.
064af421
BP
230.TP
231\fBping \fItarget \fR[\fIn\fR]
232Sends a series of 10 echo request packets to \fItarget\fR and times
233each reply. The echo request packets consist of an OpenFlow header
234plus \fIn\fR bytes (default: 64) of randomly generated payload. This
235measures the latency of individual requests.
a9b4a41a 236.
064af421
BP
237.TP
238\fBbenchmark \fItarget n count\fR
239Sends \fIcount\fR echo request packets that each consist of an
240OpenFlow header plus \fIn\fR bytes of payload and waits for each
241response. Reports the total time required. This is a measure of the
242maximum bandwidth to \fItarget\fR for round-trips of \fIn\fR-byte
243messages.
a9b4a41a 244.
064af421 245.SS "Flow Syntax"
a9b4a41a 246.PP
064af421
BP
247Some \fBovs\-ofctl\fR commands accept an argument that describes a flow or
248flows. Such flow descriptions comprise a series
249\fIfield\fB=\fIvalue\fR assignments, separated by commas or white
250space. (Embedding spaces into a flow description normally requires
251quoting to prevent the shell from breaking the description into
252multiple arguments.)
a9b4a41a 253.PP
0b3f2725
BP
254Flow descriptions should be in \fBnormal form\fR. This means that a
255flow may only specify a value for an L3 field if it also specifies a
256particular L2 protocol, and that a flow may only specify an L4 field
257if it also specifies particular L2 and L3 protocol types. For
258example, if the L2 protocol type \fBdl_type\fR is wildcarded, then L3
259fields \fBnw_src\fR, \fBnw_dst\fR, and \fBnw_proto\fR must also be
260wildcarded. Similarly, if \fBdl_type\fR or \fBnw_proto\fR (the L3
261protocol type) is wildcarded, so must be \fBtp_dst\fR and
262\fBtp_src\fR, which are L4 fields. \fBovs\-ofctl\fR will warn about
263flows not in normal form.
264.PP
064af421
BP
265The following field assignments describe how a flow matches a packet.
266If any of these assignments is omitted from the flow syntax, the field
267is treated as a wildcard; thus, if all of them are omitted, the
268resulting flow matches all packets. The string \fB*\fR or \fBANY\fR
269may be specified to explicitly mark any of these fields as a wildcard.
270(\fB*\fR should be quoted to protect it from shell expansion.)
a9b4a41a 271.
064af421
BP
272.IP \fBin_port=\fIport_no\fR
273Matches physical port \fIport_no\fR. Switch ports are numbered as
274displayed by \fBovs\-ofctl show\fR.
a9b4a41a 275.
064af421 276.IP \fBdl_vlan=\fIvlan\fR
f30f26be
JP
277Matches IEEE 802.1q Virtual LAN tag \fIvlan\fR. Specify \fB0xffff\fR
278as \fIvlan\fR to match packets that are not tagged with a Virtual LAN;
064af421
BP
279otherwise, specify a number between 0 and 4095, inclusive, as the
28012-bit VLAN ID to match.
a9b4a41a 281.
959a2ecd
JP
282.IP \fBdl_vlan_pcp=\fIpriority\fR
283Matches IEEE 802.1q Priority Code Point (PCP) \fIpriority\fR, which is
284specified as a value between 0 and 7, inclusive. A higher value
285indicates a higher frame priority level.
a9b4a41a 286.
ed951f15
BP
287.IP \fBdl_src=\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fR
288.IQ \fBdl_dst=\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fR
289Matches an Ethernet source (or destination) address specified as 6
290pairs of hexadecimal digits delimited by colons
291(e.g. \fB00:0A:E4:25:6B:B0\fR).
292.
064af421
BP
293.IP \fBdl_type=\fIethertype\fR
294Matches Ethernet protocol type \fIethertype\fR, which is specified as an
295integer between 0 and 65535, inclusive, either in decimal or as a
296hexadecimal number prefixed by \fB0x\fR (e.g. \fB0x0806\fR to match ARP
297packets).
a9b4a41a 298.
064af421 299.IP \fBnw_src=\fIip\fR[\fB/\fInetmask\fR]
ed951f15
BP
300.IQ \fBnw_dst=\fIip\fR[\fB/\fInetmask\fR]
301When \fBdl_type\fR is 0x0800 (possibly via shorthand, e.g. \fBip\fR
302or \fBtcp\fR), matches IPv4 source (or destination) address \fIip\fR,
303which may be specified as an IP address or host name
304(e.g. \fB192.168.1.1\fR or \fBwww.example.com\fR). The optional
305\fInetmask\fR allows restricting a match to an IPv4 address prefix.
306The netmask may be specified as a dotted quad
307(e.g. \fB192.168.1.0/255.255.255.0\fR) or as a CIDR block
064af421 308(e.g. \fB192.168.1.0/24\fR).
ed951f15
BP
309.IP
310When \fBdl_type=0x0806\fR or \fBarp\fR is specified, matches the
311\fBar_spa\fR or \fBar_tpa\fR field, respectively, in ARP packets for
312IPv4 and Ethernet.
313.IP
314When \fBdl_type\fR is wildcarded or set to a value other than 0x0800
0b3f2725
BP
315or 0x0806, the values of \fBnw_src\fR and \fBnw_dst\fR are ignored
316(see \fBFlow Syntax\fR above).
a9b4a41a 317.
064af421 318.IP \fBnw_proto=\fIproto\fR
ed951f15
BP
319When \fBip\fR or \fBdl_type=0x0800\fR is specified, matches IP
320protocol type \fIproto\fR, which is specified as a decimal number
d31f1109
JP
321between 0 and 255, inclusive (e.g. 1 to match ICMP packets or 6 to match
322TCP packets).
323.IP
324When \fBipv6\fR or \fBdl_type=0x86dd\fR is specified, matches IPv6
325header type \fIproto\fR, which is specified as a decimal number between
3260 and 255, inclusive (e.g. 58 to match ICMPv6 packets or 6 to match
327TCP). The header type is the terminal header as described in the
328\fBDESIGN\fR document.
ed951f15
BP
329.IP
330When \fBarp\fR or \fBdl_type=0x0806\fR is specified, matches the lower
3318 bits of the ARP opcode. ARP opcodes greater than 255 are treated as
3320.
333.IP
d31f1109
JP
334When \fBdl_type\fR is wildcarded or set to a value other than 0x0800,
3350x0806, or 0x86dd, the value of \fBnw_proto\fR is ignored (see \fBFlow
0b3f2725 336Syntax\fR above).
a9b4a41a 337.
834377ea 338.IP \fBnw_tos=\fItos\fR
d31f1109
JP
339Matches IP ToS/DSCP or IPv6 traffic class field \fItos\fR, which is
340specified as a decimal number between 0 and 255, inclusive. Note that
341the two lower reserved bits are ignored for matching purposes.
ed951f15 342.IP
d31f1109
JP
343When \fBdl_type\fR is wildcarded or set to a value other than 0x0800,
3440x0806, or 0x86dd, the value of \fBnw_tos\fR is ignored (see \fBFlow
345Syntax\fR above).
a9b4a41a 346.
064af421 347.IP \fBtp_src=\fIport\fR
ed951f15
BP
348.IQ \fBtp_dst=\fIport\fR
349When \fBdl_type\fR and \fBnw_proto\fR specify TCP or UDP, \fBtp_src\fR
350and \fBtp_dst\fR match the UDP or TCP source or destination port
351\fIport\fR, respectively. which is specified as a decimal number
352between 0 and 65535, inclusive (e.g. 80 to match packets originating
064af421 353from a HTTP server).
ed951f15
BP
354.IP
355When \fBdl_type\fR and \fBnw_proto\fR take other values, the values of
0b3f2725 356these settings are ignored (see \fBFlow Syntax\fR above).
a9b4a41a 357.
064af421 358.IP \fBicmp_type=\fItype\fR
ed951f15 359.IQ \fBicmp_code=\fIcode\fR
d31f1109
JP
360When \fBdl_type\fR and \fBnw_proto\fR specify ICMP or ICMPv6, \fItype\fR
361matches the ICMP type and \fIcode\fR matches the ICMP code. Each is
362specified as a decimal number between 0 and 255, inclusive.
ed951f15
BP
363.IP
364When \fBdl_type\fR and \fBnw_proto\fR take other values, the values of
0b3f2725 365these settings are ignored (see \fBFlow Syntax\fR above).
71e17a7a 366.
6c1491fb
BP
367.IP \fBtable=\fInumber\fR
368If specified, limits the flow manipulation and flow dump commands to
369only apply to the table with the given \fInumber\fR.
370\fInumber\fR is a number between 0 and 254, inclusive.
371.
372Behavior varies if \fBtable\fR is not specified. For flow table
373modification commands without \fB\-\-strict\fR, the switch will choose
374the table for these commands to operate on. For flow table
375modification commands with \fB\-\-strict\fR, the command will operate
376on any single matching flow in any table; it will do nothing if there
377are matches in more than one table. The \fBdump-flows\fR and
378\fBdump-aggregate\fR commands will gather statistics about flows from
379all tables.
380.IP
381When this field is specified in \fBadd-flow\fR, \fBadd-flows\fR,
382\fBmod-flows\fR and \fBdel-flows\fR commands, it activates a Nicira
383extension to OpenFlow, which as of this writing is only known to be
384implemented by Open vSwitch.
385.
71e17a7a 386.PP
d31f1109
JP
387The following shorthand notations are also available:
388.
389.IP \fBip\fR
390Same as \fBdl_type=0x0800\fR.
391.
392.IP \fBicmp\fR
393Same as \fBdl_type=0x0800,nw_proto=1\fR.
394.
395.IP \fBtcp\fR
396Same as \fBdl_type=0x0800,nw_proto=6\fR.
397.
398.IP \fBudp\fR
399Same as \fBdl_type=0x0800,nw_proto=17\fR.
400.
401.IP \fBarp\fR
402Same as \fBdl_type=0x0806\fR.
403.
404.PP
71e17a7a
JP
405The following field assignments require support for the NXM (Nicira
406Extended Match) extension to OpenFlow. When one of these is specified,
407\fBovs\-ofctl\fR will automatically attempt to negotiate use of this
408extension. If the switch does not support NXM, then \fBovs\-ofctl\fR
409will report a fatal error.
410.
bad68a99
JP
411.IP \fBarp_sha=\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fR
412.IQ \fBarp_tha=\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fR
413When \fBdl_type\fR specifies ARP, \fBarp_sha\fR and \fBarp_tha\fR match
414the source and target hardware address, respectively. An address is
415specified as 6 pairs of hexadecimal digits delimited by colons.
416.
d31f1109
JP
417.IP \fBipv6_src=\fIipv6\fR[\fB/\fInetmask\fR]
418.IQ \fBipv6_dst=\fIipv6\fR[\fB/\fInetmask\fR]
419When \fBdl_type\fR is 0x86dd (possibly via shorthand, e.g., \fBipv6\fR
420or \fBtcp6\fR), matches IPv6 source (or destination) address \fIipv6\fR,
421which may be specified as defined in RFC 2373. The preferred format is
422\fIx\fB:\fIx\fB:\fIx\fB:\fIx\fB:\fIx\fB:\fIx\fB:\fIx\fB:\fIx\fR, where
423\fIx\fR are the hexadecimal values of the eight 16-bit pieces of the
424address. A single instance of \fB::\fR may be used to indicate multiple
425groups of 16-bits of zeros. The optional \fInetmask\fR allows
426restricting a match to an IPv6 address prefix. A netmask is specified
427as a CIDR block (e.g. \fB2001:db8:3c4d:1::/64\fR).
428.
685a51a5
JP
429.IP \fBnd_target=\fIipv6\fR
430When \fBdl_type\fR, \fBnw_proto\fR, and \fBicmp_type\fR specify
431IPv6 Neighbor Discovery (ICMPv6 type 135 or 136), matches the target address
432\fIipv6\fR. \fIipv6\fR is in the same format described earlier for the
433\fBipv6_src\fR and \fBipv6_dst\fR fields.
434.
435.IP \fBnd_sll=\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fR
436When \fBdl_type\fR, \fBnw_proto\fR, and \fBicmp_type\fR specify IPv6
437Neighbor Solicitation (ICMPv6 type 135), matches the source link\-layer
438address option. An address is specified as 6 pairs of hexadecimal
439digits delimited by colons.
440.
441.IP \fBnd_tll=\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fR
442When \fBdl_type\fR, \fBnw_proto\fR, and \fBicmp_type\fR specify IPv6
443Neighbor Advertisement (ICMPv6 type 136), matches the target link\-layer
444address option. An address is specified as 6 pairs of hexadecimal
445digits delimited by colons.
446.
8368c090
BP
447.IP \fBtun_id=\fItunnel-id\fR[\fB/\fImask\fR]
448Matches tunnel identifier \fItunnel-id\fR. Only packets that arrive
4c5df7f7 449over a tunnel that carries a key (e.g. GRE with the RFC 2890 key
8368c090 450extension) will have a nonzero tunnel ID. If \fImask\fR is omitted,
71e17a7a 451\fItunnel-id\fR is the exact tunnel ID to match; if \fImask\fR is
8368c090
BP
452specified, then a 1-bit in \fImask\fR indicates that the corresponding
453bit in \fItunnel-id\fR must match exactly, and a 0-bit wildcards that
454bit.
4c5df7f7 455.IP
71e17a7a
JP
456In an attempt to be compatible with more switches, \fBovs\-ofctl\fR will
457prefer to use the ``tunnel ID from cookie'' Nicira extension to NXM.
458The use of this extension comes with three caveats: the top 32 bits of
459the \fBcookie\fR (see below) are used for \fItunnel-id\fR and thus
460unavailable for other use, specifying \fBtun_id\fR on \fBdump\-flows\fR
461or \fBdump\-aggregate\fR has no effect, and \fImask\fR is not supported.
462If any of these caveats apply, \fBovs-ofctl\fR will use NXM.
463.
00b1c62f
BP
464.IP "\fBreg\fIidx\fB=\fIvalue\fR[\fB/\fImask\fR]"
465Matches \fIvalue\fR either exactly or with optional \fImask\fR in
466register number \fIidx\fR. The valid range of \fIidx\fR depends on
467the switch. \fIvalue\fR and \fImask\fR are 32-bit integers, by
468default in decimal (use a \fB0x\fR prefix to specify hexadecimal).
469Arbitrary \fImask\fR values are allowed: a 1-bit in \fImask\fR
470indicates that the corresponding bit in \fIvalue\fR must match
471exactly, and a 0-bit wildcards that bit.
472.IP
473When a packet enters an OpenFlow switch, all of the registers are set
474to 0. Only explicit Nicira extension actions change register values.
a9b4a41a 475.
064af421 476.PP
d31f1109
JP
477Defining IPv6 flows (those with \fBdl_type\fR equal to 0x86dd) requires
478support for NXM. The following shorthand notations are available for
479IPv6-related flows:
a9b4a41a 480.
d31f1109
JP
481.IP \fBipv6\fR
482Same as \fBdl_type=0x86dd\fR.
a9b4a41a 483.
d31f1109
JP
484.IP \fBtcp6\fR
485Same as \fBdl_type=0x86dd,nw_proto=6\fR.
a9b4a41a 486.
d31f1109
JP
487.IP \fBudp6\fR
488Same as \fBdl_type=0x86dd,nw_proto=17\fR.
a9b4a41a 489.
d31f1109
JP
490.IP \fBicmp6\fR
491Same as \fBdl_type=0x86dd,nw_proto=58\fR.
a9b4a41a 492.
064af421 493.PP
4e312e69 494The \fBadd\-flow\fR and \fBadd\-flows\fR commands require an additional
537eeb9c 495field, which must be the final field specified:
a9b4a41a 496.
064af421
BP
497.IP \fBactions=\fR[\fItarget\fR][\fB,\fItarget\fR...]\fR
498Specifies a comma-separated list of actions to take on a packet when the
499flow entry matches. If no \fItarget\fR is specified, then packets
500matching the flow are dropped. The \fItarget\fR may be a decimal port
501number designating the physical port on which to output the packet, or one
502of the following keywords:
a9b4a41a 503.
064af421
BP
504.RS
505.IP \fBoutput\fR:\fIport\fR
506Outputs the packet on the port specified by \fIport\fR.
a9b4a41a 507.
5682f723
BP
508.IP \fBenqueue\fR:\fIport\fB:\fIqueue\fR
509Enqueues the packet on the specified \fIqueue\fR within port
510\fIport\fR. The number of supported queues depends on the switch;
511some OpenFlow implementations do not support queuing at all.
512.
064af421
BP
513.IP \fBnormal\fR
514Subjects the packet to the device's normal L2/L3 processing. (This
515action is not implemented by all OpenFlow switches.)
a9b4a41a 516.
064af421
BP
517.IP \fBflood\fR
518Outputs the packet on all switch physical ports other than the port on
519which it was received and any ports on which flooding is disabled
520(typically, these would be ports disabled by the IEEE 802.1D spanning
521tree protocol).
a9b4a41a 522.
064af421
BP
523.IP \fBall\fR
524Outputs the packet on all switch physical ports other than the port on
525which it was received.
a9b4a41a 526.
064af421
BP
527.IP \fBcontroller\fR:\fImax_len\fR
528Sends the packet to the OpenFlow controller as a ``packet in''
529message. If \fImax_len\fR is a number, then it specifies the maximum
530number of bytes that should be sent. If \fImax_len\fR is \fBALL\fR or
531omitted, then the entire packet is sent.
a9b4a41a 532.
064af421
BP
533.IP \fBlocal\fR
534Outputs the packet on the ``local port,'' which corresponds to the
045b2e5c 535network device that has the same name as the bridge.
a9b4a41a 536.
064af421
BP
537.IP \fBdrop\fR
538Discards the packet, so no further processing or forwarding takes place.
539If a drop action is used, no other actions may be specified.
a9b4a41a 540.
064af421
BP
541.IP \fBmod_vlan_vid\fR:\fIvlan_vid\fR
542Modifies the VLAN id on a packet. The VLAN tag is added or modified
543as necessary to match the value specified. If the VLAN tag is added,
544a priority of zero is used (see the \fBmod_vlan_pcp\fR action to set
545this).
a9b4a41a 546.
064af421
BP
547.IP \fBmod_vlan_pcp\fR:\fIvlan_pcp\fR
548Modifies the VLAN priority on a packet. The VLAN tag is added or modified
549as necessary to match the value specified. Valid values are between 0
550(lowest) and 7 (highest). If the VLAN tag is added, a vid of zero is used
551(see the \fBmod_vlan_vid\fR action to set this).
a9b4a41a 552.
064af421
BP
553.IP \fBstrip_vlan\fR
554Strips the VLAN tag from a packet if it is present.
a9b4a41a 555.
064af421
BP
556.IP \fBmod_dl_src\fB:\fImac\fR
557Sets the source Ethernet address to \fImac\fR.
a9b4a41a 558.
064af421
BP
559.IP \fBmod_dl_dst\fB:\fImac\fR
560Sets the destination Ethernet address to \fImac\fR.
a9b4a41a 561.
e423eca6
JP
562.IP \fBmod_nw_src\fB:\fIip\fR
563Sets the IPv4 source address to \fIip\fR.
a9b4a41a 564.
e423eca6
JP
565.IP \fBmod_nw_dst\fB:\fIip\fR
566Sets the IPv4 destination address to \fIip\fR.
a9b4a41a 567.
e423eca6
JP
568.IP \fBmod_tp_src\fB:\fIport\fR
569Sets the TCP or UDP source port to \fIport\fR.
a9b4a41a 570.
e423eca6
JP
571.IP \fBmod_tp_dst\fB:\fIport\fR
572Sets the TCP or UDP destination port to \fIport\fR.
a9b4a41a 573.
959a2ecd
JP
574.IP \fBmod_nw_tos\fB:\fItos\fR
575Sets the IP ToS/DSCP field to \fItos\fR. Valid values are between 0 and
576255, inclusive. Note that the two lower reserved bits are never
577modified.
a9b4a41a 578.
659586ef
JG
579.RE
580.IP
581The following actions are Nicira vendor extensions that, as of this writing, are
582only known to be implemented by Open vSwitch:
583.
584.RS
585.
3a2fe1f3
BP
586.IP \fBresubmit\fB:\fIport\fR
587Re-searches the OpenFlow flow table with the \fBin_port\fR field
588replaced by \fIport\fR and executes the actions found, if any, in
589addition to any other actions in this flow entry. Recursive
590\fBresubmit\fR actions are ignored.
659586ef
JG
591.
592.IP \fBset_tunnel\fB:\fIid\fR
b9298d3f
BP
593.IQ \fBset_tunnel64\fB:\fIid\fR
594If outputting to a port that encapsulates the packet in a tunnel and
595supports an identifier (such as GRE), sets the identifier to \fBid\fR.
596If the \fBset_tunnel\fR form is used and \fIid\fR fits in 32 bits,
597then this uses an action extension that is supported by Open vSwitch
5981.0 and later. Otherwise, if \fIid\fR is a 64-bit value, it requires
599Open vSwitch 1.1 or later.
3a2fe1f3 600.
933df876
BP
601.IP \fBdrop_spoofed_arp\fR
602Stops processing further actions, if the packet being processed is an
603Ethernet+IPv4 ARP packet for which the source Ethernet address inside
604the ARP packet differs from the source Ethernet address in the
605Ethernet header.
bad68a99
JP
606.IP
607This action is deprecated in favor of defining flows using the
608\fBarp_sha\fR match field described earlier and will likely be removed
609in a future version of Open vSwitch.
eedc0097
JP
610.
611.IP \fBset_queue\fB:\fIqueue\fR
612Sets the queue that should be used to \fIqueue\fR when packets are
613output. The number of supported queues depends on the switch; some
614OpenFlow implementations do not support queuing at all.
615.
616.IP \fBpop_queue\fR
617Restores the queue to the value it was before any \fBset_queue\fR
618actions were applied.
619.
96fc46e8
BP
620.IP \fBnote:\fR[\fIhh\fR]...
621Does nothing at all. Any number of bytes represented as hex digits
622\fIhh\fR may be included. Pairs of hex digits may be separated by
623periods for readability.
f393f81e
BP
624.
625.IP "\fBmove:\fIsrc\fB[\fIstart\fB..\fIend\fB]->\fIdst\fB[\fIstart\fB..\fIend\fB]\fR"
626Copies the named bits from field \fIsrc\fR to field \fIdst\fR.
627\fIsrc\fR and \fIdst\fR must be NXM field names as defined in
628\fBnicira\-ext.h\fR, e.g. \fBNXM_OF_UDP_SRC\fR or \fBNXM_NX_REG0\fR.
629Each \fIstart\fR and \fIend\fR pair, which are inclusive, must specify
630the same number of bits and must fit within its respective field.
631Shorthands for \fB[\fIstart\fB..\fIend\fB]\fR exist: use
632\fB[\fIbit\fB]\fR to specify a single bit or \fB[]\fR to specify an
633entire field.
634.IP
635Examples: \fBmove:NXM_NX_REG0[0..5]\->NXM_NX_REG1[26..31]\fR copies the
636six bits numbered 0 through 5, inclusive, in register 0 into bits 26
637through 31, inclusive;
638\fBmove:NXM_NX_REG0[0..15]->NXM_OF_VLAN_TCI[]\fR copies the least
639significant 16 bits of register 0 into the VLAN TCI field.
640.
641.IP "\fBload:\fIvalue\fB\->\fIdst\fB[\fIstart\fB..\fIend\fB]"
642Writes \fIvalue\fR to bits \fIstart\fR through \fIend\fR, inclusive,
643in field \fBdst\fR.
644.IP
645Example: \fBload:55\->NXM_NX_REG2[0..5]\fR loads value 55 (bit pattern
646\fB110111\fR) into bits 0 through 5, inclusive, in register 2.
53ddd40a
BP
647.
648.IP "\fBmultipath(\fIfields\fB, \fIbasis\fB, \fIalgorithm\fB, \fIn_links\fB, \fIarg\fB, \fIdst\fB[\fIstart\fB..\fIend\fB])\fR"
649Hashes \fIfields\fR using \fIbasis\fR as a universal hash parameter,
650then the applies multipath link selection \fIalgorithm\fR (with
651parameter \fIarg\fR) to choose one of \fIn_links\fR output links
652numbered 0 through \fIn_links\fR minus 1, and stores the link into
653\fIdst\fB[\fIstart\fB..\fIend\fB]\fR, which must be an NXM register as
654described above.
655.IP
656Currently, \fIfields\fR must be either \fBeth_src\fR or
657\fBsymmetric_l4\fR and \fIalgorithm\fR must be one of \fBmodulo_n\fR,
658\fBhash_threshold\fR, \fBhrw\fR, and \fBiter_hash\fR. Only
659the \fBiter_hash\fR algorithm uses \fIarg\fR.
660.IP
661Refer to \fBnicira\-ext.h\fR for more details.
3b6a2571
EJ
662.
663.IP "\fBautopath(\fIid\fB, \fIdst\fB[\fIstart\fB..\fIend\fB])\fR"
664Given \fIid\fR, chooses an OpenFlow port and populates it in
665\fIdst\fB[\fIstart\fB..\fIend\fB]\fR, which must be an NXM register as
666described above.
667.IP
668Currently, \fIid\fR should be the OpenFlow port number of an interface on the
669bridge. If it isn't then \fIdst\fB[\fIstart\fB..\fIend\fB]\fR will be
670populated with the OpenFlow port "none". If \fIid\fR is a member of a bond,
671the normal bond selection logic will be used to choose the destination port.
672Otherwise, the register will be populated with \fIid\fR itself.
673.IP
674Refer to \fBnicira\-ext.h\fR for more details.
064af421 675.RE
a9b4a41a 676.
064af421
BP
677.IP
678(The OpenFlow protocol supports other actions that \fBovs\-ofctl\fR does
679not yet expose to the user.)
a9b4a41a 680.
064af421 681.PP
8cce2125
JP
682The \fBadd\-flow\fR, \fBadd\-flows\fR, and \fBmod\-flows\fR commands
683support an additional optional field:
684.
685.IP \fBcookie=\fIvalue\fR
686.
687A cookie is an opaque identifier that can be associated with the flow.
688\fIvalue\fR can be any 64-bit number and need not be unique among
689flows.
690.
691.PP
4b6b46ce
BP
692The following additional field sets the priority for flows added by
693the \fBadd\-flow\fR and \fBadd\-flows\fR commands. For
694\fBmod\-flows\fR and \fBdel\-flows\fR when \fB\-\-strict\fR is
695specified, priority must match along with the rest of the flow
696specification. Other commands ignore the priority value.
a9b4a41a 697.
064af421
BP
698.IP \fBpriority=\fIvalue\fR
699The priority at which a wildcarded entry will match in comparison to
700others. \fIvalue\fR is a number between 0 and 65535, inclusive. A higher
701\fIvalue\fR will match before a lower one. An exact-match entry will always
702have priority over an entry containing wildcards, so it has an implicit
703priority value of 65535. When adding a flow, if the field is not specified,
704the flow's priority will default to 32768.
a9b4a41a 705.
064af421 706.PP
4e312e69 707The \fBadd\-flow\fR and \fBadd\-flows\fR commands support additional
064af421 708optional fields:
a9b4a41a 709.
064af421
BP
710.TP
711\fBidle_timeout=\fIseconds\fR
712Causes the flow to expire after the given number of seconds of
a1545337
BP
713inactivity. A value of 0 (the default) prevents a flow from expiring due to
714inactivity.
a9b4a41a 715.
064af421
BP
716.IP \fBhard_timeout=\fIseconds\fR
717Causes the flow to expire after the given number of seconds,
718regardless of activity. A value of 0 (the default) gives the flow no
719hard expiration deadline.
a9b4a41a 720.
064af421 721.PP
4e312e69
BP
722The \fBdump\-flows\fR, \fBdump\-aggregate\fR, \fBdel\-flow\fR
723and \fBdel\-flows\fR commands support one additional optional field:
a9b4a41a 724.
064af421
BP
725.TP
726\fBout_port=\fIport\fR
727If set, a matching flow must include an output action to \fIport\fR.
a9b4a41a 728.
064af421 729.PP
4e312e69 730The \fBdump\-flows\fR and \fBdump\-aggregate\fR commands support an
064af421 731additional optional field:
a9b4a41a 732.
064af421 733.SS "Table Entry Output"
a9b4a41a 734.
4e312e69 735The \fBdump\-tables\fR and \fBdump\-aggregate\fR commands print information
064af421
BP
736about the entries in a datapath's tables. Each line of output is a
737unique flow entry, which begins with some common information:
a9b4a41a 738.
064af421
BP
739.IP \fBduration\fR
740The number of seconds the entry has been in the table.
a9b4a41a 741.
064af421
BP
742.IP \fBtable_id\fR
743The table that contains the flow. When a packet arrives, the switch
744begins searching for an entry at the lowest numbered table. Tables are
4e312e69 745numbered as shown by the \fBdump\-tables\fR command.
a9b4a41a 746.
064af421
BP
747.IP \fBpriority\fR
748The priority of the entry in relation to other entries within the same
749table. A higher value will match before a lower one.
a9b4a41a 750.
064af421
BP
751.IP \fBn_packets\fR
752The number of packets that have matched the entry.
a9b4a41a 753.
064af421
BP
754.IP \fBn_bytes\fR
755The total number of bytes from packets that have matched the entry.
a9b4a41a 756.
064af421
BP
757.PP
758The rest of the line consists of a description of the flow entry as
759described in \fBFlow Syntax\fR, above.
a9b4a41a
BP
760.
761.
064af421
BP
762.SH OPTIONS
763.TP
4e312e69 764\fB\-\-strict\fR
064af421 765Uses strict matching when running flow modification commands.
a9b4a41a 766.
88ca35ee
BP
767.IP "\fB\-F \fIformat\fR"
768.IQ "\fB\-\-flow\-format=\fIformat\fR"
769\fBovs\-ofctl\fR supports the following flow formats, in order of
770increasing capability:
771.RS
772.IP "\fBopenflow10\fR"
773This is the standard OpenFlow 1.0 flow format. It should be supported
774by all OpenFlow switches.
775.
88ca35ee
BP
776.IP "\fBnxm\fR (Nicira Extended Match)"
777This Nicira extension to OpenFlow is flexible and extensible. It
778supports all of the Nicira flow extensions, such as \fBtun_id\fR and
779registers.
780.RE
781.IP
782Usually, \fBovs\-ofctl\fR picks the correct format automatically. For
783commands that modify the flow table, \fBovs\-ofctl\fR by default uses
784the most widely supported flow format that supports the flows being
785added. For commands that query the flow table, \fBovs\-ofctl\fR by
786default queries and uses the most advanced format supported by the
787switch.
788.IP
789This option, where \fIformat\fR is one of the formats listed in the
790above table, overrides \fBovs\-ofctl\fR's default choice of flow
791format. If a command cannot work as requested using the requested
792flow format, \fBovs\-ofctl\fR will report a fatal error.
4f564f8d
BP
793.
794.IP "\fB\-m\fR"
795.IQ "\fB\-\-more\fR"
796Increases the verbosity of OpenFlow messages printed and logged by
797\fBovs\-ofctl\fR commands. Specify this option more than once to
798increase verbosity further.
ac300505 799.SS "Public Key Infrastructure Options"
84ee7bcf 800.so lib/ssl.man
064af421
BP
801.so lib/vlog.man
802.so lib/common.man
a9b4a41a 803.
064af421 804.SH EXAMPLES
a9b4a41a 805.
045b2e5c
BP
806The following examples assume that \fBovs\-vswitchd\fR has a bridge
807named \fBbr0\fR configured.
a9b4a41a 808.
064af421 809.TP
045b2e5c 810\fBovs\-ofctl dump\-tables br0\fR
064af421
BP
811Prints out the switch's table stats. (This is more interesting after
812some traffic has passed through.)
a9b4a41a 813.
064af421 814.TP
045b2e5c 815\fBovs\-ofctl dump\-flows br0\fR
064af421 816Prints the flow entries in the switch.
a9b4a41a 817.
064af421 818.SH "SEE ALSO"
a9b4a41a 819.
064af421
BP
820.BR ovs\-appctl (8),
821.BR ovs\-controller (8),
822.BR ovs\-vswitchd (8)