[go: up one dir, main page]

CN113904975B - Method, equipment and storage medium for realizing dual-homing link - Google Patents

Method, equipment and storage medium for realizing dual-homing link Download PDF

Info

Publication number
CN113904975B
CN113904975B CN202111138546.XA CN202111138546A CN113904975B CN 113904975 B CN113904975 B CN 113904975B CN 202111138546 A CN202111138546 A CN 202111138546A CN 113904975 B CN113904975 B CN 113904975B
Authority
CN
China
Prior art keywords
port
link
dhrl
node
rstp
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
Application number
CN202111138546.XA
Other languages
Chinese (zh)
Other versions
CN113904975A (en
Inventor
袁志亚
尹二飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Kyland Technology Co Ltd
Original Assignee
Kyland Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Kyland Technology Co Ltd filed Critical Kyland Technology Co Ltd
Priority to CN202111138546.XA priority Critical patent/CN113904975B/en
Publication of CN113904975A publication Critical patent/CN113904975A/en
Application granted granted Critical
Publication of CN113904975B publication Critical patent/CN113904975B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/18Loop-free operations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the invention discloses a method, equipment and a storage medium for realizing a dual-homing link. The two ends of the intermediate link are connected to two DHRL-C ports of the main link, the intermediate device included in the intermediate link and the main link device included in the main link belong to different device manufacturers, and the intermediate device starts the RSTP function, and the method comprises the following steps: after determining that a loop exists and triggering port election, if a response message sent by another DHRL-C port is received from the DHRL-C port of the node, the main link equipment sets the DHRL-C port of the node to be in a forwarding state and sends an RSTP topology change message to the intermediate equipment to realize link switching; if the intermediate device detects the link interruption, the intermediate device sets the RSTP enabling port of the node in the interrupted link to be in a blocking state, and sends an RSTP topology change message outwards to realize link switching. According to the technical scheme of the embodiment of the invention, the dual-homing link is formed among the devices of different device manufacturers, and the loop avoidance and the rapid forwarding of the dual-homing link are realized by using the RSTP.

Description

双归属链路的实现方法、设备及存储介质Implementation method, device and storage medium of dual-homing link

技术领域technical field

本发明实施例涉及通信技术领域,尤其涉及一种双归属链路的实现方法、设备及存储介质。The embodiments of the present invention relate to the technical field of communications, and in particular, to a method, device, and storage medium for implementing a dual-homing link.

背景技术Background technique

双归属链路指的是几台设备组成的中间链路的两边同时挂在一个主链路上,主链路通过自选举发现环路,并阻塞一个链路,当某一个链路故障时,自动发现并放开冗余链路。A dual-homing link means that both sides of an intermediate link composed of several devices are connected to a main link at the same time. The main link finds a loop through self-election and blocks a link. When a link fails, Automatically discover and release redundant links.

目前,双归属链路的实现方法各个设备厂商各不相同,因此无法实现跨厂商设备间混合组网。在有些双归属链路的实现中,甚至对设备的配置和组网有较高的要求。例如,要求与主链路连接的端口必须配置为特殊端口,并且组网时只能通过指定的特殊端口与主链路互连,否则可能会导致双归属链路的功能失效,出现环路等。At present, the implementation methods of dual-homing links are different among different equipment manufacturers, so it is impossible to implement mixed networking between equipment from different manufacturers. In the implementation of some dual-homing links, there are even higher requirements for device configuration and networking. For example, it is required that the port connected to the main link must be configured as a special port, and it can only be interconnected with the main link through the designated special port during networking, otherwise the function of the dual-homing link may fail, and loops may occur. .

发明内容Contents of the invention

本发明实施例提供一种双归属链路的实现方法、设备及存储介质,以在不同设备厂商的设备间组成双归属链路,并利用RSTP实现双归属链路的环路避免和快速转发。Embodiments of the present invention provide a dual-homing link implementation method, device and storage medium, so as to form a dual-homing link between devices of different equipment manufacturers, and implement loop avoidance and fast forwarding of the dual-homing link by using RSTP.

第一方面,本发明实施例提供了一种双归属链路的实现方法,双归属链路包括主链路和中间链路,中间链路的两端连接到主链路的两个双归属连接端口DHRL-C上,中间链路中包括的中间设备与主链路中包括的主链路设备属于不同的设备厂商,中间链路中包括的中间设备开启快速生成树协议(rapid spanning Tree Protocol,RSTP)功能,方法包括:In the first aspect, the embodiment of the present invention provides a method for implementing a dual-homing link. The dual-homing link includes a main link and an intermediate link, and the two ends of the intermediate link are connected to the two dual-homing connections of the main link. On port DHRL-C, the intermediate device included in the intermediate link and the main link device included in the main link belong to different equipment manufacturers, and the intermediate device included in the intermediate link starts the rapid spanning tree protocol (rapid spanning tree protocol, RSTP) function, methods include:

主链路设备在确定存在环路并触发端口选举后,如果从本节点的DHRL-C端口接收到另一DHRL-C端口发送的回应报文,则将本节点的DHRL-C端口设置为转发态,并向中间设备发送RSTP拓扑变化报文以实现链路切换;After the main link device determines that there is a loop and triggers port election, if it receives a response message sent by another DHRL-C port from the DHRL-C port of this node, it will set the DHRL-C port of this node to forward State, and send RSTP topology change message to the intermediate device to achieve link switching;

中间设备如果检测出链路中断,则将中断链路中本节点的RSTP使能端口设置为阻塞态,并向外发送RSTP拓扑变化报文以实现链路切换。If the intermediate device detects that the link is interrupted, it sets the RSTP enabled port of the node in the interrupted link to a blocking state, and sends an RSTP topology change message to realize link switching.

可选的,主链路设备在确定存在环路并触发端口选举后,如果从本节点的DHRL-C端口接收到另一DHRL-C端口发送的回应报文,则将本节点的DHRL-C端口设置为转发态,并向中间设备发送RSTP拓扑变化报文以实现链路切换,包括:Optionally, after the master link device determines that there is a loop and triggers port election, if it receives a response message sent by another DHRL-C port from the DHRL-C port of this node, it will send the DHRL-C port of this node to The port is set to forwarding state, and sends RSTP topology change message to the intermediate device to realize link switching, including:

处于主链态的主链路设备,通过本节点的DHRL-C端口周期性地向外发送环检测报文,环检测报文通过中间设备的转发态端口转发至另一DHRL-C端口;The main link device in the main link state periodically sends out the ring detection message through the DHRL-C port of the node, and the ring detection message is forwarded to another DHRL-C port through the forwarding state port of the intermediate device;

主链路设备如果通过本节点的DHRL-C端口接收到另一DHRL-C端口发送的环检测报文,则确定存在环路触发端口选举;If the main link device receives a ring detection message sent by another DHRL-C port through the DHRL-C port of this node, it determines that there is a loop to trigger port election;

主链路设备如果通过本节点的DHRL-C端口接收到另一DHRL-C端口发送的回应报文,则将本节点的DHRL-C端口设置为转发态,并向主链路中的其他设备发送清表报文,同时向中间链路中的中间设备发送RSTP拓扑变化报文,以实现链路切换。If the main link device receives the response message sent by another DHRL-C port through the DHRL-C port of this node, it will set the DHRL-C port of this node to the forwarding state and send a message to other devices in the main link. Send a table clear message, and send an RSTP topology change message to the intermediate device in the intermediate link at the same time, so as to realize link switching.

可选的,端口选举过程包括:Optionally, the port election process includes:

在第一设备通过第一DHRL-C端口接收第二设备通过第二DHRL-C端口发送的环检测报文之后,将第一DHRL-C端口的MAC地址与环检测报文中的源MAC地址进行比较;After the first device receives the ring detection message sent by the second device through the second DHRL-C port through the first DHRL-C port, the MAC address of the first DHRL-C port is combined with the source MAC address in the ring detection message Compare;

如果源MAC地址与第一DHRL-C端口的MAC地址不同,则将小的MAC地址对应的设备作为目标设备;If the source MAC address is different from the MAC address of the first DHRL-C port, the device corresponding to the smaller MAC address is used as the target device;

如果源MAC地址与第一DHRL-C端口的MAC地址相同,则将环检测报文中的端口号与第一DHRL-C端口的端口号进行比较,并在两者不同时,将小的端口号对应的设备作为目标设备;If the source MAC address is the same as the MAC address of the first DHRL-C port, compare the port number in the loop detection message with the port number of the first DHRL-C port, and when the two are different, the smaller port The device corresponding to the number is used as the target device;

目标设备将本节点的DHRL-C端口切换为转发态,将对应的链路状态切换为主链态,同时通过本节点的DHRL-C端口接收对端发送的回应报文。The target device switches the DHRL-C port of the local node to the forwarding state, switches the corresponding link state to the main chain state, and at the same time receives the response message sent by the peer end through the DHRL-C port of the local node.

可选的,在中间设备如果检测出链路中断,则将中断链路中本节点的RSTP使能端口设置为阻塞态,并向外发送RSTP拓扑变化报文之后,还包括:Optionally, if the intermediate device detects that the link is interrupted, then the RSTP enabling port of the node in the interrupted link is set to a blocking state, and after sending the RSTP topology change message to the outside, it also includes:

处于主链态的主链路设备,通过本节点的DHRL-C端口接收到RSTP拓扑变化报文后,将本节点的DHRL-C端口切换为阻塞态,并清除本地转发表,同时向主链路的其他设备发送清表报文;The main link device in the main chain state, after receiving the RSTP topology change message through the DHRL-C port of the local node, switches the DHRL-C port of the local node to the blocking state, clears the local forwarding table, and sends a message to the main chain at the same time. Other devices on the road send clearing messages;

如果本节点的DHRL-C端口在连续第一次数发送环检测报文后,都没有收到另一DHRL-C端口反馈的回应报文,则当再次发送环检测报文时将本节点的DHRL-C端口切换为转发态。If the DHRL-C port of this node does not receive the response message fed back by another DHRL-C port after sending the ring detection message for the first time in a row, then when sending the ring detection message again, the node's The DHRL-C port switches to the forwarding state.

可选的,在中间设备如果检测出链路中断,则将中断链路中本节点的RSTP使能端口设置为阻塞态,并向外发送RSTP拓扑变化报文之后,还包括:Optionally, if the intermediate device detects that the link is interrupted, then the RSTP enabling port of the node in the interrupted link is set to a blocking state, and after sending the RSTP topology change message to the outside, it also includes:

处于备份态的主链路设备,通过本节点的DHRL-C端口接收到RSTP拓扑变化报文后,将本节点的DHRL-C端口切换为阻塞态,并清除本地转发表;The main link device in the backup state, after receiving the RSTP topology change message through the DHRL-C port of the local node, switches the DHRL-C port of the local node to the blocking state, and clears the local forwarding table;

如果本节点的DHRL-C端口连续第二次数未收到环检测报文,则将本节点的DHRL-C端口切换为转发态,并将对应的链路状态切换为主链态。If the DHRL-C port of the local node does not receive the ring detection message for the second consecutive time, the DHRL-C port of the local node is switched to the forwarding state, and the corresponding link state is switched to the main chain state.

可选的,在主链路设备通过本节点的DHRL-C端口接收到RSTP拓扑变化报文后,将本节点的DHRL-C端口切换为阻塞态之后,还包括:Optionally, after the main link device receives the RSTP topology change message through the DHRL-C port of this node, after switching the DHRL-C port of this node to the blocking state, it also includes:

如果主链路设备的DHRL-C端口接收到RSTP的网桥协议数据单元BPDU报文,则向中间链路中的中间设备发送P置位的BPDU报文,以利用RSTP的PA机制实现端口的转发态切换。If the DHRL-C port of the main link device receives the bridge protocol data unit BPDU message of RSTP, it will send the BPDU message with P set to the intermediate device in the intermediate link, so as to use the PA mechanism of RSTP to realize port communication. Forward state switching.

可选的,还包括:Optionally, also include:

当中断链路恢复连接时,中间设备将中断链路中本节点的RSTP使能端口设置为转发态,并向外发送RSTP拓扑变化报文;When the interrupted link resumes the connection, the intermediate device sets the RSTP enabled port of the node in the interrupted link to the forwarding state, and sends an RSTP topology change message to the outside;

主链路设备接收到RSTP拓扑变化报文后,将本节点的DHRL-C端口切换为阻塞态,并向主链路的其他设备发送清表报文,以实现链路切换。After the main link device receives the RSTP topology change message, it switches the DHRL-C port of this node to the blocking state, and sends a clear message to other devices on the main link to realize link switching.

可选的,主链路上配置有至少两个DHRL-C端口,DHRL-C端口位于主链路中的不同设备或者同一设备,DHRL-C端口的初始端口状态为阻塞态,DHRL-C端口对应的初始链路状态为主链态。Optionally, at least two DHRL-C ports are configured on the main link. The DHRL-C ports are located on different devices or the same device on the main link. The initial port status of the DHRL-C port is blocked. The DHRL-C port The corresponding initial link state is the main chain state.

第二方面,本发明实施例还提供了一种计算机设备,设备包括:In the second aspect, the embodiment of the present invention also provides a computer device, the device includes:

一个或多个处理器;one or more processors;

存储装置,用于存储一个或多个程序,storage means for storing one or more programs,

当一个或多个程序被一个或多个处理器执行,使得一个或多个处理器实现本发明任意实施例提供的双归属链路的实现方法。When one or more programs are executed by one or more processors, the one or more processors implement the method for implementing a dual-homing link provided in any embodiment of the present invention.

第三方面,本发明实施例还提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现本发明任意实施例提供的双归属链路的实现方法。In a third aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the method for implementing a dual-homing link provided in any embodiment of the present invention is implemented.

本发明实施例的技术方案,主链路设备在确定存在环路并触发端口选举后,如果从本节点的DHRL-C端口接收到另一DHRL-C端口发送的回应报文,则将本节点的DHRL-C端口设置为转发态,并向中间设备发送RSTP拓扑变化报文以实现链路切换;中间设备如果检测出链路中断,则将中断链路中本节点的RSTP使能端口设置为阻塞态,并向外发送RSTP拓扑变化报文以实现链路切换。其中,中间链路的两端连接到主链路的两个双归属连接端口DHRL-C上,中间链路中包括的中间设备与主链路中包括的主链路设备属于不同的设备厂商,中间链路中包括的中间设备开启快速生成树协议RSTP功能。中间设备只要支持并开启RSTP功能,链路上的设备采用本发明的提供的方法,就可以实现避免双归属链路出现环路。解决了现有技术中无法实现跨厂商设备间混合组网的问题,实现在不同设备厂商的设备间组成双归属链路,并利用RSTP实现双归属链路的环路避免和快速转发。According to the technical solution of the embodiment of the present invention, after the main link device determines that there is a loop and triggers port election, if it receives a response message sent by another DHRL-C port from the DHRL-C port of this node, then the node The DHRL-C port of the DHRL-C is set to the forwarding state, and sends an RSTP topology change message to the intermediate device to realize link switching; if the intermediate device detects that the link is interrupted, it will set the RSTP enabled port of the node in the interrupted link to Blocking state, and send out RSTP topology change message to achieve link switching. Wherein, both ends of the intermediate link are connected to two dual-homing connection ports DHRL-C of the main link, and the intermediate equipment included in the intermediate link and the main link equipment included in the main link belong to different equipment manufacturers. The intermediate device included in the intermediate link enables the Rapid Spanning Tree Protocol RSTP function. As long as the intermediate equipment supports and enables the RSTP function, and the equipment on the link adopts the method provided by the present invention, it is possible to avoid loops in the dual-homing link. It solves the problem in the prior art that it is impossible to realize mixed networking between devices from different manufacturers, realizes the formation of dual-homing links between devices of different device manufacturers, and uses RSTP to realize loop avoidance and fast forwarding of dual-homing links.

附图说明Description of drawings

图1是本发明实施例一中的一种双归属链路的实现方法的流程图;FIG. 1 is a flowchart of a method for implementing a dual-homing link in Embodiment 1 of the present invention;

图2a是本发明实施例二中的一种双归属链路的实现方法的流程图;FIG. 2a is a flowchart of a method for implementing a dual-homing link in Embodiment 2 of the present invention;

图2b是本发明实施例二中的一种双归属链路的示意图;FIG. 2b is a schematic diagram of a dual-homing link in Embodiment 2 of the present invention;

图3是本发明实施例三中的一种计算机设备的结构示意图。FIG. 3 is a schematic structural diagram of a computer device in Embodiment 3 of the present invention.

具体实施方式Detailed ways

下面结合附图和实施例对本发明作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释本发明,而非对本发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本发明相关的部分而非全部结构。The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, but not to limit the present invention. In addition, it should be noted that, for the convenience of description, only some structures related to the present invention are shown in the drawings but not all structures.

实施例一Embodiment one

图1是本发明实施例一中的一种双归属链路的实现方法的流程图,本实施例可适用于在不同设备厂商的设备间实现双归属链路并且环路避免的情况,该方法可以由双归属链路中的计算机设备来执行。双归属链路包括主链路和中间链路,其中,中间链路的两端连接到主链路的两个双归属连接端口DHRL-C上,中间链路中包括的中间设备与主链路中包括的主链路设备属于不同的设备厂商,中间链路中包括的中间设备开启快速生成树协议RSTP功能。如图1所示,该方法包括:Figure 1 is a flowchart of a method for implementing a dual-homing link in Embodiment 1 of the present invention. This embodiment is applicable to the situation where dual-homing links are implemented between devices of different device manufacturers and loops are avoided. The method Can be performed by a computer device in a dual-homed link. The dual-homing link includes a main link and an intermediate link, wherein the two ends of the intermediate link are connected to the two dual-homing connection ports DHRL-C of the main link, and the intermediate equipment included in the intermediate link is connected to the main link The main link devices included in the link belong to different device manufacturers, and the intermediate devices included in the intermediate link enable the Rapid Spanning Tree Protocol (RSTP) function. As shown in Figure 1, the method includes:

步骤110、主链路设备在确定存在环路并触发端口选举后,如果从本节点的DHRL-C端口接收到另一DHRL-C端口发送的回应报文,则将本节点的DHRL-C端口设置为转发态,并向中间设备发送RSTP拓扑变化报文以实现链路切换。Step 110, after the main link device determines that there is a loop and triggers port election, if it receives a response message sent by another DHRL-C port from the DHRL-C port of this node, it will send the DHRL-C port of this node Set it to the forwarding state, and send RSTP topology change packets to the intermediate device to realize link switching.

本实施例中,主链路设备是指主链路中配置有DHRL-C端口,且该DHRL-C端口与中间链路的一端连接的设备。主链路设备的设备厂商可以与中间链路中的中间设备的设备厂商不同,当然也可以与中间设备的设备厂商相同。为了实现在不同设备厂商的设备间进行混合组网,中间设备只需支持并开启RSTP协议功能,无需支持其他的功能或者满足其他要求,就可以利用RSTP协议的快速转发原理,在中间链路的两端挂载到主链路中的任意两个DHRL-C端口上之后,与主链路组成双归属链路,并根据链路拓扑变化相应地发送或接收RSTP拓扑变化报文,结合RSTP的PA机制,实现双归属链路的环路避免和快速转发。In this embodiment, the main link device refers to a device configured with a DHRL-C port on the main link, and the DHRL-C port is connected to one end of the intermediate link. The device manufacturer of the main link device may be different from the device manufacturer of the intermediate device in the intermediate link, and of course it may also be the same as the device manufacturer of the intermediate device. In order to implement mixed networking between devices from different device manufacturers, the intermediate device only needs to support and enable the RSTP protocol function, and does not need to support other functions or meet other requirements. After the two ends are mounted on any two DHRL-C ports in the main link, they form a dual-homing link with the main link, and send or receive RSTP topology change messages according to link topology changes. The PA mechanism implements loop avoidance and fast forwarding of dual-homed links.

其中,为了避免双归属链路中产生环路,可以设置挂载中间链路的两个DHRL-C端口所对应的链路状态,使得网络中只有一条链路可以用于主链路设备为中间设备提供业务服务,其余的冗余链路被阻塞作为备份链路,在当前服务链路中断时再作为主链路设备与中间设备的服务链路,保证链路的稳定性。Among them, in order to avoid loops in the dual-homing link, you can set the link status corresponding to the two DHRL-C ports that mount the intermediate link, so that only one link in the network can be used for the main link device as the intermediate The device provides business services, and the remaining redundant links are blocked as backup links. When the current service link is interrupted, it will be used as the service link between the main link device and the intermediate device to ensure the stability of the link.

其中,RSTP协议可应用于环路网络,通过一定的算法实现路径冗余,同时将环路网络修剪成无环路的树型网络,从而避免报文在环路网络中的增生和无限循环。Among them, the RSTP protocol can be applied to the loop network, through a certain algorithm to achieve path redundancy, while pruning the loop network into a tree network without loops, so as to avoid the proliferation and infinite loop of messages in the loop network.

可选的,主链路上配置有至少两个DHRL-C端口,DHRL-C端口位于主链路中的不同设备或者同一设备,DHRL-C端口的初始端口状态为阻塞态,DHRL-C端口对应的初始链路状态为主链态。Optionally, at least two DHRL-C ports are configured on the main link. The DHRL-C ports are located on different devices or the same device on the main link. The initial port status of the DHRL-C port is blocked. The DHRL-C port The corresponding initial link state is the main chain state.

本实施例中,可以预先在主链路上配置至少两个DHRL-C端口,其中,所配置的DHRL-C端口可以属于主链路中的同一个设备,也可以分别属于主链路中的不同设备。中间链路的两端可以挂接到主链路中的任意两个DHRL-C端口上,且中间链路中的设备配置可以完全相同,组网和配置简单。在初始配置DHRL-C端口时,可以将各DHRL-C端口的初始端口状态设置为阻塞态,以避免产生环路,将DHRL-C端口对应的初始链路状态设置为主链态,以使得中间链路挂接到DHRL-C端口上之后,两个DHRL-C端口可以通过自动选举,对端口状态和对应的链路状态进行相应切换,从而区分出主链态的业务服务链路和备份态的冗余链路。In this embodiment, at least two DHRL-C ports can be pre-configured on the main link, where the configured DHRL-C ports can belong to the same device in the main link, or can belong to the different devices. The two ends of the intermediate link can be connected to any two DHRL-C ports of the main link, and the configuration of the equipment in the intermediate link can be exactly the same, and the networking and configuration are simple. When initially configuring the DHRL-C port, the initial port state of each DHRL-C port can be set to blocking state to avoid loops, and the initial link state corresponding to the DHRL-C port can be set to the main chain state, so that After the intermediate link is attached to the DHRL-C port, the two DHRL-C ports can switch the port state and the corresponding link state through automatic election, so as to distinguish between the business service link and the backup in the main chain state state redundant link.

可选的,主链路设备在确定存在环路并触发端口选举后,如果从本节点的DHRL-C端口接收到另一DHRL-C端口发送的回应报文,则将本节点的DHRL-C端口设置为转发态,并向中间设备发送RSTP拓扑变化报文以实现链路切换,可以包括:Optionally, after the master link device determines that there is a loop and triggers port election, if it receives a response message sent by another DHRL-C port from the DHRL-C port of this node, it will send the DHRL-C port of this node to The port is set to the forwarding state, and sends an RSTP topology change message to the intermediate device to achieve link switching, which can include:

处于主链态的主链路设备,通过本节点的DHRL-C端口周期性地向外发送环检测报文,环检测报文通过中间设备的转发态端口转发至另一DHRL-C端口;主链路设备如果通过本节点的DHRL-C端口接收到另一DHRL-C端口发送的环检测报文,则确定存在环路触发端口选举;主链路设备如果通过本节点的DHRL-C端口接收到另一DHRL-C端口发送的回应报文,则将本节点的DHRL-C端口设置为转发态,并向主链路中的其他设备发送清表报文,同时向中间链路中的中间设备发送RSTP拓扑变化报文,以实现链路切换。The main link device in the main link state periodically sends out the ring detection message through the DHRL-C port of the node, and the ring detection message is forwarded to another DHRL-C port through the forwarding state port of the intermediate device; If the link device receives a ring detection message sent by another DHRL-C port through the DHRL-C port of this node, it determines that there is a loop and triggers port election; if the main link device receives To the response message sent by another DHRL-C port, set the DHRL-C port of this node to the forwarding state, and send a clear message to other devices in the main link, and at the same time to the intermediate link in the intermediate link The device sends RSTP topology change packets to implement link switching.

本实施例中,处于主链态的主链路设备是指,本节点的DHRL-C端口对应的链路状态为主链态的主链路设备,相对应的,处于备份态的主链路设备是指,本节点的DHRL-C端口对应的链路状态为备份态的主链路设备。为了检测是否存在环路,处于主链态的主链路设备,需要通过本节点的DHRL-C端口定期向外发送环检测报文,即probe报文。其中,probe报文的发送周期可以根据需求进行配置,可以是50ms,或者其他时间长度。Probe报文中的报文标识为固定的普通组播报文的报文标识01-15-4e-00-ff-ff,协议类型为0x89ff,源媒体访问控制(Media Access Control,MAC)地址为DHRL-C端口的MAC地址,报文的协议部分还增加了DHRL-C端口的端口号。In this embodiment, the main link device in the main chain state refers to the main link device in the main chain state corresponding to the link state of the DHRL-C port of this node, and correspondingly, the main link device in the backup state The device refers to the main link device whose link state corresponding to the DHRL-C port of the current node is the backup state. In order to detect whether there is a loop, the main link device in the main link state needs to periodically send out a loop detection message, that is, a probe message, through the DHRL-C port of the node. Wherein, the sending cycle of the probe message can be configured according to requirements, and can be 50 ms or other time lengths. The message identification in the Probe message is the message identification 01-15-4e-00-ff-ff of the fixed ordinary multicast message, and the protocol type is 0x89ff, and the source media access control (Media Access Control, MAC) address is The MAC address of the DHRL-C port, and the port number of the DHRL-C port is added to the protocol part of the message.

主链路设备向外发送probe报文后,该probe报文会直接上送到CPU,不再向主链路上的其它设备透传或转发,同时,中间链路上的中间设备不能丢弃probe报文,必须通过转发态的RSTP使能端口转发该probe报文,使得probe报文可以被转发到挂载中间链路的另一DHRL-C端口。After the main link device sends a probe message, the probe message will be directly sent to the CPU, and will not be transparently transmitted or forwarded to other devices on the main link. At the same time, the intermediate device on the intermediate link cannot discard the probe message. message, the probe message must be forwarded through the RSTP enabled port in the forwarding state, so that the probe message can be forwarded to another DHRL-C port on which the intermediate link is mounted.

当两个DHRL-C端口都处于主链态时,例如在中间链路的两端挂载到两个初始配置的DHRL-C端口上之后,两个DHRL-C端口会同时向外发送probe报文,从而发送probe报文的一端也会收到另一DHRL-C端口发送的另一probe报文。主链路设备如果通过本节点的DHRL-C端口接收到另一DHRL-C端口发送的环检测报文,则确定存在环路,两个DHRL-C端口自动进行端口选举,以根据选举结果确定向中间设备提供服务的主链路设备以及业务服务链路。选举失败的主链路设备将本节点的DHRL-C端口对应的链路状态切换为备份态,将端口状态设置为阻塞态,禁止学习报文中的MAC地址和转发报文,同时通过本节点的DHRL-C端口向另一DHRL-C端口发送回应环路完整apply报文。When both DHRL-C ports are in the main chain state, for example, after the two ends of the intermediate link are mounted on the two initially configured DHRL-C ports, the two DHRL-C ports will send out probe reports at the same time. Therefore, the end sending the probe message will also receive another probe message sent by another DHRL-C port. If the main link device receives the ring detection message sent by another DHRL-C port through the DHRL-C port of this node, it will determine that there is a loop, and the two DHRL-C ports will automatically perform port election to determine the The main link device and business service link that provide services to intermediate devices. The main link device that fails in the election switches the link state corresponding to the DHRL-C port of the node to the backup state, sets the port state to the blocking state, prohibits learning the MAC address in the message and forwarding the message, and simultaneously passes the node The corresponding DHRL-C port sends a response loop complete apply message to another DHRL-C port.

主链路设备在通过本节点的DHRL-C端口收到另一DHRL-C端口发送的apply报文时,将本节点的DHRL-C端口设置为转发态,将DHRL-C端口对应的链路状态切换为主链态,清除本地的转发表,并向主链路中的其它设备发送清表报文,以使主链路中的各个设备清除转发表,并重新学习转发表。同时,通过本节点的DHRL-C端口向中间链路中的中间设备发送RSTP拓扑变化报文,以让中间设备进行转发表的清除和重新学习,实现链路的快速切换。When the main link device receives the apply message sent by another DHRL-C port through the DHRL-C port of this node, it sets the DHRL-C port of this node to the forwarding state, and the link corresponding to the DHRL-C port The state switches to the main chain state, clears the local forwarding table, and sends a table clearing message to other devices in the main chain, so that each device in the main chain clears the forwarding table and relearns the forwarding table. At the same time, an RSTP topology change message is sent to the intermediate device in the intermediate link through the DHRL-C port of this node, so that the intermediate device can clear and re-learn the forwarding table, and realize the fast switching of the link.

其中,当主链路设备的DHRL-C端口对应的链路状态为备份态时,该主链路设备就不再周期性的向外发送环检测报文,并且在收到主链路设备通过DHRL-C端口发送的环检测报文时,还要回应环路完整apply报文。Among them, when the link state corresponding to the DHRL-C port of the main link device is in the backup state, the main link device will no longer periodically send out the ring detection message, and after receiving the main link device through the DHRL -When the ring detection message sent by the C port, it also responds with a ring complete apply message.

步骤120、中间设备如果检测出链路中断,则将中断链路中本节点的RSTP使能端口设置为阻塞态,并向外发送RSTP拓扑变化报文以实现链路切换。Step 120, if the intermediate device detects that the link is interrupted, it sets the RSTP enabled port of the node in the interrupted link to a blocked state, and sends an RSTP topology change message to realize link switching.

本实施例中,在区分出主链态的业务服务链路和备份态的冗余链路之后,如果中间设备检测到链路中断,则会将本节点中涉及中断链路的RSTP使能端口设置为阻塞态,以避免链路恢复时产生临时环路,并向相连的主链路设备或者中间设备发送RSTP拓扑变化报文,以使其他设备进行转发表的清除和重新学习,将冗余链路切换为服务链路,实现链路的快速切换。In this embodiment, after distinguishing the business service link in the main chain state and the redundant link in the backup state, if the intermediate device detects that the link is interrupted, the RSTP enabled port involved in the interrupted link in this node will be Set it to the blocking state to avoid temporary loops when the link is restored, and send RSTP topology change messages to the connected main link device or intermediate device, so that other devices can clear and re-learn the forwarding table, and the redundant The link is switched to a service link to realize fast link switching.

可选的,还可以包括:当中断链路恢复连接时,中间设备通过RSTP的PA机制,将中断链路中本节点的RSTP使能端口设置为转发态,并向外发送RSTP拓扑变化报文;主链路设备接收到RSTP拓扑变化报文后,将本节点的DHRL-C端口切换为阻塞态,清除本地转发表,并向主链路的其他设备发送清表报文;处于主链态的主链路设备,通过本节点的DHRL-C端口周期性地向外发送环检测报文,环检测报文通过中间设备的转发态端口转发至另一DHRL-C端口;主链路设备在确定存在环路并触发选举后,如果通过本节点的DHRL-C端口接收到另一DHRL-C端口发送的回应报文,则将本节点的DHRL-C端口设置为转发态,并向主链路中的其他设备发送清表报文,同时向中间链路中的中间设备发送RSTP拓扑变化报文,以实现链路切换。Optionally, it may also include: when the interrupted link restores the connection, the intermediate device sets the RSTP enabled port of the node in the interrupted link to the forwarding state through the RSTP PA mechanism, and sends an RSTP topology change message to the outside ;After the main link device receives the RSTP topology change message, it switches the DHRL-C port of this node to the blocking state, clears the local forwarding table, and sends a table clearing message to other devices on the main link; it is in the main link state The main link device of the node periodically sends out the ring detection message through the DHRL-C port of the node, and the ring detection message is forwarded to another DHRL-C port through the forwarding state port of the intermediate device; the main link device is in the After confirming that there is a loop and triggering an election, if a response message sent by another DHRL-C port is received through the DHRL-C port of the current node, the DHRL-C port of the current node is set to forwarding state and sent to the main chain Other devices on the road send clearing packets, and at the same time send RSTP topology change packets to intermediate devices in the intermediate link to implement link switching.

本实施例中,当中断链路重新连接时,为避免产生临时环路,中间设备中涉及中断链路的RSTP使能端口依然保持阻塞态,RSTP会进行协议计算,根据PA机制将中间设备的阻塞态的RSTP使能端口设置为转发态,进而中间设备会向外发送RSTP拓扑变化报文,以使其他设备清除转发表并重新学习。主链路设备接收到RSTP拓扑变化报文后,为避免产生临时环路,会将本节点的DHRL-C端口切换为阻塞态,清除本地转发表,并向主链路的其他设备发送清表报文。In this embodiment, when the interrupted link is reconnected, in order to avoid temporary loops, the RSTP enabled port involved in the interrupted link in the intermediate device remains blocked, and RSTP will perform protocol calculations, and the intermediate device's The RSTP enabled port in the blocking state is set to the forwarding state, and then the intermediate device will send an RSTP topology change message to the outside, so that other devices can clear the forwarding table and re-learn. After the main link device receives the RSTP topology change message, in order to avoid temporary loops, it will switch the DHRL-C port of this node to the blocking state, clear the local forwarding table, and send the clear list to other devices on the main link message.

处于主链态的主链路设备,会通过本节点的DHRL-C端口周期性地向外发送环检测报文,环检测报文通过中间设备的转发态端口转发至另一DHRL-C端口。如果主链路设备接收到另一DHRL-C端口发送的环检测报文,确定当前存在环路,会进行DHRL-C端口选举。如果主链路设备的DHRL-C端口选举成功,通过本节点的DHRL-C端口接收到另一DHRL-C端口发送的回应报文,则将本节点的DHRL-C端口设置为转发态,并向主链路中的其他设备发送清表报文,同时向中间链路中的中间设备发送RSTP拓扑变化报文,以实现链路切换。The main link device in the main link state will periodically send out the ring detection message through the DHRL-C port of the node, and the ring detection message will be forwarded to another DHRL-C port through the forwarding state port of the intermediate device. If the main link device receives a loop detection packet sent by another DHRL-C port and determines that there is a loop, it will perform DHRL-C port election. If the DHRL-C port election of the main link device is successful, the DHRL-C port of this node receives the response message sent by another DHRL-C port, then the DHRL-C port of this node is set to forwarding state, and Send table clear messages to other devices on the main link, and send RSTP topology change messages to intermediate devices on the intermediate link to implement link switching.

其中,PA机制为Proposal(提议)/Agreement(同意)机制,PA机制的根本目的是使一个指定端口尽快进入转发状态,无需等待30s的2倍转发延时,其过程大概是:首先上游设备想快速进入转发状态,因此,通过指定端口向下游设备发送P置位的网桥协议数据单元(Bridge Protocol Data Unit,BPDU),以询问下游设备将本节点的指定端口设置为转发态是否会产生环路。下游设备通过比较BPDU报文,如果确定本节点中接收BPDU报文的端口为根端口或者阻塞端口,则将本节点的所有下游端口(不包括边缘端口)设置为阻塞态,将根端口设置为转发态,并向上游设备返回A置位BPDU报文,以说明上游设备可以将指定端口设置为转发态,不会产生环路。上游设备接收到下游设备反馈的A置位BPDU报文后,将指定端口设置为转发态。至此,上游设备的指定端口和下游设备的根端口均已进入转发状态,免去等待30s。Among them, the PA mechanism is the Proposal (proposal)/Agreement (agreement) mechanism. The fundamental purpose of the PA mechanism is to make a designated port enter the forwarding state as soon as possible without waiting for the double forwarding delay of 30s. The process is roughly as follows: first, the upstream device wants to Quickly enter the forwarding state, therefore, send a Bridge Protocol Data Unit (Bridge Protocol Data Unit, BPDU) with P set to the downstream device through the designated port to ask the downstream device whether setting the designated port of the node to the forwarding state will cause a loop road. The downstream device compares the BPDU message, if it is determined that the port receiving the BPDU message in the node is the root port or the blocking port, then all the downstream ports of the node (excluding the edge port) are set to the blocking state, and the root port is set to forwarding state, and return the A set BPDU message to the upstream device to indicate that the upstream device can set the specified port to the forwarding state without loops. After the upstream device receives the A-set BPDU message fed back by the downstream device, it sets the designated port to the forwarding state. So far, both the designated port of the upstream device and the root port of the downstream device have entered the forwarding state, eliminating the need to wait for 30 seconds.

其中,BPDU是一种生成树协议问候数据包,是运行RSTP的交换机设备之间交换的消息帧,它以可配置的间隔发出,用来在网络的网桥间进行信息交换。BPDU内包含了RSTP所需的路径和优先级信息,RSTP便利用这些信息来确定根桥以及到根桥的路径。Among them, BPDU is a kind of spanning tree protocol hello data packet, which is a message frame exchanged between switch devices running RSTP. It is sent at configurable intervals and used for information exchange between network bridges. The BPDU contains the path and priority information required by RSTP, and RSTP uses this information to determine the root bridge and the path to the root bridge.

本发明实施例的技术方案,主链路设备在确定存在环路并触发端口选举后,如果从本节点的DHRL-C端口接收到另一DHRL-C端口发送的回应报文,则将本节点的DHRL-C端口设置为转发态,并向中间设备发送RSTP拓扑变化报文以实现链路切换;中间设备如果检测出链路中断,则将中断链路中本节点的RSTP使能端口设置为阻塞态,并向外发送RSTP拓扑变化报文以实现链路切换。其中,中间链路的两端连接到主链路的两个双归属连接端口DHRL-C上,中间链路中包括的中间设备与主链路中包括的主链路设备属于不同的设备厂商,中间链路中包括的中间设备开启快速生成树协议RSTP功能。解决了现有技术中无法实现跨厂商设备间混合组网的问题,实现在不同设备厂商的设备间组成双归属链路,并利用RSTP实现双归属链路的环路避免和快速转发。According to the technical solution of the embodiment of the present invention, after the main link device determines that there is a loop and triggers port election, if it receives a response message sent by another DHRL-C port from the DHRL-C port of this node, then the node The DHRL-C port of the DHRL-C is set to the forwarding state, and sends an RSTP topology change message to the intermediate device to realize link switching; if the intermediate device detects that the link is interrupted, it will set the RSTP enabled port of the node in the interrupted link to Blocking state, and send out RSTP topology change message to achieve link switching. Wherein, both ends of the intermediate link are connected to two dual-homing connection ports DHRL-C of the main link, and the intermediate equipment included in the intermediate link and the main link equipment included in the main link belong to different equipment manufacturers. The intermediate device included in the intermediate link enables the Rapid Spanning Tree Protocol RSTP function. It solves the problem in the prior art that it is impossible to realize mixed networking between devices from different manufacturers, realizes the formation of dual-homing links between devices of different device manufacturers, and uses RSTP to realize loop avoidance and fast forwarding of dual-homing links.

实施例二Embodiment two

图2a是本发明实施例二中的一种双归属链路的实现方法的流程图,本实施例在上述实施例的基础上进一步细化。下面结合图2a对本实施例提供的一种双归属链路的实现方法进行说明,包括以下步骤:Fig. 2a is a flow chart of a method for implementing a dual-homing link in Embodiment 2 of the present invention. This embodiment is further refined on the basis of the foregoing embodiments. A method for implementing a dual-homing link provided in this embodiment will be described below in conjunction with FIG. 2a, including the following steps:

步骤210、处于主链态的主链路设备,通过本节点的DHRL-C端口周期性地向外发送环检测报文,环检测报文通过中间设备的转发态端口转发至另一DHRL-C端口。Step 210, the main link device in the main link state periodically sends out the ring detection message through the DHRL-C port of this node, and the ring detection message is forwarded to another DHRL-C through the forwarding state port of the intermediate device port.

本实施例中,示例性的,如图2b所示,某设备厂商的设备A、B、C为主链路设备,另一设备厂商的设备D、E、F为支持RSTP功能的中间设备,即设备D、E、F的所有端口都是RSTP使能端口。主链路设备A的1端口和主链路设备C的1端口被配置为DHRL-C端口,设备A的1端口的MAC地址小于设备C的1端口的MAC地址。设置两个DHRL-C端口的初始端口状态为阻塞态,设备DHRL-C端口对应的初始链路状态为主链态。中间链路的两端分别连接到主链路A的1端口和主链路设备C的1端口,组成双归属链路。In this embodiment, for example, as shown in FIG. 2b, devices A, B, and C of a certain device manufacturer are the main link devices, and devices D, E, and F of another device manufacturer are intermediate devices that support the RSTP function. That is, all ports of devices D, E, and F are RSTP-enabled ports. Port 1 of main link device A and port 1 of main link device C are configured as DHRL-C ports, and the MAC address of port 1 of device A is smaller than that of port 1 of device C. Set the initial port state of the two DHRL-C ports to blocking state, and the initial link state corresponding to the DHRL-C port of the device to be the main chain state. Both ends of the intermediate link are respectively connected to port 1 of the main link A and port 1 of the main link device C to form a dual-homing link.

本实施例中,为了检测是否存在环路,处于主链态的主链路设备,需要通过本节点的DHRL-C端口定期向外发送probe报文。示例性的,以图2b中的主链路设备A为例,A通过1端口定期向外发送probe报文时,该probe报文直接上送到CPU,不会向主链路设备B、C透传或转发。由于此时D、E、F的RSTP使能端口皆处于转发态,因此,设备D接收到该probe报文后,会通过转发态的RSTP使能端口将probe报文转发给E,E将该probe报文转发给F,F将probe报文转发到C的1端口。如果C的1端口也定期发送probe报文,则该报文同样经过F、E、D转发到A的1端口。In this embodiment, in order to detect whether there is a loop, the main link device in the main link state needs to periodically send probe messages to the outside through the DHRL-C port of the node. Exemplarily, take the main link device A in Figure 2b as an example. When A regularly sends out probe messages through port 1, the probe messages are directly sent to the CPU and will not be sent to the main link devices B and C. Pass through or forward. Since the RSTP-enabled ports of D, E, and F are all in the forwarding state at this time, after receiving the probe message, device D will forward the probe message to E through the RSTP-enabled port in the forwarding state, and E will send the probe message to E. The probe packet is forwarded to F, and F forwards the probe packet to port 1 of C. If port 1 of C also periodically sends probe packets, the packets are also forwarded to port 1 of A through F, E, and D.

步骤220、主链路设备如果通过本节点的DHRL-C端口接收到另一DHRL-C端口发送的环检测报文,则确定存在环路触发端口选举。Step 220, if the main link device receives a loop detection message sent by another DHRL-C port through the DHRL-C port of the local node, it determines that there is a loop and triggers port election.

示例性的,如图2b所示,主链路设备A的1端口在发送probe报文之后,如果接收到设备C的1端口发送的probe报文,则确定存在环路,A的1端口和C的1端口自动选举。Exemplarily, as shown in FIG. 2b, after sending a probe message to port 1 of the main link device A, if it receives the probe message sent by port 1 of device C, it is determined that there is a loop, and port 1 of A and Port 1 of C is automatically elected.

可选的,端口选举过程可以包括:在第一设备通过第一DHRL-C端口接收第二设备通过第二DHRL-C端口发送的环检测报文之后,将第一DHRL-C端口的MAC地址与环检测报文中的源MAC地址进行比较;如果源MAC地址与第一DHRL-C端口的MAC地址不同,则将小的MAC地址对应的设备作为目标设备;如果源MAC地址与第一DHRL-C端口的MAC地址相同,则将环检测报文中的端口号与第一DHRL-C端口的端口号进行比较,并在两者不同时,将小的端口号对应的设备作为目标设备;目标设备将本节点的DHRL-C端口切换为转发态,将对应的链路状态切换为主链态,同时通过本节点的DHRL-C端口接收对端发送的回应报文。Optionally, the port election process may include: after the first device receives the ring detection message sent by the second device through the second DHRL-C port through the first DHRL-C port, the MAC address of the first DHRL-C port Compare with the source MAC address in the ring detection message; if the source MAC address is different from the MAC address of the first DHRL-C port, then use the device corresponding to the smaller MAC address as the target device; if the source MAC address is different from the first DHRL-C port -The MAC address of the C port is the same, then the port number in the ring detection message is compared with the port number of the first DHRL-C port, and when the two are different, the device corresponding to the small port number is used as the target device; The target device switches the DHRL-C port of the local node to the forwarding state, switches the corresponding link state to the main chain state, and at the same time receives the response message sent by the peer end through the DHRL-C port of the local node.

本实施例中,可以以端口的MAC地址为第一优先级,以端口号为第二优先级,进行端口选举。也就是说,在两个DHRL-C端口的MAC地址大小不同时,即两个DHRL-C端口属于不同的设备时,MAC地址小的端口选举胜出;当两个DHRL-C端口的MAC地址相同时,即两个DHRL-C端口属于同一个设备时,端口号小的选举胜出。In this embodiment, port election may be performed with the MAC address of the port as the first priority and the port number as the second priority. That is to say, when the MAC addresses of two DHRL-C ports are of different sizes, that is, when the two DHRL-C ports belong to different devices, the port with the smaller MAC address wins the election; when the MAC addresses of the two DHRL-C ports are At the same time, that is, when two DHRL-C ports belong to the same device, the election with the smaller port number wins.

示例性的,如图2b所示,由于设备A的1端口的MAC地址小于设备C的1端口的MAC地址,因此,设备A的1端口选举胜出,设备C的1端口选举失败。设备C的1端口会切换为阻塞态,对应的链路状态切换为备份态,禁止学习报文中的MAC地址和转发报文,同时向设备A的1端口回应环路完整apply报文。Exemplarily, as shown in FIG. 2b, since the MAC address of port 1 of device A is smaller than the MAC address of port 1 of device C, port 1 of device A wins election, and port 1 of device C fails. Port 1 of device C will switch to blocking state, and the corresponding link state will switch to backup state, prohibiting learning the MAC address in the message and forwarding the message, and responding to port 1 of device A with a loop complete apply message.

步骤230、主链路设备如果通过本节点的DHRL-C端口接收到另一DHRL-C端口发送的回应报文,则将本节点的DHRL-C端口设置为转发态,并向主链路中的其他设备发送清表报文,同时向中间链路中的中间设备发送RSTP拓扑变化报文,以实现链路切换。Step 230, if the main link device receives the response message sent by another DHRL-C port through the DHRL-C port of this node, then the DHRL-C port of this node is set to forwarding state, and sends to the main link Other devices in the network send table clearing packets, and at the same time send RSTP topology change packets to intermediate devices in the intermediate link to implement link switching.

示例性的,如图2b所示,设备A的1端口在接收到设备C的1端口发送的apply报文后,将端口状态切换为转发态,并将对应的链路状态切换为主链态,清除本地转发表,并在主链路中广播清表报文,设备B、C收到广播清表后会清除转发表。设备A同时会发送RSTP拓扑变化报文给中间链路的设备D,设备D收到后会清除本地转发表并继续向设备E转发RSTP拓扑变化报文,设备E清除转发表,同时继续向设备F转发RSTP拓扑变化报文,设备F也会清除转发表。各设备清除转发表后,重新学习MAC地址建立新的转发表,完成链路切换。Exemplarily, as shown in Figure 2b, after receiving the apply message sent by port 1 of device C, port 1 of device A switches the port state to the forwarding state, and switches the corresponding link state to the main chain state , clear the local forwarding table, and broadcast the clearing message on the main link, and devices B and C will clear the forwarding table after receiving the broadcast clearing table. Device A will also send an RSTP topology change message to device D on the intermediate link. After receiving it, device D will clear the local forwarding table and continue to forward the RSTP topology change message to device E. Device E will clear the forwarding table and continue to forward the message to device E. F forwards the RSTP topology change packet, and device F also clears the forwarding table. After each device clears the forwarding table, it relearns the MAC address to establish a new forwarding table to complete the link switchover.

步骤240、中间设备如果检测出链路中断,则将中断链路中本节点的RSTP使能端口设置为阻塞态,并向外发送RSTP拓扑变化报文。Step 240, if the intermediate device detects that the link is interrupted, it sets the RSTP enabled port of the node in the interrupted link to a blocking state, and sends an RSTP topology change message to the outside.

本实施例中,当双归属链路中的一条链路断开时,中间设备检测到链路中断,会将本节点中涉及中断链路的RSTP使能端口设置为阻塞态,以避免链路恢复时产生临时环路,并向相连的主链路设备或者中间设备发送RSTP拓扑变化报文,以使其他设备进行转发表的清除和重新学习,将冗余链路切换为服务链路,实现链路的快速切换。In this embodiment, when a link in the dual-homing link is disconnected, the intermediate device detects that the link is interrupted, and will set the RSTP-enabled port involved in the interrupted link in the node to the blocking state, so as to avoid link failure. A temporary loop is generated during recovery, and an RSTP topology change message is sent to the connected main link device or intermediate device, so that other devices can clear and relearn the forwarding table, and switch the redundant link to a service link to realize Fast switching of links.

可选的,在中间设备如果检测出链路中断,则将中断链路中本节点的RSTP使能端口设置为阻塞态,并向外发送RSTP拓扑变化报文之后,还可以包括:处于主链态的主链路设备,通过本节点的DHRL-C端口接收到RSTP拓扑变化报文后,将本节点的DHRL-C端口切换为阻塞态,并清除本地转发表,同时向主链路的其他设备发送清表报文;如果本节点的DHRL-C端口在连续第一次数发送环检测报文后,都没有收到另一DHRL-C端口反馈的回应报文,则当再次发送环检测报文时将本节点的DHRL-C端口切换为转发态。Optionally, if the intermediate device detects that the link is interrupted, it will set the RSTP enabled port of the node in the interrupted link to the blocking state, and after sending the RSTP topology change message to the outside, it may also include: After receiving the RSTP topology change message through the DHRL-C port of the local node, the main link device of the local node switches the DHRL-C port of the local node to the blocking state, clears the local forwarding The device sends a clear message; if the DHRL-C port of this node does not receive a response message fed back by another DHRL-C port after sending the ring detection message for the first time in a row, it will send the ring detection message again. When sending a message, switch the DHRL-C port of this node to the forwarding state.

本实施例中,处于主链态的主链路设备,如果接收到中间设备发送的RSTP拓扑变化报文,则确定链路拓扑发生变化,为了避免出现环路,会将本节点的DHRL-C端口切换为阻塞态,并清除本地的转发表,同时向主链路的其他设备发送清表报文,使得其他设备也清除转发表,为链路切换做准备。在此期间,主链态的主链路设备还是需要定期向外发送probe报文,确保主链路能正常服务中间链路,以及没有出现临时环路,如果连续第一次数发送probe报文,都没有收到对端的DHRL-C端口反馈的apply报文,则当再次发送probe报文时,会将本节点的DHRL-C端口切换为转发态,以进行链路切换。其中,第一次数可以是2次,3次,或者其他预设的次数。In this embodiment, if the main link device in the main link state receives the RSTP topology change message sent by the intermediate device, it is determined that the link topology has changed. In order to avoid loops, the DHRL-C The port is switched to the blocking state, and the local forwarding table is cleared, and at the same time, a table clearing message is sent to other devices on the main link, so that other devices also clear the forwarding table to prepare for the link switchover. During this period, the main link device in the main link state still needs to send probe messages regularly to ensure that the main link can normally serve the intermediate link and there is no temporary loop. If the probe message is sent for the first time in a row , have not received the apply message fed back by the DHRL-C port of the opposite end, then when the probe message is sent again, the DHRL-C port of the local node will be switched to the forwarding state to perform link switching. Wherein, the first number can be 2 times, 3 times, or other preset times.

可选的,在中间设备如果检测出链路中断,则将中断链路中本节点的RSTP使能端口设置为阻塞态,并向外发送RSTP拓扑变化报文之后,还可以包括:处于备份态的主链路设备,通过本节点的DHRL-C端口接收到RSTP拓扑变化报文后,将本节点的DHRL-C端口切换为阻塞态,并清除本地转发表;如果本节点的DHRL-C端口连续第二次数未收到环检测报文,则将本节点的DHRL-C端口切换为转发态,并将对应的链路状态切换为主链态。Optionally, if the intermediate device detects that the link is interrupted, the RSTP enabling port of the node in the interrupted link is set to the blocking state, and after sending the RSTP topology change message outward, it may also include: in the backup state After receiving the RSTP topology change message through the DHRL-C port of the local node, the main link device of the local node switches the DHRL-C port of the local node to the blocking state and clears the local forwarding table; if the DHRL-C port of the local node If the ring detection message is not received for the second consecutive time, the DHRL-C port of this node is switched to the forwarding state, and the corresponding link state is switched to the main chain state.

本实施例中,处于备份态的主链路设备,如果接收到中间设备发送的RSTP拓扑变化报文,则确定链路拓扑发生变化,为了避免出现环路,会将本节点的DHRL-C端口切换为阻塞态,并清除本地的转发表,为链路切换做准备。在此期间,该设备还是需要定期接收处于主链态的主链路设备发送的probe报文,以确保主链路能正常服务中间链路以及没有出现临时环路,如果连续第二次数未收到主链路发送的环路probe报文,备份态的主链路设备会将本节点的DHRL-C端口切换为转发态,并将对应的链路状态切换为主链态,同时开始定期发送probe报文,并且向其他设备发送RSTP拓扑变化报文,以让其它设备进行转发表的清除和重新学习,实现链路的快速切换。其中,第二次数等于第一次数加一。In this embodiment, if the main link device in the backup state receives the RSTP topology change message sent by the intermediate device, it will determine that the link topology has changed. In order to avoid loops, the DHRL-C port of this node will Switch to the blocking state and clear the local forwarding table to prepare for link switching. During this period, the device still needs to regularly receive the probe message sent by the main link device in the main link state to ensure that the main link can normally serve the intermediate link and there is no temporary loop. To the loop probe message sent by the main link, the main link device in the backup state will switch the DHRL-C port of the node to the forwarding state, and switch the corresponding link state to the main chain state, and start sending periodically probe packets, and send RSTP topology change packets to other devices, so that other devices can clear and re-learn the forwarding table, and realize fast link switching. Wherein, the second number is equal to the first number plus one.

示例性的,如图2b所示,在设备D、E间的链路中断时,设备D、E间的RSTP使能端口会被阻塞掉,设备D、E会向外发送RSTP拓扑变化报文。当设备A收到设备D发送的RSTP拓扑变化报文后,会阻塞本节点的1端口,清除本地转发表,同时在主链路上发送广播清表报文。设备A在收到设备D的发送的RSTP拓扑变化报文阻塞本节点的1端口后,如果连续两次发送probe报文没有收到设备C返回的回应报文,则在发送第三次probe报文时,将本节点的1端口设置为转发态,以进行链路切换。当设备F收到设备E的RSTP拓扑变化报文后会清除转发表,同时向设备C转发RSTP拓扑变化报文,设备C收到后只能清除本地转发表。由于D、E之间链路中断,设备C会收不到设备A发送的probe报文,当设备C连续三次未收到probe报文后,设备C的1端口会切换到转发态,并将对应的链路状态切换为主链态,以实现链路切换,保证主链路能为中间链路提供服务。Exemplarily, as shown in Figure 2b, when the link between devices D and E is interrupted, the RSTP-enabled port between devices D and E will be blocked, and devices D and E will send RSTP topology change messages to the outside . When device A receives the RSTP topology change message sent by device D, it will block port 1 of the local node, clear the local forwarding table, and send a broadcast clear message on the main link at the same time. After device A receives the RSTP topology change message sent by device D to block port 1 of the node, if it sends probe messages twice in a row but does not receive the response message returned by device C, it sends the probe message for the third time. When sending files, set port 1 of this node to the forwarding state for link switching. When device F receives the RSTP topology change packet from device E, it clears the forwarding table and forwards the RSTP topology change packet to device C. After receiving the RSTP topology change packet, device C can only clear the local forwarding table. Due to the interruption of the link between D and E, device C will not receive the probe message sent by device A. When device C fails to receive the probe message for three consecutive times, port 1 of device C will switch to the forwarding state and send The corresponding link state is switched to the main chain state to realize link switching and ensure that the main link can provide services for the intermediate link.

可选的,在主链路设备通过本节点的DHRL-C端口接收到RSTP拓扑变化报文后,将本节点的DHRL-C端口切换为阻塞态之后,还可以包括:如果主链路设备的DHRL-C端口接收到RSTP的BPDU报文,则向中间链路中的中间设备发送P置位的BPDU报文,以利用RSTP的PA机制实现端口的转发态切换。Optionally, after the main link device receives the RSTP topology change message through the DHRL-C port of this node, after switching the DHRL-C port of this node to the blocking state, it may also include: if the main link device When the DHRL-C port receives the RSTP BPDU message, it sends the BPDU message with P set to the intermediate device in the intermediate link, so as to realize the forwarding state switching of the port by using the PA mechanism of RSTP.

本实施例中,当主链路设备根据中间设备发送的RSTP拓扑变化报文将端口设置为阻塞态之后,如果主链路设备的DHRL-C端口收到RSTP的BPDU报文,不会向主链路的其它设备转发此报文,而是通过DHRL-C端口向中间链路内回应一个proposal的BPDU报文,表示主链路没有环路,询问中间设备此时将本节点的DHRL-C端口设置为转发态是否会产生环路。从而在可以切换为转发态的情况下,无需等待30s的2倍转发延时,就可以使DHRL-C端口进入转发状态,实现双归属网络内的快速转发。In this embodiment, after the main link device sets the port to the blocking state according to the RSTP topology change message sent by the intermediate device, if the DHRL-C port of the main link device receives the BPDU message of RSTP, it will not report to the main link The other devices on the road forward this message, but respond to a proposal BPDU message to the intermediate link through the DHRL-C port, indicating that there is no loop in the main link, and ask the intermediate device to send the DHRL-C port of this node to the intermediate link at this time. Whether it will cause a loop if it is set to the forwarding state. Therefore, when switching to the forwarding state, the DHRL-C port can enter the forwarding state without waiting for the double forwarding delay of 30s to realize fast forwarding in the dual-homing network.

步骤250、当中断链路恢复连接时,中间设备通过RSTP的PA机制,将中断链路中本节点的RSTP使能端口设置为转发态,并向外发送RSTP拓扑变化报文以实现链路切换。Step 250, when the interrupted link resumes the connection, the intermediate device sets the RSTP enabled port of the node in the interrupted link to the forwarding state through the RSTP PA mechanism, and sends an RSTP topology change message to realize link switching .

本实施例中,当中断链路恢复连接时,中间设备通过RSTP的PA机制,将中断链路中本节点的RSTP使能端口设置为转发态,并向外发送RSTP拓扑变化报文,主链路设备接收到RSTP拓扑变化报文后,将本节点的DHRL-C端口切换为阻塞态,清除本地转发表,并向主链路的其他设备发送清表报文;处于主链态的主链路设备,通过本节点的DHRL-C端口周期性地向外发送环检测报文,环检测报文通过中间设备的转发态端口转发至另一DHRL-C端口;主链路设备在确定存在环路并触发端口选举后,如果通过本节点的DHRL-C端口接收到另一DHRL-C端口发送的回应报文,则将本节点的DHRL-C端口设置为转发态,并向主链路中的其他设备发送清表报文,同时向中间链路中的中间设备发送RSTP拓扑变化报文,以实现链路切换。In this embodiment, when the interrupted link resumes the connection, the intermediate device sets the RSTP enabled port of the node in the interrupted link to the forwarding state through the RSTP PA mechanism, and sends an RSTP topology change message to the outside, and the main chain After receiving the RSTP topology change message, the device on the main link switches the DHRL-C port of this node to the blocking state, clears the local forwarding table, and sends a table clearing message to other devices on the main link; the main link in the main link state The link device periodically sends a ring detection message through the DHRL-C port of the node, and the ring detection message is forwarded to another DHRL-C port through the forwarding state port of the intermediate device; the main link device determines that there is a ring After the port election is triggered, if a response message sent by another DHRL-C port is received through the DHRL-C port of this node, the DHRL-C port of this node is set to the forwarding state and sent to the main link Other devices in the network send table clearing packets, and at the same time send RSTP topology change packets to intermediate devices in the intermediate link to implement link switching.

示例性的,以图2b所示,当设备D、E间的链路重新连接时,为了有效避免临时环路的产生,设备D、E间的RSTP使能端口仍然保持阻塞态,RSTP会进行协议计算,设备A和C在收到RSTPhello报文时,会回复proposal报文,让与A的1端口和C的1端口互连的端口,通过PA协商快速进入转发状态。当中间设备的端口切换为转发态时,会向外发送拓扑变化报文,A和C收到拓扑变化报文时,会先将本节点的DHRL-C端口设置为阻塞态,清除转发表,同时在主链路上发送清表报文。待D、E、F之间链路都变成转发态时,A和C之间才能相互收到probe报文并进行选举。选举之后,C由于选举失败,DHRL-C端口被设置为阻塞态,对应的链路状态被设置为备份态,还需要向A的1端口发送apply报文。A收到apply报文后向主链路发送清表报文,并将本节点的DHRL-C端口设置为转发态。Exemplarily, as shown in Figure 2b, when the link between devices D and E is reconnected, in order to effectively avoid temporary loops, the RSTP enabled port between devices D and E remains blocked, and RSTP will perform Protocol calculation, when devices A and C receive the RSTPhello message, they will reply with a proposal message, so that the port interconnected with port 1 of A and port 1 of C will quickly enter the forwarding state through PA negotiation. When the port of the intermediate device is switched to the forwarding state, it will send out a topology change message. When A and C receive the topology change message, they will first set the DHRL-C port of the node to the blocking state, and clear the forwarding table. At the same time, the table clearing message is sent on the main link. When the links between D, E, and F are all in the forwarding state, A and C can receive probe messages from each other and conduct elections. After the election, C fails the election, the DHRL-C port is set to the blocking state, the corresponding link state is set to the backup state, and it is necessary to send an apply message to port 1 of A. After receiving the apply message, A sends a clear message to the main link, and sets the DHRL-C port of this node to the forwarding state.

本实施例中,为了防止临时环路,主链路设备的DHRL-C端口在链路中断时会设置为阻状态,在链路刚连接时仍然保持阻塞态,在收到拓扑变化报文时也先将端口置为阻塞态,在收到环路完整apply报文时立刻设置为转发态,或者超过3次未接收到probe报文时变成转发态。In this embodiment, in order to prevent temporary loops, the DHRL-C port of the main link device will be set to the blocking state when the link is interrupted, and it will still maintain the blocking state when the link is just connected. Also first set the port to the blocking state, and immediately set it to the forwarding state when it receives a complete apply message from the loop, or change to the forwarding state when it does not receive the probe message for more than 3 times.

本发明实施例的技术方案,主链路设备在确定存在环路并触发端口选举后,如果从本节点的DHRL-C端口接收到另一DHRL-C端口发送的回应报文,则将本节点的DHRL-C端口设置为转发态,并向中间设备发送RSTP拓扑变化报文以实现链路切换;中间设备如果检测出链路中断,则将中断链路中本节点的RSTP使能端口设置为阻塞态,并向外发送RSTP拓扑变化报文以实现链路切换。其中,中间链路的两端连接到主链路的两个双归属连接端口DHRL-C上,中间链路中包括的中间设备与主链路中包括的主链路设备属于不同的设备厂商,中间链路中包括的中间设备开启快速生成树协议RSTP功能。解决了现有技术中无法实现跨厂商设备间混合组网的问题,实现在不同设备厂商的设备间组成双归属链路,并利用RSTP实现双归属链路的环路避免和快速转发。According to the technical solution of the embodiment of the present invention, after the main link device determines that there is a loop and triggers port election, if it receives a response message sent by another DHRL-C port from the DHRL-C port of this node, then the node The DHRL-C port of the DHRL-C is set to the forwarding state, and sends an RSTP topology change message to the intermediate device to realize link switching; if the intermediate device detects that the link is interrupted, it will set the RSTP enabled port of the node in the interrupted link to Blocking state, and send out RSTP topology change message to achieve link switching. Wherein, both ends of the intermediate link are connected to two dual-homing connection ports DHRL-C of the main link, and the intermediate equipment included in the intermediate link and the main link equipment included in the main link belong to different equipment manufacturers. The intermediate device included in the intermediate link enables the Rapid Spanning Tree Protocol RSTP function. It solves the problem in the prior art that it is impossible to realize mixed networking between devices from different manufacturers, realizes the formation of dual-homing links between devices of different device manufacturers, and uses RSTP to realize loop avoidance and fast forwarding of dual-homing links.

实施例三Embodiment Three

图3是本发明实施例三公开的一种计算机设备的结构示意图。图3示出了适于用来实现本发明实施方式的示例性设备12的框图。图3显示的设备12仅仅是一个示例,不应对本发明实施例的功能和使用范围带来任何限制。FIG. 3 is a schematic structural diagram of a computer device disclosed in Embodiment 3 of the present invention. Figure 3 shows a block diagram of an exemplary device 12 suitable for use in implementing embodiments of the present invention. The device 12 shown in FIG. 3 is only an example, and should not limit the functions and scope of use of this embodiment of the present invention.

如图3所示,设备12以通用计算设备的形式表现。设备12的组件可以包括但不限于:一个或者多个处理器或者处理单元16,系统存储器28,连接不同系统组件(包括系统存储器28和处理单元16)的总线18。As shown in FIG. 3, device 12 takes the form of a general-purpose computing device. Components of device 12 may include, but are not limited to: one or more processors or processing units 16, system memory 28, bus 18 connecting various system components including system memory 28 and processing unit 16.

总线18表示几类总线结构中的一种或多种,包括存储器总线或者存储器控制器,外围总线,图形加速端口,处理器或者使用多种总线结构中的任意总线结构的局域总线。举例来说,这些体系结构包括但不限于工业标准体系结构(ISA)总线,微通道体系结构(MAC)总线,增强型ISA总线、视频电子标准协会(VESA)局域总线以及外围组件互连(PCI)总线。Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus structures. These architectures include, by way of example, but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect ( PCI) bus.

设备12典型地包括多种计算机系统可读介质。这些介质可以是任何能够被设备12访问的可用介质,包括易失性和非易失性介质,可移动的和不可移动的介质。Device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by device 12 and include both volatile and nonvolatile media, removable and non-removable media.

系统存储器28可以包括易失性存储器形式的计算机系统可读介质,例如随机存取存储器(RAM)30和/或高速缓存存储器。设备12可以进一步包括其它可移动/不可移动的、易失性/非易失性计算机系统存储介质。仅作为举例,存储系统34可以用于读写不可移动的、非易失性磁介质(图3未显示,通常称为“硬盘驱动器”)。尽管图3中未示出,可以提供用于对可移动非易失性磁盘(例如“软盘”)读写的磁盘驱动器,以及对可移动非易失性光盘(例如CD-ROM,DVD-ROM或者其它光介质)读写的光盘驱动器。在这些情况下,每个驱动器可以通过一个或者多个数据介质接口与总线18相连。存储器28可以包括至少一个程序产品,该程序产品具有一组(例如至少一个)程序模块,这些程序模块被配置以执行本发明各实施例的功能。System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and/or cache memory. Device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read and write to non-removable, non-volatile magnetic media (not shown in FIG. 3, commonly referred to as a "hard drive"). Although not shown in Figure 3, a disk drive for reading and writing to removable non-volatile disks (e.g. "floppy disks") may be provided, as well as for removable non-volatile optical disks (e.g. CD-ROM, DVD-ROM or other optical media) CD-ROM drive. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. Memory 28 may include at least one program product having a set (eg, at least one) of program modules configured to perform the functions of various embodiments of the present invention.

具有一组(至少一个)程序模块42的程序/实用工具40,可以存储在例如存储器28中,这样的程序模块42包括但不限于操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。程序模块42通常执行本发明所描述的实施例中的功能和/或方法。A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including but not limited to an operating system, one or more application programs, other program modules, and program data , each or some combination of these examples may include implementations of network environments. Program modules 42 generally perform the functions and/or methodologies of the described embodiments of the invention.

设备12也可以与一个或多个外部设备14(例如键盘、指向设备、显示器24等)通信,还可与一个或者多个使得用户能与该设备12交互的设备通信,和/或与使得该设备12能与一个或多个其它计算设备进行通信的任何设备(例如网卡,调制解调器等等)通信。这种通信可以通过输入/输出(I/O)接口22进行。并且,设备12还可以通过网络适配器20与一个或者多个网络(例如局域网(LAN),广域网(WAN)和/或公共网络,例如因特网)通信。如图所示,网络适配器20通过总线18与设备12的其它模块通信。应当明白,尽管图中未示出,可以结合设备12使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、RAID系统、磁带驱动器以及数据备份存储系统等。Device 12 may also communicate with one or more external devices 14 (e.g., a keyboard, pointing device, display 24, etc.), and with one or more devices that enable a user to interact with Device 12 is capable of communicating with any device (eg, network card, modem, etc.) that communicates with one or more other computing devices. Such communication may occur through input/output (I/O) interface 22 . Also, device 12 may communicate with one or more networks (eg, local area network (LAN), wide area network (WAN), and/or public networks, such as the Internet) via network adapter 20 . As shown, network adapter 20 communicates with other modules of device 12 via bus 18 . It should be appreciated that although not shown, other hardware and/or software modules may be used in conjunction with device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and Data backup storage system, etc.

处理单元16通过运行存储在系统存储器28中的程序,从而执行各种功能应用以及数据处理,例如实现本发明实施例所提供的双归属链路的实现方法,双归属链路包括主链路和中间链路,中间链路的两端连接到主链路的两个双归属连接端口DHRL-C上,中间链路中包括的中间设备与主链路中包括的主链路设备属于不同的设备厂商,中间链路中包括的中间设备开启快速生成树协议RSTP功能,方法包括:The processing unit 16 executes various functional applications and data processing by running the programs stored in the system memory 28, such as realizing the implementation method of the dual-homing link provided by the embodiment of the present invention, the dual-homing link includes the main link and the The intermediate link, the two ends of the intermediate link are connected to the two dual-homing connection ports DHRL-C of the main link, and the intermediate devices included in the intermediate link and the main link devices included in the main link belong to different devices Manufacturers, the intermediate devices included in the intermediate link enable the Rapid Spanning Tree Protocol RSTP function, and the methods include:

主链路设备在确定存在环路并触发端口选举后,如果从本节点的DHRL-C端口接收到另一DHRL-C端口发送的回应报文,则将本节点的DHRL-C端口设置为转发态,并向中间设备发送RSTP拓扑变化报文以实现链路切换;After the main link device determines that there is a loop and triggers port election, if it receives a response message sent by another DHRL-C port from the DHRL-C port of this node, it will set the DHRL-C port of this node to forward State, and send RSTP topology change message to the intermediate device to achieve link switching;

中间设备如果检测出链路中断,则将中断链路中本节点的RSTP使能端口设置为阻塞态,并向外发送RSTP拓扑变化报文以实现链路切换。If the intermediate device detects that the link is interrupted, it sets the RSTP enabled port of the node in the interrupted link to a blocking state, and sends an RSTP topology change message to realize link switching.

实施例四Embodiment four

本发明实施例四还公开了一种计算机存储介质,其上存储有计算机程序,该程序被处理器执行时实现一种双归属链路的实现方法,双归属链路包括主链路和中间链路,中间链路的两端连接到主链路的两个双归属连接端口DHRL-C上,中间链路中包括的中间设备与主链路中包括的主链路设备属于不同的设备厂商,中间链路中包括的中间设备开启快速生成树协议RSTP功能,方法包括:Embodiment 4 of the present invention also discloses a computer storage medium on which a computer program is stored. When the program is executed by a processor, a method for realizing a dual-homing link is realized. The dual-homing link includes a main link and an intermediate link. The two ends of the intermediate link are connected to the two dual-homing connection ports DHRL-C of the main link. The intermediate equipment included in the intermediate link and the main link equipment included in the main link belong to different equipment manufacturers. The intermediate device included in the intermediate link enables the Rapid Spanning Tree Protocol RSTP function, and the methods include:

主链路设备在确定存在环路并触发端口选举后,如果从本节点的DHRL-C端口接收到另一DHRL-C端口发送的回应报文,则将本节点的DHRL-C端口设置为转发态,并向中间设备发送RSTP拓扑变化报文以实现链路切换;After the main link device determines that there is a loop and triggers port election, if it receives a response message sent by another DHRL-C port from the DHRL-C port of this node, it will set the DHRL-C port of this node to forward State, and send RSTP topology change message to the intermediate device to achieve link switching;

中间设备如果检测出链路中断,则将中断链路中本节点的RSTP使能端口设置为阻塞态,并向外发送RSTP拓扑变化报文以实现链路切换。If the intermediate device detects that the link is interrupted, it sets the RSTP enabled port of the node in the interrupted link to a blocking state, and sends an RSTP topology change message to realize link switching.

本发明实施例的计算机存储介质,可以采用一个或多个计算机可读的介质的任意组合。计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质。计算机可读存储介质例如可以是,但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本文件中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。The computer storage medium in the embodiments of the present invention may use any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination thereof. More specific examples (non-exhaustive list) of computer readable storage media include: electrical connections with one or more leads, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), Erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。A computer readable signal medium may include a data signal carrying computer readable program code in baseband or as part of a carrier wave. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. .

