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