WO2016078240A1 - 一种检测路由成环的方法及装置 - Google Patents

一种检测路由成环的方法及装置 Download PDF

Info

Publication number
WO2016078240A1
WO2016078240A1 PCT/CN2015/072686 CN2015072686W WO2016078240A1 WO 2016078240 A1 WO2016078240 A1 WO 2016078240A1 CN 2015072686 W CN2015072686 W CN 2015072686W WO 2016078240 A1 WO2016078240 A1 WO 2016078240A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
route
tree
subtree
detection
Prior art date
Application number
PCT/CN2015/072686
Other languages
English (en)
French (fr)
Inventor
徐方明
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2016078240A1 publication Critical patent/WO2016078240A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks

Definitions

  • the present invention relates to the technical field of detecting a routing loop, and in particular, to a method and a related device for detecting a routing loop.
  • TTL Transmission Control Protocol/Internet Protocol
  • Routing Information Protocols such as Routing Information Protocol (RIP), Open Shortest Path First (OSPF), and Border Gateway Protocol (BGP) have their own loop detection algorithms to avoid this situation, but The route looping problem in the case of the Rapid Reroute (FRR) nesting and the public network non-direct connection in the Label Distribution Protocol (LDP) tunnel scenario is not solved.
  • RIP Routing Information Protocol
  • OSPF Open Shortest Path First
  • BGP Border Gateway Protocol
  • the primary link is 100.1.1.0/24
  • the next hop is 2.2.2.2 (where 2.2.2.2/32 forms the FRR and forms the FRR nesting)
  • the backup link is 100.1.1.0/24. 3.3.3.3.
  • the Border Gateway Protocol is established between the PE1 and the PE2 through the loopback interface.
  • BGP BGP neighbors
  • the route of 100.1.1.0/242.2.2.2 on PE1 can go through the LDP tunnel, but P1 There is no 100.1.1.0/24 route on it.
  • a method for detecting a route into a ring comprising:
  • the forwarding route corresponding to the subtree has a loop, and the forwarding route is deleted from the forwarding information table.
  • the step of setting the route next hop to detecting the root node of the routing tree, and setting the next hop of detecting the root node of the routing tree to the root node of the subtree of the detection routing tree includes:
  • the route iteration process and the route judgment process are repeatedly performed on the next hop node as the prefix node until the next hop node is found to be the route directly connected to the outbound interface of the peer device.
  • the step of detecting the subtree of detecting the routing tree includes:
  • the node detects the route at the node Detecting whether the node already exists on the path of the root node of the tree;
  • the method further includes:
  • the root node of the detection routing tree is deleted from the forwarding information table.
  • the method further includes:
  • the forwarding route corresponding to the subtree is used as a route for forwarding the data packet, and the route is stopped for loop detection.
  • a device for detecting a route into a ring comprising a tree building module, a detecting module and a processing module, wherein:
  • the tree-building module is configured to: set a route next hop as a root node of the detection routing tree, and set a next hop of the root node of the detection routing tree to be a root node of the subtree of the detection routing tree;
  • the processing module is configured to: when the detecting module detects that there is a duplicate node in the subtree, determine that the forwarding route corresponding to the subtree has a loop, and delete the forwarding route from the forwarding information table.
  • the tree building module is configured to set a routing next hop as a root node of the detection routing tree, and set a next hop of the root node of the detection routing tree to be a root of the subtree of the detection routing tree.
  • the detecting module is configured to detect the subtree of the detection routing tree as follows:
  • the node detects the route at the node
  • the node of the root node of the tree detects whether the node already exists. If the node detects that the node already exists on the path of detecting the root node of the routing tree, it is determined that there is a duplicate node in the subtree.
  • the detecting module is further configured to: when detecting that there are duplicate nodes in the subtree of the detection routing tree, notify the processing module to delete the root node of the detection routing tree from the forwarding information table. ;
  • the processing module is further configured to: delete the root node of the detection routing tree from the forwarding information table.
  • the detecting module is further configured to: find a subtree in the subtree of the detection routing tree that does not have a duplicate node, and notify the processing module to use the forwarding route corresponding to the subtree as a route for forwarding the data packet. And stop routing into loop detection;
  • the processing module is further configured to: use the forwarding route corresponding to the subtree as a route for forwarding the data packet, and stop routing to loop detection.
  • a computer program comprising program instructions which, when executed by a computer, cause the computer to perform any of the above methods of detecting routing.
  • the technical solution of the present invention can perform loop detection on the route in the LDP tunnel scenario in which the FRR nesting of the public network and the non-direct connection of the public network are forwarded, and delete the invalid route in the forwarding information table, thereby ensuring smooth communication. And avoid the waste of network resources.
  • FIG. 1 is a network diagram of a public network route FRR nesting provided by the related art
  • FIG. 2 is a network diagram of a non-directly connected next hop route of an LDP tunnel provided by the related art
  • FIG. 3 is a schematic diagram of a method for detecting a route into a ring according to an embodiment of the present invention
  • FIG. 4 is a block diagram of a device for detecting a route into a ring according to an embodiment of the present invention
  • FIG. 5 is a schematic diagram of a route loop detection algorithm according to an embodiment of the present invention.
  • FIG. 6 is a diagram showing a nested networking diagram of a public network route FRR for loop detection according to an embodiment of the present invention
  • FIG. 7 is a schematic diagram of a specific FIB table routing loop detection process for the networking diagram shown in FIG. 6.
  • FIG. 3 is a schematic diagram of a method for detecting a route into a ring according to an embodiment of the present invention. As shown in FIG. 3, the steps include:
  • Step S101 Set the next hop of the route to detect the root node of the routing tree, and set the next hop of the root node of the detection routing tree to be the root node of the subtree of the detection routing tree.
  • Step 101 includes: performing route iterative processing on the route with the root node of the subtree as a prefix node, finding the next hop node of the prefix node, adding the next hop node to the detection routing tree, and finding the next hop node. Whether the hop node is the peer device directly connected to the outbound interface for routing judgment; if not, the following hop node repeats the route iteration processing and route judgment processing for the prefix node until the next hop node is found to be the peer device directly connected The route of the interface.
  • Iteration is a pathfinding method used for routing addressing.
  • the prefix node address is used as the destination address to find the route to the destination address.
  • Step S201 Detecting a subtree of the detection route tree.
  • the node detects whether the node already exists on the path of detecting the root node of the routing tree, and if it is detected that the node already exists, determining the subtree There are duplicate nodes.
  • Step S301 If it is detected that there is a duplicate node in the subtree, it is determined that the forwarding route corresponding to the subtree has a loop, and the forwarding route is deleted from the forwarding information table.
  • the subtree of the detection routing tree may be sequentially detected. If a subtree that does not have a duplicate node is found in the subtree of the detection routing tree, the forwarding route corresponding to the subtree is used as forwarding. Routing of packets and stopping routing into loop detection. If the subtree of the routing tree is detected If there is a duplicate node, the root node of the detection routing tree is deleted from the forwarding information table.
  • FIG. 4 is a block diagram of a device for detecting a route into a ring according to an embodiment of the present invention. As shown in FIG. 4, the device includes a tree building module 11, a detecting module 21, and a processing module 31.
  • the tree building module 11 is configured to: set a route next hop as a root node of the detection routing tree, and set a next hop of detecting the root node of the routing tree as a root node of the subtree for detecting the routing tree.
  • the tree building module iteratively processes the routing route with the root node of the subtree as a prefix node, finds the next hop node of the prefix node, adds the next hop node to the detection routing tree, and determines whether the found next hop node is
  • the peer device directly connects the outbound interface to perform route judgment processing. If not, the following hop node repeats the route iteration processing and route judgment processing for the prefix node until the next hop node is the route directly connected to the outbound interface of the peer device.
  • the detecting module 21 is configured to detect the subtree of the detection routing tree. Specifically, when the detecting module adds the next hop node to the detection routing tree, the node detects whether the node already exists on the path of detecting the root node of the routing tree, if the node is on the path of detecting the root node of the routing tree. If an existing node is detected, it is determined that there are duplicate nodes in the subtree.
  • the processing module 31 is configured to: when detecting that there are duplicate nodes in the subtree, determine that there is a loop in the forwarding route corresponding to the subtree, and delete the forwarding route in the forwarding information table.
  • the processing module 31 deletes the root node of the detection routing tree from the forwarding information table. If the detection module 21 finds a subtree in the subtree of the detection routing tree that does not have a duplicate node, the processing module 31 uses the forwarding route corresponding to the subtree as a route for forwarding the data packet, and stops routing to loop detection.
  • FIG. 5 is a schematic diagram of a route-to-loop detection algorithm according to an embodiment of the present invention. As shown in FIG. 5, in this embodiment, a route for forwarding an LDP tunnel to a public network route FRR nesting and a public network non-direct connection next to an LDP tunnel is performed.
  • FRR nesting a route for forwarding an LDP tunnel to a public network route FRR nesting and a public network non-direct connection next to an LDP tunnel is performed.
  • the specific algorithm is as follows:
  • next hop the route to be detected as the root, and iterate until the next hop is found to be the route directly connected to the outbound interface of the peer router.
  • the node in this tree may be the prefix "prefix” or the next hop “nexthop”, and the leaf node must be "nexthop".
  • P Prefix in Figure 5
  • N Nexthop.
  • a P node in an iterative path may contain multiple N nodes. As long as one N node is an illegal node, the P node closest to N in the subtree is also illegal. The specific reduction is as follows:
  • Illegal N node The P node closest to the N node in the subtree where the N node is located is also illegal, and is transferred to the illegal P node for processing.
  • Illegal P node The parent node N of the P node tries to find other legal P nodes, that is, the action of the second long match only occurs in the N root node, and the iterative path always matches according to the longest.
  • the longest matching action is to use a route with the longest (most accurate) mask as the matching item and determine the next hop when there are multiple matching next hops in the network. Similarly, the second-length matching action determines that the one with the second mask is determined as the next hop.
  • NH when NH considers the iteration to complete, it finds a forwarding path that does not have a loop. If the iterative result of NH is an illegal path, the NH node considers it to be looped, and sets the invalid route to be deleted from the FIB table.
  • PE1 has a BGP FRR route to 100.1.1.0, and the next hops are 2.2.2.2 and 3.3.3.3. At the same time, there are OSPF FRR routes 2.2.2.2 to PE2, and the next hops are 4.4.4.4 and 5.5.5.5 respectively.
  • FIG. 7 is a schematic diagram of a specific FIB table routing loop detection process for the networking diagram shown in FIG. 6, as shown in FIG. 7, including the following steps:
  • the longest match finds the 2.2.2.2/32 next hop as the two routes 4.4.4.4 and 5.5.5.5, and adds 4.4.4.4 and 5.5.5.5 as the prefix P1 and P2 to the tree. That is to say, from the PE1 side, the next hop of PE2 is 4.4.4.4 and 5.5.5.5.
  • the P node P4 directly connected to the illegal node NH4 is also an illegal node.
  • the parent node NH1 of P4 is not the root node, so the suboptimal matching cannot be performed to find other P points. Therefore, NH1 is an illegal node.
  • the BGP FRR routes that are nested in the FRR are not looped and can be forwarded. If there is no 4.4.4.0/24 route on PE1, the NH suboptimal match cannot find other P nodes. The route forwarding will form a loop and need to be discarded.
  • the embodiment of the invention also discloses a computer program, comprising program instructions, when the program instruction is executed by a computer, so that the computer can perform any of the above methods for detecting routing into loops.
  • the public network routing FRR nesting and the public network non-directing next hop node are in the LDP tunnel scenario, if the iterative result of the next hop node of the to-be-detected route is a legal path, Find a forwarding path that does not have a loop. Otherwise, the node is looped, set the node as an invalid route, and delete it from the FIB table.
  • the technical solution of the present invention can perform loop detection on the route in the LDP tunnel scenario in which the FRR nesting of the public network and the non-direct connection of the public network are forwarded, and delete the invalid route in the forwarding information table, thereby ensuring smooth communication. And avoid the waste of network resources. Therefore, the present invention has strong industrial applicability.

