[go: up one dir, main page]

CN106549819B - A connectivity detection method, controller and device - Google Patents

A connectivity detection method, controller and device Download PDF

Info

Publication number
CN106549819B
CN106549819B CN201510606716.0A CN201510606716A CN106549819B CN 106549819 B CN106549819 B CN 106549819B CN 201510606716 A CN201510606716 A CN 201510606716A CN 106549819 B CN106549819 B CN 106549819B
Authority
CN
China
Prior art keywords
label
path
address
source
direct connection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510606716.0A
Other languages
Chinese (zh)
Other versions
CN106549819A (en
Inventor
郑明�
宋伟
董峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201510606716.0A priority Critical patent/CN106549819B/en
Publication of CN106549819A publication Critical patent/CN106549819A/en
Application granted granted Critical
Publication of CN106549819B publication Critical patent/CN106549819B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0811Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/24Multipath

Landscapes

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

Abstract

本发明提供一种连通性探测方法、控制器和设备。方法包括:确定源设备与目的设备之间存在N条等价路径;生成N个探测报文,所述N个探测报文中的任意一个包括源地址、目的地址和用于表示一条等价路径的标签列表;其中,源地址为源设备的IP地址,目的地址为目的设备的IP地址;标签列表包括指针和多个顺序排列的标签,每个标签用于表示一条直连路径;直连路径为仅包括两个网络设备且以所述两个网络设备为端点的路径;向所述源设备发送所述N个探测报文,以使所述源设备将所述N个探测报文分别发送给所述N条等价路径中对应的一条等价路径以检测所述N条等价路径的连通性。本发明能够实现对源设备与目的设备间存在的所有等价路径的连通性探测。

The invention provides a connectivity detection method, controller and equipment. The method includes: determining that there are N equivalent paths between the source device and the destination device; generating N detection messages, any one of the N detection messages includes a source address, a destination address, and an equivalent path label list; wherein, the source address is the IP address of the source device, and the destination address is the IP address of the destination device; the label list includes pointers and multiple sequentially arranged labels, and each label is used to represent a direct connection path; the direct connection path is a path including only two network devices and using the two network devices as endpoints; sending the N detection packets to the source device, so that the source device sends the N detection packets respectively A corresponding one of the N equivalent paths is used to detect the connectivity of the N equivalent paths. The invention can realize the connectivity detection of all equivalent paths existing between the source equipment and the destination equipment.

Description

一种连通性探测方法、控制器和设备A connectivity detection method, controller and device

技术领域technical field

本发明涉及通信技术领域,更具体地说,涉及一种连通性探测方法、控制器和设备。The present invention relates to the technical field of communications, and more specifically, to a connectivity detection method, controller and equipment.

背景技术Background technique

等价多路径路由(英文:Equal-Cost Multi-path Routing,简称:ECMP)为到达同一个目的因特网协议(英文:Internet Protocol,简称:IP)地址或者目的网段间存在的多条开销(cost)值相等的不同路径。利用ECMP协议可以在等值的多路径中实现多路径负载均衡和链路备份。Equal-cost multi-path routing (English: Equal-Cost Multi-path Routing, abbreviation: ECMP) is to reach the same destination Internet Protocol (English: Internet Protocol, abbreviation: IP) address or multiple cost (cost) between destination network segments ) with equal values. Using ECMP protocol can realize multi-path load balancing and link backup in equal value multi-path.

现有的ECMP路径的连通性探测方法通过增加探测报文中的存活时间(英文:TimeTo Live,简称:TTL)值来实现路径连通性探测,每当探测报文经过一个路由器,其TTL值就会减1。当探测报文中的TTL为0时,接收方便取消丢弃接收的探测报文,并发送一个互联网控制报文协议(英文:Internet Control Message Protocol,简称:ICMP)报文给所述探测报文的发送端。The connectivity detection method of existing ECMP path realizes path connectivity detection by increasing the time-to-live (English: TimeTo Live, abbreviation: TTL) value in the detection message, whenever detection message passes through a router, its TTL value increases will subtract 1. When the TTL in the detection message is 0, it is convenient for the receiver to cancel and discard the received detection message, and send an Internet Control Message Protocol (English: Internet Control Message Protocol, ICMP for short) message to the receiver of the detection message. sender.

具体地以图1-3为例,探测报文的发送端(源设备)1与目的设备2之间存在两条路径,分别为设备1-设备A-设备B-设备2和设备1-设备A-设备C-设备2。Specifically, taking Figure 1-3 as an example, there are two paths between the sender (source device) 1 of the probe message and the destination device 2, which are device 1-device A-device B-device 2 and device 1-device A-device C-device 2.

现有技术中,设备1会首先向设备2发送一TTL值等于1的探测报文,该探测报文经过设备A后,TTL值减1变为0,此时设备A将该探测报文丢弃,并向设备1返回一ICMP报文,告知设备1路径不可达。In the existing technology, device 1 will first send a detection message with a TTL value equal to 1 to device 2. After the detection message passes through device A, the TTL value is reduced by 1 and becomes 0. At this time, device A discards the detection message. , and return an ICMP message to device 1, informing device 1 that the path is unreachable.

进一步,设备1再次向设备2发送一TTL值等于2的探测报文,该探测报文依次经过设备A、设备B后,TTL值变为0,此时设备B将该探测报文丢弃,并向设备1返回一ICMP报文,告知设备1路径不可达。Further, device 1 sends a detection message with a TTL value equal to 2 to device 2 again, and after the detection message passes through device A and device B in turn, the TTL value becomes 0, and device B discards the detection message at this time, and Return an ICMP packet to device 1, informing device 1 that the path is unreachable.

更进一步,设备1再次向设备2发送一TTL值等于3的探测报文,该探测报文依次经过设备A、设备B后,TTL值变为1,此时报文会继续发送至设备2,并在到达设备2后TTL值变为0,设备2发现目的地址为自己的IP地址,返回一ICMP报文,告知设备1路径可达。Furthermore, device 1 sends a probe message with a TTL value equal to 3 to device 2 again. After the probe message passes through device A and device B in turn, the TTL value becomes 1. At this time, the message will continue to be sent to device 2 and After reaching device 2, the TTL value becomes 0, and device 2 finds that the destination address is its own IP address, and returns an ICMP message, informing device 1 that the path is reachable.

虽然现有技术中的上述方法能够实现对设备1与设备2间的路径连通性的探测,但本发明的发明人发现,设备1与设备2间可能包括多条路径,而每条路径的选择都是由设备自己决定的,例如上述示例中设备A是选择设备B发送探测报文,还是选择设备C发送探测报文,是由设备A自己决定的。且设备A每次只能选择一个设备,即每次只能实现对一条路径的连通性探测,那么现有技术也就无法保证对设备1与设备2之间存在的所有路径的连通性都进行探测。Although the above method in the prior art can realize the detection of path connectivity between device 1 and device 2, the inventors of the present invention found that there may be multiple paths between device 1 and device 2, and the selection of each path All are determined by the device itself. For example, in the above example, whether device A chooses device B to send the detection packet or chooses device C to send the detection packet is determined by device A itself. And device A can only select one device at a time, that is, it can only detect the connectivity of one path at a time, so the existing technology cannot guarantee the connectivity of all paths existing between device 1 and device 2. probing.

发明内容Contents of the invention

有鉴于此,本发明提供一种连通性探测方法、控制器和设备,以实现对源设备与目的设备间存在的所有路径的连通性探测。In view of this, the present invention provides a connectivity detection method, a controller and a device, so as to realize the connectivity detection of all paths existing between the source device and the destination device.

本发明的第一方面公开了一种连通性探测方法,包括:A first aspect of the present invention discloses a connectivity detection method, comprising:

确定源设备与目的设备之间存在N条等价路径;所述N大于等于2;Determine that there are N equivalent paths between the source device and the destination device; the N is greater than or equal to 2;

生成N个探测报文,所述N个探测报文中的任意一个包括源地址、目的地址和用于表示一条等价路径的标签列表;其中,所述源地址为所述源设备的因特网协议IP地址,所述目的地址为所述目的设备的IP地址;所述标签列表包括指针和多个顺序排列的标签,每个标签用于表示一条直连路径;其中,所述直连路径为仅包括两个网络设备且以所述两个网络设备为端点的路径;Generating N detection messages, any one of the N detection messages includes a source address, a destination address, and a label list used to represent an equivalent path; wherein, the source address is the Internet protocol of the source device IP address, the destination address is the IP address of the destination device; the label list includes a pointer and a plurality of sequentially arranged labels, and each label is used to represent a direct connection path; wherein, the direct connection path is only a path including two network devices and having the two network devices as endpoints;

向所述源设备发送所述N个探测报文,以使所述源设备将所述N个探测报文分别发送给所述N条等价路径中对应的一条等价路径以检测所述N条等价路径的连通性。sending the N detection packets to the source device, so that the source device sends the N detection packets to a corresponding one of the N equivalent paths to detect the N Connectivity of the equivalent paths.

结合第一方面,在第一方面的第一种可能的实现方式中,所述确定源设备与目的设备之间存在N条等价路径之前,所述方法还包括:With reference to the first aspect, in a first possible implementation manner of the first aspect, before determining that there are N equivalent paths between the source device and the destination device, the method further includes:

收集网络拓扑;collect network topology;

根据所述网络拓扑为网络中的每条直连路径分配标签;assigning a label to each direct path in the network according to the network topology;

向所述网络中的每个网络设备发送所述网络设备所在的每条直连路径的标签;sending the label of each direct path where the network device is located to each network device in the network;

所述确定源设备与目的设备之间存在N条等价路径包括:根据所述网络拓扑确定所述源设备与目的设备之间存在N条等价路径。The determining that there are N equivalent paths between the source device and the destination device includes: determining that there are N equivalent paths between the source device and the destination device according to the network topology.

本发明的第二方面公开了另一种连通性探测方法,包括:A second aspect of the present invention discloses another connectivity detection method, comprising:

第一设备接收探测报文,其中,所述探测报文包括源地址、目的地址和用于表示一条等价路径的标签列表;其中,所述源地址为所述等价路径的源设备的因特网协议IP地址,所述目的地址为所述等价路径的目的设备的IP地址;所述标签列表包括指针和多个顺序排列的标签,每个标签用于表示一条直连路径;其中,所述直连路径为仅包括两个网络设备且以所述两个网络设备为端点的路径;The first device receives a detection packet, wherein the detection packet includes a source address, a destination address, and a label list for representing an equivalent path; wherein the source address is the Internet address of the source device of the equivalent path Protocol IP address, the destination address is the IP address of the destination device of the equal-cost path; the label list includes a pointer and a plurality of sequentially arranged labels, and each label is used to represent a direct path; wherein, the A direct path is a path that only includes two network devices and uses the two network devices as endpoints;

所述第一设备依据所述探测报文生成探测响应报文;其中所述探测响应报文包括源地址和目的地址,所述源地址为所述第一设备的IP地址,所述目的地址为所述源设备的IP地址;The first device generates a probe response message according to the probe message; wherein the probe response message includes a source address and a destination address, the source address is the IP address of the first device, and the destination address is the IP address of the source device;

所述第一设备将所述探测响应报文发送至所述源设备;The first device sends the probe response packet to the source device;

所述第一设备依据所述指针指向的当前标签,确定所述探测报文的出端口,所述出端口对应所述等价路径上的下一直连路径;The first device determines the egress port of the probe message according to the current label pointed to by the pointer, and the egress port corresponds to the next direct path on the equivalent path;

