A method to reduce hash jitter caused by changes in the number of LAG members

By real-time monitoring of LAG member status, early warning initiation of the hash adjustment process, construction of a temporary hash table copy, prioritization of key data migration, and recalculation of the virtual node distribution of the consistent hash ring, the problems of unstable data transmission and load imbalance caused by changes in the number of LAG members are solved, and the continuity and uniformity of data transmission are achieved.

CN119853888BActive Publication Date: 2025-09-19HEFEI SHENZHOU KUNTAI INFORMATION TECHNOLOGY CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510128243.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-05
Publication Date
2025-09-19
Estimated Expiration
2045-02-05

AI Technical Summary

Technical Problem

In the prior art, when the number of LAG members changes, hash ring data transmission becomes unstable, efficiency is reduced, and load imbalance occurs.

Method used

By monitoring the status of LAG members in real time, the hash adjustment process is initiated with early warning, a temporary hash table copy is built, the carrying potential is evaluated based on the characteristics of the new members, key data is migrated first, the distribution of virtual nodes in the consistent hash ring is recalculated, and the load is transferred smoothly to ensure the continuity and uniformity of data transmission.

Benefits of technology

It effectively reduces hash jitter caused by changes in the number of LAG members, ensures the stability and efficiency of data transmission, reduces packet loss rate, and provides reliable support for services with high real-time requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119853888B_ABST
    Figure CN119853888B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for reducing hash jitter caused by changes in the number of LAG members. The present invention relates to the field of link aggregation technology and includes the following steps: step one, real-time monitoring; step two, early warning activation; step three, initial creation of replicas; step four, data migration; step five, node optimization; and step six, switching verification. The method for reducing hash jitter caused by changes in the number of LAG members optimizes the data distribution mechanism of the consistent hash ring by dynamically allocating virtual nodes. When the change in the number of LAG members triggers hash mapping adjustments, data concentration or dispersion problems caused by simple reallocation will not occur, thus avoiding the migration and rerouting of large amounts of data, minimizing the interference of hash jitter on data transmission stability, ensuring the continuity of data transmission, reducing packet loss rate, and providing reliable support for services with high real-time requirements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of link aggregation, and in particular to a method for reducing hash jitter caused by changes in the number of LAG members. Background Art

[0002] M-LAG (Multichassis link aggregation) virtualizes two physical devices into a virtual M-LAG system at the aggregation level to access the network, achieving cross-device link aggregation, thereby providing device-level redundancy protection and traffic load sharing.

[0003] In an M-LAG system, M-LAG protocol data traffic between two neighboring M-LAG devices is transmitted over the peer-link. In addition to the IPL link, a Keepalive link is also used between the two devices to monitor neighbor status. Keepalive messages are exchanged to implement Multi-Active Detection (MAD) in the event of a peer-link failure, preventing both M-LAG devices from operating as the master.

[0004] Invention publication number CN119070972A discloses a method and device for preventing hash polarization in multi-level cross-device link aggregation connections. As described in the aforementioned invention, existing methods include recording the root node hash algorithm; setting the root node hash algorithm for each active cross-device link aggregation group; detecting a polarized cross-device link aggregation group; selecting a new hash algorithm for the polarized cross-device link aggregation group; and setting a new hash algorithm for the polarized cross-device link aggregation group. However, existing algorithms often cause hash jitter when the number of LAG members changes, which can lead to unstable data transmission, reduced efficiency, and load imbalance. Summary of the Invention

[0005] In view of the deficiencies of the prior art, the present invention provides a method for reducing hash jitter caused by changes in the number of LAG members, thereby solving the existing problems.

[0006] To achieve the above objectives, the present invention is implemented through the following technical solutions: A method for reducing hash jitter caused by changes in the number of LAG members, comprising the following steps:

[0007] Step 1: Real-time monitoring: Use link heartbeat and port polling technologies to closely monitor LAG member status around the clock and accurately capture dynamics such as member joining, leaving, or failures.

