[ovs-dev] [PATCH 17/23] ovn-nb: Add support for IP+MAC binding pairs in Port_Binding 'address'.
blp at nicira.com
Sat Oct 10 04:20:36 UTC 2015
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 at 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(-)
diff --git a/ovn/TODO b/ovn/TODO
index c8a0338..240804c 100644
@@ -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
@@ -529,6 +529,17 @@ eth.dst = <var>HE</var>;
outport = <var>P</var>;
+ 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>
diff --git a/ovn/ovn-nb.xml b/ovn/ovn-nb.xml
index e565cda..78b146e 100644
@@ -217,12 +217,56 @@
- The logical port's own Ethernet address or addresses, each in the form
- 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.
+ Addresses owned by the logical port.
+ Each element in the set must take one of the following forms:
+ An Ethernet address owned by the logical port. Like a physical
+ Ethernet NIC, a logical port ordinarily has a single fixed Ethernet
+ 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.
+ <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>
+ This form has all the effects of the previous form. It also
+ indicates that the logical port owns the given IPv4 address.
+ 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.
+ 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>.
diff --git a/ovn/utilities/ovn-nbctl.8.xml b/ovn/utilities/ovn-nbctl.8.xml
index 8d69835..d710c3a 100644
@@ -112,9 +112,13 @@
<dt><code>lport-set-addresses</code> <var>lport</var> [<var>address</var>]...</dt>
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.
diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c
index 4c8f533..aac4c27 100644
@@ -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\
More information about the dev