forked from EdgeCloudX/ovn
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lflow: Refactor OpenFlow snat hairpin flows
Currently, ovn-controller generates N x V OpenFlow snat hairpin flows where: N = number of datapaths V = number of LB VIPs In a scale setup with 120 nodes, 15k VIPs, and 3 Protocols, this can generate 5.4M OpenFlows in the OFTABLE_CT_SNAT_FOR_VIP table with the following form: table=70, priority=100,udp,reg1=0x4001149,metadata=0x2f actions=ct(commit,zone=NXM_NX_REG12[0..15],nat(src=4.0.17.73)) As only hairpin flows match this table and as the SNAT action only specifies the VIP, this flow is independent of the metadata match field and can be removed. This reduces the number of SNAT flows to V. However, OVN allows the CMS to specify what address to use for SNAT via the "hairpin_snat_ip" option in the Load_Balancer table in the NBDB. If this is specified, we must include the metadata field because multiple LBs which have the same VIP (but with a different "hairpin_snat_ip" address) could be added to different datapaths. However, these flows can be optimized by using a conjunctive flow that matches on the VIP in one dimension and the datapath in the other dimension. For example, for two LBs with the same VIP but different "hairpin_snat_ip" addresses added to different datapaths: table=70, priority=200,conj_id=1,ip actions=ct(commit,zone=NXM_NX_REG12[[0..15]],nat(src=88.88.88.91)) table=70, priority=200,conj_id=2,ip actions=ct(commit,zone=NXM_NX_REG12[[0..15]],nat(src=88.88.88.90)) table=70, priority=200,metadata=0x1 actions=conjunction(1,1/2) table=70, priority=200,metadata=0x2 actions=conjunction(2,1/2) table=70, priority=200,tcp,reg1=0x58585858,reg2=0x1f90/0xffff actions=conjunction(2,2/2),conjunction(1,2/2) This will increase the number of snat hairpin flows from the general case but will not be V x N due to the use of the conjuctive flows. For the best-case scenario (no "hairpin_snat_ip"), this patch shows the following improvements: * A reduction in ovn-controller recompute time for logical flows: 16 -> 11.8s * A reduction in total ovs-vswitchd OpenFlows: 7.7M -> 2.1M * A reduction in ovs-vswitchd RSS: 9.9G -> 2.7G This patch updates these flows and associated tests. Signed-off-by: Mark Gray <[email protected]> Signed-off-by: Numan Siddique <[email protected]>
- Loading branch information
1 parent
f89a506
commit 07467cf
Showing
4 changed files
with
256 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.