[0008] Step 2: Alert activation: When a change in the number of members is detected, an alert is triggered immediately, notifying the administrator, starting the hash adjustment process, and suspending the flow of non-critical data to reserve time for adjustment;

[0009] Step 3: Initial replica creation: Evaluate the new member's load capacity based on its bandwidth and latency characteristics, build a temporary hash table replica, and preliminarily plan the data slot layout.

[0010] Step 4: Data Migration: Sort the original hash table data according to the preset priority, and prioritize hot and high-priority business data. Move it to the corresponding new member slots of the temporary replica in small batches or multiple batches. Verify the data integrity and consistency of each batch, and mark the migration complete after confirmation.

[0011] Step 5: Node optimization: Recalculate the virtual node distribution of the consistent hash ring according to the new LAG member configuration, insert new members into nodes as needed, and migrate some nodes near old members; when a member exits, smoothly transfer the corresponding node load to the surviving member node;

[0012] Step 6: Switch verification: After the temporary replica data is migrated and the hash ring is stable, enable the new hash table and resume data transmission. Continuously monitor indicators such as throughput, latency, and packet loss rate for comparison and verification. If any anomalies are found, roll back the original hash table and re-analyze and adjust.

[0013] Preferably, in step 1, the system monitors the status of LAG members in real time, and promptly discovers situations such as members joining, leaving or failing through technologies such as link heartbeat detection and port status polling.

[0014] Preferably, once a quantity change is detected in step 2, an early warning mechanism is immediately triggered, a notification is sent to the system administrator, and a hash adjustment process is started. At the same time, the transmission of some non-critical data is suspended to gain a time window for adjustment.

[0015] Preferably, in step three, a temporary hash table copy is constructed, and the carrying capacity of the new member is evaluated according to its characteristics (such as bandwidth, delay, etc.), and data slots are preliminarily allocated.

[0016] Preferably, in step four, the data in the original hash table is sorted according to a pre-set priority rule, and hot data and high-priority business data are preferentially migrated in small batches and multiple batches to the slots of the new members corresponding to the temporary replica. After each batch is migrated, the integrity and consistency of the data are verified, and after ensuring that there are no errors, it is marked as migrated.

[0017] Preferably, in step five, the distribution of virtual nodes is recalculated on the consistent hash ring according to the new LAG member configuration. For new members, a corresponding number of virtual nodes are reasonably inserted on the ring according to their performance parameters, and some virtual nodes adjacent to old members are migrated in a load-balanced manner. For exiting members, the data carried by their corresponding virtual nodes are smoothly transferred to the virtual nodes of other surviving members. By dynamically adjusting the mapping relationship between virtual nodes and actual LAG members, the stability of the hash ring and the uniformity of data distribution are maintained.

[0018] Preferably, in step six, when the data migration in the temporary copy is completed and the hash ring reconstruction is stable, the old and new hash tables are switched, the new hash table is officially put into use, and the suspended data transmission is resumed. For a period of time after the switch, the data transmission performance is continuously monitored, including indicators such as throughput, delay, and packet loss rate. The data before the switch is compared to verify the algorithm's suppression effect on hash jitter. If an abnormality is found, roll back to the original hash table in time and re-analyze and adjust.

[0019] Preferably, in step 3, when allocating the initial number of virtual nodes to LAG members or dynamically adjusting the number of virtual nodes according to member performance, a weighted calculation method is adopted. Let the bandwidth of the member be B, the processing capacity be P, and the delay be D, and the corresponding weights are 、 、 , the calculation formula of comprehensive score S is as follows:

[0020]

[0021] Based on the comprehensive score S, within the pre-set virtual node number range [ , ] Determine the number of virtual nodes N, and simply set it to a linear relationship:

[0022] ;

[0023] Where k and b are constants predetermined based on system experience and requirements.

