Product SiteDocumentation Site

5.12.9. Configure BPF-based Tx Port Selectors

The loadbalance and LACP runners uses hashes of packets to sort network traffic flow. The hash computation mechanism is based on the Berkeley Packet Filter (BPF) code. The BPF code is used to generate a hash rather than make a policy decision for outgoing packets. The hash length is 8 bits giving 256 variants. This means many different socket buffers (SKB) can have the same hash and therefore pass traffic over the same link. The use of a short hash is a quick way to sort traffic into different streams for the purposes of load balancing across multiple links. In static mode, the hash is only used to decide out of which port the traffic should be sent. In active mode, the runner will continually reassign hashes to different ports in an attempt to reach a perfect balance.
The following fragment types or strings can be used for packet Tx hash computation:
  • eth — Uses source and destination MAC addresses.
  • vlan — Uses VLAN ID.
  • ipv4 — Uses source and destination IPv4 addresses.
  • ipv6 — Uses source and destination IPv6 addresses.
  • ip — Uses source and destination IPv4 and IPv6 addresses.
  • l3 — Uses source and destination IPv4 and IPv6 addresses.
  • tcp — Uses source and destination TCP ports.
  • udp — Uses source and destination UDP ports.
  • sctp — Uses source and destination SCTP ports.
  • l4 — Uses source and destination TCP and UDP and SCTP ports.
These strings can be used by adding a line in the following format to the load balance runner:
"tx_hash": ["eth", "ipv4", "ipv6"]
See Section 5.12.5, “Configure the loadbalance Runner” for an example.