所述第一设备通过所述出端口向所述下一直连路径发送所述探测报文。The first device sends the detection packet to the next direct path through the egress port.

结合第二方面,在第二方面的第一种可能的实现方式,当所述指针不指向所述标签列表中的最后一个标签时,所述发送所述探测报文之前,所述方法还包括:所述第一设备控制所述指针沿所述标签列表顺序移动到下一标签位置;或With reference to the second aspect, in the first possible implementation of the second aspect, when the pointer does not point to the last label in the label list, before sending the detection message, the method further includes : the first device controls the pointer to sequentially move to the next label position along the label list; or

当所述指针指向所述标签列表中的最后一个标签时,所述发送所述探测报文前,所述方法还包括:所述第一设备删除所述标签列表中的指针。When the pointer points to the last label in the label list, before sending the probe message, the method further includes: the first device deleting the pointer in the label list.

结合第二方面、第二方面的第一种可能的实现方式中的任一种实现方式,在第二方面的第二种可能的实现方式下,所述方法还包括:In combination with any one of the second aspect and the first possible implementation manner of the second aspect, in the second possible implementation manner of the second aspect, the method further includes:

所述第一设备接收并存储控制器发送的所述源设备所在的每条直连路径的标签与所述直连路径的对应关系。The first device receives and stores the correspondence between the label of each direct path where the source device is located and the direct path sent by the controller.

结合第二方面、第二方面的第一种可能的实现方式中的任一种实现方式,在第二方面的第三种可能的实现方式下,所述方法还包括:所述第一设备通过扩展内部网关协议IGP进行多协议标签交换MPLS标签分配,以获得所述第一设备所在的每条直连路径的标签,并存储每条直连路径与所述直连路径的标签的对应关系。With reference to any one of the second aspect and the first possible implementation manner of the second aspect, in a third possible implementation manner of the second aspect, the method further includes: the first device passes The extended interior gateway protocol IGP performs multi-protocol label switching MPLS label allocation to obtain the label of each direct path where the first device is located, and stores the correspondence between each direct path and the label of the direct path.

本发明的第三方面公开了再一种连通性探测方法,包括:A third aspect of the present invention discloses another connectivity detection method, including:

源设备接收探测报文,其中,所述探测报文包括源地址、目的地址和用于表示一条等价路径的标签列表;其中,所述源地址为所述源设备的因特网协议IP地址,所述目的地址为所述等价路径的目的设备的IP地址;所述标签列表包括指针和多个顺序排列的标签,每个标签用于表示一条直连路径;其中,所述直连路径为仅包括两个网络设备且以所述两个网络设备为端点的路径;The source device receives a probe message, where the probe message includes a source address, a destination address, and a label list for representing an equal-cost path; where the source address is the Internet Protocol IP address of the source device, and the The destination address is the IP address of the destination device of the equivalent path; the label list includes a pointer and a plurality of sequentially arranged labels, and each label is used to represent a direct path; wherein, the direct path is only a path including two network devices and having the two network devices as endpoints;

所述源设备依据所述指针指向的第一标签,确定所述第一标签对应的出端口,所述出端口对应所述等价路径上的下一直连路径;The source device determines an outbound port corresponding to the first label according to the first label pointed to by the pointer, and the outbound port corresponds to the next direct path on the equivalent path;

所述源设备控制所述指针沿所述标签列表顺序移动到第二标签位置;The source device controls the pointer to move sequentially along the label list to a second label position;

所述源设备依据所述出端口,通过所述下一直连路径发送所述探测报文以检测所述等价路径的连通性。The source device sends the detection message through the next direct path according to the egress port to detect the connectivity of the equal-cost path.

结合第三方面,在第三方面的第一种可能的实现方式,还包括:In combination with the third aspect, the first possible implementation of the third aspect also includes:

当所述源设备接收到所述等价路径上的第一设备发送的探测响应报文时,确定所述源设备与所述第一设备之间的路径连通;When the source device receives the probe response message sent by the first device on the equal-cost path, determine that the path between the source device and the first device is connected;

其中,所述第一设备为所述等价路径上除所述源设备之外的设备。Wherein, the first device is a device on the equivalent path other than the source device.

结合第三方面、第三方面的第一种可能的实现方式中的任一种实现方式,在第三方面的第二种可能的实现方式下,当所述源设备在预设时间内没有收到所述目的设备发送的探测响应报文时,所述源设备确定所述等价路径异常;所述方法还包括:In combination with any one of the third aspect and the first possible implementation manner of the third aspect, in the second possible implementation manner of the third aspect, when the source device does not receive When receiving the probe response message sent by the destination device, the source device determines that the equal-cost path is abnormal; the method further includes:

所述源设备根据所述等价路径上的其他设备发送的探测响应报文确定故障设备。The source device determines the faulty device according to the probe response packets sent by other devices on the equal-cost path.

结合第三方面、第三方面的第一种可能的实现方式、第三方面的第二种可能的实现方式中的任一种实现方式,在第三方面的第三种可能的实现方式下,所述方法还包括:In combination with any of the third aspect, the first possible implementation of the third aspect, and the second possible implementation of the third aspect, in the third possible implementation of the third aspect, The method also includes:

所述源设备接收并存储控制器发送的所述源设备所在的每条直连路径的标签与所述直连路径的对应关系。The source device receives and stores the correspondence between the label of each direct path where the source device is located and the direct path sent by the controller.

本发明的第四方面公开了一种控制器,包括:A fourth aspect of the present invention discloses a controller, comprising:

等价路径数量确定单元,用于确定源设备与目的设备之间存在N条等价路径;所述N大于等于2;An equivalent path number determination unit, configured to determine that there are N equivalent paths between the source device and the destination device; said N is greater than or equal to 2;

探测报文生成单元,用于生成N个探测报文,所述N个探测报文中的任意一个包括源地址、目的地址和用于表示一条等价路径的标签列表;其中,所述源地址为所述源设备的因特网协议IP地址,所述目的地址为所述目的设备的IP地址;所述标签列表包括指针和多个顺序排列的标签,每个标签用于表示一条直连路径;其中,所述直连路径为仅包括两个网络设备且以所述两个网络设备为端点的路径;A detection message generation unit, configured to generate N detection messages, any one of the N detection messages includes a source address, a destination address, and a label list for representing an equivalent path; wherein, the source address is the IP address of the Internet protocol of the source device, and the destination address is the IP address of the destination device; the label list includes a pointer and a plurality of sequentially arranged labels, and each label is used to represent a direct path; wherein , the direct path is a path that only includes two network devices and takes the two network devices as endpoints;

探测报文发送单元,用于向所述源设备发送所述N个探测报文,以使所述源设备将所述N个探测报文分别发送给所述N条等价路径中对应的一条等价路径以检测所述N条等价路径的连通性。A detection packet sending unit, configured to send the N detection packets to the source device, so that the source device sends the N detection packets to a corresponding one of the N equivalent paths Equivalent paths to detect the connectivity of the N equivalent paths.

结合第四方面,在第四方面的第一种可能的实现方式,还包括:In combination with the fourth aspect, the first possible implementation of the fourth aspect also includes:

收集单元,用于收集网络拓扑;a collection unit, configured to collect network topology;

标签分配单元,用于根据所述网络拓扑为网络中的每条直连路径分配标签;a label allocation unit, configured to allocate labels for each direct path in the network according to the network topology;

标签发送单元,用于向所述网络中的每个网络设备发送所述网络设备所在的每条直连路径的标签;a label sending unit, configured to send the label of each direct path where the network device is located to each network device in the network;

所述等价路径数量确定单元具体用于,根据所述网络拓扑确定所述源设备与目的设备之间存在N条等价路径。The unit for determining the number of equal-cost paths is specifically configured to determine, according to the network topology, that there are N equal-cost paths between the source device and the destination device.

本发明的第五方面公开了一种设备,包括:A fifth aspect of the present invention discloses a device comprising:

接收单元,用于接收探测报文,其中,所述探测报文包括源地址、目的地址和用于表示一条等价路径的标签列表;其中,所述源地址为所述等价路径的源设备的因特网协议IP地址,所述目的地址为所述等价路径的目的设备的IP地址;所述标签列表包括指针和多个顺序排列的标签,每个标签用于表示一条直连路径;其中,所述直连路径为仅包括两个网络设备且以所述两个网络设备为端点的路径;A receiving unit, configured to receive a detection message, wherein the detection message includes a source address, a destination address, and a label list for representing an equivalent path; wherein the source address is a source device of the equivalent path The IP address of the Internet Protocol, the destination address is the IP address of the destination device of the equal-cost path; the label list includes a pointer and a plurality of sequentially arranged labels, and each label is used to represent a direct path; wherein, The direct path is a path that only includes two network devices and uses the two network devices as endpoints;

探测响应报文生成单元,用于依据所述探测报文生成探测响应报文;其中所述探测响应报文包括源地址和目的地址,所述源地址为所述设备的IP地址,所述目的地址为所述源设备的IP地址;A probe response message generating unit, configured to generate a probe response message according to the probe message; wherein the probe response message includes a source address and a destination address, the source address is the IP address of the device, and the destination The address is the IP address of the source device;

第一发送单元,用于将所述探测响应报文发送至所述源设备;a first sending unit, configured to send the probe response message to the source device;

确定单元,用于依据所述指针指向的当前标签,确定所述探测报文的出端口,所述出端口对应所述等价路径上的下一直连路径;A determining unit, configured to determine an egress port of the probe message according to the current label pointed to by the pointer, where the egress port corresponds to the next direct path on the equal-cost path;

第二发送单元,用于通过所述出端口向所述下一直连路径发送所述探测报文。A second sending unit, configured to send the detection message to the next direct path through the egress port.

结合第五方面,在第五方面的第一种可能的实现方式,还包括指针处理单元,所述指针处理单元用于:With reference to the fifth aspect, the first possible implementation manner of the fifth aspect further includes a pointer processing unit, where the pointer processing unit is configured to:

当所述指针不指向所述标签列表中的最后一个标签时,控制所述指针沿所述标签列表顺序移动到下一标签位置;或,When the pointer does not point to the last label in the label list, controlling the pointer to move sequentially to the next label position along the label list; or,

当所述指针指向所述标签列表中的最后一个标签时,删除所述标签列表中的指针。When the pointer points to the last label in the label list, delete the pointer in the label list.

结合第五方面、第五方面的第一种可能的实现方式中的任一种实现方式,在第五方面的第二种可能的实现方式下,还包括:In combination with any one of the fifth aspect and the first possible implementation manner of the fifth aspect, under the second possible implementation manner of the fifth aspect, it also includes:

接收单元,用于接收控制器发送的所述源设备所在的每条直连路径的标签与所述直连路径的对应关系;The receiving unit is configured to receive the corresponding relationship between the label of each direct connection path where the source device is located and the direct connection path sent by the controller;

存储单元,用于存储所述接收单元接收的对应关系。A storage unit, configured to store the corresponding relationship received by the receiving unit.

结合第五方面、第五方面的第一种可能的实现方式中的任一种实现方式,在第五方面的第三种可能的实现方式下,还包括:In combination with any one of the fifth aspect and the first possible implementation manner of the fifth aspect, under the third possible implementation manner of the fifth aspect, it also includes:

