From 9834dcfe147990f52bd3fbd0fc75bd4eda189bcf Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 16 Oct 2015 13:00:01 -0700 Subject: [PATCH 1/1] ovn-nb: Add support for IP+MAC binding pairs in Port_Binding 'address'. 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 Acked-by: Justin Pettit --- ovn/TODO | 9 ------ ovn/ovn-nb.xml | 56 +++++++++++++++++++++++++++++++---- ovn/utilities/ovn-nbctl.8.xml | 10 +++++-- ovn/utilities/ovn-nbctl.c | 2 +- 4 files changed, 58 insertions(+), 19 deletions(-) diff --git a/ovn/TODO b/ovn/TODO index ac1332fac..9f1056acf 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/ovn-nb.xml b/ovn/ovn-nb.xml index 34bbdc9f7..7f6f70315 100644 --- a/ovn/ovn-nb.xml +++ b/ovn/ovn-nb.xml @@ -217,12 +217,56 @@ - The logical port's own Ethernet address or addresses, each in the form - xx:xx:xx:xx:xx:xx. - Like a physical Ethernet NIC, a logical port ordinarily has a single - fixed Ethernet address. The string unknown 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: +

+ +
+
xx:xx:xx:xx:xx:xx
+
+

+ An Ethernet address owned by the logical port. Like a physical + Ethernet NIC, a logical port ordinarily has a single fixed Ethernet + address. +

+ +

+ When a OVN logical switch processes a unicast Ethernet frame whose + destination MAC address is in a logical port's column, it delivers it only to that port, as + if a MAC learning process had learned that MAC address on the port. +

+
+ +
xx:xx:xx:xx:xx:xx a.b.c.d
+
+

+ 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. +

+
+ +
unknown
+
+ 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 column, it delivers it to the port (or ports) + whose columns include unknown. +
+
diff --git a/ovn/utilities/ovn-nbctl.8.xml b/ovn/utilities/ovn-nbctl.8.xml index 38d51c2d4..34bbba08f 100644 --- a/ovn/utilities/ovn-nbctl.8.xml +++ b/ovn/utilities/ovn-nbctl.8.xml @@ -112,9 +112,13 @@
lport-set-addresses lport [address]...
Sets the addresses associated with lport to - address. Multiple MACs may be sets by using multiple - address arguments. If no mac argument is given, - lport will have no addresses associated with it. + address. Each address 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 unknown is also valid. + Multiple Ethernet addresses or Ethernet+IP pairs may be set. If no + address argument is given, lport will have no + addresses associated with it.
lport-get-addresses lport
diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c index 4c8f533a7..aac4c2748 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\ -- 2.20.1