bridge: Implement basic periodic update of interface statistics.
[sliver-openvswitch.git] / vswitchd / vswitch.xml
1 <database title="Open vSwitch Configuration Database">
2   <p>A database with this schema holds the configuration for one Open
3     vSwitch daemon.  The root of the configuration for the daemon is
4     the <ref table="Open_vSwitch"/> table, which must have exactly one
5     record.  Records in other tables are significant only when they
6     can be reached directly or indirectly from the
7     <ref table="Open_vSwitch"/> table.</p>
8
9   <table name="Open_vSwitch" title="Open vSwitch configuration.">
10     Configuration for an Open vSwitch daemon.  There must be exactly one record
11     in the <ref table="Open_vSwitch"/> table.
12
13     <group title="Configuration">
14       <column name="bridges">
15         Set of bridges managed by the daemon.
16       </column>
17
18       <column name="controller">
19         Default OpenFlow <ref table="Controller"/> set used by bridges.  May be
20         overridden on a per-bridge basis by the <ref table="Bridge"
21         column="controller"/> column in <ref table="Bridge"/>.
22       </column>
23
24       <column name="managers">
25         Remote database clients to which the Open vSwitch's database server
26         should connect or to which it should listen.
27       </column>
28
29       <column name="ssl">
30         SSL used globally by the daemon.
31       </column>
32
33       <column name="external_ids">
34         Key-value pairs that identify this Open vSwitch's role in
35         external systems.  The currently defined key-value pairs are:
36         <dl>
37           <dt><code>system-uuid</code></dt>
38           <dd>A universally unique identifier for the Open vSwitch's
39             physical host.  The form of the identifier depends on the
40             type of the host.  On a Citrix XenServer, this is the host
41             UUID displayed by, e.g., <code>xe host-list</code>.</dd>
42         </dl>
43       </column>
44     </group>
45
46     <group title="Status">
47       <column name="next_cfg">
48         Sequence number for client to increment.  When a client modifies
49         any part of the database configuration and wishes to wait for
50         Open vSwitch to finish applying the changes, it may increment
51         this sequence number.
52       </column>
53
54       <column name="cur_cfg">
55         Sequence number that Open vSwitch sets to the current value of
56         <ref column="next_cfg"/> after it finishes applying a set of
57         configuration changes.
58       </column>
59
60       <column name="capabilities">
61         Describes functionality supported by the hardware and software platform
62         on which this Open vSwitch is based.  Clients should not modify this
63         column.  See the <ref table="Capability"/> description for defined
64         capability categories and the meaning of associated
65         <ref table="Capability"/> records.
66       </column>
67
68       <column name="statistics">
69         <p>
70           Key-value pairs that report statistics about a running Open_vSwitch
71           daemon.  The current implementation updates these counters
72           periodically.  In the future, we plan to, instead, update them only
73           when they are queried (e.g. using an OVSDB <code>select</code>
74           operation) and perhaps at other times, but not on any regular
75           periodic basis.</p>
76         <p>
77           The currently defined key-value pairs are listed below.  Some Open
78           vSwitch implementations may not support some statistics, in which
79           case those key-value pairs are omitted.</p>
80         <dl>
81           <dt><code>load-average</code></dt>
82           <dd>
83             System load average multiplied by 100 and rounded to the nearest
84             integer.</dd>
85         </dl>
86       </column>
87     </group>
88   </table>
89
90   <table name="Bridge">
91     <p>
92       Configuration for a bridge within an
93       <ref table="Open_vSwitch"/>.
94     </p>
95     <p>
96       A <ref table="Bridge"/> record represents an Ethernet switch with one or
97       more ``ports,'' which are the <ref table="Port"/> records pointed to by
98       the <ref table="Bridge"/>'s <ref column="ports"/> column.
99     </p>
100
101     <group title="Core Features">
102       <column name="name">
103         Bridge identifier.  Should be alphanumeric and no more than about 8
104         bytes long.  Must be unique among the names of ports, interfaces, and
105         bridges on a host.
106       </column>
107
108       <column name="ports">
109         Ports included in the bridge.
110       </column>
111
112       <column name="mirrors">
113         Port mirroring configuration.
114       </column>
115
116       <column name="netflow">
117         NetFlow configuration.
118       </column>
119
120       <column name="sflow">
121         sFlow configuration.
122       </column>
123
124       <column name="flood_vlans">
125         VLAN IDs of VLANs on which MAC address learning should be disabled, so
126         that packets are flooded instead of being sent to specific ports that
127         are believed to contain packets' destination MACs.  This should
128         ordinarily be used to disable MAC learning on VLANs used for mirroring
129         (RSPAN VLANs).  It may also be useful for debugging.
130       </column>
131     </group>
132
133     <group title="OpenFlow Configuration">
134       <column name="controller">
135         OpenFlow controller set.  If unset, defaults to the set of
136         controllers specified by <ref column="controller"
137         table="Open_vSwitch"/> in the <ref table="Open_vSwitch"/>
138         table.  If the default is also unset, then no OpenFlow
139         controllers will be used.
140       </column>
141
142       <column name="datapath_id">
143         Reports the OpenFlow datapath ID in use.  Exactly 16 hex
144         digits.  (Setting this column will have no useful effect.  Set
145         <ref column="other_config"/>:<code>other-config</code>
146         instead.)
147       </column>
148     </group>
149
150     <group title="Other Features">
151       <column name="datapath_type">
152         Name of datapath provider.  The kernel datapath has
153         type <code>system</code>.  The userspace datapath has
154         type <code>netdev</code>.
155       </column>
156
157       <column name="external_ids">
158         Key-value pairs that identify this bridge's role in external systems.
159         The currently defined key-value pairs are:
160         <dl>
161           <dt><code>network-uuids</code></dt>
162           <dd>Semicolon-delimited set of universally unique identifier(s) for
163             the network with which this bridge is associated.  The form of the
164             identifier(s) depends on the type of the host.  On a Citrix
165             XenServer host, the network identifiers are RFC 4122 UUIDs as
166             displayed by, e.g., <code>xe network-list</code>.</dd>
167         </dl>
168       </column>
169
170       <column name="other_config">
171         Key-value pairs for configuring rarely used bridge
172         features.  The currently defined key-value pairs are:
173         <dl>
174           <dt><code>datapath-id</code></dt>
175           <dd>Exactly 16 hex
176             digits to set the OpenFlow datapath ID to a specific
177             value.</dd>
178           <dt><code>hwaddr</code></dt>
179           <dd>An Ethernet address in the form
180             <var>xx</var>:<var>xx</var>:<var>xx</var>:<var>xx</var>:<var>xx</var>:<var>xx</var>
181             to set the hardware address of the local port and influence the
182             datapath ID.</dd>
183         </dl>
184       </column>
185     </group>
186   </table>
187
188   <table name="Port" table="Port or bond configuration.">
189     <p>A port within a <ref table="Bridge"/>.</p>
190     <p>Most commonly, a port has exactly one ``interface,'' pointed to by its
191       <ref column="interfaces"/> column.  Such a port logically
192       corresponds to a port on a physical Ethernet switch.  A port
193       with more than one interface is a ``bonded port'' (see
194       <ref group="Bonding Configuration"/>).</p>
195     <p>Some properties that one might think as belonging to a port are actually
196       part of the port's <ref table="Interface"/> members.</p>
197
198     <column name="name">
199       Port name.  Should be alphanumeric and no more than about 8
200       bytes long.  May be the same as the interface name, for
201       non-bonded ports.  Must otherwise be unique among the names of
202       ports, interfaces, and bridges on a host.
203     </column>
204
205     <column name="interfaces">
206       The port's interfaces.  If there is more than one, this is a
207       bonded Port.
208     </column>
209
210     <group title="VLAN Configuration">
211       <p>A bridge port must be configured for VLANs in one of two
212         mutually exclusive ways:
213         <ul>
214           <li>A ``trunk port'' has an empty value for <ref
215             column="tag"/>.  Its <ref column="trunks"/> value may be
216             empty or non-empty.</li>
217           <li>An ``implicitly tagged VLAN port'' or ``access port''
218             has an nonempty value for <ref column="tag"/>.  Its
219             <ref column="trunks"/> value must be empty.</li>
220         </ul>
221         If <ref column="trunks"/> and <ref column="tag"/> are both
222         nonempty, the configuration is ill-formed.
223       </p>
224
225       <column name="tag">
226         <p>
227           If this is an access port (see above), the port's implicitly
228           tagged VLAN.  Must be empty if this is a trunk port.
229         </p>
230         <p>
231           Frames arriving on trunk ports will be forwarded to this
232           port only if they are tagged with the given VLAN (or, if
233           <ref column="tag"/> is 0, then if they lack a VLAN header).
234           Frames arriving on other access ports will be forwarded to
235           this port only if they have the same <ref column="tag"/>
236           value.  Frames forwarded to this port will not have an
237           802.1Q header.
238         </p>
239         <p>
240           When a frame with a 802.1Q header that indicates a nonzero
241           VLAN is received on an access port, it is discarded.
242         </p>
243       </column>
244
245       <column name="trunks">
246         <p>
247           If this is a trunk port (see above), the 802.1Q VLAN(s) that
248           this port trunks; if it is empty, then the port trunks all
249           VLANs.  Must be empty if this is an access port.
250         </p>
251         <p>
252           Frames arriving on trunk ports are dropped if they are not
253           in one of the specified VLANs.  For this purpose, packets
254           that have no VLAN header are treated as part of VLAN 0.
255         </p>
256       </column>
257     </group>
258
259     <group title="Bonding Configuration">
260       <p>A port that has more than one interface is a ``bonded port.''
261         Bonding allows for load balancing and fail-over.  Open vSwitch
262         supports ``source load balancing'' (SLB) bonding, which
263         assigns flows to slaves based on source MAC address, with
264         periodic rebalancing as traffic patterns change.  This form of
265         bonding does not require 802.3ad or other special support from
266         the upstream switch to which the slave devices are
267         connected.</p>
268
269       <p>These columns apply only to bonded ports.  Their values are
270         otherwise ignored.</p>
271
272       <column name="bond_updelay">
273         <p>For a bonded port, the number of milliseconds for which carrier must
274           stay up on an interface before the interface is considered to be up.
275           Specify <code>0</code> to enable the interface immediately.</p>
276         <p>This setting is honored only when at least one bonded interface is
277           already enabled.  When no interfaces are enabled, then the first bond
278           interface to come up is enabled immediately.</p>
279       </column>
280
281       <column name="bond_downdelay">
282         For a bonded port, the number of milliseconds for which carrier must
283         stay down on an interface before the interface is considered to be
284         down.  Specify <code>0</code> to disable the interface immediately.
285       </column>
286
287       <column name="bond_fake_iface">
288         For a bonded port, whether to create a fake internal interface with the
289         name of the port.  Use only for compatibility with legacy software that
290         requires this.
291       </column>
292     </group>
293
294     <group title="Other Features">
295       <column name="qos">
296         Quality of Service configuration for this port.
297       </column>
298       
299       <column name="mac">
300         The MAC address to use for this port for the purpose of choosing the
301         bridge's MAC address.  This column does not necessarily reflect the
302         port's actual MAC address, nor will setting it change the port's actual
303         MAC address.
304       </column>
305
306       <column name="fake_bridge">
307         Does this port represent a sub-bridge for its tagged VLAN within the
308         Bridge?  See ovs-vsctl(8) for more information.
309       </column>
310
311       <column name="external_ids">
312         Key-value pairs that identify this port's role in external systems.  No
313         key-value pairs native to <ref table="Port"/> are currently defined.
314         For fake bridges (see the <ref column="fake_bridge"/> column), external
315         IDs for the fake bridge are defined here by prefixing a
316         <ref table="Bridge"/> <ref table="Bridge" column="external_ids"/> key
317         with <code>fake-bridge-</code>,
318         e.g. <code>fake-bridge-network-uuids</code>.
319       </column>
320
321       <column name="other_config">
322         Key-value pairs for configuring rarely used port features.  The
323         currently defined key-value pairs are:
324         <dl>
325           <dt><code>hwaddr</code></dt>
326           <dd>An Ethernet address in the form
327             <code><var>xx</var>:<var>xx</var>:<var>xx</var>:<var>xx</var>:<var>xx</var>:<var>xx</var></code>.</dd>
328           <dt><code>bond-rebalance-interval</code></dt>
329           <dd>For a bonded port, the number of milliseconds between
330             successive attempts to rebalance the bond, that is, to
331             move source MACs and their flows from one interface on
332             the bond to another in an attempt to keep usage of each
333             interface roughly equal.  The default is 10000 (10
334             seconds), and the minimum is 1000 (1 second).</dd>
335         </dl>
336       </column>
337     </group>
338   </table>
339
340   <table name="Interface" title="One physical network device in a Port.">
341     An interface within a <ref table="Port"/>.
342
343     <group title="Core Features">
344       <column name="name">
345         Interface name.  Should be alphanumeric and no more than about 8 bytes
346         long.  May be the same as the port name, for non-bonded ports.  Must
347         otherwise be unique among the names of ports, interfaces, and bridges
348         on a host.
349       </column>
350
351       <column name="mac">
352         <p>Ethernet address to set for this interface.  If unset then the
353           default MAC address is used:</p>
354         <ul>
355           <li>For the local interface, the default is the lowest-numbered MAC
356             address among the other bridge ports, either the value of the
357             <ref table="Port" column="mac"/> in its <ref table="Port"/> record,
358             if set, or its actual MAC (for bonded ports, the MAC of its slave
359             whose name is first in alphabetical order).  Internal ports and
360             bridge ports that are used as port mirroring destinations (see the
361             <ref table="Mirror"/> table) are ignored.</li>
362           <li>For other internal interfaces, the default MAC is randomly
363             generated.</li>
364           <li>External interfaces typically have a MAC address associated with
365             their hardware.</li>
366         </ul>
367         <p>Some interfaces may not have a software-controllable MAC
368         address.</p>
369       </column>
370
371       <column name="ofport">
372         <p>OpenFlow port number for this interface.  Unlike most columns, this
373           column's value should be set only by Open vSwitch itself.  Other
374           clients should set this column to an empty set (the default) when
375           creating an <ref table="Interface"/>.</p>
376         <p>Open vSwitch populates this column when the port number becomes
377           known.  If the interface is successfully added,
378           <ref column="ofport"/> will be set to a number between 1 and 65535
379           (generally either in the range 1 to 65280, exclusive, or 65534, the
380           port number for the OpenFlow ``local port'').  If the interface
381           cannot be added then Open vSwitch sets this column
382           to -1.</p>
383       </column>
384     </group>
385
386     <group title="System-Specific Details">
387       <column name="type">
388         The interface type, one of:
389         <dl>
390           <dt><code>system</code></dt>
391           <dd>An ordinary network device, e.g. <code>eth0</code> on Linux.
392             Sometimes referred to as ``external interfaces'' since they are
393             generally connected to hardware external to that on which the Open
394             vSwitch is running.  The empty string is a synonym for
395             <code>system</code>.</dd>
396           <dt><code>internal</code></dt>
397           <dd>A simulated network device that sends and receives traffic.  An
398             internal interface whose <ref column="name"/> is the same as its
399             bridge's <ref table="Open_vSwitch" column="name"/> is called the
400             ``local interface.''  It does not make sense to bond an internal
401             interface, so the terms ``port'' and ``interface'' are often used
402             imprecisely for internal interfaces.</dd>
403           <dt><code>tap</code></dt>
404           <dd>A TUN/TAP device managed by Open vSwitch.</dd>
405           <dt><code>gre</code></dt>
406           <dd>An Ethernet over RFC 1702 Generic Routing Encapsulation over IPv4
407              tunnel.  Each tunnel must be uniquely identified by the
408              combination of <code>remote_ip</code>, <code>local_ip</code>, and
409              <code>in_key</code>.  Note that if two ports are defined that are
410              the same except one has an optional identifier and the other does
411              not, the more specific one is matched first.  <code>in_key</code>
412              is considered more specific than <code>local_ip</code> if a port
413              defines one and another port defines the other.  The arguments
414              are:
415             <dl>
416               <dt><code>remote_ip</code></dt>
417               <dd>Required.  The tunnel endpoint.</dd>
418             </dl>
419             <dl>
420               <dt><code>local_ip</code></dt>
421               <dd>Optional.  The destination IP that received packets must
422                 match.  Default is to match all addresses.</dd>
423             </dl>
424             <dl>
425               <dt><code>in_key</code></dt>
426               <dd>Optional.  The GRE key that received packets must contain.
427                 It may either be a 32-bit number (no key and a key of 0 are
428                 treated as equivalent) or the word <code>flow</code>.  If
429                 <code>flow</code> is specified then any key will be accepted
430                 and the key will be placed in the <code>tun_id</code> field
431                 for matching in the flow table.  The ovs-ofctl manual page
432                 contains additional information about matching fields in
433                 OpenFlow flows.  Default is no key.</dd>
434             </dl>
435             <dl>
436               <dt><code>out_key</code></dt>
437               <dd>Optional.  The GRE key to be set on outgoing packets.  It may
438                 either be a 32-bit number or the word <code>flow</code>.  If
439                 <code>flow</code> is specified then the key may be set using
440                 the <code>set_tunnel</code> Nicira OpenFlow vendor extension (0
441                 is used in the absense of an action).  The ovs-ofctl manual
442                 page contains additional information about the Nicira OpenFlow
443                 vendor extensions.  Default is no key.</dd>
444             </dl>
445             <dl>
446               <dt><code>key</code></dt>
447               <dd>Optional.  Shorthand to set <code>in_key</code> and
448                 <code>out_key</code> at the same time.</dd>
449             </dl>
450             <dl>
451               <dt><code>tos</code></dt>
452               <dd>Optional.  The value of the ToS bits to be set on the
453                 encapsulating packet.  It may also be the word
454                 <code>inherit</code>, in which case the ToS will be copied from
455                 the inner packet if it is IPv4 or IPv6 (otherwise it will be
456                 0).  Note that the ECN fields are always inherited.  Default is
457                 0.</dd>
458             </dl>
459             <dl>
460               <dt><code>ttl</code></dt>
461               <dd>Optional.  The TTL to be set on the encapsulating packet.
462                 It may also be the word <code>inherit</code>, in which case the
463                 TTL will be copied from the inner packet if it is IPv4 or IPv6
464                 (otherwise it will be the system default, typically 64).
465                 Default is the system default TTL.</dd>
466             </dl>
467             <dl>
468               <dt><code>csum</code></dt>
469               <dd>Optional.  Compute GRE checksums for outgoing packets and
470                 require checksums for incoming packets.  Default is enabled,
471                 set to <code>false</code> to disable.</dd>
472             </dl>
473             <dl>
474               <dt><code>pmtud</code></dt>
475               <dd>Optional.  Enable tunnel path MTU discovery.  If enabled
476                 ``ICMP destination unreachable - fragmentation'' needed
477                 messages will be generated for IPv4 packets with the DF bit set
478                 and IPv6 packets above the minimum MTU if the packet size
479                 exceeds the path MTU minus the size of the tunnel headers.  It
480                 also forces the encapsulating packet DF bit to be set (it is
481                 always set if the inner packet implies path MTU discovery).
482                 Note that this option causes behavior that is typically
483                 reserved for routers and therefore is not entirely in
484                 compliance with the IEEE 802.1D specification for bridges.
485                 Default is enabled, set to <code>false</code> to disable.</dd>
486             </dl>
487           </dd>
488           <dt><code>patch</code></dt>
489           <dd>A pair of virtual devices that act as a patch cable.  A 
490             <code>peer</code> argument is required that indicates the name
491             of the other side of the patch.  Since a patch must work in
492             pairs, a second patch interface must be declared with the
493             <code>name</code> and <code>peer</code> arguments reversed.</dd>
494         </dl>
495       </column>
496
497       <column name="options">
498         Configuration options whose interpretation varies based on
499         <ref column="type"/>.
500       </column>
501     </group>
502
503     <group title="Ingress Policing">
504       <column name="ingress_policing_burst">
505         <p>Maximum burst size for data received on this interface, in kb.  The
506           default burst size if set to <code>0</code> is 1000 kb.  This value
507           has no effect if <ref column="ingress_policing_rate"/>
508           is <code>0</code>.</p>
509         <p>The burst size should be at least the size of the interface's
510           MTU.</p>
511       </column>
512
513       <column name="ingress_policing_rate">
514         <p>Maximum rate for data received on this interface, in kbps.  Data
515           received faster than this rate is dropped.  Set to <code>0</code> to
516           disable policing.</p>
517         <p>The meaning of ``ingress'' is from Open vSwitch's perspective.  If
518           configured on a physical interface, then it limits the rate at which
519           traffic is allowed into the system from the outside.  If configured
520           on a virtual interface that is connected to a virtual machine, then
521           it limits the rate at which the guest is able to transmit.</p>
522       </column>
523     </group>
524
525     <group title="Other Features">
526       <column name="external_ids">
527         <p>Key-value pairs that identify this interface's role in external
528           systems.  All of the currently defined key-value pairs specifically
529           apply to an interface that represents a virtual Ethernet interface
530           connected to a virtual machine.  These key-value pairs should not be
531           present for other types of interfaces.  Keys whose names end
532           in <code>-uuid</code> have values that uniquely identify the entity
533           in question.  For a Citrix XenServer hypervisor, these values are
534           UUIDs in RFC 4122 format.  Other hypervisors may use other
535           formats.</p>
536         <p>The currently defined key-value pairs are:</p>
537         <dl>
538           <dt><code>vif-uuid</code></dt>
539           <dd>The virtual interface associated with this interface.</dd>
540           <dt><code>network-uuid</code></dt>
541           <dd>The virtual network to which this interface is attached.</dd>
542           <dt><code>vm-uuid</code></dt>
543           <dd>The VM to which this interface belongs.</dd>
544           <dt><code>vif-mac</code></dt>
545           <dd>The MAC address programmed into the "virtual hardware" for this
546               interface, in the
547               form <var>xx</var>:<var>xx</var>:<var>xx</var>:<var>xx</var>:<var>xx</var>:<var>xx</var>.
548               For Citrix XenServer, this is the value of the <code>MAC</code>
549               field in the VIF record for this interface.</dd>
550         </dl>
551       </column>
552
553       <column name="statistics">
554         <p>
555           Key-value pairs that report interface statistics.  The current
556           implementation updates these counters periodically.  In the future,
557           we plan to, instead, update them when an interface is created, when
558           they are queried (e.g. using an OVSDB <code>select</code> operation),
559           and just before an interface is deleted due to virtual interface
560           hot-unplug or VM shutdown, and perhaps at other times, but not on any
561           regular periodic basis.</p>
562         <p>
563           The currently defined key-value pairs are listed below.  These are
564           the same statistics reported by OpenFlow in its <code>struct
565           ofp_port_stats</code> structure.  If an interface does not support a
566           given statistic, then that pair is omitted.</p>
567         <ul>
568           <li>
569             Successful transmit and receive counters:
570             <dl>
571               <dt><code>rx_packets</code></dt>
572               <dd>Number of received packets.</dd>
573               <dt><code>rx_bytes</code></dt>
574               <dd>Number of received bytes.</dd>
575               <dt><code>tx_packets</code></dt>
576               <dd>Number of transmitted packets.</dd>
577               <dt><code>tx_bytes</code></dt>
578               <dd>Number of transmitted bytes.</dd>
579             </dl>
580           </li>
581           <li>
582             Receive errors:
583             <dl>
584               <dt><code>rx_dropped</code></dt>
585               <dd>Number of packets dropped by RX.</dd>
586               <dt><code>rx_frame_err</code></dt>
587               <dd>Number of frame alignment errors.</dd>
588               <dt><code>rx_over_err</code></dt>
589               <dd>Number of packets with RX overrun.</dd>
590               <dt><code>rx_crc_err</code></dt>
591               <dd>Number of CRC errors.</dd>
592               <dt><code>rx_errors</code></dt>
593               <dd>
594                 Total number of receive errors, greater than or equal
595                 to the sum of the above.
596               </dd>
597             </dl>
598           </li>
599           <li>
600             Transmit errors:
601             <dl>
602               <dt><code>tx_dropped</code></dt>
603               <dd>Number of packets dropped by TX.</dd>
604               <dt><code>collisions</code></dt>
605               <dd>Number of collisions.</dd>
606               <dt><code>tx_errors</code></dt>
607               <dd>
608                 Total number of transmit errors, greater
609                 than or equal to the sum of the above.
610               </dd>
611             </dl>
612           </li>
613         </ul>
614       </column>
615     </group>
616   </table>
617
618   <table name="QoS" title="Quality of Service configuration">
619     <p>Quality of Service (QoS) configuration for each Port that
620       references it.</p>
621
622     <column name="type">
623       <p>The type of QoS to implement.  The <ref table="Open_vSwitch"
624         column="capabilities"/> column in the <ref table="Open_vSwitch"/> table
625         identifies the types that a switch actually supports.  The currently
626         defined types are listed below:</p>
627       <dl>
628         <dt><code>linux-htb</code></dt>
629         <dd>Linux ``hierarchy token bucket'' classifier.</dd>
630       </dl>
631     </column>
632
633     <column name="queues">
634       <p>A map from queue numbers to <ref table="Queue"/> records.  The
635         supported range of queue numbers depend on <ref column="type"/>.  The
636         queue numbers are the same as the <code>queue_id</code> used in
637         OpenFlow in <code>struct ofp_action_enqueue</code> and other
638         structures.  Queue 0 is used by OpenFlow output actions that do not
639         specify a specific queue.</p>
640     </column>
641
642     <column name="other_config">
643       <p>Key-value pairs for configuring QoS features that depend on
644         <ref column="type"/>.</p>
645       <p>The <code>linux-htb</code> class supports the following key-value
646         pairs:</p>
647       <dl>
648         <dt><code>max-rate</code></dt>
649         <dd>Maximum rate shared by all queued traffic, in bit/s.
650           Optional.  If not specified, for physical interfaces, the
651           default is the link rate.  For other interfaces or if the
652           link rate cannot be determined, the default is currently 100
653           Mbps.</dd>
654       </dl>
655     </column>
656   </table>
657
658   <table name="Queue" title="QoS output queue.">
659     <p>A configuration for a port output queue, used in configuring Quality of
660       Service (QoS) features.  May be referenced by <ref column="queues"
661       table="QoS"/> column in <ref table="QoS"/> table.</p>
662
663     <column name="other_config">
664       <p>Key-value pairs for configuring the output queue.  The supported
665         key-value pairs and their meanings depend on the <ref column="type"/>
666         of the <ref column="QoS"/> records that reference this row.</p>
667       <p>The key-value pairs defined for <ref table="QoS"/> <ref table="QoS"
668         column="type"/> of <code>min-rate</code> are:</p>
669       <dl>
670         <dt><code>min-rate</code></dt>
671         <dd>Minimum guaranteed bandwidth, in bit/s.  Required.</dd>
672       </dl>
673       <p>The key-value pairs defined for <ref table="QoS"/> <ref table="QoS"
674         column="type"/> of <code>linux-htb</code> are:</p>
675       <dl>
676         <dt><code>min-rate</code></dt>
677         <dd>Minimum guaranteed bandwidth, in bit/s.  Required.</dd>
678         <dt><code>max-rate</code></dt>
679         <dd>Maximum allowed bandwidth, in bit/s.  Optional.  If specified, the
680           queue's rate will not be allowed to exceed the specified value, even
681           if excess bandwidth is available.  If unspecified, defaults to no
682           limit.</dd>
683         <dt><code>burst</code></dt>
684         <dd>Burst size, in bits.  This is the maximum amount of ``credits''
685           that a queue can accumulate while it is idle.  Optional.  Details of
686           the <code>linux-htb</code> implementation require a minimum burst
687           size, so a too-small <code>burst</code> will be silently
688           ignored.</dd>
689         <dt><code>priority</code></dt>
690         <dd>A nonnegative 32-bit integer.  Defaults to 0 if
691           unspecified.  A queue with a smaller <code>priority</code>
692           will receive all the excess bandwidth that it can use before
693           a queue with a larger value receives any.  Specific priority
694           values are unimportant; only relative ordering matters.</dd>
695       </dl>
696     </column>
697   </table>
698
699   <table name="Mirror" title="Port mirroring (SPAN/RSPAN).">
700     <p>A port mirror within a <ref table="Bridge"/>.</p>
701     <p>A port mirror configures a bridge to send selected frames to special
702       ``mirrored'' ports, in addition to their normal destinations.  Mirroring
703       traffic may also be referred to as SPAN or RSPAN, depending on the
704       mechanism used for delivery.</p>
705
706     <column name="name">
707       Arbitrary identifier for the <ref table="Mirror"/>.
708     </column>
709
710     <group title="Selecting Packets for Mirroring">
711       <column name="select_all">
712         If true, every packet arriving or departing on any port is
713         selected for mirroring.
714       </column>
715
716       <column name="select_dst_port">
717         Ports on which departing packets are selected for mirroring.
718       </column>
719
720       <column name="select_src_port">
721         Ports on which arriving packets are selected for mirroring.
722       </column>
723
724       <column name="select_vlan">
725         VLANs on which packets are selected for mirroring.  An empty set
726         selects packets on all VLANs.
727       </column>
728     </group>
729
730     <group title="Mirroring Destination Configuration">
731       <column name="output_port">
732         <p>Output port for selected packets, if nonempty.  Mutually exclusive
733           with <ref column="output_vlan"/>.</p>
734         <p>Specifying a port for mirror output reserves that port exclusively
735           for mirroring.  No frames other than those selected for mirroring
736           will be forwarded to the port, and any frames received on the port
737           will be discarded.</p>
738         <p>This type of mirroring is sometimes called SPAN.</p>
739       </column>
740
741       <column name="output_vlan">
742         <p>Output VLAN for selected packets, if nonempty.  Mutually exclusive
743           with <ref column="output_port"/>.</p>
744         <p>The frames will be sent out all ports that trunk
745           <ref column="output_vlan"/>, as well as any ports with implicit VLAN
746           <ref column="output_vlan"/>.  When a mirrored frame is sent out a
747           trunk port, the frame's VLAN tag will be set to
748           <ref column="output_vlan"/>, replacing any existing tag; when it is
749           sent out an implicit VLAN port, the frame will not be tagged.  This
750           type of mirroring is sometimes called RSPAN.</p>
751         <p><em>Please note:</em> Mirroring to a VLAN can disrupt a network that
752           contains unmanaged switches.  Consider an unmanaged physical switch
753           with two ports: port 1, connected to an end host, and port 2,
754           connected to an Open vSwitch configured to mirror received packets
755           into VLAN 123 on port 2.  Suppose that the end host sends a packet on
756           port 1 that the physical switch forwards to port 2.  The Open vSwitch
757           forwards this packet to its destination and then reflects it back on
758           port 2 in VLAN 123.  This reflected packet causes the unmanaged
759           physical switch to replace the MAC learning table entry, which
760           correctly pointed to port 1, with one that incorrectly points to port
761           2.  Afterward, the physical switch will direct packets destined for
762           the end host to the Open vSwitch on port 2, instead of to the end
763           host on port 1, disrupting connectivity.  If mirroring to a VLAN is
764           desired in this scenario, then the physical switch must be replaced
765           by one that learns Ethernet addresses on a per-VLAN basis.  In
766           addition, learning should be disabled on the VLAN containing mirrored
767           traffic. If this is not done then intermediate switches will learn
768           the MAC address of each end host from the mirrored traffic.  If
769           packets being sent to that end host are also mirrored, then they will
770           be dropped since the switch will attempt to send them out the input
771           port. Disabling learning for the VLAN will cause the switch to
772           correctly send the packet out all ports configured for that VLAN.  If
773           Open vSwitch is being used as an intermediate switch, learning can be
774           disabled by adding the mirrored VLAN to <ref column="flood_vlans"/>
775           in the appropriate <ref table="Bridge"/> table or tables.</p>
776       </column>
777     </group>
778   </table>
779
780   <table name="Controller" title="OpenFlow controller configuration.">
781     <p>An OpenFlow controller.</p>
782
783     <p>Open vSwitch permits a bridge to have any number of OpenFlow
784        controllers.  When multiple controllers are configured, Open vSwitch
785        connects to all of them simultaneously.  OpenFlow 1.0 does not specify
786        how multiple controllers coordinate in interacting with a single switch,
787        so more than one controller should be specified only if the controllers
788        are themselves designed to coordinate with each other.</p>
789
790     <group title="Core Features">
791       <column name="target">
792         <p>Connection method for controller.
793           The following connection methods are currently
794           supported:</p>
795         <dl>
796           <dt><code>ssl:<var>ip</var></code>[<code>:<var>port</var></code>]</dt>
797           <dd>
798             <p>The specified SSL <var>port</var> (default: 6633) on the host at
799               the given <var>ip</var>, which must be expressed as an IP address
800               (not a DNS name).  The <ref table="Open_vSwitch" column="ssl"/>
801               column in the <ref table="Open_vSwitch"/> must point to a valid
802               SSL configuration when this form is used.</p>
803             <p>SSL support is an optional feature that is not always built as
804               part of Open vSwitch.</p>
805           </dd>
806           <dt><code>tcp:<var>ip</var></code>[<code>:<var>port</var></code>]</dt>
807           <dd>The specified TCP <var>port</var> (default: 6633) on the host at
808             the given <var>ip</var>, which must be expressed as an IP address
809             (not a DNS name).</dd>
810           <dt><code>discover</code></dt>
811           <dd>
812             <p>Enables controller discovery.</p>
813             <p>In controller discovery mode, Open vSwitch broadcasts a DHCP
814               request with vendor class identifier <code>OpenFlow</code> across
815               all of the bridge's network devices.  It will accept any valid
816               DHCP reply that has the same vendor class identifier and includes
817               a vendor-specific option with code 1 whose contents are a string
818               specifying the location of the controller in the same format as
819               <ref column="target"/>.</p>
820             <p>The DHCP reply may also, optionally, include a vendor-specific
821               option with code 2 whose contents are a string specifying the URI
822               to the base of the OpenFlow PKI
823               (e.g. <code>http://192.168.0.1/openflow/pki</code>).  This URI is
824               used only for bootstrapping the OpenFlow PKI at initial switch
825               setup; <code>ovs-vswitchd</code> does not use it at all.</p>
826           </dd>
827           <dt><code>none</code></dt>
828           <dd>Disables the controller.</dd>
829         </dl>
830         <p>When multiple controllers are configured for a single bridge, the
831           <ref column="target"/> values must be unique.  Duplicate
832           <ref column="target"/> values yield unspecified results.</p>
833       </column>
834
835       <column name="connection_mode">
836         <p>If it is specified, this setting must be one of the following
837         strings that describes how Open vSwitch contacts this OpenFlow
838         controller over the network:</p>
839
840         <dl>
841           <dt><code>in-band</code></dt>
842           <dd>In this mode, this controller's OpenFlow traffic travels over the
843             bridge associated with the controller.  With this setting, Open
844             vSwitch allows traffic to and from the controller regardless of the
845             contents of the OpenFlow flow table.  (Otherwise, Open vSwitch
846             would never be able to connect to the controller, because it did
847             not have a flow to enable it.)  This is the most common connection
848             mode because it is not necessary to maintain two independent
849             networks.</dd>
850           <dt><code>out-of-band</code></dt>
851           <dd>In this mode, OpenFlow traffic uses a control network separate
852             from the bridge associated with this controller, that is, the
853             bridge does not use any of its own network devices to communicate
854             with the controller.  The control network must be configured
855             separately, before or after <code>ovs-vswitchd</code> is started.
856           </dd>
857         </dl>
858
859         <p>If not specified, the default is implementation-specific.  If
860           <ref column="target"/> is <code>discover</code>, the connection mode
861           is always treated as <code>in-band</code> regardless of the actual
862           setting.</p>
863       </column>
864     </group>
865
866     <group title="Controller Failure Detection and Handling">
867       <column name="max_backoff">
868         Maximum number of milliseconds to wait between connection attempts.
869         Default is implementation-specific.
870       </column>
871
872       <column name="inactivity_probe">
873         Maximum number of milliseconds of idle time on connection to
874         controller before sending an inactivity probe message.  If Open
875         vSwitch does not communicate with the controller for the specified
876         number of seconds, it will send a probe.  If a response is not
877         received for the same additional amount of time, Open vSwitch
878         assumes the connection has been broken and attempts to reconnect.
879         Default is implementation-specific.
880       </column>
881
882       <column name="fail_mode">
883         <p>When a controller is configured, it is, ordinarily, responsible
884           for setting up all flows on the switch.  Thus, if the connection to
885           the controller fails, no new network connections can be set up.
886           If the connection to the controller stays down long enough,
887           no packets can pass through the switch at all.  This setting
888           determines the switch's response to such a situation.  It may be set
889           to one of the following:
890           <dl>
891             <dt><code>standalone</code></dt>
892             <dd>If no message is received from the controller for three
893               times the inactivity probe interval
894               (see <ref column="inactivity_probe"/>), then Open vSwitch
895               will take over responsibility for setting up flows.  In
896               this mode, Open vSwitch causes the bridge to act like an
897               ordinary MAC-learning switch.  Open vSwitch will continue
898               to retry connecting to the controller in the background
899               and, when the connection succeeds, it will discontinue its
900               standalone behavior.</dd>
901             <dt><code>secure</code></dt>
902             <dd>Open vSwitch will not set up flows on its own when the
903               controller connection fails.  It will continue retry
904               connecting to the controller forever.</dd>
905           </dl>
906         </p>
907         <p>If this value is unset, the default is implementation-specific.</p>
908         <p>When more than one controller is configured,
909           <ref column="fail_mode"/> is considered only when none of the
910           configured controllers can be contacted.  At that point, the bridge
911           enters secure mode if any of the controllers'
912           <ref column="fail_mode"/> is set to <code>secure</code>.  Otherwise,
913           it enters standalone mode if at least one <ref column="fail_mode"/>
914           is set to <code>standalone</code>.  If none of the
915           <ref column="fail_mode"/> values are set, the default is
916           implementation-defined.</p>
917       </column>
918     </group>
919
920     <group title="OpenFlow Rate Limiting">
921         <column name="controller_rate_limit">
922           <p>The maximum rate at which packets in unknown flows will be
923             forwarded to the OpenFlow controller, in packets per second.  This
924             feature prevents a single bridge from overwhelming the controller.
925             If not specified, the default is implementation-specific.</p>
926           <p>In addition, when a high rate triggers rate-limiting, Open
927             vSwitch queues controller packets for each port and transmits
928             them to the controller at the configured rate.  The number of
929             queued packets is limited by
930             the <ref column="controller_burst_limit"/> value.  The packet
931             queue is shared fairly among the ports on a bridge.</p><p>Open
932             vSwitch maintains two such packet rate-limiters per bridge.
933             One of these applies to packets sent up to the controller
934             because they do not correspond to any flow.  The other applies
935             to packets sent up to the controller by request through flow
936             actions. When both rate-limiters are filled with packets, the
937             actual rate that packets are sent to the controller is up to
938             twice the specified rate.</p>
939         </column>
940
941         <column name="controller_burst_limit">
942           In conjunction with <ref column="controller_rate_limit"/>,
943           the maximum number of unused packet credits that the bridge will
944           allow to accumulate, in packets.  If not specified, the default
945           is implementation-specific.
946         </column>
947     </group>
948
949     <group title="Additional Discovery Configuration">
950       <p>These values are considered only when <ref column="target"/>
951         is <code>discover</code>.</p>
952
953       <column name="discover_accept_regex">
954         A POSIX
955         extended regular expression against which the discovered controller
956         location is validated.  The regular expression is implicitly
957         anchored at the beginning of the controller location string, as
958         if it begins with <code>^</code>.  If not specified, the default
959         is implementation-specific.
960       </column>
961
962       <column name="discover_update_resolv_conf">
963         Whether to update <code>/etc/resolv.conf</code> when the
964         controller is discovered.  If not specified, the default
965         is implementation-specific.  Open vSwitch will only modify
966         <code>/etc/resolv.conf</code> if the DHCP response that it receives
967         specifies one or more DNS servers.
968       </column>
969     </group>
970
971     <group title="Additional In-Band Configuration">
972       <p>These values are considered only in in-band control mode (see
973         <ref column="connection_mode"/>) and only when <ref column="target"/>
974         is not <code>discover</code>.  (For controller discovery, the network
975         configuration obtained via DHCP is used instead.)</p>
976
977       <p>When multiple controllers are configured on a single bridge, there
978         should be only one set of unique values in these columns.  If different
979         values are set for these columns in different controllers, the effect
980         is unspecified.</p>
981
982       <column name="local_ip">
983         The IP address to configure on the local port,
984         e.g. <code>192.168.0.123</code>.  If this value is unset, then
985         <ref column="local_netmask"/> and <ref column="local_gateway"/> are
986         ignored.
987       </column>
988
989       <column name="local_netmask">
990         The IP netmask to configure on the local port,
991         e.g. <code>255.255.255.0</code>.  If <ref column="local_ip"/> is set
992         but this value is unset, then the default is chosen based on whether
993         the IP address is class A, B, or C.
994       </column>
995
996       <column name="local_gateway">
997         The IP address of the gateway to configure on the local port, as a
998         string, e.g. <code>192.168.0.1</code>.  Leave this column unset if
999         this network has no gateway.
1000       </column>
1001     </group>
1002   </table>
1003
1004   <table name="NetFlow">
1005     A NetFlow target.  NetFlow is a protocol that exports a number of
1006     details about terminating IP flows, such as the principals involved
1007     and duration.
1008
1009     <column name="targets">
1010       NetFlow targets in the form
1011       <code><var>ip</var>:<var>port</var></code>.  The <var>ip</var>
1012       must be specified numerically, not as a DNS name.
1013     </column>
1014
1015     <column name="engine_id">
1016       Engine ID to use in NetFlow messages.  Defaults to datapath index
1017       if not specified.
1018     </column>
1019
1020     <column name="engine_type">
1021       Engine type to use in NetFlow messages.  Defaults to datapath
1022       index if not specified.
1023     </column>
1024
1025     <column name="active_timeout">
1026       The interval at which NetFlow records are sent for flows that are
1027       still active, in seconds.  A value of <code>0</code> requests the
1028       default timeout (currently 600 seconds); a value of <code>-1</code>
1029       disables active timeouts.
1030     </column>
1031
1032     <column name="add_id_to_interface">
1033       <p>If this column's value is <code>false</code>, the ingress and egress
1034         interface fields of NetFlow flow records are derived from OpenFlow port
1035         numbers.  When it is <code>true</code>, the 7 most significant bits of
1036         these fields will be replaced by the least significant 7 bits of the
1037         engine id.  This is useful because many NetFlow collectors do not
1038         expect multiple switches to be sending messages from the same host, so
1039         they do not store the engine information which could be used to
1040         disambiguate the traffic.</p>
1041       <p>When this option is enabled, a maximum of 508 ports are supported.</p>
1042     </column>
1043   </table>
1044
1045   <table name="SSL">
1046     SSL configuration for an Open_vSwitch.
1047
1048     <column name="private_key">
1049       Name of a PEM file containing the private key used as the switch's
1050       identity for SSL connections to the controller.
1051     </column>
1052
1053     <column name="certificate">
1054       Name of a PEM file containing a certificate, signed by the
1055       certificate authority (CA) used by the controller and manager,
1056       that certifies the switch's private key, identifying a trustworthy
1057       switch.
1058     </column>
1059
1060     <column name="ca_cert">
1061       Name of a PEM file containing the CA certificate used to verify
1062       that the switch is connected to a trustworthy controller.
1063     </column>
1064
1065     <column name="bootstrap_ca_cert">
1066       If set to <code>true</code>, then Open vSwitch will attempt to
1067       obtain the CA certificate from the controller on its first SSL
1068       connection and save it to the named PEM file. If it is successful,
1069       it will immediately drop the connection and reconnect, and from then
1070       on all SSL connections must be authenticated by a certificate signed
1071       by the CA certificate thus obtained.  <em>This option exposes the
1072         SSL connection to a man-in-the-middle attack obtaining the initial
1073         CA certificate.</em>  It may still be useful for bootstrapping.
1074     </column>
1075   </table>
1076
1077   <table name="sFlow">
1078     <p>An sFlow(R) target.  sFlow is a protocol for remote monitoring
1079       of switches.</p>
1080
1081     <column name="agent">
1082       Name of the network device whose IP address should be reported as the
1083       ``agent address'' to collectors.  If not specified, the IP address
1084       defaults to the <ref table="Controller" column="local_ip"/> in the
1085       collector's <ref table="Controller"/>.  If an agent IP address cannot be
1086       determined either way, sFlow is disabled.
1087     </column>
1088
1089     <column name="header">
1090       Number of bytes of a sampled packet to send to the collector.
1091       If not specified, the default is 128 bytes.
1092     </column>
1093
1094     <column name="polling">
1095       Polling rate in seconds to send port statistics to the collector.
1096       If not specified, defaults to 30 seconds.
1097     </column>
1098
1099     <column name="sampling">
1100       Rate at which packets should be sampled and sent to the collector.
1101       If not specified, defaults to 400, which means one out of 400
1102       packets, on average, will be sent to the collector.
1103     </column>
1104
1105     <column name="targets">
1106       sFlow targets in the form
1107       <code><var>ip</var>:<var>port</var></code>.
1108     </column>
1109   </table>
1110
1111   <table name="Capability">
1112     <p>Records in this table describe functionality supported by the hardware
1113       and software platform on which this Open vSwitch is based.  Clients
1114       should not modify this table.</p>
1115
1116     <p>A record in this table is meaningful only if it is referenced by the
1117       <ref table="Open_vSwitch" column="capabilities"/> column in the
1118       <ref table="Open_vSwitch"/> table.  The key used to reference it, called
1119       the record's ``category,'' determines the meanings of the
1120       <ref column="details"/> column.  The following general forms of
1121       categories are currently defined:</p>
1122
1123     <dl>
1124       <dt><code>qos-<var>type</var></code></dt>
1125       <dd><var>type</var> is supported as the value for
1126         <ref column="type" table="QoS"/> in the <ref table="QoS"/> table.
1127       </dd>
1128     </dl>
1129
1130     <column name="details">
1131       <p>Key-value pairs that describe capabilities.  The meaning of the pairs
1132       depends on the category key that the <ref table="Open_vSwitch"
1133       column="capabilities"/> column in the <ref table="Open_vSwitch"/> table
1134       uses to reference this record, as described above.</p>
1135
1136       <p>The presence of a record for category <code>qos-<var>type</var></code>
1137           indicates that the switch supports <var>type</var> as the value of
1138           the <ref table="QoS" column="type"/> column in the <ref table="QoS"/>
1139           table.  The following key-value pairs are defined to further describe
1140           QoS capabilities:</p>
1141
1142       <dl>
1143         <dt><code>n-queues</code></dt>
1144         <dd>Number of supported queues, as a positive integer.  Keys in the
1145           <ref table="QoS" column="queues"/> column for <ref table="QoS"/>
1146           records whose <ref table="QoS" column="type"/> value
1147           equals <var>type</var> must range between 0 and this value minus one,
1148           inclusive.</dd>
1149       </dl>
1150     </column>
1151   </table>
1152 </database>