CN115412456B - Loop detection method, device and medium in stacking environment - Google Patents
Loop detection method, device and medium in stacking environment Download PDFInfo
- Publication number
- CN115412456B CN115412456B CN202210959877.8A CN202210959877A CN115412456B CN 115412456 B CN115412456 B CN 115412456B CN 202210959877 A CN202210959877 A CN 202210959877A CN 115412456 B CN115412456 B CN 115412456B
- Authority
- CN
- China
- Prior art keywords
- port
- stacking
- receiving
- mac address
- loopback
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 245
- 230000009471 action Effects 0.000 claims abstract description 45
- 238000000034 method Methods 0.000 claims abstract description 36
- 238000012545 processing Methods 0.000 claims abstract description 27
- 230000002776 aggregation Effects 0.000 claims description 85
- 238000004220 aggregation Methods 0.000 claims description 85
- 230000000903 blocking effect Effects 0.000 claims description 24
- 230000006870 function Effects 0.000 claims description 20
- 230000001360 synchronised effect Effects 0.000 claims description 6
- 238000004891 communication Methods 0.000 abstract description 6
- 230000008030 elimination Effects 0.000 abstract description 3
- 238000003379 elimination reaction Methods 0.000 abstract description 3
- 230000006855 networking Effects 0.000 description 19
- 230000008569 process Effects 0.000 description 9
- 238000010586 diagram Methods 0.000 description 7
- 238000005516 engineering process Methods 0.000 description 5
- 238000012423 maintenance Methods 0.000 description 5
- 230000000694 effects Effects 0.000 description 4
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 238000011084 recovery Methods 0.000 description 2
- DWSYCUKCNSVBRA-UHFFFAOYSA-N 4-(5-methylsulfonyltetrazol-1-yl)phenol Chemical compound CS(=O)(=O)C1=NN=NN1C1=CC=C(C=C1)O DWSYCUKCNSVBRA-UHFFFAOYSA-N 0.000 description 1
- 101710167643 Serine/threonine protein phosphatase PstP Proteins 0.000 description 1
- 230000004075 alteration Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 238000012217 deletion Methods 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000002265 prevention Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/02—Capturing of monitoring data
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/18—Loop-free operations
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/58—Association of routers
- H04L45/583—Stackable routers
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Environmental & Geological Engineering (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The embodiment of the specification discloses a loopback detection method, equipment and medium under a stacking environment, and relates to the technical field of communication, wherein the method comprises the following steps: acquiring a loopback detection message, and determining the source MAC address of a sending device and the packet receiving address information of a receiving device of the loopback detection message, wherein the source MAC address of the sending device comprises the system MAC address of a stacking system and the port serial number of a sending port of the sending device; judging whether the loopback detection message is sent by a stacking system or not according to the system MAC address in the source MAC address of the loopback detection message and the packet receiving address information of the receiving equipment; when the loopback detection message is sent by the stacking system, the loopback detection is carried out on the stacking system according to the port serial number in the source MAC address and the packet receiving address information of the receiving equipment, and the corresponding port action is executed based on the detection result so as to realize the normal forwarding of the traffic. The problem that service processing is slowed down due to the fact that a large number of messages are sent is avoided, and loop-back detection elimination loops can be used in a stacking environment.
Description
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a loopback detection method, device, and medium in a stacking environment.
Background
The loopback detection mainly detects whether a loop exists in an external network environment, a detection packet is sent to a corresponding port during the loopback detection, if the transmitted packet can be received from the transmitted port, the loop exists in the port, and for the interface with the loop, the device can process according to the port and issue configuration actions. Stacking refers to that a plurality of switches supporting stacking characteristics are connected together through stacking cables, and logically virtualized into one switching device to participate in data forwarding as a whole. The stacking is a transverse virtualization technology widely applied at present, and has the effects of improving reliability, expanding the number of ports, increasing bandwidth, simplifying networking and the like. The traditional park network adopts equipment and link redundancy to ensure high reliability, but has low link utilization rate and high network maintenance cost, and the stacking technology virtualizes a plurality of switches into one switch, so that the purposes of simplifying network deployment and reducing network maintenance workload are achieved.
According to the judgment logic of the loopback detection, if the source MAC of the message is not matched with the MAC of the packet receiving port, the networking environment is considered to have no loop, and the loopback detection is not effective. However, if the loopback detection message sent by the master device in the stacking environment is received by the slave devices belonging to the same stacking environment, the source address of the message and the port address of the received packet are inconsistent, but a loop still exists in the networking environment. In addition, in the stacking environment, there are a large number of loopback detection messages, and the processing of these messages to the software layer may cause the device to process traffic flow to be slow, and the large number of loopback detection messages may also cause network congestion. In summary, the current loop-back detection method cannot meet the detection requirement of the stacked networking environment.
Disclosure of Invention
One or more embodiments of the present disclosure provide a loopback detection method, apparatus, and medium in a stacking environment, for solving the following technical problems: the current loop-back detection method cannot meet the detection requirement of the stacked networking environment.
One or more embodiments of the present disclosure adopt the following technical solutions:
one or more embodiments of the present disclosure provide a loopback detection method in a stacking environment, the method including: acquiring a loopback detection message, and determining a source MAC address of a sending device and packet receiving address information of a receiving device of the loopback detection message, wherein the source MAC address of the sending device comprises a system MAC address of a stacking system and a port serial number of a sending port of the sending device; judging whether the loopback detection message is sent out by the stacking system or not according to the system MAC address in the source MAC address of the loopback detection message and the packet receiving address information of the receiving equipment; when the loopback detection message is sent out by the stacking system, carrying out loopback detection on the stacking system according to the port serial number in the source MAC address and the packet receiving address information of the receiving equipment, and generating a detection result; and executing corresponding port actions based on the detection result so as to realize normal forwarding of the traffic.
Further, according to the port serial number in the source MAC address and the packet receiving address information of the receiving device, performing loopback detection on the stacking system, and generating a detection result, which specifically includes: determining a receiving port for receiving the loopback detection message through the packet receiving address information of the receiving equipment; determining a sending port of the loopback detection message through the port serial number in the source MAC address; respectively acquiring working states of the receiving port and the sending port, wherein the working states comprise any one of an enabling state and a blocking state; and carrying out loop-back detection on the stacking system based on the working states of the receiving port and the sending port to generate a detection result.
Further, when the detection result is that the stacking system has a loop, executing a corresponding port action based on the detection result, specifically including: acquiring port attributes of the receiving port and the transmitting port, wherein the port attributes comprise any one of a TRUNK port and a non-TRUNK port; when the port attribute of the receiving port is different from the port attribute of the sending port, blocking the port with the port attribute of not TRUNK port; when the port attributes of the receiving port and the sending port are the same, comparing the port serial number of the receiving port with the port serial number of the sending port, which is obtained in advance, and blocking the port with the smaller port serial number.
Further, after executing the corresponding port action based on the detection result, the method further includes: when appointed stacking equipment in the stacking system executes corresponding port actions, port information corresponding to the port actions is stored, and table items are generated; storing the table items into corresponding databases of the appointed stacking equipment, and synchronizing the corresponding databases to other stacking equipment so as to realize the synchronization of the table items; acquiring the table entries from corresponding databases of other stacking devices based on triggering operations of the other stacking devices; and when the equipment state of the appointed stacking equipment is the appointed state, executing corresponding port actions on the ports through the other stacking equipment according to the synchronized table items.
Further, performing an action process based on the detection result, specifically including: when the stacking environment comprises a plurality of link aggregation groups, the detection result comprises that a loop appears between two link aggregation groups in the plurality of link aggregation groups; acquiring port attributes of aggregation ports corresponding to two link aggregation groups respectively, wherein the port attributes comprise any one of TRUNK ports and non-TRUNK ports; and blocking the appointed aggregation ports in the appointed link aggregation group according to the port attribute.
Further, according to the port attribute, blocking the designated aggregation port in the designated link aggregation group specifically includes: when the port attributes of the aggregation ports respectively corresponding to the two link aggregation groups are different, blocking the port with the port attribute being a non-TRUNK port; and when the port attributes of the aggregation ports corresponding to the two link aggregation groups are the same, comparing the port serial numbers of the aggregation ports corresponding to the two link aggregation groups obtained in advance, and blocking the port with the smaller port serial number.
Further, before obtaining the loopback detection message, the method further includes: and starting a loop-back detection function for the main equipment in the stacking system, and synchronizing to a plurality of standby equipment in the stacking system.
Further, based on the working states of the receiving port and the sending port, performing loop-back detection on the stacking system to generate a detection result, which specifically includes: and when the working states of the receiving port and the sending port are both enabled states, determining that a loop circuit appears in the stacking system.
One or more embodiments of the present specification provide a loopback detection apparatus in a stacking environment, including:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores instructions executable by the at least one processor to enable the at least one processor to:
acquiring a loopback detection message, and determining a source MAC address of a sending device and packet receiving address information of a receiving device of the loopback detection message, wherein the source MAC address of the sending device comprises a system MAC address of a stacking system and a port serial number of a sending port of the sending device; judging whether the loopback detection message is sent out by the stacking system or not according to the system MAC address in the source MAC address of the loopback detection message and the packet receiving address information of the receiving equipment; when the loopback detection message is sent out by the stacking system, carrying out loopback detection on the stacking system according to the port serial number in the source MAC address and the packet receiving address information of the receiving equipment, and generating a detection result; and executing corresponding port actions based on the detection result so as to realize normal forwarding of the traffic.
One or more embodiments of the present specification provide a non-volatile computer storage medium storing computer-executable instructions configured to:
acquiring a loopback detection message, and determining a source MAC address of a sending device and packet receiving address information of a receiving device of the loopback detection message, wherein the source MAC address of the sending device comprises a system MAC address of a stacking system and a port serial number of a sending port of the sending device; judging whether the loopback detection message is sent out by the stacking system or not according to the system MAC address in the source MAC address of the loopback detection message and the packet receiving address information of the receiving equipment; when the loopback detection message is sent out by the stacking system, carrying out loopback detection on the stacking system according to the port serial number in the source MAC address and the packet receiving address information of the receiving equipment, and generating a detection result; and executing corresponding port actions based on the detection result so as to realize normal forwarding of the traffic.
The above-mentioned at least one technical scheme that this description embodiment adopted can reach following beneficial effect: by the technical scheme, the source MAC address of the loopback detection message is improved, the system MAC and the port serial number are used as the source MAC of the loopback detection message, whether the loopback detection message belongs to the same stacking system with the current receiving equipment or not is judged according to the system MAC, if the loopback detection message belongs to the same stacking system, the loopback detection message is reported, the problem that service processing is slowed down due to the fact that a large number of messages are sent is avoided, the processing time of invalid messages is shortened, and the normal service processing speed is maintained; in addition, for the stacking environment, the loop-back detection function does not need to be consistent with the port of the receiving and transmitting packet any more, and can take effect only by determining that stacking equipment for receiving and transmitting the message is consistent, and loop-back detection elimination loop can be used in the stacking environment.
Drawings
In order to more clearly illustrate the embodiments of the present description or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some of the embodiments described in the present description, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art. In the drawings:
fig. 1 is a schematic diagram of a stacked networking environment according to an embodiment of the present disclosure;
fig. 2 is a schematic flow chart of a loop-back detection method in a stacking environment according to an embodiment of the present disclosure;
fig. 3 is a schematic flow chart of table entry information synchronization according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of another stacked networking environment provided by embodiments of the present disclosure;
FIG. 5 is a flowchart of another loop-back detection method in a stacking environment according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a loopback detection device in a stacking environment according to an embodiment of the present disclosure.
Detailed Description
In order to make the technical solutions in the present specification better understood by those skilled in the art, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only some embodiments of the present specification, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present disclosure.
Stacking refers to that a plurality of switches supporting stacking characteristics are connected together through stacking cables, and logically virtualized into one switching device to participate in data forwarding as a whole. The stacking is a transverse virtualization technology widely applied at present, and has the effects of improving reliability, expanding the number of ports, increasing bandwidth, simplifying networking and the like. The traditional park network adopts equipment and link redundancy to ensure high reliability, but has low link utilization rate and high network maintenance cost, and the stacking technology virtualizes a plurality of switches into one switch, so that the purposes of simplifying network deployment and reducing network maintenance workload are achieved.
Stacking has many advantages: the reliability is improved, redundant backup is formed among a plurality of member switches of the stacking system, three devices form the stacking system, the devices are mutually backed up, and when the main device fails, the standby device can replace the main device to ensure the normal operation of the system. In addition, the stacking system supports a cross-device link aggregation function, and can also realize redundant backup of links. And when the number of the accessed users is increased to the original switch port density and the access requirement cannot be met, the number of the expanded ports of the stacking system formed by the new switch and the original switch can be increased. When the uplink bandwidth of the switch needs to be increased, a stacking system can be formed by adding a new switch and an original switch, and a plurality of physical links of the member switches are configured into an aggregation group, so that the uplink bandwidth of the switch is improved. The networking is simplified, and a plurality of devices in the network form a stack to be virtualized into a single logic device. The simplified networking no longer needs to use MSTP and other broken protocols, simplifies network configuration, and meanwhile, realizes quick switching when single equipment fails by means of cross-equipment link aggregation, thereby improving reliability. The users on each floor are connected to the external network through the corridor switches to form a stack, and the network structure is simpler because each building is provided with only one access device. Each building has multiple links to reach the core network, which becomes more robust and reliable. The configuration of the plurality of corridor switches simplifies the configuration of the stacking system and reduces the management and maintenance costs.
The loopback detection mainly monitors whether a loop exists in an external network environment, the loopback detection can send detection packets to corresponding ports, if the sent packets can be received from the sent ports, the loop exists in the ports, and for interfaces with the loop, the device can process according to the action configured under the ports. The source MAC of the message of the loopback detection is the physical MAC of the port sent by the equipment, the destination MAC is a special multicast MAC, if the equipment starts the loopback detection, the message can be sent to the equipment software for processing, after the equipment receives the message, the MAC of the port of the acceptance packet and the source MAC in the message can be detected, if the MAC is consistent, the equipment confirms that the message sent by the equipment is received, and then the external environment has a loop.
Fig. 1 is a schematic diagram of a stacking networking environment provided in the embodiment of the present disclosure, where, in the stacking environment shown in fig. 1, three devices form a basic stacking environment, a main device is responsible for service processing and traffic forwarding, and two other devices are responsible for traffic forwarding. When the client communicates with the server, the client is connected to the stacking environment through a physical port, and the three links form a loop under the condition that a spanning tree protocol is not configured, so that certain traffic forms a loop in the stacking networking environment, and normal service processing and traffic forwarding are affected. In the stacked networking environment of fig. 1, the master device starts the loopback detection function, and the port 1 sends out a loopback detection message, and after receiving the message, the client broadcasts the message in the same broadcast domain, and the port 1 of the slave device and the member device receives the message. According to the judgment logic of the loopback detection, if the source MAC of the message is not matched with the MAC of the packet receiving port, the networking environment is considered to have no loop, the loopback detection is not effective, and the problem of flow looping also exists. Because the destination MAC in the message of the loopback detection is a unified multicast MAC, all the devices which start the loopback detection function have the loopback detection message uploading software for processing. If there are a large number of loopback detection messages sent by non-self-equipment under the external network, the speed of software processing service will be affected by the sending of these messages, so that it is also necessary to shield the loopback detection messages sent by these non-self-equipment.
The embodiment of the present disclosure provides a loop-back detection method in a stacking environment, and it should be noted that an execution body in the embodiment of the present disclosure may be a server, or any device having a data processing capability. Fig. 2 is a flow chart of a loop-back detection method in a stacking environment according to an embodiment of the present disclosure, as shown in fig. 2, mainly including the following steps:
step S201, a loopback detection message is obtained, and the source MAC address of the sending device and the packet receiving address information of the receiving device of the loopback detection message are determined.
The source MAC address of the transmitting device includes a system MAC address of the stacked system and a port serial number of a transmitting port of the transmitting device.
Before the loop-back detection message is acquired, the method further comprises the following steps: and starting a loop-back detection function for the main equipment in the stacking system, and synchronizing to a plurality of standby equipment in the stacking system.
For the exchanger equipment, the loopback detection message can be sent only after the equipment starts the loopback detection function, the destination MAC of the message is a special multicast MAC, the equipment which also starts the loopback detection function can send software to process after receiving the message, and other equipment which does not start the loopback detection function can only forward the message in the same domain.
In one embodiment of the present disclosure, a loopback detection function is turned on for a master device in a stacked system, and based on the specificity of a stacked networking environment, after the master device turns on the loopback detection function, the action is synchronized to multiple devices belonging to the same stacked environment, so that other devices turn on the loopback detection function, where the multiple devices may be standby devices or member devices.
In one embodiment of the present disclosure, after each device in the stacked system has turned on the loopback detection function, a loopback detection message is sent through the enable port. It should be noted that, the source MAC of the loopback detection message of the normal device is the physical MAC of the packet sending port, so that after the port receives the message, it is judged that the source MAC is consistent with the local port MAC, and then the external network is considered to have a loop. The source MAC of the loopback detection message in the stacking environment is specially processed, and the physical MAC of the packet sending port is not used as the source MAC any more, but the system MAC plus the serial number of the sending port is used as the source MAC.
In one embodiment of the present disclosure, a loopback detection message received by a receiving device is obtained, and a source MAC address of a transmitting device of the loopback detection message and packet receiving address information of the receiving device are determined. Here, the source MAC address of the transmitting device includes a system MAC corresponding to the currently stacked system and a port serial number corresponding to a transmitting port of the transmitting device. In addition, the packet receiving address information of the receiving device is an address corresponding to the current receiving port, which may include a port MAC address of the current receiving port and may also include a port serial number of the current receiving port. In addition, it should be noted that the receiving device and the transmitting device may be the same device or may be different devices, but the receiving device and the transmitting device belong to one stack networking environment, and may also be understood to belong to one stack system.
Step S202, judging whether the loopback detection message is sent by the stacking system according to the system MAC address in the source MAC address of the loopback detection message and the packet receiving address information of the receiving equipment.
Because the destination MAC in the message of the loopback detection is a unified multicast MAC, all devices which start the loopback detection function can send the loopback detection message to the software for processing. If there are a large number of loopback detection messages sent by non-self devices under the external network, the speed of the software processing service will be affected by the uploading of these messages. In the stacking environment, a large number of loopback detection messages exist, and the messages are sent to a software layer for processing, so that the service flow of equipment processing is possibly slowed, and the network congestion is caused by the large number of loopback detection messages.
In one embodiment of the present disclosure, after receiving the loopback detection message, the port of the stacking master device first checks whether the message is a message sent by the system, by checking whether the first 24 bits of the source MAC in the loopback detection message are matched with the system MAC of the device, if so, the loopback detection message is sent by the current stacking system, then the message needs to be sent to a software layer preset in the master device for processing, and if not, the message does not need to be sent to software, and is directly discarded or forwarded.
In a stacked networking environment, after the equipment starts the function of loop-back detection, all loop-back detection messages are required to be processed, and the loop-back detection messages of a plurality of external network equipment are sent to software, so that the service processing capacity is reduced, so that the field inspection of the messages is carried out before the message is sent, whether the source MAC of the messages is matched or not is checked, and the messages are sent and processed after the message is matched, a large number of message sending is reduced, and the problem that the service processing is reduced due to the fact that a large number of messages are sent is avoided.
Step S203, when it is determined that the loopback detection message is sent by the stacking system, loopback detection is performed on the stacking system according to the port serial number in the source MAC address and the packet receiving address information of the receiving device, and a detection result is generated.
In one embodiment of the present disclosure, when it is determined that the loopback detection message is sent by a stacking device in the stacking system, the loopback detection message is reported to a software layer, and the software layer processes the loopback detection message to determine whether a network loop occurs.
And carrying out loop-back detection on the stacking system according to the port serial number in the source MAC address and the packet receiving address information of the receiving equipment to generate a detection result, wherein the method specifically comprises the following steps of: determining a receiving port for receiving the loopback detection message through the packet receiving address information of the receiving equipment; determining a sending port of the loopback detection message through the port serial number in the source MAC address; respectively acquiring working states of the receiving port and the sending port, wherein the working states comprise any one of an enabling state and a blocking state; and carrying out loop-back detection on the stacking system based on the working states of the receiving port and the sending port to generate a detection result.
Based on the working states of the receiving port and the sending port, performing loopback detection on the stacking system to generate a detection result, wherein the method specifically comprises the following steps: and when the working states of the receiving port and the sending port are both enabled states, determining that a loop circuit appears in the stacking system.
In one embodiment of the present disclosure, after receiving the loopback detection message, the software layer of the master device determines a receiving port for receiving the loopback detection message according to the packet receiving address information of the receiving device, and searches for a corresponding loopback detection enabling port according to the packet receiving port MAC. After the loopback detection enabling port is found, the sending port of the loopback detection message is determined through the port serial number in the source MAC address, if both ports are enabled, the device is indicated to receive the loopback detection message sent by the device, and the loopback detection is effective, namely, a network loop exists. Otherwise, if one port exists between the two ports and is in a blocking state, the loop-back detection is not effective, that is, the condition that a network loop does not exist is indicated.
Step S204, corresponding port actions are executed based on the detection result, so that normal forwarding of the traffic is realized.
When the detection result is that the stacking system has a loop, executing a corresponding port action based on the detection result, which specifically includes: acquiring port attributes of the receiving port and the transmitting port, wherein the port attributes comprise any one of a TRUNK port and a non-TRUNK port; when the port attribute of the receiving port is different from the port attribute of the sending port, blocking the port with the port attribute being a non-TRUNK port; when the port attributes of the receiving port and the sending port are the same, comparing the port serial number of the receiving port with the port serial number of the sending port, and blocking the port with smaller port serial number.
In one embodiment of the present disclosure, loop-back detection action processing is required after loop-back detection is validated. Because the loop-back detection is that two ports form a loop, only one port needs to be blocked, and the other port normally communicates, so that the traffic cannot form a loop and normal traffic forwarding and service processing can be ensured. So after the above-mentioned loop-back detection is effective, the protocol can compare VLAN attribute of two ports, ensure the communication of the TRUNK port is prioritized, namely one is TRUNK port, one is non-TRUNK port, then block the non-TRUNK port; if the VLAN attributes of the two ports are consistent, namely, the two ports are TRUNK ports or are non-TRUNK ports, comparing the serial numbers of the two ports, and blocking the port with the small serial number.
After executing the corresponding port action based on the detection result, the method further comprises: when the appointed stacking equipment in the stacking system executes the corresponding port action, the port information corresponding to the port action is stored, and a table entry is generated; storing the table item into a corresponding database of the appointed stacking equipment, and synchronizing the corresponding database to other stacking equipment so as to realize the synchronization of the table item; acquiring the table entry from corresponding databases of other stacking devices based on triggering operations of the other stacking devices; and when the equipment state of the appointed stacking equipment is the appointed state, executing corresponding port actions on the port through the other stacking equipment according to the synchronized table entry.
In one embodiment of the present disclosure, after the stack environment loop-back detection action is performed, the master device saves information of the port execution action and generates a corresponding table entry. These entries are not only needed by the primary device but also by the backup device. The protocol has a recovery mechanism, and when the equipment does not receive the same loopback detection message or the user manually opens the port within a certain time, the port is recovered again. In the normal operation process of the stacking environment, the loopback detection protocol can normally calculate the time of message reception, port information of protocol actions exists on the equipment, and when the recovery condition is met, the port can recover the capacity of flow forwarding and service processing. When the main device is disconnected due to version upgrade or device failure, the port information list items of the main device for recording the protocol actions are lost, so that the port for detecting the actions in a loop-back way can not be recovered, and the generated list item information needs to be synchronized to the standby device when the port is required to be detected in a loop-back way to perform the actions.
Fig. 3 is a schematic diagram of a table entry information synchronization flow provided in the embodiment of the present disclosure, where the synchronization flow is shown in fig. 3, and table entries are generated when a loopback detection is performed on a master device to perform a port action, and the table entry information is stored in a redis database, and a backup device acquires the table entry information generated by the loopback detection through subscribing to acquire database information in the master device. When the main equipment is disconnected due to version upgrade or equipment failure, the backup equipment can restore the loopback detection action information, so that the port state is consistent with that of the main equipment, and the loopback detection function is enabled to realize normal operation.
In a stacking environment, cross-device link aggregation is generally adopted to prevent loop generation, but in some special stacking environments, if a plurality of cross-device aggregation links are communicated with an external environment, loops are also possible between the links, and traffic forwarding of the aggregation links also has problems without using spanning tree protocol (Spanning Tree Protocol, STP). Fig. 4 is a schematic diagram of another stacking networking environment provided in the embodiment of the present disclosure, where in the stacking networking environment of fig. 4, a stacking device communicates with a client through two cross-device aggregation links, and due to a load sharing function of link aggregation, traffic can be forwarded normally between member links, but a loop exists between the two links, so that loop-back detection on link aggregation is required.
Based on the detection result, performing action processing specifically includes: when the stacking environment comprises a plurality of link aggregation groups, the detection result comprises that a loop appears between two link aggregation groups in the plurality of link aggregation groups; acquiring port attributes of aggregation ports corresponding to two link aggregation groups respectively, wherein the port attributes comprise any one of TRUNK ports and non-TRUNK ports; and blocking the designated aggregation ports in the designated link aggregation group according to the port attribute.
According to the port attribute, blocking the appointed aggregation port in the appointed link aggregation group specifically comprises: when the port attributes of the aggregation ports corresponding to the two link aggregation groups are different, blocking the port with the port attribute being a non-TRUNK port; when the port attributes of the aggregation ports corresponding to the two link aggregation groups are the same, comparing the port serial numbers of the aggregation ports corresponding to the two link aggregation groups obtained in advance, and blocking the port with the smaller port serial number.
In one embodiment of the present description, the loop-back detection of link aggregation and the loop-back detection of ports are the same, and in the action processing phase, the object that processes the action changes from a single physical port to an entire aggregate group port. Assuming that a network loop is formed between the aggregation group 1 and the aggregation group 2 in fig. 4, obtaining port attributes of aggregation ports corresponding to the aggregation group 1 and the aggregation group 2 respectively, where the port attributes include any one of TRUNK ports and non-TRUNK ports. And when the port attributes of the aggregation ports corresponding to the aggregation group 1 and the aggregation group 2 are different, blocking the aggregation ports with the port attributes being non-TRUNK ports. When the port attributes of the aggregation ports corresponding to the aggregation group 1 and the aggregation group 2 are the same, the port serial numbers of the aggregation ports corresponding to the aggregation group 1 and the aggregation group 2 are acquired in advance, the aggregation port serial numbers of the aggregation group 1 and the aggregation port serial numbers of the aggregation group 2 are compared, and the aggregation port with the smaller port serial number is blocked.
The addition and deletion of the members of the aggregation group also need special treatment, when the aggregation group is added with a new member port, the loop-back detection action information of the aggregation group needs to be synchronized to the member port, namely, the aggregation group is closed or blocked, and then the state of the member port is also closed and blocked; when the member port exits the aggregation group, the member port which becomes a physical port needs to be ensured to normally communicate, a loop exists between the physical link which exits the aggregation and the aggregation link, and loop detection is needed to close or block one link to ensure normal communication, and the general rule is to ensure the communication of the aggregation link preferentially. In a stacking environment, loop-back detection can be used on cross-equipment aggregation links to realize loop prevention among aggregation links, and normal communication of the links is guaranteed preferentially among common links and aggregation links.
By the technical scheme, the source MAC address of the loopback detection message is improved, the system MAC and the port serial number are used as the source MAC of the loopback detection message, whether the loopback detection message belongs to the same stacking system with the current receiving equipment or not is judged according to the system MAC, if the loopback detection message belongs to the same stacking system, the loopback detection message is reported, the problem that service processing is slowed down due to the fact that a large number of messages are sent is avoided, the processing time of invalid messages is shortened, and the normal service processing speed is maintained; in addition, for the stacking environment, the loop-back detection function does not need to be consistent with the port of the receiving and transmitting packet any more, and can take effect only by determining that stacking equipment for receiving and transmitting the message is consistent, and loop-back detection elimination loop can be used in the stacking environment.
In the embodiment of the present disclosure, a method for detecting loopback in another stacking environment is further provided, and fig. 5 is a schematic flow diagram of the method for detecting loopback in another stacking environment provided in the embodiment of the present disclosure, as shown in fig. 5, after the switch starts the loopback detection function, the enabling port sends a loopback detection message, and the source MAC of the loopback detection message of the normal device is the physical MAC of the sending port, so that after the port receives the message, it is determined that the source MAC is consistent with the MAC of the local port, and then the external network is considered to have a loop. The source MAC of the loopback detection message in the stacking environment is specially processed, and the physical MAC of the packet sending port is not used as the source MAC any more, but the system MAC plus the serial number of the port is used as the source MAC. After receiving the loopback detection message, the port of the stacking main device firstly checks whether the message is a message sent by the system or not, and the checking mode is to check whether the first 24 bits of the source MAC in the message are matched with the system MAC of the device or not, if so, the message is sent by the stacking system, then the message needs to be sent to a software layer for processing, and if not, the message does not need to be sent to software and is directly discarded or forwarded. After receiving the loopback detection message, the device software searches the corresponding loopback detection enabling port according to the MAC of the packet receiving port, searches the corresponding loopback detection enabling port according to the source MAC in the message after the loopback detection enabling port is found, and if both ports are enabled, the device is indicated to receive the loopback detection message sent by the device, the loopback detection is effective, the loopback detection action is processed, and the next message is continuously monitored.
The embodiment of the present disclosure further provides a loopback detection device in a stacking environment, as shown in fig. 6, where the device includes: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executable by the at least one processor to enable the at least one processor to:
acquiring a loopback detection message, and determining a source MAC address of a transmitting device and packet receiving address information of a receiving device of the loopback detection message, wherein the source MAC address of the transmitting device comprises a system MAC address of a stacking system and a port serial number of a transmitting port of the transmitting device; judging whether the loopback detection message is sent out by the stacking system or not according to the system MAC address in the source MAC address of the loopback detection message and the packet receiving address information of the receiving equipment; when the loopback detection message is judged to be sent by the stacking system, carrying out loopback detection on the stacking system according to the port serial number in the source MAC address and the packet receiving address information of the receiving equipment to generate a detection result; and executing corresponding port actions based on the detection result so as to realize normal forwarding of the traffic.
The present specification embodiments also provide a non-volatile computer storage medium storing computer-executable instructions configured to:
acquiring a loopback detection message, and determining a source MAC address of a transmitting device and packet receiving address information of a receiving device of the loopback detection message, wherein the source MAC address of the transmitting device comprises a system MAC address of a stacking system and a port serial number of a transmitting port of the transmitting device; judging whether the loopback detection message is sent out by the stacking system or not according to the system MAC address in the source MAC address of the loopback detection message and the packet receiving address information of the receiving equipment; when the loopback detection message is judged to be sent by the stacking system, carrying out loopback detection on the stacking system according to the port serial number in the source MAC address and the packet receiving address information of the receiving equipment to generate a detection result; and executing corresponding port actions based on the detection result so as to realize normal forwarding of the traffic.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for apparatus, devices, non-volatile computer storage medium embodiments, the description is relatively simple, as it is substantially similar to method embodiments, with reference to the section of the method embodiments being relevant.
The foregoing describes specific embodiments of the present disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
The foregoing is merely one or more embodiments of the present description and is not intended to limit the present description. Various modifications and alterations to one or more embodiments of this description will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, or the like, which is within the spirit and principles of one or more embodiments of the present description, is intended to be included within the scope of the claims of the present description.
Claims (10)
1. A method for loop-back detection in a stacked environment, the method comprising:
acquiring a loopback detection message, and determining a source MAC address of a sending device and packet receiving address information of a receiving device of the loopback detection message, wherein the source MAC address of the sending device comprises a system MAC address of a stacking system and a port serial number of a sending port of the sending device;
judging whether the loopback detection message is sent out by the stacking system or not according to the system MAC address in the source MAC address of the loopback detection message and the packet receiving address information of the receiving equipment;
when the loopback detection message is sent out by the stacking system, carrying out loopback detection on the stacking system according to the port serial number in the source MAC address and the packet receiving address information of the receiving equipment, and generating a detection result;
and executing corresponding port actions based on the detection result so as to realize normal forwarding of the traffic.
2. The method for detecting loopback in a stacking environment according to claim 1, wherein the method for detecting loopback in the stacking system according to the port serial number in the source MAC address and the packet receiving address information of the receiving device, and generating a detection result specifically comprises:
determining a receiving port for receiving the loopback detection message through the packet receiving address information of the receiving equipment;
determining a sending port of the loopback detection message through the port serial number in the source MAC address;
respectively acquiring working states of the receiving port and the sending port, wherein the working states comprise any one of an enabling state and a blocking state;
and carrying out loop-back detection on the stacking system based on the working states of the receiving port and the sending port to generate a detection result.
3. The method for detecting loop back in a stacking environment according to claim 2, wherein when the detection result is that the stacking system has a loop, executing a corresponding port action based on the detection result, specifically comprising:
acquiring port attributes of the receiving port and the transmitting port, wherein the port attributes comprise any one of a TRUNK port and a non-TRUNK port;
when the port attribute of the receiving port is different from the port attribute of the sending port, blocking the port with the port attribute of not TRUNK port;
when the port attributes of the receiving port and the sending port are the same, comparing the port serial number of the receiving port with the port serial number of the sending port, which is obtained in advance, and blocking the port with the smaller port serial number.
4. The method for loop-back detection in a stacking environment according to claim 1, wherein after performing a corresponding port action based on the detection result, the method further comprises:
when appointed stacking equipment in the stacking system executes corresponding port actions, port information corresponding to the port actions is stored, and table items are generated;
storing the table items into corresponding databases of the appointed stacking equipment, and synchronizing the corresponding databases to other stacking equipment so as to realize the synchronization of the table items;
acquiring the table entries from corresponding databases of other stacking devices based on triggering operations of the other stacking devices;
and when the equipment state of the appointed stacking equipment is the appointed state, executing corresponding port actions on the ports through the other stacking equipment according to the synchronized table items.
5. The method for detecting loop back in a stacking environment according to claim 1, wherein the action processing is performed based on the detection result, specifically comprising:
when the stacking environment comprises a plurality of link aggregation groups, the detection result comprises that a loop appears between two link aggregation groups in the plurality of link aggregation groups;
acquiring port attributes of aggregation ports corresponding to two link aggregation groups respectively, wherein the port attributes comprise any one of TRUNK ports and non-TRUNK ports;
and blocking the appointed aggregation ports in the appointed link aggregation group according to the port attribute.
6. The method for detecting loopback in a stacking environment according to claim 5, wherein blocking the designated aggregated ports in the designated link aggregation group according to the port attribute comprises:
when the port attributes of the aggregation ports respectively corresponding to the two link aggregation groups are different, blocking the port with the port attribute being a non-TRUNK port;
and when the port attributes of the aggregation ports corresponding to the two link aggregation groups are the same, comparing the port serial numbers of the aggregation ports corresponding to the two link aggregation groups obtained in advance, and blocking the port with the smaller port serial number.
7. The method for loop-back detection in a stacking environment according to claim 1, wherein before obtaining the loop-back detection packet, the method further comprises:
and starting a loop-back detection function for the main equipment in the stacking system, and synchronizing to a plurality of standby equipment in the stacking system.
8. The method for detecting loopback in a stacking environment according to claim 2, wherein the loopback detection is performed on the stacking system based on the working states of the receiving port and the transmitting port, and the method specifically comprises the steps of:
and when the working states of the receiving port and the sending port are both enabled states, determining that a loop circuit appears in the stacking system.
9. A loop-back detection apparatus in a stacked environment, the apparatus comprising:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores instructions executable by the at least one processor to enable the at least one processor to:
acquiring a loopback detection message, and determining a source MAC address of a sending device and packet receiving address information of a receiving device of the loopback detection message, wherein the source MAC address of the sending device comprises a system MAC address of a stacking system and a port serial number of a sending port of the sending device;
judging whether the loopback detection message is sent out by the stacking system or not according to the system MAC address in the source MAC address of the loopback detection message and the packet receiving address information of the receiving equipment;
when the loopback detection message is sent out by the stacking system, carrying out loopback detection on the stacking system according to the port serial number in the source MAC address and the packet receiving address information of the receiving equipment, and generating a detection result;
and executing corresponding port actions based on the detection result so as to realize normal forwarding of the traffic.
10. A non-transitory computer storage medium storing computer-executable instructions configured to:
acquiring a loopback detection message, and determining a source MAC address of a sending device and packet receiving address information of a receiving device of the loopback detection message, wherein the source MAC address of the sending device comprises a system MAC address of a stacking system and a port serial number of a sending port of the sending device;
judging whether the loopback detection message is sent out by the stacking system or not according to the system MAC address in the source MAC address of the loopback detection message and the packet receiving address information of the receiving equipment;
when the loopback detection message is sent out by the stacking system, carrying out loopback detection on the stacking system according to the port serial number in the source MAC address and the packet receiving address information of the receiving equipment, and generating a detection result;
and executing corresponding port actions based on the detection result so as to realize normal forwarding of the traffic.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210959877.8A CN115412456B (en) | 2022-08-11 | 2022-08-11 | Loop detection method, device and medium in stacking environment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210959877.8A CN115412456B (en) | 2022-08-11 | 2022-08-11 | Loop detection method, device and medium in stacking environment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115412456A CN115412456A (en) | 2022-11-29 |
CN115412456B true CN115412456B (en) | 2023-10-27 |
Family
ID=84158714
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210959877.8A Active CN115412456B (en) | 2022-08-11 | 2022-08-11 | Loop detection method, device and medium in stacking environment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115412456B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101594304A (en) * | 2009-07-02 | 2009-12-02 | 杭州华三通信技术有限公司 | Prevent that pile system from producing the method for loop and the member device in the pile system |
CN101710856A (en) * | 2009-11-13 | 2010-05-19 | 中兴通讯股份有限公司 | Method and equipment for detection processing of loopback of aggregation link |
CN102420721A (en) * | 2011-11-30 | 2012-04-18 | 瑞斯康达科技发展股份有限公司 | Loop detection message packaging method, loop detection method and device |
WO2017215291A1 (en) * | 2016-06-12 | 2017-12-21 | 烽火通信科技股份有限公司 | Ipran device-based method for detecting and processing ethernet loop |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7672227B2 (en) * | 2005-07-12 | 2010-03-02 | Alcatel Lucent | Loop prevention system and method in a stackable ethernet switch system |
TWI514821B (en) * | 2014-02-26 | 2015-12-21 | Accton Technology Corp | Network devices and loopback detection methods |
US10361948B2 (en) * | 2017-03-02 | 2019-07-23 | Dell Products, L.P. | Communication loop prevention in an information handling system |
-
2022
- 2022-08-11 CN CN202210959877.8A patent/CN115412456B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101594304A (en) * | 2009-07-02 | 2009-12-02 | 杭州华三通信技术有限公司 | Prevent that pile system from producing the method for loop and the member device in the pile system |
CN101710856A (en) * | 2009-11-13 | 2010-05-19 | 中兴通讯股份有限公司 | Method and equipment for detection processing of loopback of aggregation link |
CN102420721A (en) * | 2011-11-30 | 2012-04-18 | 瑞斯康达科技发展股份有限公司 | Loop detection message packaging method, loop detection method and device |
WO2017215291A1 (en) * | 2016-06-12 | 2017-12-21 | 烽火通信科技股份有限公司 | Ipran device-based method for detecting and processing ethernet loop |
Non-Patent Citations (2)
Title |
---|
Protocol virtualization through dynamic network stacks;Jens Heuschkel等;《: 2015 International Conference and Workshops on Networked Systems (NetSys)》;全文 * |
基于源抑制表项防止堆叠报文成环的实现方法;刘纬;陈钱;;电子设计工程(23);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN115412456A (en) | 2022-11-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9655232B2 (en) | Spanning tree protocol (STP) optimization techniques | |
CN111865779B (en) | Route synchronization method and cross-device link aggregation group | |
TW200421777A (en) | High availability Ethernet backplane architecture | |
CN102315975B (en) | Fault processing method based on intelligent resilient framework (IRF) system and equipment thereof | |
CN101588304B (en) | Implementation method of VRRP and device | |
US9385944B2 (en) | Communication system, path switching method and communication device | |
CN102148677A (en) | Method for updating address resolution protocol table entries and core switch | |
WO2009023996A1 (en) | Method for implementing network interconnect via link aggregation | |
WO2017000832A1 (en) | Mac address synchronization method, device and system | |
JP2010525693A (en) | Distributed Ethernet system and method for detecting faults based on the system | |
WO2020259121A1 (en) | Method, apparatus and system for implementing traffic switching | |
US20190007302A1 (en) | Mechanism for Dual Active Detection Link Monitoring in Virtual Switching System with Hardware Accelerated Fast Hello | |
CN113315665B (en) | Message sending method, device, equipment and medium of dual-network-card terminal equipment | |
CN114978987B (en) | Server Redundancy Backup Method | |
CN112511326A (en) | Switching method, device, equipment and storage medium | |
CN114244736A (en) | Multi-master detection method, equipment and medium based on stacking environment | |
CN111953591A (en) | Fault processing method and device | |
CN102932249B (en) | A kind of transmission method of VRRP message and device | |
JP2007208502A (en) | Communication system, backup router, redundant processing program thereof, and redundant processing method thereof | |
CN115412456B (en) | Loop detection method, device and medium in stacking environment | |
CN101237319A (en) | Time synchronization method in Ethernet ring network and Ethernet ring system | |
WO2020152693A1 (en) | Method and system to selectively flush filtering databases in a major ring of an ethernet ring protection switching network | |
CN112737938B (en) | DRP switching method, device, equipment and medium | |
CN102045600A (en) | Link protection method and device of Ethernet accessed to SDH (Synchronous Digital Hierarchy) optical network | |
CN111224803B (en) | Multi-master detection method in stacking system and stacking system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP03 | Change of name, title or address | ||
CP03 | Change of name, title or address |
Address after: 250101 s01-6 / F, No. 1036, Langchao Road, high tech Zone, Jinan City, Shandong Province Patentee after: Inspur Network Technology (Shandong) Co.,Ltd. Country or region after: China Address before: 250101 s01-6 / F, No. 1036, Langchao Road, high tech Zone, Jinan City, Shandong Province Patentee before: INSPUR CISCO NETWORK TECHNOLOGY Co.,Ltd. Country or region before: China |