Link election methods, devices, switching equipment and storage media

By selecting links based on link quality assessment algorithms and polling mechanisms in the switching chip, the problems of high circuit design overhead and poor user experience when multiple links have the same quality are solved, and the balanced allocation of link selection and the improvement of system stability are achieved.

CN119520385BActive Publication Date: 2025-10-28SUZHOU CENTEC COMM CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411699116.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2025-10-28
Estimated Expiration
2044-11-26

AI Technical Summary

Technical Problem

When switching chips support DLB, the random selection of links, when multiple links have the same quality, leads to high circuit design overhead and poor user experience.

Method used

By using a link quality assessment algorithm to obtain target links that meet the conditions in real time, and when there are multiple target links, a round-robin approach is used to allocate links to the traffic to be processed, so as to avoid unbalanced link selection.

Benefits of technology

It reduces the cost of link election, improves the user experience, ensures that each link has a chance to handle traffic, and improves the performance and stability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119520385B_ABST
    Figure CN119520385B_ABST
Patent Text Reader

Abstract

Embodiments of the present invention provide a link election method, apparatus, switching device, and storage medium, relating to the field of communications. The method includes: obtaining target links that meet the conditions from multiple links in real time based on a link quality assessment algorithm; receiving multiple traffic to be processed; and when there are multiple target links, allocating target links to each traffic to be processed in a round-robin manner. This can reduce the cost of randomly selecting links from target links and avoid the existence of unselected links among the target links, thereby improving the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of communications, and more specifically, to a link election method, apparatus, switching equipment, and storage medium. Background Technology

[0002] When a switching chip supports DLB (Dynamic Load Balancing), it faces the problem of electing a member link when multiple member links with the same link quality exist simultaneously.

[0003] At this point, the common thought is to randomly select an exit point for a given flow. However, in ASICs (Application-Specific Integrated Circuits), a common way to implement randomness is through a pseudo-random form of LFSR (Linear Feedback Shift Register). An LFSR is a sequence generator that generates pseudo-random or specific sequences through a simple hardware structure. This approach leads to high circuit design overhead, especially since each ECMP (Equal Cost Multi-Path) circuit requires its own LFSR circuit, further increasing the overhead. Secondly, when multiple member ports have the same load, and subsequently, a corresponding number of flows arrive simultaneously, pseudo-randomness may result in some ports not being selected, impacting the user experience. Summary of the Invention

[0004] The purpose of this invention is to provide a link election method, apparatus, switching device, and storage medium that can reduce costs and improve the user experience.

[0005] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows:

[0006] In a first aspect, embodiments of this application provide a link election method applied to a switching chip, the method comprising:

[0007] Based on the link quality assessment algorithm, the target link that meets the conditions is obtained from multiple links in real time;

[0008] Receive multiple pending traffic streams;

[0009] When there are multiple target links, the target links are allocated to each traffic to be processed in a round-robin manner.

[0010] In an optional implementation, the traffic to be processed includes a first traffic to be processed and a second traffic to be processed, the target link includes a first target link and a second target link, and the step of allocating the target link to each traffic to be processed based on a round-robin method when there are multiple target links includes:

[0011] Determine the first reception time of the first traffic to be processed and the second reception time of the second traffic to be processed;

[0012] When the first reception time is earlier than the second reception time, the first traffic to be processed is sent out based on the first target link using a polling method.

[0013] The second traffic to be processed is sent via the second target link using a polling method.

[0014] In an optional implementation, the step of allocating the target link to each of the traffic to be processed based on a round-robin method when there are multiple target links includes:

[0015] Construct an rr bitmap based on multiple of the aforementioned links;

[0016] Set the bit value of the target link to the first value;

[0017] Set the bit value of each of the multiple links other than the target link to a second value;

[0018] By polling the target link with the first bit value in the rr bitmap using a pointer, links are sequentially allocated to each of the traffic to be processed.

[0019] In an optional implementation, the method further includes:

[0020] When the polling status of subsequent packets of the first traffic to be processed is configured as the first state, the polling sequence of the second traffic to be processed is the second target link and the first target link, wherein the first state indicates that it does not participate in the polling of the target link;

[0021] When the polling status of subsequent packets of the first traffic to be processed is configured to the second status, the polling sequence of the second traffic to be processed is the first target link and the second target link, wherein the second status indicates participation in the polling of the target link.

[0022] In an optional implementation, the switching chip includes multiple ECMP Groups, and each ECMP Group includes multiple links;

[0023] The steps for obtaining target links that meet the conditions from multiple links in real time based on the link quality assessment algorithm include:

[0024] For each ECMP Group, based on the link quality assessment algorithm, the first target link that meets the conditions is obtained in real time from multiple links in the ECMP Group;

[0025] When there are multiple target links, the step of allocating target links to each traffic to be processed based on a round-robin method includes:

[0026] When there are multiple first target links, determine the polling sequence for each first target link;

[0027] Each ECMP Group allocates the first target link to each of the pending traffic groups based on the corresponding polling sequence.

[0028] In an optional implementation, the step of allocating the target link to each of the traffic to be processed based on a round-robin method when there are multiple target links includes:

[0029] Each ECMP Group allocates the first target link to each of the pending traffic based on the polling sequence.

[0030] In an optional implementation, the step of obtaining target links that meet the conditions from multiple links in real time based on the link quality assessment algorithm includes:

[0031] Obtain the throughput of each link within a unit of time;

[0032] Obtain a preset number of links that exceed a preset throughput, and use them as target links.

[0033] Secondly, embodiments of this application provide a link election device applied to a switching chip, the device comprising:

[0034] The acquisition module is used to acquire target links that meet the conditions from multiple links in real time based on the link quality assessment algorithm;

[0035] The receiving module is used to receive multiple traffic streams to be processed.

[0036] The allocation module is used to allocate the target links to each of the traffic to be processed based on a round-robin method when there are multiple target links.

[0037] Thirdly, embodiments of this application provide a switching device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the link election method.

[0038] Fourthly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the link election method.

[0039] This application has the following beneficial effects:

[0040] This application uses a link quality assessment algorithm to obtain target links that meet the conditions from multiple links in real time, and receives multiple traffic to be processed. When there are multiple target links, a round-robin method is used to allocate target links to each traffic to be processed. This can reduce the cost of randomly selecting links from target links and avoid the existence of unselected links in the target links, thereby improving the user experience. Attached Figure Description

[0041] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0042] Figure 1 A block diagram of a switching device provided in an embodiment of the present invention;

[0043] Figure 2 This is one of the flowcharts illustrating a link election method provided in an embodiment of the present invention;

[0044] Figure 3 This is a second flowchart illustrating a link election method provided in an embodiment of the present invention.

[0045] Figure 4 The third flowchart illustrates a link election method provided in an embodiment of the present invention.

[0046] Figure 5 A schematic diagram of the rr bitmap provided in an embodiment of the present invention;

[0047] Figure 6 The fourth flowchart illustrates a link election method provided in an embodiment of the present invention.

[0048] Figure 7 The fifth flowchart illustrates a link election method provided in an embodiment of the present invention.

[0049] Figure 8 This is a structural block diagram of a link election device provided in an embodiment of the present invention. Detailed Implementation

[0050] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0051] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.

[0052] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0053] In the description of this invention, it should be noted that if terms such as "upper," "lower," "inner," or "outer" are used to indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, or the orientation or positional relationship in which the product of this invention is usually placed, they are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this invention.

[0054] Furthermore, the terms "first" and "second" are used only to distinguish descriptions and should not be interpreted as indicating or implying relative importance.

[0055] In the description of this application, it should also be noted that, unless otherwise expressly specified and limited, the terms "set up," "install," "connect," and "link" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.

