sflow: Write "sFlow" as "sFlow(R)" in documentation.
[sliver-openvswitch.git] / vswitchd / ovs-vswitchd.conf.5.in
1 .\" -*- nroff -*-
2 .de TQ
3 .  br
4 .  ns
5 .  TP "\\$1"
6 ..
7 .de IQ
8 .  br
9 .  ns
10 .  IP "\\$1"
11 ..
12 .de ST
13 .  PP
14 .  RS -0.15in
15 .  I "\\$1"
16 .  RE
17 .  PP
18 ..
19 .TH ovs\-vswitchd.conf 5 "June 2009" "Open vSwitch" "Open vSwitch Manual"
20 .
21 .SH NAME
22 ovs\-vswitchd.conf \- configuration file for \fBovs\-vswitchd\fR
23 .
24 .SH DESCRIPTION
25 This manual page explains how to configure \fBovs\-vswitchd\fR, the
26 Open vSwitch virtual switch daemon.  Refer to \fBovs\-vswitchd\fR(8)
27 for instructions on how to start, stop, and control the virtual switch
28 daemon and for an overview of its features.
29 .SS "Overview"
30 \fBovs\-vswitchd\fR configuration is hierarchical.
31 .ST "Global Configuration"
32 A few aspects of configuration apply to the entire \fBovs\-vswitchd\fR
33 process:
34 .IP \(bu
35 Remote management (see \fBRemote Management\fR below).
36 .IP \(bu
37 SSL key and certificate configuration (see \fBSSL Configuration\fR
38 below).
39 .ST "Bridge Configuration"
40 \fBovs\-vswitchd\fR manages one or more ``bridges.''  A bridge is,
41 conceptually, an Ethernet switch.  Properties configurable at the
42 bridge level include:
43 .
44 .IP \(bu
45 The set of bridge ports (see \fBBridge Configuration\fR below).
46 .IP \(bu
47 Mirroring of packets across ports and VLANs (see \fBPort mirroring
48 (SPAN and RSPAN)\fR below).
49 .IP \(bu
50 Flow logging via NetFlow (see \fBNetFlow v5 Flow Logging\fR below).
51 .IP \(bu
52 Connectivity to an OpenFlow controller (see \fBOpenFlow Controller
53 Connectivity\fR below).
54 .IP \(bu
55 Addresses on which to listen for OpenFlow management connections (see
56 \fBOpenFlow Management Connections\fR below) or for snooping on the
57 connection to the primary OpenFlow controller (see \fBOpenFlow
58 Controller Connection Snooping\fR below).
59 .PP
60 .ST "Port Configuration"
61 Each bridge has one or more ``ports.''  The main configurable property
62 of a port is its 802.1Q VLAN configuration (see \fB802.1Q VLAN
63 support\fR below).
64 .PP
65 Most commonly, a port has exactly one ``interface.''  Such a port
66 logically corresponds to a port on a physical Ethernet switch.
67 .PP
68 A port that has more than one interface is a ``bonded port.''  Bonding
69 allows for load balancing and fail-over (see \fBNetwork Device
70 Bonding\fR below).
71 .ST "Interface Configuration"
72 There are two different kinds of interfaces:
73 .IP "``external interfaces''"
74 These interfaces are ordinary network devices, e.g. \fBeth0\fR on
75 Linux.
76 .IP "``internal interfaces''"
77 These interfaces are simulated network device that sent and receive
78 traffic.  Every bridge has one internal interface called the ``local
79 interface'' and may also have additional internal interfaces.  It does
80 not make sense to bond an internal interface, so the terms ``port''
81 and ``interface'' are often used imprecisely for internal interfaces.
82 .PP
83 Interfaces have a few configurable properties of their own:
84 .IP \(bu
85 Ingress rate-limiting (see \fBInterface Rate-Limiting\fR below).
86 .IP \(bu
87 Ethernet address (internal interfaces only, see \fBBridge
88 Configuration\fR below).
89 .SS "Configuration File Syntax"
90 The \fBovs\-vswitchd\fR configuration file syntax is based on
91 key-value pairs, which are given
92 one per line in the form \fIkey\fB=\fIvalue\fR.  Each \fIkey\fR
93 consists of one or more parts separated by dots,
94 e.g. \fIpart1\fB.\fIpart2\fB.\fIpart3\fR.  Each \fIpart\fR may consist
95 only of the English letters, digits, and the special characters
96 \fB_-@$:+\fR.  White space within \fIvalue\fR  and at the beginning of a
97 line is significant, but is otherwise ignored.
98 .PP
99 If a single key is specified more than once, that key has multiple
100 values, one value for each time the key is specified.  The ordering of
101 key-value pairs, and the ordering of multiple values for a single key,
102 within a configuration file is not significant.
103 .PP
104 Blank lines, lines that consist only of white space, and lines that
105 begin with \fB#\fR (optionally preceded by white space) are ignored.
106 Keep in mind that programs that modify the configuration file, such as 
107 \fBovs\-brcompatd\fR and \fBovs-cfg-mod\fR, may alter the order of
108 elements and 
109 strip comments and blank lines.
110 .PP
111 The following subsections describe how key-value pairs are used to
112 configure \fBovs\-vswitchd\fR.
113 .SS "Bridge Configuration"
114 A bridge (switch) with a given \fIname\fR is configured by specifying
115 the names of its network devices as values for key
116 \fBbridge.\fIname\fB.port\fR.
117 .PP
118 To designate network device \fInetdev\fR as an internal port, add
119 \fBiface.\fInetdev\fB.internal=true\fR to the configuration file,
120 which causes \fBovs\-vswitchd\fR to automatically creates
121 \fInetdev\fR, which may then be configured using the usual system
122 tools (e.g. \fBifconfig\fR, \fBip\fR).  An internal interface by
123 default has a random Ethernet address, but you may configure a
124 specific address by setting \fBiface.\fInetdev\fB.mac\fR to a MAC
125 address in the format
126 \fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fR, where each
127 \fIx\fR is a hex digit.
128 .PP
129 A bridge with a given \fIname\fR always has an internal port with the
130 same \fIname\fR, called the ``local port.''  This network device may
131 be included
132 in the bridge, by specifying it as one of the values for key
133 \fBbridge.\fIname\fB.port\fR, or it may be omitted.  If it is
134 included, then its MAC address is by default the lowest-numbered MAC
135 address among the other bridge ports, ignoring other internal ports
136 and bridge ports that are
137 used as port mirroring destinations (see \fBPort Mirroring\fR, below).
138 For this purpose, the MAC of a bonded port (see \fBNetwork Device
139 Bonding\fR, below) is by default the MAC of its slave whose name is first in
140 alphabetical order.
141 There are two ways to modify this algorithm for selecting the MAC
142 address of the local port:
143 .IP \(bu
144 To use a specific MAC address for the local port, set
145 \fBbridge.\fIname\fB.mac\fR to a MAC address in the format
146 \fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fB:\fIxx\fR, where each
147 \fIx\fR is a hex digit.
148 .IP \(bu
149 To override the MAC of a port for the purpose of this algorithm, set
150 \fBport.\fIport\fB.mac\fR to a MAC address in the format described
151 above.
152 .PP
153 If no valid MAC address can be determined
154 either of these ways, then a MAC address is randomly generated.
155 .PP
156 The following syntax defines a bridge named \fBmybr\fR, configured
157 with network devices \fBeth0\fR, \fBeth1\fR, and \fBeth2\fR:
158 .RS
159 .nf
160
161 bridge.mybr.port=eth0
162 bridge.mybr.port=eth1
163 bridge.mybr.port=eth2
164
165 .fi
166 .RE
167 .SS "802.1Q VLAN support"
168 A bridge port may be configured either as a trunk port or as belonging
169 to a single, untagged VLAN.  These two options are mutually exclusive,
170 and a port must be configured in one way or the other.
171 .ST "Trunk Ports"
172 By default, bridge ports are trunk ports that carry all VLANs.  To
173 limit the VLANs that a trunk port carries, define
174 \fBvlan.\fIport\fB.trunks\fR to one or more integers between 0 and
175 4095 designating VLANs.  Only frames that have an 802.1Q header with
176 one of the listed VLANs are accepted on a trunk port.  If 0 is
177 included in the list, then frames without an 802.1Q header are also
178 accepted.  Other frames are discarded.
179 .PP
180 The following syntax makes network device \fBeth0\fR a trunk port that
181 carries VLANs 1, 2, and 3:
182 .PP
183 .RS
184 .nf
185
186 vlan.eth0.trunks=1
187 vlan.eth0.trunks=2
188 vlan.eth0.trunks=3
189         
190 .fi
191 .RE
192 .ST "Untagged VLAN Ports"
193 A bridge port may be configured with an implicit, untagged VLAN.  
194 Define key
195 \fBvlan.\fIport\fB.tag\fR to an integer value \fIvid\fR between 0 and
196 4095, inclusive, to designate the named \fIport\fR as a member
197 of 802.1Q VLAN \fIvid\fR.  When \fIport\fR is assigned a VLAN tag this
198 way, frames arriving on trunk ports will be forwarded to \fIport\fR
199 only if they are tagged with VLAN \fIvid\fR, and frames arriving on
200 other VLAN ports will be forwarded to \fIport\fR only if their
201 \fIvid\fR values are equal.  Frames forwarded to \fIport\fR will not
202 have an 802.1Q header.
203 .PP
204 When \fIvid\fR is 0, frames arriving on trunk ports without an 802.1Q
205 VLAN header will also be forwarded to \fIport\fR.
206 .PP
207 When a frame with a 802.1Q header that indicates a nonzero VLAN is
208 received on an implicit VLAN port, it is discarded.
209 .PP
210 The following syntax makes network device \fBeth0\fR a member of VLAN
211 101:
212 .PP
213 .RS
214 .nf
215
216 vlan.eth0.tag=101
217         
218 .fi
219 .RE
220 .SS "Network Device Bonding"
221 Bonding allows multiple ``slave'' network devices to be treated as if
222 they were a single virtual ``bonded'' network device.  It is useful for
223 load balancing and fail-over.
224 .PP
225 \fBovs\-vswitchd\fR supports ``source load balancing'' (SLB) bonding, which
226 assigns flows to slaves based on source MAC address, with periodic
227 rebalancing as traffic patterns change.  This form of bonding does not
228 require 802.3ad or other special support from the upstream switch to
229 which the slave devices are connected.
230 .PP
231 To configure bonding, create a virtual bonding device by specifying
232 the slave network device names as values for
233 \fBbonding.\fIname\fB.slave\fR, then specify \fIname\fR as a bridge
234 port.  The chosen \fIname\fR should not be the name of any real
235 network device on the host system.
236 .PP
237 By default, bonding interfaces are enabled or disabled immediately
238 when a carrier is detected or dropped on the underlying network
239 device.  To insert a delay when carrier comes up or goes down before
240 enabling or disabling an interface, set the value of
241 \fBbonding.\fIname\fB.updelay\fR or
242 \fBbonding.\fIname\fB.downdelay\fR, respectively, to a positive
243 integer, interpreted in milliseconds.
244 The \fBupdelay\fR setting is honored only when at least one bonded
245 interface is already enabled.  When no interfaces are enabled, then
246 the first bond interface to come up is enabled immediately.  The
247 \fBdowndelay\fR setting is always honored.
248 .PP
249 The following syntax bonds \fBeth0\fR and \fBeth1\fR into a bonding
250 device named \fBbond0\fR, which is added to bridge \fBmybr\fR along
251 with physical network devices \fBeth2\fR and \fBeth3\fR:
252 .PP
253 .RS
254 .nf
255
256 bridge.mybr.port=bond0
257 bridge.mybr.port=eth2
258 bridge.mybr.port=eth3
259
260 bonding.bond0.slave=eth0
261 bonding.bond0.slave=eth1
262         
263 .fi
264 .RE
265 .SS "Port Mirroring (SPAN and RSPAN)"
266 \fBovs\-vswitchd\fR may be configured to send selected frames to special
267 ``mirrored'' ports, in addition to their normal destinations.  Mirroring
268 traffic may also be referred to as SPAN or RSPAN, depending on the
269 mechanism used for delivery.
270 .PP
271 Up to 32 instances of port mirroring may be configured on a given
272 bridge.  Each must be given a name that is unique within the bridge.
273 The keys associated with port mirroring instance \fIpmname\fR for
274 bridge \fIbrname\fR begin with \fBmirror.\fIbrname\fB.\fIpmname\fR.
275 .PP
276 The selection of the frames to mirror and the form in which they
277 should be output is configured separately for each port mirroring
278 instances, through a subsection of
279 \fBmirror.\fIbrname\fB.\fIpmname\fR, named \fBselect\fR, and
280 \fBoutput\fR, respectively.
281 .ST "Selecting Frames to Mirror"
282 The values for the following keys, if specified, limit the frames that
283 are chosen for mirroring.  If none of these keys is specified, then
284 all frames received by the bridge are mirrored.  If more than one of
285 these keys is specified, then a frame must meet all specified criteria
286 to be mirrored.
287 .TP
288 \fBmirror.\fIbrname\fB.\fIpmname\fB.select.src-port=\fIport\fR
289 .TQ
290 \fBmirror.\fIbrname\fB.\fIpmname\fB.select.dst-port=\fIport\fR
291 .TQ
292 \fBmirror.\fIbrname\fB.\fIpmname\fB.select.port=\fIport\fR
293 Frame received on \fIport\fR, output to \fIport\fR, or either received
294 on or output to \fIport\fR, respectively.  \fIport\fR must be part of
295 the bridge \fIbrname\fR; that is, it must be listed on
296 \fBbridge.\fIbrname\fB.port\fR.
297 .TP
298 \fBmirror.\fIbrname\fB.\fIpmname\fB.select.vlan=\fIvid\fR
299 .
300 \fIvid\fR must be an integer between 0 and 4095, inclusive.  A nonzero
301 \fIvid\fR selects frames that belong to VLAN \fIvid\fR, that is,
302 frames that arrived on a trunk port tagged with VLAN \fIvid\fR or on a
303 port that is configured as part of VLAN \fIvid\fR (see \fB802.1Q VLAN
304 tagging\fR, above).  A \fIvid\fR of zero selects frames that do not
305 belong to a VLAN, that is, frames that arrived on a trunk port without
306 a VLAN tag or tagged with VLAN 0.
307 .ST "Mirror Output"
308 The values of the following keys determine how frames selected for
309 mirroring are output.  Only one of the keys may be specified.
310 .TP
311 \fBmirror.\fIbrname\fB.\fIpmname\fB.output.port=\fIport\fR
312 .
313 Causes the selected frames to be sent out \fIport\fR, which must be
314 part of the bridge \fIbrname\fR; that is, it must be listed on
315 \fBbridge.\fIbrname\fB.port\fR.
316 .IP
317 Specifying a \fIport\fR in this way reserves that port exclusively for
318 mirroring.  No frames other than those selected for mirroring will be
319 forwarded to \fIport\fR, and any frames received on \fIport\fR will be
320 discarded.  This type of mirroring may be referred to as SPAN.
321 .TP
322 \fBmirror.\fIbrname\fB.\fIpmname\fB.output.vlan=\fIvid\fR
323 .
324 Causes the selected frames to be sent on the VLAN numbered \fIvid\fR,
325 which must be an integer between 0 and 4095, inclusive.  The frames
326 will be sent out all ports that trunk VLAN \fIvid\fR, as well as any
327 ports with implicit VLAN \fIvid\fR.  When a mirrored frame is sent out
328 a trunk port, the frame's VLAN tag will be set to \fIvid\fR, replacing
329 any existing tag; when it is sent out an implicit VLAN port, the frame
330 will not be tagged.  This type of mirroring may be referred to as
331 RSPAN.
332 .IP
333 Please note that mirroring to a VLAN can disrupt a network that
334 contains unmanaged switches.  Consider an unmanaged physical switch
335 with two ports: port 1, connected to an end host, and port 2,
336 connected to an Open vSwitch configured to mirror received packets
337 into VLAN 123 on port 2.  Suppose that the end host sends a packet on
338 port 1 that the physical switch forwards to port 2.  The Open vSwitch
339 forwards this packet to its destination and then reflects it back on
340 port 2 in VLAN 123.  This reflected packet causes the unmanaged
341 physical switch to replace the MAC learning table entry, which
342 correctly pointed to port 1, with one that incorrectly points to port
343 2.  Afterward, the physical switch will direct packets destined for
344 the end host to the Open vSwitch on port 2, instead of to the end host
345 on port 1, disrupting connectivity.  If mirroring to a VLAN is desired
346 in this scenario, then the physical switch must be replaced by one
347 that learns Ethernet addresses on a per-VLAN basis.  In addition,
348 learning should be disabled on the VLAN containing mirrored traffic.
349 If this is not done then intermediate switches will learn the MAC
350 address of each end host from the mirrored traffic.  If packets being
351 sent to that end host are also mirrored, then they will be dropped
352 since the switch will attempt to send them out the input port.
353 Disabling learning for the VLAN will cause the switch to correctly
354 send the packet out all ports configured for that VLAN.  If Open
355 vSwitch is being used as an intermediate switch learning can be disabled
356 by setting the key \fBvlan.\fIbrname\fB.learning-disable=\fIvid\fR
357 to the mirrored VLAN.
358 .ST "Example"
359 The following \fBovs\-vswitchd\fR configuration copies all frames received
360 on \fBeth1\fR or \fBeth2\fR to \fBeth3\fR.
361 .PP
362 .RS
363 .nf
364
365 bridge.mybr.port=eth1
366 bridge.mybr.port=eth2
367 bridge.mybr.port=eth3
368
369 mirror.mybr.a.select.src-port=eth1
370 mirror.mybr.a.select.src-port=eth2
371 mirror.mybr.a.output.port=eth3
372         
373 .fi
374 .RE
375 .SS "Interface Rate-Limiting"
376 Traffic policing and shaping are configured on interfaces.  Policing
377 defines a hard limit at which traffic that exceeds the specified rate is
378 dropped.  Shaping uses queues to delay packets so that egress traffic
379 leaves at the specified rate.
380
381 .ST "Ingress Policing"
382 The rate at which traffic is allowed to enter through a interface may be 
383 configured with ingress policing.  Note that "ingress" is from the 
384 perspective of \fBovs\-vswitchd\fR.  If configured on a physical interface, 
385 then it limits the rate at which traffic is allowed into the system from 
386 the outside.  If configured on a virtual interface that is connected to 
387 a virtual machine, then it limits the rate at which the guest is able to 
388 transmit.
389
390 The rate is specified in kilobits (1000 bits) per second with a maximum 
391 burst size specified in kilobits (1000 bits).  The burst size should be at 
392 least the size of the interface's MTU.  
393
394 An interface may be configured to enforce ingress policing by defining the
395 key \fBport.\fIname\fB.ingress.policing-rate\fR with an integer
396 indicating the rate.  The interface \fIname\fR will only allow traffic to be
397 received at the rate specified in kilobits per second.  If the rate is zero 
398 or the key is not defined, then ingress policing is disabled.
399
400 If ingress policing is enabled, then the burst rate may be set by defining 
401 the key \fBport.\fIname\fB.ingress.policing-burst\fR with an integer 
402 indicating the burst rate in kilobits.  If the key is not supplied or is 
403 zero, then the default burst is 10 kilobits.
404
405 .PP
406 The following syntax limits interface \fBeth1\fR to receiving traffic at
407 \fB512\fR kilobits per second with a burst of \fB20\fR kilobits:
408 .PP
409 .RS
410 .nf
411
412 port.eth1.ingress.policing-rate=512
413 port.eth1.ingress.policing-burst=20
414
415 .fi
416 .SS "NetFlow v5 Flow Logging"
417 NetFlow is a protocol that exports a number of details about terminating
418 IP flows, such as the principals involved and duration.  A bridge may be
419 configured to send NetFlow v5 records to NetFlow collectors when flows
420 end.  To enable, define the key \fBnetflow.\fIbridge\fB.host\fR for each
421 collector in the form \fIip\fB:\fIport\fR.  Records from \fIbridge\fR
422 will be sent to each \fIip\fR on UDP \fIport\fR.  The \fIip\fR must
423 be specified numerically, not as a DNS name.
424
425 In addition to terminating flows, NetFlow can also send records at a set
426 interval for flows that are still active.  This interval can be configured
427 by defining the key \fBnetflow.\fIbridge\fB\.active-timeout\fR.  The value
428 is in seconds.  An active timeout of 0 will disable this functionality.  By
429 default there is timeout value of 600 seconds.
430
431 The NetFlow messages will use the datapath index for the engine type and id.
432 This can be overridden with the \fBnetflow.\fIbridge\fB.engine-type\fR and
433 \fBnetflow.\fIbridge\fB.engine-id\fR, respectively.  Each takes a value
434 between 0 and 255, inclusive.
435
436 Many NetFlow collectors do not expect multiple switches to be
437 sending messages from the same host, and they do not store the engine
438 information which could be used to disambiguate the traffic.  To prevent
439 flows from multiple switches appearing as if they came on the interface,
440 add \fBnetflow.\fIbridge\fB.add-id-to-iface=true\fR to the configuration
441 file.  This will place the least significant 7 bits of the engine id
442 into the most significant bits of the ingress and egress interface fields
443 of flow records.  When this option is enabled, a maximum of 508 ports are
444 supported.  By default, this behavior is disabled.
445
446 The egress interface field normally contains the OpenFlow port number,
447 however, certain port values have special meaning: 0xFFFF indicates
448 flooding, 0xFFFE is multiple controller-specified output interfaces, and
449 0xFFFD means that packets from the flow were dropped.  If add-id-to-iface
450 is enabled then these values become 0x1FF, 0x1FE, and 0x1FD respectively.
451
452 The following syntax sends NetFlow records for \fBmybr\fR to the NetFlow
453 collector \fBnflow.example.com\fR on UDP port \fB9995\fR:
454 .PP
455 .RS
456 .nf
457
458 netflow.mybr.host=nflow.example.com:9995
459
460 .fi
461 .RE
462 .SS "sFlow Monitoring"
463 sFlow(R) is a protocol for monitoring switches.  A bridge may be
464 configured to send sFlow records to sFlow collectors by defining the
465 key \fBsflow.\fIbridge\fB.host\fR for each collector in the form
466 \fIip\fR[\fB:\fIport\fR].  Records from \fIbridge\fR will be sent to
467 each \fIip\fR on UDP \fIport\fR.  The \fIip\fR must be specified
468 numerically, not as a DNS name.  If \Iport\fR is omitted, port 6343 is
469 used.
470 .PP
471 By default, 1 out of every 400 packets is sent to the configured sFlow
472 collector.  To override this, set \fBsflow.\fIbridge\fB.sampling\fR to
473 the number of switched packets out of which 1, on average, will be
474 sent to the sFlow collector, e.g. a value of 1 sends every packet to
475 the collector, a value of 2 sends 50% of the packets to the collector,
476 and so on.
477 .PP
478 \fBovs\-vswitchd\fR also occasionally sends switch port statistics to
479 sFlow collectors, by default every 30 seconds.  To override this, set
480 \fBsflow.\fIbridge\fB.polling\fR to a duration in seconds.
481 .PP
482 By default, \fBovs\-vswitchd\fR sends the first 128 bytes of sampled
483 packets to sFlow collectors.  To override this, set
484 \fBsflow.\fIbridge\fB.header\fR to a size in bytes.
485 .SS "Remote Management"
486 A \fBovs\-vswitchd\fR instance may be remotely managed by a controller that
487 supports the OpenFlow Management Protocol, such as NOX.  This
488 functionality is enabled by setting the key \fBmgmt.controller\fR to one 
489 of the following values:
490 .
491 .IP "\fBssl:\fIip\fR[\fB:\fIport\fR]"
492 The specified SSL \fIport\fR (default: 6633) on the host at the given
493 \fIip\fR, which must be expressed as an IP address (not a DNS name).
494 SSL must be configured when this form is used (see \fBSSL
495 Configuration\fR, below).
496 .
497 .IP "\fBtcp:\fIip\fR[\fB:\fIport\fR]"
498 The specified TCP \fIport\fR (default: 6633) on the host at the given
499 \fIip\fR, which must be expressed as an IP address (not a DNS name).
500 .PP
501 The maximum time between attempts to connect to the controller may be
502 specified in integral seconds with the \fBmgmt.max-backoff\fR key.  The
503 default maximum backoff is 8 seconds, and the minimum value is 1
504 second.
505
506 An inactivity probe may be configured with the \fBmgmt.inactivity-probe\fR
507 key.  If \fBovs\-vswitchd\fR does not communicate with the controller for the
508 specified number of seconds, it will send a probe.  If a response is not
509 received for an additional amount of that time, \fBovs\-vswitchd\fR assumes
510 the connection has been broken and attempts to reconnect.  The default
511 and minimum values are both 5 seconds.
512
513 A management id may be specified with the \fBmgmt.id\fR key.  It takes
514 an id in the form of exactly 12 hexadecimal digits.  If one is not
515 specified, a random id is generated each time \fBovs\-vswitchd\fR is started.
516 .fi
517 .RE
518 .SS "OpenFlow Controller Connectivity"
519 \fBovs\-vswitchd\fR can perform all configured bridging and switching
520 locally, or it can be configured to connect a given bridge to an
521 external OpenFlow controller, such as NOX.  Its behavior depends on
522 the \fBbridge.\fIname\fB.controller\fR setting:
523 .
524 .TP
525 \fI\[la]unset\[ra]\fR
526 When the key is not set, the behavior depends on whether remote 
527 management is configured.  If management is configured, then the switch 
528 will connect to the controller specified on \fBmgmt.controller\fR.  If 
529 management is not configured, the switch will perform all configured 
530 bridging and switching locally.
531 .
532 .TP
533 \fI\[la]empty\[ra]\fR
534 Setting an empty string value disables controller connectivity.  The
535 switch will perform all configured bridging and switching locally.
536 .
537 .TP
538 \fBdiscover\fR
539 Use controller discovery to find the local OpenFlow controller.
540 Refer to \fBovs\-openflowd\fR(8) for information on how to configure a DHCP
541 server to support controller discovery.  The following additional
542 options control the discovery process:
543 .
544 .RS
545 .TP
546 \fBbridge.\fIname\fB.controller.accept-regex=\fIregex\fR
547 A POSIX extended regular expression against which the discovered
548 controller location is validated.  Only controllers whose names match
549 the regular expression will be accepted.
550 .IP
551 The default regular expression is \fBssl:.*\fR, meaning that only SSL
552 controller connections will be accepted, when SSL is configured (see
553 \fBSSL Configuration\fR), and \fBtcp:.*\fR otherwise, meaning that only
554 TCP controller connections will be accepted.
555 .IP
556 The regular expression is implicitly anchored at the beginning of the
557 controller location string, as if it begins with \fB^\fR.
558 .TP
559 \fBbridge.\fIname\fB.controller.update-resolv.conf=\fBtrue\fR|\fBfalse\fR
560 By default, or if this is set to \fBtrue\fR, \fBovs\-vswitchd\fR overwrites
561 the system's \fB/etc/resolv.conf\fR with domain information and DNS
562 servers obtained via DHCP.  If this setting is \fBfalse\fR,
563 \fBovs\-vswitchd\fR will not modify \fB/etc/resolv.conf\fR.
564 .IP
565 \fBovs\-vswitchd\fR will only modify \fBresolv.conf\fR if the DHCP response
566 that it receives specifies one or more DNS servers.
567 .RE
568 .
569 .TP
570 \fBssl:\fIip\fR[\fB:\fIport\fR]
571 The specified SSL \fIport\fR (default: 6633) on the host at the given
572 \fIip\fR, which must be expressed as an IP address (not a DNS name).
573 SSL must be configured when this form is used (see \fBSSL
574 Configuration\fR, below).
575 .
576 .TP
577 \fBtcp:\fIip\fR[\fB:\fIport\fR]
578 The specified TCP \fIport\fR (default: 6633) on the host at the given
579 \fIip\fR, which must be expressed as an IP address (not a DNS name).
580 .
581 .TP
582 \fBunix:\fIfile\fR
583 The Unix domain server socket named \fIfile\fR.
584 .PP
585 The datapath ID used by the bridge to identify itself to the remote
586 controller may be specified as \fBbridge.\fIname\fB.datapath-id\fR,
587 in the form of exactly 12 hexadecimal digits.  If the datapath ID
588 is not specified, then it defaults to the bridge's MAC address (see
589 \fBBridge Configuration\fR, above, for information on how the bridge's
590 MAC address is chosen).
591 .ST "Local Port Network Configuration"
592 When an external controller is configured, but controller discovery is
593 not in use, the following additional settings are honored:
594 .TP
595 \fBbridge.\fIname\fB.controller.in-band=\fBtrue\fR|\fBfalse\fR
596 By default, or if this is set to \fBtrue\fR, \fBovs\-vswitchd\fR connects
597 to the controller in-band.  If this is set to \fBfalse\fR,
598 \fBovs\-vswitchd\fR connects to the controller out-of-band.  Refer to
599 \fBovs\-openflowd\fR(8) for a description of in-band and out-of-band control.
600 .IP "\fBbridge.\fIname\fB.controller.ip=\fIip\fR"
601 If specified, the IP address to configure on the bridge's local port.
602 .IP "\fBbridge.\fIname\fB.controller.netmask=\fInetmask\fR"
603 When an IP is specified, the corresponding netmask.  The default is
604 255.255.255.0 for a Class C IP address, 255.255.0.0 for Class B, and
605 255.0.0.0 for Class A.
606 .IP "\fBbridge.\fIname\fB.controller.gateway=\fIip\fR"
607 When an IP is specified, the corresponding IP gateway.  There is no
608 default gateway.
609 .ST "Controller Failure Settings"
610 The following additional settings take effect when any remote
611 controller is configured:
612 .IP "\fBbridge.\fIname\fB.controller.inactivity-probe=\fIsecs\fR"
613 This optional setting may be set to \fIsecs\fR, a number of seconds.
614 The minimum value of \fIsecs\fR is 5 seconds.  The default is taken
615 from \fBmgmt.inactivity-probe\fR (see above).
616 .IP
617 When the switch is connected to the controller, it waits for a
618 message to be received from the controller for \fIsecs\fR seconds
619 before it sends a inactivity probe to the controller.  After sending
620 the inactivity probe, if no response is received for an additional
621 \fIsecs\fR seconds, \fBovs-vswitchd\fR assumes that the connection has
622 been broken and attempts to reconnect.
623 .IP
624 Changing the inactivity probe interval also changes the interval
625 before entering standalone mode (see below).
626 .IP "\fBbridge.\fIname\fB.controller.fail-mode=\fBstandalone\fR|\fBsecure\fR"
627 .IQ "\fBmgmt.fail-mode=standalone\fR|\fBsecure\fR"
628 When a controller is configured, it is, ordinarily, responsible for
629 setting up all flows on the switch.  Thus, if the connection to
630 the controller fails, no new network connections can be set up.  If
631 the connection to the controller stays down long enough, no packets
632 can pass through the switch at all.
633 .IP
634 The first of these that is set takes effect.
635 If the value is \fBstandalone\fR, or if neither of these settings
636 is set, \fBovs\-vswitchd\fR will take over
637 responsibility for setting up
638 flows when no message has been received from the controller for three
639 times the inactivity probe interval (see above).  In this mode,
640 \fBovs\-vswitchd\fR causes the datapath to act like an ordinary
641 MAC-learning switch.  \fBovs\-vswitchd\fR will continue to retry connecting
642 to the controller in the background and, when the connection succeeds,
643 it discontinues its standalone behavior.
644 .IP
645 If this option is set to \fBsecure\fR, \fBovs\-vswitchd\fR will not
646 set up flows on its own when the controller connection fails.
647 .IP "\fBbridge.\fIname\fB.controller.max-backoff=\fIsecs\fR"
648 Sets the maximum time between attempts to connect to the controller to
649 \fIsecs\fR, which must be at least 1.  The actual interval between
650 connection attempts starts at 1 second and doubles on each failing
651 attempt until it reaches the maximum.  The default maximum backoff
652 time is taken from \fBmgmt.max-backoff\fR.
653 .ST "Controller Rate-Limiting"
654 These settings configure how the switch applies a ``token
655 bucket'' to limit the rate at which packets in unknown flows are
656 forwarded to the OpenFlow controller for flow-setup processing.  This
657 feature prevents a single bridge from overwhelming a controller.
658 .PP
659 In addition, when a high rate triggers rate-limiting,
660 \fBovs\-vswitchd\fR queues controller packets for each port and
661 transmits them to the controller at the configured rate.  The number
662 of queued packets is limited by a ``burst size'' parameter.  The
663 packet queue is shared fairly among the ports on a bridge.
664 .PP
665 \fBovs\-vswitchd\fR maintains two such packet rate-limiters per
666 bridge.  One of these applies to packets sent up to the controller
667 because they do not correspond to any flow.  The other applies to
668 packets sent up to the controller by request through flow actions.
669 When both rate-limiters are filled with packets, the actual rate that
670 packets are sent to the controller is up to twice the specified rate.
671 .IP "\fBbridge.\fIname\fB.controller.rate-limit=\fIrate\fR"
672 .IQ "\fBmgmt.rate-limit=\fIrate\fR"
673 Limits the maximum rate at which packets will be forwarded to the
674 OpenFlow controller to \fIrate\fR packets per second.  A rate specified
675 explicitly for \fIname\fR overrides a value configured using the
676 \fBmgmt.rate-limit\fR key.
677 .IP
678 If neither one of these settings is set, then the bridge does not
679 limit the rate at which packets are forwarded to the controller.
680 .IP "\fBbridge.\fIname\fB.controller.burst-limit=\fIburst\fR"
681 .IQ "\fBmgmt.burst-limit=\fIburst\fR"
682 Sets the maximum number of unused packet credits that the bridge will
683 allow to accumulate during the time in which no packets are being
684 forwarded to the OpenFlow controller to \fIburst\fR (measured in
685 packets).  The default \fIburst\fR is one-quarter of the \fIrate\fR
686 specified in the rate-limit setting.
687 .IP
688 A burst specified explicitly for \fIname\fR overrides a value configured 
689 using the \fBmgmt.burst-limit\fR key.  This option takes effect only 
690 when a rate-limit is specified.
691 .ST "Remote Command Execution Settings"
692 These settings configure the commands that remote OpenFlow connections
693 are allowed to invoke using (e.g.) \fBovs\-ofctl execute\fR.  To be
694 permitted, a command name must be whitelisted and must not be
695 blacklisted.  When the whitelist and blacklist permit a command name,
696 \fBovs\-vswitchd\fR looks for a program with the same name as the command
697 in the commands directory (see below).  Other directories are not
698 searched.
699 .IP "\fBbridge.\fIname\fB.controller.commands.acl=\fIglob\fR"
700 Whitelists commands whose names match shell glob pattern \fIglob\fR,
701 allowing those commands to be invoked by the remote controller.
702 .IP
703 By default, no commands are whitelisted, so this setting is mandatory
704 if any remote command execution is to be allowed.
705 .IP "\fBbridge.\fIname\fB.controller.commands.acl=\fB!\fR\fIglob\fR"
706 Blacklists commands whose names match shell glob pattern \fIglob\fR,
707 prohibiting those commands from being invoked by the remote
708 controller.  Command names that include characters other than upper-
709 and lower-case English letters, digits, and the underscore and hyphen
710 characters are blacklisted unconditionally.
711 .IP "\fBbridge.\fIname\fB.controller.commands.dir=\fIdirectory\fR"
712 Sets the directory searched for remote command execution to
713 \fIdirectory\fR.  The default directory is
714 \fB@pkgdatadir@/commands\fR.
715 .SS "SSL Configuration"
716 When \fBovs\-vswitchd\fR is configured to connect over SSL for management or
717 for controller connectivity, the following settings are required:
718 .TP
719 \fBssl.private-key=\fIprivkey.pem\fR
720 Specifies a PEM file containing the private key used as the 
721 switch's identity for SSL connections to the controller.
722 .TP
723 \fBssl.certificate=\fIcert.pem\fR
724 Specifies a PEM file containing a certificate, signed by the
725 certificate authority (CA) used by the controller and manager, that
726 certifies the switch's private key, identifying a trustworthy
727 switch.
728 .TP
729 \fBssl.ca-cert=\fIcacert.pem\fR
730 Specifies a PEM file containing the CA certificate used to verify that
731 the switch is connected to a trustworthy controller.
732 .PP
733 These files are read only once, at \fBovs\-vswitchd\fR startup time.  If
734 their contents change, \fBovs\-vswitchd\fR must be killed and restarted.
735 .PP
736 These SSL settings apply to all SSL connections made by the switch.
737 .ST "CA Certificate Bootstrap"
738 Ordinarily, all of the files named in the SSL configuration must exist
739 when \fBovs\-vswitchd\fR starts.  However, if \fBssl.bootstrap-ca-cert\fR
740 is set to \fBtrue\fR, then \fBovs\-vswitchd\fR will attempt to obtain the
741 CA certificate from the controller on its first SSL connection and
742 save it to the named PEM file.  If it is successful, it will
743 immediately drop the connection and reconnect, and from then on all
744 SSL connections must be authenticated by a certificate signed by the
745 CA certificate thus obtained.
746 .PP
747 \fBThis option exposes the SSL connection to a man-in-the-middle
748 attack obtaining the initial CA certificate\fR, but it may be useful
749 for bootstrapping.
750 .PP
751 This option is only useful if the controller sends its CA certificate
752 as part of the SSL certificate chain.  The SSL protocol does not
753 require the controller to send the CA certificate, but
754 \fBcontroller\fR(8) can be configured to do so with the
755 \fB--peer-ca-cert\fR option.
756 .SS "OpenFlow Management Connections"
757 By default, each bridge \fIname\fR listens for OpenFlow management
758 connections on a Unix domain socket named
759 \fB@RUNDIR@/\fIname\fB.mgmt\fR.  This socket can be used to perform
760 local OpenFlow monitoring and administration, e.g., \fBovs\-ofctl dump-flows
761 unix:@RUNDIR@/\fIname\fB.mgmt\fR to display the flows currently set up
762 in bridge \fIname\fR.
763 .PP
764 If \fBbridge.\fIname\fB.openflow.listeners\fR is set to one or more
765 values, \fBovs\-vswitchd\fR instead listens on the specified connection
766 methods.  Acceptable connection methods include:
767 .RS
768 .IP "\fBpunix:\fIfile\fR"
769 Listens for connections on the Unix domain server socket named \fIfile\fR.
770 .IP "\fBpssl:\fR[\fIport\fR]"
771 Listens for SSL connections on \fIport\fR (default: 6633).  SSL must
772 be configured when this form is used (see \fBSSL Configuration\fR,
773 above).
774 .IP "\fBptcp:\fR[\fIport\fR][\fB:\fIip\fR]"
775 Listens for TCP connections on \fIport\fR (default: 6633).
776 By default, \fB\ovs\-vswitchd\fR listens for connections to any local
777 IP address, but \fIip\fR may be specified to limit connections to the
778 specified local \fIip\fR.
779 .RE
780 To entirely disable listening for management connections, set
781 \fBbridge.\fIname\fB.openflow.listeners\fR to the single value
782 \fBnone\fR.
783
784 .SS "OpenFlow Controller Connection Snooping"
785 By default, each bridge \fIname\fR listens for OpenFlow controller
786 connection snooping connections on a Unix domain socket named
787 \fB@RUNDIR@/\fIname\fB.snoop\fR.  A client that connects to this
788 socket, e.g., \fBovs\-ofctl monitor unix:@RUNDIR@/\fIname\fB.snoop\fR, will
789 receive a copy of every OpenFlow message sent by the switch to the
790 controller, or vice versa, on the primary OpenFlow controller
791 connection.
792 .PP
793 If \fBbridge.\fIname\fB.openflow.snoops\fR is set to one or more
794 values, \fBovs\-vswitchd\fR instead listens on the specified connection
795 methods.  The acceptable connection methods are the same as for
796 OpenFlow management connections (see above).
797 .PP
798 To entirely disable controller connection snooping, set
799 \fBbridge.\fIname\fB.openflow.snoops\fR to the single value
800 \fBnone\fR.
801 .SH "SEE ALSO"
802 .BR ovs\-brcompatd (8),
803 .BR ovs\-cfg\-mod (8),
804 .BR ovs\-vswitchd (8)