Landscapes

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

Abstract

一种检测路由成环的方法及装置,所述方法包括:设置路由下一跳作为检测路由树的根节点,并设置所述根节点的下一跳作为所述检测路由树的子树的根节点;检测所述检测路由树的子树;若检测到子树中存在重复节点,则确定所述子树对应的转发路由存在环路,并在从转发信息表中删除所述转发路由。本发明技术方案能够在转发面对公网路由FRR嵌套和公网非直连下一跳走LDP隧道场景下的路由进行成环检测,并在转发信息表中删除无效路由,从而保证通信顺畅,并避免网络资源的浪费。

Description

一种检测路由成环的方法及装置 技术领域
本发明涉及检测路由环路的技术领域,特别涉及一种检测路由环路的方法及相关的装置。
背景技术
路由器在传输控制协议/互联网络协议(Transmission Control Protocol/Internet Protocol,TCP/IP)第三层形成环路后,数据包就进了一个死循环直到生存时间(time-to-live,TTL)减为0后被丢弃。其结果是通信中断和网络资源的极度浪费,所有构成路由环路的路由器都在那里做无用功而且负荷极大。
路由信息协议(Routing Information Protocol,RIP)、开放式最短路径优先(Open Shortest Path First,OSPF)、边界网关协议(Border Gateway Protocol,BGP)等协议有自己的环路检测算法来避免上述情况,但解决不了公网路由快速重路由(Fast ReRoute,FRR)嵌套和公网非直连下一跳走标签分发协议(Label Distribution Protocol,LDP)隧道场景下的路由成环问题。
在如图1所示的公网路由FRR嵌套组网中,边缘设备(Provider Edge,PE)1-PE2、PE1-PE3形成FRR,其中PE1-PE2又嵌套了PE1-核心设备(Provider,P)1、PE1-P2的FRR。为了进行外层FRR的双向转发检测(Bidirectional Forwarding Detection,BFD),协议传给转发的转发信息(Fowarding Information Base,FIB)表的是对端原始下一跳,不是实际出接口,也无法保证路由不成环。比如PE1上通过配置静态路由或内部边界网关协议(Internal Border Gateway Protocol,IBGP)路由,形成FRR。其中主链路为100.1.1.0/24下一跳是2.2.2.2(其中2.2.2.2/32这条路由又形成FRR,形成FRR嵌套),备链路为100.1.1.0/24下一跳是3.3.3.3。当PE1到2.2.2.2的路由存在环路时,协议将无法检测到路由已经形成环路。
在如图2所示的公网非直连下一跳路由走LDP隧道的组网中,PE1和PE2之间通过Loopback接口建立边界网关协议(Border Gateway Protocol, BGP)邻居,在PE2上将100.1.1.0/24的路由通过BGP邻居通告给PE1,PE1和PE2之间起LDP隧道,要求PE1上100.1.1.0/242.2.2.2的路由能够走LDP隧道,但P1上没有100.1.1.0/24这条路由。由于BGP学习到的是对端PE2的环回(Loopback)地址,不是到P1的直接下一跳,无法保证不存在环路。
发明内容
本发明的目的在于提供一种检测路由成环的方法及装置,能更好地解决公网路由FRR嵌套和公网非直连下一跳走LDP隧道场景下的路由成环的检测问题。
为解决上述技术问题,采用如下技术方案:
一种检测路由成环的方法,包括:
设置路由下一跳为检测路由树的根节点,并设置所述检测路由树根节点的下一跳为所述检测路由树的子树的根节点;
检测所述检测路由树的子树;
若检测到所述子树中存在重复节点,则确定所述子树对应的转发路由存在环路,并从转发信息表中删除所述转发路由。
可选地,设置路由下一跳为检测路由树的根节点,并设置所述检测路由树根节点的下一跳为所述检测路由树的子树的根节点的步骤包括:
对以所述子树的根节点为前缀节点的路由进行路由迭代处理,找到所述前缀节点的下一跳节点;
将所述下一跳节点添加到所述检测路由树,并对所找到的下一跳节点是否是对端设备直连出接口进行路由判断处理;
如果不是,则以所述下一跳节点为前缀节点重复执行路由迭代处理和路由判断处理,直至找到下一跳节点是对端设备直连出接口的路由。
可选地,所述检测所述检测路由树的子树的步骤包括:
在将所述下一跳节点添加到所述检测路由树时,在所述节点向检测路由 树的根节点的路径上检测是否已存在所述节点;
若在所述节点向检测路由树的根节点的路径上检测到已存在所述节点,则确定所述子树中存在重复节点。
可选地,该方法还包括:
若所述检测路由树的子树中均存在重复节点,则从所述转发信息表中删除所述检测路由树的根节点。
可选地,该方法还包括:
若在所述检测路由树的子树中找到一个不存在重复节点的子树,则将所述子树对应的转发路由作为用来转发数据包的路由,并停止路由成环检测。
一种检测路由成环的装置,包括建树模块、检测模块和处理模块,其中:
所述建树模块设置成:设置路由下一跳为检测路由树的根节点,并设置所述检测路由树根节点的下一跳为所述检测路由树的子树的根节点;
所述检测模块设置成:检测所述检测路由树的子树;
所述处理模块设置成:在所述检测模块检测到子树中存在重复节点时,确定所述子树对应的转发路由存在环路,并在从转发信息表中删除所述转发路由。
可选地,所述建树模块设置成按照如下方式设置路由下一跳为检测路由树的根节点,并设置所述检测路由树根节点的下一跳为所述检测路由树的子树的根节点:
对以所述子树的根节点为前缀节点的路由进行路由迭代处理,找到所述前缀节点的下一跳节点,将所述下一跳节点添加到所述检测路由树,对所找到的下一跳节点是否是对端设备直连出接口进行路由判断处理,如果不是,则以所述下一跳节点为前缀节点重复执行路由迭代处理和路由判断处理,直至找到的下一跳节点是对端设备直连出接口的路由。
可选地,所述检测模块设置成按照如下方式检测所述检测路由树的子树:
在将所述下一跳节点添加到所述检测路由树时,在所述节点向检测路由 树的根节点的路径上检测是否已存在所述节点,若在所述节点向检测路由树的根节点的路径上检测到已存在所述节点,则确定所述子树中存在重复节点。
可选地,所述检测模块还设置成:检测到所述检测路由树的子树中均存在重复节点时,通知所述处理模块从所述转发信息表中删除所述检测路由树的根节点;
所述处理模块还设置成:从所述转发信息表中删除所述检测路由树的根节点。
可选地,
所述检测模块还设置成:在所述检测路由树的子树中找到一个不存在重复节点的子树,通知所述处理模块将所述子树对应的转发路由作为用来转发数据包的路由,并停止路由成环检测;
所述处理模块还设置成:将所述子树对应的转发路由作为用来转发数据包的路由,并停止路由成环检测。
一种计算机程序,包括程序指令,当该程序指令被计算机执行时,使得该计算机可执行上述任意的检测路由成环的方法。
一种载有所述的计算机程序的载体。
与相关技术相比较,本发明技术方案的有益效果在于:
本发明技术方案能够在转发面对公网路由FRR嵌套和公网非直连下一跳走LDP隧道场景下的路由进行成环检测,并在转发信息表中删除无效路由,从而保证通信顺畅,并避免网络资源的浪费。
附图概述
图1是相关技术提供的公网路由FRR嵌套组网图;
图2是相关技术提供的公网非直连下一跳路由走LDP隧道组网图;
图3是本发明实施例提供的检测路由成环的方法原理图;
图4是本发明实施例提供的检测路由成环的装置框图;
图5是本发明实施例提供的路由成环检测算法示意图;
图6是本发明实施例提供的成环检测针对的公网路由FRR嵌套组网图;
图7是针对图6所示组网图的一次具体的FIB表路由成环检测过程示意图。
本发明的较佳实施方式
以下结合附图对本发明的优选实施例进行详细说明,应当理解,以下所说明的优选实施例仅用于说明和解释本发明,并不用于限定本发明。
图3是本发明实施例提供的检测路由成环的方法原理图,如图3所示,步骤包括:
步骤S101:设置路由下一跳为检测路由树的根节点,并设置检测路由树根节点的下一跳为检测路由树的子树的根节点。
其中,步骤101包括:对以子树的根节点为前缀节点的路由进行路由迭代处理,找到前缀节点的下一跳节点;将下一跳节点添加到检测路由树,并对所找到的下一跳节点是否是对端设备直连出接口进行路由判断处理;如果不是,则以下一跳节点为前缀节点重复执行路由迭代处理和路由判断处理,直至找到下一跳节点是对端设备直连出接口的路由。
迭代是一种寻路方式,用来进行路由寻址,例如,将前缀节点地址作为目的地址,查找到达目的地址的路由。
步骤S201:检测所述检测路由树的子树。
具体地说,在将下一跳节点添加到检测路由树时,在该节点向检测路由树的根节点的路径上检测是否已存在该节点,若检测到已存在该节点,则确定子树中存在重复节点。
步骤S301:若检测到子树中存在重复节点,则确定该子树对应的转发路由存在环路,并从转发信息表中删除转发路由。
可选地,本实施例可以对检测路由树的子树依次进行检测,若在检测路由树的子树中找到一个不存在重复节点的子树,则将子树对应的转发路由作为用来转发数据包的路由,并停止路由成环检测。若检测路由树的子树中均 存在重复节点,则从转发信息表中删除检测路由树的根节点。
图4是本发明实施例提供的检测路由成环的装置框图,如图4所示,包括建树模块11、检测模块21和处理模块31。
建树模块11设置成:设置路由下一跳作为检测路由树的根节点,并设置检测路由树根节点的下一跳作为检测路由树的子树的根节点。其中,建树模块对以子树的根节点为前缀节点的路由路由迭代处理,找到前缀节点的下一跳节点,将下一跳节点添加到检测路由树,对所找到的下一跳节点是否是对端设备直连出接口进行路由判断处理,如果不是,则以下一跳节点为前缀节点重复执行路由迭代处理和路由判断处理,直至找到下一跳节点是对端设备直连出接口的路由。
检测模块21设置成:对检测路由树的子树进行检测。具体地说,检测模块在将下一跳节点添加到检测路由树时,在节点向检测路由树的根节点的路径上检测是否已存在节点,若在节点向检测路由树的根节点的路径上检测到已存在节点,则确定子树中存在重复节点。
处理模块31设置成:在检测到子树中存在重复节点时,确定子树对应的转发路由存在环路,并在从转发信息表中删除转发路由。可选地,若检测模块21检测到检测路由树的子树中均存在重复节点,则处理模块31从转发信息表中删除检测路由树的根节点。若检测模块21在检测路由树的子树中找到一个不存在重复节点的子树,则处理模块31将子树对应的转发路由作为用来转发数据包的路由,并停止路由成环检测。
图5是本发明实施例提供的路由成环检测算法示意图,如图5所示,本实施例在转发面对公网路由FRR嵌套和公网非直连下一跳走LDP隧道的路由进行成环检测,其具体的算法如下:
以待检测路由的下一跳为根创建一棵树,进行迭代,直到找到下一跳是对端路由器直连出接口的路由。这样树中的节点可能是前缀“prefix”,也可能是下一跳“nexthop”,叶子节点一定是“nexthop”。其中,图5中的P=Prefix, N=Nexthop。
每次向树中加入叶子节点时,都需要以该叶子节点向树根的路径上检查是否已存在该节点,如果存在则称该叶子节点为非法叶子节点(存在环路),需要对其进行裁剪。迭代路径中的一个P节点可能包含多个N节点,只要有一个N节点是非法节点,则该子树中与N最近的P节点也是非法的。具体裁减如下:
非法N节点:N节点所在的子树中与N节点最近的P节点也是非法的,转非法P节点处理。
非法P节点:该P节点的父节点N尝试找其它合法的P节点,即次长匹配的动作仅仅发生在N根节点,迭代路径中始终根据最长匹配。
其中,最长匹配动作是在网络中存在多条可匹配下一跳时,采用掩码最长(最精确)的一条路由作为匹配项并确定为下一跳。同样地,次长匹配动作是将采用掩码次长的一条确定为下一跳。
迭代时,每个合法的N节点只允许迭代到一个合法的P节点,但每个合法的P节点可以包含多个合法的N节点。这样,当迭代到Px节点,其包含的直连下一跳Nw...Nv节点都是合法的时,N1节点不再尝试查找其它P节点,N1节点将返回告诉P1节点迭代完成。P1节点继续N2...Nx节点的迭代,处理完毕且都确认合法后,P1节点返回告诉NH节点合法,NH节点认为迭代完成,不再查找其它节点,比如P2…Pn节点。只有当P1节点非法时,才尝试查找其它节点P2,依次类推。
这样,当NH认为迭代完成时,就找到了一条不会存在环路的转发路径。若NH的迭代结果是非法路径,该NH节点认为是成环的,设为无效路由从FIB表中删除。
下面结合公网路由FRR嵌套和成环检测算法对本发明作进一步说明,图6是本发明实施例提供的成环检测针对的公网路由FRR嵌套组网图,如图6所示。
PE1存在到100.1.1.0的BGP FRR路由,下一跳分别为2.2.2.2和3.3.3.3。 同时存在到PE2的OSPF FRR路由2.2.2.2,下一跳分别为4.4.4.4和5.5.5.5。
在PE1上有之前配置的静态路由4.4.4.0/24下一跳40.0.0.2、4.4.4.4/32下一跳6.6.6.6、5.5.5.5/32下一跳50.0.0.2、6.6.6.6/32下一跳4.4.4.4和40.0.0.2。其中40.0.0.2和50.0.0.2分别是P1、P2的接口地址。
图7是针对图6所示组网图的一次具体的FIB表路由成环检测过程示意图,如图7所示,包括以下步骤:
1、取BGP路由的下一跳2.2.2.2作为树根NH。
2、迭代以2.2.2.2为目的地址的路由。
最长匹配找到2.2.2.2/32下一跳为4.4.4.4和5.5.5.5两条路由,把4.4.4.4和5.5.5.5为前缀P1、P2加入树中。也就是说,从PE1侧看,PE2的下一跳为4.4.4.4和5.5.5.5。
4.4.4.4有次长匹配路由4.4.4.0/24下一跳为40.0.0.2,把4.4.4.0作为前缀P3加入树中。
3、把路由4.4.4.4、5.5.5.5、4.4.4.0的下一跳6.6.6.6、50.0.0.2、40.0.0.2作为下一跳NH1、NH2、NH3加入树中,此时,发现50.0.0.2和40.0.0.2是对端直连接口地址,P2、P3结束迭代。
4、把6.6.6.6设为P4,迭代以6.6.6.6为目的地址的路由,找到6.6.6.6/32的下一跳为4.4.4.4和40.0.0.2两条。把4.4.4.4和40.0.0.2作为NH4、NH5加入树中,此时发现向树根的路径上节点4.4.4.4已在树中,因此NH4是非法节点。
5、按非法N节点的处理方式,与非法节点NH4直接相连的P节点P4也是非法节点。
6、按非法P节点的处理方式,P4的父节点NH1不是根节点,因此不能进行次优匹配以寻找其他P几点,因此,NH1为非法节点。
7、重复非法N和P节点的处理方式,发现P1是非法节点后,NH根节点进行次优匹配,找到合法的P3节点。
此时,存在FRR嵌套的BGP FRR路由不会成环,可以指导转发。若PE1上不存在4.4.4.0/24这条路由,NH次优匹配找不到其他P节点,该路由转发将形成环路,需要丢弃。
本发明实施例还公开了一种计算机程序,包括程序指令,当该程序指令被计算机执行时,使得该计算机可执行上述任意的检测路由成环的方法。
本发明实施例还公开了一种载有所述的计算机程序的载体。
综上所述,本发明实施例在公网路由FRR嵌套和公网非直连下一跳节点走LDP隧道场景下,若待检测路由的下一跳节点的迭代结果是合法路径,则能够找到一条不存在环路的转发路径,否则该节点是成环的,将该节点设为无效路由,并从FIB表中删除。
尽管上文对本发明进行了详细说明,但是本发明不限于此,本技术领域技术人员可以根据本发明的原理进行各种修改。因此,凡按照本发明原理所作的修改,都应当理解为落入本发明的保护范围。
工业实用性
本发明技术方案能够在转发面对公网路由FRR嵌套和公网非直连下一跳走LDP隧道场景下的路由进行成环检测,并在转发信息表中删除无效路由,从而保证通信顺畅,并避免网络资源的浪费。因此本发明具有很强的工业实用性。