[0056] Through extensive research, the inventors discovered that when a switching chip supports DLB (Dynamic Load Balancing), it faces the problem of electing a member link when multiple member links with the same link quality exist simultaneously.

[0057] At this point, the common thought is to randomly select an exit point for a given flow. However, in ASICs (Application-Specific Integrated Circuits), a common way to implement randomness is through a pseudo-random form of LFSR (Linear Feedback Shift Register). An LFSR is a sequence generator that generates pseudo-random or specific sequences through a simple hardware structure. This approach leads to high circuit design overhead, especially since each ECMP (Equal Cost Multi-Path) circuit requires its own LFSR circuit, further increasing the overhead. Secondly, when multiple member ports have the same load, and subsequently, a corresponding number of flows arrive simultaneously, pseudo-randomness may result in some ports not being selected, impacting the user experience.

[0058] In view of the above-mentioned problems, this embodiment provides a link election method, apparatus, switching device, and storage medium, which can obtain target links that meet the conditions from multiple links in real time based on a link quality assessment algorithm, receive multiple traffic to be processed, and allocate target links to each traffic to be processed in a round-robin manner when there are multiple target links. This can reduce the cost of randomly selecting links from target links and avoid the existence of unselected links among target links, thereby improving the user experience. The solution provided in this embodiment will be described in detail below.

[0059] This embodiment provides a switching device capable of electing links. In one possible implementation, the switching device can be a user terminal, such as, but not limited to, a server, smartphone, personal computer (PC), tablet computer, personal digital assistant (PDA), mobile internet device (MID), and switch.

[0060] Please refer to Figure 1 , Figure 1 This is a schematic diagram of the structure of the switching device 100 provided in an embodiment of this application. The switching device 100 may further include a... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown. Figure 1 The components shown can be implemented using hardware, software, or a combination thereof.

[0061] The switching device 100 includes a link election device 110, a memory 120, and a processor 130.

[0062] The components of the memory 120 and processor 130 are electrically connected directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines. The link election device 110 includes at least one software function module that can be stored in the memory 120 in the form of software or firmware or embedded in the operating system (OS) of the switching device 100. The processor 130 is used to execute the executable modules stored in the memory 120, such as the software function modules and computer programs included in the link election device 110.

[0063] The memory 120 may be, but is not limited to, Random Access Memory (RAM), Read Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), etc. The memory 120 is used to store programs, and the processor 130 executes the programs after receiving execution instructions.

[0064] Please refer to Figure 2 , Figure 2 For application Figure 1 The following is a flowchart of a link election method for a switching device 100, and the method includes a detailed description of each step.

[0065] S201: Based on the link quality assessment algorithm, it obtains the target link that meets the conditions from multiple links in real time.

[0066] S202: Receive multiple pending traffic streams.

[0067] S203: When there are multiple target links, target links are allocated to each traffic to be processed based on a round-robin method.

[0068] When there are multiple target links, each target link is the link with the same load and the lowest load.

[0069] There are several ways to implement a link quality assessment algorithm to obtain a target link that meets certain conditions from multiple links. In one implementation:

[0070] Based on Round-Trip Time, target links that meet certain conditions are selected from multiple links. The time required for data packets to travel from the sender to the receiver and back to the sender for each link is determined, and a preset number of links with a time shorter than a preset time are selected as target links.

[0071] Specifically, this can be calculated by sending an ICMP Echo Request (ping) and measuring the response time.

[0072] The Packet Loss Rate (PLR) is used to select a target link from multiple links that meets certain criteria. The Packet Loss Rate (PLR) is the percentage of data packets lost during network transmission.

[0073] Specifically, the PLR ​​can be calculated by sending a series of data packets and counting the number of unreceived response packets, and then a preset number of links with a lower than the preset packet loss rate can be selected as target links.

[0074] The target link that meets the criteria is selected from multiple links based on jitter. Jitter refers to the variation in packet arrival time.

[0075] Specifically, jitter is calculated by measuring the time difference of arrival between consecutive data packets, and a preset number of links with less than a preset jitter are selected as target links.

[0076] The target link that meets the criteria is selected from multiple links based on the bandwidth. Bandwidth indicates the maximum transmission rate in the link.

[0077] Specifically, the Bandwidth of each link is calculated by sending a large amount of data and measuring the transmission time, and a preset number of links with a maximum transmission rate greater than or equal to the preset number of links are selected as target links.

[0078] Throughput is used to select a target link that meets certain conditions from multiple links. Throughput indicates the amount of data successfully transmitted per unit of time, which is the throughput.

[0079] Specifically, the amount of data successfully transmitted per unit time is calculated by sending a large amount of data and measuring the actual transmission rate. A preset number of links with a throughput greater than or equal to a preset limit are then identified as target links.

[0080] The target link that meets the conditions is obtained from multiple links based on Quality of Service (QoS) parameters. Quality of Service (QoS) parameters are service quality parameters, such as priority, bandwidth guarantee, or latency guarantee.

[0081] Specifically, service quality parameters are evaluated by configuring and monitoring QoS parameters. A preset number of links with service quality parameters greater than or equal to a preset number are then identified as target links.

[0082] It should be noted that the preset quantity can be set to 3, 4, or 5. The preset quantity can be freely selected based on the actual situation, and this application embodiment does not impose specific restrictions on it.

[0083] When multiple pending traffic messages are received simultaneously, a target link is assigned to each pending traffic message in a round-robin manner. That is, each pending traffic message selects the corresponding target link from multiple target links in turn.

[0084] For example, when multiple pending traffic flows include a first pending traffic flow, a second pending traffic flow, and a third pending traffic flow, and the target links include a first target link, a second target link, and a third target link, then the first pending traffic flow selects the first target link, the second pending traffic flow selects the second target link, and the third pending traffic flow selects the third target link.

[0085] When there are multiple target links, there are several ways to allocate target links to each traffic to be processed based on a round-robin approach. In one implementation, such as... Figure 3 As shown, it includes the following steps:

[0086] The following example illustrates the process based on the traffic to be processed, which includes a first traffic to be processed and a second traffic to be processed, and the target link, which includes a first target link and a second target link.

[0087] S301: Determine the first reception time of the first traffic to be processed and the second reception time of the second traffic to be processed.

[0088] S302: When the first reception time is earlier than the second reception time, the first traffic to be processed is sent out based on the first target link using a polling method.

[0089] S303: Based on polling, the second traffic to be processed is sent through the second target link.

[0090] Polling distributes traffic evenly across multiple target links, preventing overload on individual links and improving overall system performance and stability. Each target link has a chance to process the traffic, ensuring that every unit in the system receives appropriate resource allocation.

[0091] When the first reception time of the first pending traffic is earlier than the second reception time of the second pending traffic, that is, when the switching chip receives the first pending traffic first and then the second pending traffic, and when the polling sequence of the first target link and the second target link is the first target link and the second target link, then based on the polling method, the first target link processes the first pending traffic and the second target link processes the second pending traffic.

[0092] When multiple pending traffic flows include a first pending traffic flow, a second pending traffic flow, and a third pending traffic flow, and these three flows are received sequentially by a switching chip, and the target link includes a first target link and a second target link, the first target link processes the first pending traffic flow, the second target link processes the second pending traffic flow, and the third target link processes the third pending traffic flow.

[0093] When there are multiple target links, another way to allocate target links to each traffic to be processed based on round-robin is as follows: Figure 4 As shown, it includes the following steps:

[0094] S401: Construct rr bitmap based on multiple links.

[0095] S402: Set the target link's bit value to the first value.

[0096] S403: Set the bit value of each link other than the target link in multiple links to the second value.

[0097] S404: Poll the target link with the first bit value in the rr bitmap using a pointer to allocate links to each of the traffic to be processed in sequence.

[0098] like Figure 5 The diagram shows a schematic of the rr bitmap. Based on the link quality assessment algorithm, target links that meet the conditions are obtained from multiple links in real time. The corresponding member of the target link is set to 1 in the rr bitmap, while other members are set to 0. A pointer is used to record the index of the previously selected member in the bitmap. This allows multiple new incoming traffic to be selected sequentially from these members, ultimately ensuring that multiple target links are selected by the incoming traffic.

[0099] Polling distributes traffic evenly across multiple target links, preventing overload on individual links and improving overall system performance and stability. Each target link has a chance to process the traffic, ensuring that every unit in the system receives appropriate resource allocation.

[0100] The polling principle works as follows: all tasks or requests are placed in a queue, meaning multiple pending traffic flows are put into a queue to await processing. The system has multiple processing units, i.e., multiple target links, each capable of handling tasks. The scheduler is responsible for retrieving pending traffic from the task queue and allocating it to the target links in a polling manner. The scheduler maintains a pointer pointing to the target link that should currently handle the pending traffic. Each time a pending traffic flow is retrieved from the task queue, the scheduler allocates it to the target link currently pointed to by the pointer. After allocating the pending traffic, the pointer moves to the next target link. If all target links have already processed the pending traffic, the pointer returns to the first target link, and the polling continues.

[0101] Different states can be set for pending traffic after links have been allocated. When the polling state of the first pending traffic is configured as the first state, the polling sequence of the second pending traffic is the second target link and the first target link. The first state indicates that it does not participate in the polling of the target link. When the polling state of the second pending traffic is configured as the second state, the polling sequence of the second pending traffic is the first target link and the second target link. The second state indicates that it participates in the polling of the target link.

[0102] For example, if the first packet of the first traffic to be processed has already selected a target link (e.g., target link 0), and the polling status of subsequent packets of the first traffic to be processed is configured to not participate in the polling of target links, then when the target links include target link 0 and target link 1, the polling sequence for the target path of the second traffic to be processed is 1,0. Here, 0 represents target link 0, and 1 represents target link 1.

[0103] If a target link has been selected in the first packet of the first pending traffic (e.g., target link 0), and subsequent packets of the first pending traffic are in the polling state of participating in target link polling, then the polling sequence for the target path of the second pending traffic is 0,1, where 0 represents target link 0 and 1 represents target link 1.

[0104] The polling election involves a packet-by-packet process. This means that each packet querying the ECMPGroup causes a pointer to slide on the rr bitmap. Non-new flows on already selected links will not update their initially selected ports with the selected result. By configuring subsequent packets of the first pending traffic to participate in the polling of the target link, a random effect is added to the polling order election; that is, packets that do not need to be re-selected interfere with the polling sequence of packets that need to be elected.

[0105] Only packets requiring election participate in the round-robin election. This means that subsequent packets of the first pending traffic that has already selected a target link will also select the corresponding target link. This avoids the problem of flows requiring election being "randomly" assigned to the same member port, leading to some ports being idle. It ensures that when multiple flows have the same and lightest load, and new flows enter the switching chip sequentially or simultaneously, they are evenly distributed to the target link. Especially when the number of incoming new flows equals the number of target links, each flow selects a unique target link. From the user's perspective, this "random" routing is more distributed and even, resulting in higher member link utilization.

[0106] The aforementioned superimposed random effects, when a synchronization effect occurs, may cause some target links to remain unselected. For example, if the rate of traffic from interfering factors is consistently twice that of new flows, microscopically, it will always occupy an extra polling sequence element, and it will not use the result of this element. When the number of flows and the number of target links are in a certain proportion, some target links that are extra-occupied will never send out any traffic. To avoid some target links being idle during polling election due to synchronization effects, each ECMP Group can control a certain number of packet intervals to participate in the election, and these packet intervals can be dynamically changed, such as by incrementing or using timestamp values.

[0107] The switching chip contains multiple ECMP Groups, and each ECMP Group contains multiple links. Link election is performed based on multiple ECMP Groups, such as... Figure 6 As shown, it includes the following steps:

