Message transmission method and related device
By performing fine-grained segmentation of link states and performance index analysis, and selecting a suitable set of links for message transmission, the problem of service interruption caused by link switching mechanisms in complex network failure scenarios in existing technologies is solved, and more stable message transmission is achieved.
Patent Information
- Application Number
- CN202411149487.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-20
- Publication Date
- 2026-03-03
AI Technical Summary
Existing link switching mechanisms are clumsy in complex and ever-changing network failure scenarios, easily leading to service interruptions and failing to provide switching behavior that adapts to different scenarios.
By dividing the link states into more granular categories, including first, second, and third states, a subset of links is determined based on the link's performance metrics. A suitable set of links is then selected for message transmission to avoid service interruption.
In complex network failure scenarios, it can more accurately match multiple switching schemes, reduce service interruptions, and provide more stable packet transmission quality.
Smart Images

Figure CN121603572A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a message transmission method and related apparatus. Background Technology
[0002] Link aggregation groups (LAGs) are used to aggregate multiple physical links of a network device into a single logical link, enabling these physical links to operate simultaneously, achieving load balancing and redundancy, thereby improving network reliability. Multi-chassis-link aggregation groups (MC-LAGs) aggregate the LAGs of multiple network devices, allowing these devices to synchronize their status and information via peer links, ensuring that their LAGs transmit messages with peer devices in the same state. Multiple network devices managed by the same MC-LAG are designated as primary and backup nodes. The primary node is responsible for message transmission. Backup nodes are typically in hot standby mode, ready to take over the primary node's work and continue message transmission at any time. Therefore, MC-LAGs can provide device-level redundancy protection.
[0003] Currently, both the switching mechanisms applied to multiple links within the same LAG and the switching mechanisms applied to multiple devices within the same MC-LAG are cumbersome in complex and ever-changing network fault scenarios, and are prone to causing service interruptions. Summary of the Invention
[0004] To address the aforementioned technical issues, this application provides a message transmission method and related apparatus that can provide switching behavior adapted to different scenarios in complex and ever-changing network fault scenarios, thereby minimizing service interruptions.
[0005] A first aspect provides a message transmission method, comprising: obtaining the link state of at least one link in a first link set; and determining whether to use a first link subset for message transmission based on the link state of the at least one link. The first link set includes one or more Link Aggregation Groups (LAGs). Each LAG includes multiple links. Links in the first link subset belong to the same LAG within one or more LAGs. The link state of each link is determined based on its performance metrics, and the link state belongs to a state set. The state set includes a first state, a second state, and a third state. The first state indicates that the link's performance metrics are better than a first reference performance metric. The second state indicates that the link's performance metrics are worse than the first reference performance metric but better than the second reference performance metric. The third state indicates that the link's performance metrics are worse than the second reference performance metric.
[0006] In existing solutions, network devices perform link switching based solely on two link states (normal and abnormal). Typically, only links in the normal state are selected for data transmission. When the number of normal links is insufficient, data transmission is directly interrupted, leading to service disruption. This solution provides a more granular classification of link states. For example, based on link performance metrics, link states are divided into first, second, and third states, allowing for a more accurate representation of the current transmission quality. This finely defined link state allows for more link combinations, enabling the matching of a wider range of network failure scenarios and flexible switching schemes. It also makes it easier to select the primary subset of links for data transmission, thus minimizing service interruptions.
[0007] In some possible implementations, the at least one link includes links belonging to a first LAG. Determining whether to use a first subset of links to transmit a message based on the link state of the at least one link includes: determining to use the first subset of links to transmit a message if the number of links in the first LAG that are in a first state is greater than or equal to the minimum number of active links in the first LAG. The first subset of links includes links in the first LAG that are in the first state.
[0008] In the above scheme, when the number of links in the first state in the first LAG (i.e., links with good transmission quality) meets the minimum transmission requirement (i.e., the minimum number of active links), the transmission scheme provided by this scheme is to directly use these links with good transmission quality to transmit messages. This can provide the best transmission quality.
[0009] In some possible implementations, the at least one link includes links belonging to a first LAG. Determining whether to use the first link subset for message transmission based on the link state of the at least one link includes: determining to use the first link subset for message transmission when the number of links in the first LAG in the first state is less than the minimum number of active links in the first LAG, and the sum of the number of links in the first state and the number of links in the second state in the first LAG is greater than or equal to the minimum number of active links. The first link subset includes links in the first LAG in the first state and links in the second state.
[0010] In the above scheme, even if the number of links with good transmission quality in the first LAG cannot meet the minimum transmission requirements, this scheme can still provide a transmission solution that avoids service interruption: when the sum of the number of links in the first state and the number of links in the second state (i.e., links representing poor transmission quality) in the first LAG is greater than or equal to the minimum number of active links, the links in the first state and the links in the second state in the first LAG are used together to transmit messages. Although using links in the second state to transmit messages will degrade transmission quality and impair service, the loss to users caused by the degraded transmission quality is smaller than the loss caused by directly interrupting transmission.
[0011] In some possible implementations, the first LAG belongs to the first link set, which includes multiple LAGs, each LAG corresponding to an available bandwidth. The determination to use the first link subset to transmit the message includes: if the first LAG is the LAG with the largest available bandwidth among the multiple LAGs, then determining to use the first link subset to transmit the message.
[0012] In some possible implementations, the above method further includes: if the first LAG is not the LAG with the largest available bandwidth among multiple LAGs, determining not to use the first link subset to transmit messages.
[0013] The available bandwidth corresponding to the first LAG is determined based on the available bandwidth of the port corresponding to each link in the first LAG. The available bandwidth of the port corresponding to each link is determined based on the link status of each link.
[0014] This scheme provides a specific implementation for determining whether to use the first link subset for packet transmission. The available bandwidth of a Linkage Group (LAG) is used to characterize the transmission quality of links within that LAG. Therefore, by comparing the available bandwidth of different LAGs, it can be determined whether the first LAG has the best overall transmission quality among multiple LAGs, thus determining whether to use the first link subset for packet transmission.
[0015] In some possible implementations, the aforementioned multiple LAGs include a second LAG. The number of links in the second LAG that are in the first state is greater than or equal to the minimum number of active links in the second LAG. Alternatively, the number of links in the second LAG that are in the first state is less than the minimum number of active links in the second LAG, and the sum of the number of links in the first state and the number of links in the second state in the second LAG is greater than or equal to the minimum number of active links in the second LAG. The first LAG is different from the second LAG. After determining that the first LAG will not be used to transmit messages if the first LAG is not the LAG with the maximum available bandwidth among the multiple LAGs, the above method further includes: if the second LAG is the LAG with the maximum available bandwidth among the multiple LAGs, determining that the second subset of links will be used to transmit messages. The links in the second subset of links belong to the second LAG.
[0016] In the above scheme, even if it is clear that the first LAG is not used to transmit messages, a clear switching scheme can also be provided, that is, to specify which LAG is responsible for subsequent message transmission. Specifically, it is determined based on the available bandwidth of each LAG and the link status of each link in the LAG.
[0017] In some possible implementations, if the number of links in the first state within the second LAG is greater than or equal to the minimum number of active links in the second LAG, then the second subset of links includes the links in the first state within the second LAG. If the number of links in the first state within the second LAG is less than the minimum number of active links in the second LAG, and the sum of the number of links in the first state and the number of links in the second state within the second LAG is greater than or equal to the minimum number of active links in the second LAG, then the second subset of links includes both the links in the first state and the links in the second state within the second LAG.
[0018] After determining the LAG responsible for subsequent message transmission, this solution can also determine the actual link in the LAG used for message transmission based on the link status of each link in the LAG, thus providing a more specific switching solution.
[0019] In some possible implementations, the aforementioned multiple LAGs include a second LAG. The number of links in the second LAG that are in the first state is greater than or equal to the minimum number of active links in the second LAG. Alternatively, the number of links in the second LAG that are in the first state is less than the minimum number of active links in the second LAG, and the sum of the number of links in the first state and the number of links in the second state in the second LAG is greater than or equal to the minimum number of active links in the second LAG. The first LAG is different from the second LAG. The determination to use the first link subset for packet transmission if the first LAG is the LAG with the maximum available bandwidth among the multiple LAGs includes: if both the first LAG and the second LAG are LAGs with the maximum available bandwidth among the multiple LAGs, and the first device corresponding to the first LAG has the highest system priority, then the determination to use the first link subset for packet transmission is made.
[0020] This solution uses the system priority of the device corresponding to the LAG to solve the problem of which LAG is responsible for subsequent message transmission when multiple LAGs with the maximum available bandwidth exist at the same time.
[0021] In some possible implementations, the first device is the device currently transmitting the message, and the second LAG corresponds to the second device, which is a different device from the first device.
[0022] In some possible implementations, the links in the aforementioned first link subset belong to a first LAG. The first LAG corresponds to a first device. The first device is the device currently transmitting the message. The determination of whether to use the first link subset for message transmission based on the link state of at least one link includes: determining whether to use the first link subset for message transmission based on the link state of at least one link when the link state of at least one link changes. Alternatively, determining whether to use the first link subset for message transmission based on the link state of at least one link when the number of links in the first LAG in the first state is less than the minimum number of active links.
[0023] The above scheme provides two triggering methods for determining whether to use the first link subset for packet transmission. In the first triggering method, the usage result of the first link subset is updated whenever the link status changes. This method ensures that the LAG used for packet transmission is always the LAG with the best overall transmission quality among multiple LAGs, thus guaranteeing the best transmission quality for the service. In the second triggering method, the usage result of the currently responsible link subset is updated only if the number of high-quality links in the LAG is insufficient to meet the minimum transmission requirements. This method saves computational and switching overhead while maintaining transmission quality.
[0024] In some possible implementations, the links in the first subset of links mentioned above belong to a first LAG. The first LAG corresponds to a first device. The first device is the device currently transmitting the message. The method further includes sending a Link Aggregation Control Protocol (LACP) negotiation message to the peer device of the first device. This LACP negotiation message is used to indicate the links in the first LAG that are in a second state.
[0025] This solution informs the peer device of the link status by sending LACP negotiation messages, thereby ensuring the consistency of behavior between the first device and the peer device.
[0026] Secondly, a message transmission apparatus is provided, including an acquisition unit and a determination unit. The acquisition unit is used to acquire the link status of at least one link in a first link set. The determination unit is used to determine, based on the link status of the at least one link, whether to use the first link subset for message transmission. The first link set includes one or more Link Aggregation Groups (LAGs). Each LAG includes multiple links. Links in the first link subset belong to the same LAG within one or more LAGs. The link status of each link is determined based on its performance metrics, and the link status belongs to a status set. The status set includes a first status, a second status, and a third status. The first status indicates that the link's performance metrics are better than a first reference performance metric. The second status indicates that the link's performance metrics are worse than the first reference performance metric but better than the second reference performance metric. The third status indicates that the link's performance metrics are worse than the second reference performance metric.
[0027] In some possible implementations, at least one of the aforementioned links includes links belonging to a first LAG. Specifically, the determining unit is configured to determine whether to use a first subset of links for message transmission when the number of links in the first LAG that are in a first state is greater than or equal to the minimum number of active links in the first LAG. The first subset of links includes links in the first LAG that are in the first state.
[0028] In some possible implementations, at least one of the aforementioned links includes links belonging to a first LAG. Specifically, the determining unit is configured to determine whether to use a first subset of links for message transmission when the number of links in the first LAG in a first state is less than the minimum number of active links in the first LAG, and the sum of the number of links in the first LAG in the first state and the number of links in the second state is greater than or equal to the minimum number of active links. The first subset of links includes links in the first LAG in the first state and links in the second state.
[0029] In some possible implementations, the first LAG belongs to the first link set. This first link set includes multiple LAGs. Each LAG corresponds to an available bandwidth. Specifically, the determining unit is used when the number of links in the first LAG in the first state is greater than or equal to the minimum number of active links in the first LAG; or when the number of links in the first LAG in the first state is less than the minimum number of active links in the first LAG, and the sum of the number of links in the first state and the number of links in the second state in the first LAG is greater than or equal to the minimum number of active links, and if the first LAG is the LAG with the largest available bandwidth among the multiple LAGs, it determines to use the first link subset to transmit the message.
[0030] In some possible implementations, the determining unit is further configured to determine that the first link subset will not be used to transmit messages if the first LAG is not the LAG with the largest available bandwidth among the multiple LAGs.
[0031] In some possible implementations, the aforementioned plurality of LAGs includes a second LAG. The number of links in the second LAG that are in the first state is greater than or equal to the minimum number of active links in the second LAG. Alternatively, the number of links in the second LAG that are in the first state is less than the minimum number of active links in the second LAG, and the sum of the number of links in the second LAG that are in the first state and the number of links in the second state is greater than or equal to the minimum number of active links in the second LAG. The first LAG is different from the second LAG. The aforementioned determining unit is further configured to, if it is determined that the first subset of links will not be used to transmit packets, and if the second LAG is the LAG with the largest available bandwidth among the plurality of LAGs, determine that the second subset of links will be used to transmit packets. The links in the second subset of links belong to the second LAG.
[0032] In some possible implementations, if the number of links in the first state within the second LAG is greater than or equal to the minimum number of active links in the second LAG, then the second subset of links includes the links in the first state within the second LAG. If the number of links in the first state within the second LAG is less than the minimum number of active links in the second LAG, and the sum of the number of links in the first state and the number of links in the second state within the second LAG is greater than or equal to the minimum number of active links in the second LAG, then the second subset of links includes both the links in the first state and the links in the second state within the second LAG.
[0033] In some possible implementations, the aforementioned multiple LAGs include a second LAG. The number of links in the second LAG that are in the first state is greater than or equal to the minimum number of active links in the second LAG. Alternatively, the number of links in the second LAG that are in the first state is less than the minimum number of active links in the second LAG, and the sum of the number of links in the second LAG that are in the first state and the number of links in the second state is greater than or equal to the minimum number of active links in the second LAG. The first LAG and the second LAG are different. Specifically, the determining unit is used to determine whether to use the first subset of links to transmit packets when both the first LAG and the second LAG are LAGs with the largest available bandwidth among multiple LAGs, and the system priority of the first device corresponding to the first LAG is the highest.
[0034] In some possible implementations, the first device is the device currently transmitting the message, and the second LAG corresponds to the second device, which is a different device from the first device.
[0035] In some possible implementations, the links in the aforementioned first link subset belong to a first LAG. The first LAG corresponds to a first device. The first device is the device currently transmitting the message. Specifically, the determining unit is used to determine whether to use the first link subset to transmit the message based on the link state of at least one link when the link state of at least one link changes. Alternatively, the determining unit is specifically used to determine whether to use the first link subset to transmit the message based on the link state of at least one link when the number of links in the first LAG in the first state is less than the minimum number of active links.
[0036] In some possible implementations, the links in the aforementioned first subset of links belong to a first LAG. The first LAG corresponds to a first device. The first device is the device currently transmitting the message. The aforementioned message transmission apparatus includes a sending unit. The sending unit is used to send a Link Aggregation Control Protocol (LACP) negotiation message to the peer device of the first device. This LACP negotiation message is used to indicate the links in the first LAG that are in a second state.
[0037] Thirdly, a network device is provided, including a processor and a memory for storing instructions, the processor for executing the instructions, and when the processor executes the instructions, implementing the method as described in the first aspect or any possible implementation thereof.
[0038] Fourthly, a network system is provided, comprising a plurality of network devices managed by a cross-device link aggregation group (MC-LAG), each of the plurality of network devices performing a method as described in the first aspect or any possible implementation thereof.
[0039] Fifthly, a computer-readable storage medium is provided, including computer program instructions that, when executed by a computing device, perform a method as described in the first aspect or any possible implementation thereof.
[0040] In a sixth aspect, a computer program product comprising instructions is provided, which, when executed by a computing device, cause the computing device to perform a method as described in the first aspect or any possible implementation thereof. Attached Figure Description
[0041] Figure 1A This is a schematic diagram of the structure of a message transmission system provided in an embodiment of this application;
[0042] Figure 1B This is a schematic diagram of another message transmission system provided in an embodiment of this application;
[0043] Figure 1C This is a schematic diagram of another message transmission system provided in an embodiment of this application;
[0044] Figure 2 This is a flowchart illustrating a message transmission method provided in an embodiment of this application;
[0045] Figure 3 This is a schematic diagram of a MUX state machine standard provided in an embodiment of this application;
[0046] Figure 4 This is a schematic diagram illustrating the link state switching relationship of a link according to an embodiment of this application;
[0047] Figure 5 This is a schematic diagram of the structure of a message transmission device provided in an embodiment of this application;
[0048] Figure 6 This is a schematic diagram of the structure of a network device provided in an embodiment of this application. Detailed Implementation
[0049] The embodiments of this application are described below with reference to the accompanying drawings.
[0050] Before introducing the embodiments of this application, let's briefly introduce the concepts and relationships of link aggregation groups and cross-device link aggregation groups.
[0051] Link aggregation group (LAG) is used to aggregate multiple physical links of a network device into a single logical link, enabling these physical links to work simultaneously, achieving load sharing and redundancy backup, thereby improving network reliability.
[0052] A multi-chassis-link aggregation group (MC-LAG) is used to aggregate the Link Aggregators (LAGs) of multiple network devices, enabling these devices to synchronize their status and information via peer-to-peer links. This allows the LAGs of these network devices to negotiate link aggregation with peer devices as a single communication object. Multiple network devices managed by the same MC-LAG are designated as primary and backup nodes. The primary node is responsible for transmitting packets. Backup nodes are typically in hot standby mode, ready to take over the primary node's work and continue transmitting packets at any time.
[0053] In this application embodiment, three message transmission systems will be used as examples to describe the message transmission method provided in this application embodiment. The first message transmission system, the second message transmission system, and the third message transmission system can all be used to transmit messages. The first message transmission system can be found in [link to relevant documentation]. Figure 1A And an introduction to related content. For the second type of message transmission system, please refer to... Figure 1B And an introduction to related content. For a third type of message transmission system, please refer to... Figure 1C And an introduction to related content.
[0054] (I) The first type of message transmission system
[0055] See Figure 1A , Figure 1A This is a schematic diagram of the structure of a message transmission system provided in an embodiment of this application. For example... Figure 1A As shown, the message transmission system 10 includes network device 11 and network device 12. Network device 11 and network device 12 can communicate with each other via wired or wireless means.
[0056] exist Figure 1A In this configuration, both network device 11 and network device 12 are used to transmit messages. The messages transmitted between network device 11 and network device 12 can be generated by either network device 11 or network device 12, or by other terminal devices or network devices besides network device 11 and network device 12. Network device 11 or network device 12 can be, for example, a switch, router, load balancer, or fiber optic communication equipment (such as fiber optic switches, fiber optic splitters), etc.
[0057] exist Figure 1AIn this diagram, links 131, 132, and 133, which transmit messages between network device 11 and network device 12, form LAG 13. LAG 13 corresponds to both network device 11 and network device 12. When LAG 13 corresponds to network device 11, it specifically corresponds to the three ports on network device 11 used for transmitting messages with network device 12. When LAG 13 corresponds to network device 12, it specifically corresponds to the three ports on network device 12 used for transmitting messages with network device 11.
[0058] It should be understood that the LAG between network device 11 and network device 12 is based on Figure 1A The LAG 13 shown is illustrated using three links as an example. In practical applications, the number of links in the LAG between network device 11 and network device 12 can be more or less, and this application does not make a specific limitation.
[0059] Currently, the link switching mechanism applied to the first type of message transmission system is clumsy in complex and ever-changing network fault scenarios and cannot provide switching behavior adapted to different scenarios, as follows:
[0060] When a link switching mechanism is not deployed between multiple links in the LAG of the first type of message transmission system, as long as the link is not interrupted, regardless of the abnormality (such as bit error) that occurs on the link, the abnormal link will continue to be used to transmit messages. This will cause a degraded message transmission quality and continuously damage the service.
[0061] When a link switching mechanism is deployed between multiple links in the LAG of the first type of message transmission system, if a link malfunctions, it is not allowed to continue transmitting messages on that link. When the number of normal links in the LAG falls below the minimum number of active links, the LAG is also not allowed to continue transmitting messages. This will cause a sudden interruption of message transmission, directly disrupting service. For a description of the minimum number of active links, please refer to the LAG-related protocol standard IEEE 802.3ad.
[0062] (II) Second type of message transmission system
[0063] See Figure 1B , Figure 1B This is a schematic diagram of another message transmission system provided in an embodiment of this application. For example... Figure 1B As shown, the message transmission system 20 includes network device 21, network device 22, and network device 23. Network device 21 and network device 22 synchronize their respective status and information via a peer-to-peer link 24. Communication between network device 21 and network device 23, and between network device 22 and network device 23, can be achieved via wired or wireless means.
[0064] exist Figure 1B In this process, network device 21 transmits messages with network device 23, and network device 22 transmits messages with network device 23. Taking the message transmitted between network device 21 and network device 23 as an example, the message transmitted between network device 21 and network device 23 can be generated by network device 21 or network device 23, or it can be generated by other terminal devices or network devices other than network device 21 and network device 23.
[0065] exist Figure 1B In this diagram, links 251, 252, and 253, which transmit messages between network device 21 and network device 23, form LAG 25. LAG 25 corresponds to both network device 21 and network device 23. When LAG 25 corresponds to network device 21, it specifically corresponds to the three ports on network device 21 used for transmitting messages with network device 23. When LAG 25 corresponds to network device 23, it specifically corresponds to the three ports on network device 23 used for transmitting messages with network device 21.
[0066] exist Figure 1B In this diagram, links 261, 262, and 263, which transmit messages between network device 22 and network device 23, form LAG 26. LAG 26 corresponds to both network device 22 and network device 23. When LAG 26 corresponds to network device 22, it specifically corresponds to the three ports on network device 22 used for transmitting messages with network device 23. When LAG 26 corresponds to network device 23, it specifically corresponds to the three ports on network device 23 used for transmitting messages with network device 22.
[0067] exist Figure 1B In this configuration, MC-LAG 27 aggregates LAG 25 and LAG 26, enabling them to negotiate link aggregation with network device 23 as a single communication target. MC-LAG 27 also manages network devices 21 and 22. When network device 21, managed by MC-LAG 27, acts as the master node, it is the device currently transmitting packets and is responsible for transmitting the current packets. Meanwhile, network device 22, managed by MC-LAG 27, acts as a backup node, ready to take over the work of network device 21 and continue transmitting packets.
[0068] It should be understood that the second type of message transmission system is based on Figure 1BThe message transmission system 20 shown is illustrated with two network devices transmitting messages with the same network device, and the LAG between any two network devices transmitting messages includes three links. In practical applications, the number of network devices transmitting messages with the same network device can be more, and the number of MC-LAG aggregated LAGs will also be more. The number of links in the LAG between two network devices transmitting messages can also be more or less. This application does not make specific limitations.
[0069] (III) Third Message Transmission System
[0070] See Figure 1C , Figure 1C This is a schematic diagram of another message transmission system provided in an embodiment of this application. For example... Figure 1C As shown, the message transmission system 30 includes network device 31, network device 32, network device 33, and network device 34. Network device 31 and network device 32 synchronize their respective status and information via a peer-to-peer link 351. Network device 33 and network device 34 synchronize their respective status and information via a peer-to-peer link 352. Communication between network device 31 and network device 33, and between network device 32 and network device 34, can be achieved via wired or wireless means.
[0071] exist Figure 1C In this process, network device 31 transmits messages with network device 33, and network device 32 transmits messages with network device 34. Taking the message transmitted between network device 31 and network device 33 as an example, the message transmitted between network device 31 and network device 33 can be generated by network device 31 or network device 33, or it can be generated by other terminal devices or network devices other than network device 31 and network device 33.
[0072] exist Figure 1C In this diagram, links 361, 362, and 363, which transmit messages between network device 31 and network device 33, form LAG 36. LAG 36 corresponds to both network device 31 and network device 33. When LAG 36 corresponds to network device 31, it specifically corresponds to the three ports in network device 31 used for transmitting messages with network device 33. When LAG 36 corresponds to network device 33, it specifically corresponds to the three ports in network device 33 used for transmitting messages with network device 31.
[0073] exist Figure 1CIn this diagram, links 364, 365, and 366, which transmit messages between network device 32 and network device 34, form LAG 37. LAG 37 corresponds to both network device 32 and network device 34. When LAG 37 corresponds to network device 32, it specifically corresponds to the three ports on network device 32 used for transmitting messages with network device 34. When LAG 37 corresponds to network device 34, it specifically corresponds to the three ports on network device 34 used for transmitting messages with network device 32.
[0074] exist Figure 1C In this configuration, MC-LAG 38 aggregates LAG 36 and LAG 37, enabling them to negotiate link aggregation with network devices 33 and 34 as a single communication object. MC-LAG 38 also manages network devices 31 and 32. When network device 31, managed by MC-LAG 38, acts as the master node, it is the device currently transmitting packets and is responsible for transmitting the current packets. Meanwhile, network device 32, managed by MC-LAG 38, acts as a backup node, ready to take over the work of network device 31 and continue transmitting packets.
[0075] It should be understood that the third type of message transmission system is based on Figure 1C The message transmission system 30 shown has two groups of network devices transmitting messages, and the LAG between the network devices in the same group of message transmission includes three links as an example. In actual applications, the number of network devices transmitting messages can be more, and the number of MC-LAG aggregated LAGs will also be more. The number of links in the LAG between the network devices in the same group of message transmission can also be more or less. This application does not make specific limitations.
[0076] Currently, the link switching mechanisms applied to the second or third message transmission system are cumbersome in complex and ever-changing network fault scenarios, and cannot provide switching behavior adapted to different scenarios, as detailed below:
[0077] When no link switching mechanism is deployed between multiple LAGs managed by MC-LAG, as long as the links in the master node's LAG are not interrupted, regardless of the type of anomaly (such as bit errors) on that link, the faulty link will continue to be used to transmit packets until the number of uninterrupted links in the master node's LAG falls below the minimum number of active links. Only then will one of the backup nodes be notified to take over the master node's work to continue transmitting packets. This will cause a degraded packet transmission quality and continuously damage services.
[0078] When a link switching mechanism is deployed between multiple LAGs managed by MC-LAG, if a link in the primary node's LAG becomes abnormal, that link is not allowed to continue transmitting packets. When the number of normal links in the primary node's LAG falls below the minimum number of active links, the primary node is not allowed to continue transmitting packets; instead, one of the backup nodes is notified to take over the primary node's work. If, after using a backup node to transmit packets, the number of normal links in the backup node's LAG falls below the minimum number of active links, that backup node is not allowed to continue transmitting packets. When all backup nodes are not allowed to be used for packet transmission, it will cause a sudden interruption of packet transmission, directly disrupting service.
[0079] In summary, existing link switching mechanisms cannot provide switching behavior that is compatible with all scenarios. Using existing mechanisms can lead to unreasonable switching behavior in many scenarios, causing unnecessary losses for users. For example, in the first type of message transmission system, if a link switching mechanism is deployed between multiple links in the same LAG, even if most links in that LAG only experience bit errors, the number of normal links in that LAG will fall below the minimum number of active links, causing direct service interruption.
[0080] It should be noted that the application scenarios of the message transmission method provided in this application are not limited to the first to third message transmission systems described above. All scenarios in which the message transmission method provided in this application can be applied are within the protection scope of this application.
[0081] The following describes a message transmission method provided by an embodiment of this application, which can be applied to any of the message transmission systems described above. When the message transmission method is applied to the above... Figure 1A When the message transmission system is 10, the following Figure 2 Each step in the message transmission method is performed by the network device 11 in the message transmission system 10. When the message transmission method is applied to the above... Figure 1B When the message transmission system is at 20, the following Figure 2 Each step in the message transmission method is performed by network device 21 in message transmission system 20, or, as follows: Figure 2 Each step in the message transmission method is performed by the network device 22 in the message transmission system 20. When the message transmission method is applied to the above... Figure 1C When the message transmission system is 30, the following Figure 2 Each step in the message transmission method is performed by the network device 31 in the message transmission system 30, or, as follows: Figure 2 Each step in the message transmission method is performed by the network device 32 in the message transmission system 30.
[0082] See Figure 2 , Figure 2 This is a flowchart illustrating a message transmission method provided in an embodiment of this application. Figure 2 As shown, the method may include, but is not limited to, the following steps:
[0083] S201: Obtain the link status of at least one link in the first link set.
[0084] In some possible application scenarios, the first link set includes one or more LAGs, and each LAG includes multiple links. The specific links included in the first link set depend on the type of message transmission system. When there is only one LAG in the message transmission system, the first link set is that LAG, and the first link set specifically includes all links in that LAG. When there are multiple LAGs in the message transmission system, and these LAGs are managed by the same MC-LAG, the first link set includes all LAGs managed by that MC-LAG, and the first link set specifically includes all links in all LAGs managed by that MC-LAG.
[0085] In some possible implementations, when the first device obtains the link status of at least one link in the first link set, if the link to be obtained is a link in the first LAG corresponding to the first device, then the first device can obtain the link status of the link by monitoring the link; if the link to be obtained is a link in the second LAG corresponding to the second device, and the second device and the first device are different devices, the second LAG and the first LAG are different LAGs, and the second LAG and the first LAG are managed by the same MC-LAG, then the first device receives the link status of the link sent by the second device through a peer-to-peer link.
[0086] In some possible implementations, the link state of the aforementioned link is determined based on the link's performance metrics. The link state belongs to a set of states, which includes at least a first state, a second state, and a third state. Specifically, the first state indicates that the link's performance metrics are better than a first reference performance metric; the second state indicates that the link's performance metrics are worse than the first reference performance metric but better than the second reference performance metric; and the third state indicates that the link's performance metrics are worse than the second reference performance metric.
[0087] The aforementioned performance metrics include one or more of the following: bit error rate (BER), packet loss rate (PFR), latency, and jitter. BER refers to the proportion of erroneous bits received at one port of a link during data packet transmission. A lower BER indicates better link quality; a higher BER indicates worse link quality. PFR refers to the ratio of lost data packets to transmitted data packets on a link during transmission. A lower PFR indicates better link quality; a higher PFR indicates worse link quality. Latency refers to the total time it takes for a data packet to travel from one port of a link to another during transmission, including transmission delay, queuing delay, and processing delay. Lower latency indicates better link quality; higher latency indicates worse link quality. Jitter refers to the variation or fluctuation in the time interval between data packets arriving at the same port of a link during transmission. Low jitter indicates stable data packet arrival times, while high jitter indicates unstable data packet arrival times. Therefore, lower jitter indicates better link quality, and higher jitter indicates worse link quality. The first and second reference performance metrics depend on the communication protocol in the message transmission system. Different communication protocols result in different values for the first and second reference performance metrics. The specific values of the first and second reference performance metrics can be determined by the user.
[0088] Taking link performance metrics including bit error rate and packet loss rate as an example, the first reference performance metric also includes bit error rate and packet loss rate, and the second reference performance metric also includes bit error rate and packet loss rate. Assume the first reference performance metric includes a bit error rate of 10. -6 The packet loss rate is 5%, and the second reference performance indicator includes a bit error rate of 10%. -3 The packet loss rate is 50%. Therefore, when the bit error rate of a link is less than 10... -6 When the packet loss rate is less than 5%, the performance index of the link is considered to be better than the first reference performance index, and the link state corresponds to the first state. When the bit error rate of a link is greater than 10... -3 If the packet loss rate is greater than 50%, the performance metric of the link is considered inferior to the second reference performance metric, and the link state corresponds to the third state. Otherwise, the performance metric of the link is considered inferior to the first reference performance metric but superior to the second reference performance metric, and the link state corresponds to the second state.
[0089] It should be understood that the above is an example of link performance indicators including bit error rate and packet loss rate. When the link performance indicators only include bit error rate or packet loss rate, the first reference performance indicator and the second reference performance indicator will also only include bit error rate or packet loss rate. When the link performance indicators also include other performance indicators (such as latency, jitter, etc.), the first reference performance indicator and the second reference performance indicator will also include other performance indicators. This application does not make specific limitations.
[0090] It should be understood that the above description assumes the state set includes a first state, a second state, and a third state. In practical applications, the number of states in the state set can be greater. For example, in application scenarios where the transmission quality of the link is unstable and various failures occur during transmission, the link state can be further divided into a first state, a second state, a third state, and a fourth state, meaning the state set includes four elements. In this case, the third state indicates that the link's performance indicator is worse than the second reference performance indicator but better than the third reference performance indicator; the fourth state indicates that the link's performance indicator is worse than the third reference performance indicator. It is understood that the number of states in the state set can be determined based on the actual application scenario, and this application does not impose specific limitations.
[0091] S202: Determine whether to use the first subset of links to transmit messages based on the link status of at least one link.
[0092] In some possible implementations, when the first device acquires at least one link that belongs to the first LAG, the first device can determine whether to use the first link subset to transmit the message based on the link status of the links belonging to the first LAG. The specific process is as follows:
[0093] The first device compares the number of links in the first LAG that are in the first state with the minimum number of active links in the first LAG.
[0094] If the number of links in the first LAG that are in the first state is greater than or equal to the minimum number of active links in the first LAG, then the first device will use the links in the first LAG that are in the first state as the first link subset and determine to use the first link subset to transmit messages.
[0095] If the number of links in the first LAG that are in the first state is less than the minimum number of active links in the first LAG, then the first device compares the sum of the number of links in the first state and the number of links in the second state in the first LAG with the minimum number of active links in the first LAG.
[0096] If the sum of the number of links in the first state and the number of links in the second state in the first LAG is greater than or equal to the minimum number of active links in the first LAG, then the first device will use the links in the first state and the links in the second state in the first LAG as a first link subset, and determine to use the first link subset to transmit messages.
[0097] If the sum of the number of links in the first state and the number of links in the second state in the first LAG is less than the minimum number of active links in the first LAG, then the first device determines not to use the links of the first LAG to transmit messages, that is, the first device determines not to use the first subset of links to transmit messages.
[0098] As can be seen from the above, all links in the first link subset belong to the first LAG, that is, the links in the first link subset belong to the same LAG among one or more LAGs included in the first link set.
[0099] In some potential application scenarios, the first device may obtain the link status of the first LAG (Link Status Group) in different ways. These different methods will affect the specific links included in the first link subset in different comparison results. Specific methods can be found in Method 1 and Method 2 below.
[0100] Acquisition Method 1: Each time the first device acquires a link in a certain state within the first LAG, it increments the number of links in that state by 1 and compares the incremented number with the minimum number of active links in the first LAG to determine whether to use the first link subset for packet transmission and to determine the specific links included in the first link subset. The specific process is as follows:
[0101] For each link in the first LAG that is in the first state, the first device increments the number of links in the first LAG that are in the first state by 1, and compares the incremented result with the minimum number of active links in the first LAG.
[0102] If the first accumulated result equals the minimum number of active links in the first LAG, it indicates that the number of links in the first LAG in the first state is equal to the minimum number of active links in the first LAG. In this case, the first device will use the links in the first state that have already been acquired in the first LAG as a first subset of links and determine to use this first subset of links to transmit messages. Furthermore, the first device may stop acquiring the link status of the remaining links in the first LAG.
[0103] If, after the first device obtains the link status of all links in the first LAG, the first accumulated result is still less than the minimum number of active links in the first LAG, it indicates that the number of links in the first LAG in the first state is less than the minimum number of active links in the first LAG. Then, the first device adds the number of links in the first LAG in the second state to the first accumulated result to obtain the second accumulated result, and then compares the second accumulated result with the minimum number of active links in the first LAG.
[0104] If the second cumulative result is greater than or equal to the minimum number of active links in the first LAG, it indicates that the sum of the number of links in the first state and the number of links in the second state in the first LAG is greater than or equal to the minimum number of active links in the first LAG. In this case, the first device uses all links in the first state and all links in the second state in the first LAG as a first link subset and determines to use this first link subset to transmit messages. Alternatively, the first device uses all links in the first state and some links in the second state in the first LAG as a first link subset and determines to use this first link subset to transmit messages. Or, the first device uses some links in the first state and some links in the second state in the first LAG as a first link subset and determines to use this first link subset to transmit messages. In all three cases, the number of links in the first link subset must be greater than or equal to the minimum number of active links in the first LAG.
[0105] If the second cumulative result is still less than the minimum number of active links in the first LAG, it indicates that the sum of the number of links in the first state and the number of links in the second state in the first LAG is less than the minimum number of active links in the first LAG. In this case, the first device determines not to use the links of the first LAG to transmit messages, that is, the first device determines not to use the first subset of links to transmit messages.
[0106] Method 2: The first device directly obtains the link status of all links in the first LAG, and then compares the number of links in a certain state in the first LAG with the minimum number of active links in the first LAG to determine whether to use the first link subset to transmit packets, and to determine the specific links included in the first link subset. The specific process is as follows:
[0107] First, the first device directly obtains the link status of all links in the first LAG, and determines the number of links in the first LAG in the first state (i.e., the first cumulative result) and the sum of the number of links in the first LAG in the first state and the number of links in the second state (i.e., the second cumulative result).
[0108] Next, the first device compares the first accumulated result with the minimum number of active links in the first LAG.
[0109] If the first accumulated result is greater than or equal to the minimum number of active links in the first LAG, then the first device will use all links in the first LAG that are in the first state as the first link subset and determine to use this first link subset to transmit messages. Alternatively, the first device will use some links in the first LAG that are in the first state as the first link subset and determine to use this first link subset to transmit messages. In this case, the number of links in the first link subset must be greater than or equal to the minimum number of active links in the first LAG.
[0110] If the first accumulated result is less than the minimum number of active links of the first LAG, then the first device compares the second accumulated result with the minimum number of active links of the first LAG.
[0111] If the second cumulative result is greater than or equal to the minimum number of active links in the first LAG, then the first device will use all links in the first LAG that are in the first state and all links in the second state as a first link subset, and determine to use this first link subset to transmit messages. Alternatively, the first device will use all links in the first LAG that are in the first state and some links in the second state as a first link subset, and determine to use this first link subset to transmit messages. Or, the first device will use some links in the first LAG that are in the first state and some links in the second state as a first link subset, and determine to use this first link subset to transmit messages. In all three cases, the number of links in the first link subset must be greater than or equal to the minimum number of active links in the first LAG.
[0112] If the second cumulative result is less than the minimum number of active links in the first LAG, then the first device determines not to use the links of the first LAG to transmit messages, that is, the first device determines not to use the first subset of links to transmit messages.
[0113] It should be understood that the execution process of step S202 described above is a specific procedure when the state set includes a first state, a second state, and a third state. When the number of states in the state set is larger, such as when the state set includes a first state, a second state, a third state, and a fourth state, if the sum of the number of links in the first state and the number of links in the second state in the first LAG is less than the minimum number of active links in the first LAG, the first device can either directly determine not to use the links in the first LAG to transmit messages, or it can compare the sum of the number of links in the first state, the second state, and the third state in the first LAG with the minimum number of active links in the first LAG. If the sum of the number of links in the first state, the second state, and the third state in the first LAG is greater than or equal to the minimum number of active links in the first LAG, then the first device will use these links as a first subset of links and determine to use this first subset of links to transmit messages. If the sum of the number of links in the first state, the second state, and the third state in the first LAG is less than the minimum number of active links in the first LAG, then the first device will determine not to use the links in the first LAG to transmit messages, that is, it will determine not to use the first subset of links to transmit messages. Although the transmission quality of links in the third state is inferior to that of links in the second state, this will lead to a further decrease in transmission quality when using the first subset of links containing links in the first, second, and third states to transmit messages, further increasing service loss, but it is still less than the loss caused to the user by directly interrupting transmission.
[0114] It should be understood that the more states in the state set, the more complex the process of determining whether to use the first link subset for message transmission becomes, and the more ways there are to combine links in the first link subset. In this technical solution, the process of determining whether to use the first link subset for message transmission can be set by the user as needed according to the actual application scenario, network requirements, and service requirements, and this application does not impose specific limitations.
[0115] In summary, existing solutions rely solely on two link states (normal and abnormal) for link switching, typically selecting only links in the normal state for data transmission. When the number of normal links falls short, data transmission is directly interrupted, leading to service disruption. This solution offers a more granular classification of link states. For example, it categorizes link states into first, second, and third states based on performance metrics, allowing for a more precise representation of current transmission quality. This finely defined link state allows for more link combinations, accommodating a wider range of network failure scenarios and providing a more flexible switching strategy. This makes it easier to select the primary subset of links for data transmission, minimizing service interruptions.
[0116] Specifically, when the number of links in the first LAG in the first state (i.e., links representing good transmission quality) meets the minimum transmission requirement (i.e., the minimum number of active links in the first LAG), this solution provides the following transmission scheme: directly use these links with good transmission quality to transmit messages. This provides the best transmission quality. Even if the number of links with good transmission quality in the first LAG does not meet the minimum transmission requirement, this solution can still provide a transmission scheme that avoids service interruption: if the sum of the number of links in the first state and the number of links in the second state (i.e., links representing poor transmission quality) in the first LAG is greater than or equal to the minimum number of active links, then use both the links in the first state and the links in the second state in the first LAG to transmit messages. Although using links in the second state to transmit messages will degrade transmission quality and impair service, the loss to users due to the degraded transmission quality is smaller than the loss caused by a direct interruption of transmission.
[0117] When the first device is a different device in a different message transmission system, the process of the first device performing step S201, the process of performing step S202, and the actions performed after completing step S202 are all different.
[0118] The following will continue with the aforementioned... Figure 1A Message transmission system 10 Figure 1B Message transmission system 20 Figure 1C The message transmission system 30 serves as different message transmission systems, with the first device as the first device. Figure 1A Network device 11 in message transmission system 10 Figure 1B Network device 21 in message transmission system 20 Figure 1B Network device 22 in message transmission system 20 Figure 1C Network device 31 in message transmission system 30 Figure 1CThe network device 32 in the message transmission system 30 serves as an example of different devices, and describes the actions performed by the first device in different message transmission systems, including: (i) message transmission of the first device in a single LAG scenario; and (ii) message transmission of the first device in a multi-LAG scenario.
[0119] (I) Message transmission of the first device in a single LAG scenario
[0120] When the first device is the aforementioned Figure 1A When the network device 11 in the message transmission system 10 is used, the first link set is the first LAG, specifically LAG 13 in the message transmission system 10. The first link set includes link 131, link 132 and link 133 in LAG 13.
[0121] The first device performs the aforementioned Figure 2 The processes of steps S201 and S202 in the message transmission method are as follows:
[0122] The first device monitors links 131, 132, and 133 in LAG 13 respectively, and can then obtain the link status of links 131, 132, and 133 respectively.
[0123] If the first device adopts acquisition method 1 in step S202, the first device sequentially acquires the link status of link 131, link 132, and link 133. For each acquired link status, the first device updates the link status result in LAG 13, then compares the updated link status result in LAG 13 with the minimum number of active links in LAG 13 to determine whether to continue acquiring the link status of other links in LAG 13, determine the specific links included in the first link subset, and determine whether to use the first link subset to transmit messages.
[0124] If the first device adopts acquisition method 2 in step S202, the first device directly acquires the link status of link 131, link 132 and link 133, then determines the link status result in LAG 13 based on the link status of link 131, link 132 and link 133, and then compares the link status result in LAG 13 with the minimum number of active links in LAG 13 to determine the specific links included in the first link subset, and to determine whether to use the first link subset to transmit messages.
[0125] Regardless of the acquisition method used, when the minimum number of active links in LAG 13 is 2, and the state set includes the first, second, and third states, the resulting link states in LAG 13 will fall into one of the following four categories:
[0126] Case 1: At least two of links 131, 132, and 133 are in the first state.
[0127] Case 2: One of the links 131, 132, and 133 is in the first state, and at least one of the links is in the second state;
[0128] Case 3: At least two of links 131, 132, and 133 are in the second state, and none of the links are in the first state.
[0129] Case 4: At least two of the links 131, 132, and 133 are in the third state.
[0130] The process by which the first device determines the specific links included in the first link subset and whether to use the first link subset to transmit messages based on the link status results in LAG 13 of the above four situations is as follows:
[0131] In scenario 1 above, if the number of links in LAG 13 in the first state is greater than or equal to 2, then the first device will use all links in LAG 13 in the first state as the first link subset, or use two links in LAG 13 in the first state as the first link subset, and determine to use the first link subset to transmit the message. In this scenario, the first device can guarantee transmission quality by using the first link subset to transmit the message.
[0132] In scenario 2 above, if the number of links in LAG 13 in the first state is less than 2, and the sum of the number of links in the first state and the number of links in the second state in LAG 13 is greater than or equal to 2, then the first device will use all links in the first state and all links in the second state in LAG 13 as the first link subset, or use all links in the first state and some links in the second state in LAG 13 as the first link subset, as long as the number of links in the first link subset is greater than or equal to 2, and will determine to use the first link subset to transmit messages. Compared to the scenario in scenario 1 above, in this scenario, the first device will inevitably use links in the second state to transmit messages when using the first link subset. Although this will degrade transmission quality and impair services, the loss to users caused by the degraded transmission quality is smaller than the loss caused by directly interrupting transmission.
[0133] In scenario 3 above, if the number of links in LAG 13 in the first state is less than 2, and the sum of the number of links in the first state and the number of links in the second state in LAG 13 is greater than or equal to 2, then the first device will use all links in LAG 13 in the second state as the first link subset, or use two links in LAG 13 in the second state as the first link subset, and determine to use the first link subset to transmit messages. Compared to the scenario in scenario 2 above, the first device will use more links in the second state to transmit messages in this scenario, which will further degrade the transmission quality and increase service loss, but it is still less than the loss caused to the user by directly interrupting the transmission.
[0134] In scenario 4 above, if the sum of the number of links in the first state and the number of links in the second state in LAG 13 is less than 2, then the first device determines not to use the links in LAG 13 to transmit messages, i.e., it will not use the first subset of links to transmit messages. In this scenario, the first device will directly interrupt transmission by not using the first subset of links to transmit messages.
[0135] It should be understood that the minimum number of active links in LAG 13 being 2, the total number of links in LAG 13 being three, and the state set including three states are merely examples. In practical applications, the minimum number of active links in LAG 13 can be larger or smaller, the number of links in LAG 13 can be more or less, and the number of states in the state set can be more. This application does not impose specific limitations. When the minimum number of active links in LAG 13, the number of links in LAG 13, and the number of states in the state set change, the process by which the first device determines the specific links included in the first link subset based on the state results of the links in LAG 13 and determines whether to use the first link subset to transmit messages is similar to the example above. For the sake of brevity, it will not be elaborated further here.
[0136] In the message transmission system 10, after the first device determines whether to use the first link subset to transmit messages based on the link status of at least one link, the first device synchronizes the determination result of the first device for the first LAG with the peer device (i.e., the network device 12 in the message transmission system 10), thereby ensuring the consistency of behavior between the first device and the peer device.
[0137] The following example uses a specific scenario to illustrate the synchronization mechanism between the first device and the peer device when the first device determines to use the first link subset to transmit messages.
[0138] Assuming the minimum number of active links in LAG 13 is 2, and the link states of links 131, 132, and 133 in LAG 13 are all in the first state, respectively. In this scenario, the first device determines to use a first subset of links to transmit packets, which includes links 131 and 132 but excludes link 133. Therefore, the first device needs to synchronize the states of links 131, 132, and 133 with the peer device. The state of link 131 indicates that packet transmission via link 131 is enabled, the state of link 132 indicates that packet transmission via link 132 is enabled, and the state of link 133 indicates that packet transmission via link 133 is disabled. Enabling packet transmission via a link requires setting both ports corresponding to that link to the selected state; disabling packet transmission via a link requires setting both ports corresponding to that link to the unselected state.
[0139] The synchronization method from the first device to the peer device can be referred to as (1) the first synchronization method to (4) the fourth synchronization method.
[0140] (1) First synchronization method
[0141] When the first device synchronizes the state of link 131 with the peer device, the first device sends a Link Aggregation Control Protocol (LACP) negotiation message with both the aggregation and synchronization status bits set to 1 to the corresponding port on the peer device via the port corresponding to link 131. Additionally, the first device sets the port corresponding to link 131 to the SELECTED state. The peer device receives the LACP negotiation message, retrieves the specific values of the aggregation and synchronization status bits, and compares these values with the multiplexer (MUX) state machine standard to determine whether to set the port corresponding to link 131 to the SELECTED state.
[0142] When the first device synchronizes the state of link 132 with the peer device, the first device sends an LACP negotiation message with both the aggregation and synchronization status bits set to 1 to the corresponding port on the peer device via the port corresponding to link 132. Additionally, the first device sets the port corresponding to link 132 to the SELECTED state. The peer device receives the LACP negotiation message, retrieves the specific values of the aggregation and synchronization status bits from the message, and compares these values with the MUX state machine standard to determine whether to set the port corresponding to link 132 to the SELECTED state.
[0143] When the first device synchronizes the state of link 133 with the peer device, the first device sends an LACP negotiation message with both the aggregation and synchronization status bits set to 0 to the corresponding port on the peer device via the port corresponding to link 133. Additionally, the first device sets the port corresponding to link 133 to the UNSELECTED state. The peer device receives the LACP negotiation message, retrieves the specific values of the aggregation and synchronization status bits from the message, and compares these values with the MUX state machine standard to determine whether to set the port corresponding to link 133 to the UNSELECTED state.
[0144] In the LACP message, for the link aggregation status bit, a value of 1 indicates that the link can be aggregated; a value of 0 indicates that the link is independent, meaning it can only operate as an individual link. For the synchronization status bit, a value of 1 indicates that the link has been assigned to the correct link aggregation group; a value of 0 indicates that the link is not currently in the correct link aggregation group. For details on the MUX state machine standard, please refer to [link to relevant documentation]. Figure 3 , Figure 3 This is a schematic diagram of a MUX state machine standard provided in an embodiment of this application.
[0145] (2) Second synchronization method
[0146] When the first device synchronizes the status of link 131 with the peer device, the process of synchronizing the link status of link 131 with the peer device in the first synchronization method described in (1) above can be referred to. For the sake of brevity, the process will not be elaborated here.
[0147] When the first device synchronizes the status of link 132 with the peer device, the process of synchronizing the link status of link 132 with the peer device in the first synchronization method described in (1) above can be referred to. For the sake of brevity, the process will not be elaborated here.
[0148] When the first device synchronizes the status of link 133 with the peer device, the first device stops sending LACP negotiation messages through the port corresponding to link 133 to the corresponding port on the peer device. Additionally, the first device sets the port corresponding to link 133 to the UNSELECTED state. If the port corresponding to link 133 on the peer device does not receive any LACP negotiation messages within the agreed time period, the peer device will then set the port corresponding to link 133 to the UNSELECTED state.
[0149] (3) The third synchronization method
[0150] When the first device synchronizes the status of link 131 with the peer device, the process of synchronizing the link status of link 131 with the peer device in the first synchronization method described in (1) above can be referred to. For the sake of brevity, the process will not be elaborated here.
[0151] When the first device synchronizes the status of link 132 with the peer device, the process of synchronizing the link status of link 132 with the peer device in the first synchronization method described in (1) above can be referred to. For the sake of brevity, the process will not be elaborated here.
[0152] When the first device synchronizes the status of link 133 with the peer device, it combines the first and second synchronization methods described above for notification. Specifically, the first device first sends an LACP negotiation message with both the aggregation and synchronization status bits set to 0 to the corresponding port on the peer device via the port corresponding to link 133. Then, it stops sending LACP negotiation messages to the corresponding port on the peer device via the port corresponding to link 133. For example, the first device first sends three consecutive LACP negotiation messages to the corresponding port on the peer device via the port corresponding to link 133, and then stops sending LACP negotiation messages. In addition, the first device sets the port corresponding to link 133 to the UNSELECTED state.
[0153] If the peer device supports LACP, after receiving the LACP negotiation message and obtaining the specific values of the aggregation and synchronization status bits from the LACP negotiation message, the peer device will compare the specific values of the aggregation and synchronization status bits with the MUX state machine standard to determine whether to set the port corresponding to link 133 to the UNSELECTED state.
[0154] If the peer device does not support LACP but supports its extended protocol, and the extended protocol instructs the peer device not to set the state of the port corresponding to link 133 according to the specific values of the aggregation and synchronization status bits in the LACP negotiation message even if it receives the LACP negotiation message, then the peer device will determine to set the port corresponding to link 133 to the UNSELECTED state if it does not receive the LACP negotiation message within the agreed time period.
[0155] (4) Fourth synchronization method
[0156] When the first device synchronizes the status of link 131 with the peer device, the first device sends a message carrying an enable flag to the corresponding port on the peer device through the port corresponding to link 131. This message can be, for example, an LACP negotiation message, an IPv6 message, or a TCP message. Additionally, the first device sets the port corresponding to link 131 to the SELECTED state. The peer device receives this message, obtains the enable flag from it, and thus determines to set the port corresponding to link 131 to the SELECTED state. The field carrying the enable flag in the message is determined by the user.
[0157] When the first device synchronizes the status of link 132 with the peer device, the first device sends a message carrying an enable flag to the corresponding port of link 132 on the peer device via the port corresponding to link 132. Additionally, the first device sets the port corresponding to link 132 to the SELECTED state. The peer device receives this message, obtains the enable flag from it, and thus determines that the port corresponding to link 132 should be set to the SELECTED state.
[0158] When the first device synchronizes the status of link 133 with the peer device, the first device sends a message carrying an inactive flag to the corresponding port on the peer device via the port corresponding to link 133. Additionally, the first device sets the port corresponding to link 133 to the UNSELECTED state. The peer device receives this message, obtains the inactive flag from it, and thus determines that the port corresponding to link 133 should be set to the UNSELECTED state. The field carrying the inactive flag in the message is determined by the user.
[0159] Optionally, the first device may also add a status identifier to the message carrying the (inactive) status identifier. The status identifier is used to indicate the link status. Specifically, when the first device synchronizes the status of link 131 with the peer device, it sends a message carrying the active status identifier and a first status identifier to the peer device; when the first device synchronizes the status of link 132 with the peer device, it sends a message carrying the active status identifier and a second status identifier to the peer device; when the first device synchronizes the status of link 133 with the peer device, it sends a message carrying the inactive status identifier and a second status identifier to the peer device. The field carrying the status identifier in the message is determined by the user.
[0160] The first synchronization method (1) has a fast state synchronization speed, enabling rapid notification and minimizing the impact on services. (2) The second synchronization method has a simple state synchronization process, making it easy to implement. (3) In the third synchronization method, for links in the second state but not belonging to the first link subset, the potential hidden danger of the peer device not performing corresponding actions even if it receives LACP negotiation messages due to supporting the extended protocol of LACP can be avoided. (4) The fourth synchronization method provides accurate state synchronization information, enabling the peer device to clearly know the specific status of each link.
[0161] It should be noted that the above-mentioned synchronization methods (1) to (4) are based on the following application scenario: the link state of link 131 is in the first state, the link state of link 132 is in the second state, the link state of link 133 is in the second state, the first device determines to use the first link subset to transmit the message, and the first link subset includes link 131 and link 132, but does not include link 133, as an example for illustration. This application scenario belongs to case 2 of the message transmission of the first device in the single LAG scenario mentioned above (a). Since the first device determines to use the first link subset to transmit messages in scenarios 1, 2, and 3, when the link state of any one of links 131, 132, and 133 is in the first state, but the first link subset does not include that link, the process of the first device synchronizing the link state of that link with the peer device can refer to the process of the first device synchronizing the link state of link 133 with the peer device in the first synchronization method (1), the second synchronization method (2), the third synchronization method (3), or the fourth synchronization method (4) described above. When the link state of any one of links 131, 132, and 133 is in the third state, the process of the first device synchronizing the link state of that link with the peer device can refer to the process of the first device synchronizing the link state of link 133 with the peer device in the first synchronization method (1) or the fourth synchronization method (4) described above.
[0162] It should be noted that when the application scenario is Case 4 in the message transmission of the first device in the single LAG scenario mentioned above (I), since the first device determines not to use the first link subset to transmit messages in Case 4, the process of the first device synchronizing the link status of link 131, link 132 or link 133 with the peer device can refer to the process of the first device synchronizing the link status of link 133 with the peer device in the first synchronization method of (1) or the fourth synchronization method of (4) mentioned above, or refer to the process of the first device synchronizing the link in the third state with the peer device in Case 1, Case 2 or Case 3 mentioned above.
[0163] In the message transmission system 10, the link state change of any of the links 131, 132 and 133 is related to both the first device (or the peer device) and the interference on the link.
[0164] The following explanation uses link 131 as an example and the state set including the first state, the second state, and the third state as examples to illustrate the reasons for the changes in the link state.
[0165] If link 131 is in state one at the first moment, from that moment onward, as time progresses, the chip on the first device gradually ages or experiences a sudden failure, causing its quality to deteriorate. This will affect the performance of the port corresponding to link 131 in the first device, resulting in decreased port performance. Deteriorated port performance leads to increased packet loss rate, increased packet processing time, and consequently increased latency of link 131. These problems will degrade the performance of link 131, causing its performance to fall from better than the first reference performance indicator to worse than it. If the performance of link 131 remains better than the second reference performance indicator, then link 131 is in state two. If the performance of link 131 falls below the second reference performance indicator, then link 131 is in state three. Alternatively, from the first moment onward, as time progresses, increased interference on link 131 will lead to increased bit error rate, increased latency, and increased jitter. These problems will also degrade the performance of link 131, causing its performance to fall from better than the first reference performance indicator to worse than it.
[0166] If link 131 is in the second state at the second time point, and from the second time point onwards, as time progresses, the chip on the first device continues to age or experiences sudden failures, resulting in poorer chip quality, the performance of the port corresponding to link 131 in the first device will further deteriorate, causing the performance index of link 131 to change from better than the second reference performance index to worse than the second reference performance index, then link 131 will be in the third state. Alternatively, from the second time point onwards, as time progresses, the interference on link 131 will continue to increase, also causing the performance index of link 131 to change from better than the second reference performance index to worse than the second reference performance index.
[0167] If link 131 is in state two at the third time point, and from the third time point onwards, the aging or faulty chip on the first device is replaced, the performance of the port corresponding to link 131 in the first device will improve, reducing the packet loss rate of transmitted packets, reducing the processing time of packets, and thus reducing the latency of link 131. This will optimize the performance of link 131, causing its performance to improve from being worse than the first reference performance indicator to being better than the first reference performance indicator, and link 131 will then be in state one. Alternatively, from the third time point onwards, as time progresses, the interference on link 131 decreases, which will also cause the performance of link 131 to improve from being worse than the first reference performance indicator to being better than the first reference performance indicator.
[0168] If link 131 is in state 3 at time 4, and from time 4 onwards, the aging or faulty chip on the first device is replaced, the performance of the port corresponding to link 131 in the first device will improve, reducing the packet loss rate and processing time of the transmitted packets, thus reducing the latency of link 131. This will optimize the performance of link 131, causing its performance to improve from being worse than the second reference performance indicator to being better than the first reference performance indicator, and link 131 will then be in state 1. Alternatively, from time 4 onwards, as time progresses, the interference on link 131 will decrease, also causing its performance to improve from being worse than the second reference performance indicator to being better than the second reference performance indicator. If the performance of link 131 remains better than the second reference performance indicator, link 131 will be in state 2. If the performance of link 131 is better than the first reference performance indicator, link 131 will be in state 1.
[0169] It should be understood that the reasons for the link state change of link 131 mentioned above also apply to links 132 and 133.
[0170] To better determine the current state of the link, a link state machine is set up in the first device. This link state machine is used to switch between the various states of the link. Continuing with link 131 as an example, and using a state set including the first, second, and third states, we will specifically introduce the process of switching between the various states of link 131 using the link state machine.
[0171] See Figure 4 , Figure 4 This is a schematic diagram of a link state switching relationship provided in an embodiment of this application.
[0172] In the message transmission system 10, the port corresponding to link 131 in the first device is called port A1, and the port corresponding to link 131 in the peer device of the first device is called port B1.
[0173] Initially, when link 131 was first added to LAG13, both ports A1 and B1 were in the off state. Therefore, the initial state of link 131 was the third state. The first device set port A1 to the on state, and the peer device set port B1 to the on state, enabling ports A1 and B1 to negotiate based on LACP.
[0174] If port A1 and port B1 successfully negotiate based on LACP, and there is no interference or minimal interference on link 131, and port A1 and port B1 have good performance, making the performance index of link 131 better than the first reference performance index, then the first device switches the link state of link 131 from the third state to the first state through the link state machine.
[0175] If port A1 and port B1 successfully negotiate based on LACP, and the interference on link 131 is large (or port A1 has poor performance, or port B1 has poor performance), causing the performance index of link 131 to be worse than the first reference performance index, but better than the second reference performance index, then the first device switches the link state of link 131 from the third state to the second state through the link state machine.
[0176] If link 131 is in the first state, packets can still be transmitted between port A1 and port B1 based on LACP. However, if there is significant interference on link 131 (or poor performance of port A1 or port B1), causing the performance index of link 131 to be worse than the first reference performance index but better than the second reference performance index, then the first device will switch the link state of link 131 from the first state to the second state through the link state machine.
[0177] If link 131 is in the first state, but port A1 and port B1 cannot transmit messages based on LACP (or the first device sets port A1 to the closed state, or the peer device sets port B1 to the closed state), causing the performance index of link 131 to be worse than the second reference performance index, then the first device switches the link state of link 131 from the first state to the third state through the link state machine.
[0178] If link 131 is in the second state, packets can still be transmitted between port A1 and port B1 based on LACP. However, if there is no interference or minimal interference on link 131, and the performance of ports A1 and B1 is good, making the performance index of link 131 better than the first reference performance index, then the first device will switch the link state of link 131 from the second state to the first state through the link state machine.
[0179] If link 131 is in the second state, but port A1 and port B1 cannot transmit messages based on LACP (or the first device sets port A1 to the closed state, or the peer device sets port B1 to the closed state), causing the performance index of link 131 to be worse than the second reference performance index, then the first device switches the link state of link 131 from the second state to the third state through the link state machine.
[0180] Furthermore, to identify whether a link belongs to the first subset of links, the link state machine is also used to add an enable or disable flag for the link in various link states. Continuing with the example of link 131 as the link and link 131 in the second state as the link state, the following describes in detail the process of setting the (disabled) enable flag of link 131 through the link state machine.
[0181] If link 131 is in the second state and link 131 belongs to the first subset of links, then the first device adds an enable flag to link 131 through the link state machine.
[0182] If link 131 is in the second state and link 131 does not belong to the first subset of links, then the first device adds an inactive flag to link 131 through the link state machine.
[0183] If link 131 has an enabled flag, after the first device removes link 131 from the first link subset, the first device switches the flag of link 131 from the enabled flag to the disabled flag through the link state machine.
[0184] If link 131 has an inactive flag, after the first device adds link 131 to the first link subset, the first device switches the flag of link 131 from inactive to active through the link state machine.
[0185] If link 131 is in the second state and has an inactive flag, and the first device synchronizes the link state of link 131 to the peer device using the second synchronization method (2) or the third synchronization method (3) mentioned above, then both port A1 and port B1 are in the closed state. Port A1 and port B1 cannot transmit messages based on LACP. The first device then switches the link state of link 131 from the second state to the third state through the link state machine. Subsequently, the first device sets port A1 to the open state, and the peer device sets port B1 to the open state, enabling port A1 and port B1 to negotiate based on LACP.
[0186] If link 131 is in the second state and has an inactive flag, and the first device synchronizes the link state of link 131 to the peer device using the first synchronization method (1) or the fourth synchronization method (4) mentioned above, since port A1 and port B1 can still transmit messages based on LACP, and there is no interference or minimal interference on link 131, and port A1 and port B1 have good performance, making the performance index of link 131 better than the first reference performance index, then the first device switches the link state of link 131 from the second state to the first state through the link state machine. Whether to add an active flag or an inactive flag to link 131 after link 131 is in the first state depends on whether link 131 has been added to the first link subset after being in the first state.
[0187] If link 131 is in the second state and link 131 has an enable flag, the process of the first device switching the link state of link 131 through the link state machine can be referred to the above process of the first device switching the link state of link 131 through the link state machine when link 131 is in the second state before the enable flag is introduced. For the sake of brevity, it will not be elaborated here.
[0188] It should be understood that when link 131 is in the first state, the process by which the first device adds an (non)enabled flag to link 131 through the link state machine, the process by which the enabled flag and the non-enabled flag of link 131 are switched, and the process by which link 131 is switched when it has an (non)enabled flag can all be referred to the process by which the first device adds an (non)enabled flag to link 131 through the link state machine when link 131 is in the second state, the process by which the enabled flag and the non-enabled flag of link 131 are switched, and the process by which link 131 is switched when it has an (non)enabled flag. For the sake of brevity, these will not be elaborated here.
[0189] It should be understood that the process of the first device switching various states on other links can be referred to the process of the first device switching various states on link 131 as described above. For the sake of brevity, it will not be elaborated here.
[0190] It should be understood that the switching process between the various states of the link described above is illustrated using the state set including the first state, the second state, and the third state as an example. When the state set includes more states, the link state machine can realize the switching between more states of the link, which will not be elaborated here.
[0191] (II) Message transmission of the first device in a multi-LAG scenario
[0192] When the first device is the aforementioned Figure 1B When the network device 21 in the message transmission system 20 is in the first LAG, the second device is the network device 22, the second LAG is the second LAG, the first link set includes LAG 25 and LAG 26, the first link set includes links 251, 252 and 253 in LAG 25, and links 261, 262 and 263 in LAG 26.
[0193] The first device performs the aforementioned Figure 2 The processes of steps S201 and S202 in the message transmission method are as follows:
[0194] The first device monitors links 251, 252, and 253 in LAG 25 respectively, and can obtain the link status of links 251, 252, and 253 respectively. The first device receives the link status of links 261, 262, and 263 in LAG 26 sent by network device 22 through peer link 24.
[0195] In some possible implementations, the first device can determine whether to use the first link subset to transmit the message if the link state of at least one link in the first link set changes; alternatively, if the number of links in the LAG corresponding to the device currently transmitting the message that are in the first state is less than the minimum number of active links in the first LAG, the first device can determine whether to use the first link subset to transmit the message based on the link state of at least one link in the first link set. If the first device is the device currently transmitting the message, then the LAG corresponding to the device currently transmitting the message is the first LAG; if the second device is the device currently transmitting the message, then the LAG corresponding to the device currently transmitting the message is the second LAG.
[0196] This technical solution provides two triggering methods for determining whether to use the first link subset for packet transmission. In the first triggering method, the usage result of the first link subset is updated whenever the link status changes. This method ensures that the LAG used for packet transmission is always the LAG with the best overall transmission quality among multiple LAGs, thus guaranteeing the best transmission quality for the service. In the second triggering method, the usage result of the currently responsible link subset is updated only if the number of high-quality links in the currently responsible LAG cannot meet the minimum transmission requirements. This method saves computational and switching overhead while ensuring transmission quality.
[0197] In some possible implementations, the first link set includes multiple LAGs, including a first LAG, and each LAG corresponds to an available bandwidth. The first device determines whether to use the first link subset to transmit packets based on the link status of at least one link, including at least the following five cases:
[0198] Case 1: If the number of links in the first state in the first LAG is greater than or equal to the minimum number of active links in the first LAG, and if the first LAG is the LAG with the largest available bandwidth among multiple LAGs, then the first device determines to use the first link subset to transmit the message.
[0199] Case 2: If the number of links in the first state in the first LAG is greater than or equal to the minimum number of active links in the first LAG, and if the first LAG is not the LAG with the maximum available bandwidth among multiple LAGs, then the first device determines not to use the first link subset to transmit messages.
[0200] Case 3: If the number of links in the first state in the first LAG is less than the minimum number of active links in the first LAG, and the sum of the number of links in the first state and the number of links in the second state in the first LAG is greater than or equal to the minimum number of active links in the first LAG, then if the first LAG is the LAG with the largest available bandwidth among multiple LAGs, the first device determines to use the first link subset to transmit the message.
[0201] Case 4: If the number of links in the first state in the first LAG is less than the minimum number of active links in the first LAG, and the sum of the number of links in the first state and the number of links in the second state in the first LAG is greater than or equal to the minimum number of active links in the first LAG, then if the first LAG is not the LAG with the maximum available bandwidth among multiple LAGs, the first device determines not to use the first link subset to transmit messages.
[0202] Case 5: If the sum of the number of links in the first state and the number of links in the second state in the first LAG is less than the minimum number of active links in the first LAG, the first device determines not to use the first subset of links to transmit messages.
[0203] The available bandwidth for each LAG is determined based on the available bandwidth of the port corresponding to each link within that LAG, and the available bandwidth of the port corresponding to each link is determined based on the link status of each link. The relationship between the available bandwidth of the port corresponding to each link and the link status of that link can be seen in the following configuration methods 1 and 2:
[0204] Configuration Method 1: Configure the relationship between the available bandwidth of the port corresponding to each link and the link status of that link.
[0205] Specifically, when the link is in the first state, the available bandwidth of the port corresponding to the link is set to a first value; when the link is in the second state, the available bandwidth of the port corresponding to the link is set to a second value; and when the link is in the third state, the available bandwidth of the port corresponding to the link is set to a third value. The first value is greater than the second value, and the second value is greater than the third value.
[0206] Optionally, the first value is the actual available bandwidth; the second value is the ratio between the actual available bandwidth and the number of links in the LAG; and the third value is 0. The actual available bandwidth can be obtained by the first device using a bandwidth monitoring tool.
[0207] Configuration Method 2: Configure the relationship between the available bandwidth of the port corresponding to each link and the link status and performance indicators of the link.
[0208] Specifically, when the link is in the first state, the available bandwidth of the port corresponding to the link is set to a first value, which is the sum of a first base value and a first difference value; when the link is in the second state, the available bandwidth of the port corresponding to the link is set to a second value, which is the sum of a second base value and a second difference value; when the link is in the third state, the available bandwidth of the port corresponding to the link is set to a third value.
[0209] The first baseline value indicates a first reference performance indicator; the better the performance represented by the first reference performance indicator, the larger the first baseline value. The second baseline value indicates a second reference performance indicator; the better the performance represented by the second reference performance indicator, the larger the second baseline value. The first baseline value is greater than the second baseline value, and the second baseline value is greater than the third value. The first difference is a non-negative number, indicating the degree to which the link's performance indicator is superior to the first reference performance indicator; the greater the degree to which the link's performance indicator is superior to the first reference performance indicator, the larger the first difference. The second difference is also a non-negative number, indicating the degree to which the link's performance indicator is superior to the second reference performance indicator; the greater the degree to which the link's performance indicator is superior to the second reference performance indicator, the larger the second difference.
[0210] In summary, in scenarios where the first link set includes multiple LAGs, the process by which the first device determines whether to use the first link subset for packet transmission mainly involves two stages: The first stage involves determining the relationship between the number of links in the first state and the number of links in the second state within the first LAG, and the minimum number of active links in the first LAG; the second stage involves determining the relationship between the available bandwidth of the first LAG and the available bandwidth of other LAGs. The specific implementation process of the first stage can be referenced in the aforementioned (I) section on packet transmission in a single LAG scenario, where the first device determines whether to use the first link subset for packet transmission based on the link status results in LAG 13. For the sake of brevity, this will not be elaborated further here. The following section continues with an example of the first link set including both the first and second LAGs to illustrate the specific implementation process of the second stage.
[0211] For the first LAG, designated LAG 25, the links within the first LAG include links 251, 252, and 253. Assuming the port corresponding to link 251 in the first device is called port C1, the port corresponding to link 252 is called port C2, and the port corresponding to link 253 is called port C3, then the available bandwidth of the first LAG is the sum of the available bandwidths of the ports corresponding to links 251, 252, and 253 in LAG 25, specifically the sum of the available bandwidths of ports C1, C2, and C3.
[0212] For the second LAG, designated LAG 26, the links within the second LAG include links 261, 262, and 263. Assuming the port corresponding to link 261 in the second device is called port D1, the port corresponding to link 262 is called port D2, and the port corresponding to link 263 is called port D3, then the available bandwidth of the second LAG is the sum of the available bandwidths of the ports corresponding to links 261, 262, and 263 in LAG 26, specifically the sum of the available bandwidths of ports D1, D2, and D3.
[0213] Application Scenario 1: The first LAG is the LAG with the largest available bandwidth among multiple LAGs.
[0214] Assuming link 251 is in state 1, link 252 is in state 2, and link 253 is in state 3, then the available bandwidth of port C1 is the first value, the available bandwidth of port C2 is the second value, and the available bandwidth of port C3 is the third value. Therefore, the available bandwidth corresponding to the first LAG is the sum of the first, second, and third values. For example, if the first value is 100, the second value is 33, and the third value is 0, then the available bandwidth corresponding to the first LAG is 100 + 33 + 0 = 133.
[0215] Assuming link 261 is in state 2, link 262 is in state 2, and link 263 is in state 3, then the available bandwidth of port D1 is the second value, the available bandwidth of port D2 is the second value, and the available bandwidth of port D3 is the third value. Therefore, the available bandwidth corresponding to the second LAG is the sum of the second value and the third value. For example, if the first value is 100, the second value is 33, and the third value is 0, then the available bandwidth corresponding to the second LAG is 33 + 33 + 0 = 66.
[0216] Therefore, if the available bandwidth corresponding to the first LAG is greater than the available bandwidth corresponding to the second LAG, then the first LAG is the LAG with the largest available bandwidth among the multiple LAGs. Thus, the first device determines to use the first link subset to transmit the message, and determines that the first link subset includes link 251 and link 252.
[0217] Application Scenario 2: The first LAG is not the LAG with the largest available bandwidth among multiple LAGs.
[0218] Assuming link 251 is in state 2, link 252 is in state 2, and link 253 is in state 3, then the available bandwidth of port C1 is the second value, the available bandwidth of port C2 is the second value, and the available bandwidth of port C3 is the third value. Therefore, the available bandwidth corresponding to the first LAG is the sum of the second and third values. For example, if the first value is 100, the second value is 33, and the third value is 0, then the available bandwidth corresponding to the first LAG is 33 + 33 + 0 = 66.
[0219] Assuming link 261 is in state 1, link 262 is in state 2, and link 263 is in state 3, then the available bandwidth of port D1 is the first value, the available bandwidth of port D2 is the second value, and the available bandwidth of port D3 is the third value. Therefore, the available bandwidth corresponding to the second LAG is the sum of the first, second, and third values. For example, if the first value is 100, the second value is 33, and the third value is 0, then the available bandwidth corresponding to the second LAG is 100 + 33 + 0 = 133.
[0220] Therefore, if the available bandwidth corresponding to the first LAG is less than the available bandwidth corresponding to the second LAG, then the first LAG is not the LAG with the largest available bandwidth among the multiple LAGs, and the first device determines not to use the first link subset to transmit messages.
[0221] Application Scenario 3: The first LAG and the second LAG are both LAGs with the largest available bandwidth among multiple LAGs.
[0222] Assuming link 251 is in state 1, link 252 is in state 2, and link 253 is in state 3, then the available bandwidth of port C1 is the first value, the available bandwidth of port C2 is the second value, and the available bandwidth of port C3 is the third value. Therefore, the available bandwidth corresponding to the first LAG is the sum of the first, second, and third values. For example, if the first value is 100, the second value is 33, and the third value is 0, then the available bandwidth corresponding to the first LAG is 100 + 33 + 0 = 133.
[0223] Assuming link 261 is in state 1, link 262 is in state 2, and link 263 is in state 3, then the available bandwidth of port D1 is the first value, the available bandwidth of port D2 is the second value, and the available bandwidth of port D3 is the third value. Therefore, the available bandwidth corresponding to the second LAG is the sum of the first, second, and third values. For example, if the first value is 100, the second value is 33, and the third value is 0, then the available bandwidth corresponding to the second LAG is 100 + 33 + 0 = 133.
[0224] Therefore, the available bandwidth corresponding to the first LAG is equal to the available bandwidth corresponding to the second LAG, and both the first LAG and the second LAG are the LAGs with the largest available bandwidth among multiple LAGs.
[0225] In this scenario, since the first LAG corresponds to the first device and the second LAG corresponds to the second device, and the first and second devices are different devices, the first device compares the system priorities of the first and second devices. If the system priority of the first device is higher than that of the second device, the first device determines to use the first link subset to transmit messages, and determines that the first link subset includes links 251 and 252. If the system priority of the first device is lower than that of the second device, the first device determines not to use the first link subset to transmit messages. The system priority indicates the device's selection authority in a message transmission system with LAGs (LAG system). The higher the system priority, the greater the device's selection authority in the LAG system; the lower the system priority, the smaller the device's selection authority in the LAG system. The system priority can be represented using an unsigned binary number. For example, the system priority can be the LACP system priority, in which case the system priority is represented by the highest two bytes of the LAG system identifier; the lower the value, the higher the priority. See the LAG-related protocol standard IEEE 802.3ad for details.
[0226] Therefore, when multiple LAGs, including the first LAG, correspond to the LAG with the maximum available bandwidth, if the first device determines that it is the device with the highest system priority among the devices corresponding to each of these multiple LAGs, then the first device determines to use the first link subset to transmit the message. If the first device determines that it is not the device with the highest system priority among the devices corresponding to each of these multiple LAGs, then the first device determines not to use the first link subset to transmit the message.
[0227] It should be understood that when the first link set includes more LAGs, the process by which the first device determines whether to use the first link subset to transmit a message is similar to the process described above when the first link set includes the first LAG and the second LAG. For the sake of brevity, this will not be elaborated further here.
[0228] It should be understood that the above determination that the first link subset includes links 251 and 252 based on link 251 being in the first state, link 252 being in the second state, and link 253 being in the third state in application scenario 1 or application scenario 3 is merely an example. In actual applications, there are various correspondences between the link states of links 251, 252, and 253 and the specific links included in the first link subset. For details, please refer to the above-mentioned (I) Message transmission of the first device in a single LAG scenario, including situations 1-4 and related content. Further details will not be elaborated here.
[0229] In summary, this technical solution provides a specific implementation for determining whether to use the first link subset for packet transmission. The available bandwidth of a Linkage Aggregator (LAG) is used to characterize the transmission quality of links within that LAG. Therefore, by comparing the available bandwidth of different LAGs, it can be determined whether the first LAG has the best overall transmission quality among multiple LAGs, thus determining whether to use the first link subset for packet transmission. Furthermore, this technical solution also employs the system priority of the devices corresponding to the LAG to address the issue of which LAG is responsible for subsequent packet transmission when multiple LAGs with the largest available bandwidth exist simultaneously.
[0230] In some possible implementations, the first link set includes multiple LAGs, including a first LAG and a second LAG. Specifically, the number of links in the second LAG in the first state is greater than or equal to the minimum number of active links in the second LAG; or the number of links in the second LAG in the first state is less than the minimum number of active links in the second LAG, and the sum of the number of links in the first state and the number of links in the second state in the second LAG is greater than or equal to the minimum number of active links in the second LAG. The first LAG and the second LAG are different LAGs. After the first device determines that the first LAG is not the LAG with the maximum available bandwidth among the multiple LAGs, and determines not to use the first link subset to transmit packets, if the first device determines that the second LAG is the LAG with the maximum available bandwidth among the multiple LAGs, then the first device determines to use the second link subset to transmit packets. The links in the second link subset belong to the second LAG.
[0231] The process by which the first device determines whether the second LAG is the LAG with the largest available bandwidth among multiple LAGs can be referred to the process by which the first device determines whether the first LAG is the LAG with the largest available bandwidth among multiple LAGs in the above application scenarios 1-3. For the sake of brevity, it will not be elaborated here.
[0232] The specific links included in the second link subset depend on the link states in the second LAG. If the number of links in the second LAG in the first state is greater than or equal to the minimum number of active links in the second LAG, the second link subset includes the links in the second LAG in the first state. If the number of links in the second LAG in the first state is less than the minimum number of active links in the second LAG, and the sum of the number of links in the second state and the number of links in the second state in the second LAG is greater than or equal to the minimum number of active links in the second LAG, the second link subset includes both the links in the first state and the links in the second state in the second LAG.
[0233] When the second LAG is LAG 26, the specific links included in the second link subset depend on the link states of links 261, 262, and 263 in LAG 26. There are several possible correspondences between the link states of links 261, 262, and 263 and the links specifically included in the second link subset. For details, please refer to the descriptions in section (I) regarding cases 1-4 of message transmission in a single LAG scenario for the first device, and related content. Further details will not be elaborated here.
[0234] In summary, this technical solution can further determine which LAG is responsible for subsequent message transmission and the link in that LAG actually used for message transmission based on the available bandwidth of each LAG and the link status of each link in the LAG.
[0235] In some possible application scenarios, the first LAG corresponds to the first device, and the second LAG corresponds to the second device. When the first device is the device currently transmitting the packet, and the first LAG is the LAG of the currently transmitted packet, the first device's determination of whether to use the first link subset to transmit the packet will produce the following results:
[0236] Result 11: If the first device and the second device are different devices, and the first device uses the first link subset to transmit messages, then the first device continues to transmit messages and continues to use the first link subset in the first LAG to transmit messages.
[0237] Result 12: If the first device and the second device are different devices, and the first device does not use the first link subset to transmit packets, but determines to use the second link subset to transmit packets, then the first device determines to perform a traffic switch. Specifically, the first device stops using the first LAG to transmit packets, and the second device starts using the second link subset in the second LAG to transmit packets.
[0238] In some possible application scenarios, the first LAG corresponds to the first device, and the second LAG corresponds to the second device. If the first device is not the device currently transmitting the packet, the first LAG is not the LAG of the currently transmitted packet, and the second LAG is the LAG of the currently transmitted packet, the first device's determination of whether to use the first link subset to transmit the packet will produce the following results:
[0239] Result 21: If the first device and the second device are different devices, and the first device uses the first link subset to transmit packets, then the first device determines to perform a traffic switch. Specifically, the second device stops using the second LAG to transmit packets, and the first device starts using the first link subset in the first LAG to transmit packets.
[0240] Result 22: If the first device and the second device are different devices, and the first device does not use the first link subset to transmit messages, but determines to use the second link subset to transmit messages, then the second device continues to transmit messages and continues to use the second LAG to transmit messages.
[0241] In some possible implementations, after the first device determines to perform a traffic switch, the first device needs to synchronize its determination result for the first LAG with the peer device (i.e., network device 23 in the message transmission system 20) to ensure the consistency of behavior between the first device and the peer device. The synchronization method between the first device and the peer device can refer to the first synchronization method (1) to the fourth synchronization method (4) in the message transmission of the first device in a single LAG scenario described above. For the sake of brevity, it will not be elaborated here.
[0242] In some possible implementations, a link state machine is set in the first device to switch between the various states of the link. The process of switching between the various states of the link through the link state machine can be referred to the process of switching between the various states of link 131 through the link state machine in the message transmission of the first device in a single LAG scenario described in (I) above. For the sake of brevity, it will not be elaborated here.
[0243] In message transmission system 20, network device 22 is also used to perform the aforementioned tasks. Figure 2 The message transmission method includes steps S201 and S202. Specifically, the network device 22 executes steps S201 and S202, which is similar to the aforementioned (II) message transmission method for the first device in a multi-LAG scenario. When the first device is network device 21, the first device executes the aforementioned... Figure 2 The processes of steps S201 and S202 in the message transmission method are similar, and will not be elaborated here for the sake of brevity.
[0244] It should be understood that when the first device is the aforementioned Figure 1C When the first device performs the aforementioned operation on network device 31 or network device 32 in the message transmission system 20, Figure 2 The processes of steps S201 and S202 in the message transmission method are similar to those in the aforementioned (II) message transmission of the first device in a multi-LAG scenario. When the first device is network device 21, the first device performs the aforementioned... Figure 2 The processes of steps S201 and S202 in the message transmission method are similar, and will not be elaborated here for the sake of brevity.
[0245] See Figure 5 , Figure 5 This is a schematic diagram of the structure of a message transmission device provided in an embodiment of this application. The message transmission device 400 can be used to implement the aforementioned... Figure 2 The message transmission method. For example... Figure 5 As shown, the message transmission device 400 includes an acquisition unit 401 and a determination unit 402.
[0246] The acquisition unit 401 is used to acquire the link status of at least one link in the first link set.
[0247] The determining unit 402 is used to determine whether to use the first link subset to transmit messages based on the link status of at least one link.
[0248] The first link set comprises one or more Link Aggregation Groups (LAGs). Each LAG includes multiple links. Links in the first link subset belong to the same LAG within one or more LAGs. The link state of each link is determined based on its performance metrics, and the link state belongs to a state set. The state set includes a first state, a second state, and a third state. The first state indicates that the link's performance metrics are better than a first reference performance metric. The second state indicates that the link's performance metrics are worse than the first reference performance metric but better than the second reference performance metric. The third state indicates that the link's performance metrics are worse than the second reference performance metric.
[0249] In some possible implementations, at least one link includes links belonging to a first LAG. Specifically, the determining unit 402 is configured to determine whether to use a first subset of links for message transmission when the number of links in a first state within the first LAG is greater than or equal to the minimum number of active links in the first LAG. The first subset of links includes links in the first state within the first LAG.
[0250] In some possible implementations, at least one link includes links belonging to a first LAG. Specifically, the determining unit 402 is configured to determine whether to use a first subset of links to transmit a message when the number of links in the first LAG in a first state is less than the minimum number of active links in the first LAG, and the sum of the number of links in the first LAG in the first state and the number of links in the second state is greater than or equal to the minimum number of active links. The first subset of links includes links in the first LAG in the first state and links in the second state.
[0251] In some possible implementations, the first LAG belongs to the aforementioned first link set. The first link set includes multiple LAGs. Each LAG corresponds to an available bandwidth. Specifically, the determining unit 402 is used when the number of links in the first LAG in the first state is greater than or equal to the minimum number of active links in the first LAG, or when the number of links in the first LAG in the first state is less than the minimum number of active links in the first LAG, and the sum of the number of links in the first state and the number of links in the second state in the first LAG is greater than or equal to the minimum number of active links, if the first LAG is the LAG with the largest available bandwidth among the multiple LAGs, then it determines to use the first link subset to transmit the message.
[0252] In some possible implementations, the determining unit 402 is further configured to determine that the first link subset will not be used to transmit messages if the first LAG is not the LAG with the largest available bandwidth among the multiple LAGs.
[0253] In some possible implementations, multiple LAGs include a second LAG. The number of links in the second LAG that are in the first state is greater than or equal to the minimum number of active links in the second LAG. Alternatively, the number of links in the second LAG that are in the first state is less than the minimum number of active links in the second LAG, and the sum of the number of links in the first state and the number of links in the second state in the second LAG is greater than or equal to the minimum number of active links in the second LAG. The first LAG is different from the second LAG. The determining unit 402 is further configured to, if it is determined that the first subset of links will not be used to transmit the message, and if the second LAG is the LAG with the largest available bandwidth among the multiple LAGs, determine to use the second subset of links to transmit the message. The links in the second subset of links belong to the second LAG.
[0254] In some possible implementations, if the number of links in the second LAG that are in the first state is greater than or equal to the minimum number of active links in the second LAG, the second subset of links includes the links in the second LAG that are in the first state. If the number of links in the second LAG that are in the first state is less than the minimum number of active links in the second LAG, and the sum of the number of links in the second LAG that are in the first state and the number of links in the second state is greater than or equal to the minimum number of active links in the second LAG, the second subset of links includes the links in the second LAG that are in the first state and the links that are in the second state.
[0255] In some possible implementations, multiple LAGs include a second LAG. The number of links in the second LAG that are in the first state is greater than or equal to the minimum number of active links in the second LAG. Alternatively, the number of links in the second LAG that are in the first state is less than the minimum number of active links in the second LAG, and the sum of the number of links in the second LAG that are in the first state and the number of links in the second state is greater than or equal to the minimum number of active links in the second LAG. The first LAG and the second LAG are different. Specifically, the determining unit 402 is used to determine whether to use the first subset of links to transmit messages when both the first LAG and the second LAG are LAGs with the largest available bandwidth among multiple LAGs, and the system priority of the first device corresponding to the first LAG is the highest.
[0256] In some possible implementations, the first device is the device currently transmitting the message, the second LAG corresponds to the second device, and the second device is a different device from the first device.
[0257] In some possible implementations, the links in the first subset of links belong to the first LAG. The first LAG corresponds to the first device. The first device is the device currently transmitting the message. Specifically, the determining unit 402 is used to determine whether to use the first subset of links to transmit the message based on the link state of at least one link when the link state of at least one link changes. Alternatively, the determining unit 402 is specifically used to determine whether to use the first subset of links to transmit the message based on the link state of at least one link when the number of links in the first LAG in the first state is less than the minimum number of active links.
[0258] In some possible implementations, the links in the first subset of links belong to the first LAG. The first LAG corresponds to the first device. The first device is the device currently transmitting the message. The message transmission apparatus 400 includes a sending unit. The sending unit is used to send a Link Aggregation Control Protocol (LACP) negotiation message to the peer device of the first device. The LACP negotiation message is used to indicate the links in the first LAG that are in the second state.
[0259] The acquisition unit 401, determination unit 402, and sending unit described above can all be implemented in software or in hardware. For example, the implementation of the acquisition unit 401 will be described below. Similarly, the implementation of the determination unit 402 and the sending unit can refer to the implementation of the acquisition unit 401.
[0260] As an example of a software functional unit, the acquisition unit 401 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the aforementioned computing instance may be one or more. For example, the acquisition unit 401 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region or in different regions. Further, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one or more geographically proximate data centers. Typically, a region may include multiple AZs.
[0261] Similarly, multiple hosts / virtual machines / containers used to run this code can be distributed within the same Virtual Private Cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Communication between two VPCs within the same region, as well as between VPCs in different regions, requires a communication gateway to be set up within each VPC to enable interconnection between VPCs.
[0262] As an example of a hardware functional unit, the acquisition unit 401 may include at least one computing device, such as a server. Alternatively, the acquisition unit 401 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be implemented using a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), generic array logic (GAL), or any combination thereof.
[0263] The multiple computing devices included in the acquisition unit 401 can be distributed in the same region or in different regions. Similarly, the multiple computing devices included in the acquisition unit 401 can be distributed in the same Availability Zone (AZ) or in different AZs. Likewise, the multiple computing devices included in the acquisition unit 401 can be distributed in the same Virtual Private Cloud (VPC) or in multiple VPCs. These multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
[0264] It should be noted that, in other embodiments, the acquisition unit 401 can be used to execute any step in the message transmission method, the determination unit 402 can be used to execute any step in the message transmission method, and the sending unit can be used to execute any step in the message transmission method. The steps implemented by the acquisition unit 401, the determination unit 402, and the sending unit can be specified as needed. By implementing different steps in the message transmission method through the acquisition unit 401, the determination unit 402, and the sending unit, all functions of the message transmission device 400 can be realized.
[0265] See Figure 6 , Figure 6 This is a schematic diagram of the structure of a network device provided in this application. For example... Figure 6 As shown, the network device 500 provided in this application includes: a bus 501, a processor 502, a memory 503, and a communication interface 504. The processor 502, the memory 503, and the communication interface 504 communicate with each other via the bus 501. The network device 500 can be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in the network device 500.
[0266] Bus 501 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, Figure 6 The bus 501 may be represented by a single line, but this does not mean that there is only one bus or one type of bus. The bus 501 may include a path for transmitting information between various components of the network device 500 (e.g., memory 503, processor 502, communication interface 504).
[0267] Processor 502 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0268] Memory 503 may include volatile memory, such as random access memory (RAM). Memory 503 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).
[0269] The memory 503 stores executable program code, and the processor 502 executes the executable program code to implement the functions of the aforementioned acquisition unit 401, determination unit 402, and sending unit, thereby achieving the aforementioned... Figure 2 The message transmission method. That is, the memory 503 stores the message transmission method used for execution. Figure 2 Instructions for message transmission methods.
[0270] The communication interface 504 uses transceiver modules such as, but not limited to, network interface cards and transceivers to enable communication between the network device 500 and other computing devices or communication networks.
[0271] This application also provides a network system comprising multiple network devices managed by MC-LAG. Each of the multiple network devices is used to implement the aforementioned... Figure 2 The message transmission method.
[0272] This application also provides a computer program product containing instructions. This computer program product may be a software or program product containing instructions, capable of running on a computing device or stored on any usable medium. When the computer program product runs on a computing device, it causes the computing device to perform the aforementioned... Figure 2 The message transmission method.
[0273] This application also provides a computer-readable storage medium. The computer-readable storage medium can be any usable medium that a computing device can store, or a data storage device such as a data center containing one or more usable media. The usable medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive). The computer-readable storage medium includes instructions that direct a computing device to perform the aforementioned actions. Figure 2 The message transmission method.
[0274] It should be understood that in the embodiments of this application, "when," "...when," or "if" all refer to the device making corresponding processing under certain objective circumstances, and are not limited to a time, nor do they require the device to make a judgment action when it implements the process, nor do they imply any other limitations.
[0275] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of this application.
Claims
1. A message transmission method, characterized in that, The method includes: Obtain the link status of at least one link in the first link set; Based on the link status of the at least one link, determine whether to use the first link subset to transmit the message; The first link set includes one or more Link Aggregation Groups (LAGs), each LAG includes multiple links, and the links in the first link subset belong to the same LAG among the one or more LAGs. The link state of each link is determined based on the link's performance metric. The link state belongs to a state set, which includes a first state, a second state, and a third state. The first state indicates that the link's performance metric is better than a first reference performance metric. The second state indicates that the link's performance metric is worse than the first reference performance metric but better than the second reference performance metric. The third state indicates that the link's performance metric is worse than the second reference performance metric.
2. The method according to claim 1, characterized in that, The at least one link includes a link belonging to the first LAG. The step of determining whether to use the first subset of links to transmit a message based on the link status of the at least one link includes: If the number of links in the first state in the first LAG is greater than or equal to the minimum number of active links in the first LAG, it is determined that the message will be transmitted using the first subset of links. The first subset of links includes the links in the first LAG that are in the first state.
3. The method according to claim 1, characterized in that, The at least one link includes a link belonging to the first LAG. The step of determining whether to use the first subset of links to transmit a message based on the link status of the at least one link includes: If the number of links in the first LAG that are in the first state is less than the minimum number of active links in the first LAG, and the sum of the number of links in the first LAG that are in the first state and the number of links in the second state is greater than or equal to the minimum number of active links, then it is determined that the first subset of links will be used to transmit the message. The first subset of links includes the links in the first LAG that are in the first state and the links that are in the second state.
4. The method according to claim 2 or 3, characterized in that, The first LAG belongs to the first link set, which includes multiple LAGs, each corresponding to one available bandwidth. The step of determining to use the first link subset to transmit the message includes: If the first LAG is the LAG with the largest available bandwidth among the plurality of LAGs, then it is determined that the first link subset will be used to transmit the message; The available bandwidth corresponding to the first LAG is determined based on the available bandwidth of the port corresponding to each link in the first LAG, and the available bandwidth of the port corresponding to each link is determined based on the link status of each link.
5. The method according to claim 4, characterized in that, The method further includes: If the first LAG is not the LAG with the maximum available bandwidth among the plurality of LAGs, it is determined that the first link subset will not be used to transmit the message.
6. The method according to claim 5, characterized in that, The plurality of LAGs includes a second LAG, wherein the number of links in the second LAG that are in the first state is greater than or equal to the minimum number of active links in the second LAG; or, the number of links in the second LAG that are in the first state is less than the minimum number of active links in the second LAG, and the sum of the number of links in the second LAG that are in the first state and the number of links in the second state is greater than or equal to the minimum number of active links in the second LAG; the first LAG is different from the second LAG. After determining that the first LAG is not the LAG corresponding to the maximum available bandwidth among the plurality of LAGs, and after determining that the first link subset will not be used to transmit the message, the method further includes: If the second LAG is the LAG with the maximum available bandwidth among the plurality of LAGs, then it is determined that the second link subset will be used to transmit the message; Among them, the links in the second link subset belong to the second LAG.
7. The method according to claim 6, characterized in that, If the number of links in the second LAG that are in the first state is greater than or equal to the minimum number of active links in the second LAG, the second subset of links includes the links in the second LAG that are in the first state. If the number of links in the second LAG that are in the first state is less than the minimum number of active links in the second LAG, and the sum of the number of links in the second LAG that are in the first state and the number of links in the second state is greater than or equal to the minimum number of active links in the second LAG, then the second link subset includes the links in the second LAG that are in the first state and the links that are in the second state.
8. The method according to claim 4 or 5, characterized in that, The plurality of LAGs includes a second LAG, wherein the number of links in the second LAG that are in the first state is greater than or equal to the minimum number of active links in the second LAG; or, the number of links in the second LAG that are in the first state is less than the minimum number of active links in the second LAG, and the sum of the number of links in the second LAG that are in the first state and the number of links in the second state is greater than or equal to the minimum number of active links in the second LAG; the first LAG is different from the second LAG. If the first LAG is the LAG with the largest available bandwidth among the plurality of LAGs, determining to use the first link subset to transmit the message includes: If both the first LAG and the second LAG are LAGs that correspond to the maximum available bandwidth among the plurality of LAGs, and the system priority of the first device corresponding to the first LAG is the highest, then it is determined that the first link subset will be used to transmit the message.
9. The method according to any one of claims 6-8, wherein the first device is the device currently transmitting the message, the second LAG corresponds to the second device, and the second device and the first device are different devices.
10. The method according to claim 1, characterized in that, The links in the first subset of links belong to the first LAG, the first LAG corresponds to the first device, and the first device is the device currently transmitting the packet. The step of determining whether to use the first subset of links to transmit a message based on the link status of the at least one link includes: If the link state of at least one link changes, determine whether to use the first link subset to transmit the message based on the link state of the at least one link. Alternatively, if the number of links in the first state in the first LAG is less than the minimum number of active links, it is determined whether to use the first subset of links to transmit the message based on the link state of the at least one link.
11. The method according to any one of claims 1-10, characterized in that, The links in the first subset of links belong to the first LAG, the first LAG corresponds to the first device, and the first device is the device currently transmitting the message. The method further includes: Send a Link Aggregation Control Protocol (LACP) negotiation message to the peer device of the first device. The LACP negotiation message is used to indicate the link in the first LAG that is in the second state.
12. A communication device, characterized in that, The communication device includes a module for implementing the method as described in any one of claims 1-11.
13. A network device, characterized in that, The network device includes a memory and a processor, the memory storing computer program instructions, and the processor executing the computer program instructions to cause the network device to perform the method as described in any one of claims 1-11.
14. A network system, characterized in that, It includes multiple network devices managed by a cross-device link aggregation group (MC-LAG), each of which is used to implement the method as described in any one of claims 1-11.
15. A computer-readable storage medium, characterized in that, It includes computer program instructions that, when executed by a processor, implement the method as described in any one of claims 1-11.