]> git.proxmox.com Git - ovs.git/blob - ovn/ovn-sb.xml
Copy external_ids from Logical_Switch_Port to SB database
[ovs.git] / ovn / ovn-sb.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <database name="ovn-sb" title="OVN Southbound Database">
3 <p>
4 This database holds logical and physical configuration and state for the
5 Open Virtual Network (OVN) system to support virtual network abstraction.
6 For an introduction to OVN, please see <code>ovn-architecture</code>(7).
7 </p>
8
9 <p>
10 The OVN Southbound database sits at the center of the OVN
11 architecture. It is the one component that speaks both southbound
12 directly to all the hypervisors and gateways, via
13 <code>ovn-controller</code>/<code>ovn-controller-vtep</code>, and
14 northbound to the Cloud Management System, via <code>ovn-northd</code>:
15 </p>
16
17 <h2>Database Structure</h2>
18
19 <p>
20 The OVN Southbound database contains classes of data with
21 different properties, as described in the sections below.
22 </p>
23
24 <h3>Physical Network (PN) data</h3>
25
26 <p>
27 PN tables contain information about the chassis nodes in the system. This
28 contains all the information necessary to wire the overlay, such as IP
29 addresses, supported tunnel types, and security keys.
30 </p>
31
32 <p>
33 The amount of PN data is small (O(n) in the number of chassis) and it
34 changes infrequently, so it can be replicated to every chassis.
35 </p>
36
37 <p>
38 The <ref table="Chassis"/> table comprises the PN tables.
39 </p>
40
41 <h3>Logical Network (LN) data</h3>
42
43 <p>
44 LN tables contain the topology of logical switches and routers, ACLs,
45 firewall rules, and everything needed to describe how packets traverse a
46 logical network, represented as logical datapath flows (see Logical
47 Datapath Flows, below).
48 </p>
49
50 <p>
51 LN data may be large (O(n) in the number of logical ports, ACL rules,
52 etc.). Thus, to improve scaling, each chassis should receive only data
53 related to logical networks in which that chassis participates. Past
54 experience shows that in the presence of large logical networks, even
55 finer-grained partitioning of data, e.g. designing logical flows so that
56 only the chassis hosting a logical port needs related flows, pays off
57 scale-wise. (This is not necessary initially but it is worth bearing in
58 mind in the design.)
59 </p>
60
61 <p>
62 The LN is a slave of the cloud management system running northbound of OVN.
63 That CMS determines the entire OVN logical configuration and therefore the
64 LN's content at any given time is a deterministic function of the CMS's
65 configuration, although that happens indirectly via the
66 <ref db="OVN_Northbound"/> database and <code>ovn-northd</code>.
67 </p>
68
69 <p>
70 LN data is likely to change more quickly than PN data. This is especially
71 true in a container environment where VMs are created and destroyed (and
72 therefore added to and deleted from logical switches) quickly.
73 </p>
74
75 <p>
76 <ref table="Logical_Flow"/> and <ref table="Multicast_Group"/> contain LN
77 data.
78 </p>
79
80 <h3>Logical-physical bindings</h3>
81
82 <p>
83 These tables link logical and physical components. They show the current
84 placement of logical components (such as VMs and VIFs) onto chassis, and
85 map logical entities to the values that represent them in tunnel
86 encapsulations.
87 </p>
88
89 <p>
90 These tables change frequently, at least every time a VM powers up or down
91 or migrates, and especially quickly in a container environment. The
92 amount of data per VM (or VIF) is small.
93 </p>
94
95 <p>
96 Each chassis is authoritative about the VMs and VIFs that it hosts at any
97 given time and can efficiently flood that state to a central location, so
98 the consistency needs are minimal.
99 </p>
100
101 <p>
102 The <ref table="Port_Binding"/> and <ref table="Datapath_Binding"/> tables
103 contain binding data.
104 </p>
105
106 <h3>MAC bindings</h3>
107
108 <p>
109 The <ref table="MAC_Binding"/> table tracks the bindings from IP addresses
110 to Ethernet addresses that are dynamically discovered using ARP (for IPv4)
111 and neighbor discovery (for IPv6). Usually, IP-to-MAC bindings for virtual
112 machines are statically populated into the <ref table="Port_Binding"/>
113 table, so <ref table="MAC_Binding"/> is primarily used to discover bindings
114 on physical networks.
115 </p>
116
117 <h2>Common Columns</h2>
118
119 <p>
120 Some tables contain a special column named <code>external_ids</code>. This
121 column has the same form and purpose each place that it appears, so we
122 describe it here to save space later.
123 </p>
124
125 <dl>
126 <dt><code>external_ids</code>: map of string-string pairs</dt>
127 <dd>
128 Key-value pairs for use by the software that manages the OVN Southbound
129 database rather than by
130 <code>ovn-controller</code>/<code>ovn-controller-vtep</code>. In
131 particular, <code>ovn-northd</code> can use key-value pairs in this
132 column to relate entities in the southbound database to higher-level
133 entities (such as entities in the OVN Northbound database). Individual
134 key-value pairs in this column may be documented in some cases to aid
135 in understanding and troubleshooting, but the reader should not mistake
136 such documentation as comprehensive.
137 </dd>
138 </dl>
139
140 <table name="SB_Global" title="Southbound configuration">
141 <p>
142 Southbound configuration for an OVN system. This table must have exactly
143 one row.
144 </p>
145
146 <group title="Status">
147 This column allow a client to track the overall configuration state of
148 the system.
149
150 <column name="nb_cfg">
151 Sequence number for the configuration. When a CMS or
152 <code>ovn-nbctl</code> updates the northbound database, it increments
153 the <code>nb_cfg</code> column in the <code>NB_Global</code> table in
154 the northbound database. In turn, when <code>ovn-northd</code> updates
155 the southbound database to bring it up to date with these changes, it
156 updates this column to the same value.
157 </column>
158 </group>
159
160 <group title="Common Columns">
161 <column name="external_ids">
162 See <em>External IDs</em> at the beginning of this document.
163 </column>
164 </group>
165 <group title="Connection Options">
166 <column name="connections">
167 Database clients to which the Open vSwitch database server should
168 connect or on which it should listen, along with options for how these
169 connections should be configured. See the <ref table="Connection"/>
170 table for more information.
171 </column>
172 <column name="ssl">
173 Global SSL configuration.
174 </column>
175 </group>
176 </table>
177
178 <table name="Chassis" title="Physical Network Hypervisor and Gateway Information">
179 <p>
180 Each row in this table represents a hypervisor or gateway (a chassis) in
181 the physical network (PN). Each chassis, via
182 <code>ovn-controller</code>/<code>ovn-controller-vtep</code>, adds
183 and updates its own row, and keeps a copy of the remaining rows to
184 determine how to reach other hypervisors.
185 </p>
186
187 <p>
188 When a chassis shuts down gracefully, it should remove its own row.
189 (This is not critical because resources hosted on the chassis are equally
190 unreachable regardless of whether the row is present.) If a chassis
191 shuts down permanently without removing its row, some kind of manual or
192 automatic cleanup is eventually needed; we can devise a process for that
193 as necessary.
194 </p>
195
196 <column name="name">
197 OVN does not prescribe a particular format for chassis names.
198 ovn-controller populates this column using <ref key="system-id"
199 table="Open_vSwitch" column="external_ids" db="Open_vSwitch"/>
200 in the Open_vSwitch database's <ref table="Open_vSwitch"
201 db="Open_vSwitch"/> table. ovn-controller-vtep populates this
202 column with <ref table="Physical_Switch" column="name"
203 db="hardware_vtep"/> in the hardware_vtep database's
204 <ref table="Physical_Switch" db="hardware_vtep"/> table.
205 </column>
206
207 <column name="hostname">
208 The hostname of the chassis, if applicable. ovn-controller will populate
209 this column with the hostname of the host it is running on.
210 ovn-controller-vtep will leave this column empty.
211 </column>
212
213 <column name="nb_cfg">
214 Sequence number for the configuration. When <code>ovn-controller</code>
215 updates the configuration of a chassis from the contents of the
216 southbound database, it copies <ref table="SB_Global" column="nb_cfg"/>
217 from the <ref table="SB_Global"/> table into this column.
218 </column>
219
220 <column name="external_ids" key="ovn-bridge-mappings">
221 <code>ovn-controller</code> populates this key with the set of bridge
222 mappings it has been configured to use. Other applications should treat
223 this key as read-only. See <code>ovn-controller</code>(8) for more
224 information.
225 </column>
226
227 <column name="external_ids" key="datapath-type">
228 <code>ovn-controller</code> populates this key with the datapath type
229 configured in the <ref table="Bridge" column="datapath_type"/> column of
230 the Open_vSwitch database's <ref table="Bridge" db="Open_vSwitch"/>
231 table. Other applications should treat this key as read-only. See
232 <code>ovn-controller</code>(8) for more information.
233 </column>
234
235 <column name="external_ids" key="iface-types">
236 <code>ovn-controller</code> populates this key with the interface types
237 configured in the <ref table="Open_vSwitch" column="iface_types"/> column
238 of the Open_vSwitch database's <ref table="Open_vSwitch"
239 db="Open_vSwitch"/> table. Other applications should treat this key as
240 read-only. See <code>ovn-controller</code>(8) for more information.
241 </column>
242
243 <group title="Common Columns">
244 The overall purpose of these columns is described under <code>Common
245 Columns</code> at the beginning of this document.
246
247 <column name="external_ids"/>
248 </group>
249
250 <group title="Encapsulation Configuration">
251 <p>
252 OVN uses encapsulation to transmit logical dataplane packets
253 between chassis.
254 </p>
255
256 <column name="encaps">
257 Points to supported encapsulation configurations to transmit
258 logical dataplane packets to this chassis. Each entry is a <ref
259 table="Encap"/> record that describes the configuration.
260 </column>
261 </group>
262
263 <group title="Gateway Configuration">
264 <p>
265 A <dfn>gateway</dfn> is a chassis that forwards traffic between the
266 OVN-managed part of a logical network and a physical VLAN, extending a
267 tunnel-based logical network into a physical network. Gateways are
268 typically dedicated nodes that do not host VMs and will be controlled
269 by <code>ovn-controller-vtep</code>.
270 </p>
271
272 <column name="vtep_logical_switches">
273 Stores all VTEP logical switch names connected by this gateway
274 chassis. The <ref table="Port_Binding"/> table entry with
275 <ref column="options" table="Port_Binding"/>:<code>vtep-physical-switch</code>
276 equal <ref table="Chassis"/> <ref column="name" table="Chassis"/>, and
277 <ref column="options" table="Port_Binding"/>:<code>vtep-logical-switch</code>
278 value in <ref table="Chassis"/>
279 <ref column="vtep_logical_switches" table="Chassis"/>, will be
280 associated with this <ref table="Chassis"/>.
281 </column>
282 </group>
283 </table>
284
285 <table name="Encap" title="Encapsulation Types">
286 <p>
287 The <ref column="encaps" table="Chassis"/> column in the <ref
288 table="Chassis"/> table refers to rows in this table to identify
289 how OVN may transmit logical dataplane packets to this chassis.
290 Each chassis, via <code>ovn-controller</code>(8) or
291 <code>ovn-controller-vtep</code>(8), adds and updates its own rows
292 and keeps a copy of the remaining rows to determine how to reach
293 other chassis.
294 </p>
295
296 <column name="type">
297 The encapsulation to use to transmit packets to this chassis.
298 Hypervisors must use either <code>geneve</code> or
299 <code>stt</code>. Gateways may use <code>vxlan</code>,
300 <code>geneve</code>, or <code>stt</code>.
301 </column>
302
303 <column name="options">
304 <p>
305 Options for configuring the encapsulation. Currently, the only
306 option that has been defined is <code>csum</code>.
307 </p>
308
309 <p>
310 <code>csum</code> indicates that encapsulation checksums can be
311 transmitted and received with reasonable performance. It is a hint
312 to senders transmitting data to this chassis that they should use
313 checksums to protect OVN metadata. <code>ovn-controller</code>
314 populates this key with the value defined in
315 <ref table="Open_vSwitch" column="external_ids:ovn-encap-csum"/> column
316 of the Open_vSwitch database's <ref table="Open_vSwitch"
317 db="Open_vSwitch"/> table. Other applications should treat this key as
318 read-only. See <code>ovn-controller</code>(8) for more information.
319 </p>
320
321 <p>
322 In terms of performance, this actually significantly increases
323 throughput in most common cases when running on Linux based hosts
324 without NICs supporting encapsulation hardware offload (around 60% for
325 bulk traffic). The reason is that generally all NICs are capable of
326 offloading transmitted and received TCP/UDP checksums (viewed as
327 ordinary data packets and not as tunnels). The benefit comes on the
328 receive side where the validated outer checksum can be used to
329 additionally validate an inner checksum (such as TCP), which in turn
330 allows aggregation of packets to be more efficiently handled by the
331 rest of the stack.
332 </p>
333
334 <p>
335 Not all devices see such a benefit. The most notable exception is
336 hardware VTEPs. These devices are designed to not buffer entire
337 packets in their switching engines and are therefore unable to
338 efficiently compute or validate full packet checksums. In addition
339 certain versions of the Linux kernel are not able to fully take
340 advantage of encapsulation NIC offloads in the presence of checksums.
341 (This is actually a pretty narrow corner case though - earlier
342 versions of Linux don't support encapsulation offloads at all and
343 later versions support both offloads and checksums well.)
344 </p>
345
346 <p>
347 <code>csum</code> defaults to <code>false</code> for hardware VTEPs and
348 <code>true</code> for all other cases.
349 </p>
350 </column>
351
352 <column name="ip">
353 The IPv4 address of the encapsulation tunnel endpoint.
354 </column>
355 </table>
356
357 <table name="Address_Set" title="Address Sets">
358 <p>
359 See the documentation for the <ref table="Address_Set"
360 db="OVN_Northbound"/> table in the <ref db="OVN_Northbound"/> database
361 for details.
362 </p>
363
364 <column name="name"/>
365 <column name="addresses"/>
366 </table>
367
368 <table name="Logical_Flow" title="Logical Network Flows">
369 <p>
370 Each row in this table represents one logical flow.
371 <code>ovn-northd</code> populates this table with logical flows
372 that implement the L2 and L3 topologies specified in the
373 <ref db="OVN_Northbound"/> database. Each hypervisor, via
374 <code>ovn-controller</code>, translates the logical flows into
375 OpenFlow flows specific to its hypervisor and installs them into
376 Open vSwitch.
377 </p>
378
379 <p>
380 Logical flows are expressed in an OVN-specific format, described here. A
381 logical datapath flow is much like an OpenFlow flow, except that the
382 flows are written in terms of logical ports and logical datapaths instead
383 of physical ports and physical datapaths. Translation between logical
384 and physical flows helps to ensure isolation between logical datapaths.
385 (The logical flow abstraction also allows the OVN centralized
386 components to do less work, since they do not have to separately
387 compute and push out physical flows to each chassis.)
388 </p>
389
390 <p>
391 The default action when no flow matches is to drop packets.
392 </p>
393
394 <p><em>Architectural Logical Life Cycle of a Packet</em></p>
395
396 <p>
397 This following description focuses on the life cycle of a packet through
398 a logical datapath, ignoring physical details of the implementation.
399 Please refer to <em>Architectural Physical Life Cycle of a Packet</em> in
400 <code>ovn-architecture</code>(7) for the physical information.
401 </p>
402
403 <p>
404 The description here is written as if OVN itself executes these steps,
405 but in fact OVN (that is, <code>ovn-controller</code>) programs Open
406 vSwitch, via OpenFlow and OVSDB, to execute them on its behalf.
407 </p>
408
409 <p>
410 At a high level, OVN passes each packet through the logical datapath's
411 logical ingress pipeline, which may output the packet to one or more
412 logical port or logical multicast groups. For each such logical output
413 port, OVN passes the packet through the datapath's logical egress
414 pipeline, which may either drop the packet or deliver it to the
415 destination. Between the two pipelines, outputs to logical multicast
416 groups are expanded into logical ports, so that the egress pipeline only
417 processes a single logical output port at a time. Between the two
418 pipelines is also where, when necessary, OVN encapsulates a packet in a
419 tunnel (or tunnels) to transmit to remote hypervisors.
420 </p>
421
422 <p>
423 In more detail, to start, OVN searches the <ref table="Logical_Flow"/>
424 table for a row with correct <ref column="logical_datapath"/>, a <ref
425 column="pipeline"/> of <code>ingress</code>, a <ref column="table_id"/>
426 of 0, and a <ref column="match"/> that is true for the packet. If none
427 is found, OVN drops the packet. If OVN finds more than one, it chooses
428 the match with the highest <ref column="priority"/>. Then OVN executes
429 each of the actions specified in the row's <ref table="actions"/> column,
430 in the order specified. Some actions, such as those to modify packet
431 headers, require no further details. The <code>next</code> and
432 <code>output</code> actions are special.
433 </p>
434
435 <p>
436 The <code>next</code> action causes the above process to be repeated
437 recursively, except that OVN searches for <ref column="table_id"/> of 1
438 instead of 0. Similarly, any <code>next</code> action in a row found in
439 that table would cause a further search for a <ref column="table_id"/> of
440 2, and so on. When recursive processing completes, flow control returns
441 to the action following <code>next</code>.
442 </p>
443
444 <p>
445 The <code>output</code> action also introduces recursion. Its effect
446 depends on the current value of the <code>outport</code> field. Suppose
447 <code>outport</code> designates a logical port. First, OVN compares
448 <code>inport</code> to <code>outport</code>; if they are equal, it treats
449 the <code>output</code> as a no-op by default. In the common
450 case, where they are different, the packet enters the egress
451 pipeline. This transition to the egress pipeline discards
452 register data, e.g. <code>reg0</code> ... <code>reg9</code> and
453 connection tracking state, to achieve uniform behavior regardless
454 of whether the egress pipeline is on a different hypervisor
455 (because registers aren't preserve across tunnel encapsulation).
456 </p>
457
458 <p>
459 To execute the egress pipeline, OVN again searches the <ref
460 table="Logical_Flow"/> table for a row with correct <ref
461 column="logical_datapath"/>, a <ref column="table_id"/> of 0, a <ref
462 column="match"/> that is true for the packet, but now looking for a <ref
463 column="pipeline"/> of <code>egress</code>. If no matching row is found,
464 the output becomes a no-op. Otherwise, OVN executes the actions for the
465 matching flow (which is chosen from multiple, if necessary, as already
466 described).
467 </p>
468
469 <p>
470 In the <code>egress</code> pipeline, the <code>next</code> action acts as
471 already described, except that it, of course, searches for
472 <code>egress</code> flows. The <code>output</code> action, however, now
473 directly outputs the packet to the output port (which is now fixed,
474 because <code>outport</code> is read-only within the egress pipeline).
475 </p>
476
477 <p>
478 The description earlier assumed that <code>outport</code> referred to a
479 logical port. If it instead designates a logical multicast group, then
480 the description above still applies, with the addition of fan-out from
481 the logical multicast group to each logical port in the group. For each
482 member of the group, OVN executes the logical pipeline as described, with
483 the logical output port replaced by the group member.
484 </p>
485
486 <p><em>Pipeline Stages</em></p>
487
488 <p>
489 <code>ovn-northd</code> populates the <ref table="Logical_Flow"/> table
490 with the logical flows described in detail in <code>ovn-northd</code>(8).
491 </p>
492
493 <column name="logical_datapath">
494 The logical datapath to which the logical flow belongs.
495 </column>
496
497 <column name="pipeline">
498 <p>
499 The primary flows used for deciding on a packet's destination are the
500 <code>ingress</code> flows. The <code>egress</code> flows implement
501 ACLs. See <em>Logical Life Cycle of a Packet</em>, above, for details.
502 </p>
503 </column>
504
505 <column name="table_id">
506 The stage in the logical pipeline, analogous to an OpenFlow table number.
507 </column>
508
509 <column name="priority">
510 The flow's priority. Flows with numerically higher priority take
511 precedence over those with lower. If two logical datapath flows with the
512 same priority both match, then the one actually applied to the packet is
513 undefined.
514 </column>
515
516 <column name="match">
517 <p>
518 A matching expression. OVN provides a superset of OpenFlow matching
519 capabilities, using a syntax similar to Boolean expressions in a
520 programming language.
521 </p>
522
523 <p>
524 The most important components of match expression are
525 <dfn>comparisons</dfn> between <dfn>symbols</dfn> and
526 <dfn>constants</dfn>, e.g. <code>ip4.dst == 192.168.0.1</code>,
527 <code>ip.proto == 6</code>, <code>arp.op == 1</code>, <code>eth.type ==
528 0x800</code>. The logical AND operator <code>&amp;&amp;</code> and
529 logical OR operator <code>||</code> can combine comparisons into a
530 larger expression.
531 </p>
532
533 <p>
534 Matching expressions also support parentheses for grouping, the logical
535 NOT prefix operator <code>!</code>, and literals <code>0</code> and
536 <code>1</code> to express ``false'' or ``true,'' respectively. The
537 latter is useful by itself as a catch-all expression that matches every
538 packet.
539 </p>
540
541 <p>
542 Match expressions also support a kind of function syntax. The
543 following functions are supported:
544 </p>
545
546 <dl>
547 <dt><code>is_chassis_resident(<var>lport</var>)</code></dt>
548 <dd>
549 Evaluates to true on a chassis on which logical port <var>lport</var>
550 (a quoted string) resides, and to false elsewhere. This function was
551 introduced in OVN 2.7.
552 </dd>
553 </dl>
554
555 <p><em>Symbols</em></p>
556
557 <p>
558 <em>Type</em>. Symbols have <dfn>integer</dfn> or <dfn>string</dfn>
559 type. Integer symbols have a <dfn>width</dfn> in bits.
560 </p>
561
562 <p>
563 <em>Kinds</em>. There are three kinds of symbols:
564 </p>
565
566 <ul>
567 <li>
568 <p>
569 <dfn>Fields</dfn>. A field symbol represents a packet header or
570 metadata field. For example, a field
571 named <code>vlan.tci</code> might represent the VLAN TCI field in a
572 packet.
573 </p>
574
575 <p>
576 A field symbol can have integer or string type. Integer fields can
577 be nominal or ordinal (see <em>Level of Measurement</em>,
578 below).
579 </p>
580 </li>
581
582 <li>
583 <p>
584 <dfn>Subfields</dfn>. A subfield represents a subset of bits from
585 a larger field. For example, a field <code>vlan.vid</code> might
586 be defined as an alias for <code>vlan.tci[0..11]</code>. Subfields
587 are provided for syntactic convenience, because it is always
588 possible to instead refer to a subset of bits from a field
589 directly.
590 </p>
591
592 <p>
593 Only ordinal fields (see <em>Level of Measurement</em>,
594 below) may have subfields. Subfields are always ordinal.
595 </p>
596 </li>
597
598 <li>
599 <p>
600 <dfn>Predicates</dfn>. A predicate is shorthand for a Boolean
601 expression. Predicates may be used much like 1-bit fields. For
602 example, <code>ip4</code> might expand to <code>eth.type ==
603 0x800</code>. Predicates are provided for syntactic convenience,
604 because it is always possible to instead specify the underlying
605 expression directly.
606 </p>
607
608 <p>
609 A predicate whose expansion refers to any nominal field or
610 predicate (see <em>Level of Measurement</em>, below) is nominal;
611 other predicates have Boolean level of measurement.
612 </p>
613 </li>
614 </ul>
615
616 <p>
617 <em>Level of Measurement</em>. See
618 http://en.wikipedia.org/wiki/Level_of_measurement for the statistical
619 concept on which this classification is based. There are three
620 levels:
621 </p>
622
623 <ul>
624 <li>
625 <p>
626 <dfn>Ordinal</dfn>. In statistics, ordinal values can be ordered
627 on a scale. OVN considers a field (or subfield) to be ordinal if
628 its bits can be examined individually. This is true for the
629 OpenFlow fields that OpenFlow or Open vSwitch makes ``maskable.''
630 </p>
631
632 <p>
633 Any use of a nominal field may specify a single bit or a range of
634 bits, e.g. <code>vlan.tci[13..15]</code> refers to the PCP field
635 within the VLAN TCI, and <code>eth.dst[40]</code> refers to the
636 multicast bit in the Ethernet destination address.
637 </p>
638
639 <p>
640 OVN supports all the usual arithmetic relations (<code>==</code>,
641 <code>!=</code>, <code>&lt;</code>, <code>&lt;=</code>,
642 <code>&gt;</code>, and <code>&gt;=</code>) on ordinal fields and
643 their subfields, because OVN can implement these in OpenFlow and
644 Open vSwitch as collections of bitwise tests.
645 </p>
646 </li>
647
648 <li>
649 <p>
650 <dfn>Nominal</dfn>. In statistics, nominal values cannot be
651 usefully compared except for equality. This is true of OpenFlow
652 port numbers, Ethernet types, and IP protocols are examples: all of
653 these are just identifiers assigned arbitrarily with no deeper
654 meaning. In OpenFlow and Open vSwitch, bits in these fields
655 generally aren't individually addressable.
656 </p>
657
658 <p>
659 OVN only supports arithmetic tests for equality on nominal fields,
660 because OpenFlow and Open vSwitch provide no way for a flow to
661 efficiently implement other comparisons on them. (A test for
662 inequality can be sort of built out of two flows with different
663 priorities, but OVN matching expressions always generate flows with
664 a single priority.)
665 </p>
666
667 <p>
668 String fields are always nominal.
669 </p>
670 </li>
671
672 <li>
673 <p>
674 <dfn>Boolean</dfn>. A nominal field that has only two values, 0
675 and 1, is somewhat exceptional, since it is easy to support both
676 equality and inequality tests on such a field: either one can be
677 implemented as a test for 0 or 1.
678 </p>
679
680 <p>
681 Only predicates (see above) have a Boolean level of measurement.
682 </p>
683
684 <p>
685 This isn't a standard level of measurement.
686 </p>
687 </li>
688 </ul>
689
690 <p>
691 <em>Prerequisites</em>. Any symbol can have prerequisites, which are
692 additional condition implied by the use of the symbol. For example,
693 For example, <code>icmp4.type</code> symbol might have prerequisite
694 <code>icmp4</code>, which would cause an expression <code>icmp4.type ==
695 0</code> to be interpreted as <code>icmp4.type == 0 &amp;&amp;
696 icmp4</code>, which would in turn expand to <code>icmp4.type == 0
697 &amp;&amp; eth.type == 0x800 &amp;&amp; ip4.proto == 1</code> (assuming
698 <code>icmp4</code> is a predicate defined as suggested under
699 <em>Types</em> above).
700 </p>
701
702 <p><em>Relational operators</em></p>
703
704 <p>
705 All of the standard relational operators <code>==</code>,
706 <code>!=</code>, <code>&lt;</code>, <code>&lt;=</code>,
707 <code>&gt;</code>, and <code>&gt;=</code> are supported. Nominal
708 fields support only <code>==</code> and <code>!=</code>, and only in a
709 positive sense when outer <code>!</code> are taken into account,
710 e.g. given string field <code>inport</code>, <code>inport ==
711 "eth0"</code> and <code>!(inport != "eth0")</code> are acceptable, but
712 not <code>inport != "eth0"</code>.
713 </p>
714
715 <p>
716 The implementation of <code>==</code> (or <code>!=</code> when it is
717 negated), is more efficient than that of the other relational
718 operators.
719 </p>
720
721 <p><em>Constants</em></p>
722
723 <p>
724 Integer constants may be expressed in decimal, hexadecimal prefixed by
725 <code>0x</code>, or as dotted-quad IPv4 addresses, IPv6 addresses in
726 their standard forms, or Ethernet addresses as colon-separated hex
727 digits. A constant in any of these forms may be followed by a slash
728 and a second constant (the mask) in the same form, to form a masked
729 constant. IPv4 and IPv6 masks may be given as integers, to express
730 CIDR prefixes.
731 </p>
732
733 <p>
734 String constants have the same syntax as quoted strings in JSON (thus,
735 they are Unicode strings).
736 </p>
737
738 <p>
739 Some operators support sets of constants written inside curly braces
740 <code>{</code> ... <code>}</code>. Commas between elements of a set,
741 and after the last elements, are optional. With <code>==</code>,
742 ``<code><var>field</var> == { <var>constant1</var>,
743 <var>constant2</var>,</code> ... <code>}</code>'' is syntactic sugar
744 for ``<code><var>field</var> == <var>constant1</var> ||
745 <var>field</var> == <var>constant2</var> || </code>...<code></code>.
746 Similarly, ``<code><var>field</var> != { <var>constant1</var>,
747 <var>constant2</var>, </code>...<code> }</code>'' is equivalent to
748 ``<code><var>field</var> != <var>constant1</var> &amp;&amp;
749 <var>field</var> != <var>constant2</var> &amp;&amp;
750 </code>...<code></code>''.
751 </p>
752
753 <p>
754 You may refer to a set of IPv4, IPv6, or MAC addresses stored in the
755 <ref table="Address_Set"/> table by its <ref column="name"
756 table="Address_Set"/>. An <ref table="Address_Set"/> with a name
757 of <code>set1</code> can be referred to as
758 <code>$set1</code>.
759 </p>
760
761 <p><em>Miscellaneous</em></p>
762
763 <p>
764 Comparisons may name the symbol or the constant first,
765 e.g. <code>tcp.src == 80</code> and <code>80 == tcp.src</code> are both
766 acceptable.
767 </p>
768
769 <p>
770 Tests for a range may be expressed using a syntax like <code>1024 &lt;=
771 tcp.src &lt;= 49151</code>, which is equivalent to <code>1024 &lt;=
772 tcp.src &amp;&amp; tcp.src &lt;= 49151</code>.
773 </p>
774
775 <p>
776 For a one-bit field or predicate, a mention of its name is equivalent
777 to <code><var>symobl</var> == 1</code>, e.g. <code>vlan.present</code>
778 is equivalent to <code>vlan.present == 1</code>. The same is true for
779 one-bit subfields, e.g. <code>vlan.tci[12]</code>. There is no
780 technical limitation to implementing the same for ordinal fields of all
781 widths, but the implementation is expensive enough that the syntax
782 parser requires writing an explicit comparison against zero to make
783 mistakes less likely, e.g. in <code>tcp.src != 0</code> the comparison
784 against 0 is required.
785 </p>
786
787 <p>
788 <em>Operator precedence</em> is as shown below, from highest to lowest.
789 There are two exceptions where parentheses are required even though the
790 table would suggest that they are not: <code>&amp;&amp;</code> and
791 <code>||</code> require parentheses when used together, and
792 <code>!</code> requires parentheses when applied to a relational
793 expression. Thus, in <code>(eth.type == 0x800 || eth.type == 0x86dd)
794 &amp;&amp; ip.proto == 6</code> or <code>!(arp.op == 1)</code>, the
795 parentheses are mandatory.
796 </p>
797
798 <ul>
799 <li><code>()</code></li>
800 <li><code>== != &lt; &lt;= &gt; &gt;=</code></li>
801 <li><code>!</code></li>
802 <li><code>&amp;&amp; ||</code></li>
803 </ul>
804
805 <p>
806 <em>Comments</em> may be introduced by <code>//</code>, which extends
807 to the next new-line. Comments within a line may be bracketed by
808 <code>/*</code> and <code>*/</code>. Multiline comments are not
809 supported.
810 </p>
811
812 <p><em>Symbols</em></p>
813
814 <p>
815 Most of the symbols below have integer type. Only <code>inport</code>
816 and <code>outport</code> have string type. <code>inport</code> names a
817 logical port. Thus, its value is a <ref column="logical_port"/> name
818 from the <ref table="Port_Binding"/> table. <code>outport</code> may
819 name a logical port, as <code>inport</code>, or a logical multicast
820 group defined in the <ref table="Multicast_Group"/> table. For both
821 symbols, only names within the flow's logical datapath may be used.
822 </p>
823
824 <p>
825 The <code>reg</code><var>X</var> symbols are 32-bit integers.
826 The <code>xxreg</code><var>X</var> symbols are 128-bit integers,
827 which overlay four of the 32-bit registers: <code>xxreg0</code>
828 overlays <code>reg0</code> through <code>reg3</code>, with
829 <code>reg0</code> supplying the most-significant bits of
830 <code>xxreg0</code> and <code>reg3</code> the least-signficant.
831 <code>xxreg1</code> similarly overlays <code>reg4</code> through
832 <code>reg7</code>.
833 </p>
834
835 <ul>
836 <li><code>reg0</code>...<code>reg9</code></li>
837 <li><code>xxreg0</code> <code>xxreg1</code></li>
838 <li><code>inport</code> <code>outport</code></li>
839 <li><code>flags.loopback</code></li>
840 <li><code>eth.src</code> <code>eth.dst</code> <code>eth.type</code></li>
841 <li><code>vlan.tci</code> <code>vlan.vid</code> <code>vlan.pcp</code> <code>vlan.present</code></li>
842 <li><code>ip.proto</code> <code>ip.dscp</code> <code>ip.ecn</code> <code>ip.ttl</code> <code>ip.frag</code></li>
843 <li><code>ip4.src</code> <code>ip4.dst</code></li>
844 <li><code>ip6.src</code> <code>ip6.dst</code> <code>ip6.label</code></li>
845 <li><code>arp.op</code> <code>arp.spa</code> <code>arp.tpa</code> <code>arp.sha</code> <code>arp.tha</code></li>
846 <li><code>tcp.src</code> <code>tcp.dst</code> <code>tcp.flags</code></li>
847 <li><code>udp.src</code> <code>udp.dst</code></li>
848 <li><code>sctp.src</code> <code>sctp.dst</code></li>
849 <li><code>icmp4.type</code> <code>icmp4.code</code></li>
850 <li><code>icmp6.type</code> <code>icmp6.code</code></li>
851 <li><code>nd.target</code> <code>nd.sll</code> <code>nd.tll</code></li>
852 <li><code>ct_mark</code> <code>ct_label</code></li>
853 <li>
854 <p>
855 <code>ct_state</code>, which has several Boolean subfields. The
856 <code>ct_next</code> action initializes the following subfields:
857 </p>
858 <ul>
859 <li>
860 <code>ct.trk</code>: Always set to true by <code>ct_next</code>
861 to indicate that connection tracking has taken place. All other
862 <code>ct</code> subfields have <code>ct.trk</code> as a
863 prerequisite.
864 </li>
865 <li><code>ct.new</code>: True for a new flow</li>
866 <li><code>ct.est</code>: True for an established flow</li>
867 <li><code>ct.rel</code>: True for a related flow</li>
868 <li><code>ct.rpl</code>: True for a reply flow</li>
869 <li><code>ct.inv</code>: True for a connection entry in a bad state</li>
870 </ul>
871 <p>
872 The <code>ct_dnat</code>, <code>ct_snat</code>, and
873 <code>ct_lb</code> actions initialize the following subfields:
874 </p>
875 <ul>
876 <li>
877 <code>ct.dnat</code>: True for a packet whose destination IP
878 address has been changed.
879 </li>
880 <li>
881 <code>ct.snat</code>: True for a packet whose source IP
882 address has been changed.
883 </li>
884 </ul>
885 </li>
886 </ul>
887
888 <p>
889 The following predicates are supported:
890 </p>
891
892 <ul>
893 <li><code>eth.bcast</code> expands to <code>eth.dst == ff:ff:ff:ff:ff:ff</code></li>
894 <li><code>eth.mcast</code> expands to <code>eth.dst[40]</code></li>
895 <li><code>vlan.present</code> expands to <code>vlan.tci[12]</code></li>
896 <li><code>ip4</code> expands to <code>eth.type == 0x800</code></li>
897 <li><code>ip4.mcast</code> expands to <code>ip4.dst[28..31] == 0xe</code></li>
898 <li><code>ip6</code> expands to <code>eth.type == 0x86dd</code></li>
899 <li><code>ip</code> expands to <code>ip4 || ip6</code></li>
900 <li><code>icmp4</code> expands to <code>ip4 &amp;&amp; ip.proto == 1</code></li>
901 <li><code>icmp6</code> expands to <code>ip6 &amp;&amp; ip.proto == 58</code></li>
902 <li><code>icmp</code> expands to <code>icmp4 || icmp6</code></li>
903 <li><code>ip.is_frag</code> expands to <code>ip.frag[0]</code></li>
904 <li><code>ip.later_frag</code> expands to <code>ip.frag[1]</code></li>
905 <li><code>ip.first_frag</code> expands to <code>ip.is_frag &amp;&amp; !ip.later_frag</code></li>
906 <li><code>arp</code> expands to <code>eth.type == 0x806</code></li>
907 <li><code>nd</code> expands to <code>icmp6.type == {135, 136} &amp;&amp; icmp6.code == 0 &amp;&amp; ip.ttl == 255</code></li>
908 <li><code>nd_ns</code> expands to <code>icmp6.type == 135 &amp;&amp; icmp6.code == 0 &amp;&amp; ip.ttl == 255</code></li>
909 <li><code>nd_na</code> expands to <code>icmp6.type == 136 &amp;&amp; icmp6.code == 0 &amp;&amp; ip.ttl == 255</code></li>
910 <li><code>tcp</code> expands to <code>ip.proto == 6</code></li>
911 <li><code>udp</code> expands to <code>ip.proto == 17</code></li>
912 <li><code>sctp</code> expands to <code>ip.proto == 132</code></li>
913 </ul>
914 </column>
915
916 <column name="actions">
917 <p>
918 Logical datapath actions, to be executed when the logical flow
919 represented by this row is the highest-priority match.
920 </p>
921
922 <p>
923 Actions share lexical syntax with the <ref column="match"/> column. An
924 empty set of actions (or one that contains just white space or
925 comments), or a set of actions that consists of just
926 <code>drop;</code>, causes the matched packets to be dropped.
927 Otherwise, the column should contain a sequence of actions, each
928 terminated by a semicolon.
929 </p>
930
931 <p>
932 The following actions are defined:
933 </p>
934
935 <dl>
936 <dt><code>output;</code></dt>
937 <dd>
938 <p>
939 In the ingress pipeline, this action executes the
940 <code>egress</code> pipeline as a subroutine. If
941 <code>outport</code> names a logical port, the egress pipeline
942 executes once; if it is a multicast group, the egress pipeline runs
943 once for each logical port in the group.
944 </p>
945
946 <p>
947 In the egress pipeline, this action performs the actual
948 output to the <code>outport</code> logical port. (In the egress
949 pipeline, <code>outport</code> never names a multicast group.)
950 </p>
951
952 <p>
953 By default, output to the input port is implicitly dropped,
954 that is, <code>output</code> becomes a no-op if
955 <code>outport</code> == <code>inport</code>. Occasionally
956 it may be useful to override this behavior, e.g. to send an
957 ARP reply to an ARP request; to do so, use
958 <code>flags.loopback = 1</code> to allow the packet to
959 "hair-pin" back to the input port.
960 </p>
961 </dd>
962
963 <dt><code>next;</code></dt>
964 <dt><code>next(<var>table</var>);</code></dt>
965 <dt><code>next(pipeline=<var>pipeline</var>, table=<var>table</var>);</code></dt>
966 <dd>
967 Executes the given logical datapath <var>table</var> in
968 <var>pipeline</var> as a subroutine. The default <var>table</var> is
969 just after the current one. If <var>pipeline</var> is specified, it
970 may be <code>ingress</code> or <code>egress</code>; the default
971 <var>pipeline</var> is the one currently executing. Actions in the
972 ingress pipeline may not use <code>next</code> to jump into the
973 egress pipeline (use the <code>output</code> instead), but
974 transitions in the opposite direction are allowed.
975 </dd>
976
977 <dt><code><var>field</var> = <var>constant</var>;</code></dt>
978 <dd>
979 <p>
980 Sets data or metadata field <var>field</var> to constant value
981 <var>constant</var>, e.g. <code>outport = "vif0";</code> to set the
982 logical output port. To set only a subset of bits in a field,
983 specify a subfield for <var>field</var> or a masked
984 <var>constant</var>, e.g. one may use <code>vlan.pcp[2] = 1;</code>
985 or <code>vlan.pcp = 4/4;</code> to set the most sigificant bit of
986 the VLAN PCP.
987 </p>
988
989 <p>
990 Assigning to a field with prerequisites implicitly adds those
991 prerequisites to <ref column="match"/>; thus, for example, a flow
992 that sets <code>tcp.dst</code> applies only to TCP flows,
993 regardless of whether its <ref column="match"/> mentions any TCP
994 field.
995 </p>
996
997 <p>
998 Not all fields are modifiable (e.g. <code>eth.type</code> and
999 <code>ip.proto</code> are read-only), and not all modifiable fields
1000 may be partially modified (e.g. <code>ip.ttl</code> must assigned
1001 as a whole). The <code>outport</code> field is modifiable in the
1002 <code>ingress</code> pipeline but not in the <code>egress</code>
1003 pipeline.
1004 </p>
1005 </dd>
1006
1007 <dt><code><var>field1</var> = <var>field2</var>;</code></dt>
1008 <dd>
1009 <p>
1010 Sets data or metadata field <var>field1</var> to the value of data
1011 or metadata field <var>field2</var>, e.g. <code>reg0 =
1012 ip4.src;</code> copies <code>ip4.src</code> into <code>reg0</code>.
1013 To modify only a subset of a field's bits, specify a subfield for
1014 <var>field1</var> or <var>field2</var> or both, e.g. <code>vlan.pcp
1015 = reg0[0..2];</code> copies the least-significant bits of
1016 <code>reg0</code> into the VLAN PCP.
1017 </p>
1018
1019 <p>
1020 <var>field1</var> and <var>field2</var> must be the same type,
1021 either both string or both integer fields. If they are both
1022 integer fields, they must have the same width.
1023 </p>
1024
1025 <p>
1026 If <var>field1</var> or <var>field2</var> has prerequisites, they
1027 are added implicitly to <ref column="match"/>. It is possible to
1028 write an assignment with contradictory prerequisites, such as
1029 <code>ip4.src = ip6.src[0..31];</code>, but the contradiction means
1030 that a logical flow with such an assignment will never be matched.
1031 </p>
1032 </dd>
1033
1034 <dt><code><var>field1</var> &lt;-&gt; <var>field2</var>;</code></dt>
1035 <dd>
1036 <p>
1037 Similar to <code><var>field1</var> = <var>field2</var>;</code>
1038 except that the two values are exchanged instead of copied. Both
1039 <var>field1</var> and <var>field2</var> must modifiable.
1040 </p>
1041 </dd>
1042
1043 <dt><code>ip.ttl--;</code></dt>
1044 <dd>
1045 <p>
1046 Decrements the IPv4 or IPv6 TTL. If this would make the TTL zero
1047 or negative, then processing of the packet halts; no further
1048 actions are processed. (To properly handle such cases, a
1049 higher-priority flow should match on
1050 <code>ip.ttl == {0, 1};</code>.)
1051 </p>
1052
1053 <p><b>Prerequisite:</b> <code>ip</code></p>
1054 </dd>
1055
1056 <dt><code>ct_next;</code></dt>
1057 <dd>
1058 <p>
1059 Apply connection tracking to the flow, initializing
1060 <code>ct_state</code> for matching in later tables.
1061 Automatically moves on to the next table, as if followed by
1062 <code>next</code>.
1063 </p>
1064
1065 <p>
1066 As a side effect, IP fragments will be reassembled for matching.
1067 If a fragmented packet is output, then it will be sent with any
1068 overlapping fragments squashed. The connection tracking state is
1069 scoped by the logical port when the action is used in a flow for
1070 a logical switch, so overlapping addresses may be used. To allow
1071 traffic related to the matched flow, execute <code>ct_commit
1072 </code>. Connection tracking state is scoped by the logical
1073 topology when the action is used in a flow for a router.
1074 </p>
1075
1076 <p>
1077 It is possible to have actions follow <code>ct_next</code>,
1078 but they will not have access to any of its side-effects and
1079 is not generally useful.
1080 </p>
1081 </dd>
1082
1083 <dt><code>ct_commit;</code></dt>
1084 <dt><code>ct_commit(ct_mark=<var>value[/mask]</var>);</code></dt>
1085 <dt><code>ct_commit(ct_label=<var>value[/mask]</var>);</code></dt>
1086 <dt><code>ct_commit(ct_mark=<var>value[/mask]</var>, ct_label=<var>value[/mask]</var>);</code></dt>
1087 <dd>
1088 <p>
1089 Commit the flow to the connection tracking entry associated with it
1090 by a previous call to <code>ct_next</code>. When
1091 <code>ct_mark=<var>value[/mask]</var></code> and/or
1092 <code>ct_label=<var>value[/mask]</var></code> are supplied,
1093 <code>ct_mark</code> and/or <code>ct_label</code> will be set to the
1094 values indicated by <var>value[/mask]</var> on the connection
1095 tracking entry. <code>ct_mark</code> is a 32-bit field.
1096 <code>ct_label</code> is a 128-bit field. The <var>value[/mask]</var>
1097 should be specified in hex string if more than 64bits are to be used.
1098 </p>
1099
1100 <p>
1101 Note that if you want processing to continue in the next table,
1102 you must execute the <code>next</code> action after
1103 <code>ct_commit</code>. You may also leave out <code>next</code>
1104 which will commit connection tracking state, and then drop the
1105 packet. This could be useful for setting <code>ct_mark</code>
1106 on a connection tracking entry before dropping a packet,
1107 for example.
1108 </p>
1109 </dd>
1110
1111 <dt><code>ct_dnat;</code></dt>
1112 <dt><code>ct_dnat(<var>IP</var>);</code></dt>
1113 <dd>
1114 <p>
1115 <code>ct_dnat</code> sends the packet through the DNAT zone in
1116 connection tracking table to unDNAT any packet that was DNATed in
1117 the opposite direction. The packet is then automatically sent to
1118 to the next tables as if followed by <code>next;</code> action.
1119 The next tables will see the changes in the packet caused by
1120 the connection tracker.
1121 </p>
1122 <p>
1123 <code>ct_dnat(<var>IP</var>)</code> sends the packet through the
1124 DNAT zone to change the destination IP address of the packet to
1125 the one provided inside the parentheses and commits the connection.
1126 The packet is then automatically sent to the next tables as if
1127 followed by <code>next;</code> action. The next tables will see
1128 the changes in the packet caused by the connection tracker.
1129 </p>
1130 </dd>
1131
1132 <dt><code>ct_snat;</code></dt>
1133 <dt><code>ct_snat(<var>IP</var>);</code></dt>
1134 <dd>
1135 <p>
1136 <code>ct_snat</code> sends the packet through the SNAT zone to
1137 unSNAT any packet that was SNATed in the opposite direction. The
1138 behavior on gateway routers differs from the behavior on a
1139 distributed router:
1140 </p>
1141 <ul>
1142 <li>
1143 On a gateway router, if the packet needs to be sent to the next
1144 tables, then it should be followed by a <code>next;</code>
1145 action. The next tables will not see the changes in the packet
1146 caused by the connection tracker.
1147 </li>
1148 <li>
1149 On a distributed router, if the connection tracker finds a
1150 connection that was SNATed in the opposite direction, then the
1151 destination IP address of the packet is UNSNATed. The packet is
1152 automatically sent to the next tables as if followed by the
1153 <code>next;</code> action. The next tables will see the changes
1154 in the packet caused by the connection tracker.
1155 </li>
1156 </ul>
1157 <p>
1158 <code>ct_snat(<var>IP</var>)</code> sends the packet through the
1159 SNAT zone to change the source IP address of the packet to
1160 the one provided inside the parenthesis and commits the connection.
1161 The packet is then automatically sent to the next tables as if
1162 followed by <code>next;</code> action. The next tables will see the
1163 changes in the packet caused by the connection tracker.
1164 </p>
1165 </dd>
1166
1167 <dt><code>ct_clear;</code></dt>
1168 <dd>
1169 Clears connection tracking state.
1170 </dd>
1171
1172 <dt><code>clone { <var>action</var>; </code>...<code> };</code></dt>
1173 <dd>
1174 Makes a copy of the packet being processed and executes each
1175 <code>action</code> on the copy. Actions following the
1176 <var>clone</var> action, if any, apply to the original, unmodified
1177 packet. This can be used as a way to ``save and restore'' the packet
1178 around a set of actions that may modify it and should not persist.
1179 </dd>
1180
1181 <dt><code>arp { <var>action</var>; </code>...<code> };</code></dt>
1182 <dd>
1183 <p>
1184 Temporarily replaces the IPv4 packet being processed by an ARP
1185 packet and executes each nested <var>action</var> on the ARP
1186 packet. Actions following the <var>arp</var> action, if any, apply
1187 to the original, unmodified packet.
1188 </p>
1189
1190 <p>
1191 The ARP packet that this action operates on is initialized based on
1192 the IPv4 packet being processed, as follows. These are default
1193 values that the nested actions will probably want to change:
1194 </p>
1195
1196 <ul>
1197 <li><code>eth.src</code> unchanged</li>
1198 <li><code>eth.dst</code> unchanged</li>
1199 <li><code>eth.type = 0x0806</code></li>
1200 <li><code>arp.op = 1</code> (ARP request)</li>
1201 <li><code>arp.sha</code> copied from <code>eth.src</code></li>
1202 <li><code>arp.spa</code> copied from <code>ip4.src</code></li>
1203 <li><code>arp.tha = 00:00:00:00:00:00</code></li>
1204 <li><code>arp.tpa</code> copied from <code>ip4.dst</code></li>
1205 </ul>
1206
1207 <p>
1208 The ARP packet has the same VLAN header, if any, as the IP packet
1209 it replaces.
1210 </p>
1211
1212 <p><b>Prerequisite:</b> <code>ip4</code></p>
1213 </dd>
1214
1215 <dt><code>get_arp(<var>P</var>, <var>A</var>);</code></dt>
1216
1217 <dd>
1218 <p>
1219 <b>Parameters</b>: logical port string field <var>P</var>, 32-bit
1220 IP address field <var>A</var>.
1221 </p>
1222
1223 <p>
1224 Looks up <var>A</var> in <var>P</var>'s mac binding table.
1225 If an entry is found, stores its Ethernet address in
1226 <code>eth.dst</code>, otherwise stores
1227 <code>00:00:00:00:00:00</code> in <code>eth.dst</code>.
1228 </p>
1229
1230 <p><b>Example:</b> <code>get_arp(outport, ip4.dst);</code></p>
1231 </dd>
1232
1233 <dt>
1234 <code>put_arp(<var>P</var>, <var>A</var>, <var>E</var>);</code>
1235 </dt>
1236
1237 <dd>
1238 <p>
1239 <b>Parameters</b>: logical port string field <var>P</var>, 32-bit
1240 IP address field <var>A</var>, 48-bit Ethernet address field
1241 <var>E</var>.
1242 </p>
1243
1244 <p>
1245 Adds or updates the entry for IP address <var>A</var> in
1246 logical port <var>P</var>'s mac binding table, setting its
1247 Ethernet address to <var>E</var>.
1248 </p>
1249
1250 <p><b>Example:</b> <code>put_arp(inport, arp.spa, arp.sha);</code></p>
1251 </dd>
1252
1253 <dt>
1254 <code>nd_na { <var>action</var>; </code>...<code> };</code>
1255 </dt>
1256
1257 <dd>
1258 <p>
1259 Temporarily replaces the IPv6 neighbor solicitation packet
1260 being processed by an IPv6 neighbor advertisement (NA)
1261 packet and executes each nested <var>action</var> on the NA
1262 packet. Actions following the <code>nd_na</code> action,
1263 if any, apply to the original, unmodified packet.
1264 </p>
1265
1266 <p>
1267 The NA packet that this action operates on is initialized based on
1268 the IPv6 packet being processed, as follows. These are default
1269 values that the nested actions will probably want to change:
1270 </p>
1271
1272 <ul>
1273 <li><code>eth.dst</code> exchanged with <code>eth.src</code></li>
1274 <li><code>eth.type = 0x86dd</code></li>
1275 <li><code>ip6.dst</code> copied from <code>ip6.src</code></li>
1276 <li><code>ip6.src</code> copied from <code>nd.target</code></li>
1277 <li><code>icmp6.type = 136</code> (Neighbor Advertisement)</li>
1278 <li><code>nd.target</code> unchanged</li>
1279 <li><code>nd.sll = 00:00:00:00:00:00</code></li>
1280 <li><code>nd.tll</code> copied from <code>eth.dst</code></li>
1281 </ul>
1282
1283 <p>
1284 The ND packet has the same VLAN header, if any, as the IPv6 packet
1285 it replaces.
1286 </p>
1287
1288 <p>
1289 <b>Prerequisite:</b> <code>nd_ns</code>
1290 </p>
1291 </dd>
1292
1293 <dt><code>get_nd(<var>P</var>, <var>A</var>);</code></dt>
1294
1295 <dd>
1296 <p>
1297 <b>Parameters</b>: logical port string field <var>P</var>, 128-bit
1298 IPv6 address field <var>A</var>.
1299 </p>
1300
1301 <p>
1302 Looks up <var>A</var> in <var>P</var>'s mac binding table.
1303 If an entry is found, stores its Ethernet address in
1304 <code>eth.dst</code>, otherwise stores
1305 <code>00:00:00:00:00:00</code> in <code>eth.dst</code>.
1306 </p>
1307
1308 <p><b>Example:</b> <code>get_nd(outport, ip6.dst);</code></p>
1309 </dd>
1310
1311 <dt>
1312 <code>put_nd(<var>P</var>, <var>A</var>, <var>E</var>);</code>
1313 </dt>
1314
1315 <dd>
1316 <p>
1317 <b>Parameters</b>: logical port string field <var>P</var>,
1318 128-bit IPv6 address field <var>A</var>, 48-bit Ethernet
1319 address field <var>E</var>.
1320 </p>
1321
1322 <p>
1323 Adds or updates the entry for IPv6 address <var>A</var> in
1324 logical port <var>P</var>'s mac binding table, setting its
1325 Ethernet address to <var>E</var>.
1326 </p>
1327
1328 <p><b>Example:</b> <code>put_nd(inport, nd.target, nd.tll);</code></p>
1329 </dd>
1330
1331 <dt>
1332 <code><var>R</var> = put_dhcp_opts(<var>D1</var> = <var>V1</var>, <var>D2</var> = <var>V2</var>, ..., <var>Dn</var> = <var>Vn</var>);</code>
1333 </dt>
1334
1335 <dd>
1336 <p>
1337 <b>Parameters</b>: one or more DHCP option/value pairs, which must
1338 include an <code>offerip</code> option (with code 0).
1339 </p>
1340
1341 <p>
1342 <b>Result</b>: stored to a 1-bit subfield <var>R</var>.
1343 </p>
1344
1345 <p>
1346 Valid only in the ingress pipeline.
1347 </p>
1348
1349 <p>
1350 When this action is applied to a DHCP request packet (DHCPDISCOVER
1351 or DHCPREQUEST), it changes the packet into a DHCP reply (DHCPOFFER
1352 or DHCPACK, respectively), replaces the options by those specified
1353 as parameters, and stores 1 in <var>R</var>.
1354 </p>
1355
1356 <p>
1357 When this action is applied to a non-DHCP packet or a DHCP packet
1358 that is not DHCPDISCOVER or DHCPREQUEST, it leaves the packet
1359 unchanged and stores 0 in <var>R</var>.
1360 </p>
1361
1362 <p>
1363 The contents of the <ref table="DHCP_Option"/> table control the
1364 DHCP option names and values that this action supports.
1365 </p>
1366
1367 <p>
1368 <b>Example:</b>
1369 <code>
1370 reg0[0] = put_dhcp_opts(offerip = 10.0.0.2, router = 10.0.0.1,
1371 netmask = 255.255.255.0, dns_server = {8.8.8.8, 7.7.7.7});
1372 </code>
1373 </p>
1374 </dd>
1375
1376 <dt>
1377 <code><var>R</var> = put_dhcpv6_opts(<var>D1</var> = <var>V1</var>, <var>D2</var> = <var>V2</var>, ..., <var>Dn</var> = <var>Vn</var>);</code>
1378 </dt>
1379
1380 <dd>
1381 <p>
1382 <b>Parameters</b>: one or more DHCPv6 option/value pairs.
1383 </p>
1384
1385 <p>
1386 <b>Result</b>: stored to a 1-bit subfield <var>R</var>.
1387 </p>
1388
1389 <p>
1390 Valid only in the ingress pipeline.
1391 </p>
1392
1393 <p>
1394 When this action is applied to a DHCPv6 request packet, it changes
1395 the packet into a DHCPv6 reply, replaces the options by those
1396 specified as parameters, and stores 1 in <var>R</var>.
1397 </p>
1398
1399 <p>
1400 When this action is applied to a non-DHCPv6 packet or an invalid
1401 DHCPv6 request packet , it leaves the packet unchanged and stores
1402 0 in <var>R</var>.
1403 </p>
1404
1405 <p>
1406 The contents of the <ref table="DHCPv6_Options"/> table control the
1407 DHCPv6 option names and values that this action supports.
1408 </p>
1409
1410 <p>
1411 <b>Example:</b>
1412 <code>
1413 reg0[3] = put_dhcpv6_opts(ia_addr = aef0::4, server_id = 00:00:00:00:10:02,
1414 dns_server={ae70::1,ae70::2});
1415 </code>
1416 </p>
1417 </dd>
1418
1419 <dt>
1420 <code>set_queue(<var>queue_number</var>);</code>
1421 </dt>
1422
1423 <dd>
1424 <p>
1425 <b>Parameters</b>: Queue number <var>queue_number</var>, in the range 0 to 61440.
1426 </p>
1427
1428 <p>
1429 This is a logical equivalent of the OpenFlow <code>set_queue</code>
1430 action. It affects packets that egress a hypervisor through a
1431 physical interface. For nonzero <var>queue_number</var>, it
1432 configures packet queuing to match the settings configured for the
1433 <ref table="Port_Binding"/> with
1434 <code>options:qdisc_queue_id</code> matching
1435 <var>queue_number</var>. When <var>queue_number</var> is zero, it
1436 resets queuing to the default strategy.
1437 </p>
1438
1439 <p><b>Example:</b> <code>set_queue(10);</code></p>
1440 </dd>
1441
1442 <dt><code>ct_lb;</code></dt>
1443 <dt><code>ct_lb(</code><var>ip</var>[<code>:</code><var>port</var>]...<code>);</code></dt>
1444 <dd>
1445 <p>
1446 With one or more arguments, <code>ct_lb</code> commits the packet
1447 to the connection tracking table and DNATs the packet's destination
1448 IP address (and port) to the IP address or addresses (and optional
1449 ports) specified in the string. If multiple comma-separated IP
1450 addresses are specified, each is given equal weight for picking the
1451 DNAT address. Processing automatically moves on to the next table,
1452 as if <code>next;</code> were specified, and later tables act on
1453 the packet as modified by the connection tracker. Connection
1454 tracking state is scoped by the logical port when the action is
1455 used in a flow for a logical switch, so overlapping
1456 addresses may be used. Connection tracking state is scoped by the
1457 logical topology when the action is used in a flow for a router.
1458 </p>
1459 <p>
1460 Without arguments, <code>ct_lb</code> sends the packet to the
1461 connection tracking table to NAT the packets. If the packet is
1462 part of an established connection that was previously committed to
1463 the connection tracker via <code>ct_lb(</code>...<code>)</code>, it
1464 will automatically get DNATed to the same IP address as the first
1465 packet in that connection.
1466 </p>
1467 </dd>
1468
1469 <dt>
1470 <code><var>R</var> = dns_lookup();</code>
1471 </dt>
1472
1473 <dd>
1474 <p>
1475 <b>Parameters</b>: No parameters.
1476 </p>
1477
1478 <p>
1479 <b>Result</b>: stored to a 1-bit subfield <var>R</var>.
1480 </p>
1481
1482 <p>
1483 Valid only in the ingress pipeline.
1484 </p>
1485
1486 <p>
1487 When this action is applied to a valid DNS request (a UDP packet
1488 typically directed to port 53), it attempts to resolve the query
1489 using the contents of the <ref table="DNS"/> table. If it is
1490 successful, it changes the packet into a DNS reply and stores 1 in
1491 <var>R</var>. If the action is applied to a non-DNS packet, an
1492 invalid DNS request packet, or a valid DNS request for which the
1493 <ref table="DNS"/> table does not supply an answer, it leaves the
1494 packet unchanged and stores 0 in <var>R</var>.
1495 </p>
1496
1497 <p>
1498 Regardless of success, the action does not make any of the changes
1499 to the flow that are necessary to direct the packet back to the
1500 requester. The logical pipeline can implement this behavior with
1501 matches and actions in later tables.
1502 </p>
1503
1504 <p>
1505 <b>Example:</b>
1506 <code>
1507 reg0[3] = dns_lookup();
1508 </code>
1509 </p>
1510
1511 <p>
1512 <b>Prerequisite:</b> <code>udp</code>
1513 </p>
1514 </dd>
1515 </dl>
1516
1517 <p>
1518 The following actions will likely be useful later, but they have not
1519 been thought out carefully.
1520 </p>
1521
1522 <dl>
1523 <dt><code>icmp4 { <var>action</var>; </code>...<code> };</code></dt>
1524 <dd>
1525 <p>
1526 Temporarily replaces the IPv4 packet being processed by an ICMPv4
1527 packet and executes each nested <var>action</var> on the ICMPv4
1528 packet. Actions following the <var>icmp4</var> action, if any,
1529 apply to the original, unmodified packet.
1530 </p>
1531
1532 <p>
1533 The ICMPv4 packet that this action operates on is initialized based
1534 on the IPv4 packet being processed, as follows. These are default
1535 values that the nested actions will probably want to change.
1536 Ethernet and IPv4 fields not listed here are not changed:
1537 </p>
1538
1539 <ul>
1540 <li><code>ip.proto = 1</code> (ICMPv4)</li>
1541 <li><code>ip.frag = 0</code> (not a fragment)</li>
1542 <li><code>icmp4.type = 3</code> (destination unreachable)</li>
1543 <li><code>icmp4.code = 1</code> (host unreachable)</li>
1544 </ul>
1545
1546 <p>
1547 Details TBD.
1548 </p>
1549
1550 <p><b>Prerequisite:</b> <code>ip4</code></p>
1551 </dd>
1552
1553 <dt><code>tcp_reset;</code></dt>
1554 <dd>
1555 <p>
1556 This action transforms the current TCP packet according to the
1557 following pseudocode:
1558 </p>
1559
1560 <pre>
1561 if (tcp.ack) {
1562 tcp.seq = tcp.ack;
1563 } else {
1564 tcp.ack = tcp.seq + length(tcp.payload);
1565 tcp.seq = 0;
1566 }
1567 tcp.flags = RST;
1568 </pre>
1569
1570 <p>
1571 Then, the action drops all TCP options and payload data, and
1572 updates the TCP checksum.
1573 </p>
1574
1575 <p>
1576 Details TBD.
1577 </p>
1578
1579 <p><b>Prerequisite:</b> <code>tcp</code></p>
1580 </dd>
1581 </dl>
1582 </column>
1583
1584 <column name="external_ids" key="stage-name">
1585 Human-readable name for this flow's stage in the pipeline.
1586 </column>
1587
1588 <column name="external_ids" key="stage-hint" type='{"type": "uuid"}'>
1589 UUID of a <ref db="OVN_Northbound"/> record that caused this logical flow
1590 to be created. Currently used only for attribute of logical flows to
1591 northbound <ref db="OVN_Northbound" table="ACL"/> records.
1592 </column>
1593
1594 <column name="external_ids" key="source">
1595 Source file and line number of the code that added this flow to the
1596 pipeline.
1597 </column>
1598
1599 <group title="Common Columns">
1600 The overall purpose of these columns is described under <code>Common
1601 Columns</code> at the beginning of this document.
1602
1603 <column name="external_ids"/>
1604 </group>
1605 </table>
1606
1607 <table name="Multicast_Group" title="Logical Port Multicast Groups">
1608 <p>
1609 The rows in this table define multicast groups of logical ports.
1610 Multicast groups allow a single packet transmitted over a tunnel to a
1611 hypervisor to be delivered to multiple VMs on that hypervisor, which
1612 uses bandwidth more efficiently.
1613 </p>
1614
1615 <p>
1616 Each row in this table defines a logical multicast group numbered <ref
1617 column="tunnel_key"/> within <ref column="datapath"/>, whose logical
1618 ports are listed in the <ref column="ports"/> column.
1619 </p>
1620
1621 <column name="datapath">
1622 The logical datapath in which the multicast group resides.
1623 </column>
1624
1625 <column name="tunnel_key">
1626 The value used to designate this logical egress port in tunnel
1627 encapsulations. An index forces the key to be unique within the <ref
1628 column="datapath"/>. The unusual range ensures that multicast group IDs
1629 do not overlap with logical port IDs.
1630 </column>
1631
1632 <column name="name">
1633 <p>
1634 The logical multicast group's name. An index forces the name to be
1635 unique within the <ref column="datapath"/>. Logical flows in the
1636 ingress pipeline may output to the group just as for individual logical
1637 ports, by assigning the group's name to <code>outport</code> and
1638 executing an <code>output</code> action.
1639 </p>
1640
1641 <p>
1642 Multicast group names and logical port names share a single namespace
1643 and thus should not overlap (but the database schema cannot enforce
1644 this). To try to avoid conflicts, <code>ovn-northd</code> uses names
1645 that begin with <code>_MC_</code>.
1646 </p>
1647 </column>
1648
1649 <column name="ports">
1650 The logical ports included in the multicast group. All of these ports
1651 must be in the <ref column="datapath"/> logical datapath (but the
1652 database schema cannot enforce this).
1653 </column>
1654 </table>
1655
1656 <table name="Datapath_Binding" title="Physical-Logical Datapath Bindings">
1657 <p>
1658 Each row in this table identifies physical bindings of a logical
1659 datapath. A logical datapath implements a logical pipeline among the
1660 ports in the <ref table="Port_Binding"/> table associated with it. In
1661 practice, the pipeline in a given logical datapath implements either a
1662 logical switch or a logical router.
1663 </p>
1664
1665 <column name="tunnel_key">
1666 The tunnel key value to which the logical datapath is bound.
1667 The <code>Tunnel Encapsulation</code> section in
1668 <code>ovn-architecture</code>(7) describes how tunnel keys are
1669 constructed for each supported encapsulation.
1670 </column>
1671
1672 <group title="OVN_Northbound Relationship">
1673 <p>
1674 Each row in <ref table="Datapath_Binding"/> is associated with some
1675 logical datapath. <code>ovn-northd</code> uses these keys to track the
1676 association of a logical datapath with concepts in the <ref
1677 db="OVN_Northbound"/> database.
1678 </p>
1679
1680 <column name="external_ids" key="logical-switch" type='{"type": "uuid"}'>
1681 For a logical datapath that represents a logical switch,
1682 <code>ovn-northd</code> stores in this key the UUID of the
1683 corresponding <ref table="Logical_Switch" db="OVN_Northbound"/> row in
1684 the <ref db="OVN_Northbound"/> database.
1685 </column>
1686
1687 <column name="external_ids" key="logical-router" type='{"type": "uuid"}'>
1688 For a logical datapath that represents a logical router,
1689 <code>ovn-northd</code> stores in this key the UUID of the
1690 corresponding <ref table="Logical_Router" db="OVN_Northbound"/> row in
1691 the <ref db="OVN_Northbound"/> database.
1692 </column>
1693
1694 <group title="Naming">
1695 <p>
1696 <code>ovn-northd</code> copies these from the name fields in the <ref
1697 db="OVN_Northbound"/> database, either from <ref
1698 table="Logical_Router" db="OVN_Northbound" column="name"/> and <ref
1699 table="Logical_Router" db="OVN_Northbound" column="external_ids"
1700 key="neutron:router_name"/> in the <ref table="Logical_Router"
1701 db="OVN_Northbound"/> table or from <ref table="Logical_Switch"
1702 db="OVN_Northbound" column="name"/> and <ref table="Logical_Switch"
1703 db="OVN_Northbound" column="external_ids"
1704 key="neutron:network_name"/> in the <ref table="Logical_Switch"
1705 db="OVN_Northbound"/> table.
1706 </p>
1707
1708 <column name="external_ids" key="name">
1709 A name for the logical datapath.
1710 </column>
1711
1712 <column name="external_ids" key="name2">
1713 Another name for the logical datapath.
1714 </column>
1715 </group>
1716 </group>
1717
1718 <group title="Common Columns">
1719 The overall purpose of these columns is described under <code>Common
1720 Columns</code> at the beginning of this document.
1721
1722 <column name="external_ids"/>
1723 </group>
1724 </table>
1725
1726 <table name="Port_Binding" title="Physical-Logical Port Bindings">
1727 <p>
1728 Most rows in this table identify the physical location of a logical port.
1729 (The exceptions are logical patch ports, which do not have any physical
1730 location.)
1731 </p>
1732
1733 <p>
1734 For every <code>Logical_Switch_Port</code> record in
1735 <code>OVN_Northbound</code> database, <code>ovn-northd</code>
1736 creates a record in this table. <code>ovn-northd</code> populates
1737 and maintains every column except the <code>chassis</code> column,
1738 which it leaves empty in new records.
1739 </p>
1740
1741 <p>
1742 <code>ovn-controller</code>/<code>ovn-controller-vtep</code>
1743 populates the <code>chassis</code> column for the records that
1744 identify the logical ports that are located on its hypervisor/gateway,
1745 which <code>ovn-controller</code>/<code>ovn-controller-vtep</code> in
1746 turn finds out by monitoring the local hypervisor's Open_vSwitch
1747 database, which identifies logical ports via the conventions described
1748 in <code>IntegrationGuide.rst</code>. (The exceptions are for
1749 <code>Port_Binding</code> records with <code>type</code> of
1750 <code>l3gateway</code>, whose locations are identified by
1751 <code>ovn-northd</code> via the <code>options:l3gateway-chassis</code>
1752 column in this table. <code>ovn-controller</code> is still responsible
1753 to populate the <code>chassis</code> column.)
1754 </p>
1755
1756 <p>
1757 When a chassis shuts down gracefully, it should clean up the
1758 <code>chassis</code> column that it previously had populated.
1759 (This is not critical because resources hosted on the chassis are equally
1760 unreachable regardless of whether their rows are present.) To handle the
1761 case where a VM is shut down abruptly on one chassis, then brought up
1762 again on a different one,
1763 <code>ovn-controller</code>/<code>ovn-controller-vtep</code> must
1764 overwrite the <code>chassis</code> column with new information.
1765 </p>
1766
1767 <group title="Core Features">
1768 <column name="datapath">
1769 The logical datapath to which the logical port belongs.
1770 </column>
1771
1772 <column name="logical_port">
1773 A logical port, taken from <ref table="Logical_Switch_Port"
1774 column="name" db="OVN_Northbound"/> in the OVN_Northbound
1775 database's <ref table="Logical_Switch_Port" db="OVN_Northbound"/>
1776 table. OVN does not prescribe a particular format for the
1777 logical port ID.
1778 </column>
1779
1780 <column name="chassis">
1781 The meaning of this column depends on the value of the <ref column="type"/>
1782 column. This is the meaning for each <ref column="type"/>
1783
1784 <dl>
1785 <dt>(empty string)</dt>
1786 <dd>
1787 The physical location of the logical port. To successfully identify a
1788 chassis, this column must be a <ref table="Chassis"/> record. This is
1789 populated by <code>ovn-controller</code>.
1790 </dd>
1791
1792 <dt>vtep</dt>
1793 <dd>
1794 The physical location of the hardware_vtep gateway. To successfully
1795 identify a chassis, this column must be a <ref table="Chassis"/> record.
1796 This is populated by <code>ovn-controller-vtep</code>.
1797 </dd>
1798
1799 <dt>localnet</dt>
1800 <dd>
1801 Always empty. A localnet port is realized on every chassis that has
1802 connectivity to the corresponding physical network.
1803 </dd>
1804
1805 <dt>localport</dt>
1806 <dd>
1807 Always empty. A localport port is present on every chassis.
1808 </dd>
1809
1810 <dt>l3gateway</dt>
1811 <dd>
1812 The physical location of the L3 gateway. To successfully identify a
1813 chassis, this column must be a <ref table="Chassis"/> record. This is
1814 populated by <code>ovn-controller</code> based on the value of
1815 the <code>options:l3gateway-chassis</code> column in this table.
1816 </dd>
1817
1818 <dt>l2gateway</dt>
1819 <dd>
1820 The physical location of this L2 gateway. To successfully identify a
1821 chassis, this column must be a <ref table="Chassis"/> record.
1822 This is populated by <code>ovn-controller</code> based on the value
1823 of the <code>options:l2gateway-chassis</code> column in this table.
1824 </dd>
1825 </dl>
1826
1827 </column>
1828
1829 <column name="tunnel_key">
1830 <p>
1831 A number that represents the logical port in the key (e.g. STT key or
1832 Geneve TLV) field carried within tunnel protocol packets.
1833 </p>
1834
1835 <p>
1836 The tunnel ID must be unique within the scope of a logical datapath.
1837 </p>
1838 </column>
1839
1840 <column name="mac">
1841 <p>
1842 The Ethernet address or addresses used as a source address on the
1843 logical port, each in the form
1844 <var>xx</var>:<var>xx</var>:<var>xx</var>:<var>xx</var>:<var>xx</var>:<var>xx</var>.
1845 The string <code>unknown</code> is also allowed to indicate that the
1846 logical port has an unknown set of (additional) source addresses.
1847 </p>
1848
1849 <p>
1850 A VM interface would ordinarily have a single Ethernet address. A
1851 gateway port might initially only have <code>unknown</code>, and then
1852 add MAC addresses to the set as it learns new source addresses.
1853 </p>
1854 </column>
1855
1856 <column name="type">
1857 <p>
1858 A type for this logical port. Logical ports can be used to model other
1859 types of connectivity into an OVN logical switch. The following types
1860 are defined:
1861 </p>
1862
1863 <dl>
1864 <dt>(empty string)</dt>
1865 <dd>VM (or VIF) interface.</dd>
1866
1867 <dt><code>patch</code></dt>
1868 <dd>
1869 One of a pair of logical ports that act as if connected by a patch
1870 cable. Useful for connecting two logical datapaths, e.g. to connect
1871 a logical router to a logical switch or to another logical router.
1872 </dd>
1873
1874 <dt><code>l3gateway</code></dt>
1875 <dd>
1876 One of a pair of logical ports that act as if connected by a patch
1877 cable across multiple chassis. Useful for connecting a logical
1878 switch with a Gateway router (which is only resident on a
1879 particular chassis).
1880 </dd>
1881
1882 <dt><code>localnet</code></dt>
1883 <dd>
1884 A connection to a locally accessible network from each
1885 <code>ovn-controller</code> instance. A logical switch can only
1886 have a single <code>localnet</code> port attached. This is used
1887 to model direct connectivity to an existing network.
1888 </dd>
1889
1890 <dt><code>localport</code></dt>
1891 <dd>
1892 A connection to a local VIF. Traffic that arrives on a
1893 <code>localport</code> is never forwarded over a tunnel to another
1894 chassis. These ports are present on every chassis and have the same
1895 address in all of them. This is used to model connectivity to local
1896 services that run on every hypervisor.
1897 </dd>
1898
1899 <dt><code>l2gateway</code></dt>
1900 <dd>
1901 An L2 connection to a physical network. The chassis this
1902 <ref table="Port_Binding"/> is bound to will serve as
1903 an L2 gateway to the network named by
1904 <ref column="options" table="Port_Binding"/>:<code>network_name</code>.
1905 </dd>
1906
1907 <dt><code>vtep</code></dt>
1908 <dd>
1909 A port to a logical switch on a VTEP gateway chassis. In order to
1910 get this port correctly recognized by the OVN controller, the <ref
1911 column="options"
1912 table="Port_Binding"/>:<code>vtep-physical-switch</code> and <ref
1913 column="options"
1914 table="Port_Binding"/>:<code>vtep-logical-switch</code> must also
1915 be defined.
1916 </dd>
1917
1918 <dt><code>chassisredirect</code></dt>
1919 <dd>
1920 A logical port that represents a particular instance, bound
1921 to a specific chassis, of an otherwise distributed parent
1922 port (e.g. of type <code>patch</code>). A
1923 <code>chassisredirect</code> port should never be used as an
1924 <code>inport</code>. When an ingress pipeline sets the
1925 <code>outport</code>, it may set the value to a logical port
1926 of type <code>chassisredirect</code>. This will cause the
1927 packet to be directed to a specific chassis to carry out the
1928 egress pipeline. At the beginning of the egress pipeline,
1929 the <code>outport</code> will be reset to the value of the
1930 distributed port.
1931 </dd>
1932 </dl>
1933 </column>
1934 </group>
1935
1936 <group title="Patch Options">
1937 <p>
1938 These options apply to logical ports with <ref column="type"/> of
1939 <code>patch</code>.
1940 </p>
1941
1942 <column name="options" key="peer">
1943 The <ref column="logical_port"/> in the <ref table="Port_Binding"/>
1944 record for the other side of the patch. The named <ref
1945 column="logical_port"/> must specify this <ref column="logical_port"/>
1946 in its own <code>peer</code> option. That is, the two patch logical
1947 ports must have reversed <ref column="logical_port"/> and
1948 <code>peer</code> values.
1949 </column>
1950
1951 <column name="nat_addresses">
1952 MAC address followed by a list of SNAT and DNAT external IP
1953 addresses, followed by
1954 <code>is_chassis_resident("<var>lport</var>")</code>, where
1955 <var>lport</var> is the name of a logical port on the same chassis
1956 where the corresponding NAT rules are applied. This is used to
1957 send gratuitous ARPs for SNAT and DNAT external IP addresses via
1958 <code>localnet</code>, from the chassis where <var>lport</var>
1959 resides. Example: <code>80:fa:5b:06:72:b7 158.36.44.22
1960 158.36.44.24 is_chassis_resident("foo1")</code>. This would result
1961 in generation of gratuitous ARPs for IP addresses 158.36.44.22 and
1962 158.36.44.24 with a MAC address of 80:fa:5b:06:72:b7 from the chassis
1963 where the logical port "foo1" resides.
1964 </column>
1965 </group>
1966
1967 <group title="L3 Gateway Options">
1968 <p>
1969 These options apply to logical ports with <ref column="type"/> of
1970 <code>l3gateway</code>.
1971 </p>
1972
1973 <column name="options" key="peer">
1974 The <ref column="logical_port"/> in the <ref table="Port_Binding"/>
1975 record for the other side of the 'l3gateway' port. The named <ref
1976 column="logical_port"/> must specify this <ref column="logical_port"/>
1977 in its own <code>peer</code> option. That is, the two 'l3gateway'
1978 logical ports must have reversed <ref column="logical_port"/> and
1979 <code>peer</code> values.
1980 </column>
1981
1982 <column name="options" key="l3gateway-chassis">
1983 The <code>chassis</code> in which the port resides.
1984 </column>
1985
1986 <column name="options" key="nat-addresses">
1987 MAC address of the <code>l3gateway</code> port followed by a list of
1988 SNAT and DNAT external IP addresses. This is used to send gratuitous
1989 ARPs for SNAT and DNAT external IP addresses via <code>localnet</code>.
1990 Example: <code>80:fa:5b:06:72:b7 158.36.44.22 158.36.44.24</code>.
1991 This would result in generation of gratuitous ARPs for IP addresses
1992 158.36.44.22 and 158.36.44.24 with a MAC address of 80:fa:5b:06:72:b7.
1993 This is used in OVS versions prior to 2.8.
1994 </column>
1995
1996 <column name="nat_addresses">
1997 MAC address of the <code>l3gateway</code> port followed by a list of
1998 SNAT and DNAT external IP addresses. This is used to send gratuitous
1999 ARPs for SNAT and DNAT external IP addresses via <code>localnet</code>.
2000 Example: <code>80:fa:5b:06:72:b7 158.36.44.22 158.36.44.24</code>.
2001 This would result in generation of gratuitous ARPs for IP addresses
2002 158.36.44.22 and 158.36.44.24 with a MAC address of 80:fa:5b:06:72:b7.
2003 This is used in OVS version 2.8 and later versions.
2004 </column>
2005 </group>
2006
2007 <group title="Localnet Options">
2008 <p>
2009 These options apply to logical ports with <ref column="type"/> of
2010 <code>localnet</code>.
2011 </p>
2012
2013 <column name="options" key="network_name">
2014 Required. <code>ovn-controller</code> uses the configuration entry
2015 <code>ovn-bridge-mappings</code> to determine how to connect to this
2016 network. <code>ovn-bridge-mappings</code> is a list of network names
2017 mapped to a local OVS bridge that provides access to that network. An
2018 example of configuring <code>ovn-bridge-mappings</code> would be:
2019
2020 <pre>$ ovs-vsctl set open . external-ids:ovn-bridge-mappings=physnet1:br-eth0,physnet2:br-eth1</pre>
2021
2022 <p>
2023 When a logical switch has a <code>localnet</code> port attached,
2024 every chassis that may have a local vif attached to that logical
2025 switch must have a bridge mapping configured to reach that
2026 <code>localnet</code>. Traffic that arrives on a
2027 <code>localnet</code> port is never forwarded over a tunnel to
2028 another chassis.
2029 </p>
2030 </column>
2031
2032 <column name="tag">
2033 If set, indicates that the port represents a connection to a specific
2034 VLAN on a locally accessible network. The VLAN ID is used to match
2035 incoming traffic and is also added to outgoing traffic.
2036 </column>
2037 </group>
2038
2039 <group title="L2 Gateway Options">
2040 <p>
2041 These options apply to logical ports with <ref column="type"/> of
2042 <code>l2gateway</code>.
2043 </p>
2044
2045 <column name="options" key="network_name">
2046 Required. <code>ovn-controller</code> uses the configuration entry
2047 <code>ovn-bridge-mappings</code> to determine how to connect to this
2048 network. <code>ovn-bridge-mappings</code> is a list of network names
2049 mapped to a local OVS bridge that provides access to that network. An
2050 example of configuring <code>ovn-bridge-mappings</code> would be:
2051
2052 <pre>$ ovs-vsctl set open . external-ids:ovn-bridge-mappings=physnet1:br-eth0,physnet2:br-eth1</pre>
2053
2054 <p>
2055 When a logical switch has a <code>l2gateway</code> port attached,
2056 the chassis that the <code>l2gateway</code> port is bound to
2057 must have a bridge mapping configured to reach the network
2058 identified by <code>network_name</code>.
2059 </p>
2060 </column>
2061
2062 <column name="options" key="l2gateway-chassis">
2063 Required. The <code>chassis</code> in which the port resides.
2064 </column>
2065
2066 <column name="tag">
2067 If set, indicates that the gateway is connected to a specific
2068 VLAN on the physical network. The VLAN ID is used to match
2069 incoming traffic and is also added to outgoing traffic.
2070 </column>
2071 </group>
2072
2073 <group title="VTEP Options">
2074 <p>
2075 These options apply to logical ports with <ref column="type"/> of
2076 <code>vtep</code>.
2077 </p>
2078
2079 <column name="options" key="vtep-physical-switch">
2080 Required. The name of the VTEP gateway.
2081 </column>
2082
2083 <column name="options" key="vtep-logical-switch">
2084 Required. A logical switch name connected by the VTEP gateway. Must
2085 be set when <ref column="type"/> is <code>vtep</code>.
2086 </column>
2087 </group>
2088
2089 <group title="VMI (or VIF) Options">
2090 <p>
2091 These options apply to logical ports with <ref column="type"/> having
2092 (empty string)
2093 </p>
2094
2095 <column name="options" key="qos_max_rate">
2096 If set, indicates the maximum rate for data sent from this interface,
2097 in bit/s. The traffic will be shaped according to this limit.
2098 </column>
2099
2100 <column name="options" key="qos_burst">
2101 If set, indicates the maximum burst size for data sent from this
2102 interface, in bits.
2103 </column>
2104
2105 <column name="options" key="qdisc_queue_id"
2106 type='{"type": "integer", "minInteger": 1, "maxInteger": 61440}'>
2107 Indicates the queue number on the physical device. This is same as the
2108 <code>queue_id</code> used in OpenFlow in <code>struct
2109 ofp_action_enqueue</code>.
2110 </column>
2111 </group>
2112
2113 <group title="Chassis Redirect Options">
2114 <p>
2115 These options apply to logical ports with <ref column="type"/>
2116 of <code>chassisredirect</code>.
2117 </p>
2118
2119 <column name="options" key="distributed-port">
2120 The name of the distributed port for which this
2121 <code>chassisredirect</code> port represents a particular instance.
2122 </column>
2123
2124 <column name="options" key="redirect-chassis">
2125 The <code>chassis</code> that this <code>chassisredirect</code> port
2126 is bound to. This is taken from <ref table="Logical_Router_Port"
2127 column="options" key="redirect-chassis" db="OVN_Northbound"/>
2128 in the OVN_Northbound database's <ref table="Logical_Router_Port"
2129 db="OVN_Northbound"/> table.
2130 </column>
2131 </group>
2132
2133 <group title="Nested Containers">
2134 <p>
2135 These columns support containers nested within a VM. Specifically,
2136 they are used when <ref column="type"/> is empty and <ref
2137 column="logical_port"/> identifies the interface of a container spawned
2138 inside a VM. They are empty for containers or VMs that run directly on
2139 a hypervisor.
2140 </p>
2141
2142 <column name="parent_port">
2143 This is taken from
2144 <ref table="Logical_Switch_Port" column="parent_name"
2145 db="OVN_Northbound"/> in the OVN_Northbound database's
2146 <ref table="Logical_Switch_Port" db="OVN_Northbound"/> table.
2147 </column>
2148
2149 <column name="tag">
2150 <p>
2151 Identifies the VLAN tag in the network traffic associated with that
2152 container's network interface.
2153 </p>
2154
2155 <p>
2156 This column is used for a different purpose when <ref column="type"/>
2157 is <code>localnet</code> (see <code>Localnet Options</code>, above)
2158 or <code>l2gateway</code> (see <code>L2 Gateway Options</code>, above).
2159 </p>
2160 </column>
2161 </group>
2162
2163 <group title="Naming">
2164 <column name="external_ids" key="name">
2165 <p>
2166 For a logical switch port, <code>ovn-northd</code> copies this from
2167 <ref table="Logical_Switch_Port" db="OVN_Northbound"
2168 column="external_ids" key="neutron:port_name"/> in the <ref
2169 table="Logical_Switch_Port" db="OVN_Northbound"/> table in the
2170 OVN_Northbound database, if it is a nonempty string.
2171 </p>
2172
2173 <p>
2174 For a logical switch port, <code>ovn-northd</code> does not currently
2175 set this key.
2176 </p>
2177 </column>
2178 </group>
2179
2180 <group title="Common Columns">
2181 <column name="external_ids">
2182 <p>
2183 See <em>External IDs</em> at the beginning of this document.
2184 </p>
2185
2186 <p>
2187 The <code>ovn-northd</code> program populates this column with
2188 all entries into the <ref column="external_ids"/> column of the
2189 <ref table="Logical_Switch_Port"/> table of the
2190 <ref db="OVN_Northbound"/> database.
2191 </p>
2192 </column>
2193 </group>
2194 </table>
2195
2196 <table name="MAC_Binding" title="IP to MAC bindings">
2197 <p>
2198 Each row in this table specifies a binding from an IP address to an
2199 Ethernet address that has been discovered through ARP (for IPv4) or
2200 neighbor discovery (for IPv6). This table is primarily used to discover
2201 bindings on physical networks, because IP-to-MAC bindings for virtual
2202 machines are usually populated statically into the <ref
2203 table="Port_Binding"/> table.
2204 </p>
2205
2206 <p>
2207 This table expresses a functional relationship: <ref
2208 table="MAC_Binding"/>(<ref column="logical_port"/>, <ref column="ip"/>) =
2209 <ref column="mac"/>.
2210 </p>
2211
2212 <p>
2213 In outline, the lifetime of a logical router's MAC binding looks like
2214 this:
2215 </p>
2216
2217 <ol>
2218 <li>
2219 On hypervisor 1, a logical router determines that a packet should be
2220 forwarded to IP address <var>A</var> on one of its router ports. It
2221 uses its logical flow table to determine that <var>A</var> lacks a
2222 static IP-to-MAC binding and the <code>get_arp</code> action to
2223 determine that it lacks a dynamic IP-to-MAC binding.
2224 </li>
2225
2226 <li>
2227 Using an OVN logical <code>arp</code> action, the logical router
2228 generates and sends a broadcast ARP request to the router port. It
2229 drops the IP packet.
2230 </li>
2231
2232 <li>
2233 The logical switch attached to the router port delivers the ARP request
2234 to all of its ports. (It might make sense to deliver it only to ports
2235 that have no static IP-to-MAC bindings, but this could also be
2236 surprising behavior.)
2237 </li>
2238
2239 <li>
2240 A host or VM on hypervisor 2 (which might be the same as hypervisor 1)
2241 attached to the logical switch owns the IP address in question. It
2242 composes an ARP reply and unicasts it to the logical router port's
2243 Ethernet address.
2244 </li>
2245
2246 <li>
2247 The logical switch delivers the ARP reply to the logical router port.
2248 </li>
2249
2250 <li>
2251 The logical router flow table executes a <code>put_arp</code> action.
2252 To record the IP-to-MAC binding, <code>ovn-controller</code> adds a row
2253 to the <ref table="MAC_Binding"/> table.
2254 </li>
2255
2256 <li>
2257 On hypervisor 1, <code>ovn-controller</code> receives the updated <ref
2258 table="MAC_Binding"/> table from the OVN southbound database. The next
2259 packet destined to <var>A</var> through the logical router is sent
2260 directly to the bound Ethernet address.
2261 </li>
2262 </ol>
2263
2264 <column name="logical_port">
2265 The logical port on which the binding was discovered.
2266 </column>
2267
2268 <column name="ip">
2269 The bound IP address.
2270 </column>
2271
2272 <column name="mac">
2273 The Ethernet address to which the IP is bound.
2274 </column>
2275 <column name="datapath">
2276 The logical datapath to which the logical port belongs.
2277 </column>
2278 </table>
2279
2280 <table name="DHCP_Options" title="DHCP Options supported by native OVN DHCP">
2281 <p>
2282 Each row in this table stores the DHCP Options supported by native OVN
2283 DHCP. <code>ovn-northd</code> populates this table with the supported
2284 DHCP options. <code>ovn-controller</code> looks up this table to get the
2285 DHCP codes of the DHCP options defined in the "put_dhcp_opts" action.
2286 Please refer to the RFC 2132 <code>"https://tools.ietf.org/html/rfc2132"</code>
2287 for the possible list of DHCP options that can be defined here.
2288 </p>
2289
2290 <column name="name">
2291 <p>
2292 Name of the DHCP option.
2293 </p>
2294
2295 <p>
2296 Example. name="router"
2297 </p>
2298 </column>
2299
2300 <column name="code">
2301 <p>
2302 DHCP option code for the DHCP option as defined in the RFC 2132.
2303 </p>
2304
2305 <p>
2306 Example. code=3
2307 </p>
2308 </column>
2309
2310 <column name="type">
2311 <p>
2312 Data type of the DHCP option code.
2313 </p>
2314
2315 <dl>
2316 <dt><code>value: bool</code></dt>
2317 <dd>
2318 <p>
2319 This indicates that the value of the DHCP option is a bool.
2320 </p>
2321
2322 <p>
2323 Example. "name=ip_forward_enable", "code=19", "type=bool".
2324 </p>
2325
2326 <p>
2327 put_dhcp_opts(..., ip_forward_enable = 1,...)
2328 </p>
2329 </dd>
2330
2331 <dt><code>value: uint8</code></dt>
2332 <dd>
2333 <p>
2334 This indicates that the value of the DHCP option is an unsigned
2335 int8 (8 bits)
2336 </p>
2337
2338 <p>
2339 Example. "name=default_ttl", "code=23", "type=uint8".
2340 </p>
2341
2342 <p>
2343 put_dhcp_opts(..., default_ttl = 50,...)
2344 </p>
2345 </dd>
2346
2347 <dt><code>value: uint16</code></dt>
2348 <dd>
2349 <p>
2350 This indicates that the value of the DHCP option is an unsigned
2351 int16 (16 bits).
2352 </p>
2353
2354 <p>
2355 Example. "name=mtu", "code=26", "type=uint16".
2356 </p>
2357
2358 <p>
2359 put_dhcp_opts(..., mtu = 1450,...)
2360 </p>
2361 </dd>
2362
2363 <dt><code>value: uint32</code></dt>
2364 <dd>
2365 <p>
2366 This indicates that the value of the DHCP option is an unsigned
2367 int32 (32 bits).
2368 </p>
2369
2370 <p>
2371 Example. "name=lease_time", "code=51", "type=uint32".
2372 </p>
2373
2374 <p>
2375 put_dhcp_opts(..., lease_time = 86400,...)
2376 </p>
2377 </dd>
2378
2379 <dt><code>value: ipv4</code></dt>
2380 <dd>
2381 <p>
2382 This indicates that the value of the DHCP option is an IPv4
2383 address or addresses.
2384 </p>
2385
2386 <p>
2387 Example. "name=router", "code=3", "type=ipv4".
2388 </p>
2389
2390 <p>
2391 put_dhcp_opts(..., router = 10.0.0.1,...)
2392 </p>
2393
2394 <p>
2395 Example. "name=dns_server", "code=6", "type=ipv4".
2396 </p>
2397
2398 <p>
2399 put_dhcp_opts(..., dns_server = {8.8.8.8 7.7.7.7},...)
2400 </p>
2401 </dd>
2402
2403 <dt><code>value: static_routes</code></dt>
2404 <dd>
2405 <p>
2406 This indicates that the value of the DHCP option contains a pair of
2407 IPv4 route and next hop addresses.
2408 </p>
2409
2410 <p>
2411 Example. "name=classless_static_route", "code=121", "type=static_routes".
2412 </p>
2413
2414 <p>
2415 put_dhcp_opts(..., classless_static_route = {30.0.0.0/24,10.0.0.4,0.0.0.0/0,10.0.0.1}...)
2416 </p>
2417 </dd>
2418
2419 <dt><code>value: str</code></dt>
2420 <dd>
2421 <p>
2422 This indicates that the value of the DHCP option is a string.
2423 </p>
2424
2425 <p>
2426 Example. "name=host_name", "code=12", "type=str".
2427 </p>
2428 </dd>
2429 </dl>
2430 </column>
2431 </table>
2432
2433 <table name="DHCPv6_Options" title="DHCPv6 Options supported by native OVN DHCPv6">
2434 <p>
2435 Each row in this table stores the DHCPv6 Options supported by native OVN
2436 DHCPv6. <code>ovn-northd</code> populates this table with the supported
2437 DHCPv6 options. <code>ovn-controller</code> looks up this table to get
2438 the DHCPv6 codes of the DHCPv6 options defined in the
2439 <code>put_dhcpv6_opts</code> action. Please refer to RFC 3315 and RFC
2440 3646 for the list of DHCPv6 options that can be defined here.
2441 </p>
2442
2443 <column name="name">
2444 <p>
2445 Name of the DHCPv6 option.
2446 </p>
2447
2448 <p>
2449 Example. name="ia_addr"
2450 </p>
2451 </column>
2452
2453 <column name="code">
2454 <p>
2455 DHCPv6 option code for the DHCPv6 option as defined in the appropriate
2456 RFC.
2457 </p>
2458
2459 <p>
2460 Example. code=3
2461 </p>
2462 </column>
2463
2464 <column name="type">
2465 <p>
2466 Data type of the DHCPv6 option code.
2467 </p>
2468
2469 <dl>
2470 <dt><code>value: ipv6</code></dt>
2471 <dd>
2472 <p>
2473 This indicates that the value of the DHCPv6 option is an IPv6
2474 address(es).
2475 </p>
2476
2477 <p>
2478 Example. "name=ia_addr", "code=5", "type=ipv6".
2479 </p>
2480
2481 <p>
2482 put_dhcpv6_opts(..., ia_addr = ae70::4,...)
2483 </p>
2484 </dd>
2485
2486 <dt><code>value: str</code></dt>
2487 <dd>
2488 <p>
2489 This indicates that the value of the DHCPv6 option is a string.
2490 </p>
2491
2492 <p>
2493 Example. "name=domain_search", "code=24", "type=str".
2494 </p>
2495
2496 <p>
2497 put_dhcpv6_opts(..., domain_search = ovn.domain,...)
2498 </p>
2499 </dd>
2500
2501 <dt><code>value: mac</code></dt>
2502 <dd>
2503 <p>
2504 This indicates that the value of the DHCPv6 option is a MAC address.
2505 </p>
2506
2507 <p>
2508 Example. "name=server_id", "code=2", "type=mac".
2509 </p>
2510
2511 <p>
2512 put_dhcpv6_opts(..., server_id = 01:02:03:04L05:06,...)
2513 </p>
2514 </dd>
2515 </dl>
2516 </column>
2517 </table>
2518 <table name="Connection" title="OVSDB client connections.">
2519 <p>
2520 Configuration for a database connection to an Open vSwitch database
2521 (OVSDB) client.
2522 </p>
2523
2524 <p>
2525 This table primarily configures the Open vSwitch database server
2526 (<code>ovsdb-server</code>).
2527 </p>
2528
2529 <p>
2530 The Open vSwitch database server can initiate and maintain active
2531 connections to remote clients. It can also listen for database
2532 connections.
2533 </p>
2534
2535 <group title="Core Features">
2536 <column name="target">
2537 <p>Connection methods for clients.</p>
2538 <p>
2539 The following connection methods are currently supported:
2540 </p>
2541 <dl>
2542 <dt><code>ssl:<var>ip</var></code>[<code>:<var>port</var></code>]</dt>
2543 <dd>
2544 <p>
2545 The specified SSL <var>port</var> on the host at the given
2546 <var>ip</var>, which must be expressed as an IP address
2547 (not a DNS name). A valid SSL configuration must be provided
2548 when this form is used, this configuration can be specified
2549 via command-line options or the <ref table="SSL"/> table.
2550 </p>
2551 <p>
2552 If <var>port</var> is not specified, it defaults to 6640.
2553 </p>
2554 <p>
2555 SSL support is an optional feature that is not always
2556 built as part of Open vSwitch.
2557 </p>
2558 </dd>
2559
2560 <dt><code>tcp:<var>ip</var></code>[<code>:<var>port</var></code>]</dt>
2561 <dd>
2562 <p>
2563 The specified TCP <var>port</var> on the host at the given
2564 <var>ip</var>, which must be expressed as an IP address (not a
2565 DNS name), where <var>ip</var> can be IPv4 or IPv6 address. If
2566 <var>ip</var> is an IPv6 address, wrap it in square brackets,
2567 e.g. <code>tcp:[::1]:6640</code>.
2568 </p>
2569 <p>
2570 If <var>port</var> is not specified, it defaults to 6640.
2571 </p>
2572 </dd>
2573 <dt><code>pssl:</code>[<var>port</var>][<code>:<var>ip</var></code>]</dt>
2574 <dd>
2575 <p>
2576 Listens for SSL connections on the specified TCP <var>port</var>.
2577 Specify 0 for <var>port</var> to have the kernel automatically
2578 choose an available port. If <var>ip</var>, which must be
2579 expressed as an IP address (not a DNS name), is specified, then
2580 connections are restricted to the specified local IP address
2581 (either IPv4 or IPv6 address). If <var>ip</var> is an IPv6
2582 address, wrap in square brackets,
2583 e.g. <code>pssl:6640:[::1]</code>. If <var>ip</var> is not
2584 specified then it listens only on IPv4 (but not IPv6) addresses.
2585 A valid SSL configuration must be provided when this form is used,
2586 this can be specified either via command-line options or the
2587 <ref table="SSL"/> table.
2588 </p>
2589 <p>
2590 If <var>port</var> is not specified, it defaults to 6640.
2591 </p>
2592 <p>
2593 SSL support is an optional feature that is not always built as
2594 part of Open vSwitch.
2595 </p>
2596 </dd>
2597 <dt><code>ptcp:</code>[<var>port</var>][<code>:<var>ip</var></code>]</dt>
2598 <dd>
2599 <p>
2600 Listens for connections on the specified TCP <var>port</var>.
2601 Specify 0 for <var>port</var> to have the kernel automatically
2602 choose an available port. If <var>ip</var>, which must be
2603 expressed as an IP address (not a DNS name), is specified, then
2604 connections are restricted to the specified local IP address
2605 (either IPv4 or IPv6 address). If <var>ip</var> is an IPv6
2606 address, wrap it in square brackets,
2607 e.g. <code>ptcp:6640:[::1]</code>. If <var>ip</var> is not
2608 specified then it listens only on IPv4 addresses.
2609 </p>
2610 <p>
2611 If <var>port</var> is not specified, it defaults to 6640.
2612 </p>
2613 </dd>
2614 </dl>
2615 <p>When multiple clients are configured, the <ref column="target"/>
2616 values must be unique. Duplicate <ref column="target"/> values yield
2617 unspecified results.</p>
2618 </column>
2619
2620 <column name="read_only">
2621 <code>true</code> to restrict these connections to read-only
2622 transactions, <code>false</code> to allow them to modify the database.
2623 </column>
2624 </group>
2625
2626 <group title="Client Failure Detection and Handling">
2627 <column name="max_backoff">
2628 Maximum number of milliseconds to wait between connection attempts.
2629 Default is implementation-specific.
2630 </column>
2631
2632 <column name="inactivity_probe">
2633 Maximum number of milliseconds of idle time on connection to the client
2634 before sending an inactivity probe message. If Open vSwitch does not
2635 communicate with the client for the specified number of seconds, it
2636 will send a probe. If a response is not received for the same
2637 additional amount of time, Open vSwitch assumes the connection has been
2638 broken and attempts to reconnect. Default is implementation-specific.
2639 A value of 0 disables inactivity probes.
2640 </column>
2641 </group>
2642
2643 <group title="Status">
2644 <p>
2645 Key-value pair of <ref column="is_connected"/> is always updated.
2646 Other key-value pairs in the status columns may be updated depends
2647 on the <ref column="target"/> type.
2648 </p>
2649
2650 <p>
2651 When <ref column="target"/> specifies a connection method that
2652 listens for inbound connections (e.g. <code>ptcp:</code> or
2653 <code>punix:</code>), both <ref column="n_connections"/> and
2654 <ref column="is_connected"/> may also be updated while the
2655 remaining key-value pairs are omitted.
2656 </p>
2657
2658 <p>
2659 On the other hand, when <ref column="target"/> specifies an
2660 outbound connection, all key-value pairs may be updated, except
2661 the above-mentioned two key-value pairs associated with inbound
2662 connection targets. They are omitted.
2663 </p>
2664
2665 <column name="is_connected">
2666 <code>true</code> if currently connected to this client,
2667 <code>false</code> otherwise.
2668 </column>
2669
2670 <column name="status" key="last_error">
2671 A human-readable description of the last error on the connection
2672 to the manager; i.e. <code>strerror(errno)</code>. This key
2673 will exist only if an error has occurred.
2674 </column>
2675
2676 <column name="status" key="state"
2677 type='{"type": "string", "enum": ["set", ["VOID", "BACKOFF", "CONNECTING", "ACTIVE", "IDLE"]]}'>
2678 <p>
2679 The state of the connection to the manager:
2680 </p>
2681 <dl>
2682 <dt><code>VOID</code></dt>
2683 <dd>Connection is disabled.</dd>
2684
2685 <dt><code>BACKOFF</code></dt>
2686 <dd>Attempting to reconnect at an increasing period.</dd>
2687
2688 <dt><code>CONNECTING</code></dt>
2689 <dd>Attempting to connect.</dd>
2690
2691 <dt><code>ACTIVE</code></dt>
2692 <dd>Connected, remote host responsive.</dd>
2693
2694 <dt><code>IDLE</code></dt>
2695 <dd>Connection is idle. Waiting for response to keep-alive.</dd>
2696 </dl>
2697 <p>
2698 These values may change in the future. They are provided only for
2699 human consumption.
2700 </p>
2701 </column>
2702
2703 <column name="status" key="sec_since_connect"
2704 type='{"type": "integer", "minInteger": 0}'>
2705 The amount of time since this client last successfully connected
2706 to the database (in seconds). Value is empty if client has never
2707 successfully been connected.
2708 </column>
2709
2710 <column name="status" key="sec_since_disconnect"
2711 type='{"type": "integer", "minInteger": 0}'>
2712 The amount of time since this client last disconnected from the
2713 database (in seconds). Value is empty if client has never
2714 disconnected.
2715 </column>
2716
2717 <column name="status" key="locks_held">
2718 Space-separated list of the names of OVSDB locks that the connection
2719 holds. Omitted if the connection does not hold any locks.
2720 </column>
2721
2722 <column name="status" key="locks_waiting">
2723 Space-separated list of the names of OVSDB locks that the connection is
2724 currently waiting to acquire. Omitted if the connection is not waiting
2725 for any locks.
2726 </column>
2727
2728 <column name="status" key="locks_lost">
2729 Space-separated list of the names of OVSDB locks that the connection
2730 has had stolen by another OVSDB client. Omitted if no locks have been
2731 stolen from this connection.
2732 </column>
2733
2734 <column name="status" key="n_connections"
2735 type='{"type": "integer", "minInteger": 2}'>
2736 When <ref column="target"/> specifies a connection method that
2737 listens for inbound connections (e.g. <code>ptcp:</code> or
2738 <code>pssl:</code>) and more than one connection is actually active,
2739 the value is the number of active connections. Otherwise, this
2740 key-value pair is omitted.
2741 </column>
2742
2743 <column name="status" key="bound_port" type='{"type": "integer"}'>
2744 When <ref column="target"/> is <code>ptcp:</code> or
2745 <code>pssl:</code>, this is the TCP port on which the OVSDB server is
2746 listening. (This is particularly useful when <ref
2747 column="target"/> specifies a port of 0, allowing the kernel to
2748 choose any available port.)
2749 </column>
2750 </group>
2751
2752 <group title="Common Columns">
2753 The overall purpose of these columns is described under <code>Common
2754 Columns</code> at the beginning of this document.
2755
2756 <column name="external_ids"/>
2757 <column name="other_config"/>
2758 </group>
2759 </table>
2760 <table name="SSL">
2761 SSL configuration for ovn-sb database access.
2762
2763 <column name="private_key">
2764 Name of a PEM file containing the private key used as the switch's
2765 identity for SSL connections to the controller.
2766 </column>
2767
2768 <column name="certificate">
2769 Name of a PEM file containing a certificate, signed by the
2770 certificate authority (CA) used by the controller and manager,
2771 that certifies the switch's private key, identifying a trustworthy
2772 switch.
2773 </column>
2774
2775 <column name="ca_cert">
2776 Name of a PEM file containing the CA certificate used to verify
2777 that the switch is connected to a trustworthy controller.
2778 </column>
2779
2780 <column name="bootstrap_ca_cert">
2781 If set to <code>true</code>, then Open vSwitch will attempt to
2782 obtain the CA certificate from the controller on its first SSL
2783 connection and save it to the named PEM file. If it is successful,
2784 it will immediately drop the connection and reconnect, and from then
2785 on all SSL connections must be authenticated by a certificate signed
2786 by the CA certificate thus obtained. <em>This option exposes the
2787 SSL connection to a man-in-the-middle attack obtaining the initial
2788 CA certificate.</em> It may still be useful for bootstrapping.
2789 </column>
2790
2791 <column name="ssl_protocols">
2792 List of SSL protocols to be enabled for SSL connections. The default
2793 when this option is omitted is <code>TLSv1,TLSv1.1,TLSv1.2</code>.
2794 </column>
2795
2796 <column name="ssl_ciphers">
2797 List of ciphers (in OpenSSL cipher string format) to be supported
2798 for SSL connections. The default when this option is omitted is
2799 <code>HIGH:!aNULL:!MD5</code>.
2800 </column>
2801
2802 <group title="Common Columns">
2803 The overall purpose of these columns is described under <code>Common
2804 Columns</code> at the beginning of this document.
2805
2806 <column name="external_ids"/>
2807 </group>
2808 </table>
2809 <table name="DNS" title="Native DNS resolution">
2810 <p>
2811 Each row in this table stores the DNS records. The OVN action
2812 <code>dns_lookup</code> uses this table for DNS resolution.
2813 </p>
2814
2815 <column name="records">
2816 Key-value pair of DNS records with <code>DNS query name</code> as the key
2817 and a string of IP address(es) separated by comma or space as the
2818 value.
2819
2820 <p><b>Example: </b> "vm1.ovn.org" = "10.0.0.4 aef0::4"</p>
2821 </column>
2822
2823 <column name="datapaths">
2824 The DNS records defined in the column <ref column="records"/> will be
2825 applied only to the DNS queries originating from the datapaths defined
2826 in this column.
2827 </column>
2828
2829 <group title="Common Columns">
2830 <column name="external_ids">
2831 See <em>External IDs</em> at the beginning of this document.
2832 </column>
2833 </group>
2834 </table>
2835 </database>