标签分配单元,用于通过扩展内部网关协议IGP进行多协议标签交换MPLS标签分配,以获得所述第一设备所在的每条直连路径的标签,并存储每条直连路径与所述直连路径的标签的对应关系。A label allocation unit, configured to perform multi-protocol label switching MPLS label allocation by extending the interior gateway protocol IGP, so as to obtain the label of each direct path where the first device is located, and store each direct path and the direct path The corresponding relationship between the label of the path.

本发明的第六方面公开了一种设备,包括:A sixth aspect of the present invention discloses a device comprising:

接收单元,用于接收探测报文,其中,所述探测报文包括源地址、目的地址和用于表示一条等价路径的标签列表;其中,所述源地址为所述源设备的因特网协议IP地址,所述目的地址为所述等价路径的目的设备的IP地址;所述标签列表包括指针和多个顺序排列的标签,每个标签用于表示一条直连路径;其中,所述直连路径为仅包括两个网络设备且以所述两个网络设备为端点的路径;A receiving unit, configured to receive a probe message, wherein the probe message includes a source address, a destination address, and a label list for representing an equal-cost path; wherein the source address is the Internet Protocol IP address of the source device address, the destination address is the IP address of the destination device of the equal-cost path; the label list includes a pointer and a plurality of sequentially arranged labels, and each label is used to represent a direct connection path; wherein the direct connection The path is a path including only two network devices and taking the two network devices as endpoints;

第一确定单元,用于依据所述指针指向的第一标签,确定所述第一标签对应的出端口,所述出端口对应所述等价路径上的下一直连路径;The first determining unit is configured to determine an outbound port corresponding to the first label according to the first label pointed to by the pointer, and the outbound port corresponds to the next direct path on the equivalent path;

指针控制单元,用于控制所述指针沿所述标签列表顺序移动到第二标签位置;a pointer control unit, configured to control the pointer to move sequentially along the label list to a second label position;

发送单元,用于依据所述出端口,通过所述下一直连路径发送所述探测报文以检测所述等价路径的连通性。A sending unit, configured to send the probe message through the next direct path according to the egress port to detect the connectivity of the equal-cost path.

结合第六方面,在第六方面的第一种可能的实现方式,所述第一确定单元还用于当接收到所述等价路径上的第一设备发送的探测响应报文时,确定所述源设备与所述第一设备之间的路径连通;With reference to the sixth aspect, in a first possible implementation manner of the sixth aspect, the first determining unit is further configured to, when receiving the probe response message sent by the first device on the equal-cost path, determine the a path connection between the source device and the first device;

其中,所述第一设备为所述等价路径上除所述源设备之外的设备。Wherein, the first device is a device on the equivalent path other than the source device.

结合第六方面、第六方面的第一种可能的实现方式中的任一种实现方式,在第六方面的第二种可能的实现方式下,还包括:In combination with any one of the sixth aspect and the first possible implementation manner of the sixth aspect, under the second possible implementation manner of the sixth aspect, it also includes:

第二确定单元,用于当在预设时间内没有收到所述目的设备发送的探测响应报文时,确定所述等价路径异常;以及根据所述等价路径上的其他设备发送的探测响应报文确定故障设备。The second determining unit is configured to determine that the equivalent-cost path is abnormal when the probe response message sent by the destination device is not received within a preset time; and according to the probes sent by other devices on the equal-cost path The response message identifies the faulty device.

结合第六方面、第六方面的第一种可能的实现方式、第六方面的第二种可能的实现方式中的任一种实现方式,在第六方面的第三种可能的实现方式下,还包括:In combination with any of the sixth aspect, the first possible implementation of the sixth aspect, and the second possible implementation of the sixth aspect, in the third possible implementation of the sixth aspect, Also includes:

接收单元,用于接收控制器发送的所述源设备所在的每条直连路径的标签与所述直连路径的对应关系。The receiving unit is configured to receive the corresponding relationship between the label of each direct path where the source device is located and the direct path sent by the controller.

存储单元,用于存储所述接收单元接收的对应关系。A storage unit, configured to store the corresponding relationship received by the receiving unit.

本发明预先为网络中每条直连路径分配标签,且当源设备与目的设备间存在N条等价路径时,相应地生成N个探测报文,进而依据每个探测报文中的标签列表实现探测报文沿指定等价路径被转发。由于本发明中每一探测报文中的标签列表用于表示一条等价路径,且各个探测报文中的标签列表不同,因此本发明依据标签列表中的标签顺序完成N个探测报文的转发能够遍历源设备与目的设备间存在的所有等价路径。且在探测报文的转发过程中,第一设备(即中间设备)在继续依据标签列表顺序转发探测报文的同时,还生成探测响应报文,并将该探测响应报文发送给源设备,因此本发明中的源设备可以通过判断是否接收到各个中间设备反馈的探测响应报文,来判断该标签列表表示的等价路径的连通性。因此,本发明能够实现对源设备与目的设备间存在的所有等价路径的连通性探测。The present invention pre-allocates labels for each direct path in the network, and when there are N equivalent paths between the source device and the destination device, correspondingly generate N detection messages, and then according to the label list in each detection message Realize that detection packets are forwarded along the specified equal-cost path. Since the label list in each detection message in the present invention is used to represent an equivalent path, and the label lists in each detection message are different, the present invention completes the forwarding of N detection messages according to the label order in the label list All equivalent paths between the source device and the destination device can be traversed. In addition, during the forwarding process of the detection message, the first device (ie, the intermediate device) generates a detection response message while continuing to forward the detection message in sequence according to the label list, and sends the detection response message to the source device, Therefore, the source device in the present invention can judge the connectivity of the equivalent path represented by the label list by judging whether it has received the probe response message fed back by each intermediate device. Therefore, the present invention can realize the connectivity detection of all equivalent paths existing between the source device and the destination device.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings that are required in the description of the embodiments or the prior art.

图1为现有技术中一种连通性探测方法的示意图;FIG. 1 is a schematic diagram of a connectivity detection method in the prior art;

图2为现有技术中另一种连通性探测方法的示意图;FIG. 2 is a schematic diagram of another connectivity detection method in the prior art;

图3为现有技术中再一种连通性探测方法的示意图;3 is a schematic diagram of another connectivity detection method in the prior art;

图4为本发明中标签分配过程示意图;Fig. 4 is a schematic diagram of the label assignment process in the present invention;

图5为本发明实施例提供的一种连通性探测方法的流程示意图;FIG. 5 is a schematic flowchart of a connectivity detection method provided by an embodiment of the present invention;

图6为本发明中标签列表的结构示意图;Fig. 6 is a structural schematic diagram of a label list in the present invention;

图7为本发明实施例提供的另一种连通性探测方法的流程示意图;FIG. 7 is a schematic flowchart of another connectivity detection method provided by an embodiment of the present invention;

图8为本发明实施例提供的再一种连通性探测方法的流程示意图;FIG. 8 is a schematic flowchart of another connectivity detection method provided by an embodiment of the present invention;

图9为本发明实施例提供的一种控制器的结构示意图;FIG. 9 is a schematic structural diagram of a controller provided by an embodiment of the present invention;

图10为本发明实施例提供的另一种控制器的结构示意图;FIG. 10 is a schematic structural diagram of another controller provided by an embodiment of the present invention;

图11为本发明实施例提供的一种设备的结构示意图;FIG. 11 is a schematic structural diagram of a device provided by an embodiment of the present invention;

图12为本发明实施例提供的另一种设备的结构示意图;Fig. 12 is a schematic structural diagram of another device provided by an embodiment of the present invention;

图13为本发明实施例提供的再一种设备的结构示意图;Fig. 13 is a schematic structural diagram of another device provided by an embodiment of the present invention;

图14为本发明实施例提供的再一种设备的结构示意图。Fig. 14 is a schematic structural diagram of another device provided by an embodiment of the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

在本发明中,本发明预先为网络中每个直连路径分配标签,其中,所述直连路径为仅包括两个网络设备且以所述两个网络设备为端点的路径。例如图4所示,源设备为设备1、目的设备为设备2、中间设备包括设备A、设备B和设备C,那么本发明预先为设备1与设备A间的直连路径分配第一标签8001,为设备A与设备B间的直连路径分配第二标签8011,为设备B与设备2间的直连路径分配第三标签8021,为设备A与设备C间的直连路径分配第四标签8012,为设备C与设备2间的直连路径分配第五标签8022。In the present invention, the present invention pre-allocates a label for each direct path in the network, wherein the direct path is a path that only includes two network devices and takes the two network devices as end points. For example, as shown in Figure 4, the source device is device 1, the destination device is device 2, and the intermediate devices include device A, device B, and device C, then the present invention pre-allocates the first label 8001 for the direct path between device 1 and device A , assign the second label 8011 to the direct path between device A and device B, assign the third label 8021 to the direct path between device B and device 2, and assign the fourth label to the direct path between device A and device C 8012. Allocate a fifth label 8022 for the direct path between device C and device 2.

具体地本发明中为网络中每条直连路径分配标签的方法可以包括:Specifically, the method for assigning labels for each direct path in the network in the present invention may include:

步骤001,收集网络拓扑;Step 001, collecting network topology;

步骤002,根据所述网络拓扑为网络中的每条直连路径分配标签;Step 002, assigning a label to each direct path in the network according to the network topology;

步骤003,向所述网络中的每个网络设备发送所述网络设备所在的每条直连路径的标签。Step 003, sending the label of each direct path where the network device is located to each network device in the network.

具体在本发明中,本发明通过采集各个设备间的直连路径,以得到由各个设备构成的网络拓扑,进而依据所述网络拓扑,为每条直连路径分配标签。可选地,本发明可以由网络中的控制器controller采集每个设备间的连接关系,以得到各个设备间的直连路径,进而得到整个网络的网络拓扑,此时controller为该网络中的每个直连路径分配标签。然后,controller将分配好的标签下发到相关设备中。Specifically, in the present invention, the present invention obtains a network topology composed of various devices by collecting direct connection paths between various devices, and then assigns a label to each direct connection path according to the network topology. Optionally, in the present invention, the controller in the network can collect the connection relationship between each device, so as to obtain the direct connection path between each device, and then obtain the network topology of the entire network. At this time, the controller is each device in the network. Labels are assigned to directly connected paths. Then, the controller sends the allocated labels to related devices.

此外,本发明还可以通过扩展内部网关协议(英文:Interior GatewayProtocol,简称IGP)进行多协议标签交换(英文:Multi-Protocol Label Switching,简称:MPLS)标签分配,以实现对各个设备间的直连路径的标签分配。In addition, the present invention can also perform multi-protocol label switching (English: Multi-Protocol Label Switching, abbreviated: MPLS) label allocation by extending the Interior Gateway Protocol (English: Interior Gateway Protocol, referred to as IGP), so as to realize the direct connection between various devices. The label assignment for the path.

具体地,如图5所示,其示出了本发明实施例提供的一种连通性探测方法的流程示意图,该方法被控制器执行,所述方法具体包括:Specifically, as shown in FIG. 5 , it shows a schematic flowchart of a connectivity detection method provided by an embodiment of the present invention. The method is executed by a controller, and the method specifically includes:

步骤101,确定源设备与目的设备之间存在N条等价路径;所述N大于等于2。Step 101, determine that there are N equivalent paths between the source device and the destination device; said N is greater than or equal to 2.

具体地,本发明可以根据所述网络拓扑确定所述源设备与目的设备之间存在N条等价路径。Specifically, the present invention may determine that N equal-cost paths exist between the source device and the destination device according to the network topology.

