diff mbox

[ovs-dev,17/23] ovn-nb: Add support for IP+MAC binding pairs in Port_Binding 'address'.

Message ID 1444450838-12150-6-git-send-email-blp@nicira.com
State Accepted
Headers show

Commit Message

Ben Pfaff Oct. 10, 2015, 4:20 a.m. UTC
When a logical router can statically obtain the IP+MAC pairs for its
attached logical switches, it can avoid expensive ARP resolution.

Signed-off-by: Ben Pfaff <blp@nicira.com>
---
 ovn/TODO                      |  9 -------
 ovn/northd/ovn-northd.8.xml   | 11 +++++++++
 ovn/ovn-nb.xml                | 56 ++++++++++++++++++++++++++++++++++++++-----
 ovn/utilities/ovn-nbctl.8.xml | 10 +++++---
 ovn/utilities/ovn-nbctl.c     |  2 +-
 5 files changed, 69 insertions(+), 19 deletions(-)

Comments

Justin Pettit Oct. 16, 2015, 1:12 a.m. UTC | #1
> On Oct 9, 2015, at 9:20 PM, Ben Pfaff <blp@nicira.com> wrote:
> 
> When a logical router can statically obtain the IP+MAC pairs for its
> attached logical switches, it can avoid expensive ARP resolution.
> 
> Signed-off-by: Ben Pfaff <blp@nicira.com>

Acked-by: Justin Pettit <jpettit@nicira.com>

--Justin
diff mbox

Patch

diff --git a/ovn/TODO b/ovn/TODO
index c8a0338..240804c 100644
--- a/ovn/TODO
+++ b/ovn/TODO
@@ -186,15 +186,6 @@  Somehow it has to be possible for an L3 logical router to map from an
 IP address to an Ethernet address.  This can happen statically or
 dynamically.  Probably both cases need to be supported eventually.
 
-*** Static IP to MAC binding
-
-Commonly, for a VM, the binding of an IP address to a MAC is known
-statically.  The Logical_Port table in the OVN_Northbound schema can
-be revised to make these bindings known.  Then ovn-northd can
-integrate the bindings into the logical router flow table.
-(ovn-northd can also integrate them into the logical switch flow table
-to terminate ARP requests from VIFs.)
-
 *** Dynamic IP to MAC bindings
 
 Some bindings from IP address to MAC will undoubtedly need to be
diff --git a/ovn/northd/ovn-northd.8.xml b/ovn/northd/ovn-northd.8.xml
index 002708b..b9278ea 100644
--- a/ovn/northd/ovn-northd.8.xml
+++ b/ovn/northd/ovn-northd.8.xml
@@ -529,6 +529,17 @@  eth.dst = <var>HE</var>;
 outport = <var>P</var>;
 output;
         </pre>
+
+        <p>
+          MAC bindings can be known statically based on data in the
+          <code>OVN_Northbound</code> database.  For router ports connected to
+          logical switches, MAC bindings can be known statically from the
+          <code>addresses</code> column in the <code>Logical_Port</code> table.
+          For router ports connected to other logical routers, MAC bindings can
+          be known statically from the <code>mac</code> and
+          <code>network</code> column in the <code>Logical_Router_Port</code>
+          table.
+        </p>
       </li>
 
       <li>
diff --git a/ovn/ovn-nb.xml b/ovn/ovn-nb.xml
index e565cda..78b146e 100644
--- a/ovn/ovn-nb.xml
+++ b/ovn/ovn-nb.xml
@@ -217,12 +217,56 @@ 
     </column>
 
     <column name="addresses">