计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于无线、电线、光缆、RF等等,或者上述的任意合适的组合。Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

可以以一种或多种程序设计语言或其组合来编写用于执行本发明操作的计算机程序代码,程序设计语言包括面向对象的程序设计语言,诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言,诸如”C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络,包括局域网(LAN)或广域网(WAN),连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for performing the operations of the present invention may be written in one or more programming languages or combinations thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages. A programming language, such as "C" or a similar programming language. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In cases involving a remote computer, the remote computer can be connected to the user computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (such as through the Internet using an Internet service provider). connect).

注意,上述仅为本发明的较佳实施例及所运用技术原理。本领域技术人员会理解,本发明不限于这里所述的特定实施例,对本领域技术人员来说能够进行各种明显的变化、重新调整和替代而不会脱离本发明的保护范围。因此,虽然通过以上实施例对本发明进行了较为详细的说明,但是本发明不仅仅限于以上实施例,在不脱离本发明构思的情况下,还可以包括更多其他等效实施例,而本发明的范围由所附的权利要求范围决定。Note that the above are only preferred embodiments of the present invention and applied technical principles. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and can also include more other equivalent embodiments without departing from the concept of the present invention, and the present invention The scope is determined by the scope of the appended claims.

Claims (9)

1. A method for implementing a dual-homing link, the dual-homing link comprising a main link and an intermediate link, wherein two ends of the intermediate link are connected to two dual-homing connection ports DHRL-C of the main link, an intermediate device included in the intermediate link and a main link device included in the main link belong to different device vendors, the intermediate device included in the intermediate link starts a Rapid Spanning Tree Protocol (RSTP) function, the method comprising:
after determining that a loop exists and triggering port election, if a response message sent by another DHRL-C port is received from the DHRL-C port of the node, the main link equipment sets the DHRL-C port of the node to be a forwarding state and sends an RSTP topology change message to the intermediate equipment to realize link switching;
if the intermediate device detects the link interruption, the intermediate device sets an RSTP enabled port of the node in the interrupted link to be in a blocking state, and sends an RSTP topology change message outwards to realize link switching;
after determining that a loop exists and triggering port election, if a response message sent by another DHRL-C port is received from the DHRL-C port of the node, the main link equipment sets the DHRL-C port of the node to be a forwarding state and sends an RSTP topology change message to intermediate equipment to realize link switching, and the method comprises the following steps:
the method comprises the steps that a main link device in a main chain state periodically sends a ring detection message outwards through a DHRL-C port of a node, and the ring detection message is forwarded to another DHRL-C port through a forwarding state port of intermediate equipment;
if the main link equipment receives a ring detection message sent by another DHRL-C port through the DHRL-C port of the node, determining that a loop triggering port election exists;
if the main link equipment receives a response message sent by another DHRL-C port through the DHRL-C port of the node, the DHRL-C port of the node is set to be in a forwarding state, a table clearing message is sent to other equipment in the main link, and an RSTP topology change message is sent to intermediate equipment in the intermediate link, so that link switching is realized.
2. The method of claim 1, wherein the port election process comprises:
after the first device receives a ring detection message sent by the second device through the second DHRL-C port through the first DHRL-C port, comparing the MAC address of the first DHRL-C port with a source MAC address in the ring detection message;
if the source MAC address is different from the MAC address of the first DHRL-C port, the device corresponding to the small MAC address is taken as the target device;
if the source MAC address is the same as the MAC address of the first DHRL-C port, comparing the port number in the ring detection message with the port number of the first DHRL-C port, and taking the device corresponding to the small port number as the target device when the port number in the ring detection message is different from the port number in the first DHRL-C port;
the target device switches the DHRL-C port of the node into a forwarding state, switches the corresponding link state into a main chain state, and receives a response message sent by an opposite end through the DHRL-C port of the node.
3. The method according to claim 1, wherein after the intermediate device detects the link failure, sets the RSTP enabled port of the node in the broken link to a blocking state, and sends out an RSTP topology change message, the method further comprises:
after receiving the RSTP topology change message through the DHRL-C port of the node, the main link equipment in the main chain state switches the DHRL-C port of the node into a blocking state, clears a local forwarding table and simultaneously sends a table clearing message to other equipment of the main link;
if the DHRL-C port of the node does not receive the response message fed back by the other DHRL-C port after continuously sending the ring detection messages for the first time, the DHRL-C port of the node is switched to a forwarding state when the ring detection messages are sent again.
4. The method according to claim 1, wherein after the intermediate device detects the link failure, sets the RSTP enabled port of the node in the broken link to a blocking state, and sends out an RSTP topology change message, the method further comprises:
after receiving the RSTP topology change message through the DHRL-C port of the node, the main link equipment in the backup state switches the DHRL-C port of the node into a blocking state and clears a local forwarding table;
and if the DHRL-C port of the node does not receive the ring detection message for the second time, switching the DHRL-C port of the node into a forwarding state and switching the corresponding link state into a main chain state.
5. The method according to claim 3 or 4, wherein after the primary link device receives the RSTP topology change packet through the DHRL-C port of the node, the method further comprises, after switching the DHRL-C port of the node to the blocking state:
and if the DHRL-C port of the main link equipment receives a Bridge Protocol Data Unit (BPDU) message of the RSTP, sending the BPDU message of the P setting to the intermediate equipment in the intermediate link, so as to realize the forwarding state switching of the port by utilizing a PA mechanism of the RSTP.
6. The method of claim 1, further comprising:
when the interrupted link is recovered to be connected, the intermediate equipment sets the RSTP enabled port of the node in the interrupted link to be in a forwarding state and sends an RSTP topology change message outwards;
after receiving the RSTP topology change message, the main link equipment switches the DHRL-C port of the node into a blocking state and sends a table clearing message to other equipment of the main link so as to realize link switching.
7. The method according to claim 1, wherein at least two DHRL-C ports are configured on the main link, the DHRL-C ports are located in different devices or the same device in the main link, an initial port state of the DHRL-C ports is a blocking state, and an initial link state corresponding to the DHRL-C ports is a main link state.
8. A computer device, the device comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a method for dual-homed link implementation as claimed in any one of claims 1-7.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a method for dual-homed link implementation as claimed in any one of claims 1 to 7.
CN202111138546.XA 2021-09-27 2021-09-27 Method, equipment and storage medium for realizing dual-homing link Active CN113904975B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111138546.XA CN113904975B (en) 2021-09-27 2021-09-27 Method, equipment and storage medium for realizing dual-homing link

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111138546.XA CN113904975B (en) 2021-09-27 2021-09-27 Method, equipment and storage medium for realizing dual-homing link