仍以图4所示为例,那么本发明可以确定源设备1与目的设备2之间存在两条等价路径,分别为:设备1-设备A-设备B-设备2和设备1-设备A-设备C-设备2。Still taking the example shown in Figure 4, the present invention can determine that there are two equivalent paths between the source device 1 and the destination device 2, which are: device 1-device A-device B-device 2 and device 1-device A - Device C - Device 2.

步骤102,生成N个探测报文。Step 102, generating N detection packets.

在本发明中,当本发明完成对整个网络中各个设备间的直连路径的标签分配后,本发明首先确定源设备与目的设备间存在的等价路径数量,并生成相同数量的探测报文。In the present invention, after the present invention completes the label allocation of the direct paths between the various devices in the entire network, the present invention first determines the number of equivalent paths existing between the source device and the destination device, and generates the same number of detection messages .

其中,所述N个探测报文中的任意一个包括源地址、目的地址和用于表示一条等价路径的标签列表。其中,所述源地址为所述源设备的因特网协议(英文:InternetProtocol,简称:IP)地址,所述目的地址为所述目的设备的IP地址;所述标签列表包括指针和多个顺序排列的标签,每个标签用于表示一条直连路径。当本发明中指针指向所述多个顺序排列的标签中的一个标签时,能够控制所述探测报文向所述一个标签对应的出端口进行转发。其中,不同探测报文中的标签列表不同,出端口对应所述探测报文继续转发的下一直连路径。Wherein, any one of the N detection packets includes a source address, a destination address, and a label list used to indicate an equal-cost path. Wherein, the source address is the Internet Protocol (English: Internet Protocol, IP) address of the source device, and the destination address is the IP address of the destination device; the label list includes pointers and a plurality of sequentially arranged Labels, each label is used to represent a direct path. In the present invention, when the pointer points to one of the plurality of sequentially arranged labels, the detection message can be controlled to be forwarded to the egress port corresponding to the one label. Wherein, the label lists in different detection messages are different, and the egress port corresponds to the next direct path through which the detection messages are forwarded.

步骤103,向所述源设备发送所述N个探测报文,以使所述源设备将所述N个探测报文分别发送给所述N条等价路径中对应的一条等价路径以检测所述N条等价路径的连通性。Step 103, sending the N detection packets to the source device, so that the source device sends the N detection packets to a corresponding one of the N equivalent paths to detect Connectivity of the N equivalent paths.

具体仍以图4所示为例,本发明中源设备1与目的设备2间包括两条等价路径,分别为:设备1-设备A-设备B-设备2和设备1-设备A-设备C-设备2。此时,本发明会依据该两条等价路径生成两个探测报文,如第一探测报文和第二探测报文。该两个探测报文中均包括设备1的IP地址、设备2的IP地址和一个标签列表,其中第一探测报文中包括第一标签列表,所述第一标签列表用于表示设备1-设备A-设备B-设备2这条路径,第二探测报文中包括第二标签列表,所述第二标签列表用于表示设备1-设备A-设备C-设备2这条路径。Still taking the example shown in Figure 4 as an example, there are two equal-cost paths between the source device 1 and the destination device 2 in the present invention, which are: device 1-device A-device B-device 2 and device 1-device A-device C-device 2. At this time, the present invention will generate two detection messages based on the two equal-cost paths, such as a first detection message and a second detection message. The two detection messages both include the IP address of device 1, the IP address of device 2, and a label list, wherein the first detection message includes a first label list, and the first label list is used to indicate that device 1- For the path of device A-device B-device 2, the second detection message includes a second label list, and the second label list is used to indicate the path of device 1-device A-device C-device 2.

在本发明中,欲探测设备1与设备2间包括的所有路径的连通性,本发明会将该两个探测报文均下发给设备1,以控制设备1首先分别按照该两个探测报文中的标签列表中的第一标签,将探测报文转发至第一标签对应的第一设备。In the present invention, to detect the connectivity of all paths included between device 1 and device 2, the present invention will send the two detection messages to device 1, so as to control device 1 to follow the two detection messages respectively. The first label in the label list in the text forwards the detection message to the first device corresponding to the first label.

对于本发明中的标签列表,其包括指针和多个顺序排列的标签,该多个顺序排列的标签即指示的一条路径。仍以图4所示为例,用于表示设备1-设备A-设备B-设备2的第一标签列表中的标签包括顺序排列的第一标签8001、第二标签8011和第三标签8021,用于表示设备1-设备A-设备C-设备2的第二标签列表中的标签包括顺序排列的第一标签8001、第四标签8012和第五标签8022,其中标签列表的具体结构形式可参阅图6所示。与此同时,标签列表中还包括指针,指针用于指向该多个顺序排列的标签中的一个标签。具体地,当所述指针指向所述多个顺序排列的标签中的一个标签时,控制所述探测报文向所述一个标签对应出端口进行转发。As for the tag list in the present invention, it includes a pointer and a plurality of sequentially arranged tags, and the plurality of sequentially arranged tags is an indicated path. Still taking the example shown in FIG. 4, the tags in the first tag list used to represent device 1-device A-device B-device 2 include a first tag 8001, a second tag 8011, and a third tag 8021 arranged in sequence, The tags in the second tag list used to represent device 1-device A-device C-device 2 include the first tag 8001, the fourth tag 8012 and the fifth tag 8022 arranged in sequence, wherein the specific structure of the tag list can be found in Figure 6 shows. At the same time, the label list also includes a pointer, and the pointer is used to point to one of the multiple sequentially arranged labels. Specifically, when the pointer points to a label among the plurality of sequentially arranged labels, the detection message is controlled to be forwarded to the egress port corresponding to the one label.

为了便于对本发明实施例的进一步说明,下面本发明以探测设备1-设备A-设备B-设备2这一等价路径的连通性为例继续说明。如图7所示,其示出了本发明实施例提供的另一种连通性探测方法的流程示意图,该方法被第一设备执行,方法具体包括:In order to facilitate further description of the embodiment of the present invention, the present invention will continue to be described below by taking the connectivity of the equivalent path of detecting device 1-device A-device B-device 2 as an example. As shown in FIG. 7 , it shows a schematic flowchart of another connectivity detection method provided by an embodiment of the present invention. The method is executed by the first device, and the method specifically includes:

步骤201,第一设备接收探测报文。In step 201, the first device receives a detection message.

其中,所述第一设备可以是一条等价转发路径上除源设备和目的设备之外的任意设备。所述探测报文包括源地址、目的地址和用于表示一条等价路径的标签列表。其中,所述源地址为所述等价路径的源设备(即设备1)的IP地址,所述目的地址为所述等价路径的目的设备(即设备2)的IP地址;所述标签列表包括指针和多个顺序排列的标签,每个标签用于表示一条直连路径;其中,所述直连路径为仅包括两个网络设备且以所述两个网络设备为端点的路径。Wherein, the first device may be any device on an equal-cost forwarding path except the source device and the destination device. The detection message includes a source address, a destination address, and a label list used to represent an equal-cost path. Wherein, the source address is the IP address of the source device (i.e. device 1) of the equal-cost path, and the destination address is the IP address of the destination device (i.e. device 2) of the equal-cost path; the label list It includes a pointer and a plurality of labels arranged in sequence, and each label is used to represent a direct connection path; wherein, the direct connection path is a path that only includes two network devices and takes the two network devices as endpoints.

在本实施例中,假设第一设备为设备A,本发明中的设备1会首先依据探测报文的标签列表中指针指向的第一标签,确定该第一标签的出端口,经由该出端口向第一标签对应的设备A发送探测报文。In this embodiment, assuming that the first device is device A, the device 1 in the present invention will first determine the outgoing port of the first label according to the first label pointed to by the pointer in the label list of the detection message, and through the outgoing port Send a detection packet to device A corresponding to the first label.

在本发明中,出端口是用于确定探测报文继续转发的下一直连路径的。具体在本实施例中,以设备A作为探测报文发送端的直连路径包括两条,那么对应的,设备A上会包括两个出端口,该两个出端口分别对应设备A与设备B间的直连路径,和设备A与设备C间的直连路径。本发明为了保证设备A成功无误地发送到设备B,则需要首先依据指针指向的第一标签确定设备A与设备B间的直连路径对应的出端口,如出端口1,只要设备A将探测报文从该出端口1发出,则保证了探测报文会经由设备A与设备B间的直连路径发送至设备B。In the present invention, the egress port is used to determine the next direct path for further forwarding of the detection message. Specifically, in this embodiment, the direct connection path with device A as the sender of the detection message includes two, so correspondingly, device A will include two outbound ports, and the two outbound ports correspond to the connection between device A and device B respectively. and the direct path between device A and device C. In order to ensure that device A is sent to device B successfully and without error, the present invention needs to first determine the output port corresponding to the direct connection path between device A and device B according to the first label pointed by the pointer, such as output port 1, as long as device A will detect The packet is sent from the egress port 1, which ensures that the detection packet will be sent to the device B through the direct connection path between the device A and the device B.

需要说明的是,在实际应用过程中,源设备中探测报文的标签列表中,指针一般都是指向的第一个标签。It should be noted that, in the actual application process, in the label list of the detection message in the source device, the pointer generally points to the first label.

本实施例中的第一标签为8001,第二标签为8011,第三标签为8021,此时标签列表可以表示为:8001*/8011/8021,其中*为指针,此时表示指针指向第一标签8001。具体在发明中,如果当前指针指向于第一标签8001,则用于告知设备1将探测报文向第一标签8001对应的出端口进行转发,即转发至设备A。如果当前指针指向于第二标签8011,则用于告知设备A将探测报文继续向第二标签8011对应的出端口进行转发,即转发至设备B。In this embodiment, the first label is 8001, the second label is 8011, and the third label is 8021. At this time, the label list can be expressed as: 8001*/8011/8021, where * is a pointer, which means that the pointer points to the first Label 8001. Specifically, in the invention, if the current pointer points to the first label 8001, it is used to inform the device 1 to forward the detection message to the output port corresponding to the first label 8001, that is, to forward to the device A. If the current pointer points to the second label 8011, it is used to inform the device A to continue forwarding the detection message to the egress port corresponding to the second label 8011, that is, to forward the detection message to the device B.

那么具体在本实施例中,设备A接收到的标签列表为8001/8011*/8021,即指针指向第二标签8011。So specifically in this embodiment, the tag list received by device A is 8001/8011*/8021, that is, the pointer points to the second tag 8011.

在本实施例中可选的,第一设备可以通过接收并存储控制器发送的所述源设备所在的每条直连路径的标签与所述直连路径的对应关系,也可通过IGP进行MPLS标签分配,以获得所述第一设备所在的每条直连路径的标签,并存储每条直连路径与所述直连路径的标签的对应关系。Optionally in this embodiment, the first device may receive and store the corresponding relationship between the label of each direct path where the source device is located and the direct path sent by the controller, or perform MPLS through the IGP. label allocation, to obtain the label of each direct connection path where the first device is located, and store the correspondence between each direct connection path and the label of the direct connection path.

步骤202,第一设备依据所述探测报文生成探测响应报文。其中探测响应报文包括源地址和目的地址,所述源地址为所述第一设备的IP地址,所述目的地址为所述源设备的IP地址。Step 202, the first device generates a probe response message according to the probe message. The probe response message includes a source address and a destination address, the source address is the IP address of the first device, and the destination address is the IP address of the source device.

在本实施例中,设备A在接收到探测报文后,会依据该探测报文生成探测响应报文,该探测响应报文以设备A的IP地址作为源地址,以设备1的IP地址作为目的地址。In this embodiment, after receiving the probe message, device A generates a probe response message based on the probe message. The probe response message uses the IP address of device A as the source address and the IP address of device 1 as the source address. Destination address.

