diff mbox series

[ovs-dev,v1,1/1] ovn-sb: Introduce Route table.

Message ID d710908b31b21f562d3d68529a228c0c597883d2.1733232055.git.felix.huettner@stackit.cloud
State Superseded
Headers show
Series OVN Fabric integration: Route table. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test fail github build: failed
ovsrobot/github-robot-_ovn-kubernetes fail github build: failed

Commit Message

Felix Huettner Dec. 3, 2024, 1:23 p.m. UTC
The Route table will be used in the future to coordinate routing
information between northd and ovn-controller.
Northd will insert routes that should be advertised to the outside
fabric.
Ovn-controller will insert routes that have been learned from the
outside fabric.

Signed-off-by: Felix Huettner <felix.huettner@stackit.cloud>
---
 ovn-sb.ovsschema | 25 +++++++++++++++
 ovn-sb.xml       | 80 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 105 insertions(+)
diff mbox series

Patch

diff --git a/ovn-sb.ovsschema b/ovn-sb.ovsschema
index 73abf2c8d..4f2d7f137 100644
--- a/ovn-sb.ovsschema
+++ b/ovn-sb.ovsschema
@@ -617,6 +617,31 @@ 
                     "type": {"key": "string", "value": "string",
                              "min": 0, "max": "unlimited"}}},
             "indexes": [["chassis"]],
+            "isRoot": true},
+        "Route": {
+            "columns": {
+                "datapath":
+                    {"type": {"key": {"type": "uuid",
+                                      "refTable": "Datapath_Binding"}}},
+                "logical_port": {"type": {"key": {"type": "uuid",
+                                                  "refTable": "Port_Binding",
+                                                  "refType": "weak"}}},
+                "ip_prefix": {"type": "string"},
+                "nexthop": {"type": "string"},
+                "tracked_port": {"type": {"key": {"type": "uuid",
+                                                  "refTable": "Port_Binding",
+                                                  "refType": "weak"},
+                                          "min": 0,
+                                          "max": 1}},
+                "type": {"type": {"key": {"type": "string",
+                                          "enum": ["set", ["advertise",
+                                                           "receive"]]},
+                                    "min": 1, "max": 1}},
+                "external_ids": {
+                    "type": {"key": "string", "value": "string",
+                             "min": 0, "max": "unlimited"}}},
+            "indexes": [["datapath", "logical_port", "ip_prefix", "nexthop",
+                         "type"]],
             "isRoot": true}
     }
 }
diff --git a/ovn-sb.xml b/ovn-sb.xml
index ea4adc1c3..fa9e7b4ba 100644
--- a/ovn-sb.xml
+++ b/ovn-sb.xml
@@ -5217,4 +5217,84 @@  tcp.flags = RST;
       The set of variable values for a given chassis.
     </column>
   </table>
+
+  <table name="Route">
+    <p>
+      Each record represents a route thas is export from ovn or imported to ovn
+      using some dynamic routing logic outside of ovn.
+      It is populated on the one hand by <code>ovn-northd</code> based on the
+      addresses, routes and NAT Entries of a
+      <code>OVN_Northbound.Logical_Router_Port</code>.
+      On the other hand <code>ovn-controller</code> populates it with routes
+      learned from outside of OVN.
+    </p>
+
+    <column name="datapath">
+      The datapath belonging to the
+      <code>OVN_Northbound.Logical_Router</code> that this route is valid
+      for.
+    </column>
+
+    <column name="logical_port">
+      <p>
+        If the type is <code>advertise</code> then this is the logical_port
+        the router will send packets out.
+      </p>
+
+      <p>
+        If the type is <code>receive</code> then this is the logical_port
+        the route was learned on.
+      </p>
+    </column>
+
+    <column name="ip_prefix">
+      <p>
+        IP prefix of this route (e.g. 192.168.100.0/24).
+      </p>
+    </column>
+
+    <column name="nexthop">
+      <p>
+        If the type is <code>advertise</code> then this is empty.
+      </p>
+
+      <p>
+        If the type is <code>receive</code> then this is the nexthop ip we
+        from the outside.
+      </p>
+    </column>
+
+    <column name="tracked_port">
+      <p>
+        Only relevant for type <code>advertise</code>.
+
+        In combination with a host <code>ip_prefix</code> this trackes the port
+        OVN will forward the packets for this destination to.
+
+        An announcing chassis can use this information to check if this
+        destination is local and adjust the route priorities based on that.
+      </p>
+    </column>
+
+    <column name="type">
+      <p>
+        If the route is to be exported from OVN to the outside network or if
+        it is imported from the outside network.
+      </p>
+      <ul>
+        <li>
+          <code>advertise</code>: This route should be advertised to the
+          outside network.
+       </li>
+        <li>
+          <code>receive</code>: This route has been learned from the outside
+          network.
+        </li>
+      </ul>
+    </column>
+
+    <column name="external_ids">
+      See <em>External IDs</em> at the beginning of this document.
+    </column>
+  </table>
 </database>