fcca9810b22156a8333474fd991c3cc935627214
[sliver-openvswitch.git] / utilities / ovs-openflowd.8.in
1 .TH ovs\-openflowd 8 "March 2009" "Open vSwitch" "Open vSwitch Manual"
2 .\" This program's name:
3 .ds PN ovs\-openflowd
4 .\" SSL peer program's name:
5 .ds SN ovs\-controller
6 .
7 .SH NAME
8 ovs\-openflowd \- OpenFlow switch implementation
9 .
10 .SH SYNOPSIS
11 .B ovs\-openflowd
12 [\fIoptions\fR] \fIdatapath\fR [\fIcontroller\fR\&...]
13 .
14 .SH DESCRIPTION
15 The \fBovs\-openflowd\fR program implements an OpenFlow switch using a
16 flow-based datapath.  \fBovs\-openflowd\fR connects to one or more
17 OpenFlow controllers over TCP or SSL.
18 .PP
19 For a more powerful alternative to \fBovs\-openflowd\fR, see
20 \fBovs\-vswitchd\fR(8).  Do not run both daemons at the same time.
21 .PP
22 The mandatory \fIdatapath\fR argument argument specifies the local datapath
23 to relay.  It takes one of the following forms:
24 .
25 .so lib/dpif.man
26 .
27 .PP
28 The optional \fIcontroller\fR arguments specify how to connect to the
29 OpenFlow controller or controllers.  Each takes one of the following
30 forms:
31 .
32 .so lib/vconn-active.man
33 .IP "\fBnone\fR"
34 Run without actively maintaining a connection to a remote OpenFlow
35 controller.  (See the \fB\-\-listen\fR option, under \fBNetworking
36 Options\fR below, for another way to make OpenFlow connections to the
37 switch.)
38 .
39 .PP
40 When multiple controllers are configured, \fBovs\-openflowd\fR
41 connects to all of them simultaneously.  OpenFlow 1.0 does not specify
42 how multiple controllers coordinate in interacting with a single
43 switch, so more than one controller should be specified only if the
44 controllers are themselves designed to coordinate with each other.
45 (The Nicira-defined \fBNXT_ROLE\fR OpenFlow vendor extension may be
46 useful for this.)
47 .PP
48 If no \fIcontroller\fR is specified, \fBovs\-openflowd\fR attempts to
49 discover the location of a controller automatically (see below).
50 .
51 .SS "Contacting Controllers"
52 The OpenFlow switch must be able to contact the OpenFlow controllers
53 over the network.  It can do so in one of two ways:
54 .
55 .IP out-of-band
56 In this configuration, OpenFlow traffic uses a network separate from
57 the data traffic that it controls, that is, the switch does not use
58 any of the network devices added to the datapath with \fBovs\-dpctl
59 add\-if\fR in its communication with the controller.
60 .IP
61 To use \fBovs\-openflowd\fR in a network with out-of-band control, specify
62 \fB\-\-out\-of\-band\fR on the \fBovs\-openflowd\fR command line.  The control
63 network must be configured separately, before or after \fBovs\-openflowd\fR
64 is started.
65 .
66 .IP in-band
67 In this configuration, a single network is used for OpenFlow traffic
68 and other data traffic, that is, the switch contacts the controller
69 over one of the network devices added to the datapath with \fBovs\-dpctl
70 add\-if\fR.  This configuration is often more convenient than
71 out-of-band control, because it is not necessary to maintain two
72 independent networks.
73 .IP
74 In-band control is the default for \fBovs\-openflowd\fR, so no special
75 command-line option is required.
76 .IP
77 With in-band control, the location of the controller can be configured
78 manually or discovered automatically:
79 .
80 .RS
81 .IP "controller discovery"
82 To make \fBovs\-openflowd\fR discover the location of the controller
83 automatically, do not specify a controller on the \fBovs\-openflowd\fR
84 command line.
85 .IP
86 In this mode, \fBovs\-openflowd\fR will broadcast a DHCP request with vendor
87 class identifier \fBOpenFlow\fR across the network devices added to
88 the datapath with \fBovs\-dpctl add\-if\fR.  It will accept any valid DHCP
89 reply that has the same vendor class identifier and includes a
90 vendor-specific option with code 1 whose contents are a string
91 specifying the location of the controller in the same format used on
92 the \fBovs\-openflowd\fR command line (e.g. \fBssl:192.168.0.1\fR).
93 .IP
94 The DHCP reply may also, optionally, include a vendor-specific option
95 with code 2 whose contents are a string specifying the URI to the base
96 of the OpenFlow PKI (e.g. \fBhttp://192.168.0.1/openflow/pki\fR).
97 This URI is used only for bootstrapping the OpenFlow PKI at initial
98 switch setup; \fBovs\-openflowd\fR does not use it at all.
99 .IP
100 The following ISC DHCP server configuration file assigns the IP
101 address range 192.168.0.20 through 192.168.0.30 to OpenFlow switches
102 that follow the switch protocol and addresses 192.168.0.1 through
103 192.168.0.10 to all other DHCP clients:
104 .IP
105 default\-lease\-time 600;
106 .br
107 max\-lease\-time 7200;
108 .br
109 option space openflow;
110 .br
111 option openflow.controller\-vconn code 1 = text;
112 .br
113 option openflow.pki\-uri code 2 = text;
114 .br
115 class "OpenFlow" {
116 .br
117   match if option vendor\-class\-identifier = "OpenFlow";
118 .br
119   vendor\-option\-space openflow;
120 .br
121   option openflow.controller\-vconn "tcp:192.168.0.10";
122 .br
123   option openflow.pki\-uri "http://192.168.0.10/openflow/pki";
124 .br
125   option vendor\-class\-identifier "OpenFlow";
126 .br
127 }
128 .br
129 subnet 192.168.0.0 netmask 255.255.255.0 {
130 .br
131     pool {
132 .br
133         allow members of "OpenFlow";
134 .br
135         range 192.168.0.20 192.168.0.30;
136 .br
137     }
138 .br
139     pool {
140 .br
141         deny members of "OpenFlow";
142 .br
143         range 192.168.0.1 192.168.0.10;
144 .br
145     }
146 .br
147 }
148 .br
149 .
150 .IP "manual configuration"
151 To configure in-band control manually, specify the location of the
152 controller on the \fBovs\-openflowd\fR command line as the \fIcontroller\fR
153 argument.  You must also configure the network device for the OpenFlow
154 ``local port'' to allow \fBovs\-openflowd\fR to connect to that controller.
155 The OpenFlow local port is a virtual network port that \fBovs\-openflowd\fR
156 bridges to the physical switch ports.  The name of the local port for
157 a given \fIdatapath\fR may be seen by running \fBovs\-dpctl show
158 \fIdatapath\fR; the local port is listed as port 0 in \fBshow\fR's
159 output.
160 .
161 .IP
162 Before \fBovs\-openflowd\fR starts, the local port network device is not
163 bridged to any physical network, so the next step depends on whether
164 connectivity is required to configure the device's IP address.  If the
165 switch has a static IP address, you may configure its IP address now
166 with a command such as 
167 .B ifconfig of0 192.168.1.1
168 and then invoke \fBovs\-openflowd\fR.
169 .IP
170 On the other hand, if the switch does not have a static IP address,
171 e.g. it obtains its IP address dynamically via DHCP, the DHCP client
172 will not be able to contact the DHCP server until the OpenFlow switch
173 has started up.  Thus, start \fBovs\-openflowd\fR without configuring
174 the local port network device, and start the DHCP client afterward.
175 .RE
176 .
177 .SH OPTIONS
178 .SS "OpenFlow Options"
179 .TP
180 \fB\-\-datapath\-id=\fIdpid\fR
181 Sets \fIdpid\fR, which must consist of exactly 16 hexadecimal digits
182 and may not be all-zero,
183 as the datapath ID that the switch will use to identify itself to
184 OpenFlow controllers.
185 .IP
186 If this option is omitted, the default datapath ID is taken from the
187 Ethernet address of the datapath's local port (which is typically
188 randomly generated) in the lower 48 bits and zeros in the upper 16.
189 .
190 .TP
191 \fB\-\-mfr\-desc=\fIdesc\fR
192 Set the description of the switch's manufacturer to \fIdesc\fR, which
193 may contain up to 255 ASCII characters.
194 .
195 .TP
196 \fB\-\-hw\-desc=\fIdesc\fR
197 Set the description of the switch's hardware revision to \fIdesc\fR, which
198 may contain up to 255 ASCII characters.
199 .
200 .TP
201 \fB\-\-sw\-desc=\fIdesc\fR
202 Set the description of the switch's software revision to \fIdesc\fR, which
203 may contain up to 255 ASCII characters.
204 .
205 .TP
206 \fB\-\-serial\-desc=\fIdesc\fR
207 Set the description of the switch's serial number to \fIdesc\fR, which
208 may contain up to 31 ASCII characters.
209 .
210 .TP
211 \fB\-\-dp\-desc=\fIdesc\fR
212 Set the description of the datapath to \fIdesc\fR, which may contain up to
213 255 ASCII characters.  Note that this field is intended for debugging
214 purposes and is not guaranteed to be unique and should not be used as
215 the primary identifier of the datapath.
216 .
217 .SS "Controller Discovery Options"
218 .TP
219 \fB\-\-accept\-vconn=\fIregex\fR
220 When \fBovs\-openflowd\fR performs controller discovery (see \fBContacting
221 the Controller\fR, above, for more information about controller
222 discovery), it validates the controller location obtained via DHCP
223 with a POSIX extended regular expression.  Only controllers whose
224 names match the regular expression will be accepted.
225 .IP
226 The default regular expression is \fBssl:.*\fR (meaning that only SSL
227 controller connections will be accepted) when any of the SSL
228 configuration options \fB\-\-private\-key\fR, \fB\-\-certificate\fR, or
229 \fB\-\-ca\-cert\fR is specified.  The default is \fB^tcp:.*\fR otherwise
230 (meaning that only TCP controller connections will be accepted).
231 .IP
232 The \fIregex\fR is implicitly anchored at the beginning of the
233 controller location string, as if it begins with \fB^\fR.
234 .IP
235 When controller discovery is not performed, this option has no effect.
236 .
237 .TP
238 \fB\-\-no\-resolv\-conf\fR
239 When \fBovs\-openflowd\fR performs controller discovery (see \fBContacting
240 the Controller\fR, above, for more information about controller
241 discovery), by default it overwrites the system's
242 \fB/etc/resolv.conf\fR with domain information and DNS servers
243 obtained via DHCP.  If the location of the controller is specified
244 using a hostname, rather than an IP address, and the network's DNS
245 servers ever change, this behavior is essential.  But because it also
246 interferes with any administrator or process that manages
247 \fB/etc/resolv.conf\fR, when this option is specified, \fBovs\-openflowd\fR
248 will not modify \fB/etc/resolv.conf\fR.
249 .IP
250 \fBovs\-openflowd\fR will only modify \fBresolv.conf\fR if the DHCP response
251 that it receives specifies one or more DNS servers.
252 .IP
253 When controller discovery is not performed, this option has no effect.
254 .
255 .SS "Networking Options"
256 .TP
257 \fB\-\-datapath\-id=\fIdpid\fR
258 Sets \fIdpid\fR, which must consist of exactly 16 hexadecimal digits,
259 as the datapath ID that the switch will use to identify itself to the
260 OpenFlow controller.
261 .IP
262 If this option is omitted, the default datapath ID is taken from the
263 Ethernet address of the datapath's local port (which is typically
264 randomly generated) in the lower 48 bits and zeros in the upper 16.
265 .
266 .TP
267 \fB\-\-fail=\fR[\fBstandalone\fR|\fBsecure\fR]
268 The controller is, ordinarily, responsible for setting up all flows on
269 the OpenFlow switch.  Thus, if the connection to the controller fails,
270 no new network connections can be set up.  If the connection to the
271 controller stays down long enough, no packets can pass through the
272 switch at all.
273 .IP
274 If this option is set to \fBstandalone\fR (the default),
275 \fBovs\-openflowd\fR will
276 take over responsibility for setting up flows in the local datapath
277 when no message has been received from the controller for three times
278 the inactivity probe interval (see below), or 45 seconds by default.
279 In this ``fail open'' mode, \fBovs\-openflowd\fR causes the datapath to act
280 like an ordinary MAC-learning switch.  \fBovs\-openflowd\fR will continue to
281 retry connection to the controller in the background and, when the
282 connection succeeds, it discontinues its standalone switching behavior.
283 .IP
284 If this option is set to \fBsecure\fR, then \fBovs\-openflowd\fR will not
285 set up flows on its own when the controller connection fails.
286 .
287 .TP
288 \fB\-\-inactivity\-probe=\fIsecs\fR
289 When the OpenFlow switch is connected to the controller, the
290 switch waits for a message to be received from the controller for
291 \fIsecs\fR seconds before it sends a inactivity probe to the
292 controller.  After sending the inactivity probe, if no response is
293 received for an additional \fIsecs\fR seconds, the switch
294 assumes that the connection has been broken and attempts to reconnect.
295 The default and the minimum value are both 5 seconds.
296 .IP
297 When fail-open mode is configured, changing the inactivity probe
298 interval also changes the interval before entering fail-open mode (see
299 above).
300 .
301 .TP
302 \fB\-\-max\-idle=\fIsecs\fR|\fBpermanent\fR
303 Sets \fIsecs\fR as the number of seconds that a flow set up by the
304 OpenFlow switch will remain in the switch's flow table without any
305 matching packets being seen.  If \fBpermanent\fR is specified, which
306 is not recommended, flows set up by the switch will never
307 expire.  The default is 15 seconds.
308 .IP
309 Most flows are set up by the OpenFlow controller, not by the
310 switch.  This option affects only the following flows, which the
311 OpenFlow switch sets up itself:
312 .
313 .RS
314 .IP \(bu
315 When \fB\-\-fail=open\fR is specified, flows set up when the
316 switch has not been able to contact the controller for the configured
317 fail-open delay.
318 .
319 .IP \(bu
320 When in-band control is in use, flows set up to bootstrap contacting
321 the controller (see \fBContacting the Controller\fR, above, for
322 more information about in-band control).
323 .RE
324 .
325 .IP
326 As a result, when both \fB\-\-fail=secure\fR and \fB\-\-out\-of\-band\fR are
327 specified, this option has no effect.
328 .
329 .TP
330 \fB\-\-max\-backoff=\fIsecs\fR
331 Sets the maximum time between attempts to connect to the controller to
332 \fIsecs\fR, which must be at least 1.  The actual interval between
333 connection attempts starts at 1 second and doubles on each failing
334 attempt until it reaches the maximum.  The default maximum backoff
335 time is 8 seconds.
336 .
337 .TP
338 \fB\-l\fR, \fB\-\-listen=\fImethod\fR
339 By default, the switch listens for OpenFlow management connections on a
340 Unix domain socket named \fB@RUNDIR@/\fIdatapath\fB.mgmt\fR.  This socket 
341 can be used to perform local OpenFlow monitoring and administration with
342 tools such as \fBovs\-ofctl\fR.  
343 .IP
344 This option may be used to override the default listener.  The \fImethod\fR
345 must be given as one of the passive OpenFlow connection methods listed
346 below.  This option may be specified multiple times to listen to
347 multiple connection methods.  If a single \fImethod\fR of \fBnone\fR is
348 used, no listeners will be created.
349 .
350 .RS
351 .so lib/vconn-passive.man
352 .RE
353 .
354 .TP
355 \fB\-\-snoop=\fImethod\fR
356 Configures the switch to additionally listen for incoming OpenFlow
357 connections for controller connection snooping.  The \fImethod\fR must
358 be given as one of the passive OpenFlow connection methods listed
359 under the \fB\-\-listen\fR option above.  This option may be specified
360 multiple times to listen to multiple connection methods.
361 .IP
362 If \fBovs\-ofctl monitor\fR is used to connect to \fImethod\fR specified on
363 \fB\-\-snoop\fR, it will display all the OpenFlow messages traveling
364 between the switch and its controller on the primary OpenFlow
365 connection.  This can be useful for debugging switch and controller
366 problems.
367 .
368 .TP
369 \fB\-\-in\-band\fR, \fB\-\-out\-of\-band\fR
370 Configures \fBovs\-openflowd\fR to operate in in-band or out-of-band control
371 mode (see \fBContacting the Controller\fR above).  When neither option
372 is given, the default is in-band control.
373 .
374 .TP
375 \fB\-\-netflow=\fIip\fB:\fIport\fR
376 Configures the given UDP \fIport\fR on the specified IP \fIip\fR as
377 a recipient of NetFlow messages for expired flows.  The \fIip\fR must
378 be specified numerically, not as a DNS name.
379 .IP
380 This option may be specified multiple times to configure additional
381 NetFlow collectors.
382 .
383 .SS "Rate-Limiting Options"
384 .
385 These options configure how the switch applies a ``token bucket'' to
386 limit the rate at which packets in unknown flows are forwarded to an
387 OpenFlow controller for flow-setup processing.  This feature prevents
388 a single OpenFlow switch from overwhelming a controller.
389 .
390 .TP
391 \fB\-\-rate\-limit\fR[\fB=\fIrate\fR]
392 .
393 Limits the maximum rate at which packets will be forwarded to the
394 OpenFlow controller to \fIrate\fR packets per second.  If \fIrate\fR
395 is not specified then the default of 1,000 packets per second is used.
396 .IP
397 If \fB\-\-rate\-limit\fR is not used, then the switch does not limit the
398 rate at which packets are forwarded to the controller.
399 .
400 .TP
401 \fB\-\-burst\-limit=\fIburst\fR
402 .
403 Sets the maximum number of unused packet credits that the switch will
404 allow to accumulate during time in which no packets are being
405 forwarded to the OpenFlow controller to \fIburst\fR (measured in
406 packets).  The default \fIburst\fR is one-quarter of the \fIrate\fR
407 specified on \fB\-\-rate\-limit\fR.
408 .
409 This option takes effect only when \fB\-\-rate\-limit\fR is also specified.
410 .
411 .SS "Datapath Options"
412 .
413 .IP "\fB\-\-ports=\fIport\fR[\fB,\fIport\fR...]"
414 Ordinarily, \fBovs\-openflowd\fR expects the administrator to create
415 the specified \fIdatapath\fR and add ports to it externally with a
416 utility such as \fBovs\-dpctl\fR.  However, the userspace switch
417 datapath is implemented inside \fBovs\-openflowd\fR itself and does
418 not (currently) have any external interface for \fBovs\-dpctl\fR to
419 access.  As a stopgap measure, this option specifies one or more ports
420 to add to the datapath at \fBovs\-openflowd\fR startup time.  Multiple
421 ports may be specified as a comma-separated list or by specifying
422 \fB\-\-ports\fR multiple times.
423 .IP
424 See \fBINSTALL.userspace\fR for more information about userspace
425 switching.
426 .
427 .SS "Daemon Options"
428 .so lib/daemon.man
429 .
430 .SS "Public Key Infrastructure Options"
431 .so lib/ssl.man
432 .so lib/ssl-bootstrap.man
433 .
434 .SS "Logging Options"
435 .so lib/vlog.man
436 .SS "Other Options"
437 .so lib/unixctl.man
438 .so lib/common.man
439 .so lib/leak-checker.man
440 .
441 .SH "RUNTIME MANAGEMENT COMMANDS"
442 \fBovs\-appctl\fR(8) can send commands to a running
443 \fBovs\-openflowd\fR process.  The currently supported commands are
444 described below.
445 .SS "OVS\-OPENFLOWD COMMANDS"
446 These commands are specific to \fBovs\-openflowd\fR.
447 .IP "\fBexit\fR"
448 Causes \fBovs\-openflowd\fR to gracefully terminate.
449 .so lib/vlog-unixctl.man
450 .
451 .SH "SEE ALSO"
452 .
453 .BR ovs\-appctl (8),
454 .BR ovs\-controller (8),
455 .BR ovs\-discover (8),
456 .BR ovs\-dpctl (8),
457 .BR ovs\-ofctl (8),
458 .BR ovs\-pki (8)