步骤203,第一设备将所述探测响应报文发送至所述源设备。Step 203, the first device sends the probe response packet to the source device.

设备A在生成探测响应报文后,依据探测响应报文中的目的地址,即设备1的IP地址,将探测响应报文发送至设备1。After generating the probe response message, device A sends the probe response message to device 1 according to the destination address in the probe response message, that is, the IP address of device 1 .

步骤204,第一设备依据指针指向的当前标签,确定所述探测报文的出端口,所述出端口对应所述等价路径上的下一直连路径。In step 204, the first device determines the egress port of the probe message according to the current label pointed to by the pointer, and the egress port corresponds to the next direct path on the equal-cost path.

在本实施例中,设备A包括两个出端口,如出端口1对应设备A与设备B间的直连路径,出端口2对应设备A与设备C间的直连路径。具体地,设备A在继续转发探测报文时,首先依据指针指向的第二标签8011确定探测报文进行后续转发的出端口为出端口1,通过该出端口1将探测报文沿设备A与设备B间的直连路径继续转发。In this embodiment, device A includes two outgoing ports. For example, outgoing port 1 corresponds to a direct connection path between device A and device B, and outgoing port 2 corresponds to a direct connection path between device A and device C. Specifically, when device A continues to forward the detection message, first, according to the second label 8011 pointed to by the pointer, it determines that the output port for the subsequent forwarding of the detection message is output port 1, and through the output port 1, the detection message is sent along the path between device A and The direct path between devices B continues to forward.

步骤205,第一设备通过所述出端口向所述下一直连路径发送所述探测报文。Step 205, the first device sends the detection message to the next direct path through the egress port.

在本实施例中,设备A依据第二标签8011,确定出第二标签8011对应的出端口,进而将探测报文从该出端口继续向设备B进行转发。In this embodiment, device A determines the outbound port corresponding to the second label 8011 according to the second label 8011, and then forwards the detection message from the outbound port to device B.

在本发明上述实施例中,当指针不指向所述标签列表中的最后一个标签时,在步骤205中第一设备发送所述探测报文之前,所述方法还包括:第一设备控制所述指针沿所述标签列表顺序移动到下一标签位置。In the above embodiments of the present invention, when the pointer does not point to the last label in the label list, before the first device sends the detection message in step 205, the method further includes: the first device controls the The pointer moves to the next label position sequentially along the label list.

在本发明中,当第一设备在确定探测报文进行后续转发的出端口后,第一设备便将指针沿所述标签列表顺序移动到下一标签位置。具体地,即本实施例中的设备A将指针*顺序移动到第三标签8021后面,此时的标签列表为:8001/8011/8021*,以用于告知设备B,设备B继续转发探测报文的转发路径为第三标签8021对应的出端口,即具体向设备C(第二设备)继续转发探测报文。In the present invention, after the first device determines the outgoing port for the subsequent forwarding of the detection message, the first device moves the pointer along the label list to the next label position sequentially. Specifically, the device A in this embodiment moves the pointer * to the back of the third label 8021 in order, and the label list at this time is: 8001/8011/8021*, which is used to inform the device B that the device B continues to forward the detection message The forwarding path of the message is the egress port corresponding to the third label 8021, that is, to continue forwarding the detection message to the device C (the second device).

需要说明的是在本实施例中,设备A在接收到设备1发送的探测报文后,一共包括两个处理动作,一个处理动作为步骤202至步骤203,生成探测响应报文,并将探测响应报文发送至设备1;另一处理动作为步骤204-步骤205,设备A控制指针沿标签列表顺序移动到下一标签位置,并完成探测报文的继续转发。因此,本发明上述实施例只是示例性实施例,本发明对于上述两个处理动作的执行顺序不做限定。It should be noted that in this embodiment, after device A receives the detection message sent by device 1, it includes two processing actions in total. One processing action is step 202 to step 203, which generates a detection response message and sends the detection The response message is sent to device 1; another processing action is step 204-step 205, device A controls the pointer to move to the next label position along the label list, and completes the continued forwarding of the detection message. Therefore, the above embodiments of the present invention are only exemplary embodiments, and the present invention does not limit the execution order of the above two processing actions.

当然,对于本发明上述实施例,其第一设备也可以为设备B,其设备B的处理动作与设备A的处理动作相同,即在接收到设备A发送的探测报文后,生成第二探测响应报文,并将第二探测响应报文发送至设备1,并继续控制指针沿标签列表顺序移动到下一标签位置,控制探测报文的继续转发。其唯一不同在于,设备B生成第二探测响应报文中的源地址为设备B的IP地址,目的地址仍为设备1的IP地址。Of course, for the above-mentioned embodiments of the present invention, the first device may also be device B, and the processing action of device B is the same as that of device A, that is, after receiving the detection message sent by device A, the second detection message is generated. Response message, and send the second probe response message to device 1, and continue to control the pointer to move to the next label position in order along the label list, so as to control the continued forwarding of the probe message. The only difference is that the source address in the second probe response message generated by device B is the IP address of device B, and the destination address is still the IP address of device 1 .

在本发明另一个实施例中,如果当指针指向所述标签列表中的最后一个标签时,在步骤205第一设备发送所述探测报文之前,所述方法还包括:第一设备删除所述标签列表中的指针。In another embodiment of the present invention, if the pointer points to the last label in the label list, before the first device sends the detection message in step 205, the method further includes: the first device deletes the Pointer to a list of labels.

在本实施例中,第一设备为设备B。设备B接收到设备A发送的探测报文后,继续控制指针沿所述标签列表顺序移动到下一标签位置,此时探测报文中标签列表为:8001/8011/8021*,显然指针已经移动到了标签列表中最后一个标签的位置处,此时设备B依据指针指向的最后一个标签8021,确定该最后一个标签8021对应的直连路径,将探测报文发送至设备2。In this embodiment, the first device is device B. After device B receives the detection message sent by device A, it continues to control the pointer to move to the next label position along the label list. At this time, the label list in the detection message is: 8001/8011/8021*, obviously the pointer has moved At the position of the last label in the label list, device B determines the direct connection path corresponding to the last label 8021 according to the last label 8021 pointed to by the pointer, and sends the probe message to device 2.

需要说明的是,在本实施例中,由于当前指针已经指向了标签列表中的最后一个标签,那么当设备B把探测报文发送至设备2前,设备B会删除标签列表中的指针。此时,设备2接收到的探测报文中的标签列表中不再包括指针,那么当设备2接收到探测报文,检测到标签列表中并不包括指针时,不再继续转发探测报文,而只向设备1返回一探测响应报文,该探测响应报文中的源地址为设备2的IP地址,目的地址为设备1的IP地址。It should be noted that, in this embodiment, since the current pointer has already pointed to the last label in the label list, before device B sends the probe message to device 2, device B will delete the pointer in the label list. At this time, the label list in the detection message received by device 2 no longer includes pointers, so when device 2 receives the detection message and detects that the label list does not include pointers, it will not continue to forward the detection message. Instead, only a probe response message is returned to the device 1, the source address in the probe response message is the IP address of the device 2, and the destination address is the IP address of the device 1.

最后还需要说明的是,在有些情况下,如本发明附图4,源设备1与目的设备2间包括的两条等价路径的前段直连路径相同,即对于该两条等价路径均需要设备1先发送探测报文至设备A,那么此时,本发明在生成标签列表时,标签列表中可以不包括前段相同的直连路径的标签,而只包括从分支点开始的后段直连路径的标签,例如,对于上述实施例中的第一标签列表和第二标签列表来说,其第一标签列表可以为8011*/8021,第二标签列表为8012*/8022。当设备A接收到包括第一标签列表的第一探测报文时,将第一探测报文按照标签8011指向的出端口进行转发,当设备A接收到包括第二标签列表的第二探测报文时,将第二探测报文按照标签8012指向的出端口进行转发。Finally, it should be noted that, in some cases, as shown in Figure 4 of the present invention, the front-end direct paths of the two equal-cost paths included between the source device 1 and the destination device 2 are the same, that is, the two equal-cost paths are It is necessary for device 1 to send a detection message to device A first, so at this time, when the present invention generates a label list, the label list may not include the label of the same direct path in the previous section, but only include the back section direct path starting from the branch point. For the labels of connected paths, for example, for the first label list and the second label list in the above embodiment, the first label list may be 8011*/8021, and the second label list may be 8012*/8022. When device A receives the first detection packet including the first label list, it forwards the first detection packet according to the outgoing port pointed to by the label 8011; when device A receives the second detection packet including the second label list , forward the second detection packet according to the outgoing port pointed to by the label 8012.

因此应用本发明上述技术方案,本发明预先为网络中每条直连路径分配标签,且当源设备与目的设备间存在N条等价路径时,相应地生成N个探测报文,进而依据每个探测报文中的标签列表实现探测报文沿指定直连路径被转发。由于本发明中每一探测报文中的标签列表用于表示一条等价路径,且各个探测报文中的标签列表不同,因此本发明依据标签列表中的标签顺序完成N个探测报文的转发能够遍历源设备与目的设备间存在的所有等价路径。且在探测报文的转发过程中,第一设备(即中间设备)在继续依据标签列表顺序转发探测报文的同时,还生成探测响应报文,并将该探测响应报文发送给源设备,因此本发明中的源设备可以通过判断是否接收到各个中间设备反馈的探测响应报文,来实现判断该标签列表表示的等价路径的连通性。因此,本发明能够实现对源设备与目的设备间存在的所有路径的连通性探测。Therefore, applying the above-mentioned technical solution of the present invention, the present invention pre-allocates labels for each direct connection path in the network, and when there are N equivalent paths between the source device and the destination device, correspondingly generate N detection messages, and then according to each The label list in each detection message realizes that the detection message is forwarded along the specified direct path. Since the label list in each detection message in the present invention is used to represent an equivalent path, and the label lists in each detection message are different, the present invention completes the forwarding of N detection messages according to the label order in the label list All equivalent paths between the source device and the destination device can be traversed. In addition, during the forwarding process of the detection message, the first device (ie, the intermediate device) generates a detection response message while continuing to forward the detection message in sequence according to the label list, and sends the detection response message to the source device, Therefore, the source device in the present invention can judge the connectivity of the equivalent path represented by the label list by judging whether it has received the probe response message fed back by each intermediate device. Therefore, the present invention can realize the connectivity detection of all paths existing between the source device and the destination device.

基于前文本发明实施例提供的一种连通性探测方法,本发明还提供一种连通性探测方法,如图8所示,该方法被源设备执行,方法具体包括:Based on the connectivity detection method provided in the foregoing invention embodiments, the present invention also provides a connectivity detection method, as shown in FIG. 8, the method is executed by the source device, and the method specifically includes:

步骤301,源设备接收探测报文。In step 301, the source device receives a detection message.

其中,所述探测报文包括源地址、目的地址和用于表示一条等价路径的标签列表;其中,所述源地址为所述源设备的IP地址,所述目的地址为所述等价路径的目的设备的IP地址;所述标签列表包括指针和多个顺序排列的标签,每个标签用于表示一条直连路径;其中,所述直连路径为仅包括两个网络设备且以所述两个网络设备为端点的路径。Wherein, the probe message includes a source address, a destination address, and a label list for representing an equivalent path; wherein, the source address is the IP address of the source device, and the destination address is the equivalent path The IP address of the destination device; the label list includes a pointer and a plurality of sequentially arranged labels, and each label is used to represent a direct path; wherein, the direct path includes only two network devices and uses the A path where two network devices are endpoints.

