Three-level differential hash anti-polarization traffic transmission method, device and equipment
By employing a three-level differentiated hashing method, Galois multipliers and perturbation factors are generated using node characteristics. Combined with Galois field polynomial operations and perturbation compensation, the hash polarization and load imbalance problems of traditional hashing algorithms are solved, achieving node-level differentiation and system-level load balancing with minimal increase in resource consumption.
Patent Information
- Application Number
- CN202511183748.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-22
- Publication Date
- 2025-11-04
AI Technical Summary
Traditional hash algorithms in existing network switching chips suffer from problems such as hash polarization, static parameters failing to adapt to dynamic network topology changes, failure to consider node characteristic differences, and cross-node load imbalance.
A three-level differential hashing method is adopted. By obtaining node characteristics, Galois multipliers and perturbation factors are generated. Combined with Galois domain polynomial operations and perturbation compensation, hash values are dynamically generated to achieve load balancing of traffic.
It achieves node-level differentiated hash results, has strong dynamic adaptability, significant system-level load balancing effect, reduced hash polarization rate, and limited increase in resource consumption.
Smart Images

Figure CN120896902A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of network, more particularly, to a three-level differential hash anti-polarization traffic transmission method, device and equipment. BACKGROUND
[0002] The current network switching chip (such as programmable switching chip Tofino) generally uses traditional hash algorithm (such as CRC, XOR) to realize traffic load balancing (such as ECMP, LAG). The specific process is as follows:
[0003] Hash key extraction: extracting quintuple (source / desination IP, port, protocol type) from the data packet header as input key;
[0004] Fixed hash operation: generating hash value by linear operation (such as modulo operation) and mapping to preset forwarding path.
[0005] The traditional hash algorithm has the following defects:
[0006] Hash polarization and convergence: the traditional hash algorithm produces convergent hash results when multiple nodes process the same traffic, resulting in cascading polarization phenomenon;
[0007] Static parameter defect: fixed hash parameter cannot adapt to dynamic network topology changes;
[0008] Node feature loss: individual difference features of different switching nodes are not considered;
[0009] Cross-node load imbalance: insufficient load balancing capability from global perspective. SUMMARY
[0010] The embodiment of the present application provides a three-level differential hash anti-polarization traffic transmission method, which is applied to a network switching chip, and comprises:
[0011] S101, obtaining traffic to be transmitted, and extracting quintuple from the data packet header of the traffic;
[0012] S102, obtaining node features related to the network switching chip, generating Galois multiplier and perturbation factor based on the node features, and fusing the feature factor into the quintuple to generate hash key;
[0013] S103, performing Galois field polynomial operation on the hash key based on the Galois multiplier to obtain hash value;
[0014] S104, perturbing and compensating the hash value according to the perturbation factor to generate final hash value, and mapping the traffic to preset forwarding path according to the final hash value to realize load balancing output of the traffic.
[0015] Preferably, the node feature is a chip unique identification of a network switch chip.
[0016] Preferably, the node feature is a 32-bit real-time random number generated according to a current timestamp after the network switch chip is powered on and utilizes a phase-locked loop.
[0017] Preferably, in S102,
[0018] Galois multiplier galois_factor = (node_id * 0x9E37) & 0xFFFF
[0019] Perturbation factor perturb_factor = (node_id % 127) + 1; where node_id is the node feature.
[0020] Preferably, in S103, the hash key is divided into multiple segments, and each segment is subjected to a Galois field polynomial operation according to the Galois multiplier, and the operation results are combined to obtain the hash value.
[0021] Preferably, in S103, the Galois field polynomial is dynamically selected according to the traffic feature.
[0022] Preferably, in S104, the final hash value after perturbation compensation is:
[0023] ((hash_value^perturb_factor)*0xDEED) % port_count
[0024] Where hash_value is the hash value, ^ is the bitwise XOR operator, and port_count is the number of ports.
[0025] The embodiment of the application also provides a three-level differentiated hash polarization-resistant traffic transmission device, applied to a network switch chip, comprising:
[0026] An extraction unit is configured to obtain traffic to be transmitted and extract a five-tuple from a data packet header of the traffic.
[0027] A fusion unit is configured to obtain a node feature related to the network switch chip, generate a Galois multiplier and a perturbation factor based on the node feature, and fuse the feature factors into the five-tuple to generate a hash key.
[0028] A multi-field Galois operation unit is configured to perform a Galois field polynomial operation on the hash key based on the Galois multiplier to obtain a hash value.
[0029] The disturbance compensation unit is configured to generate a final hash value by performing disturbance compensation on the hash value according to a disturbance factor, and map the traffic to a preset forwarding path according to the final hash value, so as to realize load balancing output of the traffic.
[0030] The application also provides a three-level differential hash anti-polar traffic transmission device, which comprises a memory and a processor, and the memory stores a computer program which can be executed by the processor to realize the three-level differential hash anti-polar traffic transmission method.
[0031] The application solves the systematic polarization problem caused by multi-node hash convergence by means of dynamic node identification injection, Galois field polynomial differential operation and disturbance compensation mechanism, and realizes double load balancing at the chip level and the system level. Compared with the prior art, the application has the following advantages:
[0032] 1. Node-level differentiation: the difference rate of hash results of the same traffic in different nodes is greater than 99%;
[0033] 2. Dynamic adaptability: supporting online update of polynomial parameters (actual switching time < 10 μs);
[0034] 3. System-level balancing: the load imbalance degree of a 256-node cluster is less than 3%;
[0035] 4. Hardware friendliness: the resource consumption is only increased by 12% compared with the CRC32 algorithm. BRIEF DESCRIPTION OF DRAWINGS
[0036] Figure 1 It is a flowchart of the three-level differential hash anti-polar traffic transmission method of the first embodiment of the application;
[0037] Figure 2 It is a principle diagram of the three-level differential hash anti-polar method;
[0038] Figure 3 It is a simulation network topology diagram provided by the application;
[0039] Figure 4 It is a simulation result diagram of the traditional CRC32 hash algorithm under the network topology;
[0040] Figure 5 It is a simulation result diagram of the traditional CRC32 hash algorithm + three-level differential hash anti-polar model under the network topology;
[0041] Figure 6 It is a structure diagram of the three-level differential hash anti-polar traffic transmission device of the second embodiment of the application. DETAILED DESCRIPTION
[0042] The specific embodiments of the present application are described in further detail below in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present application but are not intended to limit the scope of the present application.
[0043] Please refer to Figures 1 to 2 The first embodiment of the present application provides a three-level differential hash anti-polarized traffic transmission method, which can be executed by a three-level differential hash anti-polarized traffic transmission device (such as a network switch chip)
[0044] to implement the following steps:
[0045] S101, obtaining the traffic to be transmitted, and extracting the five-tuple from the data packet header of the traffic.
[0046] In this embodiment, the five-tuple can include source / desination IP, port, protocol type.
[0047] S102, obtaining the node characteristics related to the network switch chip, generating a Galois multiplier and a perturbation factor based on the node characteristics, and fusing the characteristic factor into the five-tuple to generate a hash key.
[0048] In this embodiment, the node characteristics can be a chip unique identifier of the network switch chip, wherein the chip unique identifier needs to be no less than 16 bits, and is normally 32 bits.
[0049] Optionally, the node characteristics can also use a 32-bit real-time random number generated by the network switch chip after power-on using a phase-locked loop according to the current timestamp, which is within the protection scope of the present application and will not be repeated.
[0050] In particular, the process of fusing the characteristic factor into the five-tuple can be represented as:
[0051] return hash_key^node_mask
[0052] Here, hash_key is the five-tuple, node_mask=((node_id&0xFFFF)<<16)|((node_id>>16)&0xFFFF), node_id is the node characteristics, ^ is the bit XOR operator, & is the bit AND operator, << is the left shift operator, and >> is the right shift operator.
[0053] In particular,
[0054] Galois multiplier galois_factor=(node_id*0x9E37)&0xFFFF
[0055] Perturbation factor perturb_factor = (node_id % 127) + 1.
[0056] S103, after Galois field polynomial operation based on the Galois multiplier and the hash key, a hash value is obtained.
[0057] In this embodiment, specifically, Ghash is used to generate a hash value, which can map data of any length into a fixed-length hash value to ensure data integrity and consistency. Ghash uses polynomial operations on the Galois field to implement the hash function. Specifically, it uses multiplication and addition operations to calculate the hash value.
[0058] First, the data to be calculated for the hash value is divided into consecutive blocks. Each block is treated as a polynomial on the Galois field. Then the final hash value is obtained by multiplying each polynomial with a specific polynomial and adding the results.
[0059] In this embodiment, since the Galois multiplier used in the Galois field polynomial operation is a dynamic parameter generated according to the node characteristics, the dynamicity of the generated hash value can be improved.
[0060] In this embodiment, the polynomial library can include 8 pre-stored irreducible polynomials, such as 0x8BB7, etc. Of course, the Galois field polynomial can also be dynamically selected according to the traffic characteristics to improve adaptability.
[0061] In addition, this embodiment also supports online updating of polynomial parameters.
[0062] S104, after perturbation compensation of the hash value according to the perturbation factor, a final hash value is generated, and the traffic is mapped to a preset forwarding path according to the final hash value, realizing load balancing output of the traffic.
[0063] In this embodiment, the final hash value after perturbation compensation is:
[0064] ((hash_value^perturb_factor)*0xDEED) % port_count
[0065] Where hash_value is the hash value, and port_count is the number of ports.
[0066] The following will be a mathematical verification model for this embodiment
[0067] The proof principle of the differential hash convergence of this mathematical verification model is as follows:
[0068] Let the adjacent node identifier difference be ΔN, then the output port number difference ΔP satisfies:
[0069] ΔP≡(ΔH·α+ΔΦ)mod M
[0070] wherein:
[0071] ΔH=G(ΔN·K)-hash difference term
[0072] ΔΦ=disturbance factor difference
[0073] α=amplification factor
[0074] By selecting an irreducible polynomial G, the probability of ΔP≠0 can be guaranteed to be >99.6% (actual measurement data)
[0075] The software simulation process is provided below
[0076] The node characteristics of the simulation process are selected as the node ID: a 32-bit random chip serial number
[0077] Polynomial library: 8 pre-stored irreducible polynomials (0x8BB7, etc.)
[0078] Disturbance factor generation period: 1ms
[0079] Reference Figures 3 to 5 In the simulation platform with publication (announcement) number CN118590400A, a three-level data center network architecture hash simulation is performed, wherein, Figure 3 It is a hash polarization simulation network topology, which is divided into a four-level network, from top to bottom, SSP (super spine), SPINE, LEAF, and TOR; Figure 4 It is the simulation result of the traditional CRC32 hash algorithm under the network topology. From the simulation result, it can be seen that, by using the traditional CRC32 hash algorithm, the northbound traffic hash polarization rate reaches more than 50% at the third level leaf node, and the southbound traffic hash polarization rate reaches more than 20%; Figure 5 It is a simulation result diagram of the traditional CRC32 hash algorithm + three-level differentiated hash anti-polarization model under the network topology. It can be seen that, at the third level leaf node, the northbound traffic hash polarization rate is reduced from 50% to below 2%, and the southbound traffic hash polarization rate is reduced from 20% to below 5%. It can be obviously seen that the three-level differentiated hash anti-polarization model greatly reduces the hash polarization rate under the multi-level network topology.
[0080] In summary, the embodiment of the application solves the systematic polarization problem caused by multi-node hash convergence through dynamic node identification injection, Galois field polynomial differentiated operation, and disturbance compensation mechanism, and realizes chip-level and system-level dual load balancing. Compared with the prior art, the embodiment has the following advantages:
[0081] 1. Node-level differentiation: the difference rate of the same traffic in different nodes is greater than 99%;
[0082] 2. Dynamic adaptability: supporting online updating of polynomial parameters (actual switching time <10μs);
[0083] 3. System-level balance: the load imbalance of a 256-node cluster is less than 3%;
[0084] 4. Hardware friendliness: the resource consumption is only increased by 12% compared with the CRC32 algorithm.
[0085] Please refer to Figure 6 The second embodiment of the application also provides a three-level differentiated hash polarization-resistant traffic transmission device, which comprises:
[0086] An extraction unit 210 is configured to obtain traffic to be transmitted and extract a five-tuple from a data packet header of the traffic.
[0087] A fusion unit 220 is configured to obtain node features related to a network switching chip, generate a Galois multiplier and a perturbation factor based on the node features, and fuse the feature factors into the five-tuple to generate a hash key.
[0088] A multi-domain Galois operation unit 230 is configured to perform Galois domain polynomial operation on the hash key based on the Galois multiplier to obtain a hash value.
[0089] A perturbation compensation unit 240 is configured to perform perturbation compensation on the hash value according to the perturbation factor to generate a final hash value, and map the traffic to a preset forwarding path according to the final hash value to realize load-balanced output of the traffic.
[0090] The third embodiment of the application also provides a three-level differentiated hash polarization-resistant traffic transmission device, which comprises a memory and a processor, and the memory stores a computer program which can be executed by the processor to realize the three-level differentiated hash polarization-resistant traffic transmission method as described above.
[0091] In several embodiments provided by the embodiments of the present application, it should be understood that the disclosed methods can also be implemented by other manners. The above-described apparatus and method embodiments are merely illustrative, for example, the flowcharts and block diagrams in the drawings show the possible implementation architectures, functions and operations of the apparatus, method and computer program product according to the embodiments of the present application. In this regard, each block in the flowcharts or block diagrams can represent a module, a program segment or a part of code, which includes one or more executable instructions for implementing the specified logic function. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur in different orders from those noted in the drawings. For example, two consecutive blocks can actually be executed substantially in parallel, and they can also be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and the combination of blocks in the block diagrams and / or flowcharts, can be implemented by a dedicated hardware-based system for performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0092] In addition, the functional modules in the various embodiments of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0093] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, an electronic device, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes. It should be noted that in this document, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the processes, methods, articles or devices that include a series of elements not only include those elements, but also include other elements not explicitly listed or inherent to such processes, methods, articles or devices. Without more limitations, the element defined by the statement "includes a" does not exclude the presence of another identical element in the process, method, article or device that includes the element.
[0094] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. The present application can be variously changed and modified by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the present application.
Claims
1. A method for three-level differential hash polarization-resistant traffic transmission, applied to a network switching chip, comprising: The method comprises the following steps: S101, obtaining traffic to be transmitted, and extracting a five-tuple from a data packet header of the traffic; S102, obtaining a node feature related to a network switching chip, generating a Galois multiplier and a perturbation factor based on the node feature, and fusing the feature factor into the five-tuple to generate a hash key; S103, performing a Galois field polynomial operation based on the Galois multiplier and the hash key to obtain a hash value; S104, generating a final hash value after perturbation compensation of the hash value according to the perturbation factor, and mapping the traffic to a preset forwarding path according to the final hash value to realize load balancing output of the traffic.
2. The three-stage differential hashing anti-polarization method according to claim 1, wherein, The node feature is a chip unique identifier of the network switching chip.
3. The three-stage differential hashing anti-polarization method according to claim 1, wherein, The node feature is a 32-bit real-time random number generated by the network switching chip after power-on using a phase-locked loop according to a current timestamp.
4. The three-stage differential hashing anti-polarization method of claim 1, wherein, In S102, Galois multiplier galois_factor=(node_id*0x9E37)&0xFFFF Perturbation factor perturb_factor=(node_id%127)+1; wherein node_id is the node feature.
5. The method of claim 1, wherein, In S103, the hash key is divided into multiple segments, and a Galois field polynomial operation is performed on each segment based on the Galois multiplier, and the operation results are combined to obtain the hash value.
6. The three-stage differential hashing anti-polarization method of claim 1, wherein, In S103, the Galois field polynomial is dynamically selected according to the traffic feature.
7. The three-stage differential hashing anti-polarization method according to claim 4, wherein, In S104, the final hash value after perturbation compensation is: ((hash_value^perturb_factor)*0xDEED)%port_count Wherein hash_value is the hash value, ^ is the bit exclusive or operator, and port_count is the number of ports.
8. A three-level differential hash polarization-resistant traffic transmission device applied to a network switching chip, characterized in that, The method comprises the following steps: An extraction unit is configured to obtain traffic to be transmitted, and extract a five-tuple from a data packet header of the traffic; A fusion unit is configured to obtain a node feature related to a network switching chip, generate a Galois multiplier and a perturbation factor based on the node feature, and fuse the feature factor into the five-tuple to generate a hash key; A multi-field Galois operation unit is configured to perform a Galois field polynomial operation on the hash key based on the Galois multiplier to obtain a hash value; A perturbation compensation unit is configured to generate a final hash value after perturbation compensation of the hash value according to the perturbation factor, and map the traffic to a preset forwarding path according to the final hash value to realize load balancing output of the traffic.
9. A three-level differential hash polarization-resistant traffic transmission device, characterized in that, The method comprises a memory and a processor, and the memory stores a computer program which can be executed by the processor to realize the three-level differentiated hash polarization-resistant traffic transmission method of any one of claims 1 to 7.
Citation Information
Patent Citations
Switching chip HASH simulation device, device and equipment based on network topology and flow
CN118590400A