Communication Link Selection Method, Apparatus and Storage Medium
The leaf node sends link status messages to multiple spine nodes and receives response messages, which solves the problem that the target communication link cannot be selected without direct links between spine nodes, and realizes the certainty of link selection.
Patent Information
- Application Number
- CN202010917781.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-03
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2040-09-03
AI Technical Summary
In the communication link of the leaf spine architecture, if there is no direct link between the two spine nodes, the prior art cannot effectively select the target communication link used to manage node communication.
The leaf node sends link status messages to multiple spine nodes respectively. After receiving the response message, the target communication link is determined from the available communication links to realize link selection.
Even if there is no direct link between the spine nodes, the available communication link can still be effectively selected to ensure the communication certainty between the leaf node and the management node.
Smart Images

Figure CN114143853B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of communications, and in particular, to a communication link selection method, apparatus, and storage medium. Background Art
[0002] To expand network capacity, forwarding devices in a network usually adopt large frame devices. For example, a frame device that can accommodate 20 interface boards. When the network capacity continues to grow to a level that cannot be supported by a single frame device, a scale-out system with a spine-leaf architecture can be used for capacity expansion. However, in this architecture, since each spine node establishes a communication connection with each leaf node, and there is one or more communication links between a leaf node and a spine node, in order to ensure the determinacy of communication between the management node and the leaf node, that is, it is necessary to select one communication link from the multiple communication links between the leaf node and multiple spine nodes to communicate with the management node.
[0003] For any two spine nodes connected to a leaf node, these two spine nodes determine a primary spine node through mutual negotiation. After that, the primary spine node selects one communication link from one or more communication links between itself and the leaf node, and uses the selected communication link as the target communication link for communicating with the management node. Since in the related art, the primary spine node is determined through negotiation between two spine nodes, it is required that there is a direct link between the two spine nodes. When there is no direct link between the two spine nodes, the above method cannot be used for link selection. Summary of the Invention
[0004] Embodiments of the present application provide a communication link selection method, apparatus, and storage medium, which are used to select a target communication link for communicating with a management node from the communication links between a leaf node and a spine node when there is no direct link between the spine nodes. The technical solution is as follows:
[0005] In a first aspect, a communication link selection method is provided. The method includes: a first node respectively sends first link status messages to a second node through communication links in a first link group, where the first link group is a link group between the first node and the second node, and the first link group includes a first communication link; the first node respectively sends second link status messages to a third node through communication links in a second link group, where the first link group is a link group between the first node and the third node, and the second link group includes a second communication link; the first node receives a first response message through the first communication link, and the first response message is a response message to the first link status message; the first node receives a second response message through the second communication link, and the second response message is a response message to the second link status message; the first node determines a target communication link from the first communication link and the second communication link, and the target communication link is used for the first node to communicate with a management node.
[0006] Wherein, the first node may be a leaf node, the second node and the third node are both spine nodes, and there is no direct link between the second node and the third node. Moreover, the management node and the first node performing control information interaction through the target communication link means that the management node performs control information interaction with the first node through the communication link between the spine nodes corresponding to the target communication link and the target communication link.
[0007] In the embodiment of the present application, with the first node as the leading node, through message interaction with the second node and the third node, an available communication link can be selected from multiple communication links between the second node and the third node as the target communication link. In this way, even if there is no direct link between the second node and the third node, the link selection between the first node and the second node and the third node can still be achieved.
[0008] In one implementation, the first link group further includes a third communication link, and the method further includes: the first node receives the first response message through the third communication link; in this case, the process of the first node determining the target communication link from the first communication link and the second communication link is: the first node determines the target communication link from the first communication link, the second communication link, and the third communication link.
[0009] That is, when there are multiple communication links in the link group between the first node and the second node, if the first node also receives the first response message fed back by the second node through other communication links, the first node will regard all the links that receive the first response message and the links that receive the second response message as candidate communication links, and then select the target communication link from these communication links.
[0010] In one implementation, the second link group further includes a fourth communication link, and the method further includes: the first node receives the second response message through the fourth communication link; in this case, the process of the first node determining the target communication link from the first communication link and the second communication link is: the first node determines the target communication link from the first communication link, the second communication link, the third communication link, and the fourth communication link.
[0011] When there are multiple communication links in the link group between the first node and the third node, if the first node also receives the second response message fed back by the second node through other communication links, the first node will regard all the links that receive the second response message and the links that receive the first response message as candidate communication links, and then select the target communication link from these communication links.
[0012] In one implementation, after receiving the first response message and the second response message, the first node sets the status identifier of the interface that receives the first response message and the second response message to a first identifier, and the first identifier is used to indicate that the corresponding interface is in an available state.
[0013] Wherein, both the first response message and the second response message may carry the first identifier. At this time, the first identifier is used to indicate the liquid level available state of the interface that sends the first response message and the second response message.
[0014] In one implementation, before the first node determines the target communication link from the first communication link and the second communication link, it determines the target interface from the interfaces of the first communication link and the second communication link; the first node sends a first message through the communication link corresponding to the target interface, and the first message includes a second identifier, and the second identifier is used to indicate that the interface that sends the first message is the main interface.
[0015] In the embodiment of the present application, since the first node receives the first response message sent by the second node from the first communication link and the second response message sent by the third node from the second communication link, it can be determined that both the first communication link and the second communication link are available. At this time, the first node can select an interface from the interfaces of the first communication link and the second communication link on the first node as the target interface, and this target interface is the primary interface. The so-called primary interface refers to the interface corresponding to the target communication link preliminarily selected by the first node. Then, the first node sends a first message through the communication link corresponding to the target interface, and this first message is used to notify the node connected to the communication link corresponding to the target interface to use the interface of this communication link as the primary interface.
[0016] In one implementation, after the first node sends the first message through the communication link corresponding to the target interface, when the first node receives a second message that responds to the first message through the target interface, and the second message includes the second identifier, the communication link corresponding to the target interface is used as the target communication link.
[0017] As can be seen from the foregoing introduction, the first message is a message used by the first node to notify the node connected to the communication link corresponding to the target interface to use the interface of this communication link as the primary interface. Correspondingly, the second message is a message used by the node connected to the communication link corresponding to the target interface to confirm using the communication link corresponding to this target interface as the target communication link.
[0018] In one implementation, the process of the first node determining the target interface from the interfaces of the first communication link and the second communication link includes: the first node determines the target interface according to the interface number of the first communication link and the interface number of the second communication link.
[0019] Among them, determining the target interface according to the interface number may be to use the interface with the smallest interface number as the target interface, or to use the interface with the largest interface number as the target interface, or after processing the interface numbers, according to the processed interface numbers, select an interface according to other principles. The embodiment of the present application does not limit this.
[0020] In one implementation, both the first response message and the second response message include a third identifier, and the third identifier is used to identify the node that sends the corresponding message. The implementation process for the first node to select a target interface from the interfaces of the first communication link and the second communication link includes: the first node obtains the third identifier included in each of the received first response message and the second response message; the first node selects a target node from the second node and the third node according to the obtained third identifier; if the target node is the second node, the first node selects a target interface from the interface that receives the first response message, and if the target node is the third node, the first node selects a target interface from the interface that receives the second response message.
[0021] In this implementation, the first node determines the target node through the third identifier carried in each response message, and then selects a communication link from the available communication links between the target node and the first node as the target communication link. In this way, compared with directly selecting the communication link corresponding to the interface with the smallest or largest interface number as the target communication link, it is possible to avoid the problem of excessive pressure on the spine node caused by the target communication links selected by multiple leaf nodes corresponding to the same spine node, thereby being able to avoid the spine node becoming a performance bottleneck and being beneficial to the load balancing of each spine node.
[0022] In one implementation, the implementation process for the first node to select a target node from the sending second node and the third node according to the obtained third identifier is: the first node arranges the obtained third identifiers in a first order to obtain an identifier array; the first node calculates a first value according to the identifier of the first node; the first node uses the node identified by the third identifier ranked at the first value in the identifier array as the target node.
[0023] In one implementation, while selecting the target node, the first node can also select a backup identifier from the identifiers in the identifier array other than the identifier of the target node, use the node identified by the backup identifier as the backup node; select an interface from the interfaces that receive the response messages sent by the backup node, and use the communication link corresponding to the selected interface as the backup communication link; when the first node detects a failure of the target communication link, update the target communication link to the backup communication link. In this way, after the target communication link fails, it can be directly switched to the backup communication link, improving the link switching efficiency.
[0024] In one implementation, the third identifier is a node identifier used to uniquely identify the second node or the third node. Or, when the second node and other spine nodes are deployed on the same hardware device, in order to uniquely identify the second node, the third identifier in the first response message includes the second node and the second node. When the third node and other spine nodes are deployed on the same hardware device, in order to uniquely identify the third node, the third identifier in the second response message includes the node identifier of the third node and the device identifier where the third node is located.
[0025] In one implementation, after the first node determines the target communication link from the first communication link and the second communication link, when the first node detects a failure of the target communication link, it sets the state of the multi-device aggregation interface where the interface of the target communication link on the first node is located to the main interface deactivated state.
[0026] In the embodiments of the present application, the interfaces of all communication links between the first node and the second node and the third node on the first node can be bundled into a multi-device aggregation interface. When there are more spine nodes, the interfaces of the communication links established between the first node and all spine nodes on the first node can form a multi-device aggregation interface. This multi-device aggregation interface is a logical interface. By setting the state of the above multi-device aggregation interface to the main interface deactivated state, it can be indicated that packet transmission is no longer performed through this logical interface.
[0027] In one implementation, after setting the state of the multi-device aggregation interface where the interface of the target communication link on the first node is located to the main interface deactivated state, the first node selects a communication link from the remaining communication links except the target communication link; the first node updates the target communication link to the selected communication link, thereby completing the switching of the communication link.
[0028] In a second aspect, a communication link selection method is provided, which is applied to a second node. The method includes: receiving a first link state message sent by the first node through a first communication link between the second node and the first node; sending a first response message to the first node through the first communication link, so that the first node selects a target communication link according to the first response message, and the target communication link is used for the management node to interact with the first node for control information.
[0029] Wherein, the second node is a spine node, and the first node is a leaf node.
[0030] In an embodiment of the present application, after the second node receives the first link status message sent by the first node, it feeds back a first response message to the first node. In this way, when the first node receives the first response message, it can determine that the first communication link is an available communication link, and then select a target communication link based on this first communication link. It can be seen that in the embodiment of the present application, the selection of the communication link can be achieved through the message interaction between the leaf node and the spine node. In this way, even if there is no direct link between multiple spine nodes, the link selection between the leaf node and the spine node can still be achieved.
[0031] In one implementation, the second node can also receive the first link status message sent by the first node through a third communication link with the first node. Correspondingly, the first response message is sent to the first node through this third communication link, so that the first node can select a target communication link from the first communication link and the third communication link.
[0032] That is to say, in the embodiment of the present application, for the communication links in the link group between the second node and the first node, if the second node receives the first link status message sent by the first node through the communication links in the link group, the first response message can be fed back to the first node through the corresponding communication links, so as to notify the first node that the corresponding communication link is an available communication link, so that the first node can select a target communication link from these available communication links. Among them, the link group between the first node and the second node includes one or more communication links.
[0033] In one implementation, after the second node receives the first link status message through the first communication link, it sets the status identifier of the interface of the first communication link on the second node to a first identifier, and this first identifier is used to indicate that the interface is in an available state.
[0034] In one implementation, the first response message includes the first identifier. In this way, through the first response message, it can be notified that the interface of the communication link for the first node to send the first response message on the second node is in an available state.
[0035] In one implementation, after the second node sends the first response message through the first communication link, if it receives the first message sent by the first node through the first communication link, it takes the first communication link as the target communication link. Among them, the first message includes a second identifier, and this second identifier is used to indicate that the interface for sending the first message is the main interface.
[0036] That is to say, when the first node initially selects the first communication link as the target communication link, it can send a first message through the first communication link. This first message is used to notify the second node that the first node has initially selected the interface of the first communication link on the first node as the primary interface, that is, the first communication link is selected as the target communication link.
[0037] In one implementation, the interfaces of all communication links established between the second node and the first node on the second node can be bundled into an M-Trunk interface. Based on this, after the first communication link is used as the target communication link, the state of this M-Trunk interface is set to the primary interface enabled state.
[0038] In one implementation, after the first communication link is used as the target communication link, the second node sends a second message to the first node through this target communication link. This second message is a response message in reply to the first message, and is used to notify the first node that the second node has confirmed that the first communication link is selected as the target communication link. Among them, the second message may include a second identifier to indicate that the second node has taken the interface of the first communication link on the second node as the primary interface. Or, the second message may also include other confirmation information to indicate that the second node has taken the first communication link as the target communication link.
[0039] In one implementation, after determining the target communication link, the second node sends forwarding guidance information to the management node. This forwarding guidance information is used to instruct the management node to interact with the first node for control information through this target communication link.
[0040] In one implementation, when the second node detects a failure of the target communication link, it sets the state of the M-Trunk interface where the target communication link is located to the primary interface disabled state, so as to update the target communication link according to the message interaction of the first node subsequently.
[0041] It should be noted that the above takes the spine node as the second node as an example. For other spine nodes, when interacting with the first node, the processing method can refer to the processing method of the above second node, and the embodiments of the present application will not elaborate here.
[0042] In a third aspect, a communication link selection device is provided. The communication link selection device has the function of implementing the behavior of the communication link selection method in the above first aspect. The communication link selection device includes at least one module, and this at least one module is used to implement the communication link selection method provided in the above first aspect.
[0043] Fourthly, a communication link selection device is provided, and the communication link selection device has a function of implementing the behavior of the communication link selection method in the second aspect above. The communication link selection device includes at least one module, and the at least one module is used to implement the communication link selection method provided in the second aspect above.
[0044] Fifthly, a network device is provided. The structure of the network device includes a processor and a memory. The memory is used to store a program that supports the network device to execute the communication link selection method provided in the first aspect above, and to store data involved in implementing the communication link selection method provided in the first aspect above. The processor is configured to execute the program stored in the memory. The network device may further include a communication bus, and the communication bus is used to establish a connection between the processor and the memory.
[0045] Sixthly, a network device is provided. The structure of the network device includes a processor and a memory. The memory is used to store a program that supports the network device to execute the communication link selection method provided in the second aspect above, and to store data involved in implementing the communication link selection method provided in the second aspect above. The processor is configured to execute the program stored in the memory. The network device may further include a communication bus, and the communication bus is used to establish a connection between the processor and the memory.
[0046] Seventhly, a computer-readable storage medium is provided. Instructions are stored in the computer-readable storage medium, and when it runs on a computer, it causes the computer to execute the communication link selection method described in the first aspect above.
[0047] Eighthly, a computer-readable storage medium is provided. Instructions are stored in the computer-readable storage medium, and when it runs on a computer, it causes the computer to execute the communication link selection method described in the second aspect above.
[0048] Ninthly, a computer program product containing instructions is provided, and when it runs on a computer, it causes the computer to execute the communication link selection method described in the first aspect above.
[0049] Tenthly, a computer program product containing instructions is provided, and when it runs on a computer, it causes the computer to execute the communication link selection method described in the second aspect above.
[0050] The technical effects obtained in the second aspect to the ninth aspect above are similar to the technical effects obtained by the corresponding technical means in the first aspect, and will not be elaborated here.
[0051] The beneficial effects brought by the technical solutions provided in the embodiments of the present application at least include:
[0052] In the embodiment of the present application, the first node sends a first link state message to the second node through the communication link between the first node and the second node, and sends a second link state message to the third node through the communication link between the first node and the third node. Since the first response message and the second response message are response messages feedback by the nodes connected by the communication links for transmitting the corresponding response messages for the link state messages transmitted on the communication links, the first node can determine that the interfaces of the communication links for transmitting the response messages on the second node and the third node are both in an available state according to the received first response message and second response message. It can be seen that in the embodiment of the present application, with the first node as the leading node, the available communication link can be selected from multiple communication links between the second node and the third node as the target communication link through message interaction between the first node and the second node and the third node. In this way, even if there is no direct link between the second node and the third node, the link selection between the first node and the second node and the third node can still be realized. Description of the Drawings
[0053] Figure 1 is an architecture diagram of a scale-out system adopting a spine-leaf architecture provided by an embodiment of the present application;
[0054] Figure 2 is a schematic structural diagram of a network device provided by an embodiment of the present application;
[0055] Figure 3 is a flowchart of a communication link selection method provided by an embodiment of the present application;
[0056] Figure 4 is a schematic diagram of the message format of a first link state message provided by an embodiment of the present application;
[0057] Figure 5 is a flowchart of another communication link selection method provided by an embodiment of the present application;
[0058] Figure 6 is a schematic structural diagram of a communication link selection device provided by an embodiment of the present application. Detailed Embodiments
[0059] The embodiments of the present application will be further described in detail below in conjunction with the accompanying drawings.
[0060] Before explaining the embodiments of the present application in detail, the network system involved in the embodiments of the present application will be introduced first.
[0061] Figure 1It is a schematic diagram of a scale-out system adopting a spine-leaf architecture provided by an embodiment of the present application. As Figure 1 shown, the system includes leaf nodes 101, spine nodes 102, and a management node 103.
[0062] Among them, the number of leaf nodes 101 and spine nodes 102 is multiple, and the number of management nodes 103 is one or more. Each spine node 102 is communicatively connected to each management node 103. Among them, the spine node 102 and the management node 103 can be directly connected or connected through a network. Each leaf node 101 is also communicatively connected to each spine node 102, and there is a communication link group between a leaf node and a spine node, and the communication link group includes one or more communication links. In this way, for any leaf node 101, there will be multiple communication links between the leaf node and multiple spine nodes 102. In addition, the management node 103 and the leaf node 101 can communicate through an in-band link. Communicating through an in-band link means that the management node 103 communicates with the leaf node through the communication link between the spine node 102 and the leaf node 101. In this case, since there are multiple communication links between a leaf node 101 and multiple spine nodes 102, for a certain leaf node, in order to ensure the certainty of communication, that is, it is necessary to select a communication link from multiple communication links between the leaf node and multiple spine nodes 102 through the communication link selection method provided by the embodiment of the present application to implement the communication between the leaf node 101 and the management node 103. Among them, the communication between the management node 103 and the leaf node 101 refers to the in-band communication performed by the management node 103 due to the control requirements of the leaf node. For example, the management node 103 transmits a message carrying control information to the leaf node through the spine node corresponding to the target communication link and the target communication link.
[0063] It should be noted that the management node 103 is equivalent to the main control board in a frame device and is used to control the spine node 102 and the leaf node 101. The spine node 102 is equivalent to the switching board in a frame device and is used for data transmission. The leaf node 101 is equivalent to the interface board in a frame device and is used to provide out-interface capabilities.
[0064] Among them, the management node 103 can be an independent hardware device or can be deployed in the cloud. Additionally, each spine node 102 can be an independent hardware device, or, in some possible cases, multiple spine nodes 102 can be deployed in the same hardware device. In this case, one or more management nodes 103 can also be deployed in the hardware device where multiple spine nodes 102 are deployed. The embodiments of the present application do not limit this. Among them, the hardware device where the spine node 102 is deployed can be a frame-type or box-type router or switch, or a frame-type central switching frame. The leaf node 101 is a frame-type or box-type router or switch.
[0065] Figure 2 It is a schematic structural diagram of a network device provided by the embodiments of the present application. Figure 1 The leaf node 101 and the spine node 102 shown in [Figure] can both be implemented through this network device. This network device can include one or more processors 201, a communication bus 202, a memory 203, and one or more communication interfaces 204.
[0066] The processor 201 can be a general-purpose central processing unit (CPU), a network processor (NP), a microprocessor, or can be one or more integrated circuits for implementing the solution of the present application. For example, an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The above PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0067] The communication bus 202 is used to transmit information between the above components. The communication bus 202 can be divided into an address bus, a data bus, a control bus, etc. For the sake of simplicity, only a thick line is used to represent it in the figure, but it does not mean that there is only one bus or one type of bus.
[0068] The memory 203 can be a read-only memory (ROM), a random access memory (RAM), an electrically erasable programmable read-only memory (EEPROM), an optical disc (including a compact disc read-only memory (CD-ROM), a compressed optical disc, a laser disc, a digital versatile disc, a Blu-ray disc, etc.), a magnetic disk storage medium, or other magnetic storage devices, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 203 can exist independently and be connected to the processor 201 through the communication bus 202. The memory 203 can also be integrated with the processor 201.
[0069] The communication interface 204 uses any device such as a transceiver for communicating with other devices or communication networks. The communication interface 204 includes a wired communication interface and may also include a wireless communication interface. Among them, the wired communication interface can be, for example, an Ethernet interface. The Ethernet interface can be an optical interface, an electrical interface, or a combination thereof. The wireless communication interface can be a wireless local area networks (WLAN) interface, a cellular network communication interface, or a combination thereof, etc.
[0070] In some embodiments, the network device can include multiple processors, such as Figure 2 the processor 201 and the processor 205 shown in
[0071] In a specific implementation, as an embodiment, the network device can further include an output device 206 and an input device 207. The output device 206 communicates with the processor 201 and can display information in various ways. For example, the output device 206 can be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector, etc. The input device 207 communicates with the processor 201 and can receive user input in various ways. For example, the input device 207 can be a mouse, a keyboard, a touch screen device, or a sensing device, etc.
[0072] In some embodiments, the memory 203 is used to store the program code 208 for executing the solution of this application, and the processor 201 can execute the program code 208 stored in the memory 203. The program code may include one or more software modules, and the network device can implement the communication link selection method provided in the embodiments below Figure 3 through the processor 201 and the program code 208 in the memory 203.
[0073] Next, the communication link selection method provided in the embodiments of this application will be introduced.
[0074] As can be seen from the scale-out system introduced above, a leaf node has established communication links with multiple spine nodes. The leaf node can select a communication link from multiple communication links between the multiple spine nodes through the communication link selection method provided in the embodiments of this application to communicate with the management node. Next, taking a leaf node having established a communication connection with two spine nodes as an example, the implementation process of the leaf node selecting a communication link from multiple communication links between the two spine nodes will be described. For the convenience of description, hereinafter, the leaf node is referred to as the first node, the two spine nodes are respectively referred to as the second node and the third node, and in the embodiments of this application, there is no direct connection link between the second node and the third node. Refer to Figure 3 , the implementation process includes the following steps:
[0075] Step 301: The first node sends a first link status message to the second node through the communication links in the first link group respectively, and the first link group includes the first communication link.
[0076] Among them, the first link group is the link group between the first node and the second node, and the first link group includes one or more communication links between the first node and the second node, and the one or more communication links include the first communication link. In the embodiments of this application, each communication link in the first link group has corresponding interfaces on the first node and the second node. Based on this, the first node sends the first link status message through the interfaces corresponding to each communication link in the first link group on the first node.
[0077] Among them, the first node can periodically send a first link status message to the second node through each communication link in the first link group. For example, the first node sends the first link status message through each communication link in the first link group every preset period. Alternatively, the first node can also send the first link status message through each communication link in the first link group when detecting a failure of the target communication link determined most recently. Alternatively, the first node can also send the first link status message through each communication link in the first link group when detecting failures of both the target communication link and the backup link selected most recently.
[0078] It should be noted that the first link status message is used to collect the status information of the interfaces of each communication link in the first link group on the second node. Optionally, the first link status message includes an identification field. Among them, since the first node cannot confirm the availability of the interfaces corresponding to each communication link on the first node when sending the first link status message through each communication link in the first link group, the identification field of the first link status message includes a fourth identifier, which is used to indicate that the interface sending the first link status message is unavailable. In addition, since the first node has not selected the primary interface when sending the first link status message, the identification field of the first link status message further includes a fifth identifier, and this fifth identifier is used to indicate that the interface sending the first link status message is not the primary interface.
[0079] In addition, in the embodiments of the present application, the interfaces corresponding to all communication links between the first node and the second node and the third node on the first node can be bundled into a multi-device trunk (M-Trunk) interface, and this M-Trunk interface corresponds to an interface identifier, and this interface identifier can be the media access control (MAC) address assigned to this M-Trunk interface. In this case, the first link status message also carries the interface identifier of this M-Trunk interface. In addition to this, the first link status message further includes other protocol fields, which are used to indicate the message attributes of this first link status message.
[0080] Exemplarily, Figure 4 is a schematic diagram of the message format of a first link status message provided by an embodiment of the present application. As Figure 4As shown in the figure, the first link state packet includes an Ethernet header and an M-Trunk header. The Ethernet header includes a destination MAC field, a source MAC field, and an Ethernet protocol field. Among them, both the destination MAC field and the Ethernet protocol field carry default values, and the source MAC field carries the interface identifier of the aforementioned M-Trunk interface. The M-Trunk header includes a subtype field, a version field, an identifier field, and a system MAC field. Among them, the subtype field carries a default value, and this subtype field, in cooperation with the destination MAC field and the Ethernet protocol field in the Ethernet header, is used to indicate that the first link state packet is a packet for collecting interface status information, so that the second node receiving the first link state packet can correctly parse the first link state packet. The version field is used to indicate which version of the packet format the current packet format is, so as to identify the first link state packets extended in different scenarios. The identifier field includes the aforementioned fourth identifier indicating that the outgoing interface of the first link state packet is in an unavailable state and the fifth identifier indicating that the outgoing interface of the first link state packet is not the primary interface. It should be noted that these two identifiers can be arranged in a specified order, so that the second node can parse and obtain them in accordance with this specified order. The system MAC field is used to carry the identifier of the device where the first node is located.
[0081] Step 302: The first node sends second link state packets to the third node through the communication links in the second link group respectively. The second link group includes a second communication link.
[0082] Among them, the second link group is the link group between the first node and the third node. The second link group includes one or more communication links between the first node and the third node, and the one or more communication links include a second communication link. In the embodiments of the present application, each communication link in the second link group has corresponding interfaces on the first node and the third node. Based on this, the first node sends second link state packets through the interfaces corresponding to each communication link in the second link group on the first node.
[0083] Among them, the timing for the first node to send second link state packets through each communication link in the second link group can refer to the timing for sending the first link state packet in the aforementioned step 301. Moreover, the first node can send the first link state packet and the second link state packet synchronously, that is, when the first node reaches the sending timing described in step 301, it can send link state packets to the second node and the third node simultaneously.
[0084] In addition, the packet format and the information carried by the second link state packet can refer to the packet format and the information carried by the first link state packet. Optionally, the second link state packet and the first link state packet are the same packet.
[0085] Step 303: The second node sends a first response message to the first node through the first communication link, where the first response message is a response message to the first link status message.
[0086] As introduced in the foregoing step 301, each communication link in the first link group has a corresponding interface on the second node. Based on this, the second node can receive the first link status message through the interfaces corresponding to the communication links in the first link group on the second node. Among them, for the interface that receives the first link status message among these interfaces corresponding to the first link group on the second node, the second node can set the status flag of the corresponding interface to the first flag, where the first flag is used to indicate that the interface is in an available state. For the interface that does not receive the first link status message among these interfaces corresponding to the first link group on the second node, it means that the communication link corresponding to the corresponding interface is unavailable. At this time, the status flag of the corresponding interface is set to the fourth flag to indicate that the interface is unavailable.
[0087] After setting the status flags of the interfaces corresponding to the communication links in the first link group on the second node, the second node feeds back the first response message to the first node through the communication links in the first link group. For example, the first response message is sent through the first communication link in the first link group. Among them, the first communication link refers to any one of the communication links corresponding to the interface that receives the first link status message on the second node, and the first response message is a response message in response to the first link status message.
[0088] It should be noted that the message format of the first response message can refer to the message format of the first link status message introduced above. Different from the first link status message, the identification field of the first response message carries the first flag instead of the fourth flag, so as to notify the first node that the interface of the first response message is in an available state.
[0089] In addition, since the second node may establish communication links with other leaf nodes in addition to the communication link with the first node, based on this, in the embodiment of the present application, the interfaces of the communication link between the second node and the first node on the second node can be bundled into an M-Trunk interface. That is, the interfaces of the communication links in the first link group on the second node are bundled into an M-Trunk interface. Correspondingly, the source MAC field of the first response message carries the interface identifier of the M-Trunk interface, where the interface identifier of the M-Trunk interface can be the MAC address assigned to the M-Trunk interface.
[0090] In addition, different from the first link state message, the device identifier of the device where the second node is located is carried in the system MAC field in the first response message.
[0091] Optionally, if the second node is not deployed alone on a hardware device but is deployed on the same hardware device as other spine nodes, considering that the identifiers of the same device are the same, the second node cannot be uniquely identified solely by the device identifier carried in the system MAC field. Therefore, the first response message further includes an extended field that carries the node identifier of the second node. In this way, the second node can be uniquely identified by the node identifier of the second node and the device identifier carried in the system MAC field.
[0092] Optionally, if the communication link corresponding to the interface on the second node that receives the first link state message includes other communication links in addition to the first communication link, the second node can send the first response message through other communication links while sending the first response message through the first communication link. For example, assuming that in addition to the interface corresponding to the first communication link, the interface corresponding to the third communication link in the first link group on the second node also receives the first link state message, the second node can also feedback the first response message to the first node through the third communication link.
[0093] Step 304: The third node sends a second response message to the first node through the second communication link, and the second response message is a response message to the second link state message.
[0094] The third node receives the second link state message through the interfaces corresponding to the respective communication links in the second link group on the third node. Among them, for the interfaces that receive the second link state message among these interfaces corresponding to the second link group, the third node can set the status identifier of the corresponding interface to a first identifier, where the first identifier is used to indicate that the interface is in an available state. For the interfaces that do not receive the second link state message among these interfaces corresponding to the second link group, it indicates that the communication link corresponding to the corresponding interface is unavailable. At this time, the status identifier of the corresponding interface is set to a fourth identifier to indicate that the interface is unavailable.
[0095] After setting the status identifiers of the interfaces corresponding to the respective communication links in the second link group on the third node, the third node feeds back the second response message to the first node through the second communication link. Among them, the second communication link refers to any one of the communication links corresponding to the interface on the third node that receives the second link state message, and the second response message is a response message in response to the second link state message.
[0096] It should be noted that the implementation method of the second response message can refer to the implementation method of the first response message introduced above. Different from the first response message, the interface identifier of the M-Trunk interface bundled by the interfaces of each communication link in the second link group on the third node is carried in the source MAC field of the second response message.
[0097] In addition, the identifier of the device where the third node is located is carried in the system MAC field of the second response message. In the case of an extended field, the node identifier of the third node is carried in the extended field.
[0098] Optionally, if the communication link corresponding to the interface on the third node that receives the second link status message includes other communication links in addition to the second communication link, the second node can send the second response message through other communication links while sending the second response message through the second communication link. For example, assuming that in addition to the interface corresponding to the second communication link, the interface corresponding to the fourth communication link in the second link group on the second node also receives the second link status message, the second node can also feedback the second response message to the first node through the fourth communication link.
[0099] Step 305: The first node determines a target communication link from the first communication link and the second communication link, and this target communication link is used for the first node to communicate with the management node.
[0100] If the first node receives the first response message through the first communication link and the second response message through the second communication link, it means that both the first communication link and the second communication link are available links. In this case, the first node selects one of the first communication link and the second communication link as the target communication link for interacting with the management node for control information. The management node has established communication links with the second node and the third node respectively, and the second node and the third node have established communication links with the first node respectively. Therefore, when the management node interacts with the first node through this target communication link, this control information also needs to pass through the communication link between the management node and the second node or the third node corresponding to this target communication link.
[0101] Among them, when the first node receives the first response message through the first communication link, the status identifier of the interface that receives the first response message can be set to the first identifier to indicate that this interface that receives the first response message is an available interface. Similarly, when the first node receives the second response message through the second communication link, the status identifier of the interface that receives the second response message is set to the first identifier to indicate that the interface that receives the second response message is an available interface.
[0102] It should be noted that a status flag array can be stored in the first node, and each bit in the status flag array is the status flag of an interface. Among them, the arrangement order of the status flags of each interface in the status flag array can be arranged in ascending or descending order according to the interface numbers of each interface. The embodiments of the present application do not limit this. Based on this, after the first node receives a response message through a certain interface, it can determine the position of the status flag corresponding to the interface in the status flag array according to the interface number of the interface, and set the status flag at this position to the first flag.
[0103] After setting the status flags of the interfaces for receiving the first response message and the second response message to the first flag, the first node determines a target interface from the interfaces corresponding to the first communication link and the second communication link on the first node. Among them, this target interface is the main interface selected by the first node.
[0104] In a possible implementation manner, the first node determines the target interface according to the interface numbers of the interfaces corresponding to the first communication link and the second communication link on the first node. For example, the interface with the smallest interface number is used as the target interface, or the interface with the largest interface number is used as the target interface. The embodiments of the present application do not limit this.
[0105] In another possible implementation manner, as introduced above, both the first response message and the second response message carry the device identifier where the node is located, or both carry the device identifier where the node is located and the node identifier. For the convenience of subsequent description, the such identifiers carried in the first response message and the second response message are referred to as the third identifier. Based on this, in this implementation manner, the first node respectively obtains the third identifier carried in each received response message from the first response message and the second response message, selects a target node from the second node and the third node according to the obtained third identifier, and selects a target interface from the interfaces for receiving the response message sent by the target node.
[0106] Exemplarily, the first node arranges the obtained third identifiers in the first order to obtain an identifier array. Then, the first node calculates a first value according to the identifier of the first node and the number of the obtained third identifiers, and uses the node identified by the third identifier ranked at the first value in the identifier array as the target node. Among them, the first order refers to the ascending or descending order of the interface numbers of the interfaces for receiving each third identifier.
[0107] It should be noted that, in some possible cases, as introduced in the aforementioned step 304, the second node may not only feedback the first response message to the first node through the first communication link, but also feedback the first response message to the first node through other communication links in the first link group. In this way, there may be multiple first response messages received by the first node. Similarly, there may also be multiple second response messages received by the first node. For the response messages feedback by the same node through different communication links, the third identifiers carried by these response messages are all the same. Based on this, the third identifiers obtained by the first node from each response message may have duplicate identifiers. Therefore, before sorting the third identifiers in the first order, the first node can also remove the duplicates of the obtained third identifiers.
[0108] In addition, if the third identifier is the device identifier where the node is located, the first node obtains the identifier of the device where it is located as the identifier of the first node. If the third identifier includes the device identifier where the node is located and the node identifier, the first node obtains the device identifier where it is located and the node identifier as the identifier of the first node. Among them, the device identifier can be the MAC address of the device, and the node identifier can be the MAC address of the node. After that, the first node divides its own identifier into multiple fields, processes these multiple fields, and takes the remainder obtained by dividing the processing result by the number of the obtained third identifiers as the first value. Wherein, the first node dividing its own identifier into multiple fields may refer to dividing it into multiple fields with the same length, or it may also be divided into multiple fields with different lengths. Processing the multiple fields may refer to performing an exclusive OR operation or other operation processing on the multiple fields, which will not be elaborated in this embodiment of the present application.
[0109] It should be noted that the above is only a possible way to calculate the first value given in this embodiment of the present application. The first node can also perform hashing on each third identifier through other hash algorithms to obtain the first value, and this embodiment of the present application does not limit this.
[0110] In this embodiment of the present application, the target node is determined through the third identifier carried by each response message, and then a communication link is selected from the available communication links between the target node and the first node as the target communication link. In this way, compared with directly selecting the communication link corresponding to the interface with the smallest or largest interface number as the target communication link, it can avoid the problem of excessive pressure on the spine node caused by the target communication links selected by multiple leaf nodes corresponding to the same spine node, thereby avoiding the spine node becoming a performance bottleneck and being beneficial to the load balancing of each spine node.
[0111] Optionally, after using the node identified by the third identifier ranked first in the identifier array as the target node, the first node may also select a standby identifier from the identifiers in the identifier array other than the identifier of the target node, and use the node identified by the standby identifier as the standby node. Select an interface from the interfaces for receiving response messages sent by the standby node, and use the communication link corresponding to the selected interface as the standby communication link. The standby communication link is used as a switching link in case of a failure of the target communication link.
[0112] In the embodiment of the present application, since the number of spine nodes is exemplified as two, the identifier array will include two third identifiers. In this case, after determining the target node, only the other node except the target node needs to be used as the standby node. However, when the first node is connected to more other spine nodes in addition to being connected to the second node and the third node, the identifier array will include more third identifiers. In this case, after determining the target node, the first node may randomly select an identifier from the remaining identifiers in the identifier array except the third identifier corresponding to the target node as the standby identifier, or the first node may use the next identifier after the identifier of the target node in the identifier array as the standby identifier. Additionally, after using the node identified by the standby identifier as the standby node, since the first node may also receive multiple response messages sent by the standby node, the first node may select the interface with the smallest or largest interface number from the multiple interfaces for receiving the response messages of the standby node, and then use the communication link corresponding to the selected interface as the standby communication link. Of course, the first node may also select an interface from the multiple interfaces for receiving the response messages of the standby node in other ways, such as randomly selecting, and the embodiment of the present application does not limit this.
[0113] After determining the target node, the first node may select an interface as the target interface from the interfaces that receive the response message sent by the target node. For example, when the target node is determined to be the second node in the above manner, the first node may select an interface as the target interface from the interfaces that receive the second response message. Among them, if the interfaces that receive the second response message only include the interfaces corresponding to the first communication link on the first node, then the target interface is the interface corresponding to the first communication link on the first node. Optionally, in some possible cases, as described in the foregoing step 303, the second node may also feedback the first response message through other communication links in the first link group except the first communication link. For example, the first response message is feedback through the third communication link. In this case, there may be multiple interfaces on the first node that receive the first response message. In this case, the first node may select an interface as the target interface from the multiple interfaces that receive the first response message according to the interface number size. Similarly, if the determined target node is the third node, the first node may select an interface as the target interface from the interfaces that receive the second response message with reference to the above method, which will not be elaborated in this embodiment of the present application.
[0114] After determining the target interface, in a possible implementation manner, the first node directly uses the communication link corresponding to the target interface as the target communication link. Optionally, as introduced in the foregoing, the interfaces of all communication links established between the first node and the second node and the third node on the first node are bundled into an M-Trunk interface. Based on this, the first node may also configure the M-Trunk interface to the main interface enabled state.
[0115] In another possible implementation manner, the first node sends a first message through the communication link corresponding to the target interface. The first message includes a second identifier, and the second identifier is used to indicate that the interface sending the first message is the main interface; then, the communication link corresponding to the target interface is used as the target communication link.
[0116] Among them, the first node may first set the second identifier for the target interface, and then send the first message through the communication link corresponding to the target interface. Among them, the message format of the first message may refer to the foregoing first link status message. Different from the first link status message, the identifier field of the first message carries the first identifier and the second identifier, rather than the fourth identifier and the fifth identifier. Through the first message, the first node can notify the target node which communication link's interface has been selected as the main interface.
[0117] After sending the first message to the target node via the communication link corresponding to the target interface, in one possible implementation, the first node directly uses the communication link corresponding to the target interface as the target communication link. In another possible implementation, after receiving the first message sent by the first node, the target node can also feedback a second message in response to the first message to the first node to confirm the primary interface selected by the first node. Accordingly, when the first node receives the second message in response to the first message via the target interface and the second message carries a second identifier, the communication link corresponding to the target interface is used as the target communication link. Optionally, as introduced above, all the communication links established by the first node with the second node and the third node are bundled into an M-Trunk interface on the first node. Based on this, after the first node uses the communication link corresponding to the target interface as the target communication link, it can also configure the M-Trunk interface to the primary interface enabled state, that is, set the M-Trunk interface including the target interface to the primary interface enabled state.
[0118] Among them, after receiving the first message, the target node can set a primary interface identifier for the interface that receives the first message, and configure the M-Trunk interface composed of the interfaces of the link group where the target communication link is located on the target node to the primary interface enabled state. Then, the target node feedbacks the second message to the first node through this interface. Among them, the message format of the second message can refer to the message format of the first response message introduced above. Different from the first response message, the identifier field of the second message also carries the first identifier and the second identifier.
[0119] In addition, after configuring the M-Trunk interface composed of the interfaces of the link group where the target communication link is located on the target node to the primary interface enabled state, the target node can also send forwarding guidance information to the management node, and the forwarding guidance information is used to instruct the management node to communicate with the first node through this target communication link. Among them, the target node can send the forwarding guidance information to the management node in a routing manner, or can also send the forwarding guidance information to the management node in other ways. For example, when the management node and the target node are connected through a layer 2 network, a gratuitous address resolution protocol (ARP) is used to refresh the forwarding table of the layer 2 network to achieve the sending of the forwarding guidance information. The embodiments of the present application do not limit this.
[0120] The above mainly introduces the process of the first node selecting the target communication link. After selecting the target communication link, the first node can also detect in real time whether the target communication link fails, so as to select other communication links in time to update the target communication link when detecting a target communication link failure.
[0121] Among them, after determining the target communication link, the first node can regularly send a first message to the target node through the target communication link to detect whether the target communication link fails. For example, the first node sends the first message to the target node through the target communication link according to the period of sending the first link status message before.
[0122] In some possible cases, if the target node fails to receive the first message sent by the first node continuously for multiple times, it indicates that there is a failure in the communication from the first node to the target node on the target communication link. At this time, the target node changes the status identifier of the interface corresponding to the target communication link on the target node to the fourth identifier, changes the second identifier set for this interface to the fifth identifier, and configures the M-Trunk interface composed of the interfaces of the link group where the target communication link is located on the target node to the main interface deactivation state. Then, the target node feeds back a third message to the first node through the target communication link. Among them, the message format of this third message can refer to the message format of the first response message or the second response message. Different from the foregoing response messages, the fourth identifier and the fifth identifier are carried in the identifier field of the third message. Subsequently, if the first node receives the third message, it indicates that the communication from the target node to the first node on the target communication link is normal. However, since there is a failure in the communication from the first node to the target node on the target communication link, in this case, the first node determines that the target communication link fails, changes the status identifier of the interface corresponding to the target communication link on the first node to the fourth identifier, changes the second identifier set for this interface to the fifth identifier, and sets the M-Trunk interface including this interface to the main interface deactivation state. Then, the first node updates the target communication link, that is, re-determines the target communication link.
[0123] In some other possible cases, if the target node can receive the first message sent by the first node, it indicates that there is no fault in the communication from the first node to the target node on the target communication link. Thus, after each receipt of a first message by the target node, the target node feeds back a fourth message in response to the first message to the first node. Among them, the message format of the fourth message can refer to the message format of the aforementioned second message. In addition, as introduced above, in the case where there is a fault in the communication from the first node to the target node on the target communication link, the target node can feed back a third message to the first node. Based on this, if the first node fails to receive any message (including the third message and the fourth message) fed back by the target node for multiple consecutive times, it indicates that there is a fault in the communication from the target node to the first node on the target communication link. In this case, the first node determines that the target communication link is faulty, modifies the status identifier of the interface corresponding to the target communication link on the first node to the fourth identifier, modifies the second identifier set for the interface to the fifth identifier, and sets the M-trunk interface including the interface to the main interface deactivated state. Then, the first node sends a fifth message to the target node through the target communication link. Among them, the message format of the fifth message can refer to the message format of the first message. Different from the first message, the identifier field of the fifth message carries the fourth identifier and the fifth identifier. After the first node sends the fifth message, if there is no fault in the communication from the first node to the target node on the target communication link, the target node will be able to receive the fifth message sent by the first node. In this case, after receiving the fifth message, the target node can modify the status identifier of the interface for receiving the fifth message to the fourth identifier, modify the second identifier set for the interface to the fifth identifier, and set the M-Trunk interface composed of the interfaces of the link group where the target communication link is located on the target node to the main interface deactivated state. After determining the target communication link fault, the first node updates the target communication link, that is, re-determines the target communication link.
[0124] It should be noted that in the embodiment of the present application, after determining the target communication link, while the first node regularly sends the first message to the target node through the target communication link, it can also continue to send the first link state message to the corresponding node through each communication link with other nodes, and set the status identifier of the interface corresponding to the corresponding communication link on the first node according to the situation of the response messages fed back by other communication links. In this way, the first node can refresh the available state of the communication links between it and other nodes in real time. In this case, when the first node re-determines the target communication link after detecting the target communication link fault, it can select an interface from the interfaces with the status identifier of the first identifier, use the selected interface as the updated target interface, and use the communication link corresponding to the target interface as the updated target communication link.
[0125] Among them, after the first node obtains the updated target interface, the process of determining the target communication link according to the target interface can refer to the relevant introduction in the foregoing embodiments, and will not be elaborated herein in the embodiments of the present application.
[0126] Optionally, if the first node also selects a backup communication link when selecting the target communication link, then in the embodiments of the present application, while the first node periodically sends a first message to the target node through the target communication link, it also sends a first link status message to the backup node through the backup communication link, and sets the status flag of the interface corresponding to the backup communication link on the first node according to the situation of the response message fed back by the backup communication link. In this way, the first node can refresh the available status of the backup communication link in real time. For other communication links other than the target communication link and the backup communication link, the first node temporarily stops sending the first link status message through these communication links. In this way, the resource overhead of the first node can be reduced. Correspondingly, in this case, when the first node re-determines the target communication link after detecting a failure of the target communication link, if the status flag of the interface corresponding to the backup communication link is the first flag, the first node directly uses the backup communication link as the updated target communication link. If the status flag of the interface corresponding to the backup communication link is the fourth flag, the first node re-executes steps 301-305 to select the target communication link.
[0127] Optionally, in a possible implementation manner, since there will be no other backup communication links after the first node uses the backup communication link as the updated target communication link, the first node can also send the first link status message through other communication links after using the backup communication link as the updated target communication link, and select a communication link from other communication links as the new backup communication link according to the situation of the response message fed back by other communication links.
[0128] Alternatively, in another possible implementation manner, when the first node has not yet detected a failure of the target communication link, if the first node detects through the first link status message that the backup communication link is unavailable, the first node can also send the first link status message through other communication links, and select a communication link from other communication links as the new backup communication link according to the situation of the response message fed back by other communication links.
[0129] In the embodiment of the present application, the first node sends a first link state message to the second node through the communication link with the second node, and sends a second link state message to the third node through the communication link with the third node. Since the first response message and the second response message are response messages feedback by the nodes connected by the communication links transmitting the corresponding response messages for the link state messages transmitted on the communication links, the first node can determine that the interfaces of the communication links transmitting the response messages on the second node and the third node are both in an available state according to the received first response message and second response message. It can be seen that in the embodiment of the present application, with the first node as the leading node, the available communication link can be selected from multiple communication links between the second node and the third node as the target communication link through message interaction between the first node and the second node and the third node. In this way, even if there is no direct link between the second node and the third node, the link selection between the first node and the second node and the third node can still be achieved.
[0130] In the above embodiment, the communication link selection method provided by the embodiment of the present application is mainly explained by taking the example of a leaf node connecting two spine nodes. When a leaf node is connected to more than two spine nodes, the processing method for each spine node can refer to the processing methods for the second node and the third node introduced in the foregoing embodiment, and the embodiment of the present application will not elaborate herein.
[0131] To better illustrate the communication link selection method introduced above, next, taking the first node connected to the second node and the third node respectively, and the first link group including two communication links M1 and M2, and the second link group including two communication links N1 and N2 as an example, the process of selecting the target communication link is exemplarily illustrated. Among them, the interfaces of M1, M2, N1, and N2 on the first node form the M-Trunk1 interface. The interfaces of M1 and M2 on the second node form the M-Trunk2 interface, and the interfaces of N1 and N2 on the third node form the M-Trunk3 interface. See Figure 5 , the process includes the following steps:
[0132] 1. The first node sends a first link state message to the second node through M1 and M2 respectively. In this message, R = 0 and S = 0, where R = 0 is the fourth identifier in the identifier field used to indicate that the interface for sending the first link state message is in an unavailable state, and S = 0 is the fifth identifier in the identifier field used to indicate that the interface for sending the first link state message is not the main interface.
[0133] 2. The first node sends a second link state message to the second node through N1 and N2 respectively. In this message, R = 0 and S = 0.
[0134] 3. After receiving the first link status message through M1 and M2, the second node sets the status identifier of the interfaces of M1 and M2 to R = 1.
[0135] 4. The second node respectively feeds back the first response message to the first node through M1 and M2. In this message, R = 1 and S = 0. Among them, R = 1 is the first identifier carried in the identifier field for indicating that the interface sending the first response message is in an available state. That is, the identifier field of this message carries the first identifier and the fifth identifier.
[0136] 5. After receiving the second link status message through N1 and N2, the third node sets the status identifier of the interfaces of N1 and N2 to R = 1.
[0137] 6. The third node respectively feeds back the second response message to the first node through N1 and N2. In this message, R = 1 and S = 0. That is, the identifier field of this message carries the first identifier and the fifth identifier.
[0138] 7. After receiving the response message through M1, M2, N1, and N2, the first node sets the status identifier of the interface corresponding to each communication link to R = 1.
[0139] 8. The first node selects the interface intf1 of M1 as the primary interface from all the interfaces with R = 1, and sets S = 1 for intf1. That is, the second identifier is set for intf1.
[0140] 9. The first node sends the first message to the second node through M1. In this message, R = 1 and S = 1. Among them, S = 1 is the second identifier in the identifier field for indicating that the interface sending the first message is the primary interface.
[0141] 10. After receiving the first message, the second node sets the M-Trunk2 interface including the interface corresponding to M1 to the up state. That is, the primary interface enabled state is set.
[0142] 11. The second node feeds back the second message to the first node through M1. In this message, R = 1 and S = 1. That is, the identifier field of the second message includes the first identifier and the second identifier.
[0143] 12. After receiving the second message, the first node sets the M-Trunk1 interface including intf1 to the up state.
[0144] Next, the communication link selection device provided by the embodiments of the present application will be introduced.
[0145] See Figure 6 , the embodiments of the present application provide a communication link selection device 600, and this device 600 includes:
[0146] A sending module 601, configured to implement step 301 and step 302 in the foregoing embodiment;
[0147] A receiving module 602, configured to implement step 303 and step 304 in the foregoing embodiment;
[0148] A determining module 603, configured to implement step 305 in the foregoing embodiment.
[0149] It should be noted that, the sending module 601 and the receiving module 602 may be implemented by a processor in the network device shown above controlling a communication interface, and the determining module 603 is implemented by a processor in the network device shown above. Figure 2 shown above Figure 2 shown above
[0150] Optionally, the first link group further includes a third communication link, and the receiving module 602 is further configured to: receive a first response message through the third communication link; the determining module 603 is configured to: determine a target communication link from the first communication link, the second communication link, and the third communication link.
[0151] Optionally, the second link group further includes a fourth communication link, and the receiving module 602 is further configured to: receive a second response message through the fourth communication link; the determining module 603 is configured to: determine a target communication link from the first communication link, the second communication link, the third communication link, and the fourth communication link.
[0152] Optionally, the apparatus 600 is further configured to:
[0153] Set a status identifier of an interface for receiving the first response message and the second response message to a first identifier, where the first identifier is used to indicate that the corresponding interface is in an available state.
[0154] Optionally, the apparatus 600 is further configured to:
[0155] Determine a target interface from interfaces of the first communication link and the second communication link;
[0156] Send a first message through a communication link corresponding to the target interface, where the first message includes a second identifier, and the second identifier is used to indicate that the interface for sending the first message is a main interface.
[0157] Optionally, the determining module 603 is configured to:
[0158] When a second message in response to the first message is received through the target interface, and the second message includes the second identifier, use the communication link corresponding to the target interface as the target communication link.
[0159] Optionally, the apparatus 600 is further configured to:
[0160] Determine a target interface according to the interface number of the first communication link and the interface number of the second communication link.
[0161] Optionally, both the first response message and the second response message include a third identifier for identifying the node that sends the corresponding message. The apparatus 600 is further configured to:
[0162] Obtain the third identifier included in each of the received first response message and second response message;
[0163] Select a target node from the second node and the third node according to the obtained third identifier;
[0164] If the target node is the second node, select a target interface from the interfaces that receive the first response message; if the target node is the third node, select a target interface from the interfaces that receive the second response message.
[0165] In summary, in the embodiment of the present application, the first node sends a first link status message to the second node through the communication link with the second node, and sends a second link status message to the third node through the communication link with the third node. Since the first response message and the second response message are response messages feedback by the nodes connected by the communication links that transmit the corresponding response messages for the link status messages transmitted on these communication links, the first node can determine that the interfaces of the communication links that transmit these response messages on the second node and the third node are both in an available state according to the received first response message and second response message. It can be seen that in the embodiment of the present application, with the first node as the leading node, the available communication link can be selected from multiple communication links between the second node and the third node through message interaction between the first node and the second node and the third node. In this way, even if there is no direct link between the second node and the third node, the link selection between the first node and the second node and the third node can still be achieved.
[0166] It should be noted that when the communication link selection apparatus provided in the above embodiment selects a communication link, only the division of the above function modules is used for illustration. In actual application, the above functions can be allocated to different function modules according to needs, that is, the internal structure of the device is divided into different function modules to complete all or part of the functions described above. In addition, the communication link selection apparatus provided in the above embodiment and the embodiment of the communication link selection method belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0167] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., Digital Versatile Disc (DVD)), or a semiconductor medium (e.g., Solid State Disk (SSD)), etc.
[0168] Those of ordinary skill in the art can understand that all or part of the steps to implement the above embodiments can be completed by hardware, or can be completed by a program instructing relevant hardware. The program can be stored in a computer-readable storage medium. The storage medium mentioned above can be a read-only memory, a magnetic disk, or an optical disc, etc.
[0169] It should be understood that the "at least one" mentioned herein refers to one or more, and "a plurality" refers to two or more. In the description herein, unless otherwise specified, " / " means "or". For example, A / B can mean A or B. The "and / or" herein is merely a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, for the convenience of clearly describing the technical solutions of the embodiments of the present application, in the embodiments of the present application, terms such as "first" and "second" are used to distinguish the same items or similar items with basically the same functions and roles. Those skilled in the art can understand that the terms "first", "second", etc. do not limit the quantity and execution order, and the terms "first", "second", etc. do not necessarily mean different.
[0170] The foregoing does not limit the embodiments of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the embodiments of the present application shall be included within the protection scope of the embodiments of the present application.
Claims
1. A communication link selection method, characterized in that The method includes: The first node respectively sends first link status messages to the second node through communication links in a first link group. The first link group is the link group between the first node and the second node, and the first link group includes a first communication link. The first link status message is used to collect the status information of the interfaces of each communication link in the first link group on the second node, and the status information includes an available state or an unavailable state. The first node respectively sends second link status messages to the third node through communication links in a second link group. The second link group is the link group between the first node and the third node, and the second link group includes a second communication link. There is no direct link between the second node and the third node. The second link status message is used to collect the status information of the interfaces of each communication link in the second link group on the third node. The first node receives a first response message through the first communication link. The first response message is a response message to the first link status message. The first communication link refers to any one of the communication links corresponding to the interface on the second node that receives the first link status message. The first response message is used to notify that the status information of the interface that receives the first link status message is in an available state. The first node receives a second response message through the second communication link. The second response message is a response message to the second link status message. The second communication link refers to any one of the communication links corresponding to the interface on the third node that receives the second link status message. The second response message is used to notify that the status information of the interface that receives the second link status message is in an available state. Based on the fact that the status information of the interface of the first communication link on the second node is in an available state and the status information of the interface of the second communication link on the third node is in an available state, the first node determines a target communication link from the first communication link and the second communication link. The target communication link is used for the first node to communicate with the management node.
2. The method according to claim 1, wherein The first link group further includes a third communication link. The method further includes: the first node receives the first response message through the third communication link. The first node determining the target communication link from the first communication link and the second communication link includes: The first node determines the target communication link from the first communication link, the second communication link, and the third communication link.
3. The method according to claim 2, wherein The second link group further includes a fourth communication link. The method further includes: the first node receives the second response message through the fourth communication link. The first node determining the target communication link from the first communication link and the second communication link includes: The first node determines the target communication link from the first communication link, the second communication link, the third communication link, and the fourth communication link.
4. The method according to any one of claims 1-3, characterized in that, The method further includes: The first node respectively sets the status identifiers of the interfaces for receiving the first response message and the second response message to a first identifier, and the first identifier is used to indicate that the corresponding interface is in an available state.
5. The method according to any one of claims 1 to 3, characterized in that, Before the first node determines a target communication link from the first communication link and the second communication link, it further includes: The first node determines a target interface from the interfaces of the first communication link and the second communication link; The first node sends a first message through the communication link corresponding to the target interface, and the first message includes a second identifier, and the second identifier is used to indicate that the interface for sending the first message is the main interface.
6. The method according to claim 5, wherein The first node determines a target communication link from the first communication link and the second communication link, including: When the first node receives a second message in response to the first message through the target interface, and the second message includes the second identifier, the communication link corresponding to the target interface is used as the target communication link.
7. The method according to claim 5, characterized in that, The first node determines a target interface from the interfaces of the first communication link and the second communication link, including: The first node determines the target interface according to the interface number of the first communication link and the interface number of the second communication link.
8. The method according to claim 5, wherein Both the first response message and the second response message include a third identifier, and the third identifier is used to identify the node that sends the corresponding message. The first node selects a target interface from the interfaces of the first communication link and the second communication link, including: The first node obtains the third identifier included in each of the received first response message and second response message; The first node selects a target node from the second node and the third node according to the obtained third identifier; If the target node is the second node, the first node selects a target interface from the interfaces for receiving the first response message; if the target node is the third node, the first node selects a target interface from the interfaces for receiving the second response message.
9. A communication link selection device, characterized in that, Applied to a first node, the device includes: A sending module, configured to respectively send a first link status message to a second node through a communication link in a first link group, where the first link group is a link group between the first node and the second node, the first link group includes a first communication link, and the first link status message is used to collect status information of the interfaces of each communication link in the first link group on the second node, and the status information includes an available state or an unavailable state; respectively send a second link status message to a third node through a communication link in a second link group, where the first link group is a link group between the first node and the third node, the second link group includes a second communication link, and there is no direct link between the second node and the third node, and the second link status message is used to collect status information of the interfaces of each communication link in the second link group on the third node; A receiving module, configured to receive a first response message via the first communication link, where the first response message is a response message to the first link status message, and the first communication link refers to any one of the communication links corresponding to the interface on the second node that receives the first link status message. The first response message is used to notify that the status information of the interface that receives the first link status message is in an available state; receive a second response message via the second communication link, where the second response message is a response message to the second link status message, and the second communication link refers to any one of the communication links corresponding to the interface on the third node that receives the second link status message. The second response message is used to notify that the status information of the interface that receives the second link status message is in an available state; A determining module, configured to determine a target communication link from the first communication link and the second communication link based on the fact that the status information of the interface of the first communication link on the second node is in an available state and the status information of the interface of the second communication link on the third node is in an available state. The target communication link is used for the first node to communicate with the management node.
10. The device according to claim 9, characterized in that, The first link group further includes a third communication link, and the receiving module is further configured to: receive the first response message via the third communication link; The determining module is configured to: determine the target communication link from the first communication link, the second communication link, and the third communication link.
11. The device according to claim 10, wherein, The second link group further includes a fourth communication link, and the receiving module is further configured to: receive the second response message via the fourth communication link; The determining module is configured to: determine the target communication link from the first communication link, the second communication link, the third communication link, and the fourth communication link.
12. The device according to any one of claims 9-11, characterized in that, The device is further configured to: Set the status identifier of the interface that receives the first response message and the second response message to a first identifier, where the first identifier is used to indicate that the corresponding interface is in an available state.
13. The device according to any one of claims 9-11, characterized in that, The device is further configured to: Determine a target interface from the interfaces of the first communication link and the second communication link; Send a first message via the communication link corresponding to the target interface, where the first message includes a second identifier, and the second identifier is used to indicate that the interface that sends the first message is the main interface.
14. The device according to claim 13, wherein The determining module is configured to: When a second message in response to the first message is received via the target interface and the second message includes the second identifier, use the communication link corresponding to the target interface as the target communication link.
15. The device according to claim 13, characterized in that, The device is further configured to: Determine the target interface according to the interface number of the first communication link and the interface number of the second communication link.
16. The device according to claim 13, characterized in that, Both the first response message and the second response message include a third identifier, where the third identifier is used to identify the node that sends the corresponding message, and the device is further configured to: Obtain the third identifier included in each of the received first response message and second response message. Select a target node from the second node and the third node according to the obtained third identifier; If the target node is the second node, select a target interface from the interfaces that receive the first response message. If the target node is the third node, select a target interface from the interfaces that receive the second response message.
17. A computer-readable storage medium, characterized in that, Instructions or code are stored in the computer-readable storage medium. When the instructions or code run on a computer, the computer is caused to execute the communication link selection method according to any one of claims 1-8.
Citation Information
Patent Citations
Link state information processing method and device
CN105763446A