在本实施例中,源设备首先接收来自于控制器发送的探测报文,进而依据接收到的探测报文中的标签列表执行后续的发送过程。In this embodiment, the source device first receives the detection message sent by the controller, and then performs a subsequent sending process according to the label list in the received detection message.

在本实施例中可选地,源设备可以接收并存储控制器发送的所述源设备所在的每条直连路径的标签与所述直连路径的对应关系,以清楚地获知每条等价路径。Optionally in this embodiment, the source device may receive and store the corresponding relationship between the label of each direct path where the source device is located and the direct path sent by the controller, so as to clearly know the equivalent path.

步骤302,源设备依据所述指针指向的第一标签,确定所述第一标签对应的出端口,其中所述出端口对应所述等价路径上的下一直连路径。In step 302, the source device determines an outbound port corresponding to the first label according to the first label pointed to by the pointer, wherein the outbound port corresponds to a next direct path on the equal-cost path.

仍以图4所示,以及探测设备1-设备A-设备B-设备2这一等价路径的连通性为例继续说明。其中探测报文的标签列表为:8001*/8011/8021,当前指针*指向于第一标签8001,设备1依据该第一标签8001确定该第一标签8001对应的出端口。Still taking the connectivity shown in FIG. 4 and detecting the equivalent path of device 1-device A-device B-device 2 as an example to continue the description. The label list of the detection message is: 8001*/8011/8021, the current pointer * points to the first label 8001, and the device 1 determines the egress port corresponding to the first label 8001 according to the first label 8001.

步骤303,源设备控制所述指针沿所述标签列表顺序移动到第二标签位置。Step 303, the source device controls the pointer to move sequentially along the label list to a second label position.

当设备1确定探测报文转发的下一直连路径后,将指针沿所述标签列表顺序移动到第二标签位置,即当前的标签列表为:8001/8011*/8021。After device 1 determines the next direct path for forwarding the probe message, it moves the pointer to the second label position sequentially along the label list, that is, the current label list is: 8001/8011*/8021.

步骤304,源设备依据所述出端口,通过所述下一直连路径发送所述探测报文以检测所述等价路径的连通性。Step 304, the source device sends the detection message through the next direct path according to the egress port to detect the connectivity of the equal-cost path.

具体地,设备1将所述探测报文通过设备1与设备A间的直连路径发送至设备A。Specifically, device 1 sends the detection packet to device A through the direct path between device 1 and device A.

其中优选地,方法还包括:Wherein preferably, method also comprises:

源设备接收所述等价路径上的第一设备发送的探测响应报文,确定所述源设备与所述第一设备之间的路径连通。The source device receives the probe response packet sent by the first device on the equal-cost path, and determines that the path between the source device and the first device is connected.

其中,所述第一设备为所述等价路径上除所述源设备之外的设备,如设备A、设备B。Wherein, the first device is a device on the equivalent path other than the source device, such as device A and device B.

在本实施例中,当设备1接收到设备A返回的探测响应报文时,表明当前从设备1到设备A间的路径连通,当设备1接收到设备B返回的探测响应报文时,表明当前从设备1到设备B间的路径连通。In this embodiment, when device 1 receives the probe response message returned by device A, it indicates that the current path from device 1 to device A is connected; when device 1 receives the probe response message returned by device B, it indicates that The current path from device 1 to device B is connected.

此外,当所述源设备在预设时间内没有收到所述目的设备发送的探测响应报文时,所述源设备确定所述等价路径异常。In addition, when the source device does not receive the probe response message sent by the destination device within a preset time, the source device determines that the equal-cost path is abnormal.

在本实施例中,当设备1在预设时间内没有收到设备2发送的探测响应报文时,设备1确定等价路径设备1-设备A-设备B-设备2异常。In this embodiment, when device 1 does not receive the probe response message sent by device 2 within a preset time, device 1 determines that the equal-cost path device 1-device A-device B-device 2 is abnormal.

为了进一步确定发生故障的故障设备,本发明还可以进一步包括:In order to further determine the faulty equipment that has failed, the present invention may further include:

源设备根据所述等价路径上的其他设备发送的探测响应报文确定故障设备。The source device determines the faulty device according to the probe response packets sent by other devices on the equal-cost path.

在本发明实际应用过程中,源设备会不断地接收到除所述源设备之外的其他设备返回得探测响应报文,具体地,当源设备接收到设备A返回的探测响应报文,并接收到设备B返回的探测响应报文和设备2返回的探测响应报文,可以确定当前等价路径设备1-设备A-设备B-设备2连通。当源设备只接收到设备A返回的探测响应报文和设备B返回的探测响应报文,而未接收到设备2返回的探测响应报文时,可以确定探测报文被丢失在了从设备B到设备2间的直连路径上,此时确定等价路径设备1-设备A-设备B-设备2不连通。During the actual application of the present invention, the source device will continuously receive probe response messages returned by other devices except the source device. Specifically, when the source device receives the probe response message returned by device A, and After receiving the probe response message returned by device B and the probe response message returned by device 2, it can be determined that the current equal-cost path device 1-device A-device B-device 2 is connected. When the source device only receives the probe response message returned by device A and the probe response message returned by device B, but does not receive the probe response message returned by device 2, it can be determined that the probe message is lost in the slave device B. On the direct path between devices 2, it is determined that the equivalent-cost path device 1-device A-device B-device 2 is not connected.

因此本发明通过判断源设备是否接收到各个中间设备反馈的探测响应报文,来实现判断该标签列表表示的路径的连通性。Therefore, the present invention realizes judging the connectivity of the path represented by the label list by judging whether the source device has received the probe response message fed back by each intermediate device.

基于前文本发明提供的一种连通性探测方法,本发明还提供一种控制器,如图9所示,包括:Based on a connectivity detection method provided by the previous invention, the present invention also provides a controller, as shown in FIG. 9 , including:

等价路径数量确定单元901,用于确定源设备与目的设备之间存在N条等价路径;所述N大于等于2;An equivalent path number determining unit 901, configured to determine that there are N equivalent paths between the source device and the destination device; said N is greater than or equal to 2;

探测报文生成单元902,用于生成N个探测报文,所述N个探测报文中的任意一个包括源地址、目的地址和用于表示一条等价路径的标签列表;其中,所述源地址为所述源设备的因特网协议IP地址,所述目的地址为所述目的设备的IP地址;所述标签列表包括指针和多个顺序排列的标签,每个标签用于表示一条直连路径;其中,所述直连路径为仅包括两个网络设备且以所述两个网络设备为端点的路径;A detection message generation unit 902, configured to generate N detection messages, any one of the N detection messages includes a source address, a destination address, and a label list used to represent an equivalent path; wherein, the source The address is the Internet Protocol IP address of the source device, and the destination address is the IP address of the destination device; the label list includes a pointer and a plurality of sequentially arranged labels, and each label is used to represent a direct connection path; Wherein, the direct connection path is a path including only two network devices and taking the two network devices as endpoints;

探测报文发送单元903,用于向所述源设备发送所述N个探测报文,以使所述源设备将所述N个探测报文分别发送给所述N条等价路径中对应的一条等价路径以检测所述N条等价路径的连通性。A detection packet sending unit 903, configured to send the N detection packets to the source device, so that the source device sends the N detection packets to corresponding An equivalent path is used to detect the connectivity of the N equivalent paths.

其中可选地,还包括:Wherein optionally, also include:

收集单元904,用于收集网络拓扑;A collection unit 904, configured to collect network topology;

标签分配单元905,用于根据所述网络拓扑为网络中的每条直连路径分配标签;A label assignment unit 905, configured to assign a label to each direct path in the network according to the network topology;

标签发送单元906,用于向所述网络中的每个网络设备发送所述网络设备所在的每条直连路径的标签;A label sending unit 906, configured to send to each network device in the network the label of each direct path where the network device is located;

此时,所述等价路径数量确定单元901具体用于,根据所述网络拓扑确定所述源设备与目的设备之间存在N条等价路径。At this time, the unit 901 for determining the number of equal-cost paths is specifically configured to determine, according to the network topology, that there are N equal-cost paths between the source device and the destination device.

同时,本发明还提供一种控制器,如图10所示,该控制器可以是包含计算能力的主机服务器,或者是个人计算机PC,或者是可携带的便携式计算机或终端等等,本发明具体实施例并不对控制器的具体实现做限定。控制器包括:At the same time, the present invention also provides a controller, as shown in Figure 10, the controller can be a host server with computing power, or a personal computer PC, or a portable portable computer or terminal, etc., the present invention specifically The embodiment does not limit the specific implementation of the controller. Controllers include:

处理器(processor)100,通信接口(Communications Interface)200,存储器(memory)300,总线400。A processor (processor) 100 , a communication interface (Communications Interface) 200 , a memory (memory) 300 , and a bus 400 .

处理器100,通信接口200,存储器300通过总线400完成相互间的通信。The processor 100 , the communication interface 200 , and the memory 300 communicate with each other through the bus 400 .

处理器100,用于执行程序110。The processor 100 is configured to execute a program 110 .

具体地,程序110可以包括程序代码,所述程序代码包括计算机操作指令。Specifically, the program 110 may include program codes including computer operation instructions.

处理器100可能是一个中央处理器CPU,或者是特定集成电路(英文:ApplicationSpecific Integrated Circuit,简称:ASIC),或者是被配置成实施本发明实施例的一个或多个集成电路。The processor 100 may be a central processing unit CPU, or a specific integrated circuit (English: Application Specific Integrated Circuit, ASIC for short), or one or more integrated circuits configured to implement the embodiments of the present invention.

存储器300,用于存放程序110。存储器300可能包含高速RAM存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。当程序110被执行时,能够实现图5所示的方法。The memory 300 is used to store the program 110 . The memory 300 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one magnetic disk memory. When the program 110 is executed, the method shown in FIG. 5 can be realized.

同时基于前文本发明提供的一种连通性探测方法,本发明还提供一种设备,如图11所示,包括:At the same time, based on the connectivity detection method provided by the previous invention, the present invention also provides a device, as shown in Figure 11, including:

接收单元1101,用于接收探测报文,其中,所述探测报文包括源地址、目的地址和用于表示一条等价路径的标签列表;其中,所述源地址为所述等价路径的源设备的因特网协议IP地址,所述目的地址为所述等价路径的目的设备的IP地址;所述标签列表包括指针和多个顺序排列的标签,每个标签用于表示一条直连路径;其中,所述直连路径为仅包括两个网络设备且以所述两个网络设备为端点的路径;The receiving unit 1101 is configured to receive a detection message, wherein the detection message includes a source address, a destination address and a label list used to represent an equivalent path; wherein the source address is the source of the equivalent path The Internet Protocol IP address of the device, the destination address being the IP address of the destination device of the equal-cost path; the label list includes a pointer and a plurality of sequentially arranged labels, and each label is used to represent a direct path; wherein , the direct path is a path that only includes two network devices and takes the two network devices as endpoints;

探测响应报文生成单元1102,用于依据所述探测报文生成探测响应报文;其中所述探测响应报文包括源地址和目的地址,所述源地址为所述设备的IP地址,所述目的地址为所述源设备的IP地址;A probe response message generation unit 1102, configured to generate a probe response message according to the probe message; wherein the probe response message includes a source address and a destination address, the source address is the IP address of the device, and the The destination address is the IP address of the source device;

