Disclosure of Invention
In view of the above, the present invention is directed to a method and an apparatus for VSI-based loop detection in a DRNI network to improve the above-mentioned problems.
The embodiment of the invention provides a loop detection method based on VSI in a DRNI network, which comprises the following steps:
enabling a loop detection function on each Leaf node in the first DRNI networking; the loop detection function is used for triggering a loop detection message to be sent to the CPU; the common IP of the first DRNI networking and the common IP of the second DRNI networking establish a first tunnel, and the first DRNI networking is connected with each device through a DR interface; the AC interfaces and tunnels in the first DRNI networking and the second DRNI networking are bound in the same VSI;
constructing a loop detection message at each Leaf node in the first DRNI networking; the loop detection message is sent by broadcasting on the VSI of the loop detection message and is sent out on the first tunnel and each AC interface;
judging whether the SMAC received in the preset time is a loop detection message of the equipment;
if receiving the loop detection message from other panel ports except the internal control link port, discarding the two-layer unicast message and broadcast message based on the VSI, and removing the loop.
Preferably, the loop detection message ethernet header encapsulation format includes the following fields:
DMAC: the destination MAC address of the message uses a multicast MAC address 010F-E200-8570; when the device enables the loop detection function, the message of the destination address is redirected to the CPU for processing, and the original message is broadcasted in the VSI receiving the message;
SMAC: the source MAC address of the message adopts the bridge MAC of the equipment sending the message;
TPID: the type of the VLAN label is 0x8100;
VLAN: specific values of the VLAN tag, wherein the specific contents comprise priority and VLAN ID;
type: a protocol type;
data: the data is in TLV format; the Data includes the following contents: chassis ID TLV, slot ID TLV, VSI TLV, VLAN TLV, port ID TLV, and End of TLV.
Preferably, the releasing the loop comprises:
confirming a virtual interface of the VSI inner loop, and removing the loop; the virtual interface comprises an AC interface or a tunnel.
Preferably, the virtual interface of the inner ring of the VSI is confirmed; the virtual interface comprises an AC interface or a tunnel, and comprises:
virtual interfaces related to VSI on each Leaf node of a first DRNI networking send detection messages based on the virtual interfaces;
when the device receives a detection message from a virtual interface, checking whether the SMAC, the Chassis ID and the Slot ID in the detection message are information of the device;
if not, adding the virtual interface information of the received loop detection message into the detection message and sending the virtual interface information from the IPP port among the Leaf nodes, so as to forward the virtual interface information to other equipment of the first DRNI networking;
if yes, indicating that the virtual interface recorded in the DATA of the loop detection message is related to the virtual interface of the received detection message, namely, forming a loop; setting the corresponding virtual interface to be BLOCK according to the preset loop detection BLOCK priority;
after the detection is completed, ACLs discarded by the two-layer unicast message and the broadcast message which are matched with the VSI are deleted, and the VSI loop is released.
Preferably, the loop detection Block priorities are, in order from high to low:
the message sent by the user is received from the user, and the local virtual interface has the priority of BLOCK;
the tunnel sent by the AC interface can be received, and meanwhile, the AC interface sent by the tunnel can also be received, and the priority AC interface is set to be BLOCK;
a second AC interface sent by the first AC interface receives the signal, a first AC interface sent by the second AC interface receives the signal, and a BLOCK with a small port is sent by the second AC interface; when the tunnel is sent out and received from another tunnel, the tunnel index is small and the BLOCK is set based on the VSI;
the virtual interface capable of receiving and transmitting in one direction sets BLOCK.
Preferably, the method further comprises the following steps:
when the state of the associated virtual interface changes, starting a detection flow of the associated Block virtual interface; if the first tunnel fails or the first tunnel is unbound with the VSI, sending a detection message based on the virtual interface from the second AC interface immediately, and if the detection message is not received in advance, setting the state of the second AC interface to Forward.
The embodiment of the invention also provides a VSI-based loop detection device in a DRNI network, which comprises:
a loop detection enabling unit, configured to enable a loop detection function on each Leaf node in the first DRNI networking; the loop detection function is used for triggering a loop detection message to be sent to the CPU; the common IP of the first DRNI networking and the common IP of the second DRNI networking establish a first tunnel, and the first DRNI networking is connected with each device through a DR interface; the AC interfaces and tunnels in the first DRNI networking and the second DRNI networking are all bound in the same VSI;
a detection message constructing unit, configured to construct a loop detection message at each Leaf node in the first DRNI networking; the loop detection message is sent by broadcasting on the VSI of the loop detection message and is sent out on the first tunnel and each AC interface;
the judging unit is used for judging whether the SMAC received in the preset time is the loop detection message of the equipment;
and the removing unit is used for removing the two-layer unicast message and the broadcast message based on the VSI and removing the loop if the loop detection message is received from other panel ports except the internal control link port.
Preferably, the loop detection message ethernet header encapsulation format includes the following fields:
DMAC: the destination MAC address of the message uses multicast MAC address 010F-E200-8570; when the equipment enables the loop detection function, the message of the destination address is redirected to a CPU for processing, and the original message is broadcasted in the VSI receiving the message;
SMAC: the source MAC address of the message adopts the bridge MAC of the equipment sending the message;
TPID: the type of the VLAN label is 0x8100;
VLAN: specific values of the VLAN tag, wherein the specific contents comprise priority and VLAN ID;
type: a protocol type;
data: the data is in TLV format; the Data includes the following contents: a chatsis ID TLV, a Slot ID TLV, a VSI TLV, a VLAN TLV, a Port ID TLV, and an End of TLV.
Preferably, the releasing unit is specifically configured to: confirming a virtual interface of a loop in the VSI, and removing the loop; the virtual interface comprises an AC interface or a tunnel.
Preferably, the releasing unit is specifically configured to:
virtual interfaces related to VSI on each Leaf node of the first DRNI networking send detection messages based on the virtual interfaces;
when the device receives a detection message from a virtual interface, checking whether the SMAC, the Chassis ID and the Slot ID in the detection message are information of the device;
if not, adding the virtual interface information of the received loop detection message into the detection message and sending the virtual interface information from the IPP port among the Leaf nodes, so as to forward the virtual interface information to other equipment of the first DRNI networking;
if yes, indicating that the virtual interface recorded in the DATA of the loop detection message is related to the virtual interface of the received detection message, namely, forming a loop; setting a corresponding virtual interface to be BLOCK according to a preset loop detection BLOCK priority;
after the detection is completed, ACLs discarded by the two-layer unicast message and the broadcast message which are matched with the VSI are deleted, and the VSI loop is released.
Preferably, the loop detection Block priorities are, from high to low:
the message sent by the user is received from the user, and the local virtual interface has the priority of BLOCK;
the tunnel sent by the AC interface can be received, and meanwhile, the AC interface sent by the tunnel can also be received, and the priority AC interface is set to be BLOCK;
receiving by a second AC interface sent by the first AC interface, receiving by the first AC interface sent by the second AC interface, and obtaining a BLOCK with a small port; when the tunnel is sent out and received from another tunnel, the tunnel index is small and the BLOCK is set based on the VSI;
the virtual interface capable of receiving and transmitting in one direction sets BLOCK.
In summary, the present embodiment can check whether a loop exists in the DRNI networking, and release the loop through the interface related to BLOCK. When the DRNI environment is changed, the method can quickly respond, and update the state of the relevant interface to ensure that the traffic is normally forwarded.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
For better understanding of the technical solutions of the present invention, the following detailed descriptions of the embodiments of the present invention are provided with reference to the accompanying drawings.
It should be understood that the described embodiments are only some embodiments of the invention, and not all embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
The terminology used in the embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the examples of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
The invention is described in further detail below with reference to the following detailed description and accompanying drawings:
referring to fig. 2 and 3 together, a first embodiment of the present invention provides a VSI-based loop detection method in a DRNI network, which includes:
s101, enabling a loop detection function on each Leaf node in the first DRNI networking; the loop detection function is used for triggering a loop detection message to be sent to the CPU; the common IP of the first DRNI networking and the common IP of the second DRNI networking establish a first tunnel, and the first DRNI networking is connected with each device through a DR interface; the AC interfaces and tunnels in the first DRNI network and the second DRNI network are bound in the same VSI.
In this embodiment, taking fig. 3 as an example, a DRNI network includes a first DRNI network 10 and a second DRNI network 20, the first DRNI network 10 includes a first Leaf node 11 and a second Leaf node 12, the second DRNI network 20 includes a third Leaf node 21 and a second Leaf node 22, a first tunnel is established between a common IP of the first DRNI network 10 and a common IP of the second DRNI network 20, and the DRNI is connected to each device (i.e., the first device 31, the second device 32, the third device 33, and the fourth device 34 in fig. 3) through a Distributed Relay interface (DR interface); each AC interface and the first tunnel in the DRNI network are bound in the same VSI (as is the Vxlan ID associated with the VSI). And all Leaf nodes in the group network are communicated through Spine three layers.
It should be noted that, in other embodiments of the present invention, the number of DRNI networks and the number of Leaf nodes in one DRNI network may be set according to actual needs, and the present invention is not limited in particular.
S102, constructing a loop detection message at each Leaf node in the first DRNI networking; the loop detection message is broadcast and sent on the VSI of the loop detection message and is sent out on the first tunnel and each AC interface;
and S103, judging whether the SMAC received in the preset time is the loop detection message of the equipment.
If not, no loop is formed.
S104, if receiving the loop detection message from other panel ports except the internal control link port, discarding the two-layer unicast message and the broadcast message based on the VSI, and removing the loop.
In this embodiment, in order to detect whether there is a loop in the networking, the loop detection function is first enabled on the first Leaf node 11 and the second Leaf node 12 in the first DRNI networking 10. This operation issues an acl that causes a loop detection message to be sent to the CPU, specifically by matching Ethernet type and DMAC.
Then, a loop detection message is constructed on the first Leaf node 11 and the second Leaf node 12.
As shown in fig. 4, the encapsulating format of the ethernet header of the loop detection packet is as follows:
DMAC: the destination MAC address of the message uses the multicast MAC address 010F-E200-8570. When the device enables the loop detection function, the message of the destination address is redirected to the CPU for processing, and the original message is broadcasted in the VSI receiving the message.
SMAC: the source MAC address of the message is the bridge MAC of the device sending the message.
TPID: the VLAN tag may be 0x8100.
VLAN: specific values of the VLAN tag include priority, VLAN ID, and the like.
Type: and the protocol type takes a value of 0x8570, and the value can be adjusted according to actual conditions.
Data: the data is in the form of TLV, the contents of which are shown in fig. 5.
The TLV format is type + length + value, where type represents the type of TLV, length is the length of TLV in bytes, and value is the value of TLV. Where an End Of TLV is mandatory, a part that must be contained, in addition to which 1 to several optional other TLVs may be contained before the End Of TLV. The TLV format is shown in fig. 6.
TYPE definition of TLV is shown in table 1 below:
TABLE 1
Where TLV for Mandatory is the part that DATA must contain. The End Of TLV format is shown in fig. 7.
In this embodiment, after the loop detection message is constructed, the loop detection message is broadcast and sent on the VSI of the present network, and the loop detection message is sent on the first tunnel, the first AC interface 41, and the second AC interface 42. If the SMAC is not received within the preset time (such as 1 second) and is the loop detection message of the equipment, the loop is considered to be not existed. If a loop detection message is received from a panel Port other than a PP (Intra-Port) (SMAC is a bridge MAC of the first Leaf node 11 or the second Leaf node 12), the next ACL discards both the two-layer unicast message and the broadcast message based on the VSI, and removes the loop. Wherein the loop is released as follows:
firstly, confirming virtual interfaces of a ring formed in a VSI, and sending a detection message based on the virtual interfaces related to the VSI on each Leaf node of a first DRNI networking;
then, when the device receives the detection message from the virtual interface, checking whether the SMAC, the Chassis ID and the Slot ID in the detection message are the information of the device;
if not, adding the virtual interface information of the received loop detection message into the detection message and sending the virtual interface information from the IPP port among the Leaf nodes, so as to forward the virtual interface information to other equipment of the first DRNI networking;
if yes, indicating that the virtual interface recorded in the DATA of the loop detection message is related to the virtual interface of the received detection message, namely, forming a loop; and setting the corresponding virtual interface to be BLOCK according to the preset loop detection BLOCK priority.
As shown in fig. 8, if the probe message sent by the second AC interface 42 is received from the first tunnel, and the probe message sent by the first tunnel is received from the second AC interface 42, the second AC interface 42 is set to Block, and a virtual interface associated with the second AC interface 42 is recorded as the first tunnel.
The priority of the loop detection Block is sequentially from high to low as follows:
the message sent by the virtual interface is received from the virtual interface, and the local virtual interface has the priority of BLOCK;
the tunnel sent by the AC interface can be received, and the AC interface sent by the tunnel can also be received, and the BLOCK is set on the AC interface preferentially;
a second AC interface sent by the first AC interface receives the signal, a first AC interface sent by the second AC interface receives the signal, and a BLOCK with a small port is sent by the second AC interface; when the tunnel is sent out, the tunnel is received from another tunnel, and the tunnel index is small, and the BLOCK is set based on the VSI;
the virtual interface capable of receiving and transmitting in one direction sets BLOCK.
After the detection is finished, ACLs discarded by the two-layer unicast message and the broadcast message which are matched with the VSI are deleted, the VSI loop is removed, and thus the flow can be normally forwarded.
In this embodiment, when the state of the associated virtual interface changes, the detection flow of the associated Block virtual interface is immediately started. And if the first tunnel fails or the first tunnel is unbound with the VSI, immediately sending a detection message based on the virtual interface from the second AC interface, and if the message is not received within 1 second, setting the state of the second AC interface to Forward.
In summary, the present embodiment can check whether a loop exists in the DRNI networking, and release the loop through the interface related to BLOCK. When the DRNI environment is changed, the method can quickly respond, and update the state of the relevant interface to ensure that the traffic is normally forwarded.
Referring to fig. 9, a VSI-based loop detection apparatus in a DRNI network according to a second embodiment of the present invention includes:
a loop detection enabling unit 210, configured to enable a loop detection function on each Leaf node in the first DRNI networking; the loop detection function is used for triggering a loop detection message to be sent to the CPU; the common IP of the first DRNI networking and the common IP of the second DRNI networking establish a first tunnel, and the first DRNI networking is connected with each device through a DR interface; the AC interfaces and tunnels in the first DRNI networking and the second DRNI networking are all bound in the same VSI;
a detection packet constructing unit 220, configured to construct a loop detection packet at each Leaf node in the first DRNI networking; the loop detection message is broadcast and sent on the VSI of the loop detection message and is sent out on the first tunnel and each AC interface;
a determining unit 230, configured to determine whether the SMAC is a loop detection packet of the device received within a preset time;
a removing unit 240, configured to discard both the two-layer unicast packet and the broadcast packet based on the VSI if the loop detection packet is received from the panel port other than the internal control link port, and remove the loop.
Preferably, the loop detection message ethernet header encapsulation format includes the following fields:
DMAC: the destination MAC address of the message uses a multicast MAC address 010F-E200-8570; when the device enables the loop detection function, the message of the destination address is redirected to the CPU for processing, and the original message is broadcasted in the VSI receiving the message;
SMAC: the source MAC address of the message adopts the bridge MAC of the equipment sending the message;
TPID: the type of the VLAN label is 0x8100;
VLAN: specific values of the VLAN tag, wherein the specific contents comprise priority and VLAN ID;
type: a protocol type;
data: the data is in TLV format; the Data includes the following contents: chassis ID TLV, slot ID TLV, VSI TLV, VLAN TLV, port ID TLV, and End of TLV.
Preferably, the release unit is used for confirming the virtual interface of the inner ring of the VSI and releasing the ring; the virtual interface comprises an AC interface or a tunnel.
Preferably, the releasing unit is specifically configured to:
virtual interfaces related to VSI on each Leaf node of the first DRNI networking send detection messages based on the virtual interfaces;
when the device receives a detection message from a virtual interface, checking whether the SMAC, the Chassis ID and the Slot ID in the detection message are information of the device;
if not, adding the virtual interface information of the received loop detection message into the detection message and sending the virtual interface information from the IPP port among the Leaf nodes, so as to forward the virtual interface information to other equipment of the first DRNI networking;
if yes, indicating that the virtual interface recorded in the DATA of the loop detection message is related to the virtual interface of the received detection message, namely, forming a loop; setting a corresponding virtual interface to be BLOCK according to a preset loop detection BLOCK priority;
after the detection is completed, ACLs discarded by the two-layer unicast message and the broadcast message which are matched with the VSI are deleted, and the VSI loop is released.
Preferably, the loop detection Block priorities are, in order from high to low:
the message sent by the user is received from the user, and the local virtual interface has the priority of BLOCK;
the tunnel sent by the AC interface can be received, and meanwhile, the AC interface sent by the tunnel can also be received, and the priority AC interface is set to be BLOCK;
a second AC interface sent by the first AC interface receives the signal, a first AC interface sent by the second AC interface receives the signal, and a BLOCK with a small port is sent by the second AC interface; when the tunnel is sent out and received from another tunnel, the tunnel index is small and the BLOCK is set based on the VSI;
the virtual interface capable of receiving and transmitting in one direction sets BLOCK.
In the embodiments provided in the embodiments of the present invention, it should be understood that the disclosed apparatus and method may be implemented in other manners. The apparatus and method embodiments described above are merely illustrative and, for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, the functional modules in the embodiments of the present invention may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention or a part thereof which substantially contributes to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, an electronic device, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes. It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.