]>
Commit | Line | Data |
---|---|---|
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 |
11 | ovs\-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 |
18 | The | |
19 | .B ovs\-ofctl | |
20 | program is a command line tool for monitoring and administering | |
21 | OpenFlow switches. It can also show the current state of an OpenFlow | |
22 | switch, including features, configuration, and table entries. | |
a9b4a41a | 23 | . |
064af421 | 24 | .SS "OpenFlow Switch Management Commands" |
a9b4a41a | 25 | .PP |
064af421 BP |
26 | These commands allow \fBovs\-ofctl\fR to monitor and administer an OpenFlow |
27 | switch. It is able to show the current state of a switch, including | |
28 | features, configuration, and table entries. | |
a9b4a41a | 29 | .PP |
064af421 BP |
30 | Most of these commands take an argument that specifies the method for |
31 | connecting to an OpenFlow switch. The following connection methods | |
32 | are supported: | |
a9b4a41a | 33 | . |
064af421 | 34 | .RS |
84ee7bcf BP |
35 | .so lib/vconn-active.man |
36 | . | |
064af421 BP |
37 | .IP "\fIfile\fR" |
38 | This is short for \fBunix:\fIfile\fR, as long as \fIfile\fR does not | |
39 | contain a colon. | |
84ee7bcf | 40 | . |
1a6f1e2a JG |
41 | .IP \fIbridge\fR |
42 | This 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 | |
46 | Attempts to look up the bridge associated with \fIdp\fR and open as | |
47 | above. 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 | |
53 | Prints to the console information on \fIswitch\fR, including | |
54 | information on its flow tables and ports. | |
a9b4a41a | 55 | . |
064af421 | 56 | .TP |
4e312e69 | 57 | \fBdump\-tables \fIswitch\fR |
064af421 BP |
58 | Prints 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 |
63 | Prints to the console statistics for network devices associated with |
64 | \fIswitch\fR. If \fInetdev\fR is specified, only the statistics | |
65 | associated with that device will be printed. \fInetdev\fR can be an | |
66 | OpenFlow 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 |
70 | Modify characteristics of an interface monitored by \fIswitch\fR. |
71 | \fInetdev\fR can be referred to by its OpenFlow assigned port number or | |
72 | the device name, e.g. \fBeth0\fR. The \fIaction\fR may be any one of the | |
73 | following: | |
a9b4a41a | 74 | . |
064af421 BP |
75 | .RS |
76 | .IP \fBup\fR | |
77 | Enables the interface. This is equivalent to ``ifconfig up'' on a Unix | |
78 | system. | |
a9b4a41a | 79 | . |
064af421 BP |
80 | .IP \fBdown\fR |
81 | Disables the interface. This is equivalent to ``ifconfig down'' on a Unix | |
82 | system. | |
a9b4a41a | 83 | . |
451256f6 EJ |
84 | .IP \fBforward\fR |
85 | Allows forwarding of traffic on this interface. This is the default posture | |
86 | for all ports. | |
87 | . | |
88 | .IP \fBnoforward\fR | |
89 | Disallows forwarding of traffic on this interface. | |
90 | . | |
064af421 BP |
91 | .IP \fBflood\fR |
92 | When a \fIflood\fR action is specified, traffic will be sent out this | |
93 | interface. This is the default posture for monitored ports. | |
a9b4a41a | 94 | . |
064af421 BP |
95 | .IP \fBnoflood\fR |
96 | When a \fIflood\fR action is specified, traffic will not be sent out | |
97 | this interface. This is primarily useful to prevent loops when a | |
98 | spanning tree protocol is not in use. | |
a9b4a41a | 99 | . |
064af421 | 100 | .RE |
a9b4a41a | 101 | . |
7257b535 BP |
102 | .IP "\fBget\-frags \fIswitch\fR" |
103 | Prints \fIswitch\fR's fragment handling mode. See \fBset\-frags\fR, | |
104 | below, for a description of each fragment handling mode. | |
105 | .IP | |
106 | The \fBshow\fR command also prints the fragment handling mode among | |
107 | its other output. | |
108 | . | |
109 | .IP "\fBset\-frags \fIswitch frag_mode\fR" | |
110 | Configures \fIswitch\fR's treatment of IPv4 and IPv6 fragments. The | |
111 | choices for \fIfrag_mode\fR are: | |
112 | .RS | |
113 | .IP "\fBnormal\fR" | |
114 | Fragments pass through the flow table like non-fragmented packets. | |
115 | The TCP ports, UDP ports, and ICMP type and code fields are always set | |
116 | to 0, even for fragments where that information would otherwise be | |
117 | available (fragments with offset 0). This is the default fragment | |
118 | handling mode for an OpenFlow switch. | |
119 | .IP "\fBdrop\fR" | |
120 | Fragments are dropped without passing through the flow table. | |
121 | .IP "\fBreassemble\fR" | |
122 | The switch reassembles fragments into full IP packets before passing | |
123 | them through the flow table. Open vSwitch does not implement this | |
124 | fragment handling mode. | |
125 | .IP "\fBnx\-match\fR" | |
126 | Fragments pass through the flow table like non-fragmented packets. | |
127 | The TCP ports, UDP ports, and ICMP type and code fields are available | |
128 | for matching for fragments with offset 0, and set to 0 in fragments | |
129 | with nonzero offset. This mode is a Nicira extension. | |
130 | .RE | |
131 | .IP | |
132 | See the description of \fBip_frag\fR, below, for a way to match on | |
133 | whether a packet is a fragment and on its fragment offset. | |
134 | . | |
064af421 | 135 | .TP |
4e312e69 | 136 | \fBdump\-flows \fIswitch \fR[\fIflows\fR] |
064af421 BP |
137 | Prints to the console all flow entries in \fIswitch\fR's |
138 | tables that match \fIflows\fR. If \fIflows\fR is omitted, all flows | |
139 | in the switch are retrieved. See \fBFlow Syntax\fR, below, for the | |
140 | syntax of \fIflows\fR. The output format is described in | |
141 | \fBTable Entry Output\fR. | |
a9b4a41a | 142 | . |
064af421 | 143 | .TP |
4e312e69 | 144 | \fBdump\-aggregate \fIswitch \fR[\fIflows\fR] |
064af421 BP |
145 | Prints to the console aggregate statistics for flows in |
146 | \fIswitch\fR's tables that match \fIflows\fR. If \fIflows\fR is omitted, | |
147 | the statistics are aggregated across all flows in the switch's flow | |
148 | tables. See \fBFlow Syntax\fR, below, for the syntax of \fIflows\fR. | |
3845a3fd | 149 | The output format is described in \fBTable Entry Output\fR. |
a9b4a41a | 150 | . |
d2805da2 BP |
151 | .IP "\fBqueue\-stats \fIswitch \fR[\fIport \fR[\fIqueue\fR]]" |
152 | Prints to the console statistics for the specified \fIqueue\fR on | |
153 | \fIport\fR within \fIswitch\fR. Either of \fIport\fR or \fIqueue\fR | |
154 | or both may be omitted (or equivalently specified as \fBALL\fR). If | |
155 | both are omitted, statistics are printed for all queues on all ports. | |
156 | If only \fIqueue\fR is omitted, then statistics are printed for all | |
157 | queues on \fIport\fR; if only \fIport\fR is omitted, then statistics | |
158 | are printed for \fIqueue\fR on every port where it exists. | |
159 | . | |
4989c59f BP |
160 | .SS "OpenFlow Switch Flow Table Commands" |
161 | . | |
162 | These commands manage the flow table in an OpenFlow switch. In each | |
163 | case, \fIflow\fR specifies a flow entry in the format described in | |
164 | \fBFlow Syntax\fR, below, and \fIfile\fR is a text file that contains | |
165 | zero or more flows in the same syntax, one per line. | |
166 | . | |
167 | .IP "\fBadd\-flow \fIswitch flow\fR" | |
168 | .IQ "\fBadd\-flow \fIswitch \fB\- < \fIfile\fR" | |
169 | .IQ "\fBadd\-flows \fIswitch file\fR" | |
170 | Add each flow entry to \fIswitch\fR's tables. | |
171 | . | |
172 | .IP "[\fB\-\-strict\fR] \fBmod\-flows \fIswitch flow\fR" | |
173 | .IQ "[\fB\-\-strict\fR] \fBmod\-flows \fIswitch \fB\- < \fIfile\fR" | |
174 | Modify the actions in entries from \fIswitch\fR's tables that match | |
175 | the specified flows. With \fB\-\-strict\fR, wildcards are not treated | |
176 | as active for matching purposes. | |
177 | . | |
178 | .IP "\fBdel\-flows \fIswitch\fR" | |
179 | .IQ "[\fB\-\-strict\fR] \fBdel\-flows \fIswitch \fR[\fIflow\fR]" | |
180 | .IQ "[\fB\-\-strict\fR] \fBdel\-flows \fIswitch \fB\- < \fIfile\fR" | |
181 | Deletes entries from \fIswitch\fR's flow table. With only a | |
182 | \fIswitch\fR argument, deletes all flows. Otherwise, deletes flow | |
183 | entries that match the specified flows. With \fB\-\-strict\fR, | |
184 | wildcards are not treated as active for matching purposes. | |
a9b4a41a | 185 | . |
c4ea79bf | 186 | .IP "[\fB\-\-readd\fR] \fBreplace\-flows \fIswitch file\fR" |
0199c526 BP |
187 | Reads flow entries from \fIfile\fR (or \fBstdin\fR if \fIfile\fR is |
188 | \fB\-\fR) and queries the flow table from \fIswitch\fR. Then it fixes | |
189 | up any differences, adding flows from \fIflow\fR that are missing on | |
190 | \fIswitch\fR, deleting flows from \fIswitch\fR that are not in | |
191 | \fIfile\fR, and updating flows in \fIswitch\fR whose actions, cookie, | |
192 | or timeouts differ in \fIfile\fR. | |
193 | . | |
c4ea79bf BP |
194 | .IP |
195 | With \fB\-\-readd\fR, \fBovs\-ofctl\fR adds all the flows from | |
196 | \fIfile\fR, even those that exist with the same actions, cookie, and | |
197 | timeout in \fIswitch\fR. This resets all the flow packet and byte | |
198 | counters to 0, which can be useful for debugging. | |
199 | . | |
0199c526 BP |
200 | .IP "\fBdiff\-flows \fIsource1 source2\fR" |
201 | Reads flow entries from \fIsource1\fR and \fIsource2\fR and prints the | |
202 | differences. A flow that is in \fIsource1\fR but not in \fIsource2\fR | |
203 | is printed preceded by a \fB\-\fR, and a flow that is in \fIsource2\fR | |
204 | but not in \fIsource1\fR is printed preceded by a \fB+\fR. If a flow | |
205 | exists in both \fIsource1\fR and \fIsource2\fR with different actions, | |
206 | cookie, or timeouts, then both versions are printed preceded by | |
207 | \fB\-\fR and \fB+\fR, respectively. | |
208 | .IP | |
209 | \fIsource1\fR and \fIsource2\fR may each name a file or a switch. If | |
210 | a name begins with \fB/\fR or \fB.\fR, then it is considered to be a | |
211 | file name. A name that contains \fB:\fR is considered to be a switch. | |
212 | Otherwise, it is a file if a file by that name exists, a switch if | |
213 | not. | |
214 | .IP | |
215 | For this command, an exit status of 0 means that no differences were | |
216 | found, 1 means that an error occurred, and 2 means that some | |
217 | differences were found. | |
218 | . | |
4989c59f BP |
219 | .SS "OpenFlow Switch Monitoring Commands" |
220 | . | |
0caf6bde BP |
221 | .IP "\fBsnoop \fIswitch\fR" |
222 | Connects to \fIswitch\fR and prints to the console all OpenFlow | |
223 | messages received. Unlike other \fBovs\-ofctl\fR commands, if | |
224 | \fIswitch\fR is the name of a bridge, then the \fBsnoop\fR command | |
225 | connects to a Unix domain socket named | |
226 | \fB@RUNDIR@/\fIbridge\fB.snoop\fR. \fBovs\-vswitchd\fR listens on | |
227 | such a socket for each bridge and sends to it all of the OpenFlow | |
228 | messages sent to or received from its configured OpenFlow controller. | |
229 | Thus, this command can be used to view OpenFlow protocol activity | |
230 | between a switch and its controller. | |
231 | .IP | |
232 | When a switch has more than one controller configured, only the | |
e2bfacb6 BP |
233 | traffic to and from a single controller is output. If none of the |
234 | controllers is configured as a master or a slave (using a Nicira | |
235 | extension to OpenFlow), then a controller is chosen arbitrarily among | |
236 | them. If there is a master controller, it is chosen; otherwise, if | |
237 | there are any controllers that are not masters or slaves, one is | |
238 | chosen arbitrarily; otherwise, a slave controller is chosen | |
239 | arbitrarily. This choice is made once at connection time and does not | |
240 | change as controllers reconfigure their roles. | |
241 | .IP | |
242 | If a switch has no controller configured, or if | |
0caf6bde BP |
243 | the configured controller is disconnected, no traffic is sent, so |
244 | monitoring will not show any traffic. | |
245 | . | |
4989c59f | 246 | .IP "\fBmonitor \fIswitch\fR [\fImiss-len\fR]" |
064af421 | 247 | Connects to \fIswitch\fR and prints to the console all OpenFlow |
045b2e5c BP |
248 | messages received. Usually, \fIswitch\fR should specify the name of a |
249 | bridge in the \fBovs\-vswitchd\fR database. | |
a9b4a41a | 250 | .IP |
064af421 BP |
251 | If \fImiss-len\fR is provided, \fBovs\-ofctl\fR sends an OpenFlow ``set |
252 | configuration'' message at connection setup time that requests | |
0caf6bde BP |
253 | \fImiss-len\fR bytes of each packet that misses the flow table. Open vSwitch |
254 | does not send these and other asynchronous messages to an | |
064af421 | 255 | \fBovs\-ofctl monitor\fR client connection unless a nonzero value is |
0caf6bde BP |
256 | specified on this argument. (Thus, if \fImiss\-len\fR is not |
257 | specified, very little traffic will ordinarily be printed.) | |
a9b4a41a | 258 | .IP |
064af421 BP |
259 | This command may be useful for debugging switch or controller |
260 | implementations. | |
a9b4a41a | 261 | . |
064af421 | 262 | .SS "OpenFlow Switch and Controller Commands" |
a9b4a41a | 263 | . |
064af421 BP |
264 | The following commands, like those in the previous section, may be |
265 | applied to OpenFlow switches, using any of the connection methods | |
266 | described in that section. Unlike those commands, these may also be | |
267 | applied to OpenFlow controllers. | |
a9b4a41a | 268 | . |
064af421 BP |
269 | .TP |
270 | \fBprobe \fItarget\fR | |
271 | Sends a single OpenFlow echo-request message to \fItarget\fR and waits | |
4e312e69 | 272 | for the response. With the \fB\-t\fR or \fB\-\-timeout\fR option, this |
064af421 BP |
273 | command can test whether an OpenFlow switch or controller is up and |
274 | running. | |
a9b4a41a | 275 | . |
064af421 BP |
276 | .TP |
277 | \fBping \fItarget \fR[\fIn\fR] | |
278 | Sends a series of 10 echo request packets to \fItarget\fR and times | |
279 | each reply. The echo request packets consist of an OpenFlow header | |
280 | plus \fIn\fR bytes (default: 64) of randomly generated payload. This | |
281 | measures the latency of individual requests. | |
a9b4a41a | 282 | . |
064af421 BP |
283 | .TP |
284 | \fBbenchmark \fItarget n count\fR | |
285 | Sends \fIcount\fR echo request packets that each consist of an | |
286 | OpenFlow header plus \fIn\fR bytes of payload and waits for each | |
287 | response. Reports the total time required. This is a measure of the | |
288 | maximum bandwidth to \fItarget\fR for round-trips of \fIn\fR-byte | |
289 | messages. | |
a9b4a41a | 290 | . |
064af421 | 291 | .SS "Flow Syntax" |
a9b4a41a | 292 | .PP |
064af421 BP |
293 | Some \fBovs\-ofctl\fR commands accept an argument that describes a flow or |
294 | flows. Such flow descriptions comprise a series | |
295 | \fIfield\fB=\fIvalue\fR assignments, separated by commas or white | |
296 | space. (Embedding spaces into a flow description normally requires | |
297 | quoting to prevent the shell from breaking the description into | |
298 | multiple arguments.) | |
a9b4a41a | 299 | .PP |
0b3f2725 BP |
300 | Flow descriptions should be in \fBnormal form\fR. This means that a |
301 | flow may only specify a value for an L3 field if it also specifies a | |
302 | particular L2 protocol, and that a flow may only specify an L4 field | |
303 | if it also specifies particular L2 and L3 protocol types. For | |
304 | example, if the L2 protocol type \fBdl_type\fR is wildcarded, then L3 | |
305 | fields \fBnw_src\fR, \fBnw_dst\fR, and \fBnw_proto\fR must also be | |
306 | wildcarded. Similarly, if \fBdl_type\fR or \fBnw_proto\fR (the L3 | |
307 | protocol type) is wildcarded, so must be \fBtp_dst\fR and | |
308 | \fBtp_src\fR, which are L4 fields. \fBovs\-ofctl\fR will warn about | |
309 | flows not in normal form. | |
310 | .PP | |
064af421 BP |
311 | The following field assignments describe how a flow matches a packet. |
312 | If any of these assignments is omitted from the flow syntax, the field | |
313 | is treated as a wildcard; thus, if all of them are omitted, the | |
314 | resulting flow matches all packets. The string \fB*\fR or \fBANY\fR | |
315 | may be specified to explicitly mark any of these fields as a wildcard. | |
316 | (\fB*\fR should be quoted to protect it from shell expansion.) | |
a9b4a41a | 317 | . |
064af421 | 318 | .IP \fBin_port=\fIport_no\fR |
03a8a29e | 319 | Matches OpenFlow port \fIport_no\fR. Ports are numbered as |
064af421 | 320 | displayed by \fBovs\-ofctl show\fR. |
03a8a29e BP |
321 | .IP |
322 | (The \fBresubmit\fR action can search OpenFlow flow tables with | |
323 | arbitrary \fBin_port\fR values, so flows that match port numbers that | |
324 | do not exist from an OpenFlow perspective can still potentially be | |
325 | matched.) | |
a9b4a41a | 326 | . |
064af421 | 327 | .IP \fBdl_vlan=\fIvlan\fR |
f30f26be JP |
328 | Matches IEEE 802.1q Virtual LAN tag \fIvlan\fR. Specify \fB0xffff\fR |
329 | as \fIvlan\fR to match packets that are not tagged with a Virtual LAN; | |
064af421 BP |
330 | otherwise, specify a number between 0 and 4095, inclusive, as the |
331 | 12-bit VLAN ID to match. | |
a9b4a41a | 332 | . |
959a2ecd JP |
333 | .IP \fBdl_vlan_pcp=\fIpriority\fR |
334 | Matches IEEE 802.1q Priority Code Point (PCP) \fIpriority\fR, which is | |
335 | specified as a value between 0 and 7, inclusive. A higher value | |
336 | indicates a higher frame priority level. | |
a9b4a41a | 337 | . |
ed951f15 BP |
338 | .IP \fBdl_src=\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fR |
339 | .IQ \fBdl_dst=\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fR | |
340 | Matches an Ethernet source (or destination) address specified as 6 | |
341 | pairs of hexadecimal digits delimited by colons | |
342 | (e.g. \fB00:0A:E4:25:6B:B0\fR). | |
343 | . | |
cb8ca532 BP |
344 | .IP \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 |
345 | Matches an Ethernet destination address specified as 6 pairs of | |
346 | hexadecimal digits delimited by colons (e.g. \fB00:0A:E4:25:6B:B0\fR), | |
347 | with a wildcard mask following the slash. Only | |
348 | the following masks are allowed: | |
349 | .RS | |
350 | .IP \fB01:00:00:00:00:00\fR | |
351 | Match only the multicast bit. Thus, | |
352 | \fBdl_dst=01:00:00:00:00:00/01:00:00:00:00:00\fR matches all multicast | |
353 | (including broadcast) Ethernet packets, and | |
354 | \fBdl_dst=00:00:00:00:00:00/01:00:00:00:00:00\fR matches all unicast | |
355 | Ethernet packets. | |
356 | .IP \fBfe:ff:ff:ff:ff:ff\fR | |
357 | Match all bits except the multicast bit. This is probably not useful. | |
358 | .IP \fBff:ff:ff:ff:ff:ff\fR | |
359 | Exact match (equivalent to omitting the mask). | |
360 | .IP \fB00:00:00:00:00:00\fR | |
361 | Wildcard all bits (equivalent to \fBdl_dst=*\fR.) | |
362 | .RE | |
363 | . | |
064af421 BP |
364 | .IP \fBdl_type=\fIethertype\fR |
365 | Matches Ethernet protocol type \fIethertype\fR, which is specified as an | |
366 | integer between 0 and 65535, inclusive, either in decimal or as a | |
367 | hexadecimal number prefixed by \fB0x\fR (e.g. \fB0x0806\fR to match ARP | |
368 | packets). | |
a9b4a41a | 369 | . |
064af421 | 370 | .IP \fBnw_src=\fIip\fR[\fB/\fInetmask\fR] |
ed951f15 BP |
371 | .IQ \fBnw_dst=\fIip\fR[\fB/\fInetmask\fR] |
372 | When \fBdl_type\fR is 0x0800 (possibly via shorthand, e.g. \fBip\fR | |
373 | or \fBtcp\fR), matches IPv4 source (or destination) address \fIip\fR, | |
374 | which may be specified as an IP address or host name | |
375 | (e.g. \fB192.168.1.1\fR or \fBwww.example.com\fR). The optional | |
376 | \fInetmask\fR allows restricting a match to an IPv4 address prefix. | |
377 | The netmask may be specified as a dotted quad | |
378 | (e.g. \fB192.168.1.0/255.255.255.0\fR) or as a CIDR block | |
064af421 | 379 | (e.g. \fB192.168.1.0/24\fR). |
ed951f15 BP |
380 | .IP |
381 | When \fBdl_type=0x0806\fR or \fBarp\fR is specified, matches the | |
382 | \fBar_spa\fR or \fBar_tpa\fR field, respectively, in ARP packets for | |
383 | IPv4 and Ethernet. | |
384 | .IP | |
385 | When \fBdl_type\fR is wildcarded or set to a value other than 0x0800 | |
0b3f2725 BP |
386 | or 0x0806, the values of \fBnw_src\fR and \fBnw_dst\fR are ignored |
387 | (see \fBFlow Syntax\fR above). | |
a9b4a41a | 388 | . |
064af421 | 389 | .IP \fBnw_proto=\fIproto\fR |
ed951f15 BP |
390 | When \fBip\fR or \fBdl_type=0x0800\fR is specified, matches IP |
391 | protocol type \fIproto\fR, which is specified as a decimal number | |
d31f1109 JP |
392 | between 0 and 255, inclusive (e.g. 1 to match ICMP packets or 6 to match |
393 | TCP packets). | |
394 | .IP | |
395 | When \fBipv6\fR or \fBdl_type=0x86dd\fR is specified, matches IPv6 | |
396 | header type \fIproto\fR, which is specified as a decimal number between | |
397 | 0 and 255, inclusive (e.g. 58 to match ICMPv6 packets or 6 to match | |
398 | TCP). The header type is the terminal header as described in the | |
399 | \fBDESIGN\fR document. | |
ed951f15 BP |
400 | .IP |
401 | When \fBarp\fR or \fBdl_type=0x0806\fR is specified, matches the lower | |
402 | 8 bits of the ARP opcode. ARP opcodes greater than 255 are treated as | |
403 | 0. | |
404 | .IP | |
d31f1109 JP |
405 | When \fBdl_type\fR is wildcarded or set to a value other than 0x0800, |
406 | 0x0806, or 0x86dd, the value of \fBnw_proto\fR is ignored (see \fBFlow | |
0b3f2725 | 407 | Syntax\fR above). |
a9b4a41a | 408 | . |
834377ea | 409 | .IP \fBnw_tos=\fItos\fR |
d31f1109 JP |
410 | Matches IP ToS/DSCP or IPv6 traffic class field \fItos\fR, which is |
411 | specified as a decimal number between 0 and 255, inclusive. Note that | |
412 | the two lower reserved bits are ignored for matching purposes. | |
ed951f15 | 413 | .IP |
5c0ceb0a JP |
414 | When \fBdl_type\fR is wildcarded or set to a value other than 0x0800 or |
415 | 0x86dd, the value of \fBnw_tos\fR is ignored (see \fBFlow Syntax\fR | |
416 | above). | |
a9b4a41a | 417 | . |
530180fd JP |
418 | .IP \fBnw_ecn=\fIecn\fR |
419 | Matches \fIecn\fR bits in IP ToS or IPv6 traffic class fields, which is | |
420 | specified as a decimal number between 0 and 3, inclusive. | |
421 | .IP | |
422 | When \fBdl_type\fR is wildcarded or set to a value other than 0x0800 or | |
423 | 0x86dd, the value of \fBnw_ecn\fR is ignored (see \fBFlow Syntax\fR | |
424 | above). | |
425 | . | |
a61680c6 JP |
426 | .IP \fBnw_ttl=\fIttl\fR |
427 | Matches IP TTL or IPv6 hop limit value \fIttl\fR, which is | |
428 | specified as a decimal number between 0 and 255, inclusive. | |
429 | .IP | |
430 | When \fBdl_type\fR is wildcarded or set to a value other than 0x0800 or | |
431 | 0x86dd, the value of \fBnw_ttl\fR is ignored (see \fBFlow Syntax\fR | |
432 | above). | |
433 | .IP | |
434 | . | |
064af421 | 435 | .IP \fBtp_src=\fIport\fR |
ed951f15 BP |
436 | .IQ \fBtp_dst=\fIport\fR |
437 | When \fBdl_type\fR and \fBnw_proto\fR specify TCP or UDP, \fBtp_src\fR | |
438 | and \fBtp_dst\fR match the UDP or TCP source or destination port | |
439 | \fIport\fR, respectively. which is specified as a decimal number | |
440 | between 0 and 65535, inclusive (e.g. 80 to match packets originating | |
064af421 | 441 | from a HTTP server). |
ed951f15 BP |
442 | .IP |
443 | When \fBdl_type\fR and \fBnw_proto\fR take other values, the values of | |
0b3f2725 | 444 | these settings are ignored (see \fBFlow Syntax\fR above). |
a9b4a41a | 445 | . |
064af421 | 446 | .IP \fBicmp_type=\fItype\fR |
ed951f15 | 447 | .IQ \fBicmp_code=\fIcode\fR |
d31f1109 JP |
448 | When \fBdl_type\fR and \fBnw_proto\fR specify ICMP or ICMPv6, \fItype\fR |
449 | matches the ICMP type and \fIcode\fR matches the ICMP code. Each is | |
450 | specified as a decimal number between 0 and 255, inclusive. | |
ed951f15 BP |
451 | .IP |
452 | When \fBdl_type\fR and \fBnw_proto\fR take other values, the values of | |
0b3f2725 | 453 | these settings are ignored (see \fBFlow Syntax\fR above). |
71e17a7a | 454 | . |
6c1491fb BP |
455 | .IP \fBtable=\fInumber\fR |
456 | If specified, limits the flow manipulation and flow dump commands to | |
68c59d15 | 457 | only apply to the table with the given \fInumber\fR between 0 and 254. |
6c1491fb | 458 | . |
68c59d15 BP |
459 | Behavior varies if \fBtable\fR is not specified (equivalent to |
460 | specifying 255 as \fInumber\fR). For flow table | |
6c1491fb BP |
461 | modification commands without \fB\-\-strict\fR, the switch will choose |
462 | the table for these commands to operate on. For flow table | |
463 | modification commands with \fB\-\-strict\fR, the command will operate | |
464 | on any single matching flow in any table; it will do nothing if there | |
465 | are matches in more than one table. The \fBdump-flows\fR and | |
466 | \fBdump-aggregate\fR commands will gather statistics about flows from | |
467 | all tables. | |
468 | .IP | |
469 | When this field is specified in \fBadd-flow\fR, \fBadd-flows\fR, | |
470 | \fBmod-flows\fR and \fBdel-flows\fR commands, it activates a Nicira | |
471 | extension to OpenFlow, which as of this writing is only known to be | |
472 | implemented by Open vSwitch. | |
473 | . | |
71e17a7a | 474 | .PP |
d31f1109 JP |
475 | The following shorthand notations are also available: |
476 | . | |
477 | .IP \fBip\fR | |
478 | Same as \fBdl_type=0x0800\fR. | |
479 | . | |
480 | .IP \fBicmp\fR | |
481 | Same as \fBdl_type=0x0800,nw_proto=1\fR. | |
482 | . | |
483 | .IP \fBtcp\fR | |
484 | Same as \fBdl_type=0x0800,nw_proto=6\fR. | |
485 | . | |
486 | .IP \fBudp\fR | |
487 | Same as \fBdl_type=0x0800,nw_proto=17\fR. | |
488 | . | |
489 | .IP \fBarp\fR | |
490 | Same as \fBdl_type=0x0806\fR. | |
491 | . | |
492 | .PP | |
71e17a7a JP |
493 | The following field assignments require support for the NXM (Nicira |
494 | Extended Match) extension to OpenFlow. When one of these is specified, | |
495 | \fBovs\-ofctl\fR will automatically attempt to negotiate use of this | |
496 | extension. If the switch does not support NXM, then \fBovs\-ofctl\fR | |
497 | will report a fatal error. | |
498 | . | |
33d8c6b4 BP |
499 | .IP \fBvlan_tci=\fItci\fR[\fB/\fImask\fR] |
500 | Matches modified VLAN TCI \fItci\fR. If \fImask\fR is omitted, | |
501 | \fItci\fR is the exact VLAN TCI to match; if \fImask\fR is specified, | |
a8600e1a | 502 | then a 1-bit in \fImask\fR indicates that the corresponding bit in |
33d8c6b4 BP |
503 | \fItci\fR must match exactly, and a 0-bit wildcards that bit. Both |
504 | \fItci\fR and \fImask\fR are 16-bit values that are decimal by | |
505 | default; use a \fB0x\fR prefix to specify them in hexadecimal. | |
506 | . | |
507 | .IP | |
508 | The value that \fBvlan_tci\fR matches against is 0 for a packet that | |
509 | has no 802.1Q header. Otherwise, it is the TCI value from the 802.1Q | |
510 | header with the CFI bit (with value \fB0x1000\fR) forced to 1. | |
511 | .IP | |
512 | Examples: | |
513 | .RS | |
514 | .IP \fBvlan_tci=0\fR | |
515 | Match only packets without an 802.1Q header. | |
516 | .IP \fBvlan_tci=0xf123\fR | |
517 | Match packets tagged with priority 7 in VLAN 0x123. | |
518 | .IP \fBvlan_tci=0x1123/0x1fff\fR | |
519 | Match packets tagged with VLAN 0x123 (and any priority). | |
520 | .IP \fBvlan_tci=0x5000/0xf000\fR | |
521 | Match packets tagged with priority 2 (in any VLAN). | |
522 | .IP \fBvlan_tci=0/0xfff\fR | |
523 | Match packets with no 802.1Q header or tagged with VLAN 0 (and any | |
524 | priority). | |
525 | .IP \fBvlan_tci=0x5000/0xe000\fR | |
526 | Match packets with no 802.1Q header or tagged with priority 2 (in any | |
527 | VLAN). | |
528 | .IP \fBvlan_tci=0/0xefff\fR | |
529 | Match packets with no 802.1Q header or tagged with VLAN 0 and priority | |
530 | 0. | |
531 | .RE | |
532 | .IP | |
533 | Some of these matching possibilities can also be achieved with | |
534 | \fBdl_vlan\fR and \fBdl_vlan_pcp\fR. | |
535 | . | |
7257b535 BP |
536 | .IP \fBip_frag=\fIfrag_type\fR |
537 | When \fBdl_type\fR specifies IP or IPv6, \fIfrag_type\fR | |
538 | specifies what kind of IP fragments or non-fragments to match. The | |
539 | following values of \fIfrag_type\fR are supported: | |
540 | .RS | |
541 | .IP "\fBno\fR" | |
542 | Matches only non-fragmented packets. | |
543 | .IP "\fByes\fR" | |
544 | Matches all fragments. | |
545 | .IP "\fBfirst\fR" | |
546 | Matches only fragments with offset 0. | |
547 | .IP "\fBlater\fR" | |
548 | Matches only fragments with nonzero offset. | |
549 | .IP "\fBnot_later\fR" | |
550 | Matches non-fragmented packets and fragments with zero offset. | |
551 | .RE | |
552 | .IP | |
553 | The \fBip_frag\fR match type is likely to be most useful in | |
554 | \fBnx\-match\fR mode. See the description of the \fBset\-frags\fR | |
555 | command, above, for more details. | |
556 | . | |
bad68a99 JP |
557 | .IP \fBarp_sha=\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fR |
558 | .IQ \fBarp_tha=\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fR | |
559 | When \fBdl_type\fR specifies ARP, \fBarp_sha\fR and \fBarp_tha\fR match | |
560 | the source and target hardware address, respectively. An address is | |
561 | specified as 6 pairs of hexadecimal digits delimited by colons. | |
562 | . | |
d31f1109 JP |
563 | .IP \fBipv6_src=\fIipv6\fR[\fB/\fInetmask\fR] |
564 | .IQ \fBipv6_dst=\fIipv6\fR[\fB/\fInetmask\fR] | |
565 | When \fBdl_type\fR is 0x86dd (possibly via shorthand, e.g., \fBipv6\fR | |
566 | or \fBtcp6\fR), matches IPv6 source (or destination) address \fIipv6\fR, | |
567 | which may be specified as defined in RFC 2373. The preferred format is | |
568 | \fIx\fB:\fIx\fB:\fIx\fB:\fIx\fB:\fIx\fB:\fIx\fB:\fIx\fB:\fIx\fR, where | |
569 | \fIx\fR are the hexadecimal values of the eight 16-bit pieces of the | |
570 | address. A single instance of \fB::\fR may be used to indicate multiple | |
571 | groups of 16-bits of zeros. The optional \fInetmask\fR allows | |
572 | restricting a match to an IPv6 address prefix. A netmask is specified | |
573 | as a CIDR block (e.g. \fB2001:db8:3c4d:1::/64\fR). | |
574 | . | |
fa8223b7 JP |
575 | .IP \fBipv6_label=\fIlabel\fR |
576 | When \fBdl_type\fR is 0x86dd (possibly via shorthand, e.g., \fBipv6\fR | |
577 | or \fBtcp6\fR), matches IPv6 flow label \fIlabel\fR. | |
578 | . | |
685a51a5 JP |
579 | .IP \fBnd_target=\fIipv6\fR |
580 | When \fBdl_type\fR, \fBnw_proto\fR, and \fBicmp_type\fR specify | |
581 | IPv6 Neighbor Discovery (ICMPv6 type 135 or 136), matches the target address | |
582 | \fIipv6\fR. \fIipv6\fR is in the same format described earlier for the | |
583 | \fBipv6_src\fR and \fBipv6_dst\fR fields. | |
584 | . | |
585 | .IP \fBnd_sll=\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fR | |
586 | When \fBdl_type\fR, \fBnw_proto\fR, and \fBicmp_type\fR specify IPv6 | |
587 | Neighbor Solicitation (ICMPv6 type 135), matches the source link\-layer | |
588 | address option. An address is specified as 6 pairs of hexadecimal | |
589 | digits delimited by colons. | |
590 | . | |
591 | .IP \fBnd_tll=\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fR | |
592 | When \fBdl_type\fR, \fBnw_proto\fR, and \fBicmp_type\fR specify IPv6 | |
593 | Neighbor Advertisement (ICMPv6 type 136), matches the target link\-layer | |
594 | address option. An address is specified as 6 pairs of hexadecimal | |
595 | digits delimited by colons. | |
596 | . | |
8368c090 BP |
597 | .IP \fBtun_id=\fItunnel-id\fR[\fB/\fImask\fR] |
598 | Matches tunnel identifier \fItunnel-id\fR. Only packets that arrive | |
4c5df7f7 | 599 | over a tunnel that carries a key (e.g. GRE with the RFC 2890 key |
8368c090 | 600 | extension) will have a nonzero tunnel ID. If \fImask\fR is omitted, |
71e17a7a | 601 | \fItunnel-id\fR is the exact tunnel ID to match; if \fImask\fR is |
8368c090 BP |
602 | specified, then a 1-bit in \fImask\fR indicates that the corresponding |
603 | bit in \fItunnel-id\fR must match exactly, and a 0-bit wildcards that | |
604 | bit. | |
4c5df7f7 | 605 | .IP |
71e17a7a JP |
606 | In an attempt to be compatible with more switches, \fBovs\-ofctl\fR will |
607 | prefer to use the ``tunnel ID from cookie'' Nicira extension to NXM. | |
608 | The use of this extension comes with three caveats: the top 32 bits of | |
609 | the \fBcookie\fR (see below) are used for \fItunnel-id\fR and thus | |
610 | unavailable for other use, specifying \fBtun_id\fR on \fBdump\-flows\fR | |
611 | or \fBdump\-aggregate\fR has no effect, and \fImask\fR is not supported. | |
612 | If any of these caveats apply, \fBovs-ofctl\fR will use NXM. | |
613 | . | |
00b1c62f BP |
614 | .IP "\fBreg\fIidx\fB=\fIvalue\fR[\fB/\fImask\fR]" |
615 | Matches \fIvalue\fR either exactly or with optional \fImask\fR in | |
616 | register number \fIidx\fR. The valid range of \fIidx\fR depends on | |
617 | the switch. \fIvalue\fR and \fImask\fR are 32-bit integers, by | |
618 | default in decimal (use a \fB0x\fR prefix to specify hexadecimal). | |
619 | Arbitrary \fImask\fR values are allowed: a 1-bit in \fImask\fR | |
620 | indicates that the corresponding bit in \fIvalue\fR must match | |
621 | exactly, and a 0-bit wildcards that bit. | |
622 | .IP | |
623 | When a packet enters an OpenFlow switch, all of the registers are set | |
624 | to 0. Only explicit Nicira extension actions change register values. | |
a9b4a41a | 625 | . |
064af421 | 626 | .PP |
d31f1109 JP |
627 | Defining IPv6 flows (those with \fBdl_type\fR equal to 0x86dd) requires |
628 | support for NXM. The following shorthand notations are available for | |
629 | IPv6-related flows: | |
a9b4a41a | 630 | . |
d31f1109 JP |
631 | .IP \fBipv6\fR |
632 | Same as \fBdl_type=0x86dd\fR. | |
a9b4a41a | 633 | . |
d31f1109 JP |
634 | .IP \fBtcp6\fR |
635 | Same as \fBdl_type=0x86dd,nw_proto=6\fR. | |
a9b4a41a | 636 | . |
d31f1109 JP |
637 | .IP \fBudp6\fR |
638 | Same as \fBdl_type=0x86dd,nw_proto=17\fR. | |
a9b4a41a | 639 | . |
d31f1109 JP |
640 | .IP \fBicmp6\fR |
641 | Same as \fBdl_type=0x86dd,nw_proto=58\fR. | |
a9b4a41a | 642 | . |
064af421 | 643 | .PP |
2c6d8411 BP |
644 | Finally, field assignments to \fBduration\fR, \fBn_packets\fR, or |
645 | \fBn_bytes\fR are ignored to allow output from the \fBdump\-flows\fR | |
646 | command to be used as input for other commands that parse flows. | |
647 | . | |
648 | .PP | |
c821124b BP |
649 | The \fBadd\-flow\fR, \fBadd\-flows\fR, and \fBmod\-flows\fR commands |
650 | require an additional field, which must be the final field specified: | |
a9b4a41a | 651 | . |
064af421 BP |
652 | .IP \fBactions=\fR[\fItarget\fR][\fB,\fItarget\fR...]\fR |
653 | Specifies a comma-separated list of actions to take on a packet when the | |
654 | flow entry matches. If no \fItarget\fR is specified, then packets | |
655 | matching the flow are dropped. The \fItarget\fR may be a decimal port | |
656 | number designating the physical port on which to output the packet, or one | |
657 | of the following keywords: | |
a9b4a41a | 658 | . |
064af421 BP |
659 | .RS |
660 | .IP \fBoutput\fR:\fIport\fR | |
f694937d EJ |
661 | .IQ \fBoutput\fR:\fIsrc\fB[\fIstart\fB..\fIend\fB] |
662 | Outputs the packet. If \fIport\fR is an OpenFlow port number, outputs directly | |
663 | to it. Otherwise, outputs to the OpenFlow port number read from \fIsrc\fR | |
664 | which must be an NXM field as described above. Outputting to an NXM field is | |
665 | an OpenFlow extension which is not supported by standard OpenFlow switches. | |
666 | .IP | |
667 | Example: \fBoutput:NXM_NX_REG0[16..31]\fR outputs to the OpenFlow port number | |
668 | written in the upper half of register 0. | |
a9b4a41a | 669 | . |
5682f723 BP |
670 | .IP \fBenqueue\fR:\fIport\fB:\fIqueue\fR |
671 | Enqueues the packet on the specified \fIqueue\fR within port | |
672 | \fIport\fR. The number of supported queues depends on the switch; | |
673 | some OpenFlow implementations do not support queuing at all. | |
674 | . | |
064af421 BP |
675 | .IP \fBnormal\fR |
676 | Subjects the packet to the device's normal L2/L3 processing. (This | |
677 | action is not implemented by all OpenFlow switches.) | |
a9b4a41a | 678 | . |
064af421 BP |
679 | .IP \fBflood\fR |
680 | Outputs the packet on all switch physical ports other than the port on | |
681 | which it was received and any ports on which flooding is disabled | |
682 | (typically, these would be ports disabled by the IEEE 802.1D spanning | |
683 | tree protocol). | |
a9b4a41a | 684 | . |
064af421 BP |
685 | .IP \fBall\fR |
686 | Outputs the packet on all switch physical ports other than the port on | |
687 | which it was received. | |
a9b4a41a | 688 | . |
064af421 BP |
689 | .IP \fBcontroller\fR:\fImax_len\fR |
690 | Sends the packet to the OpenFlow controller as a ``packet in'' | |
691 | message. If \fImax_len\fR is a number, then it specifies the maximum | |
692 | number of bytes that should be sent. If \fImax_len\fR is \fBALL\fR or | |
693 | omitted, then the entire packet is sent. | |
a9b4a41a | 694 | . |
064af421 BP |
695 | .IP \fBlocal\fR |
696 | Outputs the packet on the ``local port,'' which corresponds to the | |
045b2e5c | 697 | network device that has the same name as the bridge. |
a9b4a41a | 698 | . |
64c1e8af JP |
699 | .IP \fBin_port\fR |
700 | Outputs the packet on the port from which it was received. | |
701 | . | |
064af421 BP |
702 | .IP \fBdrop\fR |
703 | Discards the packet, so no further processing or forwarding takes place. | |
704 | If a drop action is used, no other actions may be specified. | |
a9b4a41a | 705 | . |
064af421 BP |
706 | .IP \fBmod_vlan_vid\fR:\fIvlan_vid\fR |
707 | Modifies the VLAN id on a packet. The VLAN tag is added or modified | |
708 | as necessary to match the value specified. If the VLAN tag is added, | |
709 | a priority of zero is used (see the \fBmod_vlan_pcp\fR action to set | |
710 | this). | |
a9b4a41a | 711 | . |
064af421 BP |
712 | .IP \fBmod_vlan_pcp\fR:\fIvlan_pcp\fR |
713 | Modifies the VLAN priority on a packet. The VLAN tag is added or modified | |
714 | as necessary to match the value specified. Valid values are between 0 | |
715 | (lowest) and 7 (highest). If the VLAN tag is added, a vid of zero is used | |
716 | (see the \fBmod_vlan_vid\fR action to set this). | |
a9b4a41a | 717 | . |
064af421 BP |
718 | .IP \fBstrip_vlan\fR |
719 | Strips the VLAN tag from a packet if it is present. | |
a9b4a41a | 720 | . |
064af421 BP |
721 | .IP \fBmod_dl_src\fB:\fImac\fR |
722 | Sets the source Ethernet address to \fImac\fR. | |
a9b4a41a | 723 | . |
064af421 BP |
724 | .IP \fBmod_dl_dst\fB:\fImac\fR |
725 | Sets the destination Ethernet address to \fImac\fR. | |
a9b4a41a | 726 | . |
e423eca6 JP |
727 | .IP \fBmod_nw_src\fB:\fIip\fR |
728 | Sets the IPv4 source address to \fIip\fR. | |
a9b4a41a | 729 | . |
e423eca6 JP |
730 | .IP \fBmod_nw_dst\fB:\fIip\fR |
731 | Sets the IPv4 destination address to \fIip\fR. | |
a9b4a41a | 732 | . |
e423eca6 JP |
733 | .IP \fBmod_tp_src\fB:\fIport\fR |
734 | Sets the TCP or UDP source port to \fIport\fR. | |
a9b4a41a | 735 | . |
e423eca6 JP |
736 | .IP \fBmod_tp_dst\fB:\fIport\fR |
737 | Sets the TCP or UDP destination port to \fIport\fR. | |
a9b4a41a | 738 | . |
959a2ecd JP |
739 | .IP \fBmod_nw_tos\fB:\fItos\fR |
740 | Sets the IP ToS/DSCP field to \fItos\fR. Valid values are between 0 and | |
741 | 255, inclusive. Note that the two lower reserved bits are never | |
742 | modified. | |
a9b4a41a | 743 | . |
659586ef JG |
744 | .RE |
745 | .IP | |
746 | The following actions are Nicira vendor extensions that, as of this writing, are | |
747 | only known to be implemented by Open vSwitch: | |
748 | . | |
749 | .RS | |
750 | . | |
3a2fe1f3 | 751 | .IP \fBresubmit\fB:\fIport\fR |
29901626 BP |
752 | .IQ \fBresubmit\fB(\fR[\fIport\fR]\fB,\fR[\fItable\fR]\fB) |
753 | Re-searches this OpenFlow flow table (or the table whose number is | |
754 | specified by \fItable\fR) with the \fBin_port\fR field replaced by | |
755 | \fIport\fR (if \fIport\fR is specified) and executes the actions | |
756 | found, if any, in addition to any other actions in this flow entry. | |
757 | .IP | |
758 | Recursive \fBresubmit\fR actions are obeyed up to an | |
759 | implementation-defined maximum depth. Open vSwitch 1.0.1 and earlier | |
760 | did not support recursion; Open vSwitch before 1.2.90 did not support | |
761 | \fItable\fR. | |
659586ef JG |
762 | . |
763 | .IP \fBset_tunnel\fB:\fIid\fR | |
b9298d3f BP |
764 | .IQ \fBset_tunnel64\fB:\fIid\fR |
765 | If outputting to a port that encapsulates the packet in a tunnel and | |
5a6861aa | 766 | supports an identifier (such as GRE), sets the identifier to \fIid\fR. |
b9298d3f BP |
767 | If the \fBset_tunnel\fR form is used and \fIid\fR fits in 32 bits, |
768 | then this uses an action extension that is supported by Open vSwitch | |
769 | 1.0 and later. Otherwise, if \fIid\fR is a 64-bit value, it requires | |
770 | Open vSwitch 1.1 or later. | |
3a2fe1f3 | 771 | . |
eedc0097 JP |
772 | .IP \fBset_queue\fB:\fIqueue\fR |
773 | Sets the queue that should be used to \fIqueue\fR when packets are | |
774 | output. The number of supported queues depends on the switch; some | |
775 | OpenFlow implementations do not support queuing at all. | |
776 | . | |
777 | .IP \fBpop_queue\fR | |
778 | Restores the queue to the value it was before any \fBset_queue\fR | |
779 | actions were applied. | |
780 | . | |
96fc46e8 BP |
781 | .IP \fBnote:\fR[\fIhh\fR]... |
782 | Does nothing at all. Any number of bytes represented as hex digits | |
783 | \fIhh\fR may be included. Pairs of hex digits may be separated by | |
784 | periods for readability. | |
f393f81e | 785 | . |
5a6861aa | 786 | .IP "\fBmove:\fIsrc\fB[\fIstart\fB..\fIend\fB]\->\fIdst\fB[\fIstart\fB..\fIend\fB]\fR" |
f393f81e BP |
787 | Copies the named bits from field \fIsrc\fR to field \fIdst\fR. |
788 | \fIsrc\fR and \fIdst\fR must be NXM field names as defined in | |
789 | \fBnicira\-ext.h\fR, e.g. \fBNXM_OF_UDP_SRC\fR or \fBNXM_NX_REG0\fR. | |
790 | Each \fIstart\fR and \fIend\fR pair, which are inclusive, must specify | |
791 | the same number of bits and must fit within its respective field. | |
792 | Shorthands for \fB[\fIstart\fB..\fIend\fB]\fR exist: use | |
793 | \fB[\fIbit\fB]\fR to specify a single bit or \fB[]\fR to specify an | |
794 | entire field. | |
795 | .IP | |
796 | Examples: \fBmove:NXM_NX_REG0[0..5]\->NXM_NX_REG1[26..31]\fR copies the | |
797 | six bits numbered 0 through 5, inclusive, in register 0 into bits 26 | |
798 | through 31, inclusive; | |
5a6861aa | 799 | \fBmove:NXM_NX_REG0[0..15]\->NXM_OF_VLAN_TCI[]\fR copies the least |
f393f81e BP |
800 | significant 16 bits of register 0 into the VLAN TCI field. |
801 | . | |
802 | .IP "\fBload:\fIvalue\fB\->\fIdst\fB[\fIstart\fB..\fIend\fB]" | |
803 | Writes \fIvalue\fR to bits \fIstart\fR through \fIend\fR, inclusive, | |
5a6861aa | 804 | in field \fIdst\fR. |
f393f81e BP |
805 | .IP |
806 | Example: \fBload:55\->NXM_NX_REG2[0..5]\fR loads value 55 (bit pattern | |
807 | \fB110111\fR) into bits 0 through 5, inclusive, in register 2. | |
53ddd40a BP |
808 | . |
809 | .IP "\fBmultipath(\fIfields\fB, \fIbasis\fB, \fIalgorithm\fB, \fIn_links\fB, \fIarg\fB, \fIdst\fB[\fIstart\fB..\fIend\fB])\fR" | |
810 | Hashes \fIfields\fR using \fIbasis\fR as a universal hash parameter, | |
811 | then the applies multipath link selection \fIalgorithm\fR (with | |
812 | parameter \fIarg\fR) to choose one of \fIn_links\fR output links | |
813 | numbered 0 through \fIn_links\fR minus 1, and stores the link into | |
43edca57 | 814 | \fIdst\fB[\fIstart\fB..\fIend\fB]\fR, which must be an NXM field as |
53ddd40a BP |
815 | described above. |
816 | .IP | |
817 | Currently, \fIfields\fR must be either \fBeth_src\fR or | |
818 | \fBsymmetric_l4\fR and \fIalgorithm\fR must be one of \fBmodulo_n\fR, | |
819 | \fBhash_threshold\fR, \fBhrw\fR, and \fBiter_hash\fR. Only | |
820 | the \fBiter_hash\fR algorithm uses \fIarg\fR. | |
821 | .IP | |
822 | Refer to \fBnicira\-ext.h\fR for more details. | |
3b6a2571 EJ |
823 | . |
824 | .IP "\fBautopath(\fIid\fB, \fIdst\fB[\fIstart\fB..\fIend\fB])\fR" | |
825 | Given \fIid\fR, chooses an OpenFlow port and populates it in | |
43edca57 | 826 | \fIdst\fB[\fIstart\fB..\fIend\fB]\fR, which must be an NXM field as |
3b6a2571 EJ |
827 | described above. |
828 | .IP | |
829 | Currently, \fIid\fR should be the OpenFlow port number of an interface on the | |
830 | bridge. If it isn't then \fIdst\fB[\fIstart\fB..\fIend\fB]\fR will be | |
831 | populated with the OpenFlow port "none". If \fIid\fR is a member of a bond, | |
832 | the normal bond selection logic will be used to choose the destination port. | |
833 | Otherwise, the register will be populated with \fIid\fR itself. | |
834 | .IP | |
835 | Refer to \fBnicira\-ext.h\fR for more details. | |
daff3353 EJ |
836 | . |
837 | .IP "\fBbundle(\fIfields\fB, \fIbasis\fB, \fIalgorithm\fB, \fIslave_type\fB, slaves:[\fIs1\fB, \fIs2\fB, ...])\fR" | |
838 | Hashes \fIfields\fR using \fIbasis\fR as a universal hash parameter, then | |
839 | applies the bundle link selection \fIalgorithm\fR to choose one of the listed | |
840 | slaves represented as \fIslave_type\fR. Currently the only supported | |
841 | \fIslave_type\fR is \fBofport\fR. Thus, each \fIs1\fR through \fIsN\fR should | |
842 | be an OpenFlow port number. Outputs to the selected slave. | |
843 | .IP | |
844 | Currently, \fIfields\fR must be either \fBeth_src\fR or \fBsymmetric_l4\fR and | |
845 | \fIalgorithm\fR must be one of \fBhrw\fR and \fBactive_backup\fR. | |
846 | .IP | |
847 | Example: \fBbundle(eth_src,0,hrw,ofport,slaves:4,8)\fR uses an Ethernet source | |
848 | hash with basis 0, to select between OpenFlow ports 4 and 8 using the Highest | |
849 | Random Weight algorithm. | |
850 | .IP | |
851 | Refer to \fBnicira\-ext.h\fR for more details. | |
a368bb53 EJ |
852 | . |
853 | .IP "\fBbundle_load(\fIfields\fB, \fIbasis\fB, \fIalgorithm\fB, \fIslave_type\fB, \fIdst\fB[\fIstart\fB..\fIend\fB], slaves:[\fIs1\fB, \fIs2\fB, ...])\fR" | |
854 | Has the same behavior as the \fBbundle\fR action, with one exception. Instead | |
855 | of outputting to the selected slave, it writes its selection to | |
856 | \fIdst\fB[\fIstart\fB..\fIend\fB]\fR, which must be an NXM field as described | |
857 | above. | |
858 | .IP | |
2638c6dc BP |
859 | Example: \fBbundle_load(eth_src, 0, hrw, ofport, NXM_NX_REG0[], |
860 | slaves:4, 8)\fR uses an Ethernet source hash with basis 0, to select | |
861 | between OpenFlow ports 4 and 8 using the Highest Random Weight | |
862 | algorithm, and writes the selection to \fBNXM_NX_REG0[]\fR. | |
a368bb53 EJ |
863 | .IP |
864 | Refer to \fBnicira\-ext.h\fR for more details. | |
75a75043 BP |
865 | . |
866 | .IP "\fBlearn(\fIargument\fR[\fB,\fIargument\fR]...\fB)\fR" | |
867 | This action adds or modifies a flow in an OpenFlow table, similar to | |
868 | \fBovs\-ofctl \-\-strict mod\-flows\fR. The arguments specify the | |
869 | flow's match fields, actions, and other properties, as follows. At | |
870 | least one match criterion and one action argument should ordinarily be | |
871 | specified. | |
872 | .RS | |
873 | .IP \fBidle_timeout=\fIseconds\fR | |
874 | .IQ \fBhard_timeout=\fIseconds\fR | |
875 | .IQ \fBpriority=\fIvalue\fR | |
876 | These key-value pairs have the same meaning as in the usual | |
877 | \fBovs\-ofctl\fR flow syntax. | |
878 | . | |
879 | .IP \fBtable=\fInumber\fR | |
880 | The table in which the new flow should be inserted. Specify a decimal | |
881 | number between 0 and 254. The default, if \fBtable\fR is unspecified, | |
882 | is table 1. | |
883 | . | |
884 | .IP \fIfield\fB=\fIvalue\fR | |
885 | .IQ \fIfield\fB[\fIstart\fB..\fIend\fB]=\fIsrc\fB[\fIstart\fB..\fIend\fB]\fR | |
886 | .IQ \fIfield\fB[\fIstart\fB..\fIend\fB]\fR | |
887 | Adds a match criterion to the new flow. | |
888 | .IP | |
889 | The first form specifies that \fIfield\fR must match the literal | |
890 | \fIvalue\fR, e.g. \fBdl_type=0x0800\fR. All of the fields and values | |
891 | for \fBovs\-ofctl\fR flow syntax are available with their usual | |
892 | meanings. | |
893 | .IP | |
894 | The second form specifies that \fIfield\fB[\fIstart\fB..\fIend\fB]\fR | |
895 | in the new flow must match \fIsrc\fB[\fIstart\fB..\fIend\fB]\fR taken | |
896 | from the flow currently being processed. | |
897 | .IP | |
898 | The third form is a shorthand for the second form. It specifies that | |
899 | \fIfield\fB[\fIstart\fB..\fIend\fB]\fR in the new flow must match | |
900 | \fIfield\fB[\fIstart\fB..\fIend\fB]\fR taken from the flow currently | |
901 | being processed. | |
902 | . | |
903 | .IP \fBload:\fIvalue\fB\->\fIdst\fB[\fIstart\fB..\fIend\fB] | |
904 | .IQ \fBload:\fIsrc\fB[\fIstart\fB..\fIend\fB]\->\fIdst\fB[\fIstart\fB..\fIend\fB] | |
905 | . | |
906 | Adds a \fBload\fR action to the new flow. | |
907 | .IP | |
908 | The first form loads the literal \fIvalue\fR into bits \fIstart\fR | |
909 | through \fIend\fR, inclusive, in field \fIdst\fR. Its syntax is the | |
910 | same as the \fBload\fR action described earlier in this section. | |
911 | .IP | |
912 | The second form loads \fIsrc\fB[\fIstart\fB..\fIend\fB]\fR, a value | |
913 | from the flow currently being processed, into bits \fIstart\fR | |
914 | through \fIend\fR, inclusive, in field \fIdst\fR. | |
915 | . | |
916 | .IP \fBoutput:\fIfield\fB[\fIstart\fB..\fIend\fB]\fR | |
917 | Add an \fBoutput\fR action to the new flow's actions, that outputs to | |
918 | the OpenFlow port taken from \fIfield\fB[\fIstart\fB..\fIend\fB]\fR, | |
919 | which must be an NXM field as described above. | |
920 | .RE | |
921 | .IP | |
922 | For best performance, segregate learned flows into a table (using | |
923 | \fBtable=\fInumber\fR) that is not used for any other flows except | |
924 | possibly for a lowest-priority ``catch-all'' flow, that is, a flow | |
925 | with no match criteria. (This is why the default \fBtable\fR is 1, to | |
926 | keep the learned flows separate from the primary flow table 0.) | |
064af421 | 927 | .RE |
a9b4a41a | 928 | . |
848e8809 EJ |
929 | .IP "\fBexit\fR" |
930 | This action causes Open vSwitch to immediately halt execution of further | |
931 | actions. Those actions which have already been executed are unaffected. Any | |
932 | further actions, including those which may be in other tables, or different | |
933 | levels of the \fBresubmit\fR call stack, are ignored. | |
934 | . | |
064af421 | 935 | .PP |
8cce2125 JP |
936 | The \fBadd\-flow\fR, \fBadd\-flows\fR, and \fBmod\-flows\fR commands |
937 | support an additional optional field: | |
938 | . | |
939 | .IP \fBcookie=\fIvalue\fR | |
940 | . | |
941 | A cookie is an opaque identifier that can be associated with the flow. | |
942 | \fIvalue\fR can be any 64-bit number and need not be unique among | |
c821124b BP |
943 | flows. If this field is omitted, these commands set a default cookie |
944 | value of 0. | |
8cce2125 JP |
945 | . |
946 | .PP | |
4b6b46ce BP |
947 | The following additional field sets the priority for flows added by |
948 | the \fBadd\-flow\fR and \fBadd\-flows\fR commands. For | |
949 | \fBmod\-flows\fR and \fBdel\-flows\fR when \fB\-\-strict\fR is | |
950 | specified, priority must match along with the rest of the flow | |
c821124b | 951 | specification. Other commands do not allow priority to be specified. |
a9b4a41a | 952 | . |
064af421 BP |
953 | .IP \fBpriority=\fIvalue\fR |
954 | The priority at which a wildcarded entry will match in comparison to | |
955 | others. \fIvalue\fR is a number between 0 and 65535, inclusive. A higher | |
956 | \fIvalue\fR will match before a lower one. An exact-match entry will always | |
957 | have priority over an entry containing wildcards, so it has an implicit | |
958 | priority value of 65535. When adding a flow, if the field is not specified, | |
959 | the flow's priority will default to 32768. | |
a9b4a41a | 960 | . |
064af421 | 961 | .PP |
4e312e69 | 962 | The \fBadd\-flow\fR and \fBadd\-flows\fR commands support additional |
064af421 | 963 | optional fields: |
a9b4a41a | 964 | . |
064af421 BP |
965 | .TP |
966 | \fBidle_timeout=\fIseconds\fR | |
967 | Causes the flow to expire after the given number of seconds of | |
a1545337 BP |
968 | inactivity. A value of 0 (the default) prevents a flow from expiring due to |
969 | inactivity. | |
a9b4a41a | 970 | . |
064af421 BP |
971 | .IP \fBhard_timeout=\fIseconds\fR |
972 | Causes the flow to expire after the given number of seconds, | |
973 | regardless of activity. A value of 0 (the default) gives the flow no | |
974 | hard expiration deadline. | |
a9b4a41a | 975 | . |
064af421 | 976 | .PP |
4e312e69 BP |
977 | The \fBdump\-flows\fR, \fBdump\-aggregate\fR, \fBdel\-flow\fR |
978 | and \fBdel\-flows\fR commands support one additional optional field: | |
a9b4a41a | 979 | . |
064af421 BP |
980 | .TP |
981 | \fBout_port=\fIport\fR | |
982 | If set, a matching flow must include an output action to \fIport\fR. | |
a9b4a41a | 983 | . |
064af421 | 984 | .SS "Table Entry Output" |
a9b4a41a | 985 | . |
4e312e69 | 986 | The \fBdump\-tables\fR and \fBdump\-aggregate\fR commands print information |
064af421 BP |
987 | about the entries in a datapath's tables. Each line of output is a |
988 | unique flow entry, which begins with some common information: | |
a9b4a41a | 989 | . |
064af421 BP |
990 | .IP \fBduration\fR |
991 | The number of seconds the entry has been in the table. | |
a9b4a41a | 992 | . |
064af421 BP |
993 | .IP \fBtable_id\fR |
994 | The table that contains the flow. When a packet arrives, the switch | |
995 | begins searching for an entry at the lowest numbered table. Tables are | |
4e312e69 | 996 | numbered as shown by the \fBdump\-tables\fR command. |
a9b4a41a | 997 | . |
064af421 BP |
998 | .IP \fBpriority\fR |
999 | The priority of the entry in relation to other entries within the same | |
1000 | table. A higher value will match before a lower one. | |
a9b4a41a | 1001 | . |
064af421 BP |
1002 | .IP \fBn_packets\fR |
1003 | The number of packets that have matched the entry. | |
a9b4a41a | 1004 | . |
064af421 BP |
1005 | .IP \fBn_bytes\fR |
1006 | The total number of bytes from packets that have matched the entry. | |
a9b4a41a | 1007 | . |
064af421 BP |
1008 | .PP |
1009 | The rest of the line consists of a description of the flow entry as | |
1010 | described in \fBFlow Syntax\fR, above. | |
a9b4a41a BP |
1011 | . |
1012 | . | |
064af421 BP |
1013 | .SH OPTIONS |
1014 | .TP | |
4e312e69 | 1015 | \fB\-\-strict\fR |
064af421 | 1016 | Uses strict matching when running flow modification commands. |
a9b4a41a | 1017 | . |
88ca35ee BP |
1018 | .IP "\fB\-F \fIformat\fR" |
1019 | .IQ "\fB\-\-flow\-format=\fIformat\fR" | |
1020 | \fBovs\-ofctl\fR supports the following flow formats, in order of | |
1021 | increasing capability: | |
1022 | .RS | |
1023 | .IP "\fBopenflow10\fR" | |
1024 | This is the standard OpenFlow 1.0 flow format. It should be supported | |
1025 | by all OpenFlow switches. | |
1026 | . | |
88ca35ee BP |
1027 | .IP "\fBnxm\fR (Nicira Extended Match)" |
1028 | This Nicira extension to OpenFlow is flexible and extensible. It | |
1029 | supports all of the Nicira flow extensions, such as \fBtun_id\fR and | |
1030 | registers. | |
1031 | .RE | |
1032 | .IP | |
1033 | Usually, \fBovs\-ofctl\fR picks the correct format automatically. For | |
1034 | commands that modify the flow table, \fBovs\-ofctl\fR by default uses | |
1035 | the most widely supported flow format that supports the flows being | |
1036 | added. For commands that query the flow table, \fBovs\-ofctl\fR by | |
1037 | default queries and uses the most advanced format supported by the | |
1038 | switch. | |
1039 | .IP | |
1040 | This option, where \fIformat\fR is one of the formats listed in the | |
1041 | above table, overrides \fBovs\-ofctl\fR's default choice of flow | |
1042 | format. If a command cannot work as requested using the requested | |
1043 | flow format, \fBovs\-ofctl\fR will report a fatal error. | |
4f564f8d BP |
1044 | . |
1045 | .IP "\fB\-m\fR" | |
1046 | .IQ "\fB\-\-more\fR" | |
1047 | Increases the verbosity of OpenFlow messages printed and logged by | |
1048 | \fBovs\-ofctl\fR commands. Specify this option more than once to | |
1049 | increase verbosity further. | |
ac300505 | 1050 | .SS "Public Key Infrastructure Options" |
84ee7bcf | 1051 | .so lib/ssl.man |
064af421 BP |
1052 | .so lib/vlog.man |
1053 | .so lib/common.man | |
a9b4a41a | 1054 | . |
064af421 | 1055 | .SH EXAMPLES |
a9b4a41a | 1056 | . |
045b2e5c BP |
1057 | The following examples assume that \fBovs\-vswitchd\fR has a bridge |
1058 | named \fBbr0\fR configured. | |
a9b4a41a | 1059 | . |
064af421 | 1060 | .TP |
045b2e5c | 1061 | \fBovs\-ofctl dump\-tables br0\fR |
064af421 BP |
1062 | Prints out the switch's table stats. (This is more interesting after |
1063 | some traffic has passed through.) | |
a9b4a41a | 1064 | . |
064af421 | 1065 | .TP |
045b2e5c | 1066 | \fBovs\-ofctl dump\-flows br0\fR |
064af421 | 1067 | Prints the flow entries in the switch. |
a9b4a41a | 1068 | . |
064af421 | 1069 | .SH "SEE ALSO" |
a9b4a41a | 1070 | . |
064af421 BP |
1071 | .BR ovs\-appctl (8), |
1072 | .BR ovs\-controller (8), | |
1073 | .BR ovs\-vswitchd (8) |