-      The logical port's own Ethernet address or addresses, each in the form
-      <var>xx</var>:<var>xx</var>:<var>xx</var>:<var>xx</var>:<var>xx</var>:<var>xx</var>.
-      Like a physical Ethernet NIC, a logical port ordinarily has a single
-      fixed Ethernet address.  The string <code>unknown</code> is also allowed
-      to indicate that the logical port has an unknown set of (additional)
-      source addresses.
+      <p>
+        Addresses owned by the logical port.
+      </p>
+
+      <p>
+        Each element in the set must take one of the following forms:
+      </p>
+
+      <dl>
+        <dt><code><var>xx</var>:<var>xx</var>:<var>xx</var>:<var>xx</var>:<var>xx</var>:<var>xx</var></code></dt>
+        <dd>
+          <p>
+            An Ethernet address owned by the logical port.  Like a physical
+            Ethernet NIC, a logical port ordinarily has a single fixed Ethernet
+            address.
+          </p>
+
+          <p>
+            When a OVN logical switch processes a unicast Ethernet frame whose
+            destination MAC address is in a logical port's <ref
+            column="addresses"/> column, it delivers it only to that port, as
+            if a MAC learning process had learned that MAC address on the port.
+          </p>
+        </dd>
+
+        <dt><code><var>xx</var>:<var>xx</var>:<var>xx</var>:<var>xx</var>:<var>xx</var>:<var>xx</var> <var>a</var>.<var>b</var>.<var>c</var>.<var>d</var></code></dt>
+        <dd>
+          <p>
+            This form has all the effects of the previous form.  It also
+            indicates that the logical port owns the given IPv4 address.
+          </p>
+
+          <p>
+            The OVN logical switch uses this information to synthesize
+            responses to ARP requests without traversing the physical network.
+            The OVN logical router connected to the logical switch, if any,
+            uses this information to avoid issuing ARP requests for logical
+            switch ports.
+          </p>
+        </dd>
+
+        <dt><code>unknown</code></dt>
+        <dd>
+          This indicates that the logical port has an unknown set of Ethernet
+          addresses.  When an OVN logical switch processes a unicast Ethernet
+          frame whose destination MAC address is not in any logical port's <ref
+          column="addresses"/> column, it delivers it to the port (or ports)
+          whose <ref column="addresses"/> columns include <code>unknown</code>.
+        </dd>
+      </dl>
     </column>
 
     <column name="port_security">
diff --git a/ovn/utilities/ovn-nbctl.8.xml b/ovn/utilities/ovn-nbctl.8.xml
index 8d69835..d710c3a 100644
--- a/ovn/utilities/ovn-nbctl.8.xml
+++ b/ovn/utilities/ovn-nbctl.8.xml
@@ -112,9 +112,13 @@ 
       <dt><code>lport-set-addresses</code> <var>lport</var> [<var>address</var>]...</dt>
       <dd>
         Sets the addresses associated with <var>lport</var> to
-        <var>address</var>.  Multiple MACs may be sets by using multiple
-        <var>address</var> arguments.  If no <var>mac</var> argument is given,
-        <var>lport</var> will have no addresses associated with it.
+        <var>address</var>.  Each <var>address</var> should be either an
+        Ethernet address or an Ethernet address followed by an IP address
+        (separated by a space and quoted to form a single command-line
+        argument).  The special form <code>unknown</code> is also valid.
+        Multiple Ethernet addresses or Ethernet+IP pairs may be set. If no
+        <var>address</var> argument is given, <var>lport</var> will have no
+        addresses associated with it.
       </dd>
 
       <dt><code>lport-get-addresses</code> <var>lport</var></dt>
diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c
index 4c8f533..aac4c27 100644
--- a/ovn/utilities/ovn-nbctl.c
+++ b/ovn/utilities/ovn-nbctl.c
@@ -312,7 +312,7 @@  Logical port commands:\n\
   lport-get-parent LPORT    get the parent of LPORT if set\n\
   lport-get-tag LPORT       get the LPORT's tag if set\n\
   lport-set-addresses LPORT [ADDRESS]...\n\
-                            set addresses for LPORT.\n\
+                            set MAC or MAC+IP addresses for LPORT.\n\
   lport-get-addresses LPORT      get a list of MAC addresses on LPORT\n\
   lport-set-port-security LPORT [ADDRS]...\n\
                             set port security addresses for LPORT.\n\