CN104579757B - A kind of method and apparatus for detecting failure - Google Patents
A kind of method and apparatus for detecting failure Download PDFInfo
- Publication number
- CN104579757B CN104579757B CN201410804184.7A CN201410804184A CN104579757B CN 104579757 B CN104579757 B CN 104579757B CN 201410804184 A CN201410804184 A CN 201410804184A CN 104579757 B CN104579757 B CN 104579757B
- Authority
- CN
- China
- Prior art keywords
- router
- identity
- detection
- message
- response
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 36
- 238000001514 detection method Methods 0.000 claims abstract description 185
- 230000005540 biological transmission Effects 0.000 claims abstract description 49
- 230000004044 response Effects 0.000 claims description 105
- 230000008439 repair process Effects 0.000 abstract description 3
- 238000010586 diagram Methods 0.000 description 11
- 238000004891 communication Methods 0.000 description 9
- 238000013507 mapping Methods 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 230000008859 change Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 230000004397 blinking Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明实施例提供一种用于检测故障的方法和装置,所述方法包括:第一路由器获得检测请求,所述检测请求包括第二路由器的身份标识;所述第一路由器获得所述第一路由器进行报文传输的对端路由器的身份标识;所述第一路由器确定所述第二路由器是否为所述对端路由器;如果所述第二路由器不是所述对端路由器,所述第一路由器进行故障预警。如此方案,不仅有助于保证报文传输的正确性,还有助于提高网络故障定位与修复的效率。
Embodiments of the present invention provide a method and device for detecting faults, the method includes: a first router obtains a detection request, and the detection request includes the identity of the second router; the first router obtains the first The identity of the peer router for message transmission by the router; the first router determines whether the second router is the peer router; if the second router is not the peer router, the first router Carry out fault warning. Such a solution not only helps to ensure the correctness of message transmission, but also helps to improve the efficiency of network fault location and repair.
Description
技术领域technical field
本发明涉及通信技术领域,具体涉及一种用于检测故障的方法和装置。The invention relates to the field of communication technology, in particular to a method and device for detecting faults.
背景技术Background technique
通常,路由器之间的点对点物理链路,少有通过光纤直连,大多通过传输设备进行连接。举例来说,传输设备可以为波分设备。根据实际应用,可能会对传输设备之间的链路进行合并、分解、交叉等调整,对于这种链路调整,路由器是无法自动感知的,因此路由器不会改变报文的传输路径,这就导致报文无法被转发到既定目的地。Usually, point-to-point physical links between routers are rarely directly connected through optical fibers, and most of them are connected through transmission equipment. For example, the transmission device may be a wavelength division device. According to the actual application, the links between the transmission devices may be adjusted by merging, splitting, crossing, etc. For this link adjustment, the router cannot automatically perceive it, so the router will not change the transmission path of the message, which is As a result, packets cannot be forwarded to the intended destination.
参见图1所示网络,路由器R1与路由器R2之间通过传输设备S1、S2进行连接。链路调整前,S1配置的转发规则为:经入端口1进入的报文,从出端口2转出,S2配置的转发规则为:经入端口3进入的报文,从出端口4转出;经入端口5进入的报文,从出端口6转出。对应于此,R1与R2之间的报文的传输路径为:R1、S112、S234、R2。其中,S112表示报文经S1的入端口1进入,且经S1的出端口2转出;S134表示报文经S2的入端口3进入,且经S2的出端口4转出。若在实际应用中,需要调整S1与S2之间的链路,举例来说,可调整S1配置的转发规则,实现链路调整。若调整后,S1配置的转发规则为:经入端口1进入的报文,从出端口7转出。对应于此,若R1不改变报文的传输路径,仍向S1的入端口1发送报文,则报文经S117和S256后到达路由器R3,而R3并非本次报文转发的既定目的路由器,致使报文传输出错。Referring to the network shown in FIG. 1, router R1 and router R2 are connected through transmission devices S1 and S2. Before the link adjustment, the forwarding rule configured on S1 is: packets entering through ingress port 1 are forwarded out through outbound port 2, and the forwarding rule configured on S2 is: packets entering through ingress port 3 are forwarded out through outbound port 4 ; Packets that come in through port 5 are forwarded out through port 6. Correspondingly, the transmission path of the message between R1 and R2 is: R1, S1 12 , S2 34 , R2. Among them, S1 12 indicates that the message enters through the inbound port 1 of S1 and is transferred out through the outbound port 2 of S1; S1 34 indicates that the message enters through the inbound port 3 of S2 and is forwarded out through the outbound port 4 of S2. If in practical applications, the link between S1 and S2 needs to be adjusted, for example, the forwarding rules configured on S1 can be adjusted to implement link adjustment. After the adjustment, the forwarding rule configured on S1 is as follows: Packets entering through inbound port 1 are forwarded out through outbound port 7. Correspondingly, if R1 does not change the transmission path of the message, but still sends the message to the ingress port 1 of S1, the message will reach the router R3 after going through S1 17 and S2 56 , but R3 is not the intended purpose of this message forwarding Routers, resulting in packet transmission errors.
发明内容Contents of the invention
本发明实施例提供的用于检测故障的方法和装置,有助于保证报文传输的正确性。The method and device for detecting faults provided by the embodiments of the present invention help to ensure the correctness of message transmission.
为此,本发明实施例提供如下技术方案:For this reason, the embodiment of the present invention provides following technical scheme:
第一方面,提供了一种用于检测故障的方法,所述方法包括:In a first aspect, a method for detecting a fault is provided, the method comprising:
第一路由器获得检测请求,所述检测请求包括第二路由器的身份标识;The first router obtains a detection request, where the detection request includes the identity of the second router;
所述第一路由器获得所述第一路由器进行报文传输的对端路由器的身份标识;The first router obtains the identity of the peer router for which the first router transmits the message;
所述第一路由器确定所述第二路由器是否为所述对端路由器;The first router determines whether the second router is the peer router;
如果所述第二路由器不是所述对端路由器,所述第一路由器进行故障预警。If the second router is not the peer router, the first router performs fault warning.
结合第一方面,在第一方面的第一种可能的实现方式中,所述检测请求为配置请求报文,所述检测请求包括第一选项字段,所述第一选项字段用于携带所述第二路由器的身份标识;With reference to the first aspect, in a first possible implementation manner of the first aspect, the detection request is a configuration request message, the detection request includes a first option field, and the first option field is used to carry the the identity of the second router;
所述检测响应为配置响应报文,所述检测响应包括第二选项字段,所述第二选项字段用于携带所述第一路由器的身份标识。The detection response is a configuration response message, and the detection response includes a second option field, and the second option field is used to carry the identity of the first router.
结合第一方面,在第一方面的第二种可能的实现方式中,所述检测请求为回应请求报文,所述检测请求包括第一选项字段,所述第一选项字段用于携带所述第二路由器的身份标识;With reference to the first aspect, in a second possible implementation manner of the first aspect, the detection request is a response request message, and the detection request includes a first option field, and the first option field is used to carry the the identity of the second router;
所述检测响应为回应响应报文,所述检测响应包括第二选项字段,所述第二选项字段用于携带所述第一路由器的身份标识。The detection response is a response message, and the detection response includes a second option field, and the second option field is used to carry the identity of the first router.
结合第一方面或第一方面的第一种或第二种可能的实现方式,在第一方面的第三种可能的实现方式中,所述方法还包括:In combination with the first aspect or the first or second possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect, the method further includes:
如果所述第二路由器为所述对端路由器,所述第一路由器向所述第二路由器发送检测响应,所述检测响应包括所述第一路由器的身份标识。If the second router is the peer router, the first router sends a detection response to the second router, where the detection response includes the identity of the first router.
第二方面,提供了一种用于检测故障的方法,所述方法包括:In a second aspect, a method for detecting a fault is provided, the method comprising:
第二路由器向第一路由器发送检测请求,所述检测请求包括所述第二路由器的身份标识;the second router sends a detection request to the first router, where the detection request includes the identity of the second router;
所述第二路由器确定是否获得所述第一路由器发送的检测响应;The second router determines whether to obtain the detection response sent by the first router;
如果未获得所述第一路由器发送的检测响应,所述第二路由器进行故障预警。If the detection response sent by the first router is not obtained, the second router performs fault warning.
结合第二方面,在第二方面的第一种可能的实现方式中,所述检测响应包括所述第一路由器的身份标识,所述方法还包括:With reference to the second aspect, in a first possible implementation manner of the second aspect, the detection response includes the identity of the first router, and the method further includes:
如果获得所述第一路由发送的检测响应,所述第二路由器获得所述第二路由器进行报文传输的对端路由器的身份标识;If the detection response sent by the first router is obtained, the second router obtains the identity of the peer router for packet transmission by the second router;
所述第二路由器确定所述第一路由器是否为所述对端路由器;The second router determines whether the first router is the peer router;
如果所述第一路由器不是所述对端路由器,所述第二路由器进行故障预警。If the first router is not the peer router, the second router performs fault warning.
第三方面,提供了一种用于检测故障的装置,所述装置包括:In a third aspect, a device for detecting a fault is provided, the device comprising:
检测请求获得单元,用于获得检测请求,所述检测请求包括第二路由器的身份标识;A detection request obtaining unit, configured to obtain a detection request, where the detection request includes the identity of the second router;
身份标识获得单元,用于获得所述第一路由器进行报文传输的对端路由器的身份标识;an identity identification obtaining unit, configured to obtain the identity identification of the peer router for message transmission by the first router;
确定单元,用于确定所述第二路由器是否为所述对端路由器;a determining unit, configured to determine whether the second router is the peer router;
预警单元,用于在所述确定单元确定所述第二路由器不是所述对端路由器时,进行故障预警。The early warning unit is configured to perform a fault early warning when the determining unit determines that the second router is not the peer router.
结合第三方面,在第三方面的第一种可能的实现方式中,所述装置还包括:With reference to the third aspect, in a first possible implementation manner of the third aspect, the device further includes:
发送单元,用于在所述确定单元确定所述第二路由器为所述对端路由器时,向所述第二路由器发送检测响应,所述检测响应包括所述第一路由器的身份标识。A sending unit, configured to send a detection response to the second router when the determining unit determines that the second router is the peer router, the detection response including the identity of the first router.
第四方面,提供了一种用于检测故障的装置,所述装置包括:In a fourth aspect, a device for detecting a fault is provided, the device comprising:
发送单元,用于向第一路由器发送检测请求,所述检测请求包括第二路由器的身份标识;a sending unit, configured to send a detection request to the first router, where the detection request includes the identity of the second router;
第一确定单元,用于确定是否获得所述第一路由器发送的检测响应;a first determining unit, configured to determine whether to obtain a detection response sent by the first router;
第一预警单元,用于在所述第一确定单元确定未获得所述第一路由器发送的检测响应时,进行故障预警。The first early warning unit is configured to, when the first determination unit determines that the detection response sent by the first router has not been obtained, perform a failure early warning.
结合第四方面,在第四方面的第一种可能的实现方式中,所述检测响应包括所述第一路由器的身份标识,所述装置还包括:With reference to the fourth aspect, in a first possible implementation manner of the fourth aspect, the detection response includes the identity of the first router, and the device further includes:
获得单元,用于在所述第一确定单元确定获得所述第一路由发送的检测响应时,获得所述第二路由器进行报文传输的对端路由器的身份标识;An obtaining unit, configured to obtain the identity of the peer router for message transmission by the second router when the first determining unit determines to obtain the detection response sent by the first route;
第二确定单元,用于确定所述第一路由器是否为所述对端路由器;a second determining unit, configured to determine whether the first router is the peer router;
第二预警单元,用于在所述第二确定单元确定所述第一路由器不是所述对端路由器时,进行故障预警。The second early warning unit is configured to perform fault early warning when the second determination unit determines that the first router is not the peer router.
第五方面,提供了一种用于检测故障的设备,所述设备包括:处理器和存储器;In a fifth aspect, a device for detecting a fault is provided, the device comprising: a processor and a memory;
所述存储器,用于存储程序指令和数据;The memory is used to store program instructions and data;
所述处理器,用于读取所述存储器中存储的程序指令和数据,执行以下操作:The processor is configured to read program instructions and data stored in the memory, and perform the following operations:
所述处理器获得检测请求,所述检测请求包括第二路由器的身份标识;The processor obtains a detection request, where the detection request includes the identity of the second router;
所述处理器获得所述设备进行报文传输的对端路由器的身份标识;The processor obtains the identity of the peer router for message transmission by the device;
所述处理器确定所述第二路由器是否为所述对端路由器;the processor determines whether the second router is the peer router;
如果所述第二路由器不是所述对端路由器,所述处理器进行故障预警。If the second router is not the peer router, the processor performs fault pre-warning.
第六方面,提供了一种用于检测故障的设备,所述设备包括:处理器和存储器;In a sixth aspect, a device for detecting a fault is provided, the device comprising: a processor and a memory;
所述存储器,用于存储程序指令和数据;The memory is used to store program instructions and data;
所述处理器,用于读取所述存储器中存储的程序指令和数据,执行以下操作:The processor is configured to read program instructions and data stored in the memory, and perform the following operations:
所述处理器向第一路由器发送检测请求,所述检测请求包括所述设备的身份标识;The processor sends a detection request to the first router, where the detection request includes the identity of the device;
所述处理器确定是否获得所述第一路由器发送的检测响应;The processor determines whether to obtain a detection response sent by the first router;
如果未获得所述第一路由器发送的检测响应,所述处理器进行故障预警。If the detection response sent by the first router is not obtained, the processor performs fault warning.
本发明实施例的用于检测故障的方法和装置,第一路由器获得第二路由器发送的检测请求,并根据检测请求中携带的第二路由器的身份标识,确定第二路由器是否为第一路由器传输报文的对端路由器,如果第二路由器并非第一路由器传输报文的对端路由器,第一路由器则可向网络管理员进行预警,提示第一路由器与第二路由器之间的网络出现故障。这样,不仅有助于保证报文传输的正确性,还有助于提高网络故障定位与修复的效率。In the method and device for detecting faults in the embodiments of the present invention, the first router obtains the detection request sent by the second router, and determines whether the second router is the first router to transmit the fault according to the identity of the second router carried in the detection request. The peer router of the message, if the second router is not the peer router of the first router to transmit the message, the first router can give an early warning to the network administrator, prompting that the network between the first router and the second router is faulty. In this way, it not only helps to ensure the correctness of message transmission, but also helps to improve the efficiency of network fault location and repair.
附图说明Description of drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请中记载的一些实施例,对于本领域普通技术人员来讲,还可以根据这些附图获得其它的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments described in this application, and those skilled in the art can also obtain other drawings based on these drawings.
图1是一种网络示意图;Figure 1 is a schematic diagram of a network;
图2是本发明实施例用于检测故障的方法的一种流程图;Fig. 2 is a kind of flowchart of the method for detecting fault of the embodiment of the present invention;
图3是本发明实施例用于检测故障的方法的另一种流程图;FIG. 3 is another flow chart of a method for detecting a fault according to an embodiment of the present invention;
图4是本发明实施例中选项字段的一种编码格式的示意图;FIG. 4 is a schematic diagram of an encoding format of an option field in an embodiment of the present invention;
图5是本发明实施例中选项字段的另一种编码格式的示意图;Fig. 5 is a schematic diagram of another encoding format of the option field in the embodiment of the present invention;
图6是本发明实施例用于检测故障的装置的一种示意图;FIG. 6 is a schematic diagram of a device for detecting faults according to an embodiment of the present invention;
图7是本发明实施例用于检测故障的装置的另一种示意图;FIG. 7 is another schematic diagram of a device for detecting faults according to an embodiment of the present invention;
图8是本发明实施例用于检测故障的设备的硬件构成示意图。FIG. 8 is a schematic diagram of a hardware configuration of a device for detecting faults according to an embodiment of the present invention.
具体实施方式Detailed ways
为了使本技术领域的人员更好地理解本发明方案,下面结合附图和实施方式对本发明实施例作进一步的详细说明。In order to enable those skilled in the art to better understand the solution of the present invention, the embodiments of the present invention will be further described in detail below in conjunction with the accompanying drawings and implementation manners.
参见图2,示出了本发明实施例用于检测故障的方法,可包括:Referring to FIG. 2 , it shows a method for detecting a fault according to an embodiment of the present invention, which may include:
101,第一路由器获得检测请求,所述检测请求包括第二路由器的身份标识。101. The first router obtains a detection request, where the detection request includes the identity of the second router.
102,所述第一路由器获得所述第一路由器进行报文传输的对端路由器的身份标识。102. The first router obtains the identity of the peer router for packet transmission by the first router.
103,所述第一路由器确定所述第二路由器是否为所述对端路由器。103. The first router determines whether the second router is the peer router.
104,如果所述第二路由器不是所述对端路由器,所述第一路由器进行故障预警。104. If the second router is not the peer router, the first router performs a fault warning.
通常,第一路由器与第二路由器利用点对点协议(英文:Point-to-PointProtocol,简称:PPP)、高级数据链路控制(英文:High-Level Data Link Control,简称:HDLC)等链路层协议,建立连接后,第二路由器会定时向第一路由器发送保持连接的Keepalive,如果能接收到确认字符(英文:Acknowledgement,简称:ACK),第二路由器则认为其与第一路由器之间的连接正常。也就是说,第二路由器只要确认其发出的报文能够得到回应,则认为第二路由器与第一路由器之间的连接正常。参见图1所举示例,调整链路前,R1发送的Keepalive被转发至R2,若R2接收到Keepalive并向R1响应ACK,R1则会判定R1与R2之间的连接正常。调整链路后,R1发送的Keepalive则被转发至R3,若R3接收到Keepalive并向R1响应ACK,R1同样会判定R1与R2之间的连接正常。另外,如果链路调整后,R2可以接收到其它路由器发送的Keepalive,则R2也可向所述其它路由器响应ACK,并据此判定R1与R2之间的连接正常。Usually, the first router and the second router use link layer protocols such as Point-to-Point Protocol (English: Point-to-Point Protocol, abbreviated: PPP) and advanced data link control (English: High-Level Data Link Control, abbreviated: HDLC). , after the connection is established, the second router will regularly send Keepalives to the first router to keep the connection. normal. That is to say, the second router considers that the connection between the second router and the first router is normal as long as it confirms that the message sent by it can be responded to. Referring to the example in Figure 1, before the link is adjusted, the Keepalive sent by R1 is forwarded to R2. If R2 receives the Keepalive and responds with an ACK to R1, R1 will determine that the connection between R1 and R2 is normal. After the link is adjusted, the Keepalive sent by R1 is forwarded to R3. If R3 receives the Keepalive and responds to R1 with an ACK, R1 will also determine that the connection between R1 and R2 is normal. In addition, if after link adjustment, R2 can receive the Keepalive sent by other routers, then R2 can also respond ACK to the other routers, and accordingly determine that the connection between R1 and R2 is normal.
由上述介绍可知,进行报文传输的两个路由器,在本端发出的报文可以得到回应,或者能收到对端发送的报文,即判定所述两个路由器之间的报文传输路径正常,若以此为基础进行报文传输,就可能导致报文传输错误。From the above introduction, it can be seen that the two routers that transmit the message can get a response to the message sent by the local end, or can receive the message sent by the opposite end, that is, determine the message transmission path between the two routers Normal, if the message is transmitted based on this, it may cause message transmission error.
对上述问题,本发明实施例在进行故障检测时,发送端路由器向接收端路由器发送的检测请求中,可携带发送端路由器的身份标识,对应地,接收端路由器获得检测请求后,可利用本发明实施例方案进行处理,以确认二者之间的传输路径上是否存在错接的链路。举例来说,接收端路由器可以为第一路由器,发送端路由器可以为第二路由器,路由器的身份标识可以为路由器的设备标识和/或路由器的端口标识,其中,路由器的设备标识可以为路由器的名字和/或地址,路由器的端口标识可以为路由器的端口号和/或端口地址。For the above problems, in the embodiment of the present invention, when performing fault detection, the detection request sent by the router at the sending end to the router at the receiving end may carry the identity of the router at the sending end. Correspondingly, after the router at the receiving end obtains the detection request, it can use this The solution of the embodiment of the invention performs processing to confirm whether there is a wrongly connected link on the transmission path between the two. For example, the router at the receiving end may be a first router, the router at the sending end may be a second router, and the identity identifier of the router may be the device identifier of the router and/or the port identifier of the router, wherein the device identifier of the router may be the router's name and/or address, the port identifier of the router may be the port number and/or port address of the router.
具体地,第一路由器可以获得报文传输的对端路由器的身份标识,并利用所述对端路由器的身份标识与所述检测请求中的第一路由器的身份标识,进行比对,并根据比对结果做如下处理:Specifically, the first router may obtain the identity of the peer router for packet transmission, and use the identity of the peer router to compare with the identity of the first router in the detection request, and perform a comparison based on the identity of the peer router. Do the following with the result:
(1)如果二者不一致,第一路由器则可判定报文传输的路径故障,即,第二路由器发送的报文不可被正确转发至既定目的地,即第一路由器。对应于此,第一路由器便可进行故障预警,提示网络管理员第一路由器与第二路由器之间的网络出现故障,不仅有助于保证报文传输的正确性,还有助于提高网络故障定位与修复的效率。(1) If the two are inconsistent, the first router may determine that the path for message transmission is faulty, that is, the message sent by the second router cannot be correctly forwarded to the predetermined destination, that is, the first router. Corresponding to this, the first router can perform a fault warning, prompting the network administrator that the network between the first router and the second router has a fault, which not only helps to ensure the correctness of message transmission, but also helps to improve network faults. Locating and repairing efficiency.
(2)如果二者一致,第一路由器则可判定报文传输的路径正常,即,第二路由器发送的报文可以被转发至既定目的地,即第一路由器。(2) If the two are consistent, the first router can determine that the packet transmission path is normal, that is, the packet sent by the second router can be forwarded to the predetermined destination, that is, the first router.
举例来说,第一路由器可在本地保存报文传输的对端路由器的身份标识,如此,第一路由器获得检测请求后,可在本地读取所述对端路由器的身份标识。可选地,第一路由器可能用于转发多个报文,对应地,第一路由器可在本地保存多条映射关系,每条映射关系用于表示一个报文与相应对端路由器的身份标识之间的对应关系,如此,第一路由器获得检测请求后,可根据待转发的报文,在本地读取所述对端路由器的身份标识。For example, the first router may locally save the identity of the peer router for message transmission, so that after obtaining the detection request, the first router may locally read the identity of the peer router. Optionally, the first router may be used to forward multiple packets. Correspondingly, the first router may store multiple mapping relationships locally, and each mapping relationship is used to represent the relationship between a packet and the identity of the corresponding peer router. In this way, after the first router obtains the detection request, it can locally read the identity of the peer router according to the message to be forwarded.
可选地,对端路由器的身份标识、映射关系等,还可保存在能与第一路由器通信的其它设备,第一路由器获得检测请求后,可访问所述其它设备,获得所述对端路由器的身份标识。本发明实施例对第一路由器获得对端路由器的身份标识的方式不做具体限定。Optionally, the identity, mapping relationship, etc. of the peer router can also be stored in other devices capable of communicating with the first router. After the first router obtains the detection request, it can access the other devices to obtain the peer router of identity. The embodiment of the present invention does not specifically limit the manner in which the first router obtains the identity of the peer router.
举例来说,第一路由器进行故障预警可以为以下方式中的至少一种:以显示方式进行故障预警、以声音方式进行故障预警、以灯光方式进行故障预警。举例来说,第一路由器可以文字方式显示第一路由器与第二路由器之间存在故障;或者,第一路由器可以语音方式播报第一路由器与第二路由器之间存在故障;或者,第一路由器可以闪烁方式提示第一路由器与第二路由器之间存在故障。本发明实施例对故障告警方式可不做具体限定。For example, the first router may perform fault pre-warning in at least one of the following manners: a fault pre-warning by display, a fault pre-warning by sound, and a fault pre-warning by light. For example, the first router can display in text that there is a fault between the first router and the second router; or, the first router can announce that there is a fault between the first router and the second router in a voice mode; or, the first router can The blinking mode indicates that there is a fault between the first router and the second router. The embodiment of the present invention may not specifically limit the fault alarm manner.
可选地,第一路由器确定第二路由器为对端路由器,第一路由器可采用以下两种方式处理:Optionally, the first router determines that the second router is the peer router, and the first router can handle it in the following two ways:
(1)第一路由器生成检测响应,反馈至第二路由器,对应地,第二路由器接收到检测响应,即可确定第一路由器与第二路由器之间的链路正常,可正确进行报文传输。(1) The first router generates a detection response and feeds it back to the second router. Correspondingly, after receiving the detection response, the second router can determine that the link between the first router and the second router is normal, and the message can be transmitted correctly. .
(2)第一路由器生成携带有第一路由器的身份标识的检测响应,反馈至第二路由器,对应地,第二路由器接收到检测响应后,可通过所述检测响应中的第一路由器的身份标识,确定第一路由器是否为第二路由器进行报文传输的对端路由器,如果是,第二路由器确定第一路由器与第二路由器之间的链路正常,可正确进行报文传输;如果否,第二路由器确定第一路由器与第二路由器之间的链路故障。(2) The first router generates a detection response carrying the identity of the first router, and feeds it back to the second router. Correspondingly, after the second router receives the detection response, it can pass the identity of the first router in the detection response to ID, to determine whether the first router is the peer router for the second router to transmit packets, if yes, the second router determines that the link between the first router and the second router is normal, and can correctly transmit packets; if not , the second router determines that the link between the first router and the second router is faulty.
参见图3,示出了本发明实施例用于检测故障的方法,可包括:Referring to FIG. 3 , it shows a method for detecting a fault according to an embodiment of the present invention, which may include:
201,第二路由器向第一路由器发送检测请求,所述检测请求包括所述第二路由器的身份标识。201. The second router sends a detection request to the first router, where the detection request includes the identity of the second router.
202,所述第二路由器确定是否获得所述第一路由器发送的检测响应。202. The second router determines whether to obtain a detection response sent by the first router.
203,如果未获得所述第一路由器发送的检测响应,所述第二路由器进行故障预警。203. If the detection response sent by the first router is not obtained, the second router performs a fault warning.
本发明实施例中,除第一路由器可按照图2所示方案,进行故障检测之外,第二路由器亦可根据第一路由器的反馈,进行故障检测。如上文所做介绍,如果第一路由器确定链路存在故障,会进行故障预警,也就是说,第二路由器若接收不到第一路由器反馈的检测响应,便可确定二者之间的链路存在故障;若接收到第一路由器反馈的检测响应,便可确定二者之间的链路正常。In the embodiment of the present invention, in addition to the first router performing fault detection according to the solution shown in FIG. 2 , the second router may also perform fault detection according to the feedback from the first router. As mentioned above, if the first router determines that the link is faulty, it will perform a fault warning. That is to say, if the second router does not receive the detection response fed back by the first router, it can determine the link between the two. There is a fault; if a detection response fed back by the first router is received, it can be determined that the link between the two is normal.
可选地,为了进一步提高本发明实施例故障检测的准确性,第一路由器向第二路由器反馈的检测响应中还可包括第一路由器的身份标识,对应于此,第二路由器可做如下处理:如果获得所述第一路由发送的检测响应,所述第二路由器获得所述第二路由器进行报文传输的对端路由器的身份标识;所述第二路由器确定所述第一路由器是否为所述对端路由器;如果所述第一路由器不是所述对端路由器,所述第二路由器进行故障预警。也就是说,在接收到第一路由器反馈的检测响应后,第二路由器还可通过检测响应中携带的第一路由器的身份标识、第二路由器进行报文传输的对端路由器的身份标识,确定二者是否一致,如果一致,第二路由器则确定第二路由器与第一路由器之间的链路正常,可正确进行报文传输;如果不一致,第二路由器则确定第二路由器与第一路由器之间的链路故障。Optionally, in order to further improve the accuracy of fault detection in the embodiment of the present invention, the detection response fed back by the first router to the second router may also include the identity of the first router. Correspondingly, the second router may perform the following processing : if the detection response sent by the first router is obtained, the second router obtains the identity of the peer router for message transmission by the second router; the second router determines whether the first router is the the peer router; if the first router is not the peer router, the second router performs fault warning. That is to say, after receiving the detection response fed back by the first router, the second router can also determine the identity of the router through the identity of the first router carried in the detection response and the identity of the peer router for packet transmission by the second router. Whether the two are consistent, if they are consistent, the second router will determine that the link between the second router and the first router is normal, and the message can be transmitted correctly; if not, the second router will determine that the link between the second router and the first router is link failure.
可选地,本发明实施例可应用于链路建立阶段,即,第一路由器与第二路由器之间尝试建立用于传输第一报文的链路时,可利用本发明实施例确定第一报文能否在二者之间正确转发。参见图1所举示例,检测过程可体现为:Optionally, this embodiment of the present invention can be applied to the link establishment phase, that is, when trying to establish a link for transmitting the first packet between the first router and the second router, the embodiment of the present invention can be used to determine the first Whether packets can be correctly forwarded between the two. Referring to the example shown in Figure 1, the detection process can be embodied as:
1.R1通过S1的入端口1向R2发送检测请求,检测请求中携带有R1的IP地址。可选地,检测请求可以为一条专用于故障检测的报文,或者检测请求可以为配置请求(英文:Configure-Request)报文。也就是说,本发明实施例可以基于PPP定义的Configure-Request报文,扩展其中的选项(英文:options)字段,获得检测请求。即,所述检测请求中包括扩展出的第一选项字段,所述第一选项字段用于携带所述第二路由器的身份标识。1. R1 sends a detection request to R2 through ingress port 1 of S1, and the detection request carries the IP address of R1. Optionally, the detection request may be a message dedicated to fault detection, or the detection request may be a configuration request (English: Configure-Request) message. That is to say, in this embodiment of the present invention, based on the Configure-Request message defined by PPP, the options (English: options) field therein may be expanded to obtain the detection request. That is, the detection request includes an extended first option field, where the first option field is used to carry the identity of the second router.
2.如果在链路调整前尝试建立链路连接,R1发送的检测请求,经S112和S234被送达至R2。2. If an attempt is made to establish a link connection before link adjustment, the detection request sent by R1 is delivered to R2 via S1 12 and S2 34 .
3.R2接收到检测请求后,从本地获得传输第一报文的对端路由器的身份标识,即,获得R1的IP地址,该对端路由器的身份标识与检测请求中携带的身份标识一致,故,R2确定R1与R2之间可以正确传输第一报文。如此,R2可生成检测响应反馈至R1,检测响应中携带有R2的IP地址。可选地,检测响应可以为一条专用于故障反馈的报文,或者检测响应可以为配置响应(英文:Configure-ACK)报文。也就是说,本发明实施例可以基于PPP定义的Configure-ACK报文,扩展其中的选项(英文:options)字段,获得检测响应。即,所述检测响应中包括扩展出的第二选项字段,所述第二选项字段用于携带所述第一路由器的身份标识。举例来说,Configure-Request报文和Configure-ACK报文中,扩展出的选项字段的编码格式可体现为图4所示示意图。3. After R2 receives the detection request, it obtains the identity of the peer router that transmits the first message locally, that is, obtains the IP address of R1, and the identity of the peer router is consistent with the identity carried in the detection request. Therefore, R2 determines that the first packet can be correctly transmitted between R1 and R2. In this way, R2 can generate a detection response to feed back to R1, and the detection response carries the IP address of R2. Optionally, the detection response may be a message dedicated to fault feedback, or the detection response may be a configuration response (English: Configure-ACK) message. That is to say, in this embodiment of the present invention, based on the Configure-ACK message defined by PPP, the options (English: options) field therein may be extended to obtain a detection response. That is, the detection response includes an extended second option field, where the second option field is used to carry the identity of the first router. For example, in the Configure-Request message and the Configure-ACK message, the encoding format of the extended option field can be embodied as a schematic diagram shown in FIG. 4 .
4.R1接收到R2反馈的检测响应后,通过检测响应中携带的身份标识,可以确定R1与R2之间能正确传输第一报文,故,可建立R1与R2之间的链路连接,进行第一报文的传输。4. After receiving the detection response fed back by R2, R1 can confirm that the first message can be correctly transmitted between R1 and R2 through the identification carried in the detection response. Therefore, the link connection between R1 and R2 can be established. Perform the transmission of the first packet.
5.如果在链路调整后尝试建立链路连接,R1发送的检测请求,经S117和S256被送达至R3。5. If an attempt is made to establish a link connection after link adjustment, the detection request sent by R1 is sent to R3 via S1 17 and S2 56 .
6.R3接收到检测请求后,从本地获得传输第一报文的对端路由器的身份标识,如,获得路由器R4的IP地址,该对端路由器的身份标识与检测请求中携带的身份标识不一致,故,R3确定R1与R3之间存在错接的链路,不可正确传输第一报文。如此,R3可生成检测响应反馈至R1,检测响应中携带有R3的IP地址。可选地,检测响应可以为一条专用于故障反馈的报文,或者检测响应可以为Configure-ACK报文,对此可参照上文所做介绍,此处不再详述。可选地,R3可以文字方式向网络管理员进行故障告警。6. After R3 receives the detection request, it obtains the identity of the peer router that transmits the first message locally, such as obtaining the IP address of router R4, and the identity of the peer router is inconsistent with the identity carried in the detection request , therefore, R3 determines that there is a wrongly connected link between R1 and R3, and the first message cannot be transmitted correctly. In this way, R3 can generate a detection response to feed back to R1, and the detection response carries the IP address of R3. Optionally, the detection response may be a message dedicated to fault feedback, or the detection response may be a Configure-ACK message, which can be referred to above, and will not be described in detail here. Optionally, R3 can send a fault alarm to the network administrator in text.
7.R1接收到R3反馈的检测响应后,通过检测响应中携带的身份标识,可以确定R1与R2之间存在错接的链路,即,基于目前的报文传输路径,不可将第一报文送达至既定目的地,暂不建立R1与R2之间的链路连接。可选地,R1还可以文字方式向网络管理员进行故障告警。可选地,R1还可重新计算传输路径,以实现第一报文在R1与R2之间的正确传输。7. After receiving the detection response fed back by R3, R1 can determine that there is a wrongly connected link between R1 and R2 through the identification carried in the detection response, that is, based on the current packet transmission path, the first packet cannot be The document is delivered to the predetermined destination, and the link connection between R1 and R2 is not established for the time being. Optionally, R1 can also send a fault alarm to the network administrator in text. Optionally, R1 may also recalculate the transmission path, so as to realize correct transmission of the first packet between R1 and R2.
可选地,本发明实施例可应用于链路维护阶段,即,第一路由器与第二路由器之间建立用于传输第一报文的链路后,可利用本发明实施例确定第一报文能否继续在二者之间正确转发。参见图1所举示例,检测过程可体现为:Optionally, this embodiment of the present invention can be applied to the link maintenance phase, that is, after a link for transmitting the first message is established between the first router and the second router, the embodiment of the present invention can be used to determine the first message Whether the text can continue to be forwarded correctly between the two. Referring to the example shown in Figure 1, the detection process can be embodied as:
1.R1通过S1的入端口1向R2发送检测请求,检测请求中携带有R1的IP地址。可选地,检测请求可以为一条专用于故障检测的报文,或者检测请求可以为回应请求(英文:Echo-Request)报文。也就是说,本发明实施例可以基于PPP定义的Echo-Request报文,扩展其中的选项(英文:options)字段,获得检测请求。即,所述检测请求中包括扩展出的第一选项字段,所述第一选项字段用于携带所述第二路由器的身份标识。1. R1 sends a detection request to R2 through ingress port 1 of S1, and the detection request carries the IP address of R1. Optionally, the detection request may be a message dedicated to fault detection, or the detection request may be an echo request (English: Echo-Request) message. That is to say, in the embodiment of the present invention, based on the Echo-Request message defined by PPP, the options (English: options) field therein may be expanded to obtain the detection request. That is, the detection request includes an extended first option field, where the first option field is used to carry the identity of the second router.
2.在链路调整前,R1发送的检测请求,经S112和S234被送达至R2。参照上文所做介绍,R2接收到检测请求,并确定基于目前的报文传输路径,第一报文仍可被转发至既定目的地,故,R2可生成携带有R2的IP地址的检测响应,并反馈至R1。可选地,检测响应可以为一条专用于故障反馈的报文,或者检测响应可以为回应响应(英文:Echo-Reply)报文。也就是说,本发明实施例可以基于PPP定义的Echo-Reply报文,扩展其中的选项(英文:options)字段,获得检测响应。即,所述检测响应中包括扩展出的第二选项字段,所述第二选项字段用于携带所述第一路由器的身份标识。举例来说,Echo-Request报文和Echo-Reply报文中,扩展出的选项字段的编码格式可体现为图5所示示意图。2. Before link adjustment, the detection request sent by R1 is delivered to R2 via S1 12 and S2 34 . Referring to the introduction above, R2 receives the detection request and determines that based on the current packet transmission path, the first packet can still be forwarded to the intended destination, so R2 can generate a detection response carrying R2’s IP address , and fed back to R1. Optionally, the detection response may be a message dedicated to fault feedback, or the detection response may be an echo response (English: Echo-Reply) message. That is to say, the embodiment of the present invention can expand the option (English: options) field in the Echo-Reply message defined by PPP to obtain the detection response. That is, the detection response includes an extended second option field, where the second option field is used to carry the identity of the first router. For example, in the Echo-Request message and the Echo-Reply message, the encoding format of the extended option field can be embodied as a schematic diagram shown in FIG. 5 .
3.参照上文所做介绍,R1接收到R2反馈的检测响应,并确定基于目前的报文传输路径,第一报文仍可被转发至既定目的地,R1可继续维持与R2之间的链路连接,并利用该链路进行第一报文的传输。3. Referring to the introduction above, R1 receives the detection response fed back by R2, and determines that based on the current packet transmission path, the first packet can still be forwarded to the intended destination, and R1 can continue to maintain the communication with R2. The link is connected, and the link is used to transmit the first packet.
4.在链路调整后,R1发送的检测请求,经S117和S256被送达至R3。参照上文所做介绍,R3接收到检测请求,并确定R1与R3之间存在错接的链路,R3并非第一报文转发的既定目的地,故,R3可生成携带有R3的IP地址的检测响应,并反馈至R1。可选地,检测响应可以为一条专用于故障反馈的报文,或者检测响应可以为Echo-Reply报文,对此可参照上文所做介绍,此处不再详述。可选地,R3可以文字方式向网络管理员进行故障告警。4. After the link adjustment, the detection request sent by R1 is delivered to R3 via S1 17 and S2 56 . Referring to the introduction above, R3 receives the detection request and determines that there is a wrong link between R1 and R3, and R3 is not the intended destination for forwarding the first message, so R3 can generate an IP address carrying R3 The detection response is fed back to R1. Optionally, the detection response may be a message dedicated to fault feedback, or the detection response may be an Echo-Reply message, which can be referred to above, and will not be described in detail here. Optionally, R3 can send a fault alarm to the network administrator in text.
5.参照上文所做介绍,R1接收到R3反馈的检测响应,并确定基于目前的报文传输路径,第一报文不可被转发至既定目的地,即,R1与R2之间存在错接的链路,R1可撤销与R2之间的链路连接。可选地,R1还可以文字方式向网络管理员进行故障告警。可选地,R1还可重新计算传输路径,并利用重新计算的传输路径,实现第一报文在R1与R2之间的正确传输。5. Referring to the introduction above, R1 receives the detection response fed back by R3, and determines that based on the current packet transmission path, the first packet cannot be forwarded to the intended destination, that is, there is a wrong connection between R1 and R2 link, R1 can revoke the link connection with R2. Optionally, R1 can also send a fault alarm to the network administrator in text. Optionally, R1 may also recalculate the transmission path, and use the recalculated transmission path to implement correct transmission of the first message between R1 and R2.
对应地,本发明实施例还提供了一种用于检测故障的装置,所述用于检测故障的装置可执行图2对应的实施例提供的方法。参见图6所示示意图,所述装置可包括:Correspondingly, an embodiment of the present invention also provides a device for detecting a fault, and the device for detecting a fault can execute the method provided in the embodiment corresponding to FIG. 2 . Referring to the schematic diagram shown in Figure 6, the device may include:
检测请求获得单元301,用于获得检测请求,所述检测请求包括第二路由器的身份标识;A detection request obtaining unit 301, configured to obtain a detection request, where the detection request includes the identity of the second router;
身份标识获得单元302,用于获得所述第一路由器进行报文传输的对端路由器的身份标识;An identity identification obtaining unit 302, configured to obtain the identity identification of the peer router for message transmission by the first router;
确定单元303,用于确定所述第二路由器是否为所述对端路由器;A determining unit 303, configured to determine whether the second router is the peer router;
预警单元304,用于在所述确定单元确定所述第二路由器不是所述对端路由器时,进行故障预警。The early warning unit 304 is configured to perform a failure early warning when the determining unit determines that the second router is not the peer router.
综上,本发明实施例用于检测故障的装置,便可在第一路由器进行报文传输的对端路由器,与检测报文携带的第二路由器不一致时,提示网络管理员第一路由器与第二路由器之间的网络出现故障,如此,不仅有助于保证报文传输的正确性,还有助于提高网络故障定位与修复的效率。To sum up, the device for detecting faults in this embodiment of the present invention can prompt the network administrator when the opposite router that the first router transmits a message to is inconsistent with the second router carried in the detection message. If the network between the two routers fails, this not only helps to ensure the correctness of message transmission, but also helps to improve the efficiency of network fault location and repair.
可选地,所述检测请求为配置请求报文,所述检测请求包括第一选项字段,所述第一选项字段用于携带所述第二路由器的身份标识;Optionally, the detection request is a configuration request message, the detection request includes a first option field, and the first option field is used to carry the identity of the second router;
所述检测响应为配置响应报文,所述检测响应包括第二选项字段,所述第二选项字段用于携带所述第一路由器的身份标识。The detection response is a configuration response message, and the detection response includes a second option field, and the second option field is used to carry the identity of the first router.
可选地,所述检测请求为回应请求报文,所述检测请求包括第一选项字段,所述第一选项字段用于携带所述第二路由器的身份标识;Optionally, the detection request is a response request message, the detection request includes a first option field, and the first option field is used to carry the identity of the second router;
所述检测响应为回应响应报文,所述检测响应包括第二选项字段,所述第二选项字段用于携带所述第一路由器的身份标识。The detection response is a response message, and the detection response includes a second option field, and the second option field is used to carry the identity of the first router.
可选地,所述装置还包括:Optionally, the device also includes:
发送单元,用于在所述确定单元确定所述第二路由器为所述对端路由器时,向所述第二路由器发送检测响应,所述检测响应包括所述第一路由器的身份标识。A sending unit, configured to send a detection response to the second router when the determining unit determines that the second router is the peer router, the detection response including the identity of the first router.
对应地,本发明实施例还提供了另一种用于检测故障的装置,所述用于检测故障的装置可执行图3对应的实施例提供的方法。参见图7所示示意图,所述装置可包括:Correspondingly, the embodiment of the present invention also provides another device for detecting a fault, and the device for detecting a fault can execute the method provided in the embodiment corresponding to FIG. 3 . Referring to the schematic diagram shown in Figure 7, the device may include:
发送单元401,用于向第一路由器发送检测请求,所述检测请求包括第二路由器的身份标识;A sending unit 401, configured to send a detection request to the first router, where the detection request includes the identity of the second router;
第一确定单元402,用于确定是否获得所述第一路由器发送的检测响应;A first determining unit 402, configured to determine whether to obtain a detection response sent by the first router;
第一预警单元403,用于在所述第一确定单元确定未获得所述第一路由器发送的检测响应时,进行故障预警。The first warning unit 403 is configured to perform a failure warning when the first determination unit determines that the detection response sent by the first router has not been obtained.
可选地,所述检测响应包括所述第一路由器的身份标识,所述装置还包括:Optionally, the detection response includes the identity of the first router, and the device further includes:
获得单元,用于在所述第一确定单元确定获得所述第一路由发送的检测响应时,获得所述第二路由器进行报文传输的对端路由器的身份标识;An obtaining unit, configured to obtain the identity of the peer router for message transmission by the second router when the first determining unit determines to obtain the detection response sent by the first route;
第二确定单元,用于确定所述第一路由器是否为所述对端路由器;a second determining unit, configured to determine whether the first router is the peer router;
第二预警单元,用于在所述第二确定单元确定所述第一路由器不是所述对端路由器时,进行故障预警。The second early warning unit is configured to perform fault early warning when the second determination unit determines that the first router is not the peer router.
对应地,本发明实施例还提供了一种用于检测故障的设备,所述用于检测故障的设备可执行图2或图3对应的实施例提供的方法。参见图8所示示意图,所述用于检测故障的设备500可包括:处理器501、存储器502和通信接口503。其中,处理器501、存储器502和通信接口503可通过通信总线504连接。存储器502用于存储程序,处理器501根据从存储器502中读取的程序所包括的可执行指令执行具体操作。Correspondingly, an embodiment of the present invention further provides a device for detecting a fault, and the device for detecting a fault may execute the method provided in the embodiment corresponding to FIG. 2 or FIG. 3 . Referring to the schematic diagram shown in FIG. 8 , the device 500 for detecting a fault may include: a processor 501 , a memory 502 and a communication interface 503 . Wherein, the processor 501 , the memory 502 and the communication interface 503 may be connected through a communication bus 504 . The memory 502 is used to store programs, and the processor 501 executes specific operations according to executable instructions contained in the programs read from the memory 502 .
可选地,图6中的检测请求获得单元301、身份标识获得单元302、确定单元303和预警单元304可由图8中的处理器501根据存储器502存储的可执行指令实现,处理器501可以包括至少一个物理处理器。Optionally, the detection request obtaining unit 301, the identity identification obtaining unit 302, the determining unit 303 and the early warning unit 304 in FIG. 6 may be implemented by the processor 501 in FIG. At least one physical processor.
需要说明的是,图5所示的用于检测故障的装置和图6所示的用于检测故障的设备可以是同一个装置,可以认为,图5是从逻辑的角度显示了一个用于检测故障的装置包括的内容,而图6则是从物理的角度显示了一个用于检测故障的设备包括的内容。It should be noted that the device for detecting faults shown in Figure 5 and the device for detecting faults shown in Figure 6 may be the same device, it can be considered that Figure 5 shows a device for detecting faults from a logical The content of the faulty device includes, and Figure 6 shows the content of a device for detecting faults from a physical point of view.
所述处理器501,用于读取存储器502中存储的指令和数据,执行以下操作:The processor 501 is configured to read instructions and data stored in the memory 502, and perform the following operations:
所述处理器通过通信接口获得检测请求,所述检测请求包括第二路由器的身份标识;The processor obtains a detection request through a communication interface, where the detection request includes the identity of the second router;
所述处理器获得所述设备进行报文传输的对端路由器的身份标识;The processor obtains the identity of the peer router for message transmission by the device;
所述处理器确定所述第二路由器是否为所述对端路由器;the processor determines whether the second router is the peer router;
如果所述第二路由器不是所述对端路由器,所述处理器进行故障预警。If the second router is not the peer router, the processor performs fault pre-warning.
可选地,所述检测请求为配置请求报文,所述检测请求包括第一选项字段,所述第一选项字段用于携带所述第二路由器的身份标识;Optionally, the detection request is a configuration request message, the detection request includes a first option field, and the first option field is used to carry the identity of the second router;
所述检测响应为配置响应报文,所述检测响应包括第二选项字段,所述第二选项字段用于携带所述设备的身份标识。The detection response is a configuration response message, and the detection response includes a second option field, and the second option field is used to carry the identity of the device.
可选地,所述检测请求为回应请求报文,所述检测请求包括第一选项字段,所述第一选项字段用于携带所述第二路由器的身份标识;Optionally, the detection request is a response request message, the detection request includes a first option field, and the first option field is used to carry the identity of the second router;
所述检测响应为回应响应报文,所述检测响应包括第二选项字段,所述第二选项字段用于携带所述设备的身份标识。The detection response is a response message, and the detection response includes a second option field, and the second option field is used to carry the identity of the device.
可选地,所述处理器还可执行以下操作:Optionally, the processor may also perform the following operations:
如果所述第二路由器为所述对端路由器,所述处理器通过通信接口向所述第二路由器发送检测响应,所述检测响应包括所述设备的身份标识。If the second router is the peer router, the processor sends a detection response to the second router through a communication interface, where the detection response includes the identity of the device.
可选地,图7中的发送单元401、第一确定单元402和第一预警单元403可由图8中的处理器501根据存储器502存储的可执行指令实现,处理器501可以包括至少一个物理处理器。Optionally, the sending unit 401, the first determining unit 402, and the first warning unit 403 in FIG. 7 may be implemented by the processor 501 in FIG. 8 according to executable instructions stored in the memory 502, and the processor 501 may include at least one physical processing device.
需要说明的是,图7所示的用于检测故障的装置和图8所示的用于检测故障的设备可以是同一个装置,可以认为,图7是从逻辑的角度显示了一个用于检测故障的装置包括的内容,而图8则是从物理的角度显示了一个用于检测故障的设备包括的内容。It should be noted that the device for detecting faults shown in Figure 7 and the device for detecting faults shown in Figure 8 may be the same device, it can be considered that Figure 7 shows a device for detecting The content of the faulty device, and Figure 8 shows the content of a device for detecting faults from a physical point of view.
所述处理器501,用于读取存储器502中存储的指令和数据,执行以下操作:The processor 501 is configured to read instructions and data stored in the memory 502, and perform the following operations:
所述处理器通过通信接口向第一路由器发送检测请求,所述检测请求包括所述设备的身份标识;The processor sends a detection request to the first router through the communication interface, and the detection request includes the identity of the device;
所述处理器确定是否获得所述第一路由器发送的检测响应;The processor determines whether to obtain a detection response sent by the first router;
如果未获得所述第一路由器发送的检测响应,所述处理器进行故障预警。If the detection response sent by the first router is not obtained, the processor performs fault warning.
可选地,所述检测响应包括所述第一路由器的身份标识,所述处理器还可执行以下操作:Optionally, the detection response includes the identity of the first router, and the processor may further perform the following operations:
如果获得所述第一路由发送的检测响应,所述处理器获得所述设备进行报文传输的对端路由器的身份标识;If the detection response sent by the first route is obtained, the processor obtains the identity of the peer router through which the device transmits the message;
所述处理器确定所述第一路由器是否为所述对端路由器;the processor determines whether the first router is the peer router;
如果所述第一路由器不是所述对端路由器,所述处理器进行故障预警。If the first router is not the peer router, the processor performs fault pre-warning.
通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到上述实施例方法中的全部或部分可借助软件加通用硬件平台的方式来实现。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者诸如媒体网关等网络通信设备)执行本发明各个实施例或者实施例的某些部分所述的方法。From the above description of the implementation manners, it can be seen that those skilled in the art can clearly understand that all or part of the methods in the above embodiments can be implemented by means of software plus a general hardware platform. Based on this understanding, the essence of the technical solution of the present invention or the part that contributes to the prior art can be embodied in the form of software products, and the computer software products can be stored in storage media, such as ROM/RAM, disk , optical disk, etc., including several instructions to make a computer device (which may be a personal computer, a server, or a network communication device such as a media gateway) execute the methods described in various embodiments or some parts of the embodiments of the present invention.
需要说明的是,本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置及设备实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。以上所描述的设备及系统实施例仅仅是示意性的,其中作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。It should be noted that each embodiment in this specification is described in a progressive manner, the same and similar parts of each embodiment can be referred to each other, and each embodiment focuses on the differences from other embodiments. place. In particular, for the device and device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and for relevant parts, please refer to part of the description of the method embodiments. The device and system embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in One place, or it can be distributed to multiple network elements. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. It can be understood and implemented by those skilled in the art without creative effort.
以上所述仅是本发明的可选实施方式,并非用于限定本发明的保护范围。应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以作出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above descriptions are only optional implementations of the present invention, and are not intended to limit the protection scope of the present invention. It should be pointed out that those skilled in the art can make some improvements and modifications without departing from the principle of the present invention, and these improvements and modifications should also be regarded as the protection scope of the present invention.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410804184.7A CN104579757B (en) | 2014-12-19 | 2014-12-19 | A kind of method and apparatus for detecting failure |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410804184.7A CN104579757B (en) | 2014-12-19 | 2014-12-19 | A kind of method and apparatus for detecting failure |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104579757A CN104579757A (en) | 2015-04-29 |
CN104579757B true CN104579757B (en) | 2018-09-07 |
Family
ID=53095022
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410804184.7A Active CN104579757B (en) | 2014-12-19 | 2014-12-19 | A kind of method and apparatus for detecting failure |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104579757B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106533938A (en) * | 2016-11-01 | 2017-03-22 | 上海斐讯数据通信技术有限公司 | Wireless router having service protection function and working method thereof |
CN112887166B (en) * | 2021-01-18 | 2023-04-18 | 深圳市思桅电子有限公司 | Detection method and system for SD card of mobile terminal, intelligent terminal and storage medium |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7765306B2 (en) * | 2006-01-30 | 2010-07-27 | Cisco Technology, Inc. | Technique for enabling bidirectional forwarding detection between edge devices in a computer network |
CN101252528B (en) * | 2008-04-14 | 2011-04-13 | 华为技术有限公司 | Method and apparatus for detecting malfunction |
CN101360017A (en) * | 2008-09-02 | 2009-02-04 | 中兴通讯股份有限公司 | Access network opposite-end equipment detection method and apparatus |
CN102624584B (en) * | 2012-03-01 | 2018-02-23 | 中兴通讯股份有限公司 | Chain circuit detecting method and device |
-
2014
- 2014-12-19 CN CN201410804184.7A patent/CN104579757B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN104579757A (en) | 2015-04-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP2725743B1 (en) | Methods and device for processing location information about fault point | |
CN103401726B (en) | Network path detection method and device, system | |
CN102833109B (en) | Positional information processing method and equipment of fault point | |
WO2015180559A1 (en) | Fault detection method and apparatus for service chain | |
CN101610535B (en) | Method, system and device for ensuring BFD conversation stability on the scene of multilink direct connection | |
EP3232611B1 (en) | Method, device and system for performing bidirectional forwarding detection on an aggregated link | |
CN102571601B (en) | A method for ensuring the reliability of bidirectional forwarding detection and label switching path equipment | |
CN102780635B (en) | The method of pretection switch, TOR switch and system is realized based on TRILL network | |
CN102571492B (en) | Method and device for detecting failure of routing equipment | |
WO2017054547A1 (en) | Bidirectional forwarding detection method and apparatus | |
CN104065508A (en) | Application service health check method, device and system | |
WO2013189414A2 (en) | Automatic network topology acquisition method and system, and network query and management system | |
US20170272339A1 (en) | Method and apparatus for detecting connectivity | |
US20200044964A1 (en) | Defect detection in ip/mpls network tunnels | |
WO2014117475A1 (en) | Method for establishing general router encapsulation tunnel, communication device and communication system | |
CN101771604A (en) | Routing detection method, system and intermediate routing device | |
CN104579757B (en) | A kind of method and apparatus for detecting failure | |
CN102769552A (en) | Method and apparatus for transmitting BFD (bidirectional forwarding detection) message during LSP (label switched path) detection by BFD | |
CN101364890B (en) | Method and apparatus for network configuration information verification | |
CN106850328A (en) | Monitor the method and device of routing device | |
CN110661628A (en) | Method, device and system for realizing data multicast | |
JP2006174451A (en) | Method for tracing route in wireless network including multiple nodes and wireless network of nodes configured to trace route | |
WO2016082343A1 (en) | Fault detection method and device | |
CN106789639B (en) | Message processing method and device | |
CN108521336A (en) | A kind of method and device for controlling routing networking IP address conflict |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |