Skip to content

Add transmit hash policy to bond CNI (Tech Preview) #96525

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 41 additions & 1 deletion modules/nw-multus-bond-cni-object.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ The following table describes the configuration parameters for the Bond CNI plug
|`string`
|Specifies the bonding policy.

|`xmitHashPolicy`
|`string`
|Specifies the transmit hash policy for load balancing across the aggregated interfaces. This parameter defaults to `layer2` and supports the following values: `layer2`, `layer2+3` and `layer3+4`.

|`linksInContainer`
|`boolean`
|Optional: Specifies whether the network interfaces intended for bonding are expected to be created and available directly within the container's network namespace when the bond starts. If `false` which is the default, the CNI plugin looks for these interfaces on the host system first before attempting to form the bond.
Expand All @@ -58,6 +62,11 @@ The following table describes the configuration parameters for the Bond CNI plug

|====

--
:FeatureName: xmitHashPolicy
include::snippets/technology-preview.adoc[]
--

[id="nw-multus-bond-cni-config-example_{context}"]
== Bond CNI plugin configuration example

Expand Down Expand Up @@ -87,4 +96,35 @@ The following example configures a secondary network named `bond-net1`:
"gateway": "10.56.217.1"
}
}
----
----

The following example configures a secondary network named `bond-tlb-net` with the `xmitHashPolicy` feature enabled:

[source,json]
----
{
"type": "bond",
"cniVersion": "0.3.1",
"name": "bond-tlb-net",
"mode": "tlb",
"xmitHashPolicy": "layer2+3", <1>
"failOverMac": 0,
"linksInContainer": true,
"miimon": "100",
"mtu": 1500,
"links": [
{"name": "net1"},
{"name": "net2"}
],
"ipam": {
"type": "host-local",
"subnet": "10.57.218.0/24",
"routes": [{
"dst": "0.0.0.0/0"
}],
"gateway": "10.57.218.1"
}
}
----

<1> This parameter dictates how outgoing network traffic is distributed across the `net1` and `net2` active member interfaces within the bond. The hashing algorithm combines layer 2 information, specifically source and destination MAC addresses, with layer 3 information, which includes source and destination IP addresses.