tests: Reduce user burden for running "make check".
[cascardo/ovs.git] / ovn / ovn-nb.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <database name="ovn-nb" title="OVN Northbound Database">
3   <p>
4     This database is the interface between OVN and the cloud management system
5     (CMS), such as OpenStack, running above it.  The CMS produces almost all of
6     the contents of the database.  The <code>ovn-northd</code> program
7     monitors the database contents, transforms it, and stores it into the <ref
8     db="OVN_Southbound"/> database.
9   </p>
10
11   <p>
12     We generally speak of ``the'' CMS, but one can imagine scenarios in
13     which multiple CMSes manage different parts of an OVN deployment.
14   </p>
15
16   <h2>External IDs</h2>
17
18   <p>
19     Each of the tables in this database contains a special column, named
20     <code>external_ids</code>.  This column has the same form and purpose each
21     place it appears.
22   </p>
23
24   <dl>
25     <dt><code>external_ids</code>: map of string-string pairs</dt>
26     <dd>
27       Key-value pairs for use by the CMS.  The CMS might use certain pairs, for
28       example, to identify entities in its own configuration that correspond to
29       those in this database.
30     </dd>
31   </dl>
32
33   <table name="Logical_Switch" title="L2 logical switch">
34     <p>
35       Each row represents one L2 logical switch.  A given switch's ports are
36       the <ref table="Logical_Port"/> rows whose <ref table="Logical_Port"
37       column="lswitch"/> column points to its row.
38     </p>
39
40     <column name="name">
41       <p>
42         A name for the logical switch.  This name has no special meaning or purpose
43         other than to provide convenience for human interaction with the ovn-nb
44         database.  There is no requirement for the name to be unique.  The
45         logical switch's UUID should be used as the unique identifier.
46       </p>
47     </column>
48
49     <column name="router_port">
50       <p>
51         The router port to which this logical switch is connected, or empty if
52         this logical switch is not connected to any router.  A switch may be
53         connected to at most one logical router, but this is not a significant
54         restriction because logical routers may be connected into arbitrary
55         topologies.
56       </p>
57     </column>
58
59     <group title="Common Columns">
60       <column name="external_ids">
61         See <em>External IDs</em> at the beginning of this document.
62       </column>
63     </group>
64   </table>
65
66   <table name="Logical_Port" title="L2 logical switch port">
67     <p>
68       A port within an L2 logical switch.
69     </p>
70
71     <column name="lswitch">
72       The logical switch to which the logical port is connected.
73     </column>
74
75     <column name="name">
76       <p>
77       The logical port name.
78       </p>
79
80       <p>
81       For entities (VMs or containers) that are spawned in the hypervisor,
82       the name used here must match those used in the <ref key="iface-id"
83       table="Interface" column="external_ids" db="Open_vSwitch"/> in the
84       <ref db="Open_vSwitch"/> database's <ref table="Interface"
85       db="Open_vSwitch"/> table, because hypervisors use <ref key="iface-id"
86       table="Interface" column="external_ids" db="Open_vSwitch"/> as a lookup
87       key to identify the network interface of that entity.
88       </p>
89
90       <p>
91       For containers that are spawned inside a VM, the name can be
92       any unique identifier.  In such a case, <ref column="parent_name"/>
93       must be populated.
94       </p>
95     </column>
96
97     <column name="parent_name">
98       When <ref column="name"/> identifies the interface of a container
99       spawned inside a tenant VM, this column represents the VM interface
100       through which the container interface sends its network traffic.
101       The name used here must match those used in the <ref key="iface-id"
102       table="Interface" column="external_ids" db="Open_vSwitch"/> in the
103       <ref db="Open_vSwitch"/> table, because hypervisors in this case use
104       <ref key="iface-id" table="Interface" column="external_ids"
105       db="Open_vSwitch"/> as a lookup key to identify the network interface
106       of the tenant VM.
107     </column>
108
109     <column name="tag">
110       When <ref column="name"/> identifies the interface of a container
111       spawned inside a tenant VM, this column identifies the VLAN tag in
112       the network traffic associated with that container's network interface.
113       When there are multiple container interfaces inside a VM, all of
114       them send their network traffic through a single VM network interface and
115       this value helps OVN identify the correct container interface.
116     </column>
117
118     <column name="up">
119       This column is populated by <code>ovn-northd</code>, rather than by
120       the CMS plugin as is most of this database.  When a logical port is bound
121       to a physical location in the OVN Southbound database <ref
122       db="OVN_Southbound" table="Binding"/> table, <code>ovn-northd</code>
123       sets this column to <code>true</code>; otherwise, or if the port
124       becomes unbound later, it sets it to <code>false</code>.  This
125       allows the CMS to wait for a VM's (or container's) networking to
126       become active before it allows the VM (or container) to start.
127     </column>
128
129     <column name="enabled">
130       This column is used to administratively set port state.  If this column is
131       empty or is set to <code>true</code>, the port is enabled.  If this column
132       is set to <code>false</code>, the port is disabled.  A disabled port has all
133       ingress and egress traffic dropped.
134     </column>
135
136     <column name="macs">
137       The logical port's own Ethernet address or addresses, each in the form
138       <var>xx</var>:<var>xx</var>:<var>xx</var>:<var>xx</var>:<var>xx</var>:<var>xx</var>.
139       Like a physical Ethernet NIC, a logical port ordinarily has a single
140       fixed Ethernet address.  The string <code>unknown</code> is also allowed
141       to indicate that the logical port has an unknown set of (additional)
142       source addresses.
143     </column>
144
145     <column name="port_security">
146       <p>
147         A set of L2 (Ethernet) addresses
148         from which the logical port is allowed to send packets and to which it
149         is allowed to receive packets.  If this column is empty, all addresses
150         are permitted.  Logical ports are always allowed to receive packets
151         addressed to multicast and broadcast addresses.
152       </p>
153
154       <p>
155         Each member of the set is an Ethernet address in the form
156         <var>xx</var>:<var>xx</var>:<var>xx</var>:<var>xx</var>:<var>xx</var>:<var>xx</var>.
157       </p>
158
159       <p>
160         This specification will be extended to support L3 port security.
161       </p>
162     </column>
163
164     <group title="Common Columns">
165       <column name="external_ids">
166         See <em>External IDs</em> at the beginning of this document.
167       </column>
168     </group>
169   </table>
170
171   <table name="ACL" title="Access Control List (ACL) rule">
172     <p>
173       Each row in this table represents one ACL rule for the logical switch in
174       its <ref column="lswitch"/> column.  The <ref column="action"/> column for
175       the highest-<ref column="priority"/> matching row in this table
176       determines a packet's treatment.  If no row matches, packets are allowed
177       by default.  (Default-deny treatment is possible: add a rule with <ref
178       column="priority"/> 1, <code>1</code> as <ref column="match"/>, and
179       <code>deny</code> as <ref column="action"/>.)
180     </p>
181
182     <column name="lswitch">
183       The switch to which the ACL rule applies.  The expression in the
184       <ref column="match"/> column may match against logical ports
185       within this switch.
186     </column>
187
188     <column name="priority">
189       The ACL rule's priority.  Rules with numerically higher priority take
190       precedence over those with lower.  If two ACL rules with the same
191       priority both match, then the one actually applied to a packet is
192       undefined.
193     </column>
194
195     <column name="match">
196       The packets that the ACL should match, in the same expression
197       language used for the <ref column="match" table="Pipeline"
198       db="OVN_Southbound"/> column in the OVN Southbound database's <ref
199       table="Pipeline" db="OVN_Southbound"/> table.  Match
200       <code>inport</code> and <code>outport</code> against names of
201       logical ports within <ref column="lswitch"/> to implement ingress
202       and egress ACLs, respectively.  In logical switches connected to
203       logical routers, the special port name <code>ROUTER</code> refers
204       to the logical router port.
205     </column>
206
207     <column name="action">
208       <p>The action to take when the ACL rule matches:</p>
209       
210       <ul>
211         <li>
212           <code>allow</code>: Forward the packet.
213         </li>
214
215         <li>
216           <code>allow-related</code>: Forward the packet and related traffic
217           (e.g. inbound replies to an outbound connection).
218         </li>
219
220         <li>
221           <code>drop</code>: Silently drop the packet.
222         </li>
223
224         <li>
225           <code>reject</code>: Drop the packet, replying with a RST for TCP or
226           ICMP unreachable message for other IP-based protocols.
227         </li>
228       </ul>
229
230       <p>
231         Only <code>allow</code> and <code>drop</code> are implemented:
232         <code>allow-related</code> is currently treated as <code>allow</code>,
233         and <code>reject</code> as <code>drop</code>.
234       </p>
235     </column>
236
237     <column name="log">
238       <p>
239         If set to <code>true</code>, packets that match the ACL will trigger a
240         log message on the transport node or nodes that perform ACL processing.
241         Logging may be combined with any <ref column="action"/>.
242       </p>
243
244       <p>
245         Logging is not yet implemented.
246       </p>
247     </column>
248
249     <group title="Common Columns">
250       <column name="external_ids">
251         See <em>External IDs</em> at the beginning of this document.
252       </column>
253     </group>
254   </table>
255
256   <table name="Logical_Router" title="L3 logical router">
257     <p>
258       Each row represents one L3 logical router.  A given router's ports are
259       the <ref table="Logical_Router_Port"/> rows whose <ref
260       table="Logical_Router_Port" column="router"/> column points to its row.
261     </p>
262
263     <column name="ip">
264       The logical router's own IP address.  The logical router uses this
265       address for ICMP replies (e.g. network unreachable messages) and other
266       traffic that it originates and responds to traffic destined to this
267       address (e.g. ICMP echo requests).
268     </column>
269
270     <column name="default_gw">
271       IP address to use as default gateway, if any.
272     </column>
273
274     <group title="Common Columns">
275       <column name="external_ids">
276         See <em>External IDs</em> at the beginning of this document.
277       </column>
278     </group>
279   </table>
280
281   <table name="Logical_Router_Port" title="L3 logical router port">
282     <p>
283       A port within an L3 logical router.
284     </p>
285
286     <p>
287       A router port is always attached to a switch port.  The connection can be
288       identified by following the <ref column="router_port"
289       table="Logical_Port"/> column from an appropriate <ref
290       table="Logical_Port"/> row.
291     </p>
292
293     <column name="router">
294       The router to which the port belongs.
295     </column>
296
297     <column name="network">
298       The IP network and netmask of the network on the router port.  Used for
299       routing.
300     </column>
301
302     <column name="mac">
303       The Ethernet address that belongs to this router port.
304     </column>
305
306     <group title="Common Columns">
307       <column name="external_ids">
308         See <em>External IDs</em> at the beginning of this document.
309       </column>
310     </group>
311   </table>
312 </database>