feat(gateway): add fib_multipath_hash_policy support for L4-aware ECMP flow distribution#3229
Conversation
|
Hi @MircoBarone. Thanks for your PR! I am @adamjensenbot.
Make sure this PR appears in the liqo changelog, adding one of the following labels:
|
|
Can you temporarily enable the flag? Then I will run the e2e tests |
@cheina97 Do you mean I should add a commit temporarily setting the default value of enable-multipath-hash-policy to true |
Yep |
2fe170f to
b856f81
Compare
|
/rebase test=true |
b856f81 to
b0db305
Compare
b0db305 to
2617856
Compare
|
/rebase test=true |
813e90e to
11a5eaf
Compare
|
/rebase test=true |
|
@MircoBarone test passed! Can you switch flag to |
11a5eaf to
85b018a
Compare
|
/test |
|
/rebase test=true |
…P flow distribution
85b018a to
7c0860a
Compare
|
/merge |
Description
Part of the multi-tunnel WireGuard implementation. This is the second PR related to issue #3225.
This PR adds the
enable-multipath-hash-policyflag to the gateway. When set totrue, the gateway writes1to/proc/sys/net/ipv4/fib_multipath_hash_policy, enabling 5-tuple (src/dst IP, src/dst port, protocol) hashing for multipath routing instead of L3-only (src/dst IP) hashing.This is necessary to properly exploit ECMP across multiple WireGuard tunnels: without this setting, traffic between the same src/dst IP pair will always hash to the same tunnel regardless of the port, limiting the effectiveness of ECMP for those flows.
The flag defaults to
false. The intended usage is to set it totruevia a proper template when the number of interfaces specified in theGatewayClientorGatewayServerCRD is greater than one.Since
/proc/sys/net/ipv4/fib_multipath_hash_policyis namespaced, this setting only affects the network namespace of the gateway pod and has no impact on the host node.If the write fails, the gateway returns an error and stops the execution to ensure the policy is strictly applied
A new file
pkg/utils/kernel/multipathpolicy.gowas added to implement the low-level write.