第一发送单元1103,用于将所述探测响应报文发送至所述源设备;A first sending unit 1103, configured to send the probe response message to the source device;

确定单元1104,用于依据所述指针指向的当前标签,确定所述探测报文的出端口,所述出端口对应所述等价路径上的下一直连路径;A determining unit 1104, configured to determine an egress port of the probe message according to the current label pointed to by the pointer, where the egress port corresponds to the next direct path on the equal-cost path;

第二发送单元1105,用于通过所述出端口向所述下一直连路径发送所述探测报文。The second sending unit 1105 is configured to send the detection message to the next direct path through the egress port.

其中可选地,所述设备还包括:Wherein optionally, described equipment also comprises:

指针处理单元,用于当所述指针不指向所述标签列表中的最后一个标签时,控制所述指针沿所述标签列表顺序移动到下一标签位置;或,当所述指针指向所述标签列表中的最后一个标签时,删除所述标签列表中的指针。A pointer processing unit, configured to control the pointer to sequentially move to the next label position along the label list when the pointer does not point to the last label in the label list; or, when the pointer points to the label When the last tag in the list, delete the pointer in the list of tags.

其中可选地,所述设备还包括:Wherein optionally, described equipment also comprises:

接收单元,用于接收控制器发送的所述源设备所在的每条直连路径的标签与所述直连路径的对应关系;The receiving unit is configured to receive the corresponding relationship between the label of each direct connection path where the source device is located and the direct connection path sent by the controller;

存储单元,用于存储所述接收单元7000接收的对应关系。The storage unit is configured to store the corresponding relationship received by the receiving unit 7000.

其中可选地,所述设备还包括:Wherein optionally, described equipment also comprises:

标签分配单元,用于通过扩展IGP进行MPLS标签分配,以获得所述第一设备所在的每条直连路径的标签,并存储每条直连路径与所述直连路径的标签的对应关系。The label allocation unit is configured to perform MPLS label allocation through the extended IGP, so as to obtain the label of each direct path where the first device is located, and store the correspondence between each direct path and the label of the direct path.

此外,本发明还提供一种设备,如图12所示,设备包括:In addition, the present invention also provides a device, as shown in Figure 12, the device includes:

处理器2100,通信接口2200,存储器2300,总线2400。Processor 2100 , communication interface 2200 , memory 2300 , and bus 2400 .

处理器2100,通信接口2200,存储器2300通过总线2400完成相互间的通信。The processor 2100 , the communication interface 2200 , and the memory 2300 communicate with each other through the bus 2400 .

处理器2100,用于执行程序2110。The processor 2100 is configured to execute a program 2110 .

具体地,程序2110可以包括程序代码,所述程序代码包括计算机操作指令。Specifically, the program 2110 may include program codes, and the program codes include computer operation instructions.

处理器2100可能是一个中央处理器CPU,或者是特定集成电路ASIC,或者是被配置成实施本发明实施例的一个或多个集成电路。The processor 2100 may be a central processing unit CPU, or an ASIC, or one or more integrated circuits configured to implement embodiments of the present invention.

存储器2300,用于存放程序2110。存储器2300可能包含高速RAM存储器,也可能还包括非易失性存储器,例如至少一个磁盘存储器。程序2110被执行时可以实现图7所示的方法。The memory 2300 is used to store the program 2110 . The memory 2300 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one magnetic disk memory. When the program 2110 is executed, the method shown in FIG. 7 can be realized.

基于前文本发明提供的一种连通性探测方法,本发明还提供一种设备,如图13所示,包括:Based on a connectivity detection method provided by the previous invention, the present invention also provides a device, as shown in Figure 13, including:

接收单元1301,用于接收探测报文,其中,所述探测报文包括源地址、目的地址和用于表示一条等价路径的标签列表;其中,所述源地址为所述源设备的因特网协议IP地址,所述目的地址为所述等价路径的目的设备的IP地址;所述标签列表包括指针和多个顺序排列的标签,每个标签用于表示一条直连路径;其中,所述直连路径为仅包括两个网络设备且以所述两个网络设备为端点的路径;The receiving unit 1301 is configured to receive a detection message, wherein the detection message includes a source address, a destination address, and a label list used to represent an equivalent path; wherein the source address is the Internet protocol address of the source device IP address, the destination address is the IP address of the destination device of the equal-cost path; the label list includes a pointer and a plurality of sequentially arranged labels, and each label is used to represent a direct path; wherein, the direct The connecting path is a path including only two network devices and taking the two network devices as endpoints;

第一确定单元1302,用于依据所述指针指向的第一标签,确定所述第一标签对应的出端口,所述出端口对应所述等价路径上的下一直连路径;The first determining unit 1302 is configured to determine an outbound port corresponding to the first label according to the first label pointed to by the pointer, and the outbound port corresponds to the next direct path on the equivalent path;

指针控制单元1303,用于控制所述指针沿所述标签列表顺序移动到第二标签位置;A pointer control unit 1303, configured to control the pointer to move sequentially along the label list to a second label position;

发送单元1304,用于依据所述出端口,通过所述下一直连路径发送所述探测报文以检测所述等价路径的连通性。The sending unit 1304 is configured to send the probe message through the next direct path according to the egress port to detect the connectivity of the equal-cost path.

可选地,所述第一确定单元1302还用于当接收到所述等价路径上的第一设备发送的探测响应报文时,确定所述源设备与所述第一设备之间的路径连通;Optionally, the first determining unit 1302 is further configured to determine the path between the source device and the first device when receiving the probe response message sent by the first device on the equal-cost path connected;

其中,所述第一设备为所述等价路径上除所述源设备之外的设备。Wherein, the first device is a device on the equivalent path other than the source device.

可选地,所述设备还包括:Optionally, the device also includes:

第二确定单元,用于当在预设时间内没有收到所述目的设备发送的探测响应报文时,确定所述等价路径异常;以及根据所述等价路径上的其他设备发送的探测响应报文确定故障设备。The second determining unit is configured to determine that the equivalent-cost path is abnormal when the probe response message sent by the destination device is not received within a preset time; and according to the probes sent by other devices on the equal-cost path The response message identifies the faulty device.

可选地,所述设备还包括:Optionally, the device also includes:

接收单元,用于接收控制器发送的所述源设备所在的每条直连路径的标签与所述直连路径的对应关系;The receiving unit is configured to receive the corresponding relationship between the label of each direct connection path where the source device is located and the direct connection path sent by the controller;

存储单元,用于存储所述接收单元接收的对应关系。A storage unit, configured to store the corresponding relationship received by the receiving unit.

此外,本发明还提供一种设备,如图14所示,设备包括:In addition, the present invention also provides a device, as shown in Figure 14, the device includes:

处理器3100,通信接口3200,存储器3300,总线3400。Processor 3100 , communication interface 3200 , memory 3300 , and bus 3400 .

处理器3100,通信接口3200,存储器3300通过总线3400完成相互间的通信。The processor 3100 , the communication interface 3200 , and the memory 3300 communicate with each other through the bus 3400 .

处理器3100,用于执行程序3110。The processor 3100 is configured to execute the program 3110 .

具体地,程序3110可以包括程序代码,所述程序代码包括计算机操作指令。Specifically, the program 3110 may include program codes including computer operation instructions.

处理器3100可能是一个中央处理器CPU,或者是特定集成电路ASIC,或者是被配置成实施本发明实施例的一个或多个集成电路。The processor 3100 may be a central processing unit CPU, or an ASIC, or one or more integrated circuits configured to implement embodiments of the present invention.

存储器3300,用于存放程序3110。存储器3300可能包含高速RAM存储器,也可能还包括非易失性存储器,例如至少一个磁盘存储器。程序3110被执行时可以实现图8所示的方法。The memory 3300 is used to store the program 3110 . The memory 3300 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one magnetic disk memory. When the program 3110 is executed, the method shown in FIG. 8 can be realized.

需要说明的是,本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。对于装置类实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. For the same and similar parts in each embodiment, refer to each other, that is, Can. As for the device-type embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and for related parts, please refer to part of the description of the method embodiments.

最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。Finally, it should also be noted that in this text, relational terms such as first and second etc. are only used to distinguish one entity or operation from another, and do not necessarily require or imply that these entities or operations, any such actual relationship or order exists. Furthermore, the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus comprising a set of elements includes not only those elements, but also includes elements not expressly listed. other elements of or also include elements inherent in such a process, method, article, or device. Without further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising said element.

以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。The description of the above embodiments is only used to help understand the method of the present invention and its core idea; meanwhile, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation and scope of application. In summary, the contents of this specification should not be construed as limiting the present invention.

Claims (20)

