In a gateway like the VTEP L2 gateway, physical vlans belonging to the same logical network form a "logical switch". Each logical switch has a dedicated tunnel key and will keep records of all MACs learned from the owned vlans. So user can just send packet to a "logical switch" and the gateway will figure out the output port and vlan tag automatically.
Therefore, it is really not necessary to keep record of the vlan map for each gateway physical port in the OVN_Southbound database using "gateway_ports" and to map each vlan to a unique ovn logical port. Instead, we should simply map each logical switch to a ovn logical port. Thusly, this commit removes the "Gateway" table from the OVN_Southbound database. In the "Chassis" table, the "gateway_ports" column is replaced by "vtep_logical_switches" column which stores all vtep logical switch names. Then, in the OVN_Northbound database, the CMS must specify the physical switch name and the logical switch name via "options:vtep_physical_switch" and "options:vtep_logical_switch" when creating logical port with type "vtep". Signed-off-by: Alex Wang <al...@nicira.com> --- V4->V5: - rebase on top of master. - change "vtep_logical_switches" to a set of strings storing all logical switch names. - require user to specify "vtep_physical_switch" and "vtep_logical_switch" in options. V3->V4: - change the column name to "vtep_logical_switches". - adopt Ben's refinement of ovn-sb schema manual. ->V3: - Realize that the Gateway table is not needed. --- ovn/ovn-nb.xml | 31 +++++++++++++++++---- ovn/ovn-sb.ovsschema | 16 ++--------- ovn/ovn-sb.xml | 75 ++++++++++++++++++++++++++++---------------------- 3 files changed, 70 insertions(+), 52 deletions(-) diff --git a/ovn/ovn-nb.xml b/ovn/ovn-nb.xml index ade8164..77b559d 100644 --- a/ovn/ovn-nb.xml +++ b/ovn/ovn-nb.xml @@ -111,18 +111,37 @@ <column name="type"> <p> Specify a type for this logical port. Logical ports can be used to model - other types of connectivity into an OVN logical switch. Leaving this column - blank maintains the default logical port behavior. + other types of connectivity into an OVN logical switch. Leaving this + column blank maintains the default logical port behavior, which is + for a VM (or VIF) interface. Besides, the following types are + defined: </p> - <p> - There are no other logical port types implemented yet. - </p> + <dl> + <dt><code>vtep</code></dt> + <dd>A port to a logical switch on a VTEP gateway. In order + to get this port correctly recognized by the ovn controller, the + <ref column="options" table="Logical_Port"/>:vtep_physical_switch + and <ref column="options" table="Logical_Port"/>:vtep_logical_switch + must also be defined.</dd> + </dl> </column> <column name="options"> + <p> This column provides key/value settings specific to the logical port - <ref column="type"/>. + <ref column="type"/>. The following options are defined: + </p> + + <dl> + <dt><code>vtep_physical_switch</code></dt> + <dd>The <ref column="name" table="Chassis"/> of the VTEP gateway.</dd> + </dl> + + <dl> + <dt><code>vtep_logical_switch</code></dt> + <dd>A logical switch name connected by the VTEP gateway.</dd> + </dl> </column> <column name="parent_name"> diff --git a/ovn/ovn-sb.ovsschema b/ovn/ovn-sb.ovsschema index 40a29e9..9ee7431 100644 --- a/ovn/ovn-sb.ovsschema +++ b/ovn/ovn-sb.ovsschema @@ -7,12 +7,9 @@ "encaps": {"type": {"key": {"type": "uuid", "refTable": "Encap"}, "min": 1, "max": "unlimited"}}, - "gateway_ports": {"type": {"key": "string", - "value": {"type": "uuid", - "refTable": "Gateway", - "refType": "strong"}, - "min": 0, - "max": "unlimited"}}}, + "vtep_logical_switches" : {"type": {"key": "string", + "min": 0, + "max": "unlimited"}}}, "isRoot": true, "indexes": [["name"]]}, "Encap": { @@ -25,13 +22,6 @@ "min": 0, "max": "unlimited"}}, "ip": {"type": "string"}}}, - "Gateway": { - "columns": {"vlan_map": {"type": {"key": {"type": "integer", - "minInteger": 0, - "maxInteger": 4095}, - "value": {"type": "string"}, - "min": 0, - "max": "unlimited"}}}}, "Logical_Flow": { "columns": { "logical_datapath": {"type": {"key": {"type": "uuid", diff --git a/ovn/ovn-sb.xml b/ovn/ovn-sb.xml index baced61..393f708 100644 --- a/ovn/ovn-sb.xml +++ b/ovn/ovn-sb.xml @@ -165,16 +165,21 @@ <group title="Gateway Configuration"> <p> - A <dfn>gateway</dfn> is a chassis that forwards traffic between a - logical network and a physical VLAN. Gateways are typically dedicated - nodes that do not host VMs. - </p> - - <column name="gateway_ports"> - Maps from the name of a port attached to the OVN integration bridge - (typically a physical port or an Open vSwitch patch port) to a <ref - table="Gateway"/> record that describes the details of the gatewaying - function. + A <dfn>gateway</dfn> is a chassis that forwards traffic between the + OVN-managed part of a logical network and a physical VLAN, extending a + tunnel-based logical network into a physical network. Gateways are + typically dedicated nodes that do not host VMs. + </p> + + <column name="vtep_logical_switches"> + Stores all vtep logical switch names connected by this gateway + chassis. The <ref table="Port_Binding"/> table entry with + <ref column="options" table="Port_Binding"/>:vtep_physical_switch + =<ref table="Chassis"/> <ref column="name" table="Chassis"/>, and + <ref column="options" table="Port_Binding"/>:vtep_logical_switch + value in <ref table="Chassis"/> + <ref column="vtep_logical_switches" table="Chassis"/>, will be + associated with this <ref table="Chassis"/>. </column> </group> </table> @@ -206,23 +211,6 @@ </column> </table> - <table name="Gateway" title="Physical Network Gateway Ports"> - <p> - The <ref column="gateway_ports" table="Chassis"/> column in the <ref - table="Chassis"/> table refers to rows in this table to connect a chassis - port to a gateway function. Each row in this table describes the logical - networks to which a gateway port is attached. Each chassis, via - <code>ovn-controller</code>(8), adds and updates its own rows, if any - (since most chassis are not gateways), and keeps a copy of the remaining - rows to determine how to reach other chassis. - </p> - - <column name="vlan_map"> - Maps from a VLAN ID to a logical port name. Thus, each named logical - port corresponds to one VLAN on the gateway port. - </column> - </table> - <table name="Logical_Flow" title="Logical Network Flows"> <p> Each row in this table represents one logical flow. The cloud management @@ -903,18 +891,39 @@ <column name="type"> <p> A type for this logical port. Logical ports can be used to model - other types of connectivity into an OVN logical switch. Leaving this column - blank maintains the default logical port behavior. + other types of connectivity into an OVN logical switch. Leaving this + column blank maintains the default logical port behavior, which + is for a VM (or VIF) interface. Besides, the following types are + defined: </p> - <p> - There are no other logical port types implemented yet. - </p> + <dl> + <dt><code>vtep</code></dt> + <dd>A port to a logical switch on a VTEP gateway chassis. In order + to get this port correctly recognized by the ovn controller, the + <ref column="options" table="Port_Binding"/>:vtep_physical_switch + and <ref column="options" table="Port_Binding"/>:vtep_logical_switch + must also be defined.</dd> + </dl> </column> <column name="options"> + <p> This column provides key/value settings specific to the logical port - <ref column="type"/>. + <ref column="type"/>. The following options are defined: + </p> + + <dl> + <dt><code>vtep_physical_switch</code></dt> + <dd>The <ref column="name" table="Chassis"/> of the VTEP gateway + chassis.</dd> + </dl> + + <dl> + <dt><code>vtep_logical_switch</code></dt> + <dd>A logical switch name in VTEP gateway chassis's + <ref column="vtep_logical_switches" table="Chassis"/>.</dd> + </dl> </column> <column name="tunnel_key"> -- 1.7.9.5 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev