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