一 i一 One i one
一种网络拓朴信息收集方法 技术领域 Method for collecting network topology information
本发明涉及网络管理, 尤其涉及网络拓朴信息收集方法。 The present invention relates to network management, and in particular, to a method for collecting network topology information.
背景技术 Background technique
拓朴信息收集是整个网络集群管理的基础,它建立在拓朴收集范 围内的设备中已经储存了该设备的邻接设备信息的基础上。所谓拓朴 收集的过程, 就是从拓朴收集发起设备开始, 在拓朴收集范围内将所 有支持拓朴收集的设备的邻接关系信息汇集到拓朴收集发起设备。 Topology information collection is the basis for the management of the entire network cluster. It is based on the fact that the devices within the topology collection area have already stored information about the neighboring devices of the device. The so-called topology collection process starts from the topology collection initiating device and collects the adjacency information of all devices supporting topology collection to the topology collection initiating device within the scope of the topology collection.
现有技术的方法分为基于二层协议的拓朴收集和基于三层协议 的拓朴收集两种。 基于二层协议的拓朴收集, 是指所有的拓朴收集报 文, 都承载于二层协议之上, 但二层协议本身不提供网络路由功能, 因此现有的实现方法, 均基于树状网络进行, 通过向树根节点方向即 上行方向发送拓朴报告, 在树根节点处汇总出整个网络拓朴。 这种拓 朴收集方式, 对于非树状拓朴如网状拓朴, 收集方法就会失效。 The methods of the prior art are classified into two types: a topology collection based on a layer 2 protocol and a topology collection based on a layer 3 protocol. Topology collection based on the Layer 2 protocol means that all the topologically collected packets are carried on the Layer 2 protocol, but the Layer 2 protocol itself does not provide network routing functions. Therefore, the existing implementation methods are based on the tree structure. The network performs the topology report by sending a topology report to the root node of the tree, that is, the uplink direction, and summarizes the entire network topology at the root node of the tree. This topology collection method will be invalid for non-tree topology such as mesh topology.
基于三层协议的拓朴收集, 主要是指基于 IP (互联网协议)的拓 朴收集。 所有拓朴报告报文均通过标准的网络层路由协议, 转发到发 起拓朴收集的设备, 并形成整网拓朴。 这种拓朴收集的方式, 导致整 个拓朴内的每个节点, 都要实现复杂的路由算法, 这对于一些不具有 路由器功能的低端产品则无法实施。 Topology collection based on the three-layer protocol mainly refers to topology collection based on IP (Internet Protocol). All topology report messages are forwarded to the device that initiates the topology collection through a standard network-layer routing protocol and forms the entire network topology. This topology collection method causes each node in the entire topology to implement a complex routing algorithm, which cannot be implemented for some low-end products that do not have router functions.
现有技术的拓朴收集也不能保证收集到的拓朴信息的完整性,普 遍采用定时拓朴刷新的方法补救, 即使收集不成功, 也不会影响艮长
时间。 但是对于网络设备的管理, 如果拓朴收集不全, 直接后果就是 个别网络设备无法被网管等需要拓朴信息设备发现, 造成管理漏洞。 The topology collection in the prior art cannot guarantee the integrity of the collected topology information, and the regular topology refreshing method is generally used to remedy the problem. Even if the collection is unsuccessful, it will not affect the director. Time. However, for the management of network equipment, if the topology is not fully collected, the direct consequence is that individual network equipment cannot be discovered by the network management and other topological information equipment, causing management loopholes.
另外, 为了解决拓朴收集过程中的循环问题, 现有技术采用一种 生成树算法, 按照树状结构进行, 由于拓朴中的每个网络设备上都需 要运行生成树的算法, 使过程相对复杂。 In addition, in order to solve the loop problem in the topology collection process, the prior art adopts a spanning tree algorithm, which is performed according to a tree structure. Because each network device in the topology needs to run a spanning tree algorithm, the process is relatively complex.
发明内容 Summary of the Invention
本发明的目的在于提供一种简便完整的网络拓朴信息收集方法。 为达到上述目的, 本发明采用的技术方案是: 一种网络拓朴信息 收集方法,首先由拓朴信息收集设备从本地节点根据其邻接节点信息 向邻接节点发送拓朴信息收集请求报文,请求报文中包含用于限制报 文转发次数的字段, 重复执行下述操作: An object of the present invention is to provide a simple and complete method for collecting network topology information. In order to achieve the above object, the technical solution adopted by the present invention is: A network topology information collection method. First, a topology information collection device sends a topology information collection request message from a local node to an adjacent node according to its adjacent node information. The message contains a field for limiting the number of times the message is forwarded, and the following operations are repeated:
收到请求报文的节点向拓朴信息收集设备返回包含本节点信息 和本节点与邻接节点连接信息的响应报文; The node receiving the request message returns a response message containing the information of the node and the connection information between the node and the adjacent node to the topology information collecting device;
判断报文转发次数是否达到限制值,如果是,结束操作;如果否, 继续以下处理; Judge whether the number of times of message forwarding reaches the limit, if yes, end the operation; if not, continue with the following processing;
收到请求报文的节点向各自的所有邻接节点转发请求报文。 采用上述方法后, 在指定的拓朴收集范围内, 网络中的每个设备 都会收到拓朴信息收集请求, 并向拓朴收集设备响应此请求, 响应报 文包含有本设备的信息和它与所有邻接设备的连接信息, 因此, 拓朴 收集设备可以收集到所有设备的自身信息和它们间的互连信息,实现 网络拓朴信息收集, 使网管系统可以依据此信息构造出网络拓朴图, 以作为集群管理的基础。
附图说明 The node receiving the request message forwards the request message to all its neighboring nodes. After using the above method, within the specified topology collection range, each device on the network will receive a topology information collection request and respond to the topology collection device. The response message contains the information about the device and its Connection information with all neighboring devices. Therefore, the topology collection device can collect all the device's own information and the interconnection information between them to implement network topology information collection, so that the network management system can construct a network topology map based on this information. To serve as the basis for cluster management. BRIEF DESCRIPTION OF THE DRAWINGS
图 1是本发明方法的总体流程图; FIG. 1 is an overall flowchart of the method of the present invention;
图 2是本发明方法的应用实例示图。 Fig. 2 is a diagram showing an application example of the method of the present invention.
具体实施方式 detailed description
下面结合附图和实施例对本发明方法作进一步说明。 The method of the present invention is further described below with reference to the accompanying drawings and embodiments.
图 1所示的流程为:首先由拓朴信息收集设备从本地节点根据其 邻接节点信息向邻接节点发送拓朴信息收集请求报文,请求报文中包 含用于限制报文转发次数的字段, 重复执行下述操作: The process shown in FIG. 1 is: First, a topology information collection device sends a topology information collection request message from a local node to an adjacent node according to its neighbor node information, and the request message includes a field for limiting the number of times the message is forwarded. Repeat the following:
收到请求报文的节点向拓朴信息收集设备返回包含本节点信息 和本节点与邻接节点连接信息的响应报文; The node receiving the request message returns a response message containing the information of the node and the connection information between the node and the adjacent node to the topology information collecting device;
判断报文转发次数是否达到限制值,如果是,结束操作;如果否, 继续以下处理; Judge whether the number of times of message forwarding reaches the limit, if yes, end the operation; if not, continue with the following processing;
收到请求报文的节点向各自的所有邻接节点转发请求报文。限制 报文转发次数的字段是为了控制拓朴收集的范围, 可以是整数, 初始 值设定后, 每个设备转发请求报文时将该字段减 1, 字段值为 0时, 将不再转发请求报文。 The node receiving the request message forwards the request message to all its neighboring nodes. The field that limits the number of times a message is forwarded is used to control the scope of topology collection. It can be an integer. After the initial value is set, each device forwards the request field by subtracting 1 from this field. Request message.
所述请求报文中可包含用于记载报文发送顺序的源路径字段,所 述响应报文中包含用于决定报文发送顺序的响应路径字段,每次发送 请求报文时, 将本节点的设备标识写入源路径字段, 响应路径字段由 相应源路径字段逆向得出。路径就是所有经过的设备的设备标识按顺 序的排列, 设备在转发请求给它的邻接设备之前,在该请求报文的源 路径字段末尾添力。上自己的设备标识,某个设备响应收到的请求报文
时,需要将请求报文的源路径字段的内容顺序颠倒作为响应报文的路 径。 在图 2所示实例中, 当设备 A发送拓朴请求报文 1给设备 B时, 该报 文的源路径字段仅为 1个设备标识, 即 。 设备 B在转发该请求给它的 邻接设备之前, 要在该请求报文的源路径末尾添加上自己的设备标 识, 故请求报文 2、 3的源路径字段为人、 B; 当某个设备响应收到的请 求报文时,需要将相应请求报文的源路径字段的内容顺序颠倒作为响 应路径字段, 即设备 D、 E响应报文 4、 5的响应路径字段为 B、 A。 The request message may include a source path field for recording a message sending sequence, and the response message includes a response path field for determining a message sending sequence. Each time a request message is sent, the node The device ID is written into the source path field, and the response path field is derived from the corresponding source path field. A path is a sequence of device identities of all passing devices. Before a device forwards a request to its neighbor, the device adds a force to the end of the source path field of the request message. Their own device identification, a device responds to a received request message In this case, the content of the source path field of the request message needs to be reversed as the path of the response message. In the example shown in FIG. 2, when the device A sends a topology request message 1 to the device B, the source path field of the message is only one device identifier, that is, a device identifier. Before device B forwards the request to its neighboring device, it needs to add its own device identification at the end of the source path of the request message, so the source path fields of request messages 2 and 3 are person and B; when a device responds When receiving the request message, the content of the source path field of the corresponding request message needs to be reversed as the response path field, that is, the response path fields of the device D and E response packets 4 and 5 are B and A.
为了进一步防止报文循环转发,某个设备收到拓朴信息收集请求 时, 如果该报文的源路由字段已经 包含本设备的设备标识, 则丟弃 该报文。如果该报文的目的地址即源路径字段最后的一个地址不是本 设备, 按照路径指示转发给它的邻接设备。 To further prevent the message from being forwarded circularly, when a device receives a request for topology information collection, if the source route field of the message already contains the device identifier of the device, the message is discarded. If the destination address of the packet, that is, the last address in the source path field, is not the local device, it is forwarded to its neighboring device according to the path instruction.
当拓朴请求报文在网络内扩散时,某个设备可能收到从多个邻接 设备转发给它的请求报文,为了防止收到重复的请求报文时发送重复 的响应报文, 所述请求报文中包括拓朴收集标识字段, 其值由拓朴信 息收集设备发起拓朴信息收集请求时产生,每次收集完毕, 将此值加 1 作为下一次收集的拓朴收集标识,所述响应报文中包括拓朴收集标 识字段, 其值取相应请求报文中的拓朴收集标识字段值, 收到请求报 文后, 判断拓朴收集标识与已响应的报文拓朴收集标识是否相同, 如 果相同, 则丢弃该请求报文; 否则, 处理该请求报文。 When the topology request message spreads in the network, a device may receive request messages forwarded to it from multiple neighboring devices. In order to prevent sending duplicate response messages when receiving duplicate request messages, The request message includes a topology collection identifier field, the value of which is generated when the topology information collection device initiates a topology information collection request. Each time the collection is completed, this value is increased by 1 as the topology collection identifier for the next collection. The response message includes a topology collection identifier field, whose value is the value of the topology collection identifier field in the corresponding request message. After receiving the request message, it is determined whether the topology collection identifier and the response message topology collection identifier are The same, if the same, the request message is discarded; otherwise, the request message is processed.
当拓朴请求报文在网络内扩散时,大量网络设备会同时收到拓朴 请求, 同时发送响应报文, 可能会引起网络拥塞和拓朴收集设备忙, 为了减少这种情况的出现, 每个设备在发送拓朴请求报文前, 可延迟
等待一定时间。 具体实施中, 令返回响应报文到转发请求报文之间等 待一段时间 T1 ; 转发请求报文时, 按设备端口顺序逐个转发, 其顺 序与响应报文中邻接节点顺序一致。 例如可以设 Τ1= (Χ+ Δ )毫秒, 其 中 X为一确定值, Δ为一个随机数, 所述拓朴收集请求报文中包含 Δ 的最大值以及设备端口逐个转发的时间间隔值,具体实施中 X的参考 值可以为 200毫秒,设备端口逐个转发的时间间隔值可以为 20毫秒。 When the topology request message spreads in the network, a large number of network devices will receive the topology request at the same time and send a response message at the same time, which may cause network congestion and busy the topology collection device. In order to reduce the occurrence of this situation, Devices can delay before sending a topology request message Wait for some time. In specific implementation, a period of time T1 is allowed between the response message being returned and the forwarding request message; when the request message is forwarded, it is forwarded one by one according to the device port order, and the order is consistent with the order of adjacent nodes in the response message. For example, T1 = (X + Δ) milliseconds, where X is a certain value and Δ is a random number, and the topology collection request message includes a maximum value of Δ and a time interval value for each device port to forward, specifically In the implementation, the reference value of X can be 200 milliseconds, and the time interval of the device port forwarding can be 20 milliseconds.
为了进一步保证拓朴收集的完整性, 当拓朴信息收集设备收到响 应报文时, 对返回该报文的节点设备记录并标识为已响应节点, 将其 邻接节点中未响应过的节点标识为未响应节点, 等待一段时间后, 对 未响应节点进行指定拓朴收集操作。 在发现某设备的响应未收到时 , 将通过指定拓朴收集过程, 收集该设备的拓朴信息, 这种情况下, 因 为拓朴收集设备已经根据收集到的设备间连接关系掌握了从自身到 达该指定设备的路由信息, 所以可以采用源路由方式寻址 , 不需要 采用上述逐级广播的方式, 从而减少网络拥塞, 提高执行效率。
In order to further ensure the integrity of the topology collection, when the topology information collection device receives a response message, it records and identifies the node device that returned the message as a responding node, and identifies the nodes that have not responded in its adjacent nodes. For a non-responding node, after waiting for a period of time, perform a specified topology collection operation on the non-responding node. When it is found that the response of a device is not received, the topology information of the device will be collected through the specified topology collection process. In this case, the topology collection device has mastered itself from the collected connection relationship between the devices. The routing information to the specified device can be addressed using source routing, and the above-mentioned gradual broadcast mode is not required, thereby reducing network congestion and improving execution efficiency.