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