[0108] S501: For each ECMP Group, based on the link quality assessment algorithm, the first target link that meets the conditions is obtained in real time from multiple links in the ECMP Group.

[0109] S502: Receives multiple pending traffic streams.

[0110] S503: When there are multiple first target links, determine the polling sequence for each first target link.

[0111] S504: Each ECMP Group allocates the first target link to each pending traffic based on the corresponding polling sequence.

[0112] For example, an ECMP Group includes a first ECMP Group and a second ECMP Group. The first ECMP Group contains links 1, 2, 3, and 4, and the second ECMP Group contains links 5, 6, 7, and 8. A first target link determined from the first ECMP Group based on a link quality assessment algorithm contains links 1, 2, and 3, and a second target link determined from the second ECMP Group based on a link quality assessment algorithm contains links 5, 6, and 7. Then, the polling sequence for the first target link is 1, 2, and 3, and the polling sequence for the second target link is 5, 6, and 7. When processing received traffic, the first ECMP Group allocates the first target link to each traffic based on the polling sequence 1, 2, and 3. When processing received traffic, the second ECMP Group allocates the second target link to each traffic based on the polling sequence 5, 6, and 7.

[0113] The switching chip contains multiple ECMP Groups, and each ECMP Group contains multiple links. Link election is performed based on multiple ECMP Groups, such as... Figure 7 As shown, it includes the following steps:

[0114] S601: For each ECMP Group, based on the link quality assessment algorithm, the first target link that meets the conditions is obtained in real time from multiple links in the ECMP Group.

[0115] S602: Receives multiple pending traffic streams.

[0116] S603: When there are multiple first target links, determine the polling sequence for each first target link.

[0117] S604: Each ECMP Group allocates a first target link to each pending traffic based on a polling sequence.

[0118] For example, in an ECMP Group comprising a first ECMP Group and a second ECMP Group, the first ECMP Group contains links 1234 and the second ECMP Group contains links 5678. The first target link determined from the first ECMP Group based on the link quality assessment algorithm contains the first target link 123, and the second target link determined from the second ECMP Group based on the link quality assessment algorithm contains the second target link 567. Then the polling sequence of the first target link is 123.

[0119] When processing received traffic, the first ECMP Group assigns a first target link to each traffic stream based on a 1-2-3 polling sequence. Similarly, when processing received traffic, the second ECMP Group assigns a second target link to each traffic stream based on the same 1-2-3 polling sequence. Here, 1 represents the second target link corresponding to traffic stream 5, 2 represents the second target link corresponding to traffic stream 6, and 3 represents the second target link corresponding to traffic stream 7.

[0120] Please refer to Figure 8 This application embodiment also provides an application for Figure 1 The link election device 110 of the switching device 100 includes:

[0121] The acquisition module 111 is used to acquire target links that meet the conditions from multiple links in real time based on the link quality assessment algorithm.

[0122] Receiver module 112 is used to receive multiple traffic streams to be processed;

[0123] The allocation module 113 is used to allocate the target links to each of the traffic to be processed based on a round-robin method when there are multiple target links.

[0124] This application also provides a switching device 100, which includes a processor 130 and a memory 120. The memory 120 stores computer-executable instructions, which, when executed by the processor 130, implement the link election method.

[0125] This application embodiment also provides a computer-readable storage medium storing a computer program, which, when executed by a processor 130, implements the link election method.

[0126] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0127] Furthermore, the functional modules in the various embodiments of this 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. If the function is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes: USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, optical disks, and other media capable of storing program code.