Claims (12)

  1. 一种检测路由成环的方法,包括:
    设置路由下一跳为检测路由树的根节点,并设置所述检测路由树根节点的下一跳为所述检测路由树的子树的根节点;
    检测所述检测路由树的子树;
    若检测到所述子树中存在重复节点,则确定所述子树对应的转发路由存在环路,并从转发信息表中删除所述转发路由。
  2. 根据权利要求1所述的检测路由成环的方法,其中,设置路由下一跳为检测路由树的根节点,并设置所述检测路由树根节点的下一跳为所述检测路由树的子树的根节点的步骤包括:
    对以所述子树的根节点为前缀节点的路由进行路由迭代处理,找到所述前缀节点的下一跳节点;
    将所述下一跳节点添加到所述检测路由树,并对所找到的下一跳节点是否是对端设备直连出接口进行路由判断处理;
    如果不是,则以所述下一跳节点为前缀节点重复执行路由迭代处理和路由判断处理,直至找到下一跳节点是对端设备直连出接口的路由。
  3. 根据权利要求2所述的检测路由成环的方法,其中,所述检测所述检测路由树的子树的步骤包括:
    在将所述下一跳节点添加到所述检测路由树时,在所述节点向检测路由树的根节点的路径上检测是否已存在所述节点;
    若在所述节点向检测路由树的根节点的路径上检测到已存在所述节点,则确定所述子树中存在重复节点。
  4. 根据权利要求1至3中任意一项所述的检测路由成环的方法,该方法还包括:
    若所述检测路由树的子树中均存在重复节点,则从所述转发信息表中删除所述检测路由树的根节点。
  5. 根据权利要求1至3中任意一项所述的检测路由成环的方法,该方法 还包括:
    若在所述检测路由树的子树中找到一个不存在重复节点的子树,则将所述子树对应的转发路由作为用来转发数据包的路由,并停止路由成环检测。
  6. 一种检测路由成环的装置,包括建树模块、检测模块和处理模块,其中:
    所述建树模块设置成:设置路由下一跳为检测路由树的根节点,并设置所述检测路由树根节点的下一跳为所述检测路由树的子树的根节点;
    所述检测模块设置成:检测所述检测路由树的子树;
    所述处理模块设置成:在所述检测模块检测到子树中存在重复节点时,确定所述子树对应的转发路由存在环路,并在从转发信息表中删除所述转发路由。
  7. 根据权利要求6所述的检测路由成环的装置,其中,所述建树模块设置成按照如下方式设置路由下一跳为检测路由树的根节点,并设置所述检测路由树根节点的下一跳为所述检测路由树的子树的根节点:
    对以所述子树的根节点为前缀节点的路由进行路由迭代处理,找到所述前缀节点的下一跳节点,将所述下一跳节点添加到所述检测路由树,对所找到的下一跳节点是否是对端设备直连出接口进行路由判断处理,如果不是,则以所述下一跳节点为前缀节点重复执行路由迭代处理和路由判断处理,直至找到的下一跳节点是对端设备直连出接口的路由。
  8. 根据权利要求6所述的检测路由成环的装置,其中,所述检测模块设置成按照如下方式检测所述检测路由树的子树:
    在将所述下一跳节点添加到所述检测路由树时,在所述节点向检测路由树的根节点的路径上检测是否已存在所述节点,若在所述节点向检测路由树的根节点的路径上检测到已存在所述节点,则确定所述子树中存在重复节点。
  9. 根据权利要求6至8中任意一项所述的检测路由成环的装置,其中,
    所述检测模块还设置成:检测到所述检测路由树的子树中均存在重复节点时,通知所述处理模块从所述转发信息表中删除所述检测路由树的根节点;
    所述处理模块还设置成:从所述转发信息表中删除所述检测路由树的根 节点。
  10. 根据权利要求6至8中任意一项所述的检测路由成环的装置,其中,
    所述检测模块还设置成:在所述检测路由树的子树中找到一个不存在重复节点的子树,通知所述处理模块将所述子树对应的转发路由作为用来转发数据包的路由,并停止路由成环检测;
    所述处理模块还设置成:将所述子树对应的转发路由作为用来转发数据包的路由,并停止路由成环检测。
  11. 一种计算机程序,包括程序指令,当该程序指令被计算机执行时,使得该计算机可执行权利要求1-5中任一项所述的检测路由成环的方法。
  12. 一种载有如权利要求11所述的计算机程序的载体。