Publications (2)

Publication Number Publication Date
CN113904975A CN113904975A (en) 2022-01-07
CN113904975B true CN113904975B (en) 2023-03-28

Family

ID=79029803

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111138546.XA Active CN113904975B (en) 2021-09-27 2021-09-27 Method, equipment and storage medium for realizing dual-homing link

Country Status (1)

Country Link
CN (1) CN113904975B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101557333A (en) * 2009-05-18 2009-10-14 杭州华三通信技术有限公司 Processing method of loop fault in dual-homing networking and node device

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004102853A2 (en) * 2003-05-06 2004-11-25 Overture Networks, Inc. Protected switching ring
CN101247306A (en) * 2008-03-13 2008-08-20 华为技术有限公司 Edge port blocking method in Ethernet ring network, Ethernet ring network system and equipment
US8102760B2 (en) * 2009-06-30 2012-01-24 Alcatel Lucent Method for reconvergence after failure in a dual-homing network environment
CN102571520B (en) * 2011-12-31 2015-10-28 北京格林伟迪科技有限公司 A kind of method realizing Fast Convergent in looped network
CN103297257B (en) * 2012-02-27 2016-10-19 北京东土科技股份有限公司 A Realization Method of Redundant Network
US9036644B2 (en) * 2012-08-05 2015-05-19 Eci Telecom Ltd. Method of provisioning H-VPLS services in a multi-domain MPLS network
CN103001799B (en) * 2012-11-23 2015-06-24 北京东土科技股份有限公司 Method and node for achieving redundancy on basis of chain network
CN106992931B (en) * 2017-04-18 2022-02-08 深圳市立全鼎盛科技有限公司 Switch redundancy backup method based on double-loop and double-loop system
CN109167742B (en) * 2018-08-15 2021-05-18 北京东土科技股份有限公司 Dual-homing protocol deployment system, method, device, switch and storage medium
CN109525445B (en) * 2018-12-29 2022-03-08 北京东土军悦科技有限公司 Link switching method, link redundancy backup network and computer readable storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101557333A (en) * 2009-05-18 2009-10-14 杭州华三通信技术有限公司 Processing method of loop fault in dual-homing networking and node device

Also Published As

Publication number Publication date
CN113904975A (en) 2022-01-07

Similar Documents

Publication Publication Date Title
WO2021043086A1 (en) Method, device and system for establishing sbfd session
CN112217658B (en) Stacking and splitting processing method and device
CN107465611A (en) The pretection switch method and device of SDN controllers and Switch control link
WO2019184923A1 (en) Information backup method and related device
US20200044964A1 (en) Defect detection in ip/mpls network tunnels
WO2021082812A1 (en) Message sending method and first network device
CN111988222A (en) Data transmission method and device, electronic equipment and computer readable storage medium
JP2006270839A (en) Layer 2 device setting control device
US20210126856A1 (en) Networking aggregation link provisioning system
WO2023197644A1 (en) Cross-segmented network fault detection method, and communication system and related apparatus
CN104365070A (en) Optimization for trill lan hellos
CN112217718A (en) Service processing method, device, equipment and storage medium
WO2013007124A1 (en) Method and system for advertising virtual router redundancy protocol link protection
CN112995027B (en) Route publishing method and VTEP node
TWI733560B (en) Switch and switch network system thereof
CN113904975B (en) Method, equipment and storage medium for realizing dual-homing link
CN112217680B (en) Controller capability benchmark test method and device based on software-defined wide area network
JP2010141845A (en) Communication apparatus including multiple servers and communication method
CN112787917A (en) Protection method, end node, protection group network and storage medium for flexible Ethernet
CN114172855B (en) Network switch and network switch system thereof
CN102664783B (en) Virtual local area network loop detection method and device thereof
CN103152262A (en) Method and equipment for connection establishment
US9712650B2 (en) PIM fast failover using PIM graft message
US11212217B2 (en) Spanning tree enabled link aggregation system
CN109714294B (en) Physical layer chip, network security device and data forwarding method

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