[0024] Preferably, in step 4, when migrating data from the original hash table to the temporary copy, the data flow priority is used. (e.g., measured by the number of visits or data transfer volume over a period of time) and recent visit frequency (such as the number of visits in the past hour) to determine the migration order, let the comprehensive migration priority of data item i be The calculation formula is:

[0025] ;

[0026] Where, and It is a pre-set weight coefficient used to balance the importance of traffic priority and recent access frequency;

[0027] according to Sort the data in descending order by size and migrate them first Data items with high values.

[0028] Preferably, in step 5, when the number of members changes and the load needs to be redistributed, for example, after a member exits, its virtual node load is transferred to other surviving members, and a weighted round-robin or similar strategy is adopted. Suppose the set of surviving members is M={ , , , },member The current load carrying capacity (determined by bandwidth, remaining processing resources, etc.) is , the load to be distributed is L, distributed to members Load The calculation formula is as follows:

[0029]

[0030] Beneficial effects

[0031] The present invention provides a method for reducing hash jitter caused by changes in the number of LAG members. Compared with the existing technology, it has the following advantages:

[0032] 1. This method reduces hash jitter caused by changes in the number of LAG members. By dynamically allocating virtual nodes, it optimizes the data distribution mechanism of the consistent hash ring. When changes in the number of LAG members trigger hash mapping adjustments, data concentration or dispersion caused by simple reallocation is eliminated. This avoids the migration and rerouting of large amounts of data, minimizes the interference of hash jitter on data transmission stability, ensures data transmission continuity, reduces packet loss, and provides reliable support for services with high real-time requirements.

[0033] 2. This method reduces hash jitter caused by changes in the number of LAG members by introducing an improved consistent hash ring. Multiple virtual nodes are allocated to each LAG member on the ring. The number of virtual nodes is dynamically allocated based on the member's bandwidth, processing power, and other attributes. Members with large bandwidth and strong processing power have more virtual nodes. When the number of members changes, the load is balanced by adjusting the distribution of virtual nodes rather than simply redistributing hash values. This ensures that data is still distributed relatively evenly under the new LAG structure, reducing hash concentration or dispersion problems caused by the increase or decrease of members. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 Schematic diagram of the algorithm flow of the present invention. DETAILED DESCRIPTION

[0035] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0036] See for example Figure 1 The present invention provides a method for reducing hash jitter caused by changes in the number of LAG members, comprising the following steps:

[0037] Step 1: Real-time monitoring: The system monitors the status of LAG members in real time and promptly detects member joining, exiting, or failures through technologies such as link heartbeat detection and port status polling.

[0038] Step 2: Early warning activation: Once a quantity change is detected, the early warning mechanism is immediately triggered, a notification is sent to the system administrator, and the hash adjustment process is initiated. At the same time, the transmission of some non-critical data is suspended to gain a time window for adjustment.

[0039] Step 3: Initial replica creation: Build a temporary hash table replica, evaluate the carrying capacity of the new member based on its characteristics (such as bandwidth, latency, etc.), and preliminarily allocate data slots.

[0040] When a change in the number of LAG members is detected, the algorithm does not immediately recalculate the hash mapping for all data. Instead, it uses an incremental adjustment strategy. First, a temporary hash table replica is created, and newly joined LAG members are assigned to free slots in this replica. Simultaneously, some data is gradually migrated from the original hash table to the new replica. This migration is based on factors such as data traffic priority and recent access frequency. Data with high real-time requirements and frequent access is prioritized, ensuring that critical data can quickly adapt to the new link layout.

[0041] Professional network testing tools are used to accurately measure the available bandwidth of new members, simulated data loading is used to detect the upper limit of their processing capabilities, and high-precision network probes are used to obtain data transmission delay values.

[0042] When allocating the initial number of virtual nodes to LAG members or dynamically adjusting the number of virtual nodes based on member performance, a weighted calculation method is used. Let the member's bandwidth be B, processing power be P, and delay be D. The corresponding weights are 、 、 , the calculation formula of comprehensive score S is as follows:

[0043]

[0044] Based on the comprehensive score S, within the pre-set virtual node number range [ , ] Determine the number of virtual nodes N, and simply set it to a linear relationship:

[0045] ;

[0046] Where k and b are constants predetermined based on system experience and requirements.

[0047] Based on the comprehensive score and the system's current load balancing requirements, the new member is assigned a corresponding number of virtual nodes on the consistent hash ring and an appropriate insertion position is selected. The insertion position is chosen based on the principle of load distribution, prioritizing areas of the ring where virtual nodes are sparsely distributed and loads are relatively light, ensuring that the new member's integration does not cause local overload.

[0048] Step 4: Data migration: Sort the data in the original hash table according to pre-set priority rules, and prioritize migrating hot data and high-priority business data in small batches to the slots corresponding to the new members of the temporary replica. After each batch is migrated, verify the integrity and consistency of the data and mark it as migrated after ensuring that it is correct.

[0049] When migrating data from the original hash table to the temporary copy, the data is prioritized based on its traffic. (e.g., measured by the number of visits or data transfer volume over a period of time) and recent visit frequency (such as the number of visits in the past hour) to determine the migration order, let the comprehensive migration priority of data item i be The calculation formula is:

[0050] ;

[0051] Where, and It is a pre-set weight coefficient used to balance the importance of traffic priority and recent access frequency;

[0052] according to Sort the data in descending order by size and migrate them first Data items with high values.

[0053] Create a temporary hash table copy and preliminarily plan the data slots that can be carried by the new member based on its performance characteristics. For the massive data in the original hash table, carefully sort it according to pre-set data traffic priority, recent access frequency and other rules. Prioritize hot data and high-priority business data that have extremely high real-time requirements and are frequently accessed, and gradually migrate them to the slots corresponding to the new member in the temporary copy in a stable manner of small batches and multiple batches. After each batch of migration is completed, the data integrity and consistency are strictly verified using a data verification algorithm. After ensuring that the data is accurate, it is marked as successfully migrated to ensure that key data can adapt to the new link layout first and seamlessly connect the system operation after the new member joins.

[0054] Once a LAG member is detected to have left, the system quickly locks all virtual nodes corresponding to that member on the consistent hash ring. Through the load balancing scheduling algorithm, the data carried by these virtual nodes is smoothly and efficiently transferred to the virtual nodes of other surviving members. The load balancing scheduling algorithm can flexibly adopt polling, weighted polling, or dynamic allocation strategies based on real-time load monitoring. For example, if weighted polling is used, the weights must be recalculated in advance based on the current performance indicators of the surviving members to ensure that data can be reasonably distributed according to the remaining carrying capacity of each surviving member, avoid uneven data distribution due to member departure, and maintain the overall stable operation of the system.

[0055] Step 5. Node optimization: On the consistent hash ring, recalculate the distribution of virtual nodes based on the new LAG member configuration. For new members, insert a reasonable number of virtual nodes on the ring based on their performance parameters, and migrate some virtual nodes adjacent to old members in a load-balanced manner. For exiting members, smoothly transfer the data carried by their corresponding virtual nodes to the virtual nodes of other surviving members. By dynamically adjusting the mapping relationship between virtual nodes and actual LAG members, the stability of the hash ring and the uniformity of data distribution are maintained.

[0056] After completing the data transfer, the system promptly cleans up the virtual nodes left behind by departing members and optimizes and reconstructs the consistent hash ring. The system re-examines the distribution and load of the remaining members, dynamically adjusting the density of virtual nodes based on the performance of each surviving member. This further optimizes the flow of data within the ring, allowing the system to continue to operate efficiently despite a reduction in membership, while ensuring the stability and balance of data transmission.

[0057] When the number of members changes and the load needs to be redistributed, for example, after a member exits, its virtual node load is transferred to other surviving members, and a weighted round-robin or similar strategy is adopted. Let the set of surviving members be M={ , , , },member The current load carrying capacity (determined by bandwidth, remaining processing resources, etc.) is , the load to be distributed is L, distributed to members Load The calculation formula is as follows:

[0058]

[0059] Step 6: Switchover Verification: After the data migration in the temporary replica is complete and the hash ring reconstruction is stable, the old and new hash tables are switched, and the new hash table is officially put into use. At the same time, the suspended data transmission is resumed. For a period of time after the switchover, the data transmission performance, including throughput, latency, packet loss rate, and other indicators, is continuously monitored. The data is compared with the data before the switchover to verify the algorithm's suppression effect on hash jitter. If any anomalies are found, the original hash table is promptly rolled back and re-analyzed and adjusted.

[0060] In an embodiment of the present invention, when a change in the number of LAG members is detected, whether a new member is added or a member withdraws:

[0061] For new members, their performance metrics are similarly evaluated, and a comprehensive score is calculated using the weighted method described above. Then, based on the current system load and overall performance distribution, appropriate locations are found on the consistent hash ring to insert the corresponding number of virtual nodes. The selection of insertion locations should consider balancing the load across the ring to avoid overloading any specific area. For example, if a certain area of ​​the ring already has a large number of virtual nodes corresponding to highly loaded members, the virtual nodes of the new members should be inserted preferentially into a relatively unoccupied area.

[0062] For exiting members, the system quickly locates all corresponding virtual nodes and smoothly transfers the data carried by these virtual nodes to the virtual nodes of other surviving members according to load balancing principles. Load balancing principles can be based on factors such as data volume and current node load. For example, polling or weighted polling can be used to distribute the load of the exiting member's virtual nodes to other surviving member virtual nodes with remaining load capacity, ensuring that data distribution remains even.

[0063] In this embodiment of the present invention, the system periodically reevaluates the performance of LAG members (e.g., every (T) interval) during operation. This is because the actual performance of members may change due to factors such as changes in the network environment and device aging. The reevaluation of indicators and calculation of the comprehensive score are the same as those in the initial allocation phase.

[0064] In an embodiment of the present invention, based on the new comprehensive score and compared with the current number of virtual nodes, if a member's performance improves or degrades to a certain extent, the number of its virtual nodes needs to be adjusted. If performance improves, the number of virtual nodes in the consistent hash ring is appropriately increased, and the positions of the newly added virtual nodes are reasonably allocated to ensure the stability of the ring. If performance degrades, the number of virtual nodes is reduced, and the data carried by the reduced virtual nodes is smoothly migrated to other suitable virtual nodes to maintain efficient and stable data transmission.

[0065] At the same time, the contents not described in detail in this specification belong to the existing technology known to those skilled in the art, and the model parameters of each electrical appliance are not specifically limited, and conventional equipment can be used.

[0066] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus.

[0067] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.

Claims