PCT/CN2015/072686 2014-11-19 2015-02-10 一种检测路由成环的方法及装置 WO2016078240A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410662765.1 2014-11-19
CN201410662765.1A CN105681119A (zh) 2014-11-19 2014-11-19 一种检测路由成环的方法及装置

Publications (1)

Publication Number Publication Date
WO2016078240A1 true WO2016078240A1 (zh) 2016-05-26

Family

ID=56013151

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/072686 WO2016078240A1 (zh) 2014-11-19 2015-02-10 一种检测路由成环的方法及装置

Country Status (2)

Country Link
CN (1) CN105681119A (zh)
WO (1) WO2016078240A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108600096A (zh) * 2018-03-28 2018-09-28 山西大学 一种基于快速重路由的域内节能路由方法
CN114615216A (zh) * 2022-03-11 2022-06-10 深圳市风云实业有限公司 一种基于交换芯片的路由表动态调整方法

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111107006B (zh) * 2019-12-23 2022-05-20 锐捷网络股份有限公司 路由的管理方法及装置
CN111953606B (zh) * 2020-07-14 2022-06-21 锐捷网络股份有限公司 一种路由迭代循环检测方法、装置、电子设备及存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070253346A1 (en) * 2006-05-01 2007-11-01 Cisco Technology, Inc. Detection of potential forwarding loops in bridged networks
CN101252479A (zh) * 2008-04-01 2008-08-27 杭州华三通信技术有限公司 一种环路检测方法和交换机
CN102164055A (zh) * 2011-02-23 2011-08-24 华为技术有限公司 一种sccp环路的检测处理方法及装置

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101459569B (zh) * 2008-12-12 2011-08-10 华为技术有限公司 建立路由索引树的方法、装置和查找路由索引树的方法、装置
CN102420761B (zh) * 2011-12-05 2014-08-13 瑞斯康达科技发展股份有限公司 一种路由迭代方法
CN102594657B (zh) * 2011-12-20 2016-07-06 杭州华三通信技术有限公司 一种路由迭代方法及路由交换设备
CN102752205B (zh) * 2012-07-04 2016-06-01 杭州华三通信技术有限公司 一种路由迭代的方法和装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070253346A1 (en) * 2006-05-01 2007-11-01 Cisco Technology, Inc. Detection of potential forwarding loops in bridged networks
CN101252479A (zh) * 2008-04-01 2008-08-27 杭州华三通信技术有限公司 一种环路检测方法和交换机
CN102164055A (zh) * 2011-02-23 2011-08-24 华为技术有限公司 一种sccp环路的检测处理方法及装置

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108600096A (zh) * 2018-03-28 2018-09-28 山西大学 一种基于快速重路由的域内节能路由方法
CN108600096B (zh) * 2018-03-28 2020-08-04 山西大学 一种基于快速重路由的域内节能路由方法
CN114615216A (zh) * 2022-03-11 2022-06-10 深圳市风云实业有限公司 一种基于交换芯片的路由表动态调整方法

