A port status control method and device
By configuring preset rules in the primary and edge nodes of the FRRP sub-ring, the link status flag is set according to the timeout of the Major-fault and Hello packets, the network formation of the intersection ring is avoided when the main ring link is disconnected. The network security and reliability are improved, and the loss of critical packets caused by excessive CPU performance occupation is prevented.
Patent Information
- Application Number
- CN202310115564.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-10
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2043-02-10
AI Technical Summary
In the Ethernet ring, when the main ring link fails, a loop is formed between the intersecting sub-ring and the main ring, resulting in unnecessary message forwarding, occupying CPU performance, and losing critical messages.
Configure preset rules in the master and edge nodes of the target FRRP sub-ring, set the link status flag according to the timeout of the received Major-fault message and Hello message, and avoid slave port and blocking requests through ports and Edge ports are forwarded simultaneously to prevent loop formation.
It effectively avoids the networking of the intersection loop when the main ring link is disconnected, improves the security and reliability of the network, and prevents the loss of key messages caused by excessive CPU performance.
Smart Images

Figure CN116192736B_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of the present specification relate to the field of computer network technology, and in particular, to a port status control method and device. Background Art
[0002] FRRP (Fast Ring Recovery Protocol) is a link layer protocol specifically used in Ethernet rings. When a link or device on an Ethernet ring fails, it can quickly switch to a backup link to ensure rapid recovery of services.
[0003] A FRRP domain is a set of network devices configured with the same control VLAN and the same data VLAN. The control VLAN is the VLAN used to transmit FRRP control messages.
[0004] A FRRP domain can contain multiple FRRP rings, but the FRRP rings in the same FRRP domain can only contain one primary ring. After the primary ring is selected, the other FRRP rings in the same FRRP domain are all sub-rings.
[0005] Because when the networking mode is intersecting rings, when the main ring link fails, a loop will be formed between the sub-ring intersecting with the main ring and the main ring within a certain time period, or a loop will be formed between multiple sub-rings intersecting with the main ring within a certain time period; when the main ring link is broken and restored, a loop will also be formed between the sub-rings intersecting with the main ring and the main ring within a certain time period, thus causing unnecessary message forwarding, occupying CPU performance, and thus losing key messages. Summary of the invention
[0006] The present application provides a port status control method and device, and the technical solution is as follows:
[0007] According to a first aspect of the present application, a port state control method is provided, which is applied to a master node of a target Frrp subring; wherein the target Frrp subring intersects with an Frrp main ring of the same Frrp domain; the same Frrp domain includes multiple Frrp subrings; the master node is configured with a preset rule, the preset rule including setting a link state flag if a Major-fault message is received and the slave port of the master node is in a blocked state; the method includes:
[0008] Check whether the Hello message is received within the timeout period corresponding to the Hello message.
[0009] If no Hello message is received within the timeout period corresponding to the Hello message, further confirming whether the link status flag is set;
[0010] If the link state flag is set, a port blocking request is sent to the edge node corresponding to the target Frrp sub-ring, so that the edge node blocks the edge port corresponding to the target Frrp sub-ring.
[0011] Optionally, the method further includes:
[0012] Confirming whether a port blocking response message corresponding to the port blocking request is received within a preset period;
[0013] If a port blocking response message corresponding to the port blocking request is received within a preset period, the slave port corresponding to the target Frrp sub-ring is set to a forwarding state.
[0014] Optionally, the method further includes:
[0015] If no port blocking response message corresponding to the port blocking request is received within the preset period, a port blocking request is sent to the edge node corresponding to the target Frrp subring, and further confirmation is made as to whether the number of requests for sending the port blocking request reaches the preset number of requests;
[0016] If the number of requests for sending the port blocking request reaches a preset number of requests, the slave port corresponding to the target Frrp sub-ring is set to a forwarding state.
[0017] According to a second aspect of the present application, a port state control method is provided, which is applied to an edge node of a target Frrp subring; wherein the target Frrp subring intersects with an Frrp main ring of the same Frrp domain; the same Frrp domain includes multiple Frrp subrings; the edge node is configured with a preset rule, and the preset rule includes setting a link state flag if a Hello message is received and the edge port of the edge node is in a blocked state; the method includes:
[0018] Check whether the Major-fault message is received within the timeout period corresponding to the Major-fault message.
[0019] If no Major-fault message is received within a timeout period corresponding to the Major-fault message, further confirming whether the link status flag is set;
[0020] If the link status flag is set, a port blocking request is sent to the master node corresponding to the target Frrp sub-ring, so that the master node blocks the slave port corresponding to the target Frrp sub-ring.
[0021] Optionally, the method further includes:
[0022] Confirming whether a port blocking response message corresponding to the port blocking request is received within a preset period;
[0023] If a port blocking response message corresponding to the port blocking request is received within a preset period, the edge port corresponding to the target Frrp sub-ring is set to a forwarding state.
[0024] Optionally, the method further includes:
[0025] If no port blocking response message corresponding to the port blocking request is received within the preset period, a port blocking request is sent to the master node corresponding to the target Frrp subring, and further confirmation is made as to whether the number of requests for sending the port blocking request reaches the preset number of requests;
[0026] If the number of requests for sending the port blocking request reaches a preset number of requests, the edge port corresponding to the target Frrp sub-ring is set to a forwarding state.
[0027] According to a third aspect of the present application, a port state control device is provided, which is applied to a master node of a target Frrp subring; wherein the target Frrp subring intersects with an Frrp main ring of the same Frrp domain; the same Frrp domain includes multiple Frrp subrings; the master node is configured with a preset rule, and the preset rule includes setting a link state flag if a Major-fault message is received and the slave port of the master node is in a blocked state; the device includes:
[0028] A first confirmation unit, used to confirm whether the Hello message is received within a timeout period corresponding to the Hello message;
[0029] A second confirmation unit, configured to further confirm whether the link status flag is set if no Hello message is received within a timeout period corresponding to the Hello message;
[0030] The sending unit is configured to send a port blocking request to an edge node corresponding to the target Frrp sub-ring if the link status flag is set, so that the edge node blocks the edge port corresponding to the target Frrp sub-ring.
[0031] According to a fourth aspect of the present application, another port state control device is provided, which is applied to an edge node of a target Frrp subring; wherein the target Frrp subring intersects with an Frrp main ring of the same Frrp domain; the same Frrp domain includes multiple Frrp subrings; the edge node is configured with a preset rule, and the preset rule includes setting a link state flag if a Hello message is received and the edge port of the edge node is in a blocked state; the device includes:
[0032] A first confirmation unit, confirming whether a Major-fault message is received within a timeout period corresponding to the Major-fault message;
[0033] The second confirmation unit further confirms whether the link status flag is set if no Major-fault message is received within a timeout period corresponding to the Major-fault message;
[0034] The sending unit sends a port blocking request to the master node corresponding to the target Frrp sub-ring if the link status flag is set, so that the master node blocks the slave port corresponding to the target Frrp sub-ring.
[0035] According to a fifth aspect of the present application, there is provided an electronic device, comprising a communication interface, a processor, a memory and a bus, wherein the communication interface, the processor and the memory are interconnected via the bus;
[0036] The memory stores machine-readable instructions, and the processor executes the port status control method by calling the machine-readable instructions.
[0037] According to a sixth aspect of the present application, a machine-readable storage medium is provided, wherein the machine-readable storage medium stores machine-readable instructions, and when the machine-readable instructions are called and executed by a processor, the port status control method is implemented.
[0038] Through the above embodiments, preset rules can be configured in the master node of the target Frrp sub-ring, and the preset rules can include setting the link status mark if a Major-fault message is received and the slave port of the master node is in a blocked state. The master node can confirm whether a Hello message is received within the timeout period corresponding to the Hello message. If not, and the link status mark is set, a port blocking request can be sent to the edge node corresponding to the target Frrp sub-ring, so that the edge node blocks the edge port corresponding to the target Frrp sub-ring. It can also avoid that the slave port of the master node of the target Frrp sub-ring and the edge port of the edge node are both in a forwarding state in the same time period, that is, avoid the formation of a loop in the network containing the intersecting rings when the main ring link is broken, thereby improving the security and reliability of the network.
[0039] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0041] Figure 1 A schematic diagram of a network including intersecting rings in an embodiment of this specification;
[0042] Figure 2 This is a flow chart of a port state control method in an embodiment of this specification;
[0043] Figure 3 This is a flow chart of another port state control method in an embodiment of this specification;
[0044] Figure 4 A schematic diagram of another network including intersecting rings in an embodiment of this specification;
[0045] Figure 5 This is a schematic diagram of the structure of an electronic device in which a port state control device is located in an embodiment of this specification;
[0046] Figure 6 This is a block diagram of a port state control device in an embodiment of this specification;
[0047] Figure 7 This is a block diagram of another port status control device in an embodiment of this specification. DETAILED DESCRIPTION
[0048] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of this specification. Instead, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.
[0049] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.
[0050] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of this specification, the relevant contents of the FRRP protocol involved in the embodiments of this specification are briefly described below.
[0051] VLAN (Virtual Local Area Network) is a logical segmentation of network users connected to the port of a Layer 2 switch. It is a network segmentation that can be configured based on the location, role, department, or application and protocol used by the network user.
[0052] A FRRP domain is a set of network devices configured with the same control VLAN and the same data VLAN. The control VLAN is the VLAN used to transmit FRRP control messages, and the data VLAN is the VLAN used to transmit data messages.
[0053] Among them, a FRRP domain can contain multiple FRRP rings, but the FRRP rings in the same FRRP domain can only contain one primary ring, which can be determined by the user's configuration. After the primary ring is selected, the other FRRP rings in the same FRRP domain are all sub-rings.
[0054] The FRRP ring is a ring topology structure composed of network devices configured with the same control VLAN and the same data VLAN connected by links. Each network device on the FRRP ring is called a FRRP node. Each FRRP ring must have only one master node and at least one forwarding node.
[0055] The FRRP protocol supports multiple networking modes such as single ring, tangent ring and intersecting ring. In the intersecting ring networking, in order to prevent loops caused by multi-ring networks, one of the two intersecting rings must be the main ring. The protocol messages of the sub-ring can be transmitted through the main ring, and the protocol messages of the main ring are only transmitted within the main ring. The control VLANs of the main ring and the sub-ring are different and do not interfere with each other.
[0056] In actual applications, there are two intersection devices at the intersection of the main ring and the sub-ring, one of which is an edge node and the other is an auxiliary edge node in the sub-ring. The edge node and the auxiliary edge node must be configured in pairs. The intersection device is a main node or a transmission node in the main ring.
[0057] The ports through which the master node and the forwarding node access the FRRP ring have two ports, one is the master port and the other is the slave port, and the master port and the slave port are configured by the user; the port through which the edge node or the auxiliary edge node accesses the main ring is the main ring port, and the port through which the edge node or the auxiliary edge node accesses the sub-ring is the edge port.
[0058] The messages transmitted based on the FRRP protocol are divided into control messages and data messages. The transmission of data messages can be controlled based on the transmission of control messages. There are three types of control messages, namely HELLO messages, EDGE-HELLO messages, and MAJOR-FAULT messages.
[0059] HELLO message refers to the health monitoring message in the FRRP protocol, which is used to detect the loop integrity of the network. Specifically, the master node of the main ring or sub-ring can send a Hello message from the main port to the slave port of the master node. If the slave port of the master node receives the Hello message, the main ring or sub-ring where the master node is located is currently a loop.
[0060] EDGE-HELLO message refers to the main ring integrity check message in the FRRP protocol, which is used to detect the loop integrity of the main ring. Specifically, the edge node of the sub-ring can send an Edge-Hello message to the auxiliary edge node of the sub-ring. If the auxiliary edge node does not receive the Edge-Hello message sent by the edge node within a preset time period, the link between the edge node of the sub-ring and the main ring where the auxiliary edge node is located has failed.
[0061] MAJOR-FAULT message refers to the main ring fault notification message in the FRRP protocol, which is used to convey the information that the main ring has a fault to the edge node. Specifically, when the auxiliary edge node of the sub-ring fails to receive the Edge-Hello message sent by the edge node of the same sub-ring within a preset time period, the Major-fault message can be sent to the edge node. When the edge node receives the Major-fault message, it indicates that the link of the main ring where the edge node of the sub-ring and the auxiliary edge node are located has failed.
[0062] Because when the networking mode is intersecting rings, when the main ring link fails, a loop will be formed between the sub-ring intersecting with the main ring and the main ring within a certain time period, or a loop will be formed between multiple sub-rings intersecting with the main ring within a certain time period; when the main ring link is disconnected and restored, a loop will also be formed between the sub-rings intersecting with the main ring and the main ring within a certain time period.
[0063] For example, see Figure 1 , Figure 1 FIG. 1 is a schematic diagram of a network including intersecting rings in an embodiment of this specification. Figure 1 As shown, the intersecting rings may include a main ring 1, a sub-ring 1 and a sub-ring 2, the network device 2 may be an auxiliary edge node of the sub-ring 1, the network device 3 may be an edge node of the sub-ring 1 and an edge node of the sub-ring 2, the network device 4 may be an auxiliary edge node of the sub-ring 2, the network device 6 may be a master node of the sub-ring 1, and the network device 5 may be a master node of the sub-ring 2. When the network device 2 does not receive an Edge-Hello message sent by the network device 3 within the timeout period of the Edge-Hello message, it can be determined that the main ring link state between the network device 2 and the network device 3 is disconnected, and at this time, the network device 6 does not receive a Hello message within the timeout period of the Hello message, and the slave port corresponding to the sub-ring 1 may be set to a forwarding state, and at this time, the network device 2 may send a Major-fault message to the network device 3 through the sub-ring 1, so that the network device 3 blocks the edge port corresponding to the sub-ring 1. Before the Major-fault message corresponding to sub-ring 1 reaches the network device 3, the slave port of the network device 6 is in a forwarding state, and the edge port of the network device 3 corresponding to the sub-ring 1 is in a forwarding state.
[0064] When the network device 4 does not receive the Edge-Hello message sent by the network device 3 within the timeout period of the Edge-Hello message, based on the same reason as above, before the Major-fault message corresponding to the sub-ring 2 reaches the network device 3, the slave port of the network device 5 is in the forwarding state, and the edge port of the network device 3 corresponding to the sub-ring 2 is in the forwarding state.
[0065] Therefore, within a certain time period, the slave port of network device 1, the slave port of network device 6 and the slave port of network device 5 are all in forwarding state, and the edge port of network device 3 corresponding to sub-ring 1 and the edge port corresponding to sub-ring 2 are all in forwarding state. That is to say, within the certain time period, network device 1, network device 2, network device 6, network device 3, network device 5 and network device 4 constitute a network loop, which brings unnecessary message forwarding and occupies CPU performance. When the message traffic within the time period is large, it is easy to cause the CPU to lose key messages.
[0066] In view of this, the present specification aims to propose a technical solution for controlling the port status by configuring preset rules.
[0067] When implemented, the method can be applied to a master node of a target Frrp subring, wherein the target Frrp subring intersects with a Frrp main ring of the same Frrp domain; the same Frrp domain includes multiple Frrp subrings; the master node is configured with a preset rule, the preset rule includes setting a link status flag if a Major-fault message is received and a slave port of the master node is in a blocked state;
[0068] Furthermore, it can be confirmed whether the Hello message is received within the timeout period corresponding to the Hello message;
[0069] Further, if no Hello message is received within a timeout period corresponding to the Hello message, it can be further confirmed whether the link status flag is set;
[0070] Further, if the link state flag is set, a port blocking request may be sent to an edge node corresponding to the target Frrp sub-ring, so that the edge node blocks the edge port corresponding to the target Frrp sub-ring.
[0071] Through the above embodiments, preset rules can be configured in the master node of the target Frrp sub-ring, and the preset rules can include setting the link status mark if a Major-fault message is received. The master node can confirm whether a Hello message is received within the timeout period corresponding to the Hello message. If not, and the link status mark is set, a port blocking request can be sent to the edge node corresponding to the target Frrp sub-ring, so that the edge node blocks the edge port corresponding to the target Frrp sub-ring. This avoids the situation where the slave port of the master node of the target Frrp sub-ring and the edge port of the edge node are both in the forwarding state in the same time period, that is, it avoids the formation of a loop in the network containing the intersecting rings when the main ring link is broken, thereby improving the security and reliability of the network.
[0072] See also Figure 2 , Figure 2 FIG. 1 is a flow chart of a port state control method in an embodiment of the present specification. Figure 2 As shown, the method is applied to the master node of the target Frrp subring; wherein the target Frrp subring intersects with the Frrp main ring of the same Frrp domain; the same Frrp domain includes multiple Frrp subrings; the master node is configured with preset rules, and the preset rules include setting the link status mark if a Major-fault message is received and the slave port of the master node is in a blocked state.
[0073] In this specification, the master node of the target Frrp subring may be a network device configured with the target Frrp subring, and the target Frrp subring may intersect with the Frrp main ring of the same Frrp domain. The link state mark may be used to indicate the link state of the Frrp main ring intersecting with the target Frrp subring.
[0074] It should be noted that the master node can be configured with a timeout period corresponding to the Hello message. In this case, when the auxiliary edge node of the target Frrp sub-ring does not receive the Edge-Hello message sent by the edge node within the timeout period corresponding to the Edge-Hello message, and sends a Major-fault message to the edge node through the target Frrp sub-ring, the master node can receive the Major-fault message. Since the Hello message has not been received at this time, the master node has not set the slave port corresponding to the target Frrp sub-ring to the forwarding state. Therefore, the master node cannot forward the received Major-fault message. The master node can be configured with a preset rule, and the preset rule can include setting the link status mark when the Major-fault message is received and the slave port of the master node is in a blocked state.
[0075] Based on the fact that the master node of the target Frrp sub-ring has been configured with the preset rule, the master node of the target Frrp sub-ring may perform the following steps:
[0076] Step 202: confirm whether the Hello message is received within the timeout period corresponding to the Hello message.
[0077] In this specification, when the master node receives the Hello message within the timeout period corresponding to the Hello message, the target Frrp sub-ring forms a loop, and the master node can set the slave port corresponding to the target Frrp sub-ring to a blocked state; when the master node does not receive the Hello message within the timeout period corresponding to the Hello message, the target Frrp sub-ring does not form a loop, and the master node can keep the slave port corresponding to the target Frrp sub-ring in a blocked state.
[0078] Step 204: If no Hello message is received within the timeout period corresponding to the Hello message, further confirm whether the link status flag is set.
[0079] For example, if the master node does not receive the Hello message within the timeout period corresponding to the Hello message, the target Frrp sub-ring does not form a loop. The master node can keep the slave port corresponding to the target Frrp sub-ring in a blocked state and can further confirm whether the link status flag is set.
[0080] Step 206: If the link status flag is set, a port blocking request is sent to the edge node corresponding to the target Frrp sub-ring, so that the edge node blocks the edge port corresponding to the target Frrp sub-ring.
[0081] In this specification, if the link status mark is set, the master node receives the Major-fault message corresponding to the target Frrp sub-ring. At this time, since the master node keeps the slave port corresponding to the target Frrp sub-ring in a blocked state, the Major-fault message cannot be forwarded. The master node can be configured with a second control VLAN, and the master node can send a port blocking request to the edge node corresponding to the target Frrp sub-ring through the port corresponding to the second control VLAN, so that the edge node blocks the edge port corresponding to the target Frrp sub-ring.
[0082] In one embodiment shown, it can be confirmed whether a port blocking response message corresponding to the port blocking request is received within a preset cycle time; if a port blocking response message corresponding to the port blocking request is received within the preset cycle time, the slave port corresponding to the target Frrp sub-ring can be set to a forwarding state.
[0083] For example, the master node can send a port blocking request to the edge node corresponding to the target Frrp sub-ring through the port corresponding to the second control VLAN; when the edge node blocks the corresponding edge port according to the port blocking request, it can send a port blocking response message corresponding to the port blocking request to the master node; when the master node receives the port blocking response message, since the edge node has already blocked the corresponding edge port at this time, the master node can set the slave port corresponding to the target Frrp sub-ring to a forwarding state.
[0084] In this way, it is avoided that the slave port of the master node of the target Frrp sub-ring and the edge port of the edge node are both in forwarding state in the same time period, that is, it is avoided that the network containing the intersecting rings forms a loop when the main ring link is disconnected.
[0085] In one embodiment shown, it is possible to confirm whether a port blocking response message is received within a preset cycle time; if no port blocking response message is received within the preset cycle time, a port blocking request is sent to an edge node corresponding to the target Frrp sub-ring; it is confirmed whether the number of requests for sending the port blocking request reaches the preset number of requests; if the number of requests for sending the port blocking request reaches the preset number of requests, the slave port corresponding to the target Frrp sub-ring is set to a forwarding state.
[0086] In this specification, when the number of requests reaches a preset number of requests and the master node does not receive the port blocking response message sent by the edge node, there is a break in the link between the master node and the edge node. In this case, the network including the intersecting rings cannot form a loop, and the master node can set the slave port corresponding to the target Frrp sub-ring to a forwarding state.
[0087] For example, the cycle duration corresponding to the port blocking response message and the number of requests for sending the port blocking request can be pre-configured in the master node. After sending the port blocking request to the edge node corresponding to the target Frrp sub-ring, the master node can confirm whether the port blocking response message is received within the preset cycle duration; if the master node does not receive the port blocking response message within the preset cycle duration, it can send the port blocking request to the edge node again, and count the number of requests for sending the port blocking request to the edge node. The master node can confirm whether the number of requests reaches the preset number of requests; if the number of requests reaches the preset number of requests, the slave port corresponding to the target Frrp sub-ring can be set to a forwarding state.
[0088] Correspondingly, this manual also provides a method for controlling the port status, see Figure 3 , Figure 3 FIG. 1 is a flow chart of another method for controlling a port state in an embodiment of the present specification. Figure 3 As shown, the method is applied to an edge node of a target Frrp subring, wherein the target Frrp subring intersects with an Frrp main ring of the same Frrp domain; the same Frrp domain includes multiple Frrp subrings; the edge node is configured with a preset rule, and the preset rule includes setting a link status mark if a Hello message is received and the edge port of the edge node is in a blocked state;
[0089] In this specification, the edge node of the target Frrp subring may be a network device configured with the target Frrp subring and the Frrp main ring under the same Frrp domain, and the target Frrp subring may intersect with the Frrp main ring of the same Frrp domain. The link state mark may be used to indicate the link state of the Frrp main ring intersecting with the target Frrp subring.
[0090] It should be noted that when the main ring link is restored from a disconnection, the auxiliary edge node of the target Frrp sub-ring can receive the Edge-Hello message sent by the edge node within the timeout period corresponding to the Edge-Hello message, then the auxiliary edge node can stop sending Major-fault messages to the edge node. In this case, the edge node does not receive the Major-fault message within the preset cycle time, and the edge port corresponding to the target Frrp sub-ring can be kept in a blocked state. Therefore, when the edge node receives the Hello message sent by the main node corresponding to the target Frrp sub-ring, it is unable to forward the Hello message. The edge node can be configured with preset rules, and the preset rules can include setting the link status mark when the Hello message is received and the edge port of the edge node is in a blocked state.
[0091] Based on the edge node of the target Frrp subring being configured with the preset rule, the edge node of the target Frrp subring may perform the following steps:
[0092] Step 302: Confirm whether a Major-fault message is received within a timeout period corresponding to the Major-fault message.
[0093] In this specification, when the edge node receives the Major-fault message within the timeout period corresponding to the Major-fault message, the main ring link between the edge node and the auxiliary edge node is normal; when the main node does not receive the Major-fault message within the timeout period corresponding to the Major-fault message, the main ring link between the edge node and the auxiliary edge node is broken, and the edge node can keep the edge port corresponding to the target Frrp sub-ring in a blocked state.
[0094] Step 304: If no Major-fault message is received within the timeout period corresponding to the Major-fault message, further confirm whether the link status flag is set.
[0095] For example, if the edge node does not receive the Major-fault message within the timeout period corresponding to the Major-fault message, the edge node may keep the edge port corresponding to the target Frrp subring in a blocked state, and may further confirm whether the link status flag is set.
[0096] Step 306: If the link status flag is set, a port blocking request is sent to the master node corresponding to the target Frrp sub-ring, so that the master node blocks the slave port corresponding to the target Frrp sub-ring.
[0097] In this specification, if the link status flag is set, the edge node receives the Hello message corresponding to the target Frrp sub-ring. At this time, since the edge node keeps the edge port corresponding to the target Frrp sub-ring in a blocked state, the Hello message cannot be forwarded. The edge node can be configured with a second control VLAN, and the edge node can send a port blocking request to the master node corresponding to the target Frrp sub-ring through the port corresponding to the second control VLAN, so that the master node blocks the slave port corresponding to the target Frrp sub-ring.
[0098] In one embodiment shown, it can be confirmed whether a port blocking response message corresponding to the port blocking request is received within a preset cycle time; if a port blocking response message corresponding to the port blocking request is received within the preset cycle time, the edge port corresponding to the target Frrp sub-ring is set to a forwarding state.
[0099] For example, the edge node can send a port blocking request to the master node corresponding to the target Frrp sub-ring through the port corresponding to the second control VLAN; when the master node blocks the corresponding port according to the port blocking request, it can send a port blocking response message corresponding to the port blocking request to the edge node; when the edge node receives the port blocking response message, since the master node has blocked the corresponding port at this time, the edge node can set the edge port corresponding to the target Frrp sub-ring to a forwarding state.
[0100] In this way, it is avoided that the slave port of the master node of the target Frrp sub-ring and the edge port of the edge node are both in forwarding state within the same time period, that is, it is avoided that when the main ring link is broken and restored, the nodes corresponding to the target Frrp sub-ring and the nodes corresponding to the Frrp main ring intersecting with the Frrp sub-ring form a loop.
[0101] In one embodiment shown, it can be confirmed whether a port blocking response message is received within a preset cycle time; if a port blocking response message is not received within the preset cycle time, a port blocking request can be sent to the master node corresponding to the target Frrp sub-ring; it can be confirmed whether the number of requests for sending the port blocking request reaches the preset number of requests; if the number of requests for sending the port blocking request reaches the preset number of requests, the edge port corresponding to the target Frrp sub-ring can be set to a forwarding state.
[0102] In this specification, when the number of requests reaches a preset number of requests and the edge node does not receive the port blocking response message sent by the master node, there is a break in the link between the edge node and the master node. In this case, the network including the intersecting rings cannot form a loop, and the edge node can set the edge port corresponding to the target Frrp sub-ring to a forwarding state.
[0103] For example, the cycle duration corresponding to the port blocking response message and the number of requests for sending the port blocking request can be pre-configured in the edge node. After sending the port blocking request to the master node corresponding to the target Frrp sub-ring, the edge node can confirm whether the port blocking response message is received within the preset cycle duration; if the edge node does not receive the port blocking response message within the preset cycle duration, it can send the port blocking request to the master node again, and count the number of requests for sending the port blocking request to the master node. The edge node can confirm whether the number of requests reaches the preset number of requests; if the number of requests reaches the preset number of requests, the edge port corresponding to the target Frrp sub-ring can be set to a forwarding state.
[0104] In order to enable persons skilled in the art to better understand the technical solutions in the embodiments of this specification, the embodiments in this specification are described below by taking the disconnection of the main ring link as an example.
[0105] See also Figure 4 , Figure 4 FIG. 1 is a schematic diagram of another network including intersecting rings in an embodiment of this specification. Figure 4As shown, the network may include a main ring 1, a sub-ring 1 and a sub-ring 2, the main ring 1 may include network devices 1, 2, 3 and 4, the sub-ring 1 may include network devices 2, 6 and 3, and the sub-ring 2 may include network devices 2, 5 and 3. Among them, the network device 1 may be the master node of the main ring; the network device 6 may be the master node of the sub-ring 1, the network device 2 may be the auxiliary edge node of the sub-ring 1, and the network device 3 may be the edge node of the sub-ring 1; the network device 5 may be the master node of the sub-ring 2, the network device 2 may be the auxiliary edge node of the sub-ring 2, and the network device 3 may be the edge node of the sub-ring 2.
[0106] The network device 5 may be a master node of the sub-ring 2. The master node may be configured with a preset rule, wherein the preset rule includes setting a link status mark if a Major-fault message is received and the slave port of the master node is in a blocked state.
[0107] The main ring link between the network device 2 and the network device 3 may be broken. In this case, when the network device 5 does not receive the Hello message within the timeout period corresponding to the Hello message, the slave port corresponding to the sub-ring 2 may be kept in a blocked state, and further confirmation may be made as to whether the link status mark is set. If the link status mark is set, the network device 5 may send a port blocking request to the network device 3 through the port corresponding to the configured second control VLAN, so that the network device 3 blocks the edge port corresponding to the sub-ring 2.
[0108] The network device 3 can receive the port blocking request, set the edge port corresponding to the sub-ring 2 to a blocking state, and can send a port blocking response message to the network device 5. When the network device 5 receives the port blocking response message, it can set the slave port corresponding to the sub-ring 2 to a forwarding state.
[0109] The cycle duration corresponding to the port blocking response message and the number of requests for sending the port blocking request can also be pre-configured in the network device 5. After sending the port blocking request to the network device 3, the network device 5 can confirm whether the port blocking response message is received within the preset cycle duration; if the network device 5 does not receive the port blocking response message within the preset cycle duration, it can send the port blocking request to the network device 3 again, and count the number of requests for sending the port blocking request to the network device 3. The network device 5 can confirm whether the number of requests reaches the preset number of requests; if the number of requests reaches the preset number of requests, the slave port corresponding to the sub-ring 1 can be set to a forwarding state; when the network device 5 receives a port blocking response message within the preset cycle duration, the slave port corresponding to the sub-ring 1 can be set to a forwarding state.
[0110] The network device 3 may be an edge node of the sub-ring 2. The edge node may be configured with a preset rule. The preset rule may include setting a link status flag if a Hello message is received and the edge port of the edge node is in a blocked state.
[0111] When the main ring link between the network device 2 and the network device 3 is restored from a circuit breaker, the network device 3 may keep the edge port corresponding to the sub-ring 2 in a blocked state if it does not receive the Major-fault message within the timeout period corresponding to the Major-fault message, and may further confirm whether the link status mark is set; if the link status mark is set, the network device 3 may send a port blocking request to the network device 5 through the port corresponding to the configured second control VLAN, so that the network device 5 blocks the slave port corresponding to the sub-ring 2.
[0112] The network device 5 can receive the port blocking request, set the slave port corresponding to the sub-ring 2 to a blocking state, and can send a port blocking response message to the network device 3. When the network device 3 receives the port blocking response message, it can set the edge port corresponding to the sub-ring 2 to a forwarding state.
[0113] Corresponding to the embodiment of the port state control method, this specification also provides an embodiment of a port state control device.
[0114] See also Figure 5 , Figure 5This is a schematic diagram of the structure of an electronic device in which a port state control device is located in an embodiment of this specification. At the hardware level, the device includes a processor 502, an internal bus 504, a network interface 506, a memory 508, and a non-volatile memory 510, and may also include hardware required for other services. One or more embodiments of this specification can be implemented based on software, such as the processor 502 reading the corresponding computer program from the non-volatile memory 510 into the memory 508 and then running it. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0115] See also Figure 6 , Figure 6 FIG. 1 is a block diagram of a port state control device in an embodiment of the present specification. The port state control device can be applied to Figure 5 In the electronic device shown, the technical solution of this specification is implemented. The port state control device is applied to the master node of the target Frrp sub-ring; the target Frrp sub-ring intersects with the Frrp main ring of the same Frrp domain; the same Frrp domain includes multiple Frrp sub-rings; the master node is configured with a preset rule, and the preset rule includes setting the link state mark if a Major-fault message is received and the slave port of the master node is in a blocked state; the device includes:
[0116] A first confirmation unit 602 is used to confirm whether a Hello message is received within a timeout period corresponding to the Hello message;
[0117] A second confirmation unit 604 is used to further confirm whether the link status flag is set if no Hello message is received within a timeout period corresponding to the Hello message;
[0118] The sending unit 606 is configured to send a port blocking request to the edge node corresponding to the target Frrp subring if the link status flag is set, so that the edge node blocks the edge port corresponding to the target Frrp subring.
[0119] In this embodiment, the device may further include a third confirmation unit, configured to:
[0120] Confirming whether a port blocking response message corresponding to the port blocking request is received within a preset period;
[0121] If a port blocking response message corresponding to the port blocking request is received within a preset period, the slave port corresponding to the target Frrp sub-ring is set to a forwarding state.
[0122] In this embodiment, the device may further include a setting unit, configured to:
[0123] If no port blocking response message corresponding to the port blocking request is received within the preset period, a port blocking request is sent to the edge node corresponding to the target Frrp subring, and further confirmation is made as to whether the number of requests for sending the port blocking request reaches the preset number of requests;
[0124] If the number of requests for sending the port blocking request reaches a preset number of requests, the slave port corresponding to the target Frrp sub-ring is set to a forwarding state.
[0125] See also Figure 7 , Figure 7 FIG. 1 is a block diagram of another port state control device in an embodiment of the present specification. The port state control device can be applied to Figure 5 In the electronic device shown, the technical solution of this specification is implemented. The port state control device, wherein the target Frrp subring intersects with the Frrp main ring of the same Frrp domain; the same Frrp domain includes multiple Frrp subrings; the edge node is configured with a preset rule, and the preset rule includes setting the link state mark if a Hello message is received and the edge port of the edge node is in a blocked state; the device includes:
[0126] A first confirmation unit 702 confirms whether a Major-fault message is received within a timeout period corresponding to the Major-fault message;
[0127] The second confirmation unit 704 further confirms whether the link status flag is set if no Major-fault message is received within a timeout period corresponding to the Major-fault message;
[0128] The sending unit 706 sends a port blocking request to the master node corresponding to the target Frrp sub-ring if the link status flag is set, so that the master node blocks the slave port corresponding to the target Frrp sub-ring.
[0129] In this embodiment, the device may further include a third confirmation unit, configured to:
[0130] Confirming whether a port blocking response message corresponding to the port blocking request is received within a preset period;
[0131] If a port blocking response message corresponding to the port blocking request is received within a preset period, the edge port corresponding to the target Frrp sub-ring is set to a forwarding state.
[0132] In this embodiment, the device may further include a setting unit, configured to:
[0133] If no port blocking response message corresponding to the port blocking request is received within the preset period, a port blocking request is sent to the master node corresponding to the target Frrp subring, and further confirmation is made as to whether the number of requests for sending the port blocking request reaches the preset number of requests;
[0134] If the number of requests for sending the port blocking request reaches a preset number of requests, the edge port corresponding to the target Frrp sub-ring is set to a forwarding state.
[0135] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0136] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can refer to the partial description of the method embodiments. The device embodiments described above are only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this specification. Ordinary technicians in this field can understand and implement it without paying creative work.
[0137] The devices, modules or units described in the embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0138] In a typical configuration, a computer includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0139] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0140] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0141] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0142] The foregoing describes specific embodiments of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0143] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "one", "said" and "said" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0144] It should be understood that, although the terms first, second, third, etc. may be used to describe various information in one or more embodiments of this specification, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to confirmation".
[0145] The above description is merely a preferred embodiment of one or more embodiments of the present specification and is not intended to limit one or more embodiments of the present specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of the present specification shall be included in the scope of protection of one or more embodiments of the present specification.
[0146] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
Claims
1. A port state control method, applied to an edge node of a target Frrp subring; wherein: The target Frrp subring intersects with the Frrp main ring of the same Frrp domain; the same Frrp domain includes multiple Frrp subrings; the edge node is configured with a preset rule, the preset rule includes setting a link state flag if a Hello message is received and the edge port of the edge node is in a blocked state; the method includes: Check whether a Major-fault message is received within the timeout period corresponding to the Major-fault message. If no Major-fault message is received within the timeout period corresponding to the Major-fault message, further confirming whether the link status flag is set; If the link state flag is set, sending a port blocking request to the master node corresponding to the target Frrp sub-ring, so that the master node blocks the slave port corresponding to the target Frrp sub-ring; Confirming whether a port blocking response message corresponding to the port blocking request is received within a preset period; If a port blocking response message corresponding to the port blocking request is received within a preset period, the edge port corresponding to the target Frrp sub-ring is set to a forwarding state.
2. The method according to claim 1, further comprising: If no port blocking response message corresponding to the port blocking request is received within the preset period, a port blocking request is sent to the master node corresponding to the target Frrp subring, and further confirmation is made as to whether the number of requests for sending the port blocking request reaches the preset number of requests; If the number of requests for sending the port blocking request reaches a preset number of requests, the edge port corresponding to the target Frrp sub-ring is set to a forwarding state.
3. A port state control device, applied to an edge node of a target Frrp subring; wherein: The target Frrp subring intersects with the Frrp main ring of the same Frrp domain; the same Frrp domain includes multiple Frrp subrings; the edge node is configured with a preset rule, the preset rule includes setting a link state flag if a Hello message is received and the edge port of the edge node is in a blocked state; the device includes: A first confirmation unit, used to confirm whether a Major-fault message is received within a timeout period corresponding to the Major-fault message; A second confirmation unit, configured to further confirm whether the link status flag is set if no Major-fault message is received within a timeout period corresponding to the Major-fault message; a sending unit, configured to send a port blocking request to a master node corresponding to the target Frrp sub-ring if the link status flag is set, so that the master node blocks a slave port corresponding to the target Frrp sub-ring; Confirming whether a port blocking response message corresponding to the port blocking request is received within a preset period; If a port blocking response message corresponding to the port blocking request is received within a preset period, the edge port corresponding to the target Frrp sub-ring is set to a forwarding state.
4. An electronic device, comprising a communication interface, a processor, a memory and a bus, wherein the communication interface, the processor and the memory are interconnected via the bus; The memory stores machine-readable instructions, and the processor executes the port status control method according to any one of claims 1 or 2 by calling the machine-readable instructions.
5. A machine-readable storage medium storing machine-readable instructions, wherein the machine-readable instructions, when called and executed by a processor, implement the port status control method according to any one of claims 1 or 2.
Citation Information
Patent Citations
Loop fault detecting method, subring main node and subring
CN101068169A
Method and topological structure for realizing stable communication by forming multiple ring topologies into intersecting ring
CN101841450A