1. A method for reducing hash jitter caused by changes in the number of LAG members, characterized in that: The following steps are involved: Step 1: Real-time monitoring: Use link heartbeat and port polling technologies to closely monitor LAG member status around the clock and accurately capture member joining, exiting, or failure dynamics. Step 2: Alert activation: When a change in the number of members is detected, an alert is triggered immediately, notifying the administrator, starting the hash adjustment process, and suspending the flow of non-critical data to reserve time for adjustment; Step 3: Initial replica creation: Evaluate the new member's load capacity based on its bandwidth and latency characteristics, build a temporary hash table replica, and preliminarily plan the data slot layout. Step 4: Data Migration: Sort the original hash table data according to the preset priority, and prioritize hot and high-priority business data. Move it to the corresponding new member slots of the temporary replica in small batches or multiple batches. Verify the data integrity and consistency of each batch, and mark the migration complete after confirmation. Step 5. Node optimization: Recalculate the virtual node distribution of the consistent hash ring according to the new LAG member configuration, insert new members into nodes as needed, and migrate some nodes adjacent to old members; when a member exits, smoothly transfer the load of its corresponding node to the surviving member node, and recalculate the distribution of virtual nodes on the consistent hash ring according to the new LAG member configuration. For new members, insert a reasonable number of virtual nodes on the ring based on their performance parameters, and migrate some virtual nodes adjacent to old members in a load-balanced manner; for exiting members, smoothly transfer the data carried by their corresponding virtual nodes to the virtual nodes of other surviving members. By dynamically adjusting the mapping relationship between virtual nodes and actual LAG members, the stability of the hash ring and the uniformity of data distribution are maintained; Step 6: Switch verification: After the temporary replica data is migrated and the hash ring is stable, enable the new hash table and resume data transmission. Continuously monitor the throughput, latency, and packet loss rate indicators, compare and verify them, and roll back the original hash table and re-analyze and adjust them in case of any anomalies.

2. The method for reducing hash jitter caused by changes in the number of LAG members according to claim 1, characterized in that: In step 1, the system monitors the status of LAG members in real time, and promptly discovers the joining, exiting or failure of members through link heartbeat detection and port status polling technology.

3. The method for reducing hash jitter caused by changes in the number of LAG members according to claim 1, characterized in that: Once a quantity change is detected in step 2, the early warning mechanism is immediately triggered, a notification is sent to the system administrator, and the hash adjustment process is started. At the same time, the transmission of some non-critical data is suspended to gain a time window for adjustment.

4. The method for reducing hash jitter caused by changes in the number of LAG members according to claim 1, characterized in that: In step 3, a temporary hash table copy is constructed, the carrying capacity of the new member is evaluated according to its characteristics, and data slots are preliminarily allocated.

5. The method for reducing hash jitter caused by changes in the number of LAG members according to claim 1, characterized in that: In step 4, the data in the original hash table is sorted according to the pre-set priority rules, and hot data and high-priority business data are preferentially migrated in small batches and multiple batches to the slots of the new members corresponding to the temporary replica. After each batch is migrated, the integrity and consistency of the data are verified and marked as migrated after ensuring that there are no errors.

6. The method for reducing hash jitter caused by changes in the number of LAG members according to claim 1, characterized in that: In step 6, after the data migration in the temporary replica is completed and the hash ring reconstruction is stable, the old and new hash tables are switched, the new hash table is officially put into use, and the suspended data transmission is resumed. For a period of time after the switch, the data transmission performance, including throughput, latency, and packet loss rate indicators, is continuously monitored. The data before the switch is compared to verify the algorithm's suppression effect on hash jitter. If an abnormality is found, the original hash table is rolled back in time and re-analyzed and adjusted.

7. The method for reducing hash jitter caused by changes in the number of LAG members according to claim 1, characterized in that: In step 4, when migrating data from the original hash table to the temporary copy, the data is prioritized according to its traffic flow. and recent visit frequency To determine the migration order, let the comprehensive migration priority of data item i be The calculation formula is: ; Where, and It is a pre-set weight coefficient used to balance the importance of traffic priority and recent access frequency; according to Sort the data in descending order by size and migrate them first Data items with high values.

8. The method for reducing hash jitter caused by changes in the number of LAG members according to claim 1, characterized in that: In step 5, when the number of members changes and the load needs to be redistributed, the virtual node load is transferred to other surviving members after the member exits. Weighted round-robin is used. Suppose the surviving member set is M={ , , , },member The current load carrying capacity is , the load to be distributed is L, distributed to members Load The calculation formula is as follows:

Citation Information

Patent Citations

  • Method and device for preventing Hash polarization of multi-level cross-device link aggregation connection

    CN119070972A

  • Load balancing method, convergence shunt and storage medium

    CN112702278A

  • Micro-service load balancing optimization method based on dynamic feedback

    CN113382074A