Also Published As

Publication number Publication date
CN105681119A (zh) 2016-06-15

Similar Documents

Publication Publication Date Title
US9794167B2 (en) Bicasting using non-congruent paths in a loop-free routing topology having routing arcs
US10178019B2 (en) Low-overhead anchorless managing of producer mobility in information-centric networking
US8817665B2 (en) Alternate down paths for directed acyclic graph (DAG) routing
US9225629B2 (en) Efficient identification of node protection remote LFA target
US9246794B2 (en) Label distribution and route installation in a loop-free routing topology using routing arcs
WO2015184852A1 (zh) Sr信息获取方法及建立sr网络的方法
WO2015109821A1 (zh) 一种管理业务链的方法、系统及装置
US9668160B2 (en) Topology discovery based on SCTP/X2 snooping
CN103825760B (zh) 一种基于ospf协议建立邻居关系的方法和装置
WO2009111959A1 (zh) 路由安装、发布方法和设备
US9166903B2 (en) System, method and apparatus to resolve RPF-vector attribute conflicts
WO2016078240A1 (zh) 一种检测路由成环的方法及装置
CN103297340B (zh) Mpls和bgp组网中的路由收敛方法和设备
WO2011103759A1 (zh) 关联的双向标签交换路径的创建方法及系统
US9444676B2 (en) Efficient identification of Q-space in remote LFA
EP3058777A1 (en) Topology discovery based on explicit signaling
Papan et al. The new multicast repair (M‐REP) IP fast reroute mechanism
WO2016150093A1 (zh) 报文转发方法、装置及服务提供商网络边缘pe设备
WO2016123904A1 (zh) 路由收敛方法、装置及虚拟专用网vpn系统
KR20150100875A (ko) 단방향성 터널의 존재시에 프로토콜 독립 멀티캐스트 트리를 셋업하기 위한 방법
WO2017140238A1 (zh) 一种报文传输方法及装置
WO2017000566A1 (zh) 一种获取设备接口mru值的方法及装置
Tayeb et al. An Evaluative Analysis of DUAL, SPF, and Bellman-Ford
CN106936710A (zh) 一种Mesh Group配置方法及装置
CN111565149A (zh) 一种在ldp rlfa frr场景下远端会话保活的方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15861589

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15861589

Country of ref document: EP

Kind code of ref document: A1