RSS Port Pick Swizzle Table for CPU Affinity

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In environments using Receive Side Scaling (RSS) for load balancing, it is challenging to ensure that network packets returned from a server device hash to the same CPU that sent the related packets, due to difficulties in working backwards from the RSS hash and the increasing complexity with multiple CPUs, making brute force port number matching time-consuming.

Innovation Solution

A method employing a lookup table (swizzle table) to pre-compute hash collisions, allowing for the selection of a local port number that hashes correctly, using a XOR distance to transform the source port number, ensuring that returning packets hash to the same processor as the outgoing packets, with an O(1) complexity for efficient processing.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If brute force port number matching is used to ensure returning packets hash to the same CPU, then load balancing correctness is maintained, but processing time increases significantly

Engineering Contradiction:
Improveload balancing correctnessVSAvoidprocessing time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent pre-computes a mapping table during initialization that stores the relationship between local port numbers and their corresponding RSS hash values for each CPU. This preliminary action eliminates the need for time-consuming brute force port matching during actual packet processing, as the system can directly lookup the correct port number from the pre-computed table.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system performs preliminary hash calculations for all possible port numbers during system initialization, storing the results in a lookup table. This allows O(1) constant time retrieval of the correct port number during runtime, rather than performing iterative brute force searches for each packet.

Inventive Principle:
Principle #10Preliminary action

2Measurement precision

If RSS hash calculation is performed for each packet to ensure correct CPU routing, then packet routing accuracy is maintained, but computational complexity increases

Engineering Contradiction:
Improvepacket routing accuracyVSAvoidcomputational complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent pre-computes and stores the RSS hash values for all possible port number combinations during system initialization. This creates a lookup table that maps port numbers to their corresponding hash values and target CPUs, eliminating the need for complex real-time hash calculations during packet processing while maintaining routing accuracy.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system creates a simplified copy of the RSS hash calculation results in the form of a lookup table during initialization. Instead of performing the full RSS hash calculation algorithm for each packet, the system uses this pre-computed copy to directly determine the target CPU, significantly reducing computational complexity.

Inventive Principle:
Principle #26Copying

3Productivity

If a lookup table is used to pre-compute hash collisions, then port number selection efficiency is improved, but memory usage increases

Engineering Contradiction:
Improveport number selection efficiencyVSAvoidmemory usage
Core Design Contradiction:
ProductivityVSQuantity of substance

Solution Approach 1:

The patent segments the lookup table into smaller per-CPU tables, where each CPU maintains its own table containing only the port number to CPU mappings relevant to that CPU. This segmentation reduces the memory footprint compared to a single comprehensive table, while still enabling efficient O(1) port number selection for each CPU.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

Each CPU maintains a localized lookup table with only the specific port number mappings relevant to its processing responsibilities. This local quality approach ensures that each CPU uses minimal memory (only storing entries it needs) while maintaining high efficiency in port number selection for its assigned traffic.

Inventive Principle:
Principle #3Local quality

Data Source

PatentUS9712460B1Matching port pick for RSS disaggregation hashing
Publication Date: 2017.07.18 F5 NETWORKS INC
  • US9712460B1 patent drawing
  • US9712460B1 patent drawing
  • US9712460B1 patent drawing

AI summary

Embodiments are directed towards selecting a local port number for server side connections that hash to a same processor as a matching client side flow on a multiprocessor device using Receive Side Scaling (RSS) for the disaggregation hash. A hash of a flow key is computed with an initial port number. An exclusive-or (XOR) distance is computed to a desired hash, using least significant bits. An XOR is performed on a corrected pre-computed collision value, to transform the source port number to a value that hashes correctly with other elements within the flow key. The transformed source port number may then be inserted into network packets sent to a server device, such that the transformed source port number can be used in a returning RSS hash to again select the same processor.