[0128] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0129] The above descriptions are merely various embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A link election method, characterized in that, Applied to a switching chip, the method includes: Based on the link quality assessment algorithm, the target link that meets the conditions is obtained from multiple links in real time; Receive multiple pending traffic streams; When there are multiple target links, the target links are allocated to each of the pending traffic flows using a round-robin method; the pending traffic flows include a first pending traffic flow and a second pending traffic flow, and the target links include a first target link and a second target link. The step of allocating the target links to each of the pending traffic flows using a round-robin method when there are multiple target links includes: Determine the first reception time of the first traffic to be processed and the second reception time of the second traffic to be processed; When the first reception time is earlier than the second reception time, the first traffic to be processed is sent out based on the first target link using a polling method. Based on a polling method, the second traffic to be processed is sent out via the second target link; The method further includes: When the polling status of subsequent packets of the first traffic to be processed is configured as the first state, the polling sequence of the second traffic to be processed is the second target link and the first target link, wherein the first state indicates that it does not participate in the polling of the target link; When the polling status of subsequent packets of the first pending traffic is configured to the second status, the polling sequence of the second pending traffic is the first target link and the second target link, wherein the second status indicates participation in the polling of the target link.

2. The method according to claim 1, characterized in that, When there are multiple target links, the step of allocating target links to each traffic to be processed based on a round-robin method includes: Construct an rr bitmap based on multiple of the aforementioned links; Set the bit value of the target link to the first value; Set the bit value of each of the multiple links other than the target link to a second value; By polling the target link with the first bit value in the rr bitmap using a pointer, links are sequentially allocated to each of the traffic to be processed.

3. The method according to claim 1, characterized in that, The switching chip contains multiple ECMP Groups, and each ECMP Group contains multiple links; The steps for obtaining target links that meet the conditions from multiple links in real time based on the link quality assessment algorithm include: For each ECMP Group, based on the link quality assessment algorithm, the first target link that meets the conditions is obtained in real time from multiple links in the ECMP Group; When there are multiple target links, the step of allocating target links to each traffic to be processed based on a round-robin method includes: When there are multiple first target links, determine the polling sequence for each first target link; Each ECMP Group allocates the first target link to each of the pending traffic groups based on the corresponding polling sequence.

4. The method according to claim 3, characterized in that, When there are multiple target links, the step of allocating target links to each traffic to be processed based on a round-robin method includes: Each ECMP Group allocates the first target link to each of the pending traffic based on the polling sequence.

5. The method according to claim 1, characterized in that, The steps for obtaining target links that meet the conditions from multiple links in real time based on the link quality assessment algorithm include: Obtain the throughput of each link within a unit of time; Obtain a preset number of links that exceed a preset throughput, and use them as target links.

6. A link election device, characterized in that, The device, applied to a switching chip, includes: The acquisition module is used to acquire target links that meet the conditions from multiple links in real time based on the link quality assessment algorithm; The receiving module is used to receive multiple traffic streams to be processed. The allocation module is used to allocate the target links to each of the traffic to be processed based on a round-robin method when there are multiple target links. The allocation module is specifically used for: The traffic to be processed includes a first traffic to be processed and a second traffic to be processed, the target link includes a first target link and a second target link, and a first reception time of the first traffic to be processed and a second reception time of the second traffic to be processed are determined. When the first reception time is earlier than the second reception time, the first traffic to be processed is sent out based on the first target link using a polling method. Based on a polling method, the second traffic to be processed is sent out via the second target link; The allocation module is also used for: When the polling status of subsequent packets of the first traffic to be processed is configured as the first state, the polling sequence of the second traffic to be processed is the second target link and the first target link, wherein the first state indicates that it does not participate in the polling of the target link; When the polling status of subsequent packets of the first pending traffic is configured to the second status, the polling sequence of the second pending traffic is the first target link and the second target link, wherein the second status indicates participation in the polling of the target link.

7. A switching device, characterized in that, It includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the method according to any one of claims 1-5.

8. A storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of the method described in any one of claims 1-5.

Citation Information

Patent Citations

  • Vehicle-mounted Ethernet ring network link switching method and system, vehicle and storage medium

    CN116455699A

  • Chip routing method, device, equipment and medium

    CN117834537A