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