1. A connectivity probing method, comprising:
Determining that N equal cost paths exist between source equipment and target equipment; the N is more than or equal to 2; the N equivalent paths are determined based on labels distributed to each direct connection path in the network in advance;
Generating N detection messages, wherein any one of the N detection messages comprises a source address, a destination address and a label list for representing an equivalent path; wherein, the source address is an Internet Protocol (IP) address of the source equipment, and the destination address is an IP address of the destination equipment; the label list comprises a pointer and a plurality of labels which are sequentially arranged, and each label is used for representing a direct connection path; the direct connection path is a path which only comprises two network devices and takes the two network devices as endpoints;
and sending the N detection messages to the source equipment, so that the source equipment sends the N detection messages to a corresponding equivalent path in the N equivalent paths respectively to detect the connectivity of the N equivalent paths.
2. The method of claim 1,
Before determining that N equal cost paths exist between the source device and the destination device, the method further includes:
Collecting network topology;
distributing labels for each direct connection path in the network according to the network topology;
Sending a label of each direct connection path where the network equipment is located to each network equipment in the network;
The determining that there are N equal cost paths between the source device and the destination device includes: and determining that N equivalent paths exist between the source equipment and the destination equipment according to the network topology.
3. a connectivity probing method, comprising:
the method comprises the steps that a first device receives a detection message, wherein the detection message comprises a source address, a destination address and a label list used for representing an equivalent path; wherein, the source address is an Internet Protocol (IP) address of a source device of the equal cost path, and the destination address is an IP address of a destination device of the equal cost path; the label list comprises a pointer and a plurality of labels which are sequentially arranged, and each label is used for representing a direct connection path; the direct connection path is a path which only comprises two network devices and takes the two network devices as endpoints; the detection message is generated by a controller, wherein the controller generates one of N detection messages after determining that N equivalent paths exist between the source equipment and the target equipment based on a label pre-allocated to each direct connection path in the network;
the first equipment generates a detection response message according to the detection message; the detection response message comprises a source address and a destination address, wherein the source address is the IP address of the first equipment, and the destination address is the IP address of the source equipment;
the first equipment sends the detection response message to the source equipment;
the first device determines an output port of the detection message according to the current label pointed by the pointer, wherein the output port corresponds to a next direct connection path on the equal cost path;
And the first equipment sends the detection message to the next direct connection path through the output port.
4. The method of claim 3,
when the pointer does not point to the last label in the label list, before the sending the probe packet, the method further includes: the first device controls the pointer to move to the next label position along the label list sequence; or
when the pointer points to the last label in the label list, before the probe packet is sent, the method further includes: and the first equipment deletes the pointer in the label list.
5. the method according to claim 3 or 4, characterized in that the method further comprises:
the first device receives and stores a corresponding relation between the label of each direct connection path where the source device is located and the direct connection path, wherein the label of each direct connection path is sent by the controller.
6. the method according to claim 3 or 4, characterized in that the method further comprises:
the first equipment performs multi-protocol label switching (MPLS) label distribution through an extended Interior Gateway Protocol (IGP) so as to obtain a label of each direct connection path where the first equipment is located, and stores a corresponding relation between each direct connection path and the label of the direct connection path.
7. a connectivity probing method, comprising:
the method comprises the steps that source equipment receives a detection message, wherein the detection message comprises a source address, a destination address and a label list used for representing an equivalent path; wherein, the source address is an Internet Protocol (IP) address of the source equipment, and the destination address is an IP address of the destination equipment of the equal cost path; the label list comprises a pointer and a plurality of labels which are sequentially arranged, and each label is used for representing a direct connection path; the direct connection path is a path which only comprises two network devices and takes the two network devices as endpoints; the detection message is generated by a controller, wherein the controller generates one of N detection messages after determining that N equivalent paths exist between the source equipment and the target equipment based on a label pre-allocated to each direct connection path in the network;
The source device determines an output port corresponding to a first label according to the first label pointed by the pointer, wherein the output port corresponds to a next direct connection path on the equal cost path;
The source device controls the pointer to move to a second tag position along the tag list sequence;
and the source equipment sends the detection message through the next direct connection path according to the output port so as to detect the connectivity of the equivalent path.
8. the method of claim 7, further comprising:
When the source device receives a detection response message sent by first equipment on the equivalent path, determining path communication between the source device and the first equipment;
Wherein the first device is a device on the equal cost path except the source device.
9. The method according to claim 7 or 8, wherein when the source device does not receive a probe response message sent by the destination device within a preset time, the source device determines that the equal cost path is abnormal; the method further comprises the following steps:
And the source equipment determines the fault equipment according to the detection response messages sent by other equipment on the equivalent path.
10. the method according to any one of claims 7-9, further comprising:
the source device receives and stores the corresponding relation between the label of each direct connection path where the source device is located and the direct connection path, wherein the label of each direct connection path is sent by the controller.
11. a controller, comprising:
The system comprises an equal cost path number determining unit, a path selecting unit and a path selecting unit, wherein the equal cost path number determining unit is used for determining that N equal cost paths exist between source equipment and target equipment; the N is more than or equal to 2; the N equivalent paths are determined based on labels distributed to each direct connection path in the network in advance;
A detection message generating unit, configured to generate N detection messages, where any one of the N detection messages includes a source address, a destination address, and a label list used for representing an equivalent path; wherein, the source address is an Internet Protocol (IP) address of the source equipment, and the destination address is an IP address of the destination equipment; the label list comprises a pointer and a plurality of labels which are sequentially arranged, and each label is used for representing a direct connection path; the direct connection path is a path which only comprises two network devices and takes the two network devices as endpoints;
A detection message sending unit, configured to send the N detection messages to the source device, so that the source device sends the N detection messages to a corresponding one of the N equal-cost paths, respectively, to detect connectivity of the N equal-cost paths.
12. the controller of claim 11, further comprising:
A collecting unit for collecting a network topology;
the label distribution unit is used for distributing labels to each direct connection path in the network according to the network topology;
A label sending unit, configured to send a label of each direct connection path where the network device is located to each network device in the network;
the equal cost path number determining unit is specifically configured to determine that N equal cost paths exist between the source device and the destination device according to the network topology.
13. A network device, comprising:
A receiving unit, configured to receive a probe packet, where the probe packet includes a source address, a destination address, and a label list for indicating an equal cost path; wherein, the source address is an Internet Protocol (IP) address of a source device of the equal cost path, and the destination address is an IP address of a destination device of the equal cost path; the label list comprises a pointer and a plurality of labels which are sequentially arranged, and each label is used for representing a direct connection path; the direct connection path is a path which only comprises two network devices and takes the two network devices as endpoints; the detection message is generated by a controller, wherein the controller generates one of N detection messages after determining that N equivalent paths exist between the source equipment and the target equipment based on a label pre-allocated to each direct connection path in the network;
a detection response message generating unit, configured to generate a detection response message according to the detection message; the detection response message comprises a source address and a destination address, wherein the source address is the IP address of the equipment, and the destination address is the IP address of the source equipment;
A first sending unit, configured to send the probe response packet to the source device;
A determining unit, configured to determine an egress port of the probe packet according to a current tag pointed by the pointer, where the egress port corresponds to a next direct path on the equal cost path;
a second sending unit, configured to send the probe packet to the next direct path through the egress port.
14. The network device of claim 13, further comprising a pointer processing unit to:
When the pointer does not point to the last label in the label list, controlling the pointer to sequentially move to the next label position along the label list; or
And when the pointer points to the last label in the label list, deleting the pointer in the label list.
15. the network device of claim 13 or 14, further comprising:
a receiving unit, configured to receive a correspondence between a label of each direct connection path where the source device is located and the direct connection path, where the label is sent by a controller;
and the storage unit is used for storing the corresponding relation received by the receiving unit.
16. the network device of claim 13 or 14, further comprising:
And the label distribution unit is used for performing multi-protocol label switching (MPLS) label distribution through an extended Interior Gateway Protocol (IGP) so as to obtain a label of each direct connection path where the network equipment is located, and storing the corresponding relation between each direct connection path and the label of the direct connection path.
17. A network device, comprising:
A receiving unit, configured to receive a probe packet, where the probe packet includes a source address, a destination address, and a label list for indicating an equal cost path; wherein, the source address is an Internet Protocol (IP) address of a source device, and the destination address is an IP address of a destination device of the equal cost path; the label list comprises a pointer and a plurality of labels which are sequentially arranged, and each label is used for representing a direct connection path; the direct connection path is a path which only comprises two network devices and takes the two network devices as endpoints; the detection message is generated by a controller, wherein the controller generates one of N detection messages after determining that N equivalent paths exist between the source equipment and the target equipment based on a label pre-allocated to each direct connection path in the network;
a first determining unit, configured to determine, according to a first tag pointed by the pointer, an egress port corresponding to the first tag, where the egress port corresponds to a next direct path on the equal cost path;
the pointer control unit is used for controlling the pointer to sequentially move to a second label position along the label list;
And a sending unit, configured to send the probe packet through the next direct connection path according to the egress port to detect connectivity of the equal cost path.
18. The network device according to claim 17, wherein the first determining unit is further configured to determine path connectivity between the source device and the first device when receiving a probe response packet sent by the first device on the equal-cost path;
wherein the first device is a device on the equal cost path except the source device.
19. the network device of claim 17 or 18, further comprising:
a second determining unit, configured to determine that the equal cost path is abnormal when a probe response message sent by the destination device is not received within a preset time; and determining the fault equipment according to the detection response messages sent by other equipment on the equivalent path.
20. The network device of any one of claims 17-19, further comprising:
A receiving unit, configured to receive a correspondence between a label of each direct connection path where the source device is located and the direct connection path, where the label is sent by a controller;
and the storage unit is used for storing the corresponding relation received by the receiving unit.
CN201510606716.0A 2015-09-22 2015-09-22 A connectivity detection method, controller and device Active CN106549819B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510606716.0A CN106549819B (en) 2015-09-22 2015-09-22 A connectivity detection method, controller and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510606716.0A CN106549819B (en) 2015-09-22 2015-09-22 A connectivity detection method, controller and device

Publications (2)

Publication Number Publication Date
CN106549819A CN106549819A (en) 2017-03-29
CN106549819B true CN106549819B (en) 2019-12-17

Family

ID=58364272

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510606716.0A Active CN106549819B (en) 2015-09-22 2015-09-22 A connectivity detection method, controller and device

Country Status (1)

Country Link
CN (1) CN106549819B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106878113B (en) * 2017-04-12 2020-04-03 杭州迪普科技股份有限公司 Link connectivity detection method and device
CN108650190A (en) * 2018-04-12 2018-10-12 国家计算机网络与信息安全管理中心 A multi-path data distribution system and data distribution method
CN108809759A (en) * 2018-05-29 2018-11-13 新华三技术有限公司 Detect the method, apparatus and router of link state
CN109120449B (en) * 2018-08-28 2022-04-22 新华三技术有限公司 Method and device for detecting link failure
CN111988193A (en) * 2019-05-24 2020-11-24 中兴通讯股份有限公司 A TWAMP-based detection method and related equipment
CN111682986B (en) * 2020-06-08 2023-11-07 平安科技(深圳)有限公司 Full link quality detection method, full link quality detection device, computer equipment and storage medium
CN113595897B (en) * 2021-08-13 2022-09-20 新华三信息安全技术有限公司 Path detection method and device
CN116723109B (en) * 2023-06-08 2025-10-24 中国电信股份有限公司 Communication path planning method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1815970A (en) * 2005-02-01 2006-08-09 华为技术有限公司 Method for detecting network chain fault and positioning said fault
CN101094121A (en) * 2007-07-23 2007-12-26 华为技术有限公司 Method, system and device for detecting Ethernet links among not direct connected devices
CN102437931A (en) * 2011-12-29 2012-05-02 华为技术有限公司 Method and device for detecting a service path
CN103401726A (en) * 2013-07-19 2013-11-20 华为技术有限公司 Network path detecting method, device and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DK2873196T3 (en) * 2012-07-13 2019-05-20 Ericsson Telefon Ab L M Controlling connectivity errors in a communication network

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1815970A (en) * 2005-02-01 2006-08-09 华为技术有限公司 Method for detecting network chain fault and positioning said fault
CN101094121A (en) * 2007-07-23 2007-12-26 华为技术有限公司 Method, system and device for detecting Ethernet links among not direct connected devices
CN102437931A (en) * 2011-12-29 2012-05-02 华为技术有限公司 Method and device for detecting a service path
CN103401726A (en) * 2013-07-19 2013-11-20 华为技术有限公司 Network path detecting method, device and system

Also Published As

Publication number Publication date
CN106549819A (en) 2017-03-29

Similar Documents

Publication Publication Date Title
CN106549819B (en) A connectivity detection method, controller and device
US9559954B2 (en) Indexed segment ID
EP3399700B1 (en) Method, apparatus and device for detecting forwarding table
US10574563B2 (en) Seamless bidirectional forwarding detection discriminator based return path determination
CN109728962B (en) Method and equipment for sending message
WO2015054904A1 (en) Method, controller, forwarding device, and network system for forwarding packets
CN106375105B (en) A method, controller, switch and system for determining path failure
CN106330506B (en) A kind of traffic failure localization method and device
US11711243B2 (en) Packet processing method and gateway device
WO2021000848A1 (en) Packet forwarding method and packet processing method and apparatus
CN104852826B (en) A kind of loop detecting method and device
CN107078924A (en) The method, apparatus and system of two-way converting detection are carried out to aggregated links
KR20220098152A (en) Communication method and device
CN102185766A (en) Unicast forwarding method and forwarding equipment for responding messages by DHCP (Dynamic host configuration protocol) server
JP6443864B2 (en) Method, apparatus and system for implementing packet loss detection
CN107294743B (en) Network path detection method, controller and network equipment
CN101616078A (en) A method for discovering the maximum transmission unit of a path, a router and a node device
CN108259261B (en) Path detection method and device
CN106713130B (en) A routing table update method, EVPN control device and EVPN system
CN102739462B (en) Test message sending method and device
CN101626307A (en) Method, system and device for processing path tracking request message
CN113872843B (en) Route generation method, route processing method and device
CN104301221B (en) A kind of method and device of route messages
CN103546376B (en) A method and node for transmitting response message
CN106452963A (en) Network path sensing method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant