Skip to content

Commit

Permalink
Set mac binding age threshold in gateway routers
Browse files Browse the repository at this point in the history
On scenarios where the cluster is shut down and started up after some
time later, the dynamic mac binding entries in the SBDB might be stale.
If any endpoint changed MAC address and sent a GARP, OVN has no chance
of processing it if it is shut down.

Set mac_binding_age_threshold to 300 seconds. Most common values used in
other implementations range from 60s to 1200s being 300s the most common
after a google search.

Unfortunately the mac binding age of an entry is not refreshed on any
network event, so entries will be removed from the mac binding table
after 300 seconds unconditionaly. There is an initiative to improve this
behavior in OVN [1]

[1] https://mail.openvswitch.org/pipermail/ovs-discuss/2023-May/052475.html

Signed-off-by: Jaime Caamaño Ruiz <jcaamano@redhat.com>
  • Loading branch information
jcaamano committed Jun 23, 2023
1 parent fd9088f commit d81a413
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions go-controller/pkg/ovn/gateway_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ func (oc *DefaultNetworkController) gatewayInit(nodeName string, clusterIPSubnet
"chassis": l3GatewayConfig.ChassisID,
"lb_force_snat_ip": "router_ip",
"snat-ct-zone": "0",
"mac_binding_age_threshold": types.GRMacBindingAgeThreshold,
}
logicalRouterExternalIDs := map[string]string{
"physical_ip": physicalIPs[0],
Expand Down
1 change: 1 addition & 0 deletions go-controller/pkg/ovn/gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ func generateGatewayInitExpectedNB(testData []libovsdb.TestData, expectedOVNClus
"always_learn_from_arp_request": "false",
"dynamic_neigh_routers": "true",
"chassis": l3GatewayConfig.ChassisID,
"mac_binding_age_threshold": types.GRMacBindingAgeThreshold,
},
ExternalIDs: map[string]string{
"physical_ip": physicalIPs[0],
Expand Down
5 changes: 5 additions & 0 deletions go-controller/pkg/types/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,9 @@ const (

EgressServiceNoHost = "" // set on services with no allocated node
EgressServiceNoSNATHost = "ALL" // set on services with sourceIPBy=Network

// GRMacBindingAgeThreshold is the lifetime in seconds of each MAC binding
// entry for the gateway routers. After this time, the entry is removed and
// may be refreshed with a new ARP request.
GRMacBindingAgeThreshold = "300"
)

0 comments on commit d81a413

Please sign in to comment.