CN104796329A - Automatic link switching method and automatic link switching device - Google Patents
Automatic link switching method and automatic link switching device Download PDFInfo
- Publication number
- CN104796329A CN104796329A CN201410019427.6A CN201410019427A CN104796329A CN 104796329 A CN104796329 A CN 104796329A CN 201410019427 A CN201410019427 A CN 201410019427A CN 104796329 A CN104796329 A CN 104796329A
- Authority
- CN
- China
- Prior art keywords
- switching device
- port
- switching
- data frame
- active
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 39
- 230000005540 biological transmission Effects 0.000 claims abstract description 267
- 238000001514 detection method Methods 0.000 claims abstract description 226
- 208000032369 Primary transmission Diseases 0.000 claims description 27
- 230000004913 activation Effects 0.000 claims description 16
- 230000001960 triggered effect Effects 0.000 claims description 13
- 230000002159 abnormal effect Effects 0.000 abstract description 11
- 238000005516 engineering process Methods 0.000 abstract description 6
- 238000004891 communication Methods 0.000 abstract description 4
- 230000002035 prolonged effect Effects 0.000 abstract description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000005856 abnormality Effects 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000011084 recovery Methods 0.000 description 2
- 238000004904 shortening Methods 0.000 description 2
- 238000010276 construction Methods 0.000 description 1
- 230000009977 dual effect Effects 0.000 description 1
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
- Maintenance And Management Of Digital Transmission (AREA)
Abstract
本发明涉及通信技术领域,尤其涉及一种链路自动切换方法和装置,以现有技术中当交换设备连接传输设备的端口有电信号但部分链路故障时,交换设备无法检测到主用链路发生故障,因此无法实现链路的自动切换,导致远距离传输系统故障时间延长,系统稳定性差的问题。本发明采用连续M个周期检测到主用传输端口未接收到检测数据帧,则确定主用链路出现故障,关闭主用链路,启用备用链路工作;避免了现有技术中交换设备无法自动识别传输设备有电信号但链路异常的情况,缩短了远距离传输系统故障的时间,提高了远距离传输系统的可靠性;同时通过多个检测周期确定链路的状态,降低了由于传输端口接收检测数据帧出现时延,误判链路出现故障的概率。
The present invention relates to the field of communication technology, in particular to a method and device for automatic link switching. In the prior art, when the port of the switching device connected to the transmission device has an electrical signal but some links fail, the switching device cannot detect the main link. If the link fails, automatic link switching cannot be realized, resulting in prolonged failure time of the long-distance transmission system and poor system stability. The present invention detects that the main transmission port does not receive the detection data frame in consecutive M cycles, then determines that the main link has a failure, closes the main link, and enables the standby link to work; avoids the failure of the switching equipment in the prior art Automatically identify the situation that the transmission equipment has electrical signals but the link is abnormal, which shortens the failure time of the long-distance transmission system and improves the reliability of the long-distance transmission system; There is a delay in receiving and detecting data frames on a port, and the probability of misjudging a link failure.
Description
技术领域technical field
本发明涉及通信技术领域,尤其涉及一种链路自动切换方法及装置。The invention relates to the field of communication technology, in particular to a method and device for automatic link switching.
背景技术Background technique
随着移动用户数量的不断增加以及用户需求的不断更新,通信系统的建设规模越来越庞大,系统中的各组件无法放置在同一物理位置的机房内。但是,由于业务要求,整个系统的IP地址又需要在同一网段内,因此通常通过远距离传输线路将异地设备接入系统。远距离传输过程中,为了保障传输系统的可靠性,通常采用“双上联”技术,即采用在交换设备上设置主备两根网线连接到对端设备,交换设备通过主网线连接对端设备对应的链路称为主用链路,交换设备通过备用网线连接到对端设备对应的链路称为备用链路。当交换设备对应的主用链路发生故障时,切换至备用链路进行数据传输。With the continuous increase in the number of mobile users and the continuous update of user needs, the construction scale of the communication system is getting larger and larger, and each component in the system cannot be placed in the same physical location in the computer room. However, due to business requirements, the IP address of the entire system needs to be in the same network segment, so remote devices are usually connected to the system through long-distance transmission lines. In the process of long-distance transmission, in order to ensure the reliability of the transmission system, the "dual uplink" technology is usually used, that is, the main and standby two network cables are set on the switching device to connect to the peer device, and the switching device is connected to the peer device through the main network cable The corresponding link is called the active link, and the link that the switching device is connected to the peer device through the backup network cable is called the backup link. When the active link corresponding to the switching device fails, it switches to the standby link for data transmission.
下面对远距离传输系统具体举例说明,该系统中包括第一交换设备,第一数据服务器,传输设备,第二交换设备以及第二数据服务器;其中第一交换设备和第二交换设备中分别含有两个设备端口,两个传输端口;每个设备端口对应一个传输端口,即交换设备中的主用链路对应使用主用设备端口和主用传输端口,备用链路对应使用备用设备端口和备用传输端口;交换设备中的设备端口用于与数据服务器连接,传输端口用于与传输设备连接。当第一交换设备与第二交换设备通过主用链路连接时,第一交换设备通过主设备接口与第一数据服务器连接;第一交换设备通过主用传输端口与传输设备连接,并将第一交换设备通过主用传输端口与传输设备连接的部分主用链路记为主用链路段1;第二交换设备通过主设备接口与第二数据服务器连接;第二交换设备通过主用传输端口与传输设备连接,并将第二交换设备通过主用传输端口与传输设备连接的部分主用链路记为主用链路段2。The following is a specific example of the long-distance transmission system, which includes a first switching device, a first data server, a transmission device, a second switching device and a second data server; wherein the first switching device and the second switching device are respectively Contains two device ports and two transmission ports; each device port corresponds to a transmission port, that is, the active link in the switching device corresponds to the active device port and the active transmission port, and the standby link corresponds to the standby device port and The spare transmission port; the device port in the switching device is used for connecting with the data server, and the transmission port is used for connecting with the transmission device. When the first switching device is connected to the second switching device through the main link, the first switching device is connected to the first data server through the main device interface; the first switching device is connected to the transmission device through the main transmission port, and the second A part of the active link connecting the switching device to the transmission device through the active transmission port is designated as the active link segment 1; the second switching device is connected to the second data server through the main device interface; the second switching device is connected to the second data server through the active transmission The port is connected to the transmission device, and the part of the active link that the second switching device is connected to the transmission device through the active transmission port is designated as the active link segment 2.
数据传输系统通过主用链路进行数据传输的方法如下:第一数据服务器将接收到业务数据帧发送至第一交换设备;第一交换设备通过主用设备端口接收到第一数据服务器发送的业务数据帧,将该业务数据帧从主用设备端口转发至主用传输端口;第一交换设备的主用传输端口通过主用链路段1将业务数据帧发送至传输设备,传输设备通过主用链路段2将业务数据帧发送至第二交换设备;第二交换设备通过主用传输端口接收到传输设备发送的业务数据帧,将该业务数据帧从主用传输端口转发至主用设备端口;第二交换设备通过主用设备端口将该业务数据帧发送至第二数据服务器。上述数据传输的过程中,当第一交换设备与传输设备之间的主用链路段1没有出现异常时,第一交换设备就能检测到第一交换设备的主用传输端口的电信号;第一交换设备根据第一交换设备的主用传输端口是否有电信号,确定主用链路是否出现故障,当第一交换设备检测到主用传输端口的电信号时,则确定主用链路通信正常。但是当第二交换设备与传输设备之间的主用链路段2出现故障,或第二交换设备出现故障,但第一交换设备与传输设备之间的主用链路段1没有出现异常时,第一交换设备无法获知主用链路出现异常,仍旧判定主用链路正常,继续通过主用链路向第二传输设备发送业务数据帧。只有在接收到用户的投诉后,运营人员确定主用链路出现故障,并手动输入切换命令,进行主备链路的切换,才能使第一交换设备和第二交换设备通过备用链路恢复正常业务。The data transmission system performs data transmission through the main link as follows: the first data server sends the received service data frame to the first switching device; the first switching device receives the service sent by the first data server through the main device port data frame, the service data frame is forwarded from the main device port to the main transmission port; the main transmission port of the first switching device sends the service data frame to the transmission device through the main link segment 1, and the transmission device passes the main use Link segment 2 sends the service data frame to the second switching device; the second switching device receives the service data frame sent by the transmission device through the main transmission port, and forwards the service data frame from the main transmission port to the main device port ; The second switching device sends the service data frame to the second data server through the port of the active device. During the above data transmission process, when there is no abnormality in the active link segment 1 between the first switching device and the transmission device, the first switching device can detect the electrical signal of the main transmission port of the first switching device; The first switching device determines whether the active link fails according to whether there is an electrical signal at the active transmission port of the first switching device. When the first switching device detects the electrical signal of the active transmission port, it determines the active link Communication is normal. However, when the active link segment 2 between the second switching device and the transmission device fails, or the second switching device fails, but the active link segment 1 between the first switching device and the transmission device is not abnormal , the first switching device cannot know that the active link is abnormal, still determines that the active link is normal, and continues to send service data frames to the second transmission device through the active link. Only after receiving complaints from users, the operator determines that the active link is faulty, and manually enters the switching command to switch the active and standby links, so that the first switching device and the second switching device can return to normal through the standby link business.
因此,现有技术中当交换设备的传输端口有电信号,但部分主用链路故障,或对端交换设备故障时,交换设备无法检测到主用链路发生故障,也无法实现链路的自动切换,导致远距离传输系统故障时间延长,系统稳定性差。Therefore, in the prior art, when there is an electrical signal at the transmission port of the switching device, but part of the active link fails, or the peer switching device fails, the switching device cannot detect that the active link is faulty, and cannot realize the failure of the link. Automatic switching leads to prolonged failure time of the long-distance transmission system and poor system stability.
发明内容Contents of the invention
本发明实施例提供一种链路自动切换方法和装置,以解决现有技术中当交换设备的传输端口有电信号,但部分主用链路故障,或对端交换设备故障时,交换设备无法检测到主用链路发生故障,也无法实现链路的自动切换,导致远距离传输系统故障时间延长,系统稳定性差的问题。Embodiments of the present invention provide a method and device for automatic link switching to solve the problem that in the prior art, when the transmission port of the switching device has electrical signals, but some active links fail, or the peer switching device fails, the switching device cannot Even if a failure of the active link is detected, the link cannot be switched automatically, resulting in prolonged failure time of the long-distance transmission system and poor system stability.
本发明实施例提供了一种链路自动切换方法,该方法包括:An embodiment of the present invention provides a method for automatic link switching, the method comprising:
第一交换设备检测到主用传输端口连续M个周期未接收到第二交换设备发送的检测数据帧后,确定主用链路故障;其中,所述第一交换设备和第二交换设备周期向对方发送所述检测数据帧;After the first switching device detects that the active transmission port has not received the detection data frame sent by the second switching device for M consecutive periods, it determines that the active link is faulty; wherein, the first switching device and the second switching device periodically send The other party sends the detection data frame;
所述第一交换设备关闭所述主用链路,启用备用链路工作;The first switching device closes the active link and enables the standby link to work;
其中,M为正整数;所述检测数据帧是所述第一交换设备与所述第二交换设备预先约定的区别于业务数据帧的一种特定数据帧。Wherein, M is a positive integer; the detection data frame is a specific data frame different from service data frames agreed in advance by the first switching device and the second switching device.
上述实施例中第一交换设备采用连续M个周期检测到主用传输端口未接收到检测数据帧,则确定主用链路出现故障,并关闭主用链路,启用备用链路;避免了现有技术中交换设备无法自动识别传输设备有电信号但链路异常的情况,缩短了远距离传输系统故障的时间;同时通过多个周期检测到主用传输端口未接收到检测数据帧,才确定主用链路出现故障,降低了由于网络较差,或网络时延等情况导致主用传输端口接收检测数据帧出现时延,误判主用链路出现故障的概率,提高了远距离传输系统的可靠性。In the above-described embodiment, the first switching device detects that the active transmission port does not receive the detection data frame for M consecutive cycles, and then determines that the active link fails, and closes the active link and activates the standby link; In the existing technology, the switching equipment cannot automatically recognize that the transmission equipment has an electrical signal but the link is abnormal, which shortens the time for the failure of the long-distance transmission system; at the same time, it is determined that the main transmission port has not received the detection data frame through multiple cycles. Failure of the main link reduces the probability of misjudging the failure of the main link due to the poor network or network delay caused by the time delay of the main transmission port receiving the detection data frame, and improves the long-distance transmission system. reliability.
本发明实施例中每一交换设备具有与主/备用传输端口一一对应的主/备用设备端口,所述第一交换设备关闭所述主用链路,启用备用链路工作,具体包括:In the embodiment of the present invention, each switching device has a main/standby device port corresponding to the main/standby transmission port one by one, and the first switching device closes the main link and enables the standby link to work, specifically including:
触发第一交换设备的主用设备端口停止接收业务数据帧,并触发关闭所述第一交换设备的主用设备端口;triggering the active device port of the first switching device to stop receiving service data frames, and triggering to close the active device port of the first switching device;
所述第一交换设备连续N个周期未检测到主用设备端口的电信号,触发启用所述第一交换设备的备用设备端口;The first switching device does not detect the electrical signal of the active device port for N consecutive periods, triggering the activation of the backup device port of the first switching device;
所述第一交换设备触发启用所述第一交换设备的备用传输端口传输业务数据帧,并通过备用传输端口周期向所述第二交换设备发送检测数据帧;The first switching device triggers enabling the standby transmission port of the first switching device to transmit service data frames, and periodically sends detection data frames to the second switching device through the standby transmission port;
其中,N为正整数。Wherein, N is a positive integer.
上述实施例中通过主设备端口的电信号,确定备用设备端口的上电时间以及主用传输端口的关闭时间,实现了主备电路的自动切换,第一交换设备确定主用链路出现异常,则切换至第二设备端口对应的链路,交换设备的第二传输端口周期向交换设备对应的对端设备发送检测数据帧;使交换设备实现了自动切换链路,并在切换链路后根据检测数据帧确定切换后的链路的状态,缩短了传输系统的故障时间,提高了系统的稳定性。In the above embodiment, the power-on time of the backup device port and the shutdown time of the main transmission port are determined through the electrical signal of the main device port, and the automatic switching of the main and backup circuits is realized. The first switching device determines that the main link is abnormal, Then switch to the link corresponding to the second device port, and the second transmission port of the switching device periodically sends a detection data frame to the peer device corresponding to the switching device; the switching device realizes automatic link switching, and after switching the link according to Detecting the data frame determines the state of the link after switching, which shortens the failure time of the transmission system and improves the stability of the system.
本发明实施例中所述触发关闭所述第一交换设备的主用设备端口之后,还包括:In the embodiment of the present invention, after triggering and shutting down the active device port of the first switching device, it further includes:
所述第一交换设备触发主用设备端口连续关闭X个周期之后,所述第一设备触发开启主用设备端口;After the first switching device triggers the active device port to be closed continuously for X periods, the first device triggers the active device port to be turned on;
所述第一交换设备连续Y个周期检测到主用设备端口的电信号,触发所述第一交换设备的主用传输端口连续M个周期向第二交换设备发送检测数据帧;The first switching device detects the electrical signal of the active device port for Y consecutive cycles, and triggers the active transmission port of the first switching device to send detection data frames to the second switching device for M consecutive cycles;
所述第一交换设备检测到所述连续M个周期内所述主用传输端口未接收到第二交换设备发送的检测数据帧,触发关闭所述第一交换设备的主用设备端口,并返回触发主用设备端口连续关闭X个周期步骤;The first switching device detects that the active transmission port has not received the detection data frame sent by the second switching device within the consecutive M periods, triggers to close the active port of the first switching device, and returns Trigger the active device port to shut down X cycle steps continuously;
所述第一交换设备检测到所述连续M个周期内所述主用传输端口接收到第二交换设备发送的检测数据帧,则确定主用链路恢复,触发所述第一交换设备的主用传输端口周期向所述第二交换设备发送检测数据帧;The first switching device detects that the active transmission port has received the detection data frame sent by the second switching device within the consecutive M periods, then determines that the active link is restored, and triggers the active link of the first switching device. periodically sending a detection data frame to the second switching device by using a transmission port;
其中,X,Y,M均为正整数,且X不小于N。Wherein, X, Y, M are all positive integers, and X is not less than N.
上述实施例中主用设备端口关闭设定时长后,第一交换设备通知主用设备端口进入检测等待,每隔设定时长对主用设备端口进行一次上电,并通过主用传输端口向第二交换设备发送检测数据帧,并在发送检测数据帧的周期内,检测是否主用传输端口是否接受到第二交换设备发送的检测数据帧,若接收到,则确定主用链路恢复正常;主用链路恢复正常后,则开启主用设备端口,并通过主用传输端口周期向第二交换设备发送检测数据帧。使主用链路故障恢复后,当备用链路出现故障后,能随时切换至主用链路。交换设备的对链路的切换依赖于第一交换设备与第二交换设备预先约定的协议;主用传输端口的关闭或开启不依赖于中间传输设备的电信号,使交换设备对链路状态的判断更准确。In the above embodiment, after the port of the master device is closed for a set period of time, the first switching device notifies the port of the master device to enter the detection wait, powers on the port of the master device every set time length, and transmits data to the port of the master device through the master transmission port. The second switching device sends the detection data frame, and within the cycle of sending the detection data frame, detects whether the main transmission port receives the detection data frame sent by the second switching device, and if it is received, then determines that the main link returns to normal; After the active link returns to normal, the port of the active device is opened, and the detection data frame is periodically sent to the second switching device through the active transmission port. After the failure of the active link is restored, when the standby link fails, it can be switched to the active link at any time. The switching of the link by the switching device depends on the pre-agreed agreement between the first switching device and the second switching device; the closing or opening of the main transmission port does not depend on the electrical signal of the intermediate transmission device, so that the switching device can know the status of the link. Judgment is more accurate.
本发明实施例中该方法还包括:In the embodiment of the present invention, the method also includes:
当检测到所述主用链路故障恢复,且所述备用电路故障后,切换回所述主用链路工作。When it is detected that the active link recovers from failure and the backup circuit fails, switch back to the active link to work.
所述第一交换设备连续L个周期检测到备用传输端口未接收到第二交换设备发送的检测数据帧,确定备用链路故障;The first switching device detects that the backup transmission port has not received the detection data frame sent by the second switching device for L consecutive cycles, and determines that the backup link is faulty;
所述第一交换设备触发备用设备端口停止接收业务数据帧,并触发关闭所述第一交换设备的备用设备端口;The first switching device triggers the backup device port to stop receiving service data frames, and triggers to close the backup device port of the first switching device;
所述第一交换设备连续P个周期未检测到备用设备端口的电信号,触发启用所述第一交换设备的主用设备端口;The first switching device does not detect the electrical signal of the standby device port for P consecutive periods, triggering the activation of the active device port of the first switching device;
所述第一交换设备触发启用所述第一交换设备的主用传输端口传输业务数据帧,并通过备用传输端口周期向所述第二交换设备发送检测数据帧;The first switching device triggers enabling the primary transmission port of the first switching device to transmit service data frames, and periodically sends detection data frames to the second switching device through the standby transmission port;
其中,L,P均为正整数。Among them, L and P are both positive integers.
上述实施例中通过备用设备端口的电信号,确定主用设备端口的上电时间,实现了主备电路的自动切换,第一交换设备确定备用链路出现异常,则切换至主用链路,交换设备的主用传输端口周期发送检测数据帧;使交换设备实现了自动切换链路,并在切换链路后根据检测数据帧确定切换后的链路的状态,缩短了传输系统的故障时间,提高了系统的稳定性。In the above embodiment, the power-on time of the main device port is determined through the electrical signal of the backup device port, and the automatic switching of the main and backup circuits is realized. When the first switching device determines that the backup link is abnormal, it switches to the main link. The main transmission port of the switching device periodically sends detection data frames; the switching device realizes automatic link switching, and after switching the link, determines the state of the switched link according to the detection data frame, shortening the failure time of the transmission system, Improved system stability.
本发明实施例中触发关闭所述第一交换设备的备用设备端口之后,还包括:In the embodiment of the present invention, after triggering to close the standby device port of the first switching device, it further includes:
所述第一交换设备触发备用设备端口连续关闭Z个周期,所述第一设备触发开启备用设备端口;The first switching device triggers the backup device port to be closed continuously for Z periods, and the first device triggers the backup device port to be turned on;
所述第一交换设备连续Q个周期检测到备用设备端口的电信号,触发所述第一交换设备的备用传输端口连续L个周期向第二交换设备发送检测数据帧;The first switching device detects the electrical signal of the backup device port for Q consecutive cycles, and triggers the backup transmission port of the first switching device to send detection data frames to the second switching device for L consecutive cycles;
所述第一交换设备检测到所述连续L个周期内备用传输端口未接收到第二交换设备发送的检测数据帧,触发关闭所述第一交换设备的备用设备端口,并返回触发备用设备端口连续关闭Z个周期步骤;The first switching device detects that the standby transmission port has not received the detection data frame sent by the second switching device in the continuous L cycles, triggers to close the standby device port of the first switching device, and returns to trigger the standby device port Close Z cycle steps consecutively;
所述第一交换设备检测到所述连续L个周期内所述备用传输端口接收到第二交换设备发送的检测数据帧,则确定备用链路恢复,触发所述第一交换设备的备用传输端口周期向所述第二交换设备发送检测数据帧;The first switching device detects that the backup transmission port receives the detection data frame sent by the second switching device in the continuous L cycles, then determines that the backup link is restored, and triggers the backup transmission port of the first switching device periodically sending a detection data frame to the second switching device;
其中,Z,L,Q均为正整数,且Z不小于P。Among them, Z, L, Q are all positive integers, and Z is not less than P.
上述实施例中备用设备端口关闭设定时长后,第一交换设备通知备用设备端口进入检测等待,每隔设定时长对备用设备端口进行一次上电,并通过备用传输端口向第二交换设备发送检测数据帧,并在发送检测数据帧的周期内,检测是否备用传输端口是否接受到第二交换设备发送的检测数据帧,若接收到,则确定备用链路恢复正常;备用链路恢复正常后,则开启备用设备端口,并通过备用传输端口周期向第二交换设备发送检测数据帧。使备用链路故障恢复后,当主用链路出现故障后,能随时切换至备用链路。交换设备的对链路的切换依赖于第一交换设备与第二交换设备预先约定的协议;备用传输端口的关闭或开启不依赖于中间传输设备的电信号,使交换设备对链路状态的判断更准确。In the above-mentioned embodiment, after the standby device port is closed for a set period of time, the first switching device notifies the standby device port to enter the detection wait, powers up the standby device port once every set period of time, and sends a message to the second switching device through the standby transmission port. Detect the data frame, and in the cycle of sending the detection data frame, detect whether the standby transmission port has received the detection data frame sent by the second switching device, if received, then determine that the standby link is back to normal; after the standby link is back to normal , the standby device port is enabled, and the detection data frame is periodically sent to the second switching device through the standby transmission port. After the standby link is recovered from failure, when the active link fails, it can be switched to the standby link at any time. The switching of the link by the switching device depends on the pre-agreed agreement between the first switching device and the second switching device; the closing or opening of the standby transmission port does not depend on the electrical signal of the intermediate transmission device, so that the switching device can judge the link status more acurrate.
本发明实施例中触发第一交换设备的主用设备端口停止接收业务数据帧之后,触发启用第一交换设备的备用传输端口传输业务数据帧之前,还包括:In the embodiment of the present invention, after the active device port of the first switching device is triggered to stop receiving the service data frame, before the standby transmission port of the first switching device is triggered to transmit the service data frame, the steps further include:
第一交换设备检测到主用传输端口接收到第二交换设备侧发送的业务数据帧,将业务数据帧从主用传输端口转发至主用设备端口,主用设备端口对业务数据帧进行发送处理。The first switching device detects that the active transmission port has received the service data frame sent by the second switching device side, forwards the service data frame from the active transmission port to the active device port, and the active device port sends and processes the service data frame .
上述实施例中,当主用设备端口关闭以后,备用设备端口还没有启用时,接收到第二交换设备发送的业务数据帧,则依旧通过主用设备端口进行发送;减少了业务数据帧的丢失,提高了系统的可靠性。In the above-mentioned embodiment, when the port of the main device is closed and the port of the backup device has not been activated, the service data frame sent by the second switching device is received, and it is still sent through the port of the main device; the loss of the service data frame is reduced, Improve the reliability of the system.
本发明实施例提供了一种链路自动切换装置,应用于两个交换设备通过主/备用传输端口建立的主/备用链路的自动切换,该装置包括:An embodiment of the present invention provides an automatic link switching device, which is applied to the automatic switching of the main/standby link established by two switching devices through the main/standby transmission port, and the device includes:
检测单元,用于检测到第一交换设备的主用传输端口连续M个周期未接收到第二交换设备发送的检测数据帧后,确定主用链路故障;其中,所述第一交换设备和第二交换设备周期向对方发送所述检测数据帧;M为正整数;所述检测数据帧是所述第一交换设备与所述第二交换设备预先约定的区别于业务数据帧的一种特定数据帧;The detection unit is configured to detect that the primary transmission port of the first switching device has not received the detection data frame sent by the second switching device for M consecutive cycles, and determine that the primary link is faulty; wherein, the first switching device and The second switching device periodically sends the detection data frame to the other party; M is a positive integer; the detection data frame is a specific type that is different from the service data frame and is pre-agreed by the first switching device and the second switching device. Data Frame;
切换单元,用于关闭所述主用链路,启用备用链路工作。A switching unit, configured to close the active link and enable the standby link to work.
上述实施例中第一交换设备采用连续M个周期检测到主用传输端口未接收到检测数据帧,则确定主用链路出现故障,并关闭主用链路,启用备用链路;避免了现有技术中交换设备无法自动识别传输设备有电信号但链路异常的情况,缩短了远距离传输系统故障的时间;同时通过多个周期检测到主用传输端口未接收到检测数据帧,才确定主用链路出现故障,降低了由于网络较差,或网络时延等情况导致主用传输端口接收检测数据帧出现时延,误判主用链路出现故障的概率,提高了远距离传输系统的可靠性。In the above-described embodiment, the first switching device detects that the active transmission port does not receive the detection data frame for M consecutive cycles, and then determines that the active link fails, and closes the active link and activates the standby link; In the existing technology, the switching equipment cannot automatically recognize that the transmission equipment has an electrical signal but the link is abnormal, which shortens the time for the failure of the long-distance transmission system; at the same time, it is determined that the main transmission port has not received the detection data frame through multiple cycles. Failure of the main link reduces the probability of misjudging the failure of the main link due to the poor network or network delay caused by the time delay of the main transmission port receiving the detection data frame, and improves the long-distance transmission system. reliability.
本发明实施例中每一交换设备具有与主/备用传输端口一一对应的主/备用设备端口,所述切换单元具体用于:In the embodiment of the present invention, each switching device has a master/standby device port corresponding to the master/standby transmission port one by one, and the switching unit is specifically used for:
触发第一交换设备的主用设备端口停止接收业务数据帧,并触发关闭所述第一交换设备的主用设备端口;triggering the active device port of the first switching device to stop receiving service data frames, and triggering to close the active device port of the first switching device;
所述检测单元具体用于:连续N个周期未检测到所述第一交换设备的主用设备端口的电信号;所述切换单元具体用于:触发启用所述第一交换设备的备用设备端口;触发开启所述第一交换设备的备用传输端口传输业务数据帧,并通过备用传输端口周期向所述第二交换设备发送检测数据帧;The detection unit is specifically configured to: not detect the electrical signal of the active device port of the first switching device for N consecutive periods; the switching unit is specifically configured to: trigger and activate the standby device port of the first switching device ; triggering the standby transmission port of the first switching device to transmit service data frames, and periodically sending detection data frames to the second switching device through the standby transmission port;
其中,N均为正整数。Wherein, N is a positive integer.
上述实施例中通过主设备端口的电信号,确定备用设备端口的上电时间以及主用传输端口的关闭时间,实现了主备电路的自动切换,第一交换设备确定主用链路出现异常,则切换至第二设备端口对应的链路,交换设备的第二传输端口周期向交换设备对应的对端设备发送检测数据帧;使交换设备实现了自动切换链路,并在切换链路后根据检测数据帧确定切换后的链路的状态,缩短了传输系统的故障时间,提高了系统的稳定性。In the above embodiment, the power-on time of the backup device port and the shutdown time of the main transmission port are determined through the electrical signal of the main device port, and the automatic switching of the main and backup circuits is realized. The first switching device determines that the main link is abnormal, Then switch to the link corresponding to the second device port, and the second transmission port of the switching device periodically sends a detection data frame to the peer device corresponding to the switching device; the switching device realizes automatic link switching, and after switching the link according to Detecting the data frame determines the state of the link after switching, which shortens the failure time of the transmission system and improves the stability of the system.
本发明实施例中所述切换单元还用于:The switching unit described in the embodiment of the present invention is also used for:
触发主用设备端口连续关闭X个周期之后,触发开启主用设备端口;After triggering the active device port to be closed for X consecutive cycles, trigger to open the active device port;
所述检测单元还用于,连续Y个周期检测到主用设备端口的电信号,触发所述第一交换设备的主用传输端口连续M个周期向第二交换设备发送检测数据帧;The detection unit is further configured to detect the electrical signal of the main device port for Y consecutive cycles, and trigger the primary transmission port of the first switching device to send detection data frames to the second switching device for M consecutive cycles;
所述检测单元还用于,检测到所述连续M个周期内所述主用传输端口未接收到第二交换设备发送的检测数据帧;所述切换单元还用于,触发关闭所述第一交换设备的主用设备端口;The detecting unit is further configured to detect that the primary transmission port has not received the detection data frame sent by the second switching device within the consecutive M periods; the switching unit is further configured to trigger the shutdown of the first The active device port of the switching device;
所述检测单元还用于,检测到所述连续M个周期内所述主用传输端口接收到第二交换设备发送的检测数据帧,则确定主用链路恢复;触发所述第一交换设备的主用传输端口周期向所述第二交换设备发送检测数据帧;The detection unit is further configured to detect that the active transmission port receives a detection data frame sent by the second switching device within the consecutive M periods, then determine that the active link is restored; trigger the first switching device The primary transmission port periodically sends a detection data frame to the second switching device;
其中,X,Y,M均为正整数,且X不小于N。Wherein, X, Y, M are all positive integers, and X is not less than N.
上述实施例中主用设备端口关闭设定时长后,第一交换设备通知主用设备端口进入检测等待,每隔设定时长对主用设备端口进行一次上电,并通过主用传输端口向第二交换设备发送检测数据帧,并在发送检测数据帧的周期内,检测是否主用传输端口是否接受到第二交换设备发送的检测数据帧,若接收到,则确定主用链路恢复正常;主用链路恢复正常后,则开启主用设备端口,并通过主用传输端口周期向第二交换设备发送检测数据帧。使主用链路故障恢复后,当备用链路出现故障后,能随时切换至主用链路。交换设备的对链路的切换依赖于第一交换设备与第二交换设备预先约定的协议;主用传输端口的关闭或开启不依赖于中间传输设备的电信号,使交换设备对链路状态的判断更准确。In the above embodiment, after the port of the master device is closed for a set period of time, the first switching device notifies the port of the master device to enter the detection wait, powers on the port of the master device every set time length, and transmits data to the port of the master device through the master transmission port. The second switching device sends the detection data frame, and within the cycle of sending the detection data frame, detects whether the main transmission port receives the detection data frame sent by the second switching device, and if it is received, then determines that the main link returns to normal; After the active link returns to normal, the port of the active device is opened, and the detection data frame is periodically sent to the second switching device through the active transmission port. After the failure of the active link is restored, when the standby link fails, it can be switched to the active link at any time. The switching of the link by the switching device depends on the pre-agreed agreement between the first switching device and the second switching device; the closing or opening of the main transmission port does not depend on the electrical signal of the intermediate transmission device, so that the switching device can know the status of the link. Judgment is more accurate.
本发明实施例中所述检测单元具体用于:The detection unit described in the embodiment of the present invention is specifically used for:
连续L个周期检测到备用传输端口未接收到第二交换设备发送的检测数据帧,确定备用链路故障;Detecting that the standby transmission port has not received the detection data frame sent by the second switching device for L consecutive cycles, and determining that the standby link is faulty;
所述切换单元具体用于,触发备用设备端口停止接收业务数据帧,并触发关闭所述第一交换设备的备用设备端口;The switching unit is specifically configured to trigger the backup device port to stop receiving service data frames, and trigger to close the backup device port of the first switching device;
所述检测单元具体用于,连续P个周期未检测到备用设备端口的电信号;所述切换单元具体用于,触发启用所述第一交换设备的主用设备端口;触发启用所述第一交换设备的主用传输端口传输业务数据帧,并通知检测单元通过备用传输端口周期向所述第二交换设备发送检测数据帧;The detection unit is specifically configured to detect no electrical signal of the standby device port for P consecutive periods; the switching unit is specifically configured to trigger the activation of the primary device port of the first switching device; trigger the activation of the first switching device port; The main transmission port of the switching device transmits the service data frame, and notifies the detection unit to periodically send the detection data frame to the second switching device through the standby transmission port;
其中,L,P均为正整数。Among them, L and P are both positive integers.
上述实施例中通过备用设备端口的电信号,确定主用设备端口的上电时间,实现了主备电路的自动切换,第一交换设备确定备用链路出现异常,则切换至主用链路,交换设备的主用传输端口周期发送检测数据帧;使交换设备实现了自动切换链路,并在切换链路后根据检测数据帧确定切换后的链路的状态,缩短了传输系统的故障时间,提高了系统的稳定性。In the above embodiment, the power-on time of the main device port is determined through the electrical signal of the backup device port, and the automatic switching of the main and backup circuits is realized. When the first switching device determines that the backup link is abnormal, it switches to the main link. The main transmission port of the switching device periodically sends detection data frames; the switching device realizes automatic link switching, and after switching the link, determines the state of the switched link according to the detection data frame, shortening the failure time of the transmission system, Improved system stability.
本发明实施例中所述切换单元还用于:The switching unit described in the embodiment of the present invention is also used for:
触发备用设备端口连续关闭Z个周期,触发开启备用设备端口;Trigger the backup device port to close Z cycles continuously, and trigger the backup device port to open;
所述检测单元还用于连续Q个周期检测到备用设备端口的电信号,触发所述第一交换设备的备用传输端口连续L个周期向第二交换设备发送检测数据帧;The detection unit is also used to detect the electrical signal of the backup device port for Q consecutive cycles, and trigger the backup transmission port of the first switching device to send detection data frames to the second switching device for L consecutive cycles;
所述检测单元具体用于,检测到所述连续L个周期内备用传输端口未接收到第二交换设备发送的检测数据帧;所述切换单元用于,触发关闭所述第一交换设备的备用设备端口;The detection unit is specifically used to detect that the standby transmission port has not received the detection data frame sent by the second switching device in the continuous L cycles; the switching unit is used to trigger the shutdown of the standby transmission port of the first switching device. device port;
所述检测单元具体用于,检测到所述连续L个周期内所述备用传输端口接收到第二交换设备发送的检测数据帧,则确定备用链路恢复,触发所述第一交换设备的备用传输端口周期向所述第二交换设备发送检测数据帧;The detection unit is specifically configured to detect that the backup transmission port receives the detection data frame sent by the second switching device in the continuous L cycles, then determine that the backup link is restored, and trigger the backup of the first switching device. The transmission port periodically sends detection data frames to the second switching device;
其中,Z,L,Q均为正整数,且Z不小于P。Among them, Z, L, Q are all positive integers, and Z is not less than P.
上述实施例中备用设备端口关闭设定时长后,第一交换设备通知备用设备端口进入检测等待,每隔设定时长对备用设备端口进行一次上电,并通过备用传输端口向第二交换设备发送检测数据帧,并在发送检测数据帧的周期内,检测是否备用传输端口是否接受到第二交换设备发送的检测数据帧,若接收到,则确定备用链路恢复正常;备用链路恢复正常后,则开启备用设备端口,并通过备用传输端口周期向第二交换设备发送检测数据帧。使备用链路故障恢复后,当主用链路出现故障后,能随时切换至备用链路。交换设备的对链路的切换依赖于第一交换设备与第二交换设备预先约定的协议;备用传输端口的关闭或开启不依赖于中间传输设备的电信号,使交换设备对链路状态的判断更准确。In the above-mentioned embodiment, after the standby device port is closed for a set period of time, the first switching device notifies the standby device port to enter the detection wait, powers up the standby device port once every set period of time, and sends a message to the second switching device through the standby transmission port. Detect the data frame, and in the cycle of sending the detection data frame, detect whether the standby transmission port has received the detection data frame sent by the second switching device, if received, then determine that the standby link is back to normal; after the standby link is back to normal , the standby device port is enabled, and the detection data frame is periodically sent to the second switching device through the standby transmission port. After the standby link is recovered from failure, when the active link fails, it can be switched to the standby link at any time. The switching of the link by the switching device depends on the pre-agreed agreement between the first switching device and the second switching device; the closing or opening of the standby transmission port does not depend on the electrical signal of the intermediate transmission device, so that the switching device can judge the link status more acurrate.
本发明实施例中所述切换单元还用于:The switching unit described in the embodiment of the present invention is also used for:
触发第一交换设备的主用设备端口停止接收业务数据帧之后,触发启用第一交换设备的备用传输端口传输业务数据帧之前,检测到第一交换设备的主用传输端口接收到第二交换设备侧发送的业务数据帧,将业务数据帧从主用传输端口转发至主用设备端口,主用设备端口对业务数据帧进行发送处理。After the active port of the first switching device is triggered to stop receiving service data frames, before the standby transmission port of the first switching device is triggered to transmit service data frames, it is detected that the active transmission port of the first switching device receives the second switching device The service data frame sent by the side forwards the service data frame from the main transmission port to the main equipment port, and the main equipment port sends and processes the service data frame.
上述实施例中,当主用设备端口关闭以后,备用设备端口还没有启用时,接收到第二交换设备发送的业务数据帧,则依旧通过主用设备端口进行发送;减少了业务数据帧的丢失,提高了系统的可靠性。In the above-mentioned embodiment, when the port of the main device is closed and the port of the backup device has not been activated, the service data frame sent by the second switching device is received, and it is still sent through the port of the main device; the loss of the service data frame is reduced, Improve the reliability of the system.
本发明实施例采用第一交换设备检测到主用传输端口连续M个周期未接收到第二交换设备发送的检测数据帧后,确定主用链路故障;第一交换设备关闭主用链路,启用备用链路工作;第一交换设备采用连续M个周期检测到主用传输端口未接收到检测数据帧,则确定主用链路出现故障,并关闭主用链路,启用备用链路;避免了现有技术中交换设备无法自动识别传输设备有电信号但链路异常的情况,缩短了远距离传输系统故障的时间;同时通过多个周期检测到主用传输端口未接收到检测数据帧,才确定主用链路出现故障,降低了由于网络较差,或网络时延等情况导致主用传输端口接收检测数据帧出现时延,误判主用链路出现故障的概率,提高了远距离传输系统的可靠性。In the embodiment of the present invention, after the first switching device detects that the primary transmission port has not received the detection data frame sent by the second switching device for M consecutive cycles, it determines that the primary link is faulty; the first switching device closes the primary link, Enable the standby link to work; the first switching device detects that the main transmission port does not receive the detection data frame by continuous M cycles, then it is determined that the main link fails, and the main link is closed, and the standby link is enabled; avoid It solves the situation that the switching equipment in the prior art cannot automatically recognize that the transmission equipment has an electrical signal but the link is abnormal, and shortens the time for the failure of the long-distance transmission system; at the same time, it detects that the main transmission port has not received the detection data frame through multiple cycles, It is determined that the main link is faulty, which reduces the probability of misjudgment that the main link is faulty due to poor network or network delay caused by the delay in receiving the detection data frame at the main transmission port, and improves the long-distance The reliability of the transmission system.
附图说明Description of drawings
图1为本发明实施例中一种链路自动切换方法的流程示意图;FIG. 1 is a schematic flow diagram of a method for automatic link switching in an embodiment of the present invention;
图2为本发明实施例中一种链路自动切换的具体方法的流程示意图;FIG. 2 is a schematic flowchart of a specific method for automatic link switching in an embodiment of the present invention;
图3为本发明实施例中另一种链路自动切换的方法的流程示意图;FIG. 3 is a schematic flowchart of another method for automatic link switching in an embodiment of the present invention;
图4为本发明实施例中一种链路自动切换装置的示意图。Fig. 4 is a schematic diagram of an automatic link switching device in an embodiment of the present invention.
具体实施方式Detailed ways
本发明实施例提供了一种链路自动切换方法及装置,第一交换设备根据第二交换设备周期发送的检测数据帧,确定主用链路是否发生故障,确定主用链路发生故障切换至备用链路;避免了依靠传输设备的电信号确定链路当前的工作,提高了判断链路工作状态的准确性,实现了链路的自动切换,缩短了远距离传输系统故障的时间,提高了远距离传输系统的可靠性。Embodiments of the present invention provide a method and device for automatic link switching. The first switching device determines whether the active link fails according to the detection data frame periodically sent by the second switching device, and determines whether the active link fails and switches to Backup link; it avoids relying on the electrical signal of the transmission equipment to determine the current work of the link, improves the accuracy of judging the working status of the link, realizes the automatic switching of the link, shortens the time of failure of the long-distance transmission system, and improves the reliability of the link. Reliability of long-distance transmission systems.
下面结合说明书附图对本发明进行进一步说明。The present invention will be further described below in conjunction with the accompanying drawings of the description.
如图1所示,为本发明实施例中一种链路自动切换方法,应用于两个交换设备通过主/备用传输端口建立的主/备用链路的自动切换,该方法包括:As shown in Figure 1, it is a kind of link automatic switching method in the embodiment of the present invention, is applied to the automatic switching of the active/standby link that two switch devices establish through active/standby transmission port, and this method comprises:
步骤101:第一交换设备检测到主用传输端口连续M个周期未接收到第二交换设备发送的检测数据帧后,确定主用链路故障;其中,第一交换设备和第二交换设备周期向对方发送所述检测数据帧;Step 101: After the first switching device detects that the active transmission port has not received the detection data frame sent by the second switching device for M consecutive periods, it determines that the active link is faulty; wherein, the first switching device and the second switching device cycle sending the detection data frame to the other party;
步骤102:第一交换设备关闭主用链路,启用备用链路工作;Step 102: the first switching device shuts down the active link, and enables the standby link to work;
其中,M为正整数;检测数据帧是第一交换设备与第二交换设备预先约定的区别于业务数据帧的一种特定数据帧。Wherein, M is a positive integer; the detection data frame is a specific data frame different from the service data frame pre-agreed by the first switching device and the second switching device.
步骤101中,第一交换设备检测到主用传输端口连续M个周期未接收到第二交换设备发送的检测数据帧,具体包括:第一交换设备检测主用传输端口接收的检测数据帧,当第一交换设备检测到主用传输端口在一个周期内没有接收到检测数据帧,则进入逻辑等待状态,当第一交换设备进入逻辑等待状态后,连续M-1个周期检测到主用传输端口未接收到检测数据帧,则确定主用链路出现故障,其中M为正整数。如预先设定第一交换设备连续5个周期检测到主用传输端口未接收到检测数据帧,则确定主用链路发生故障;第一交换设备检测到当前周期内主用传输端口未接收到检测数据帧,则进入逻辑等待状态,第一交换设备进入逻辑等待状态后,连续4个周期检测到主用传输端口未接收到检测数据帧,则确定主用链路发生故障。In step 101, the first switching device detects that the main transmission port has not received the detection data frame sent by the second switching device for M consecutive cycles, specifically including: the first switching device detects the detection data frame received by the main transmission port, when The first switching device detects that the main transmission port has not received the detection data frame within one cycle, and then enters the logic waiting state. When the first switching device enters the logic waiting state, it detects the main transmission port for M-1 consecutive cycles If the detection data frame is not received, it is determined that the active link fails, where M is a positive integer. If it is pre-set that the first switching device detects that the primary transmission port has not received the detection data frame for 5 consecutive cycles, it is determined that the primary link has failed; After detecting the data frame, it enters the logical waiting state. After the first switching device enters the logical waiting state, it detects that the active transmission port does not receive the detection data frame for 4 consecutive cycles, and then determines that the active link fails.
第一交换设备采用连续M个周期检测到主用传输端口未接收到检测数据帧,则确定主用传输端口对应的链路出现故障,避免了现有技术中交换设备无法自动识别传输设备有电信号但链路异常的情况,缩短了远距离传输系统故障的时间,提高了远距离传输系统的可靠性;同时通过多个周期检测到主用传输端口未接收到检测数据帧,才确定主用链路出现故障,降低了由于网络较差,或网络时延等情况导致主用传输端口接收检测数据帧出现时延,误判主用传输端口对应的链路出现故障的概率。The first switching device detects that the main transmission port does not receive the detection data frame for M consecutive cycles, and then determines that the link corresponding to the main transmission port is faulty, avoiding that the switching device in the prior art cannot automatically identify that the transmission device has power The signal but the link is abnormal, which shortens the failure time of the long-distance transmission system and improves the reliability of the long-distance transmission system; at the same time, it is determined that the main transmission port has not received the detection data frame through multiple cycles The failure of the link reduces the probability of misjudging that the link corresponding to the main transmission port is faulty due to the delay in receiving the detection data frame due to poor network or network delay.
每一交换设备具有与主/备用传输端口一一对应的主/备用设备端口。Each switching device has a primary/standby device port corresponding to a primary/standby transmission port one-to-one.
步骤102中,第一交换设备关闭主用链路,启用备用链路工作,具体包括:第一交换设备确定主用链路出现故障,触发关闭主用传输端口对应的主用设备端口,同时第一交换设备对备用设备端口进行上电处理。第一交换设备触发关闭主用设备端口后,主用设备端口不再输出电信号,第一交换设备在连续N个周期没有检测到主用设备端口的电信号,则触发开启第一交换设备的备用设备端口;同时第一交换设备触发启用第一交换设备的备用传输端口传输业务数据帧,并通过备用传输端口周期向第二交换设备发送检测数据帧;其中,N为正整数。In step 102, the first switching device closes the active link and enables the standby link to work, specifically including: the first switching device determines that the active link fails, triggers the shutdown of the active device port corresponding to the active transmission port, and simultaneously A switching device performs power-on processing on the standby device port. After the first switching device triggers to close the port of the active device, the port of the active device no longer outputs electrical signals. If the first switching device does not detect the electrical signal of the port of the active device for N consecutive cycles, it triggers the opening of the first switching device. Standby device port; at the same time, the first switching device triggers to enable the standby transmission port of the first switching device to transmit service data frames, and periodically sends detection data frames to the second switching device through the standby transmission port; wherein, N is a positive integer.
其中第一交换设备触发关闭第一交换设备的主用设备端口之后,还包括:第一交换设备触发主用设备端口连续关闭X个周期之后,第一设备触发开启主用设备端口;第一交换设备连续Y个周期检测到主用设备端口的电信号,触发第一交换设备的主用传输端口连续M个周期向第二交换设备发送检测数据帧;第一交换设备检测到连续M个周期内主用传输端口未接收到第二交换设备发送的检测数据帧,触发关闭第一交换设备的主用设备端口,并返回触发主用设备端口连续关闭X个周期步骤;第一交换设备检测到连续M个周期内主用传输端口接收到第二交换设备发送的检测数据帧,则确定主用链路恢复,触发第一交换设备的主用传输端口周期向第二交换设备发送检测数据帧;其中,X,Y,M均为正整数,且X不小于N。After the first switching device triggers to close the active device port of the first switching device, it also includes: after the first switching device triggers the active device port to be closed continuously for X periods, the first device triggers to open the active device port; the first switch The device detects the electrical signal of the active device port for Y consecutive cycles, and triggers the active transmission port of the first switching device to send a detection data frame to the second switching device for M consecutive cycles; the first switching device detects that within M consecutive cycles If the main transmission port does not receive the detection data frame sent by the second switching device, it triggers the shutdown of the main device port of the first switching device, and returns to trigger the continuous shutdown of the main device port for X cycle steps; the first switching device detects that the continuous In M cycles, the active transmission port receives the detection data frame sent by the second switching device, then it is determined that the active link is restored, and the active transmission port of the first switching device is triggered to periodically send the detection data frame to the second switching device; wherein , X, Y, M are all positive integers, and X is not less than N.
如第一交换设备连续5个周期内检测到主用传输端口未接收到第二交换设备发送的检测数据帧,则确定主用链路故障,触发关闭主用设备端口;第一交换设备在一个周期内未检测到主用设备端口的电信号,第一交换设备触发启用备用设备端口;第一交换设备连接的设备检测到主用设备端口没有电信号,则将业务数据帧通过备用设备端口发送至第一交换设备,第一交换设备将业务数据帧从备用设备端口转发至备用传输端口,通过备用传输端口将业务数据帧发送至第二交换设备;第一交换设备连续两个周期未检测到主用传输端口的电信号,触发开启主用设备端口,第一交换设备检测到主用设备端口的电信号,则触发第一主用传输端口连续5个周期向第二交换设备发送检测数据帧,若在这5个周期内,主用传输端口未接收到第二交换设备发送的检测数据帧,则返回主用设备端口连续关闭连个周期的步骤;若在这5个周期内,主用传输端口接收到第二交换设备发送的检测数据帧,则确定主用链路恢复正常,触发主用传输端口周期向第二设备发送检测数据帧;以便于备用链路出现故障时,切换回主用链路。If the first switching device detects that the active transmission port has not received the detection data frame sent by the second switching device within 5 consecutive cycles, it determines that the active link is faulty and triggers the shutdown of the active port; If the electrical signal of the main device port is not detected within the period, the first switching device triggers the activation of the backup device port; the device connected to the first switching device detects that there is no electrical signal at the main device port, and then sends the service data frame through the backup device port To the first switching device, the first switching device forwards the service data frame from the backup device port to the backup transmission port, and sends the service data frame to the second switching device through the backup transmission port; the first switching device does not detect The electrical signal of the main transmission port triggers the opening of the main equipment port, and the first switching device detects the electrical signal of the main equipment port, then triggers the first main transmission port to send detection data frames to the second switching equipment for 5 consecutive cycles , if within these 5 cycles, the primary transmission port does not receive the detection data frame sent by the second switching device, then return to the step of closing the port of the primary device for consecutive cycles; if within these 5 cycles, the primary When the transmission port receives the detection data frame sent by the second switching device, it determines that the active link is back to normal, and triggers the active transmission port to periodically send the detection data frame to the second device; in order to switch back to the active link when the backup link fails. Use the link.
较佳地,该方法还包括:当检测到主用链路故障恢复,且备用电路故障后,切换回所述主用链路工作。Preferably, the method further includes: switching back to the active link to work when it is detected that the active link fails and the backup circuit fails.
第一交换设备连续L个周期检测到备用传输端口未接收到第二交换设备发送的检测数据帧,确定备用链路故障;第一交换设备触发备用设备端口停止接收业务数据帧,并触发关闭第一交换设备的备用设备端口;第一交换设备连续P个周期未检测到备用设备端口的电信号,触发启用第一交换设备的主用设备端口;第一交换设备触发启用第一交换设备的主用传输端口传输业务数据帧,并通过备用传输端口周期向第二交换设备发送检测数据帧;其中,L,P均为正整数。The first switching device detects that the backup transmission port has not received the detection data frame sent by the second switching device for L consecutive cycles, and determines that the backup link is faulty; the first switching device triggers the port of the backup device to stop receiving service data frames, and triggers the shutdown of the second switching device A backup device port of a switching device; the first switching device does not detect the electrical signal of the backup device port for P consecutive cycles, triggering the activation of the active device port of the first switching device; the first switching device triggers the activation of the primary device port of the first switching device Use the transmission port to transmit the service data frame, and periodically send the detection data frame to the second switching device through the standby transmission port; wherein, L and P are both positive integers.
其中触发关闭第一交换设备的备用设备端口之后,还包括:第一交换设备触发备用设备端口连续关闭Z个周期,第一设备触发开启备用设备端口;第一交换设备连续Q个周期检测到备用设备端口的电信号,触发第一交换设备的备用传输端口连续L个周期向第二交换设备发送检测数据帧;第一交换设备检测到连续L个周期内备用传输端口未接收到第二交换设备发送的检测数据帧,触发关闭第一交换设备的备用设备端口,并返回触发备用设备端口连续关闭Z个周期步骤;第一交换设备检测到连续L个周期内备用传输端口接收到第二交换设备发送的检测数据帧,则确定备用链路恢复,触发第一交换设备的备用传输端口周期向第二交换设备发送检测数据帧;其中,Z,L,Q均为正整数,且Z不小于P。After triggering to close the backup device port of the first switching device, it also includes: the first switching device triggers the backup device port to be closed continuously for Z cycles, and the first device triggers to open the backup device port; the first switching device detects the backup port for Q consecutive cycles The electrical signal of the device port triggers the standby transmission port of the first switching device to send detection data frames to the second switching device for L consecutive cycles; the first switching device detects that the standby transmission port has not received the second switching device for L consecutive cycles The detection data frame sent triggers the shutdown of the backup device port of the first switching device, and returns to the step of triggering the shutdown of the backup device port for Z consecutive cycles; the first switching device detects that the backup transmission port receives the second switching device in consecutive L cycles If the detection data frame is sent, it is determined that the backup link is restored, and the backup transmission port of the first switching device is triggered to periodically send a detection data frame to the second switching device; wherein, Z, L, and Q are all positive integers, and Z is not less than P .
如第一交换设备连续5个周期内检测到备用传输端口未接收到第二交换设备发送的检测数据帧,确定备用链路故障;第一交换设备触发备用设备端口停止接收业务数据帧,并触发关闭第一交换设备的备用设备端口;第一交换设备在一个周期内未检测到备用设备端口的电信号,第一交换设备触发启用主用设备端口;第一交换设备连接的设备检测到备用设备端口没有电信号,则将业务数据帧通过主用设备端口发送至第一交换设备,第一交换设备将业务数据帧从主用设备端口转发至主用传输端口,通过主用传输端口将业务数据帧发送至第二交换设备;第一交换设备连续两个周期未检测到备用传输端口的电信号,触发开启备用设备端口,第一交换设备检测到备用设备端口的电信号,则触发第一备用传输端口连续5个周期向第二交换设备发送检测数据帧,若在这5个周期内,备用传输端口未接收到第二交换设备发送的检测数据帧,则返回备用设备端口连续关闭两个周期的步骤;若在这5个周期内备用传输端口接收到第二交换设备发送的检测数据帧,则确定备用链路恢复正常,触发备用传输端口周期向第二设备发送检测数据帧;以便于主用链路出现故障时,切换回备用链路。If the first switching device detects that the standby transmission port has not received the detection data frame sent by the second switching device for 5 consecutive cycles, it determines that the backup link is faulty; the first switching device triggers the standby device port to stop receiving service data frames, and triggers Close the backup device port of the first switching device; the first switching device does not detect the electrical signal of the backup device port within one cycle, and the first switching device triggers the activation of the active device port; the device connected to the first switching device detects the backup device If there is no electrical signal at the port, the service data frame is sent to the first switching device through the port of the main device, and the first switching device forwards the service data frame from the port of the main device to the main transmission port, and transmits the service data through the main transmission port The frame is sent to the second switching device; the first switching device does not detect the electrical signal of the backup transmission port for two consecutive cycles, triggering the opening of the backup device port, and the first switching device detects the electrical signal of the backup device port, then triggers the first backup The transmission port sends the detection data frame to the second switching device for 5 consecutive cycles. If the standby transmission port does not receive the detection data frame sent by the second switching device within these 5 cycles, it returns to the standby device port and closes it for two consecutive cycles. The step; If within these 5 cycles, the standby transmission port receives the detection data frame sent by the second switching device, then it is determined that the standby link is back to normal, and the standby transmission port is triggered to periodically send the detection data frame to the second equipment; so that the master When the active link fails, switch back to the standby link.
本发明实施例中,当通过主用链路发送业务数据帧,且备用链路没有发生故障时,备用连路通过备用传输端口周期向第二交换设备发送检测数据帧,以确定备用链路当前未发生故障;当通过备用链路发送业务数据帧,且主用链路没有发生故障时,主用连路通过主用传输端口周期向第二交换设备发送检测数据帧,以确定主用链路当前未发生故障;以便于当第一交换设备中的一个链路发生故障时,能够使用另一条没有故障的链路。In the embodiment of the present invention, when the service data frame is sent through the active link and the standby link does not fail, the standby link periodically sends a detection data frame to the second switching device through the standby transmission port to determine the current status of the standby link. No fault occurs; when the service data frame is sent through the standby link and the active link is not faulty, the active link periodically sends detection data frames to the second switching device through the active transmission port to determine the active link There is currently no failure; so that when a link in the first switching device fails, another link without failure can be used.
较佳地,第一交换设备连接的设备检测到主用设备端口没有电信号,则自动停止向主用设备端口发送业务数据帧,通过备用设备端口向第一交换设备发送业务数据帧。Preferably, when the device connected to the first switching device detects that there is no electrical signal at the port of the active device, it automatically stops sending service data frames to the port of the active device, and sends service data frames to the first switching device through the port of the standby device.
第一交换设备通过主用传输端口接收第二交换设备发送的业务数据帧,将接收到的业务数据帧发送至主用设备端口,第一交换设备通过主用设备端口将业务数据帧发送至第一交换设备连接的设备。第一交换设备检测到主用设备端口接收到连接的设备发送的业务数据帧,将该业务数据帧发送至主用传输端口,第一交换设备通过主用传输端口将该业务数据帧发送至第二交换设备。The first switching device receives the service data frame sent by the second switching device through the primary transmission port, and sends the received service data frame to the port of the primary device, and the first switching device sends the service data frame to the port of the primary device through the port of the primary device. A switching device is connected to the device. The first switching device detects that the port of the active device receives the service data frame sent by the connected device, and sends the service data frame to the active transmission port, and the first switching device sends the service data frame to the second through the active transmission port. Two switching devices.
第一交换设备触发主用设备端口停止接收业务数据帧之后,触发启用第一交换设备的备用传输端口传输业务数据帧之前,还包括:第一交换设备检测到主用传输端口接收到第二交换设备侧发送的业务数据帧,将业务数据帧从主用传输端口转发至主用设备端口,主用设备端口对业务数据帧进行发送处理。After the first switching device triggers the active device port to stop receiving service data frames, before triggering the start of the standby transmission port of the first switching device to transmit service data frames, the first switching device detects that the active transmission port receives the second switch For the service data frame sent by the device side, the service data frame is forwarded from the active transmission port to the active device port, and the active device port sends and processes the service data frame.
较佳地,本发明实施例中根据IEEE802.3协议,在经过物理层和逻辑链路层的处理之后,包含在数据帧中的数据将被传递给在类型段中指定的高层协议。虽然以太网协议中并没有明确作出补齐规定,但是以太网帧中数据帧的长度最小应当不低于46个字节,以保证802.3协议的数据帧长最大值1518字节,最小值64字节。Preferably, according to the IEEE802.3 protocol in the embodiment of the present invention, after being processed by the physical layer and the logical link layer, the data included in the data frame will be delivered to the high-level protocol specified in the type field. Although the Ethernet protocol does not explicitly specify the completion requirement, the minimum length of the data frame in the Ethernet frame should not be less than 46 bytes, so as to ensure that the maximum data frame length of the 802.3 protocol is 1518 bytes, and the minimum value is 64 bytes. Festival.
为减少转发量,本发明实施例中的检测数据帧长度设置为46个字节,加上检测数据帧的前导码、界定符、类型、校验码等字段,刚好达到以太网数据帧的最小长度64字节。本发明中的46个字节的检测数据帧可以采用以下格式:“1111000011110000…”或者“0xF0F0F0F0F0F0F0F0F0…”。上述实施例中举例的检测数据帧是本发明实施例中一种较有的检测数据帧的格式,其他格式的检测数据帧同样适用于本发明。In order to reduce the amount of forwarding, the detection data frame length in the embodiment of the present invention is set to 46 bytes, plus fields such as the preamble, delimiter, type, check code of the detection data frame, just reach the minimum of the Ethernet data frame The length is 64 bytes. The detection data frame of 46 bytes in the present invention can adopt the following format: "1111000011110000..." or "0xF0F0F0F0F0F0F0F0F0...". The detection data frame exemplified in the above embodiment is a relatively common format of the detection data frame in the embodiment of the present invention, and detection data frames in other formats are also applicable to the present invention.
如图2所示,为本发明实施例中一种链路自动切换的具体方法,该方法包括:As shown in Figure 2, it is a specific method for link automatic switching in the embodiment of the present invention, the method includes:
步骤201:第一交换设备的主用传输端口周期接收到第二交换设备发送的检测数据帧;Step 201: The primary transmission port of the first switching device periodically receives the detection data frame sent by the second switching device;
步骤202:第一交换设备检测到当前周期内主用传输端口未接收到的第二交换设备发送的检测数据帧;Step 202: The first switching device detects the detection data frame sent by the second switching device that has not been received by the active transmission port in the current cycle;
步骤203:第一交换设备判断当前周期之后的连续4个周期内主用传输端口是否接收到第二传输设备发送的检测数据帧,若接收到,则返回步骤201,否则执行步骤204;Step 203: The first switching device judges whether the active transmission port has received the detection data frame sent by the second transmission device in four consecutive cycles after the current cycle, and if so, returns to step 201, otherwise executes step 204;
步骤204:第一交换设备触发关闭主用设备端口,同时触发启用第一交换设备的备用设备端口;Step 204: the first switching device triggers to shut down the active device port, and at the same time triggers to enable the standby device port of the first switching device;
步骤205:第一交换设备在当前周期内未检测到主用设备端口的电信号,则触发关闭主用传输端口;Step 205: the first switching device does not detect the electrical signal of the port of the active device within the current cycle, triggering the shutdown of the active transmission port;
步骤206:第一交换设备连续两个周期检测到备用设备端口的电信号,触发第一交换设备通过备用传输端口传输业务数据帧;Step 206: The first switching device detects the electrical signal of the port of the backup device for two consecutive cycles, and triggers the first switching device to transmit the service data frame through the backup transmission port;
步骤207:第一交换设备触发备用传输端口周期向第二交换设备发送检测数据帧;并结束本流程。Step 207: The first switching device triggers the standby transmission port to periodically send a detection data frame to the second switching device; and ends this process.
上述实施例中步骤205和步骤206没有严格是时序,可以先执行步骤205,再执行步骤206,也可以步骤205和步骤206同时执行。本实施例中举例的周期长度是本发明实施例中一种优选的周期长度,其他的周期长度也适用于本发明实施例。In the above embodiment, step 205 and step 206 are not strictly in sequence, and step 205 may be executed first, and then step 206 may be executed, or step 205 and step 206 may be executed simultaneously. The period length exemplified in this embodiment is a preferred period length in the embodiment of the present invention, and other period lengths are also applicable to the embodiment of the present invention.
如图3所示,为本发明实施例中一种链路故障恢复的检测方法,该方法包括:As shown in Figure 3, it is a detection method for link failure recovery in the embodiment of the present invention, the method includes:
步骤301:第一交换设备连续5个周期内检测到主用传输端口未接收到第二交换设备发送的检测数据帧,触发关闭主用设备端口;Step 301: The first switching device detects that the active transmission port has not received the detection data frame sent by the second switching device within 5 consecutive cycles, and triggers the shutdown of the active device port;
步骤302:第一交换设备连续两个周期内检测到主用设备端口关闭的信号,触发开启主用设备端口;Step 302: The first switching device detects a signal that the port of the active device is closed for two consecutive cycles, and triggers the port of the active device to be turned on;
步骤303:第一交换设备在当前周期内检测到主用设备端口开启的信号,触发主用传输端口连续5个周期发送检测数据帧;Step 303: The first switching device detects a signal that the port of the active device is turned on in the current cycle, and triggers the active transmission port to send detection data frames for 5 consecutive cycles;
步骤304:第一交换设备检测主用传输端口发送检测数据帧的5个周期内是否接收到第二交换设备发送的检测数据帧,若未接收到,则返回步骤301,否则执行步骤305;Step 304: the first switching device detects whether the detection data frame sent by the second switching device is received within 5 cycles of the detection data frame sent by the main transmission port, if not received, return to step 301, otherwise execute step 305;
步骤305:第一交换设备确定主用链路恢复正常,并通过主用传输端口周期向第二交换设备发送检测数据帧,并结束本流程。Step 305: The first switching device determines that the active link is back to normal, and periodically sends a detection data frame to the second switching device through the active transmission port, and ends the process.
本发明实施例中图2,图3所示的实施例均为主用链路切换至备用链路的过程,本发明中备用链路切换至主用链路的过程与之类似,在此不再赘述;另实施例中设定的周期是本发明实施例中较优的周期长度,其他符合本发明思想的周期长度也适用于本发明,在此不再一一列举。In the embodiment of the present invention, the embodiments shown in Fig. 2 and Fig. 3 are both the process of switching the active link to the standby link. The process of switching the standby link to the active link in the present invention is similar, and will not be described here Further details; the period set in the embodiment is the preferred period length in the embodiment of the present invention, and other period lengths conforming to the concept of the present invention are also applicable to the present invention, and will not be listed here.
基于同一发明构思,本发明实施例中还提供了一种链路自动切换装置,由于该装置解决问题的原理与本发明实施例一种链路自动切换方法相似,因此该装置的实施可以参见方法的实施,重复之处不再赘述。Based on the same inventive concept, an automatic link switching device is also provided in the embodiment of the present invention. Since the problem-solving principle of the device is similar to a link automatic switching method in the embodiment of the present invention, the implementation of the device can be found in the method The implementation of the implementation, the repetition will not repeat them.
如图4所示,为本发明实施例中一种链路自动切换装置,应用于两个交换设备通过主/备用传输端口建立的主/备用链路的自动切换,该装置包括检测单元401,切换单元402:As shown in Figure 4, it is a link automatic switching device in the embodiment of the present invention, which is applied to the automatic switching of the main/standby link established by two switching devices through the main/standby transmission port, the device includes a detection unit 401, Switching unit 402:
检测单元401,用于检测到第一交换设备的主用传输端口连续M个周期未接收到第二交换设备发送的检测数据帧后,确定主用链路故障;其中,第一交换设备和第二交换设备周期向对方发送检测数据帧;M为正整数;检测数据帧是第一交换设备与第二交换设备预先约定的区别于业务数据帧的一种特定数据帧;The detection unit 401 is configured to detect that the active transmission port of the first switching device has not received the detection data frame sent by the second switching device for M consecutive cycles, and determine that the active link is faulty; wherein, the first switching device and the second switching device The second switching device periodically sends a detection data frame to the other party; M is a positive integer; the detection data frame is a specific data frame different from the service data frame agreed in advance by the first switching device and the second switching device;
切换单元402,用于关闭主用链路,启用备用链路工作。The switching unit 402 is configured to close the active link and enable the standby link to work.
检测单元401具体用于,检测第一交换设备的主用传输端口接收的检测数据帧,当检测到第一交换设备的主用传输端口在一个周期内没有接收到检测数据帧,则进入逻辑等待状态,进入逻辑等待状态后,连续M-1个周期检测到主用传输端口未接收到检测数据帧,则确定主用链路出现故障,其中M为正整数。如预先设定连续5个周期检测到第一交换设备的主用传输端口未接收到检测数据帧,则确定主用链路发生故障;检测到当前周期内第一交换设备的主用传输端口未接收到检测数据帧,则进入逻辑等待状态,进入逻辑等待状态后,连续4个周期检测到主用传输端口未接收到检测数据帧,则确定主用链路发生故障。The detection unit 401 is specifically used to detect the detection data frame received by the primary transmission port of the first switching device, and when it is detected that the primary transmission port of the first switching device does not receive the detection data frame within one cycle, enter the logic waiting state, after entering the logical waiting state, if it is detected that the active transmission port does not receive the detection data frame for M-1 consecutive cycles, it is determined that the active link is faulty, where M is a positive integer. If it is preset that the active transmission port of the first switching device does not receive the detection data frame for 5 consecutive cycles, it is determined that the active link has failed; After receiving the detection data frame, it enters the logical waiting state. After entering the logical waiting state, it is detected that the active transmission port does not receive the detection data frame for 4 consecutive cycles, and it is determined that the active link is faulty.
采用连续M个周期检测到第一交换设备的主用传输端口未接收到检测数据帧,则确定主用传输端口对应的链路出现故障,避免了现有技术中交换设备无法自动识别传输设备有电信号但链路异常的情况,缩短了远距离传输系统故障的时间,提高了远距离传输系统的可靠性;同时通过多个周期检测到主用传输端口未接收到检测数据帧,才确定主用链路出现故障,降低了由于网络较差,或网络时延等情况导致主用传输端口接收检测数据帧出现时延,误判主用传输端口对应的链路出现故障的概率。Using continuous M cycles to detect that the primary transmission port of the first switching device does not receive the detection data frame, it is determined that the link corresponding to the primary transmission port is faulty, which avoids the failure of the switching device in the prior art to automatically identify that the transmission device is faulty In case of electrical signal but link abnormality, the failure time of the long-distance transmission system is shortened, and the reliability of the long-distance transmission system is improved; at the same time, it is determined that the main The failure of the active link reduces the probability of misjudging that the link corresponding to the active transmission port is faulty due to the delay in receiving the detection data frame at the active transmission port due to poor network or network delay.
每一交换设备具有与主/备用传输端口一一对应的主/备用设备端口。Each switching device has a primary/standby device port corresponding to a primary/standby transmission port one-to-one.
切换单元402具体用于:确定第一交换设备的主用链路出现故障,触发关闭主用传输端口对应的主用设备端口,同时对第一交换设备的备用设备端口进行上电处理。触发关闭第一交换设备的主用设备端口后,主用设备端口不再输出电信号,在连续N个周期没有检测到第一交换设备的主用设备端口的电信号,则触发开启第一交换设备的备用设备端口;同时第一交换设备触发启用第一交换设备的备用传输端口传输业务数据帧,并通过备用传输端口周期向第二交换设备发送检测数据帧;其中,N为正整数。The switching unit 402 is specifically configured to: determine that the primary link of the first switching device fails, trigger shutdown of the primary device port corresponding to the primary transmission port, and simultaneously power on the backup device port of the first switching device. After triggering to close the active device port of the first switching device, the active device port no longer outputs electrical signals, and if no electrical signal is detected from the active device port of the first switching device for N consecutive cycles, the first switching device is triggered to be turned on. The backup device port of the device; at the same time, the first switching device triggers the activation of the backup transmission port of the first switching device to transmit service data frames, and periodically sends detection data frames to the second switching device through the backup transmission port; wherein, N is a positive integer.
切换单元402还用于,触发主用设备端口连续关闭X个周期之后,触发开启主用设备端口;检测单元401连续Y个周期检测到主用设备端口的电信号,触发第一交换设备的主用传输端口连续M个周期向第二交换设备发送检测数据帧;检测单元401检测到连续M个周期内主用传输端口未接收到第二交换设备发送的检测数据帧,切换单元402触发关闭第一交换设备的主用设备端口,并返回触发主用设备端口连续关闭X个周期步骤;检测单元401检测到连续M个周期内主用传输端口接收到第二交换设备发送的检测数据帧,则确定主用链路恢复,触发第一交换设备的主用传输端口周期向第二交换设备发送检测数据帧;其中,X,Y,M均为正整数,且X不小于N。The switching unit 402 is also used to trigger the opening of the port of the master device after triggering the port of the master device to be closed continuously for X cycles; the detection unit 401 detects the electrical signal of the port of the master device for Y consecutive cycles, and triggers the master port of the first switching device Use the transmission port to send the detection data frame to the second switching device for M consecutive cycles; the detection unit 401 detects that the primary transmission port has not received the detection data frame sent by the second switching device for M consecutive cycles, and the switching unit 402 triggers the shutdown of the second switching device. A main device port of the switching device, and return to trigger the step of closing the main device port continuously for X cycles; the detection unit 401 detects that the detection data frame sent by the second switching device is received by the main transmission port in M consecutive cycles, then Determine the recovery of the active link, and trigger the active transmission port of the first switching device to periodically send a detection data frame to the second switching device; where X, Y, and M are all positive integers, and X is not less than N.
如检测单元401连续5个周期内检测到主用传输端口未接收到第二交换设备发送的检测数据帧,则确定主用链路故障,切换单元402触发关闭主用设备端口;检测单元401在一个周期内未检测到主用设备端口的电信号,切换单元402触发启用备用设备端口;第一交换设备连接的设备检测到主用设备端口没有电信号,则将业务数据帧通过备用设备端口发送至第一交换设备,第一交换设备将业务数据帧从备用设备端口转发至备用传输端口,通过备用传输端口将业务数据帧发送至第二交换设备。检测单元401连续两个周期未检测到主用传输端口的电信号,切换单元402触发开启主用设备端口;检测单元401检测到主用设备端口的电信号,则触发第一主用传输端口连续5个周期向第二交换设备发送检测数据帧,若在这5个周期内,检测单元401检测主用传输端口未接收到第二交换设备发送的检测数据帧,则返回主用设备端口连续关闭连个周期的步骤;若在这5个周期内,检测单元401检测主用传输端口接收到第二交换设备发送的检测数据帧,则确定主用链路恢复正常,触发主用传输端口周期向第二设备发送检测数据帧;以便于备用链路出现故障时,切换回主用链路。If the detection unit 401 detects that the primary transmission port has not received the detection data frame sent by the second switching device within 5 consecutive cycles, then it is determined that the primary link is faulty, and the switching unit 402 triggers to close the port of the primary device; If the electrical signal of the active device port is not detected within one cycle, the switching unit 402 triggers the activation of the standby device port; the device connected to the first switching device detects that there is no electrical signal at the active device port, and then sends the service data frame through the standby device port To the first switching device, the first switching device forwards the service data frame from the backup device port to the backup transmission port, and sends the service data frame to the second switching device through the backup transmission port. The detection unit 401 does not detect the electrical signal of the main transmission port for two consecutive cycles, and the switching unit 402 triggers to open the main equipment port; the detection unit 401 detects the electrical signal of the main equipment port, then triggers the first main transmission port to continue Send detection data frames to the second switching device for 5 cycles, if within these 5 cycles, the detection unit 401 detects that the primary transmission port has not received the detection data frame sent by the second switching device, then return to the primary device port and continue to close The steps of consecutive cycles; if within these 5 cycles, the detection unit 401 detects that the primary transmission port receives the detection data frame sent by the second switching device, then it is determined that the primary link returns to normal, and triggers the primary transmission port to periodically send The second device sends a detection data frame so as to switch back to the active link when the standby link fails.
较佳地,切换单元402还用于:检测到主用链路故障恢复,且备用电路故障后,切换回所述主用链路工作。Preferably, the switching unit 402 is further configured to switch back to work on the active link after detecting that the active link fails and the standby circuit fails.
检测单元401,连续L个周期检测到备用传输端口未接收到第二交换设备发送的检测数据帧,确定备用链路故障;切换单元402触发备用设备端口停止接收业务数据帧,并触发关闭第一交换设备的备用设备端口;检测单元401连续P个周期未检测到备用设备端口的电信号,切换单元402触发启用第一交换设备的主用设备端口;触发启用第一交换设备的主用传输端口传输业务数据帧,并通过备用传输端口周期向第二交换设备发送检测数据帧;其中,L,P均为正整数。The detection unit 401 detects that the standby transmission port has not received the detection data frame sent by the second switching device for L consecutive periods, and determines that the standby link is faulty; the switching unit 402 triggers the standby device port to stop receiving service data frames, and triggers to close the first The backup device port of the switching device; the detection unit 401 does not detect the electrical signal of the backup device port for P consecutive cycles, and the switching unit 402 triggers the activation of the primary device port of the first switching device; triggers the activation of the primary transmission port of the first switching device The service data frame is transmitted, and the detection data frame is periodically sent to the second switching device through the standby transmission port; wherein, L and P are both positive integers.
其中切换单元402还用于:触发备用设备端口连续关闭Z个周期,触发开启备用设备端口;检测单元401连续Q个周期检测到备用设备端口的电信号,触发第一交换设备的备用传输端口连续L个周期向第二交换设备发送检测数据帧;检测单元401检测到连续L个周期内备用传输端口未接收到第二交换设备发送的检测数据帧,切换单元402触发关闭第一交换设备的备用设备端口,并返回触发备用设备端口连续关闭Z个周期;检测单元401检测到连续L个周期内备用传输端口接收到第二交换设备发送的检测数据帧,则确定备用链路恢复,触发第一交换设备的备用传输端口周期向第二交换设备发送检测数据帧;其中,Z,L,Q均为正整数,且Z不小于P。Wherein the switching unit 402 is also used to: trigger the standby equipment port to be closed continuously for Z periods, and trigger to open the standby equipment port; the detection unit 401 detects the electrical signal of the standby equipment port for Q consecutive periods, and triggers the standby transmission port of the first switching equipment to continuously L cycles send the detection data frame to the second switching device; the detection unit 401 detects that the standby transmission port has not received the detection data frame sent by the second switching device in consecutive L cycles, and the switching unit 402 triggers off the backup of the first switching device device port, and return to trigger the backup device port to be closed continuously for Z cycles; the detection unit 401 detects that the backup transmission port receives the detection data frame sent by the second switching device in consecutive L cycles, then determines that the backup link is restored, and triggers the first The standby transmission port of the switching device periodically sends the detection data frame to the second switching device; wherein, Z, L, and Q are all positive integers, and Z is not less than P.
如检测单元401连续5个周期内检测到备用传输端口未接收到第二交换设备发送的检测数据帧,确定备用链路故障;切换单元402触发备用设备端口停止接收业务数据帧,并触发关闭第一交换设备的备用设备端口;检测单元401在一个周期内未检测到备用设备端口的电信号,切换单元402触发启用主用设备端口;第一交换设备连接的设备检测到备用设备端口没有电信号,则将业务数据帧通过主用设备端口发送至第一交换设备,第一交换设备将业务数据帧从主用设备端口转发至主用传输端口,通过主用传输端口将业务数据帧发送至第二交换设备;检测单元401连续两个周期未检测到备用传输端口的电信号,切换单元402触发开启备用设备端口,检测单元401检测到备用设备端口的电信号,则触发第一备用传输端口连续5个周期向第二交换设备发送检测数据帧,若在这5个周期内,检测单元401检测备用传输端口未接收到第二交换设备发送的检测数据帧,则返回备用设备端口连续关闭两个周期;若在这5个周期内,检测单元401检测备用传输端口接收到第二交换设备发送的检测数据帧,则确定备用链路恢复正常,触发备用传输端口周期向第二设备发送检测数据帧;以便于主用链路出现故障时,切换回备用链路。If the detection unit 401 detects that the standby transmission port has not received the detection data frame sent by the second switching device for 5 consecutive cycles, it is determined that the backup link is faulty; A backup device port of a switching device; the detection unit 401 does not detect the electrical signal of the backup device port within one cycle, and the switching unit 402 triggers to enable the main device port; the device connected to the first switching device detects that the backup device port has no electrical signal , the service data frame is sent to the first switching device through the port of the active device, the first switching device forwards the service data frame from the port of the active device to the active transmission port, and sends the service data frame to the first switching device through the active transmission port Two switching equipment; the detection unit 401 does not detect the electrical signal of the standby transmission port for two consecutive cycles, the switching unit 402 triggers to open the standby equipment port, and the detection unit 401 detects the electrical signal of the standby equipment port, then triggers the first standby transmission port to continue Send detection data frames to the second switching device for 5 cycles, if within these 5 cycles, the detection unit 401 detects that the standby transmission port has not received the detection data frame sent by the second switching device, then returns to the standby device port and closes two consecutive period; if within these 5 periods, the detection unit 401 detects that the standby transmission port receives the detection data frame sent by the second switching device, then it is determined that the standby link is back to normal, and the standby transmission port is triggered to periodically send the detection data frame to the second device ; In order to switch back to the standby link when the active link fails.
本发明实施例中,当通过主用链路发送业务数据帧,且备用链路没有发生故障时,备用连路通过备用传输端口周期向第二交换设备发送检测数据帧,以确定备用链路当前未发生故障;当通过备用链路发送业务数据帧,且主用链路没有发生故障时,主用连路通过主用传输端口周期向第二交换设备发送检测数据帧,以确定主用链路当前未发生故障;以便于当第一交换设备中的一个链路发生故障时,能够使用另一条没有故障的链路。In the embodiment of the present invention, when the service data frame is sent through the active link and the standby link does not fail, the standby link periodically sends a detection data frame to the second switching device through the standby transmission port to determine the current status of the standby link. No fault occurs; when the service data frame is sent through the standby link and the active link is not faulty, the active link periodically sends detection data frames to the second switching device through the active transmission port to determine the active link There is currently no failure; so that when a link in the first switching device fails, another link without failure can be used.
较佳地,第一交换设备连接的设备检测到主用设备端口没有电信号,则自动停止向主用设备端口发送业务数据帧,通过备用设备端口向第一交换设备发送业务数据帧。Preferably, when the device connected to the first switching device detects that there is no electrical signal at the port of the active device, it automatically stops sending service data frames to the port of the active device, and sends service data frames to the first switching device through the port of the standby device.
第一交换设备通过主用传输端口接收第二交换设备发送的业务数据帧,将接收到的业务数据帧发送至主用设备端口,第一交换设备通过主用设备端口将业务数据帧发送至第一交换设备连接的设备。第一交换设备检测到主用设备端口接收到连接的设备发送的业务数据帧,将该业务数据帧发送至主用传输端口,第一交换设备通过主用传输端口将该业务数据帧发送至第二交换设备。The first switching device receives the service data frame sent by the second switching device through the primary transmission port, and sends the received service data frame to the port of the primary device, and the first switching device sends the service data frame to the port of the primary device through the port of the primary device. A switching device is connected to the device. The first switching device detects that the port of the active device receives the service data frame sent by the connected device, and sends the service data frame to the active transmission port, and the first switching device sends the service data frame to the second through the active transmission port. Two switching devices.
切换单元还用于:触发主用设备端口停止接收业务数据帧之后,触发启用第一交换设备的备用传输端口传输业务数据帧之前,检测到主用传输端口接收到第二交换设备侧发送的业务数据帧,将业务数据帧从主用传输端口转发至主用设备端口,通过主用设备端口对业务数据帧进行发送处理。The switching unit is also used for: after triggering the port of the active device to stop receiving the service data frame, before triggering the standby transmission port of the first switching device to transmit the service data frame, detecting that the active transmission port has received the service sent by the second switching device The data frame forwards the service data frame from the main transmission port to the main equipment port, and sends and processes the service data frame through the main equipment port.
较佳地,本发明实施例中根据IEEE802.3协议,在经过物理层和逻辑链路层的处理之后,包含在数据帧中的数据将被传递给在类型段中指定的高层协议。虽然以太网协议中并没有明确作出补齐规定,但是以太网帧中数据帧的长度最小应当不低于46个字节,以保证802.3协议的数据帧长最大值1518字节,最小值64字节。Preferably, according to the IEEE802.3 protocol in the embodiment of the present invention, after being processed by the physical layer and the logical link layer, the data included in the data frame will be delivered to the high-level protocol specified in the type field. Although the Ethernet protocol does not explicitly specify the completion requirement, the minimum length of the data frame in the Ethernet frame should not be less than 46 bytes, so as to ensure that the maximum data frame length of the 802.3 protocol is 1518 bytes, and the minimum value is 64 bytes. Festival.
为减少转发量,本发明实施例中的检测数据帧长度设置为46个字节,加上检测数据帧的前导码、界定符、类型、校验码等字段,刚好达到以太网数据帧的最小长度64字节。本发明中的46个字节的检测数据帧可以采用以下格式:“1111000011110000…”或者“0xF0F0F0F0F0F0F0F0F0…”。上述实施例中举例的检测数据帧是本发明实施例中一种较有的检测数据帧的格式,其他格式的检测数据帧同样适用于本发明。In order to reduce the amount of forwarding, the detection data frame length in the embodiment of the present invention is set to 46 bytes, plus fields such as the preamble, delimiter, type, check code of the detection data frame, just reach the minimum of the Ethernet data frame The length is 64 bytes. The detection data frame of 46 bytes in the present invention can adopt the following format: "1111000011110000..." or "0xF0F0F0F0F0F0F0F0F0...". The detection data frame exemplified in the above embodiment is a relatively common format of the detection data frame in the embodiment of the present invention, and detection data frames in other formats are also applicable to the present invention.
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention also intends to include these modifications and variations.
Claims (14)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410019427.6A CN104796329B (en) | 2014-01-16 | 2014-01-16 | A kind of link automatic switching method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410019427.6A CN104796329B (en) | 2014-01-16 | 2014-01-16 | A kind of link automatic switching method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104796329A true CN104796329A (en) | 2015-07-22 |
CN104796329B CN104796329B (en) | 2017-11-28 |
Family
ID=53560853
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410019427.6A Active CN104796329B (en) | 2014-01-16 | 2014-01-16 | A kind of link automatic switching method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104796329B (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105099825A (en) * | 2015-08-17 | 2015-11-25 | 北京神州绿盟信息安全科技股份有限公司 | Security protection method and device for external Bypass |
CN106656311A (en) * | 2016-12-15 | 2017-05-10 | 国网山东省电力公司长岛县供电公司 | Data link backup apparatus and method |
CN110545566A (en) * | 2019-09-11 | 2019-12-06 | 腾讯科技(深圳)有限公司 | link switching method, device, equipment and storage medium |
CN110768848A (en) * | 2019-10-31 | 2020-02-07 | 杭州迪普科技股份有限公司 | Method and device for switching main server and standby server |
CN110943998A (en) * | 2019-12-04 | 2020-03-31 | 腾讯科技(深圳)有限公司 | Signal transmission method, device, equipment and medium |
WO2020258744A1 (en) * | 2019-06-28 | 2020-12-30 | 京信通信系统(中国)有限公司 | Main and standby link switching method and device, and digital switch |
CN113395726A (en) * | 2021-06-21 | 2021-09-14 | 迈普通信技术股份有限公司 | Backup link detection method and device |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107872822B (en) * | 2016-09-23 | 2020-05-26 | 大唐移动通信设备有限公司 | Service bearing method and device |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1984039A (en) * | 2006-04-23 | 2007-06-20 | 华为技术有限公司 | Fast re-routing method for shared multi-port transmitting link |
CN101026798A (en) * | 2007-03-12 | 2007-08-29 | 华为技术有限公司 | Iub interface business transmission method and device based on IP transmission |
CN101170459A (en) * | 2007-11-28 | 2008-04-30 | 中兴通讯股份有限公司 | Failure detection and link recovery method based on bidirectional forward link |
CN101212408A (en) * | 2006-12-29 | 2008-07-02 | 中兴通讯股份有限公司 | Switching system in load sharing mode and port-level protection switching method |
CN102664702A (en) * | 2012-04-05 | 2012-09-12 | 烽火通信科技股份有限公司 | Protection mode of cross disc of M to N |
US20130259056A1 (en) * | 2012-03-27 | 2013-10-03 | Juniper Networks, Inc. | Oam label switched path for fast reroute of protected label switched paths |
-
2014
- 2014-01-16 CN CN201410019427.6A patent/CN104796329B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1984039A (en) * | 2006-04-23 | 2007-06-20 | 华为技术有限公司 | Fast re-routing method for shared multi-port transmitting link |
CN101212408A (en) * | 2006-12-29 | 2008-07-02 | 中兴通讯股份有限公司 | Switching system in load sharing mode and port-level protection switching method |
CN101026798A (en) * | 2007-03-12 | 2007-08-29 | 华为技术有限公司 | Iub interface business transmission method and device based on IP transmission |
CN101170459A (en) * | 2007-11-28 | 2008-04-30 | 中兴通讯股份有限公司 | Failure detection and link recovery method based on bidirectional forward link |
US20130259056A1 (en) * | 2012-03-27 | 2013-10-03 | Juniper Networks, Inc. | Oam label switched path for fast reroute of protected label switched paths |
CN102664702A (en) * | 2012-04-05 | 2012-09-12 | 烽火通信科技股份有限公司 | Protection mode of cross disc of M to N |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105099825A (en) * | 2015-08-17 | 2015-11-25 | 北京神州绿盟信息安全科技股份有限公司 | Security protection method and device for external Bypass |
CN105099825B (en) * | 2015-08-17 | 2018-10-02 | 北京神州绿盟信息安全科技股份有限公司 | A kind of safeguard method and device of external Bypass |
CN106656311A (en) * | 2016-12-15 | 2017-05-10 | 国网山东省电力公司长岛县供电公司 | Data link backup apparatus and method |
WO2020258744A1 (en) * | 2019-06-28 | 2020-12-30 | 京信通信系统(中国)有限公司 | Main and standby link switching method and device, and digital switch |
CN110545566A (en) * | 2019-09-11 | 2019-12-06 | 腾讯科技(深圳)有限公司 | link switching method, device, equipment and storage medium |
CN110768848A (en) * | 2019-10-31 | 2020-02-07 | 杭州迪普科技股份有限公司 | Method and device for switching main server and standby server |
CN110943998A (en) * | 2019-12-04 | 2020-03-31 | 腾讯科技(深圳)有限公司 | Signal transmission method, device, equipment and medium |
CN113395726A (en) * | 2021-06-21 | 2021-09-14 | 迈普通信技术股份有限公司 | Backup link detection method and device |
CN113395726B (en) * | 2021-06-21 | 2023-02-17 | 迈普通信技术股份有限公司 | Backup link detection method and device |
Also Published As
Publication number | Publication date |
---|---|
CN104796329B (en) | 2017-11-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104796329B (en) | A kind of link automatic switching method and device | |
US10708132B2 (en) | Technique for handling a status change in an interconnect node | |
CN106487679B (en) | Active-standby switching system and switching method of Ethernet switch | |
CN104301146A (en) | Link switching method and device in software defined network | |
US20090199040A1 (en) | Method and device for implementing link pass through in point-to-multipoint network | |
CN103401696A (en) | Dual-network redundant communication system in industrial equipment and communication method thereof | |
KR20150088559A (en) | Method and apparatus for restoring failure of network | |
CN103684835A (en) | Link fault reporting method and processing method, and transmission node and primary node | |
CN105429814B (en) | Method and equipment for protecting BFD (bidirectional forwarding detection) by using multiple board cards | |
WO2015188553A1 (en) | Link backup and power source backup method, device and system, and storage medium | |
EP3029883B1 (en) | Network protection method and apparatus, next-ring node, and system | |
CN103227725A (en) | Method and device for dual-server backup of firewall | |
CN102932183B (en) | Double-up link failure processing method and device | |
WO2016095344A1 (en) | Link switching method and device, and line card | |
CN104901834A (en) | Method and system for automatically switching between network servers | |
CN107026780A (en) | A kind of distribution optical fiber ring network fault point positioning method and system based on Internet of Things | |
RU2536370C2 (en) | Network and expansion unit and network operation method | |
CN101163059B (en) | Network node detection method and apparatus | |
CN105516252A (en) | TCP (Transmission Control Protocol) connection switching method, apparatus and system | |
CN106330699B (en) | Multicast link switching method and device and routing equipment | |
CN105721232A (en) | Method and device for implementing link detection | |
CN105703967A (en) | Method and apparatus for detecting label switching path connectivity | |
CN102638369B (en) | Method, device and system for arbitrating main/standby switch | |
KR102032898B1 (en) | Method for remote power control using power over ethernet line and the apparatus thereof | |
CN101958812B (en) | Link failure detection method and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
EXSB | Decision made by sipo to initiate substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |