Multi-Core Load Balancing via Hash-Based Flow Distribution
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Multi-core systems face challenges in balancing network traffic evenly across cores, leading to inefficient processing and functionality, particularly when handling fragmented data packets and requiring symmetry in request and response routing to maintain source IP addresses and ports.
Innovation Solution
A method and system that utilize a packet engine and flow distributor to select cores based on hash tuples of client and server IP addresses and ports, modifying requests and responses to ensure symmetric processing, and handle fragmented packets by distributing and assembling them across cores while maintaining client IP addresses and ports.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If a Receive Side Scaler distributes packets to cores based on a predetermined function, then packet distribution is achieved, but traffic distribution becomes uneven and processing efficiency deteriorates
Solution Approach 1:
The system changes the parameters used for packet distribution from simple predetermined functions to hash values computed from multiple packet attributes including source IP, destination IP, source port, and destination port. This parameter change enables more uniform traffic distribution across cores while maintaining processing efficiency
Solution Approach 2:
The system performs preliminary hash computation and core selection before packet processing begins. The flow distributor pre-determines which core will handle each packet based on hash values, ensuring even distribution before the actual processing workload is assigned to cores
2Ease of operation
If source IP address and port are modified to ensure symmetrical routing, then request-response symmetry is achieved, but backend systems that require unmodified source IP addresses cannot function properly
Solution Approach 1:
The system segments the packet handling process into distinct stages: the flow distributor computes hash values and determines core assignment without modifying packet attributes, while individual cores process packets with their original source IP addresses and ports intact. This segmentation allows symmetry to be achieved through distribution logic rather than packet modification
Solution Approach 2:
The flow distributor acts as an intermediary that computes hash values from packet attributes to determine core assignment, without directly modifying the packets themselves. This intermediary approach enables symmetrical routing through intelligent distribution while preserving the original packet attributes that backend systems require
3Productivity
If data packets are fragmented and distributed to different cores, then load balancing is improved, but packet assembly complexity and processing overhead increase
Solution Approach 1:
The system uses hash values of packet attributes as feedback to consistently route related packets (including fragments of the same data stream) to the same core. This feedback mechanism ensures that fragmented packets are automatically directed to the correct core for assembly, reducing complexity while maintaining load balancing
Data Source
AI summary
Described herein is a method and system for distributing requests and responses across a multi-core system. Each core executes a packet engine that further processes data packets allocated to that core. A flow distributor executing within the multi-core system forwards client requests to a packet engine on a core that is selected based on a value generated when a hash is applied to a tuple comprising a client IP address, a client port, a server IP address and a server port identified in the request. The packet engine maintains the client IP address, selects a first port of the core, and determines whether a hash of a tuple comprising those values identifies the selected core. A modification is then made to the client request so that the client request includes a tuple comprising the client IP address, the server IP address, the first port and the server port.


