WO2011015103A1 - Method for collecting topology information of distributed network and distributed network thereof - Google Patents

Method for collecting topology information of distributed network and distributed network thereof Download PDF

Info

Publication number
WO2011015103A1
WO2011015103A1 PCT/CN2010/075367 CN2010075367W WO2011015103A1 WO 2011015103 A1 WO2011015103 A1 WO 2011015103A1 CN 2010075367 W CN2010075367 W CN 2010075367W WO 2011015103 A1 WO2011015103 A1 WO 2011015103A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
topology
request message
message
collection
Prior art date
Application number
PCT/CN2010/075367
Other languages
French (fr)
Chinese (zh)
Inventor
胡永生
陈志峰
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2011015103A1 publication Critical patent/WO2011015103A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/12Discovery or management of network topologies

Definitions

  • Topology information collection method and distributed network for distributed network are Topology information collection method and distributed network for distributed network
  • the present invention relates to the field of communications, and in particular, to a topology information collection method for a distributed network and a corresponding distributed network.
  • P2P Peer-to-Peer, peer-to-peer, peer-to-peer
  • P2P peer-to-peer
  • a P2P network composed of a large number of computer devices has various topological structural relationships.
  • the mainstream topology structure is divided into the following four types: Centralized Topology, fully distributed unstructured topology ( Decentralized Unstructured Topology), Decentralized Structure Topology, and Partially Decentralized Topology.
  • the centralized topology is centered on the central server (directory system), and all nodes (ie Peer) are set around the central node.
  • the network with a centralized topology is simple to maintain and the node discovery efficiency is high.
  • the entire network is overly dependent on the central server and is prone to bottlenecks. Therefore, it is only suitable for small networks and is not suitable for large-scale network applications.
  • the network using the fully distributed unstructured topology structure can quickly find the destination node, and has strong fault tolerance and can support Complex queries, fuzzy queries, etc.
  • a fully distributed structured topology is a fully distributed structured network using Distributed Hash Table (DHT).
  • DHT Distributed Hash Table
  • DHT can provide accurate discovery operations, and as long as the destination node exists in the network, it can be discovered.
  • the semi-distributed structure topology structure combines the advantages of the centralized topology structure and the fully distributed structured topology structure, and selects nodes with strong performance (strong information processing capability) as super nodes, and each super node is responsible for a group. Forwarding of messages between ordinary nodes, while super nodes complete messages in super Forwarding between nodes.
  • each node stores only a part of the network routing table. When any node receives a resource lookup request, it always forwards it to the node that is "closer" to the destination node until the destination node is found.
  • Figure 1 is a schematic diagram of network topology information provided by each node in a fully distributed structured topology network.
  • Each circle in Figure 1 represents a node in the overlay network, and the dashed line represents the logical relationship between the node and the node.
  • Each node only knows the nodes with logical connections.
  • node 1 can only know the existence of four nodes: node 2, node 3, node 4, and node 5; node 6 can know the existence of four nodes: node 4, node 5, node 7, and node 8;
  • the network changes for example, node 5 exits the overlay network, node 1 and node 6 will immediately know the exit of node 5, and will select a new node replacement node 5 according to the algorithm.
  • the technical problem to be solved by the present invention is to overcome the deficiencies of the prior art, and to provide a topology information collecting method and a corresponding distributed network of a distributed network that do not depend on a network topology and a routing algorithm.
  • the present invention provides a topology information collection method for a distributed network, the method comprising:
  • the originating node in the distributed network sends a topology collection request message to its neighboring nodes; after receiving the topology collection request message, any node X in the distributed network performs the following processing:
  • the node X sends a topology collection request message to the M neighboring nodes of the node; the M neighbor nodes are nodes other than the node that sends the topology collection request message to the node X among the neighbor nodes of the node X;
  • the node X After receiving the topology collection response message returned by the M neighboring nodes, or after reaching a preset time, if the received at least one topology collection response message includes network topology information, the node X records the node. The network topology information and the topology information in the topology collection response message received by the local node are included in the topology collection response message, and are returned to one of the nodes to which the topology collection request message is sent;
  • the method further includes: if the node X sends the topology collection request message to the node, the node X has no other neighboring nodes, and the node X includes the network topology information of the node in the topology collection response. In the message, return to one of the nodes to which the topology collection request message is sent.
  • the method further includes: if all the topology collection response messages received by the node X do not include the network topology information, the node X includes the network topology information of the node in the topology collection response message. One of the nodes to which the topology collection request message is sent.
  • the node X returns the topology collection response message containing the network topology information to the transmitting node from which the node receives the first topology collection request message.
  • the method further includes: after receiving the topology collection request message, the node X determines whether the message is the received first topology collection request message, and if not, returns to the sending node of the message.
  • a topology collection response message containing network topology information.
  • the node X determines, according to the forwarding restriction identifier included in the message, whether to allow the topology collection request message to be sent to the M neighboring nodes of the node.
  • the node X returns a topology collection response message to the node that sends the topology collection request message; the topology collection response message includes network topology information, where the network topology information includes the M
  • the neighboring nodes are information of nodes to which the topology collection request message has not been forwarded;
  • the originating node After receiving the network topology information including the information that the M neighboring nodes are the nodes to which the topology collection request message has not been forwarded, the originating node sends a topology collection request message to the M neighboring nodes. .
  • the method further comprises: before sending the topology collection request message to its neighboring node, the starting node sets an initial value of the forwarding restriction identifier N to NO, and includes the forwarding restriction identifier in the The topology collection request message is sent to its neighbor node;
  • any node X in the distributed network determines whether to allow sending a topology to the neighboring node of the node according to whether the N value in the message is less than or equal to N1 or greater than or equal to N2. Collecting the request message; if allowed, subtracting the N value, and then including it in the topology collection request message and sending it to the neighboring node of the node;
  • the topology collection request message includes a topology information collection identifier for uniquely identifying a current topology information collection operation.
  • the topology information collection identifier includes: an identifier of the start node and a message sequence number.
  • the present invention also provides a distributed network to which the topology information collecting method of the above distributed network is applied.
  • any node in the distributed network can obtain the entire network topology information by using the method provided by the present invention, and the method is applicable to a distributed network using any topology structure and arbitrary routing algorithm.
  • the topology information collection request of the present invention is hierarchically copied and distributed, and the mechanism of response grading and reporting is reported, the local traffic of the network can be effectively controlled without causing a big impact on the network.
  • FIG. 1 is a schematic diagram of network topology information provided by each node in a fully distributed structured topology network
  • FIG. 2 is a flowchart of a method for collecting topology information of a distributed network according to a first embodiment of the present invention
  • FIG. 3 is a schematic diagram showing a topology of a network for collecting topology information by using the method of the first embodiment of the present invention
  • FIG. 4 is a message interaction diagram of topology information collection by a starting node in the scenario shown in FIG. 3 according to the first embodiment of the present invention
  • FIG. 5 is a message interaction diagram of topology information collection by an intermediate node in the scenario shown in FIG. 3 according to the first embodiment of the present invention
  • FIG. 6 is a message interaction diagram of topology information collection by a stub node in the scenario shown in FIG. 3 according to the first embodiment of the present invention
  • FIG. 7 is a flow chart of a method for collecting topology information of a distributed network according to a second embodiment of the present invention.
  • the core idea of the present invention is that a starting node in a distributed network sends a topology collection request message to its neighboring nodes, and after starting topology information collection, any intermediate node in the distributed network (including the phase of the starting node)
  • the neighboring node After receiving the topology collection request message, the neighboring node forwards the topology collection request message to the neighboring node of the node, and after receiving the returned topology collection response message, the network topology information of the node (ie, the node)
  • the information contained in the routing table and the topology collection response message are included in the topology collection response message and returned to the previous node.
  • the originating node collects topology information of each node in the network.
  • each node is defined as: a start node, an intermediate node, and a stub node; wherein, the start node is initiated
  • the node that collects the topology information is the node that needs to summarize and report the topology information of the local node and the neighboring node.
  • the stub node only needs to report the topology information of the local node, and does not need to collect the topology information of the neighboring node. node.
  • the main processing steps of the starting node include:
  • the starting node that desires to obtain the network topology information queries the routing table of the local node, sends a topology collection request message to all nodes associated with the routing table (called a neighboring node), and waits for the topology returned by the neighboring node. Collect response messages;
  • the initiating node after receiving the topology collection response message returned by all neighboring nodes, the initiating node combines the topology information included in the message with the topology information included in the routing table of the local node into a complete network topology information. Complete the collection process of this topology information.
  • the main processing steps of the intermediate node include:
  • the intermediate node verifies whether the message is the topology collection request message received for the first time; If the topology collection request message is received for the first time, the intermediate node returns a topology collection failure response message to the previous node, and ends the processing process of the intermediate node; otherwise, the next step is performed;
  • the originating node may generate a unique topology information collection identifier for each topology information collection (for example, the topology information collection identifier includes The identifier of the originating node and the unique message sequence number are inserted into the topology collection request message and sent to the neighboring nodes.
  • Each intermediate node must carry the identifier when forwarding the topology collection request message.
  • each node After receiving the topology collection request message, each node reads the identifier from the message, and then performs a search in the list of received topology information collection identifiers stored in the node, if the same topology information collection identifier is not found. , indicating that the topology collection request message is the topology collection request message received for the first time.
  • the topology collection failure response message may be a topology collection response message that does not include any topology information.
  • the intermediate node queries the routing table of the local node, and sends a topology collection request message to the neighboring node other than the node that has sent the topology collection request message to the intermediate node, and waits for the corresponding topology collection response.
  • the simple collection request message is sent, but the neighboring node that has sent the topology collection request message to the intermediate node has previously received the topology collection request message sent by other nodes, so the topology collection failure response is returned to the intermediate node. Message.
  • the intermediate node After receiving all the topology collection response messages (including the topology collection failure response message and the topology collection success response message), the intermediate node combines the topology information included in the response message with the topology information of the local node, Generating network topology information of the responsible portion of the intermediate node;
  • the intermediate node sends a topology collection request message to the N neighboring nodes, and receives the topology collection failure response message returned by the M nodes, then after receiving the topology collection success response message returned by the NM nodes, the middle The node learns that all topology collection response messages have been received.
  • the intermediate node includes the network topology information of the responsible part in the topology collection response message and returns it to the previous node to complete the topology information collection task of the node.
  • the main processing steps of the stub node include:
  • the stub node After receiving the topology collection request message sent by the previous node (which may be an intermediate node or a starting node), in order to avoid a broadcast storm, the stub node verifies whether the message is the topology collection request message received for the first time; If the topology collection request message is received for the first time, the peripheral node returns a topology collection failure response message to the previous node, and ends the processing process of the terminal node; otherwise, the next step is performed;
  • the stub node queries the routing table of the node, and sends a topology collection request message to the neighboring node other than the node that has sent the topology collection request message to the stub node, but all the topology collection request is received. If the neighboring nodes of the message return a topology collection failure response message, the node determines that it is a stub node; S203c) The stub node returns a topology collection response message to the node.
  • the network topology information in the message may include only the identifier used to indicate that the node is a stub node, and complete the topology information collection task of the node.
  • the above identifier may be the node identifier itself of the stub node.
  • the stub node can also return all the topology information contained in the routing table of the node to the previous node.
  • the node is also a stub node.
  • FIG. 3 is a schematic diagram showing a topology of a network for collecting topology information by using the method according to the first embodiment of the present invention; as shown in FIG. 3, the arrows of the rows sequentially indicate the distribution level of the topology collection request message, which are respectively the first The level is distributed to the fourth level distribution.
  • the solid arrows in Fig. 3 indicate the first distribution of the topology collection request message; the dotted arrow indicates that the topology collection request message is again transmitted to the node that has received the topology collection request message.
  • node 1 is a start node, and a topology collection request message is sent to node 2, node 3, node 4, and node 5.
  • the node 4 is an intermediate node, and the topology collection request message is sent to the node 6, the node 9, and the node A.
  • the node 6 has been slave node 5 before receiving the topology collection request message sent by the node 4. Upon receiving the topology collection request message having the same topology information collection identifier, the node 6 returns a topology collection failure response message to the node 4.
  • node 9 When the node 9 receives the topology collection request message and prepares to send it to the node 8 and the node B, the node 8 and the node B have respectively obtained the topology collection request message from the node 6 and the node A, so the node 9 is returned to the node 9 Pu collects the failure response message, so node 9 becomes a member of the stub node.
  • the specific flow in the scenario shown in Figure 3 will be explained in detail below.
  • FIG. 4 is a message interaction diagram of the topology information collected by the originating node in the scenario shown in FIG. 3 according to the first embodiment of the present invention, which includes the following steps:
  • the starting node (node 1) checks the routing table of the node and finds 4 The adjacent nodes are node 2, node 3, node 4, and node 5, respectively, and then send topology collection request messages with the same topology information collection identifier to the four adjacent nodes, respectively, and node 1 stores one record, record
  • the request message is initiated by the node 1 (that is, the local node is recorded as the starting node); the above information recorded by the starting node can be deleted after a preset time (for example, 3600 seconds), and the corresponding information recorded by the following intermediate node and the peripheral node It can also be deleted after a preset time.
  • the starting node After successfully sending the topology collection request message, the starting node enters a topology collection response waiting state, and waits for the topology collection response message returned by the four neighboring nodes;
  • the node 1 combines the topology information included in the received topology collection response message with the topology information in the routing table of the local node into a complete overlay network topology information, and completes the collection process of the entire network topology information. .
  • FIG. 5 is a message interaction diagram of topology information collection by an intermediate node in the scenario shown in FIG. 3 according to the first embodiment of the present invention, including the following steps:
  • the intermediate node receives the topology collection request message sent by the previous node (node 1);
  • the node 4 extracts the topology information collection identifier from the topology collection request message, and searches for the same identifier locally by using the identifier as an index. In this step, the node 4 fails to find the same identifier, and the node 4 determines the topology.
  • the collection request message is received for the first time, and the node 4 stores the identifier, and the record has received the topology collection request message;
  • Node 4 checks the routing table of the node and finds that there are three neighboring nodes besides node 1, which are node 6, node 9, and node A, respectively, and then send the topology to the three adjacent nodes respectively.
  • the request message is collected, and the topology information collection identifier in the message is consistent with that sent by the node 1; S506) after the topology collection request message is successfully sent, the node 4 enters the topology collection response waiting state, and waits for the three adjacent nodes to return to the extension. Park collects response messages;
  • the node 4 includes the partial topology information generated by the combination and returns it to the previous node (node 1) in the topology collection response message, and the node 4 completes the topology collection task.
  • FIG. 6 is a message interaction diagram of topology information collection by a stub node in the scenario shown in FIG. 3 according to the first embodiment of the present invention, including the following steps:
  • the node 9 receives the topology collection request message sent by the previous node (node 4);
  • the node 9 extracts the topology information collection identifier from the topology collection request message, and searches for the same identifier locally by using the identifier as an index. Here, the node 9 fails to find the same identifier, and determines that the topology collection request message is the first one. Receiving, the node 9 stores the identifier, and the record has received the topology collection request message;
  • the node 9 checks the routing table of the node, and finds that there are two adjacent nodes in addition to the node 4, namely node 8 and node B, respectively, and then send a topology collection request message to the two adjacent nodes respectively.
  • the topology information collection identifier in the message is consistent with that sent by node 4.
  • the node 9 After successfully sending the topology collection request message, the node 9 enters the topology collection response waiting state, and waits for the two neighboring nodes to return the topology collection response message;
  • step S606 Similar to step S602, after receiving the topology collection request message, the node 8 detects the topology information collection identifier in the message, and finds that the topology collection request message with the same topology information collection identifier has been received;
  • the node 8 returns a topology collection failure response message to the node 9, informing the node 9 that the node has received the topology collection request message, and the node 8 does not further process the message;
  • the node B After receiving the topology collection request message, the node B detects the topology information collection identifier in the message, and finds that the topology collection request message with the same topology information collection identifier has been received.
  • Node B sends a topology collection failure response message to node 9, informing node 9 that the node has received the topology collection request message, and node B does not further process the message;
  • the node 9 After receiving the topology collection failure response message returned by the two neighboring nodes, the node 9 finds All neighboring nodes have received and processed the topology collection request message, so it is determined that the node is a stub node;
  • the node 9 returns a topology collection response message to the node 4.
  • the network topology information in the message may only include an identifier for indicating that the node is a stub node, and the node 9 completes the topology collection task.
  • the node 9 can also return all the topology information contained in the routing table of the node to the node.
  • the method also proposes to limit the number of hops collected by a single topology, and collect the entire network through multiple topology collection. Optimization of topology information.
  • FIG. 7 is a flowchart of a method for collecting topology information of a distributed network according to a second embodiment of the present invention, the method comprising the following steps:
  • the starting node (node 1) checks the routing table of the node, and finds that there are four neighboring nodes, namely node 2, node 3, node 4, and node 5, and then respectively send the same to the four neighboring nodes.
  • the topology collection request message of the topology information collection identifier (here, for convenience of description, only node 4 is shown in FIG. 7); at the same time, node 1 identifies the maximum number of times of transmission of the message in the topology collection request message (ie, allowed hopping) Number) is N times;
  • the node H returns the topology information contained in the routing table (in which the node J is the information of the node to which the topology collection request message has not been forwarded) to the previous node through the topology collection response message, the node H
  • the topology information (in which the node J is the information of the node to which the topology collection request message has not been forwarded) is forwarded by multiple nodes, and finally reaches the initiating node;
  • the originating node sends a topology collection request message having the same topology information collection identifier as that in step S701 to the node J, and identifies the maximum number of times of transmission in the message as N times;
  • the node J After receiving the topology collection request message sent by the originating node, the node J completes the topology collection task as an intermediate node or a stub node, and returns a topology collection response message to the node 1, and the node 1 collects the topology according to the node J.
  • the response message completes the assembly of the complete overlay network topology information, and completes the collection process of the entire network topology information.
  • the starting node can acquire the topology information of the entire overlay network and form a complete overlay network topology diagram, without causing message blocking, message storm, etc. to the overlay network. .
  • the above embodiment may also have various transformation manners, for example:
  • each node after receiving the repeated topology collection request message, each node returns a topology collection failure response message to the sending node of the message; the node that sends the topology collection request message is received according to the received The topology collects the total number of successful response messages and topology collection failure responses to determine whether all topology collection response messages have been received, and after determining that all topology collection response messages have been received, receiving from the first one
  • the sending node to the topology collection request message returns a topology collection response message;
  • the receiving node of the message may directly discard the message without returning a topology collection failure response message to the sending node of the message; In this case, the sending node of the message needs to set a timer.
  • the combination of the topology information is performed, and the topology collection response message is returned, and the remaining topology collection response message is no longer waiting.
  • the topology information of the node is usually not missed.
  • the network topology information in the topology collection response message received after the timer expires may be sent to the upper node by sending the topology collection response multiple times.
  • the node corresponding to the topology collection response message that is not received may also be marked as a missing node, so that the initiating node is in accordance with the second embodiment of the present invention.
  • the method then sends a topology collection request message to the missing node.
  • the intermediate node and the stub node return the collected network topology information (ie, the topology collection success response message) to the node to which the topology collection request message is first sent; in the other aspect of the present invention, the intermediate node and the stub node may return the collected network topology information (ie, the topology collection success response message) to any node to which the topology collection request message is sent, for example, the last one sends the extension information thereto. The node that collects the request message.
  • the initial value of the maximum number of forwarding times N of the topology collection request message is set by the originating node, and is included in the topology collection request message and sent to the neighboring node to receive
  • the node to the topology collection request message decrements the N value by ((>>> before forwarding the message, and when the value of N is less than or equal to 1, it indicates that the topology collection request message cannot be forwarded;
  • other identifiers may be set in the topology collection request message to indicate whether to allow forwarding of the topology collection request message; for example, the starting node sets the forwarding count identifier L, and the initial value is 0.
  • the starting node sends the L value to the neighboring node in the topology collection request message, and the node that receives the topology collection request message adds the L value to / ( />0) before forwarding the message. If the value is greater than or equal to the preset maximum number of forwarding times, the topology collection request message cannot be forwarded.
  • the above maximum forwarding number and forwarding count identifier may be collectively referred to as a forwarding restriction identifier.
  • the present invention provides a topology information collection method for a distributed network and a corresponding distributed network. Any node in the distributed network can obtain the entire network topology information by using the method provided by the present invention, and the method is applicable to a distributed network using any topology structure and arbitrary routing algorithm. At the same time, because the topology information collection request of the present invention is hierarchically copied and distributed, and the mechanism of response grading and reporting is reported, the local traffic of the network can be effectively controlled without causing a big impact on the network.

Landscapes

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

Abstract

Disclosed are a method for collecting topology information of a distributed network and the corresponding distributed network thereof, wherein the method includes: a beginning node in the distributed network sends topology collection request messages to its neighbor nodes. After any node X in the distributed network receives the topology collection request messages, it performs the following processing: node X sends the topology collection request messages to its M neighbor nodes. The M neighbor nodes are the neighbor nodes of node X except the one sending the topology collection request message to node X. After receiving topology collection response messages returned from the M neighbor nodes, or a preset time expires, if at least one received topology collection response message includes network topology information, node X contains the network topology information recorded by the current node and the network topology information in the topology collection response messages received by the current node in the topology collection response message and returns it to one of the nodes sending topology collection request messages to node X itself, wherein M ≥ 1.

Description

一种分布式网络的拓朴信息收集方法及分布式网络  Topology information collection method and distributed network for distributed network
技术领域 Technical field
本发明涉及通信领域, 尤其涉及一种分布式网络的拓朴信息收集方法及 相应的分布式网络。  The present invention relates to the field of communications, and in particular, to a topology information collection method for a distributed network and a corresponding distributed network.
背景技术 Background technique
P2P ( Peer-to-Peer, 对等互联, 或点对点)技术可以让用户直接连接到其 他用户的计算机, 进行文件共享与交换, 同时 P2P在深度搜索、 分布计算、 协同工作等方面也大有用途。  P2P (Peer-to-Peer, peer-to-peer, peer-to-peer) technology allows users to connect directly to other users' computers for file sharing and exchange, while P2P is also useful for deep search, distributed computing, and collaborative work. .
由大量计算机设备组成的 P2P网络具备多种多样的拓朴结构关系, 目前 主流的拓朴结构关系的划分为如下四种: 中心化拓朴( Centralized Topology ) , 全分布式非结构化拓朴( Decentralized Unstructured Topology ) , 全分布式结 构化拓朴(Decentralized Structure Topology ) , 以及半分布式拓朴 ( Partially Decentralized Topology ) 。  A P2P network composed of a large number of computer devices has various topological structural relationships. At present, the mainstream topology structure is divided into the following four types: Centralized Topology, fully distributed unstructured topology ( Decentralized Unstructured Topology), Decentralized Structure Topology, and Partially Decentralized Topology.
其中, 中心化拓朴结构是以中心服务器(目录系统)为中心, 所有节点 (即 Peer ) 围绕中心节点设置。 釆用中心化拓朴结构的网络维护简单, 节点 发现效率高, 但是整个网络过度依赖于中心服务器, 容易造成瓶颈, 因此只 适用于小型网络, 并不适于大型网络应用。  Among them, the centralized topology is centered on the central server (directory system), and all nodes (ie Peer) are set around the central node. The network with a centralized topology is simple to maintain and the node discovery efficiency is high. However, the entire network is overly dependent on the central server and is prone to bottlenecks. Therefore, it is only suitable for small networks and is not suitable for large-scale network applications.
全分布式非结构化拓朴结构中没有中心服务器, 网络中的设备釆用随机 方式组织, 釆用全分布式非结构化拓朴结构的网络能够较快发现目的节点, 容错能力强, 能够支持复杂查询, 模糊查询等。  There is no central server in the fully distributed unstructured topology structure, and the devices in the network are organized in a random manner. The network using the fully distributed unstructured topology structure can quickly find the destination node, and has strong fault tolerance and can support Complex queries, fuzzy queries, etc.
全分布式结构化拓朴结构是釆用分布式散列表(DHT ) 的完全分布式结 构化网络。 DHT能够提供精确发现操作, 只要目的节点存在于网络中, 就一 定能够被发现。  A fully distributed structured topology is a fully distributed structured network using Distributed Hash Table (DHT). DHT can provide accurate discovery operations, and as long as the destination node exists in the network, it can be discovered.
半分布式结构拓朴结构融合了中心化拓朴结构与全分布式结构化拓朴结 构的优点, 选择其中性能较强 (信息处理能力强) 的节点作为超级节点, 每 个超级节点负责一组普通节点间消息的转发, 同时超级节点完成消息在超级 节点间的转发。 The semi-distributed structure topology structure combines the advantages of the centralized topology structure and the fully distributed structured topology structure, and selects nodes with strong performance (strong information processing capability) as super nodes, and each super node is responsible for a group. Forwarding of messages between ordinary nodes, while super nodes complete messages in super Forwarding between nodes.
四种拓朴结构中, 除了中心化拓朴结构, 以及少数釆用一跳路由算法的 结构化网络外 (一跳路由算法同样只适用于较小型网络) , 在进行消息路由 时, 都存在一个共同点, 即: 每个节点都只存储网络路由表的一部分, 任何 一个节点收到一个资源查找请求时, 总是将其转发给离该目的节点 "更近" 的节点, 直至找到目的节点。  Among the four topologies, except for the centralized topology and a few structured networks that use a one-hop routing algorithm (one-hop routing algorithm is also only applicable to smaller networks), there is one in message routing. The commonality is that each node stores only a part of the network routing table. When any node receives a resource lookup request, it always forwards it to the node that is "closer" to the destination node until the destination node is found.
图 1是全分布式结构化拓朴结构网络中各节点具备的网络拓朴信息示意 图。 图 1 中每个圓圈表示叠加网络中的一个节点, 虚线表示节点与节点之间 具备的逻辑联系关系, 每个节点只知晓具备逻辑联系关系的节点。  Figure 1 is a schematic diagram of network topology information provided by each node in a fully distributed structured topology network. Each circle in Figure 1 represents a node in the overlay network, and the dashed line represents the logical relationship between the node and the node. Each node only knows the nodes with logical connections.
如图 1所示, 节点 1只能获知节点 2、 节点 3、 节点 4和节点 5四个节点 的存在; 节点 6可以获知节点 4、 节点 5、 节点 7和节点 8四个节点的存在; 如果网络发生变化, 例如节点 5退出了叠加网, 节点 1与节点 6会立即获知 节点 5的退出 , 将会分别根据算法选择新的节点替代节点 5。  As shown in Figure 1, node 1 can only know the existence of four nodes: node 2, node 3, node 4, and node 5; node 6 can know the existence of four nodes: node 4, node 5, node 7, and node 8; The network changes, for example, node 5 exits the overlay network, node 1 and node 6 will immediately know the exit of node 5, and will select a new node replacement node 5 according to the algorithm.
由上可知, 在整个网络中, 所有节点都只能获知叠加网络中特定部分的 拓朴信息, 而没有任何节点能获知整个网络的拓朴信息。 因此, 在收集整网 拓朴信息时, 通常都是先选取叠加网中特定的节点, 从这些节点分别获取拓 朴信息后, 组合成完整的网络拓朴信息。 但是, 釆用上述方法收集拓朴信息 时, 需要预先获知网络的拓朴结构, 根据网络的拓朴结构来选取特定的节点 来完成拓朴信息的收集。  It can be seen from the above that in the entire network, all nodes can only know the topology information of a specific part of the overlay network, and no node can know the topology information of the entire network. Therefore, when collecting the topology information of the entire network, it is usually first to select specific nodes in the overlay network, and after obtaining the topology information from these nodes, the complete network topology information is synthesized. However, when collecting the topology information by the above method, it is necessary to know the topology structure of the network in advance, and select a specific node according to the topology structure of the network to complete the collection of the topology information.
目前 P2P技术的应用非常广泛, 针对不同场景和需求所釆用的拓朴结构 和路由算法的种类繁多、 千差万别, 如果釆用以上方法收集整网拓朴信息, 需要对所有类型的拓朴结构和路由算法进行研究后才能进行。 现有技术中还 没有一种能够适用于所有拓朴结构和路由算法的网络拓朴信息的收集方法。 发明内容  At present, the application of P2P technology is very extensive. The topology and routing algorithms used for different scenarios and requirements are numerous and varied. If you use the above method to collect the entire network topology information, you need to use all types of topology structures and The routing algorithm can only be carried out after research. There is no prior art method for collecting network topology information that can be applied to all topology structures and routing algorithms. Summary of the invention
本发明所要解决的技术问题是, 克服现有技术的不足, 提供一种不依赖 于网络拓朴结构和路由算法的分布式网络的拓朴信息收集方法及相应的分布 式网络。 为了解决上述技术问题, 本发明提供一种分布式网络的拓朴信息收集方 法, 该方法包括: The technical problem to be solved by the present invention is to overcome the deficiencies of the prior art, and to provide a topology information collecting method and a corresponding distributed network of a distributed network that do not depend on a network topology and a routing algorithm. In order to solve the above technical problem, the present invention provides a topology information collection method for a distributed network, the method comprising:
分布式网络中的起始节点向其相邻节点发送拓朴收集请求消息; 分布式网络中的任一节点 X在接收到拓朴收集请求消息后, 进行如下处 理:  The originating node in the distributed network sends a topology collection request message to its neighboring nodes; after receiving the topology collection request message, any node X in the distributed network performs the following processing:
节点 X向该节点的 M个相邻节点发送拓朴收集请求消息; 所述 M个相 邻节点为节点 X的相邻节点中除向节点 X发送拓朴收集请求消息的节点以外 的其它节点;  The node X sends a topology collection request message to the M neighboring nodes of the node; the M neighbor nodes are nodes other than the node that sends the topology collection request message to the node X among the neighbor nodes of the node X;
接收到上述 M个相邻节点返回的拓朴收集响应消息、或到达预先设定的 时间后, 如果接收到的至少一个拓朴收集响应消息中包含网络拓朴信息, 则 节点 X将本节点记录的网络拓朴信息和本节点接收到的拓朴收集响应消息中 的网络拓朴信息包含在拓朴收集响应消息中, 返回给向其发送拓朴收集请求 消息的节点中的一个;  After receiving the topology collection response message returned by the M neighboring nodes, or after reaching a preset time, if the received at least one topology collection response message includes network topology information, the node X records the node. The network topology information and the topology information in the topology collection response message received by the local node are included in the topology collection response message, and are returned to one of the nodes to which the topology collection request message is sent;
其中, M > 1。  Where M > 1.
优选地, 所述方法还包括: 如果除向其发送拓朴收集请求消息的节点以 夕卜, 节点 X没有其它相邻节点, 则节点 X将本节点的网络拓朴信息包含在拓 朴收集响应消息中, 返回给向其发送拓朴收集请求消息的节点中的一个。  Preferably, the method further includes: if the node X sends the topology collection request message to the node, the node X has no other neighboring nodes, and the node X includes the network topology information of the node in the topology collection response. In the message, return to one of the nodes to which the topology collection request message is sent.
优选地, 所述方法还包括: 如果节点 X接收到的所有拓朴收集响应消息 中都不包含网络拓朴信息, 则节点 X将本节点的网络拓朴信息包含在拓朴收 集响应消息中返回给向其发送拓朴收集请求消息的节点中的一个。  Preferably, the method further includes: if all the topology collection response messages received by the node X do not include the network topology information, the node X includes the network topology information of the node in the topology collection response message. One of the nodes to which the topology collection request message is sent.
优选地, 节点 X将所述包含网络拓朴信息的拓朴收集响应消息返回给该 节点从其接收到第一个拓朴收集请求消息的发送节点。  Preferably, the node X returns the topology collection response message containing the network topology information to the transmitting node from which the node receives the first topology collection request message.
优选地, 所述方法还包括: 节点 X在接收到拓朴收集请求消息后, 判断 该消息是否为接收到的第一个拓朴收集请求消息, 如果不是, 则向该消息的 发送节点返回不包含网络拓朴信息的拓朴收集响应消息。  Preferably, the method further includes: after receiving the topology collection request message, the node X determines whether the message is the received first topology collection request message, and if not, returns to the sending node of the message. A topology collection response message containing network topology information.
优选地, 如果除向其发送拓朴收集请求消息的节点以外, 节点 X没有其 它相邻节点, 或者节点 X接收到的所有拓朴收集响应消息中都不包含网络拓 朴信息, 则所述节点 X返回的网络拓朴信息中仅包含节点 X的节点标识。 优选地, 所述方法还包括: 节点 X在接收到拓朴收集请求消息后, 根据 该消息中包含的转发限制标识判断是否允许向该节点的所述 M个相邻节点发 送拓朴收集请求消息; 如果不允许, 则节点 X向发送该拓朴收集请求消息的 节点返回拓朴收集响应消息; 所述拓朴收集响应消息中包含网络拓朴信息, 所述网络拓朴信息中包含所述 M个相邻节点是尚未向其转发拓朴收集请求消 息的节点的信息; Preferably, if the node X has no other neighboring nodes except the node to which the topology collection request message is sent, or the topology topology information is not included in all the topology collection response messages received by the node X, the node The network topology information returned by X contains only the node identifier of node X. Preferably, the method further includes: after receiving the topology collection request message, the node X determines, according to the forwarding restriction identifier included in the message, whether to allow the topology collection request message to be sent to the M neighboring nodes of the node. If not allowed, the node X returns a topology collection response message to the node that sends the topology collection request message; the topology collection response message includes network topology information, where the network topology information includes the M The neighboring nodes are information of nodes to which the topology collection request message has not been forwarded;
所述起始节点接收到包含所述 M个相邻节点是尚未向其转发拓朴收集请 求消息的节点的信息的网络拓朴信息后 , 向所述 M个相邻节点发送拓朴收集 请求消息。  After receiving the network topology information including the information that the M neighboring nodes are the nodes to which the topology collection request message has not been forwarded, the originating node sends a topology collection request message to the M neighboring nodes. .
优选地, 所述方法还包括: 在向其相邻节点发送拓朴收集请求消息前, 所述起始节点将转发限制标识 N的初始值设置为 NO,并将所述转发限制标识 包含在所述拓朴收集请求消息中发送给其相邻节点;  Preferably, the method further comprises: before sending the topology collection request message to its neighboring node, the starting node sets an initial value of the forwarding restriction identifier N to NO, and includes the forwarding restriction identifier in the The topology collection request message is sent to its neighbor node;
分布式网络中的任一节点 X在接收到拓朴收集请求消息后, 根据该消息 中的 N值是否小于等于 Nl、或是否大于等于 N2来判断是否允许向该节点的 相邻节点发送拓朴收集请求消息; 如果允许, 则将该 N值减《后, 将其包含 在拓朴收集请求消息中发送给该节点的相邻节点;  After receiving the topology collection request message, any node X in the distributed network determines whether to allow sending a topology to the neighboring node of the node according to whether the N value in the message is less than or equal to N1 or greater than or equal to N2. Collecting the request message; if allowed, subtracting the N value, and then including it in the topology collection request message and sending it to the neighboring node of the node;
其中, w<0 JL N0< Nl , 或 w>0且 N0> N2。  Where w<0 JL N0< Nl , or w>0 and N0> N2.
优选地, 所述拓朴收集请求消息中包含用于唯一标识当前的拓朴信息收 集操作的拓朴信息收集标识。  Preferably, the topology collection request message includes a topology information collection identifier for uniquely identifying a current topology information collection operation.
优选地, 所述拓朴信息收集标识中包含: 所述起始节点的标识和消息序 号。  Preferably, the topology information collection identifier includes: an identifier of the start node and a message sequence number.
本发明还提供了一种应用了上述分布式网络的拓朴信息收集方法的分布 式网络。  The present invention also provides a distributed network to which the topology information collecting method of the above distributed network is applied.
综上所述, 分布式网络中的任意节点都可以通过釆用本发明提供的方法 获取整网拓朴信息, 并且该方法适用于釆用任意拓朴结构、 任意路由算法的 分布式网络。 同时由于本发明的拓朴信息收集釆用请求分级复制、 下发, 响 应分级汇总、 上报的机制, 能够有效控制网络局部流量, 从而不对网络造成 大的冲击。 附图概述 In summary, any node in the distributed network can obtain the entire network topology information by using the method provided by the present invention, and the method is applicable to a distributed network using any topology structure and arbitrary routing algorithm. At the same time, because the topology information collection request of the present invention is hierarchically copied and distributed, and the mechanism of response grading and reporting is reported, the local traffic of the network can be effectively controlled without causing a big impact on the network. BRIEF abstract
图 1是全分布式结构化拓朴结构网络中各节点具备的网络拓朴信息示意 图;  1 is a schematic diagram of network topology information provided by each node in a fully distributed structured topology network;
图 2是本发明第一实施例的分布式网络的拓朴信息收集方法流程图; 图 3为釆用本发明第一实施例的方法进行拓朴信息收集的网络的拓朴结 构示意图;  2 is a flowchart of a method for collecting topology information of a distributed network according to a first embodiment of the present invention; FIG. 3 is a schematic diagram showing a topology of a network for collecting topology information by using the method of the first embodiment of the present invention;
图 4是本发明第一实施例的在图 3所示的场景下起始节点进行拓朴信息 收集的消息交互图;  4 is a message interaction diagram of topology information collection by a starting node in the scenario shown in FIG. 3 according to the first embodiment of the present invention;
图 5是本发明第一实施例的在图 3所示的场景下中间节点进行拓朴信息 收集的消息交互图;  FIG. 5 is a message interaction diagram of topology information collection by an intermediate node in the scenario shown in FIG. 3 according to the first embodiment of the present invention; FIG.
图 6是本发明第一实施例的在图 3所示的场景下末梢节点进行拓朴信息 收集的消息交互图;  6 is a message interaction diagram of topology information collection by a stub node in the scenario shown in FIG. 3 according to the first embodiment of the present invention;
图 7是本发明第二实施例的分布式网络的拓朴信息收集方法流程图。  7 is a flow chart of a method for collecting topology information of a distributed network according to a second embodiment of the present invention.
本发明的较佳实施方式 Preferred embodiment of the invention
本发明的核心思想是, 分布式网络中的起始节点向其相邻节点发送拓朴 收集请求消息, 启动拓朴信息收集后, 分布式网络中的任一中间节点 (包括 起始节点的相邻节点)在接收到拓朴收集请求消息后, 向该节点的相邻节点 转发拓朴收集请求消息, 接收到返回的拓朴收集响应消息后, 将本节点的网 络拓朴信息 (即本节点的路由表中包含的信息)和拓朴收集响应消息包含在 拓朴收集响应消息中返回给上一节点, 最终, 起始节点收集到了网络中各节 点的拓朴信息。  The core idea of the present invention is that a starting node in a distributed network sends a topology collection request message to its neighboring nodes, and after starting topology information collection, any intermediate node in the distributed network (including the phase of the starting node) After receiving the topology collection request message, the neighboring node forwards the topology collection request message to the neighboring node of the node, and after receiving the returned topology collection response message, the network topology information of the node (ie, the node) The information contained in the routing table and the topology collection response message are included in the topology collection response message and returned to the previous node. Finally, the originating node collects topology information of each node in the network.
下面将结合附图和实施例对本发明进行详细描述。 The invention will now be described in detail in conjunction with the drawings and embodiments.
第一实施例 First embodiment
图 2是本发明第一实施例的分布式网络的拓朴信息收集方法流程图。 在图 2所示流程中, 根据分布式网络中各节点在拓朴信息收集过程中的 不同作用, 将各节点分别定义为: 起始节点、 中间节点与末梢节点; 其中, 起始节点是发起拓朴信息收集的节点, 中间节点是需要汇总并上报本节点及 相邻节点的拓朴信息的节点, 末梢节点是仅需上报本节点的拓朴信息、 无需 收集相邻节点的拓朴信息的节点。 以下将结合图 2分别对上述三类节点在拓 朴信息的收集过程中的处理流程进行描述。 2 is a flow chart of a method for collecting topology information of a distributed network according to a first embodiment of the present invention. In the flow shown in FIG. 2, according to the different roles of each node in the distributed network in the topology information collection process, each node is defined as: a start node, an intermediate node, and a stub node; wherein, the start node is initiated The node that collects the topology information is the node that needs to summarize and report the topology information of the local node and the neighboring node. The stub node only needs to report the topology information of the local node, and does not need to collect the topology information of the neighboring node. node. The processing flow of the above three types of nodes in the collection process of the topology information will be described below with reference to FIG. 2 respectively.
起始节点的主要处理步骤包括:  The main processing steps of the starting node include:
S201a )期望获取网络拓朴信息的起始节点查询本节点的路由表, 向路由 表中关联的所有节点 (称为相邻节点)发送拓朴收集请求消息, 并等待相邻 节点返回的拓朴收集响应消息;  S201a) The starting node that desires to obtain the network topology information queries the routing table of the local node, sends a topology collection request message to all nodes associated with the routing table (called a neighboring node), and waits for the topology returned by the neighboring node. Collect response messages;
S202a )起始节点接收到所有相邻节点返回的拓朴收集响应消息后, 将该 消息中包含的拓朴信息和本节点路由表中包含的拓朴信息组合成完整的全网 拓朴信息, 完成本次拓朴信息的收集过程。  S202a) after receiving the topology collection response message returned by all neighboring nodes, the initiating node combines the topology information included in the message with the topology information included in the routing table of the local node into a complete network topology information. Complete the collection process of this topology information.
中间节点的主要处理步骤包括: The main processing steps of the intermediate node include:
S201b )接收到上一节点(可能是中间节点或起始节点)发送的拓朴收集 请求消息后, 为了避免广播风暴, 中间节点验证该消息是否为首次收到的拓 朴收集请求消息; 如果不是首次收到的拓朴收集请求消息, 则该中间节点向 上一节点返回拓朴收集失败响应消息, 并结束中间节点的处理流程; 否则执 行下一步;  S201b) after receiving the topology collection request message sent by the previous node (possibly the intermediate node or the origin node), in order to avoid the broadcast storm, the intermediate node verifies whether the message is the topology collection request message received for the first time; If the topology collection request message is received for the first time, the intermediate node returns a topology collection failure response message to the previous node, and ends the processing process of the intermediate node; otherwise, the next step is performed;
为了便于各节点获知先前是否已收到过相同的拓朴收集请求消息, 起始 节点可以为每一次拓朴信息收集生成一个唯一的拓朴信息收集标识(例如, 该拓朴信息收集标识中包含: 起始节点的标识和唯一的消息序号) , 并将其 插入到拓朴收集请求消息中发送给各相邻节点, 各中间节点在转发拓朴收集 请求消息时必须携带该标识。 各节点收到拓朴收集请求消息后, 从消息中读 取该标识, 然后在本节点存储的已经接收到的拓朴信息收集标识列表中进行 搜索, 如未搜索到相同的拓朴信息收集标识, 则表明该拓朴收集请求消息为 首次接收到的拓朴收集请求消息。 上述拓朴收集失败响应消息可以是不包含任何拓朴信息的拓朴收集响应 消息。 In order to facilitate each node to know whether the same topology collection request message has been received before, the originating node may generate a unique topology information collection identifier for each topology information collection (for example, the topology information collection identifier includes The identifier of the originating node and the unique message sequence number are inserted into the topology collection request message and sent to the neighboring nodes. Each intermediate node must carry the identifier when forwarding the topology collection request message. After receiving the topology collection request message, each node reads the identifier from the message, and then performs a search in the list of received topology information collection identifiers stored in the node, if the same topology information collection identifier is not found. , indicating that the topology collection request message is the topology collection request message received for the first time. The topology collection failure response message may be a topology collection response message that does not include any topology information.
S202b )中间节点查询本节点的路由表, 向路由表中除已向该中间节点发 送拓朴收集请求消息的节点以外的其它相邻节点发送拓朴收集请求消息, 并 等待相应的拓朴收集响应消息;  S202b) The intermediate node queries the routing table of the local node, and sends a topology collection request message to the neighboring node other than the node that has sent the topology collection request message to the intermediate node, and waits for the corresponding topology collection response. Message
朴收集请求消息, 但是, 由于已向该中间节点发送拓朴收集请求消息的相邻 节点先前一定接收到过其它节点发送的拓朴收集请求消息, 因此会向该中间 节点返回拓朴收集失败响应消息。 The simple collection request message is sent, but the neighboring node that has sent the topology collection request message to the intermediate node has previously received the topology collection request message sent by other nodes, so the topology collection failure response is returned to the intermediate node. Message.
S203b )中间节点接收到全部的拓朴收集响应消息(包括拓朴收集失败响 应消息和拓朴收集成功响应消息)后, 将响应消息中包含的拓朴信息与本节 点的拓朴信息进行组合, 生成该中间节点负责部分的网络拓朴信息;  S203b: After receiving all the topology collection response messages (including the topology collection failure response message and the topology collection success response message), the intermediate node combines the topology information included in the response message with the topology information of the local node, Generating network topology information of the responsible portion of the intermediate node;
假设中间节点向 N个相邻节点发送了拓朴收集请求消息,接收到 M个节 点返回的拓朴收集失败响应消息,那么当接收到 N-M个节点返回的拓朴收集 成功响应消息后, 该中间节点获知已接收到全部的拓朴收集响应消息。  It is assumed that the intermediate node sends a topology collection request message to the N neighboring nodes, and receives the topology collection failure response message returned by the M nodes, then after receiving the topology collection success response message returned by the NM nodes, the middle The node learns that all topology collection response messages have been received.
S204b )中间节点将其负责部分的网络拓朴信息包含在拓朴收集响应消息 中返回给上一节点, 完成本节点的拓朴信息收集任务。  S204b) The intermediate node includes the network topology information of the responsible part in the topology collection response message and returns it to the previous node to complete the topology information collection task of the node.
末梢节点的主要处理步骤包括: The main processing steps of the stub node include:
S201c )接收到上一节点(可能是中间节点或起始节点)发送的拓朴收集 请求消息后, 为了避免广播风暴, 末梢节点验证该消息是否为首次收到的拓 朴收集请求消息; 如果不是首次收到的拓朴收集请求消息, 则该末梢节点向 上一节点返回拓朴收集失败响应消息, 并结束末梢节点的处理流程; 否则执 行下一步;  S201c) after receiving the topology collection request message sent by the previous node (which may be an intermediate node or a starting node), in order to avoid a broadcast storm, the stub node verifies whether the message is the topology collection request message received for the first time; If the topology collection request message is received for the first time, the peripheral node returns a topology collection failure response message to the previous node, and ends the processing process of the terminal node; otherwise, the next step is performed;
S202c )末梢节点查询本节点的路由表, 向路由表中除已向该末梢节点发 送拓朴收集请求消息的节点以外的其它相邻节点发送拓朴收集请求消息, 但 是所有接收到拓朴收集请求消息的相邻节点都返回拓朴收集失败响应消息, 则本节点确定自己为末梢节点; S203c )末梢节点向上一节点返回拓朴收集响应消息, 该消息中的网络拓 朴信息中可以仅包含用于表明该节点为末梢节点的标识, 完成本节点的拓朴 信息收集任务。 S202c) The stub node queries the routing table of the node, and sends a topology collection request message to the neighboring node other than the node that has sent the topology collection request message to the stub node, but all the topology collection request is received. If the neighboring nodes of the message return a topology collection failure response message, the node determines that it is a stub node; S203c) The stub node returns a topology collection response message to the node. The network topology information in the message may include only the identifier used to indicate that the node is a stub node, and complete the topology information collection task of the node.
上述标识可以就是末梢节点的节点标识自身。  The above identifier may be the node identifier itself of the stub node.
此外, 末梢节点也可以将本节点路由表中包含的全部拓朴信息返回给上 一节点。  In addition, the stub node can also return all the topology information contained in the routing table of the node to the previous node.
此外, 如果除向其发送拓朴收集请求消息的节点外, 某一节点没有其它 相邻节点, 则该节点也是末梢节点。 In addition, if a node has no other neighboring nodes except the node to which the topology collection request message is sent, the node is also a stub node.
图 3为釆用本发明第一实施例的方法进行拓朴信息收集的网络的拓朴结 构示意图; 如图 3所示, 各行的箭头依次表明拓朴收集请求消息的分发级别, 分别为第一级分发到第四级分发。 图 3中的实线箭头表示拓朴收集请求消息 的首次分发; 虚线箭头表示向已经收到拓朴收集请求消息的节点再次发送拓 朴收集请求消息。 3 is a schematic diagram showing a topology of a network for collecting topology information by using the method according to the first embodiment of the present invention; as shown in FIG. 3, the arrows of the rows sequentially indicate the distribution level of the topology collection request message, which are respectively the first The level is distributed to the fourth level distribution. The solid arrows in Fig. 3 indicate the first distribution of the topology collection request message; the dotted arrow indicates that the topology collection request message is again transmitted to the node that has received the topology collection request message.
在图 3中, 节点 1为起始节点, 向节点 2、 节点 3、 节点 4和节点 5发送 拓朴收集请求消息。 节点 4为中间节点, 将拓朴收集请求消息下发给了节点 6、 节点 9和节点 A三个节点; 其中,接收到节点 4下发的拓朴收集请求消息 前, 节点 6 已经从节点 5收到具有相同拓朴信息收集标识的拓朴收集请求消 息, 节点 6向节点 4返回拓朴收集失败响应消息。 当节点 9收到拓朴收集请 求消息, 准备下发给节点 8和节点 B时, 节点 8和节点 B已经分别从节点 6 和节点 A获得了拓朴收集请求消息 , 所以向节点 9返回了拓朴收集失败响应 消息, 因此节点 9成为了末梢节点的一员。 在图 3所示场景下的具体流程将 在下文中详细说明。  In Fig. 3, node 1 is a start node, and a topology collection request message is sent to node 2, node 3, node 4, and node 5. The node 4 is an intermediate node, and the topology collection request message is sent to the node 6, the node 9, and the node A. The node 6 has been slave node 5 before receiving the topology collection request message sent by the node 4. Upon receiving the topology collection request message having the same topology information collection identifier, the node 6 returns a topology collection failure response message to the node 4. When the node 9 receives the topology collection request message and prepares to send it to the node 8 and the node B, the node 8 and the node B have respectively obtained the topology collection request message from the node 6 and the node A, so the node 9 is returned to the node 9 Pu collects the failure response message, so node 9 becomes a member of the stub node. The specific flow in the scenario shown in Figure 3 will be explained in detail below.
图 4是本发明第一实施例的在图 3所示的场景下起始节点进行拓朴信息 收集的消息交互图, 包括如下步骤: FIG. 4 is a message interaction diagram of the topology information collected by the originating node in the scenario shown in FIG. 3 according to the first embodiment of the present invention, which includes the following steps:
S401 ) ~ S404 )起始节点 (节点 1 )检查本节点的路由表, 发现有 4个 相邻节点, 分别为节点 2、 节点 3、 节点 4和节点 5 , 于是分别向这 4个相邻 节点发送具有相同拓朴信息收集标识的拓朴收集请求消息, 并且节点 1存储 一条记录, 记录该请求消息由节点 1发起 (即记录本节点为起始节点) ; 起始节点记录的上述信息可以在预先设定的时间 (如 3600秒)后删除, 以下中间节点、末梢节点记录的相应信息也可以在在预先设定的时间后删除。 S401) ~ S404) The starting node (node 1) checks the routing table of the node and finds 4 The adjacent nodes are node 2, node 3, node 4, and node 5, respectively, and then send topology collection request messages with the same topology information collection identifier to the four adjacent nodes, respectively, and node 1 stores one record, record The request message is initiated by the node 1 (that is, the local node is recorded as the starting node); the above information recorded by the starting node can be deleted after a preset time (for example, 3600 seconds), and the corresponding information recorded by the following intermediate node and the peripheral node It can also be deleted after a preset time.
S405 )成功发送拓朴收集请求消息后, 起始节点进入拓朴收集响应等待 状态, 等待 4个相邻节点返回的拓朴收集响应消息;  S405) After successfully sending the topology collection request message, the starting node enters a topology collection response waiting state, and waits for the topology collection response message returned by the four neighboring nodes;
S406 ) - S409 ) 4个相邻节点完成拓朴收集后, 分别向节点 1返回携带 部分网络拓朴信息的拓朴收集响应消息;  S406) - S409) after completing the topology collection, the four neighboring nodes respectively return to the node 1 a topology collection response message carrying part of the network topology information;
S410 )节点 1将接收到的拓朴收集响应消息中包含的拓朴信息和本节点 的路由表中的拓朴信息组合成为完整的叠加网拓朴信息, 完成一次全网拓朴 信息的收集过程。  S410) The node 1 combines the topology information included in the received topology collection response message with the topology information in the routing table of the local node into a complete overlay network topology information, and completes the collection process of the entire network topology information. .
图 5是本发明第一实施例的在图 3所示的场景下中间节点进行拓朴信息 收集的消息交互图, 包括如下步骤: FIG. 5 is a message interaction diagram of topology information collection by an intermediate node in the scenario shown in FIG. 3 according to the first embodiment of the present invention, including the following steps:
S501 )中间节点(节点 4 )收到前一节点(节点 1 )发送的拓朴收集请求 消息;  S501) the intermediate node (node 4) receives the topology collection request message sent by the previous node (node 1);
S502 )节点 4从拓朴收集请求消息中提取拓朴信息收集标识, 并以该标 识为索引在本地查找相同的标识, 本步骤中节点 4未能查找到相同的标识, 节点 4确定该拓朴收集请求消息为首次收到, 节点 4存储该标识, 记录已经 收到该拓朴收集请求消息;  S502) The node 4 extracts the topology information collection identifier from the topology collection request message, and searches for the same identifier locally by using the identifier as an index. In this step, the node 4 fails to find the same identifier, and the node 4 determines the topology. The collection request message is received for the first time, and the node 4 stores the identifier, and the record has received the topology collection request message;
S503 ) ~ S505 )节点 4检查本节点的路由表, 发现除了节点 1以外还有 3个相邻节点, 分别为节点 6、 节点 9和节点 A, 于是向这 3个相邻节点分别 发送拓朴收集请求消息,该消息中的拓朴信息收集标识与节点 1发送的一致; S506 )成功发送拓朴收集请求消息后, 节点 4进入拓朴收集响应等待状 态, 等待上述 3个相邻节点返回拓朴收集响应消息;  S503) ~ S505) Node 4 checks the routing table of the node and finds that there are three neighboring nodes besides node 1, which are node 6, node 9, and node A, respectively, and then send the topology to the three adjacent nodes respectively. The request message is collected, and the topology information collection identifier in the message is consistent with that sent by the node 1; S506) after the topology collection request message is successfully sent, the node 4 enters the topology collection response waiting state, and waits for the three adjacent nodes to return to the extension. Park collects response messages;
S507 ) ~ S509 )上述 3个邻近节点完成拓朴信息收集后, 分别向节点 4 返回携带部分网络拓朴信息的拓朴收集响应消息; S510 )节点 4将接收到的拓朴收集响应消息中包含的拓朴信息和本节点 路由表中的拓朴信息组合成部分拓朴信息; S507) ~ S509) after the top three neighbor nodes complete the topology information collection, return to the node 4 a topology collection response message carrying part of the network topology information; S510) The node 4 combines the topology information included in the received topology collection response message with the topology information in the local node routing table into partial topology information;
S511 )节点 4将组合生成的部分拓朴信息包含在拓朴收集响应消息中返 回给上一节点 (节点 1 ) , 节点 4完成了本次拓朴收集任务。  S511) The node 4 includes the partial topology information generated by the combination and returns it to the previous node (node 1) in the topology collection response message, and the node 4 completes the topology collection task.
图 6是本发明第一实施例的在图 3所示的场景下末梢节点进行拓朴信息 收集的消息交互图, 包括如下步骤: FIG. 6 is a message interaction diagram of topology information collection by a stub node in the scenario shown in FIG. 3 according to the first embodiment of the present invention, including the following steps:
S601 )节点 9收到前一节点 (节点 4 )发送的拓朴收集请求消息; S601) The node 9 receives the topology collection request message sent by the previous node (node 4);
S602 )节点 9从拓朴收集请求消息中提取拓朴信息收集标识, 并以该标 识为索引在本地查找相同的标识, 这里节点 9未能查找到相同的标识, 确定 该拓朴收集请求消息为首次收到, 节点 9存储该标识, 记录已经收到该拓朴 收集请求消息; S602: The node 9 extracts the topology information collection identifier from the topology collection request message, and searches for the same identifier locally by using the identifier as an index. Here, the node 9 fails to find the same identifier, and determines that the topology collection request message is the first one. Receiving, the node 9 stores the identifier, and the record has received the topology collection request message;
S603 ) ~ S604 )节点 9检查本节点的路由表, 发现除了节点 4以外还有 两个相邻节点, 分别为节点 8和节点 B, 于是向这 2个相邻节点分别发送拓 朴收集请求消息, 该消息中的拓朴信息收集标识与节点 4发送的一致;  S603) ~ S604) The node 9 checks the routing table of the node, and finds that there are two adjacent nodes in addition to the node 4, namely node 8 and node B, respectively, and then send a topology collection request message to the two adjacent nodes respectively. The topology information collection identifier in the message is consistent with that sent by node 4.
S605 )成功发送拓朴收集请求消息后, 节点 9进入拓朴收集响应等待状 态, 等待上述 2个相邻节点返回拓朴收集响应消息;  S605) After successfully sending the topology collection request message, the node 9 enters the topology collection response waiting state, and waits for the two neighboring nodes to return the topology collection response message;
S606 )与步骤 S602类似, 节点 8接收到拓朴收集请求消息后, 对该消息 中的拓朴信息收集标识进行检测, 发现已经收到过具有相同拓朴信息收集标 识的拓朴收集请求消息;  S606) Similar to step S602, after receiving the topology collection request message, the node 8 detects the topology information collection identifier in the message, and finds that the topology collection request message with the same topology information collection identifier has been received;
S607 )节点 8向节点 9返回拓朴收集失败响应消息, 告知节点 9本节点 已经收到过该拓朴收集请求消息, 节点 8不对该消息作进一步处理;  S607) The node 8 returns a topology collection failure response message to the node 9, informing the node 9 that the node has received the topology collection request message, and the node 8 does not further process the message;
5608 )节点 B接收到拓朴收集请求消息后, 对该消息中的拓朴信息收集 标识进行检测, 发现已经收到过具有相同拓朴信息收集标识的拓朴收集请求 消息;  After receiving the topology collection request message, the node B detects the topology information collection identifier in the message, and finds that the topology collection request message with the same topology information collection identifier has been received.
5609 )节点 B向节点 9发送拓朴收集失败响应消息, 告知节点 9本节点 已经收到过该拓朴收集请求消息, 节点 B不对该消息作进一步处理;  5609) Node B sends a topology collection failure response message to node 9, informing node 9 that the node has received the topology collection request message, and node B does not further process the message;
S609 )节点 9收到 2个相邻节点返回的拓朴收集失败响应消息后, 发现 所有相邻节点都已经接收并处理了拓朴收集请求消息, 因此判定本节点为末 梢节点; S609) After receiving the topology collection failure response message returned by the two neighboring nodes, the node 9 finds All neighboring nodes have received and processed the topology collection request message, so it is determined that the node is a stub node;
S610 )节点 9向节点 4返回拓朴收集响应消息, 该消息中的网络拓朴信 息中可以仅包含用于表示本节点为末梢节点的标识, 节点 9完成了本次拓朴 收集任务。  S610) The node 9 returns a topology collection response message to the node 4. The network topology information in the message may only include an identifier for indicating that the node is a stub node, and the node 9 completes the topology collection task.
当然, 节点 9也可以将本节点路由表中包含的全部拓朴信息返回给节点 Of course, the node 9 can also return all the topology information contained in the routing table of the node to the node.
4。 4.
第二实施例 Second embodiment
当叠加网中包含的节点非常多时, 从起始节点到末梢节点可能会需要许 多跳(即起始节点与末梢节点之间包含了许多中间节点) , 而跳数越多, 意 味着起始节点将需要等待很长时间才能收到拓朴收集响应消息; 同时, 叠加 网中包含的节点越多意味着拓朴信息的信息量越大, 釆用本发明第一实施例 所述的方法收集拓朴信息时, 拓朴收集响应消息的报文也就越大; 因此对于 包含很多节点的叠加网, 本方法还提出了限制单次拓朴收集跳数, 通过多次 拓朴收集来收集整网拓朴信息的优化方案。  When there are a lot of nodes in the overlay network, many hops may be needed from the start node to the stub node (that is, many intermediate nodes are included between the start node and the stub node), and the more hops, the start node. It will take a long time to receive the topology collection response message; at the same time, the more nodes included in the overlay network mean that the information amount of the topology information is larger, and the method described in the first embodiment of the present invention is used to collect the extension. In the case of the simple information, the topology collects the response message, so that the message is collected. Therefore, for the overlay network including many nodes, the method also proposes to limit the number of hops collected by a single topology, and collect the entire network through multiple topology collection. Optimization of topology information.
图 7是本发明第二实施例的分布式网络的拓朴信息收集方法流程图, 该 方法包括如下步骤:  FIG. 7 is a flowchart of a method for collecting topology information of a distributed network according to a second embodiment of the present invention, the method comprising the following steps:
S701 )起始节点(节点 1 )检查本节点的路由表, 发现有 4个相邻节点, 分别为节点 2、 节点 3、 节点 4和节点 5 , 于是向这 4个相邻节点分别发送具 有相同拓朴信息收集标识的拓朴收集请求消息 (这里为了表述方便, 图 7中 仅示出节点 4 ) ; 同时, 节点 1在拓朴收集请求消息中标识该消息的最大传 递次数(即允许的跳数)为 N次;  S701) The starting node (node 1) checks the routing table of the node, and finds that there are four neighboring nodes, namely node 2, node 3, node 4, and node 5, and then respectively send the same to the four neighboring nodes. The topology collection request message of the topology information collection identifier (here, for convenience of description, only node 4 is shown in FIG. 7); at the same time, node 1 identifies the maximum number of times of transmission of the message in the topology collection request message (ie, allowed hopping) Number) is N times;
S702 )节点 4收到拓朴收集请求消息, 并确定该消息不是重复接收的拓 朴收集请求消息后, 将该消息转发给下一节点, 保持拓朴信息收集标识不变, 将该消息中包含的最大传递次数减 1变为 N-1次;  S702: After receiving the topology collection request message, and determining that the message is not the repeated received topology collection request message, the node 4 forwards the message to the next node, and keeps the topology information collection identifier unchanged, and the message is included in the message. The maximum number of passes minus 1 becomes N-1 times;
S703 ) 当拓朴收集请求消息经过 N-1次传递后, 该消息中的最大传递次 数变为 1时, 该消息发送到节点 H上; S704 )节点 H确定该消息不是重复接收的拓朴收集请求消息后, 发现路 由表中有相邻节点(节点 J )需要向其转发拓朴收集请求消息, 但此时已经不 允许进行转发, 因此节点 H只能将自己作为末梢节点; S703) when the topology collection request message passes N-1 times, when the maximum number of times of transmission in the message becomes 1, the message is sent to the node H; S704) After the node H determines that the message is not the repeatedly received topology collection request message, it is found that the neighboring node (node J) needs to forward the topology collection request message to the routing table, but the forwarding is not allowed at this time. Node H can only use itself as a stub node;
S705 ) - S707 )节点 H将路由表中包含的拓朴信息 (其中包含节点 J为 尚未向其转发拓朴收集请求消息的节点的信息)通过拓朴收集响应消息返回 给上一节点, 节点 H的拓朴信息 (其中包含节点 J为尚未向其转发拓朴收集 请求消息的节点的信息)经过多个节点的转发, 最终到达起始节点;  S705) - S707) The node H returns the topology information contained in the routing table (in which the node J is the information of the node to which the topology collection request message has not been forwarded) to the previous node through the topology collection response message, the node H The topology information (in which the node J is the information of the node to which the topology collection request message has not been forwarded) is forwarded by multiple nodes, and finally reaches the initiating node;
S708 )节点 1将接收到的拓朴收集响应消息中包含的拓朴信息和本节点 路由表中的拓朴信息进行组合时, 发现拓朴信息有缺失, 缺失的节点为节点 J;  S708) When the node 1 combines the topology information included in the received topology collection response message with the topology information in the local routing table, it is found that the topology information is missing, and the missing node is the node J;
5709 )起始节点向节点 J发送具有与步骤 S701中相同的拓朴信息收集标 识的拓朴收集请求消息, 并在该消息中标识最大传递次数为 N次;  5709) The originating node sends a topology collection request message having the same topology information collection identifier as that in step S701 to the node J, and identifies the maximum number of times of transmission in the message as N times;
5710 )接收到起始节点发送的拓朴收集请求消息后, 节点 J作为中间节 点或末梢节点完成拓朴收集任务, 向节点 1 返回拓朴收集响应消息, 节点 1 根据节点 J返回的拓朴收集响应消息完成完整的叠加网拓朴信息的拼装, 完 成一次全网拓朴信息的收集过程。  After receiving the topology collection request message sent by the originating node, the node J completes the topology collection task as an intermediate node or a stub node, and returns a topology collection response message to the node 1, and the node 1 collects the topology according to the node J. The response message completes the assembly of the complete overlay network topology information, and completes the collection process of the entire network topology information.
由上可知, 釆用本发明提供的方法, 起始节点可以获取整个叠加网的拓 朴信息, 并组成完整的叠加网拓朴图, 而并没有给叠加网带来消息阻塞、 消 息风暴等问题。 It can be seen from the above that, by using the method provided by the present invention, the starting node can acquire the topology information of the entire overlay network and form a complete overlay network topology diagram, without causing message blocking, message storm, etc. to the overlay network. .
根据本发明的基本原理, 上述实施例还可以有多种变换方式, 例如:According to the basic principle of the present invention, the above embodiment may also have various transformation manners, for example:
(一)在上述实施例中, 各节点在接收到重复的拓朴收集请求消息后, 会向该消息的发送节点返回拓朴收集失败响应消息; 发送拓朴收集请求消息 的节点根据接收到的拓朴收集成功响应消息和拓朴收集失败响应的总数来判 断是否已接收到全部的拓朴收集响应消息, 并在判定已接收到全部的拓朴收 集响应消息后, 向第一个从其接收到拓朴收集请求消息的发送节点返回拓朴 收集响应消息; 在本发明的其它实施例中, 接收到重复的拓朴收集请求消息后, 该消息 的接收节点可以直接丟弃该消息, 不向该消息的发送节点返回拓朴收集失败 响应消息; 在这种情况下, 该消息的发送节点需要设置一定时器, 定时器超 时后即进行拓朴信息的组合, 并返回拓朴收集响应消息, 不再等待剩余的拓 朴收集响应消息。 釆用本方法时, 只要定时器的时长设置合理, 通常不会遗 漏节点的拓朴信息。 当然, 也可以通过多次发送拓朴收集响应来向上一节点 发送定时器超时后接收到的拓朴收集响应消息中的网络拓朴信息。 (1) In the foregoing embodiment, after receiving the repeated topology collection request message, each node returns a topology collection failure response message to the sending node of the message; the node that sends the topology collection request message is received according to the received The topology collects the total number of successful response messages and topology collection failure responses to determine whether all topology collection response messages have been received, and after determining that all topology collection response messages have been received, receiving from the first one The sending node to the topology collection request message returns a topology collection response message; In other embodiments of the present invention, after receiving the repeated topology collection request message, the receiving node of the message may directly discard the message without returning a topology collection failure response message to the sending node of the message; In this case, the sending node of the message needs to set a timer. After the timer expires, the combination of the topology information is performed, and the topology collection response message is returned, and the remaining topology collection response message is no longer waiting. When using this method, as long as the timer is set properly, the topology information of the node is usually not missed. Of course, the network topology information in the topology collection response message received after the timer expires may be sent to the upper node by sending the topology collection response multiple times.
如果在定时器超时后不再等待剩余的拓朴收集响应消息, 也可以将没有 收到的拓朴收集响应消息所对应的节点标示为缺失的节点, 以便起始节点按 照本发明第二实施例的方法再向该缺失的节点发送拓朴收集请求消息。  If the remaining topology collection response message is not waited after the timer expires, the node corresponding to the topology collection response message that is not received may also be marked as a missing node, so that the initiating node is in accordance with the second embodiment of the present invention. The method then sends a topology collection request message to the missing node.
(二)在上述实施例中, 中间节点和末梢节点将其收集的网络拓朴信息 (即拓朴收集成功响应消息)返回给首次向其发送拓朴收集请求消息的节点; 在本发明的其它实施例中, 中间节点和末梢节点可以将其收集的网络拓 朴信息 (即拓朴收集成功响应消息)返回给任意一个向其发送拓朴收集请求 消息的节点, 例如, 最后一个向其发送拓朴收集请求消息的节点。  (2) In the above embodiment, the intermediate node and the stub node return the collected network topology information (ie, the topology collection success response message) to the node to which the topology collection request message is first sent; in the other aspect of the present invention In an embodiment, the intermediate node and the stub node may return the collected network topology information (ie, the topology collection success response message) to any node to which the topology collection request message is sent, for example, the last one sends the extension information thereto. The node that collects the request message.
(三)在本发明的第二实施例中, 由起始节点设置拓朴收集请求消息的 最大转发次数 N的初始值, 并将其包含在拓朴收集请求消息中发送给相邻节 点, 接收到该拓朴收集请求消息的节点在转发该消息前将 N值减《 ( «>0 ) , 当 N值小于等于 1时表示不能继续转发该拓朴收集请求消息;  (3) In the second embodiment of the present invention, the initial value of the maximum number of forwarding times N of the topology collection request message is set by the originating node, and is included in the topology collection request message and sent to the neighboring node to receive The node to the topology collection request message decrements the N value by ((>>> before forwarding the message, and when the value of N is less than or equal to 1, it indicates that the topology collection request message cannot be forwarded;
在本发明的其它实施例中, 也可以在拓朴收集请求消息中设置其它的标 识来表示是否允许继续转发该拓朴收集请求消息; 例如, 起始节点设置转发 计数标识 L,其初值为 0,起始节点将 L值包含在拓朴收集请求消息中发送给 相邻节点, 接收到该拓朴收集请求消息的节点在转发该消息前将 L值加 / ( />0 ) , 当 L值大于等于预先设置的最大转发次数上限值 时表示不能继续 转发该拓朴收集请求消息。  In other embodiments of the present invention, other identifiers may be set in the topology collection request message to indicate whether to allow forwarding of the topology collection request message; for example, the starting node sets the forwarding count identifier L, and the initial value is 0. The starting node sends the L value to the neighboring node in the topology collection request message, and the node that receives the topology collection request message adds the L value to / ( />0) before forwarding the message. If the value is greater than or equal to the preset maximum number of forwarding times, the topology collection request message cannot be forwarded.
上述最大转发次数和转发计数标识可以统称为转发限制标识。  The above maximum forwarding number and forwarding count identifier may be collectively referred to as a forwarding restriction identifier.
此外, 上述转发限制标识也可以由对等叠加网中的任一中间节点设置。 工业实用性 本发明提供一种分布式网络的拓朴信息收集方法及相应的分布式网络。 分布式网络中的任意节点都可以通过釆用本发明提供的方法获取整网拓朴信 息, 并且该方法适用于釆用任意拓朴结构、 任意路由算法的分布式网络。 同 时由于本发明的拓朴信息收集釆用请求分级复制、 下发, 响应分级汇总、 上 报的机制, 能够有效控制网络局部流量, 从而不对网络造成大的冲击。 In addition, the above forwarding restriction identifier may also be set by any intermediate node in the peer-to-peer overlay network. Industrial Applicability The present invention provides a topology information collection method for a distributed network and a corresponding distributed network. Any node in the distributed network can obtain the entire network topology information by using the method provided by the present invention, and the method is applicable to a distributed network using any topology structure and arbitrary routing algorithm. At the same time, because the topology information collection request of the present invention is hierarchically copied and distributed, and the mechanism of response grading and reporting is reported, the local traffic of the network can be effectively controlled without causing a big impact on the network.

Claims

权 利 要 求 书 Claim
1、 一种分布式网络的拓朴信息收集方法, 包括:  A method for collecting topology information of a distributed network, comprising:
分布式网络中的起始节点向其相邻节点发送拓朴收集请求消息; 分布式网络中的任一节点 X在接收到拓朴收集请求消息后, 进行如下处 理:  The originating node in the distributed network sends a topology collection request message to its neighboring nodes; after receiving the topology collection request message, any node X in the distributed network performs the following processing:
节点 X向该节点的 M个相邻节点发送拓朴收集请求消息; 所述 M个相 邻节点为节点 X的相邻节点中除向节点 X发送拓朴收集请求消息的节点以外 的其它节点;  The node X sends a topology collection request message to the M neighboring nodes of the node; the M neighbor nodes are nodes other than the node that sends the topology collection request message to the node X among the neighbor nodes of the node X;
接收到上述 M个相邻节点返回的拓朴收集响应消息、或到达预先设定的 时间后, 如果接收到的至少一个拓朴收集响应消息中包含网络拓朴信息, 则 节点 X将本节点记录的网络拓朴信息和本节点接收到的拓朴收集响应消息中 的网络拓朴信息包含在拓朴收集响应消息中, 返回给向其发送拓朴收集请求 消息的节点中的一个;  After receiving the topology collection response message returned by the M neighboring nodes, or after reaching a preset time, if the received at least one topology collection response message includes network topology information, the node X records the node. The network topology information and the topology information in the topology collection response message received by the local node are included in the topology collection response message, and are returned to one of the nodes to which the topology collection request message is sent;
其中, M > 1。  Where M > 1.
2、 如权利要求 1所述的方法, 还包括:  2. The method of claim 1 further comprising:
如果除向其发送拓朴收集请求消息的节点以外, 节点 X没有其它相邻节 点, 则节点 X将本节点的网络拓朴信息包含在拓朴收集响应消息中, 返回给 向其发送拓朴收集请求消息的节点中的一个。  If the node X has no other neighboring nodes except the node to which the topology collection request message is sent, the node X includes the network topology information of the node in the topology collection response message, and returns to send the topology collection to the node. One of the nodes requesting the message.
3、 如权利要求 1所述的方法, 还包括:  3. The method of claim 1 further comprising:
如果节点 X接收到的所有拓朴收集响应消息中都不包含网络拓朴信息, 则节点 X将本节点的网络拓朴信息包含在拓朴收集响应消息中返回给向其发 送拓朴收集请求消息的节点中的一个。  If the topology information is not included in all the topology collection response messages received by the node X, the node X includes the network topology information of the node in the topology collection response message, and returns a message to the topology collection request message. One of the nodes.
4、 如权利要求 1至 3中任一权利要求所述的方法, 其中,  4. The method according to any one of claims 1 to 3, wherein
节点 X将所述包含网络拓朴信息的拓朴收集响应消息返回给该节点从其 接收到第一个拓朴收集请求消息的发送节点。  The node X returns the topology collection response message containing the network topology information to the transmitting node from which the node receives the first topology collection request message.
5、 如权利要求 4所述的方法, 还包括:  5. The method of claim 4, further comprising:
节点 X在接收到拓朴收集请求消息后, 判断该消息是否为接收到的第一 个拓朴收集请求消息, 如果不是, 则向该消息的发送节点返回不包含网络拓 朴信息的拓朴收集响应消息。 After receiving the topology collection request message, the node X determines whether the message is the first topology collection request message received, and if not, returns a topology collection that does not include the network topology information to the sending node of the message. Response message.
6、 如权利要求 2或 3所述的方法, 其中, 6. The method of claim 2 or 3, wherein
如果除向其发送拓朴收集请求消息的节点以外, 节点 X没有其它相邻节 点, 或者节点 X接收到的所有拓朴收集响应消息中都不包含网络拓朴信息, 则所述节点 X返回的网络拓朴信息中仅包含节点 X的节点标识。  If the node X has no other neighboring nodes except the node to which the topology collection request message is sent, or the topology topology information is not included in all the topology collection response messages received by the node X, the node X returns The network topology information only contains the node identifier of node X.
7、 如权利要求 1所述的方法, 还包括:  7. The method of claim 1 further comprising:
节点 X在接收到拓朴收集请求消息后, 根据该消息中包含的转发限制标 识判断是否允许向该节点的所述 M个相邻节点发送拓朴收集请求消息; 如果 不允许,则节点 X向发送该拓朴收集请求消息的节点返回拓朴收集响应消息; 所述拓朴收集响应消息中包含网络拓朴信息, 所述网络拓朴信息中包含所述 M个相邻节点是尚未向其转发拓朴收集请求消息的节点的信息;  After receiving the topology collection request message, the node X determines, according to the forwarding restriction identifier included in the message, whether to allow the topology collection request message to be sent to the M neighboring nodes of the node; if not, the node X And sending, by the node that sends the topology collection request message, a topology collection response message, where the topology collection response message includes network topology information, where the network topology information includes that the M neighboring nodes are not yet forwarded to the network topology information. Topologically collecting information of nodes of the request message;
所述起始节点接收到包含所述 M个相邻节点是尚未向其转发拓朴收集请 求消息的节点的信息的网络拓朴信息后 , 向所述 M个相邻节点发送拓朴收集 请求消息。  After receiving the network topology information including the information that the M neighboring nodes are the nodes to which the topology collection request message has not been forwarded, the originating node sends a topology collection request message to the M neighboring nodes. .
8、 如权利要求 7所述的方法, 还包括:  8. The method of claim 7 further comprising:
在向其相邻节点发送拓朴收集请求消息前, 所述起始节点将转发限制标 识 N的初始值设置为 NO ,并将所述转发限制标识包含在所述拓朴收集请求消 息中发送给其相邻节点;  Before sending the topology collection request message to its neighboring node, the initial node sets the initial value of the forwarding restriction identifier N to NO, and includes the forwarding restriction identifier in the topology collection request message and sends the Its adjacent nodes;
分布式网络中的任一节点 X在接收到拓朴收集请求消息后, 根据该消息 中的 N值是否小于等于 Nl、或是否大于等于 N2来判断是否允许向该节点的 相邻节点发送拓朴收集请求消息; 如果允许, 则将该 N值减《后, 将其包含 在拓朴收集请求消息中发送给该节点的相邻节点;  After receiving the topology collection request message, any node X in the distributed network determines whether to allow sending a topology to the neighboring node of the node according to whether the N value in the message is less than or equal to N1 or greater than or equal to N2. Collecting the request message; if allowed, subtracting the N value, and then including it in the topology collection request message and sending it to the neighboring node of the node;
其中, w<0 JL N0< Nl , 或 w>0且 N0> N2。  Where w<0 JL N0< Nl , or w>0 and N0> N2.
9、 如权利要求 1所述的方法, 其中,  9. The method of claim 1 wherein
所述拓朴收集请求消息中包含用于唯一标识当前的拓朴信息收集操作的 拓朴信息收集标识。  The topology collection request message includes a topology information collection identifier for uniquely identifying a current topology information collection operation.
10、 如权利要求 9所述的方法, 其中,  10. The method of claim 9, wherein
所述拓朴信息收集标识中包含: 所述起始节点的标识和消息序号。  The topology information collection identifier includes: an identifier of the starting node and a message sequence number.
11、 一种分布式网络, 其应用了如权利要求 1-10中任一项所述的方法。  A distributed network, which employs the method of any of claims 1-10.
PCT/CN2010/075367 2009-08-07 2010-07-21 Method for collecting topology information of distributed network and distributed network thereof WO2011015103A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN200910161086.5A CN101989995B (en) 2009-08-07 2009-08-07 Topology information acquiring method for distributed network
CN200910161086.5 2009-08-07

Publications (1)

Publication Number Publication Date
WO2011015103A1 true WO2011015103A1 (en) 2011-02-10

Family

ID=43543919

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2010/075367 WO2011015103A1 (en) 2009-08-07 2010-07-21 Method for collecting topology information of distributed network and distributed network thereof

Country Status (2)

Country Link
CN (1) CN101989995B (en)
WO (1) WO2011015103A1 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103236978B (en) * 2013-04-17 2016-03-23 清华大学 The determination method and apparatus of AS topology top layer autonomous system node
CN104184665B (en) * 2013-05-23 2018-09-04 杭州迪普科技股份有限公司 A kind of topology collecting method and device
CN103428030B (en) * 2013-08-01 2016-06-08 杭州华三通信技术有限公司 The topological method for building up of fully-connected network and node
CN103532791A (en) * 2013-10-25 2014-01-22 中国科学院信息工程研究所 Method and system for finding and collecting nodes in I2P network
CN104378290B (en) * 2014-10-31 2017-07-11 北京盈进科技有限公司 A kind of message forwarding method and device
CN106789651B (en) * 2016-12-27 2020-03-10 郑州云海信息技术有限公司 Method and system for preventing cloud server network from generating broadcast storm
CN110650087A (en) * 2019-10-09 2020-01-03 四川灵通电讯有限公司 Grid network and data forwarding type reliable transmission method applying grid network

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1449158A (en) * 2002-03-28 2003-10-15 华为技术有限公司 Network topology information acquisition method
CN1917433A (en) * 2005-08-19 2007-02-21 上海贝尔阿尔卡特股份有限公司 System for collecting network topology, and network equipment
US20080151755A1 (en) * 2006-12-22 2008-06-26 Nec Corporation Network path control system, path control device, and path control method
CN101459534A (en) * 2008-12-03 2009-06-17 福建星网锐捷网络有限公司 Network topology collecting method for tree shaped network and network equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1449158A (en) * 2002-03-28 2003-10-15 华为技术有限公司 Network topology information acquisition method
CN1917433A (en) * 2005-08-19 2007-02-21 上海贝尔阿尔卡特股份有限公司 System for collecting network topology, and network equipment
US20080151755A1 (en) * 2006-12-22 2008-06-26 Nec Corporation Network path control system, path control device, and path control method
CN101459534A (en) * 2008-12-03 2009-06-17 福建星网锐捷网络有限公司 Network topology collecting method for tree shaped network and network equipment

Also Published As

Publication number Publication date
CN101989995A (en) 2011-03-23
CN101989995B (en) 2013-02-27

Similar Documents

Publication Publication Date Title
JP6047229B2 (en) Name-based neighbor discovery and multi-hop service discovery in information-centric networks
WO2011015103A1 (en) Method for collecting topology information of distributed network and distributed network thereof
US8248919B2 (en) Method, device and system for updating routes after node fails in P2P network
US8358652B2 (en) Apparatus, system and method for reliable, fast, and scalable multicast message delivery in service overlay networks
EP2501083B1 (en) Relay node, distributed network of relay node and networking method thereof
CN102136917B (en) Ethernet multicast method and device
JP2005051754A (en) Distance-aware service discovery mechanism for determining availability of remote service in wireless personal area network
JP2009508410A (en) Parallel execution of peer-to-peer overlay communication using multi-destination routing
WO2008034353A1 (en) A method, system and device for establishing a peer to peer connection in a p2p network
JP2006261880A (en) Network communication method and network system
CN101640628B (en) Mesh network-based routing management and routing methods, node, device and system
Scheideler et al. A distributed and oblivious heap
CN115190559B (en) Networking and control method of multi-scene-oriented Internet of things equipment
Porwal et al. Study and Design of new Reactive Routing Protocol advance AODV for mobile ad hoc networks
CN102752335B (en) Peer-to-peer overlay network interior joint overload information subscribing method and system
Shah et al. A new cross-layer unstructured P2P file sharing protocol over mobile ad hoc network
CN113328952B (en) Block chain data transmission method based on NDN
Mei et al. Cross-layer optimized Chord protocol for separated ring convergence in MANET
JP2005244880A (en) Device, system, and method for information transfer
JP4231002B2 (en) Communication apparatus, network system, and link generation method
Lee et al. An energy-effective routing protocol for mobile P2P systems
CN111447643B (en) Routing method for congestion avoidance in wireless sensor network
JP5287500B2 (en) Node device and program for node device
WO2011097997A1 (en) Method and system for client to access to peer-to-peer network based on resource locate and discovery (reload)
Ktari et al. Empowering chord DHT overlays

Legal Events

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

Ref document number: 10806007

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 10806007

Country of ref document: EP

Kind code of ref document: A1