CN109936480B - Network topology discovery method and device, storage medium and electronic device - Google Patents
Network topology discovery method and device, storage medium and electronic device Download PDFInfo
- Publication number
- CN109936480B CN109936480B CN201910209190.0A CN201910209190A CN109936480B CN 109936480 B CN109936480 B CN 109936480B CN 201910209190 A CN201910209190 A CN 201910209190A CN 109936480 B CN109936480 B CN 109936480B
- Authority
- CN
- China
- Prior art keywords
- connection information
- network topology
- network
- information
- target
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 115
- 238000012360 testing method Methods 0.000 claims description 3
- 238000007726 management method Methods 0.000 description 14
- 238000010586 diagram Methods 0.000 description 10
- 230000006870 function Effects 0.000 description 4
- 230000001502 supplementing effect Effects 0.000 description 3
- 239000013589 supplement Substances 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 230000001419 dependent effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 238000013439 planning Methods 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000013468 resource allocation Methods 0.000 description 1
- 230000009469 supplementation Effects 0.000 description 1
Images
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明提供了一种网络拓扑发现方法,包括:当任意子网络中的主管理器接收到网络拓扑发现请求时,确定初始连接信息集合;对初始信息集合进行更新操作,将符合预设条件的连接信息转移到预设的目标连接信息存储区域中,并依据预设的目标连接信息中的各个目标连接信息,确定第一网络拓扑信息;向每个补充管理器发送网络拓扑发现指令,以触发每个补充管理器确定与其对应的第二网络拓扑信息,并将各个第二网络拓扑信息发送至主管理器;依据第一网络拓扑信息及各个第二网络拓扑信息确定目标网络拓扑信息。通过获取第一网络拓信息和接收第二网络拓扑信息,能全面的获取当前网络中的各个网络节点的拓扑信息,进而能够精准的进行网络拓扑发现。
The present invention provides a network topology discovery method, comprising: when a master manager in any sub-network receives a network topology discovery request, determining an initial connection information set; The connection information is transferred to the preset target connection information storage area, and the first network topology information is determined according to each target connection information in the preset target connection information; a network topology discovery instruction is sent to each supplementary manager to trigger Each supplementary manager determines its corresponding second network topology information, and sends each second network topology information to the main manager; the target network topology information is determined according to the first network topology information and each second network topology information. By acquiring the first network topology information and receiving the second network topology information, the topology information of each network node in the current network can be comprehensively acquired, thereby enabling accurate network topology discovery.
Description
技术领域technical field
本发明涉及网络管理领域,特别涉及一种网络拓扑发现方法及装置、存储介质及电子设备。The present invention relates to the field of network management, in particular to a method and device for discovering network topology, a storage medium and an electronic device.
背景技术Background technique
随着信息科技的发展,人们对计算机网络的日益依赖,使得计算机网络本身运行的可靠性变得至关重要,因此人们对网络管理也就有了更高的要求。为了方便技术人员对网络进行管理,通常需要进行网络拓扑发现,通过网络拓扑发现,技术人员可以定位网络故障,明确网络瓶颈,从而优化网络的整体布局与规划,提高网络运行效率。网络拓扑发现是配置管理的核心,是网络安全、网络性能监测与评估、故障发现与定位、资源分配与管理等网管工作的基础,网络拓扑发现对于网络管理和应用具有十分重要的意义。With the development of information technology, people are increasingly dependent on computer networks, making the reliability of the computer network itself very important, so people have higher requirements for network management. To facilitate network management by technicians, network topology discovery is usually required. Through network topology discovery, technicians can locate network faults and identify network bottlenecks, thereby optimizing the overall network layout and planning and improving network operation efficiency. Network topology discovery is the core of configuration management and the basis of network management work such as network security, network performance monitoring and evaluation, fault discovery and location, resource allocation and management. Network topology discovery is of great significance to network management and applications.
经本发明人研究发现,现有技术中,通常通过简单网络管理协议(Simple NetworkManagementProtocol,SNMP)进行网络拓扑发现。基于SNMP的网络拓扑发现方法,要求建立SNMP网络管理运行环境,需要在设备上开启SNMP功能,但在一个交换域网络的实际网络环境中,往往会有一些设备上的SNMP功能不会被开启,这会造成网络拓扑发现所需的数据不完整,影响网络拓扑的准确率。The inventors have found that, in the prior art, network topology discovery is usually performed through a Simple Network Management Protocol (Simple Network Management Protocol, SNMP). The SNMP-based network topology discovery method requires the establishment of an SNMP network management operating environment, and the SNMP function needs to be enabled on the device. However, in an actual network environment of a switched domain network, the SNMP function on some devices is often not enabled. This will result in incomplete data required for network topology discovery, affecting the accuracy of the network topology.
发明内容SUMMARY OF THE INVENTION
本发明所要解决的技术问题是提供一种网络拓扑发现方法,能够依据第一网络拓扑信息及第二网络拓扑信息确定目标网络拓扑信息,能全面的获取当前网络中的各个网络节点的拓扑信息,进而能够精准的进行网络拓扑发现。The technical problem to be solved by the present invention is to provide a network topology discovery method, which can determine the target network topology information according to the first network topology information and the second network topology information, and can comprehensively obtain the topology information of each network node in the current network, This enables accurate network topology discovery.
本发明还提供了一种网络拓扑发现装置,用以保证上述方法在实际中的实现及应用。The present invention also provides a network topology discovery device to ensure the practical realization and application of the above method.
一种网络拓扑发现方法,所述方法应用于交换域网络中的各个子网络,所述子网络中包括主管理器、至少一个补充管理器和至少一个交换机;所述方法包括:A network topology discovery method, the method is applied to each sub-network in a switching domain network, the sub-network includes a main manager, at least one supplementary manager and at least one switch; the method includes:
当任意子网络中的主管理器接收到网络拓扑发现请求时,确定初始连接信息集合;所述初始连接信息集合包括该子网络中每个所述交换机的连接信息,所述连接信息包括交换机的身份标识、交换机的端口标识及与交换机的端口相连接的各个网络节点的身份标识,所述网络节点为交换机或终端设备;When the master manager in any sub-network receives a network topology discovery request, it determines an initial connection information set; the initial connection information set includes connection information of each switch in the sub-network, and the connection information includes An identity identifier, a port identifier of a switch, and an identity identifier of each network node connected to the port of the switch, where the network node is a switch or a terminal device;
将所述初始连接信息集合确定为目标连接信息集合,对所述目标连接信息集合执行更新操作,所述更新操作包括:遍历所述目标连接信息集合中的各个连接信息,将满足预设条件的各个连接信息,确定为目标连接信息,并将各个所述目标连接信息转移至预先建立的目标连接信息存储区域中;将各个所述目标连接信息对应的交换机分别确定为子交换机,并将所述目标连接信息集合中剩余的各个连接信息中包含的所述子交换机下行端口连接的网络节点的身份标识,替换为所述子交换机的身份标识;并将所述目标连接信息集合中剩余的各个连接信息组成新的目标连接信息集合;The initial connection information set is determined as a target connection information set, and an update operation is performed on the target connection information set, and the update operation includes: traversing each connection information in the target connection information set, Each connection information is determined as target connection information, and each said target connection information is transferred to a pre-established target connection information storage area; the switches corresponding to each said target connection information are respectively determined as sub-switches, and said The identity of the network node connected to the downlink port of the sub-switch included in the remaining connection information in the target connection information set is replaced with the identity of the sub-switch; and the remaining connections in the target connection information set The information forms a new set of target connection information;
判断所述新的目标连接信息集合中连接信息的数目是否满足预设的连接信息数目阈值,若不满足时,对所述新的目标连接信息集合重新执行所述更新操作,直至当前所组成的新的目标连接信息集合中连接信息的数目满足所述预设的连接信息数目阈值;Judging whether the number of connection information in the new target connection information set satisfies the preset connection information number threshold, if not, re-execute the update operation on the new target connection information set until the current composition The number of connection information in the new target connection information set satisfies the preset connection information number threshold;
依据当前所述目标连接信息存储区域中的各个目标连接信息,确定第一网络拓扑信息;Determine the first network topology information according to each target connection information in the current target connection information storage area;
向该子网络中的每个所述补充管理器发送网络拓扑发现指令,以触发每个所述补充管理器确定与其对应的第二网络拓扑信息,并将各个所述第二网络拓扑信息发送至主管理器;Send a network topology discovery instruction to each of the supplementary managers in the sub-network to trigger each of the supplementary managers to determine the second network topology information corresponding to it, and send each of the second network topology information to main manager;
依据所述第一网络拓扑信息及各个所述第二网络拓扑信息确定目标网络拓扑信息。Target network topology information is determined according to the first network topology information and each of the second network topology information.
上述的方法,可选的,所述确定初始连接信息集合的过程,包括:In the above method, optionally, the process of determining the initial connection information set includes:
获取各个交换机的地址转发表AFT;Obtain the address forwarding table AFT of each switch;
获取各个交换机端口所连接的各个网络节点的类型变量值,依据所述类型变量值确定所述各个网络节点的类型;Obtain the type variable value of each network node connected to each switch port, and determine the type of each network node according to the type variable value;
依据所述AFT及各个交换机端口所连接的各个网络节点的类型确定所述初始连接信息集合。The initial connection information set is determined according to the type of each network node connected to the AFT and each switch port.
上述的方法,可选的,所述获取所述各个交换机的AFT,包括:In the above method, optionally, the acquiring the AFT of each switch includes:
在预设的时限内连续执行确定操作,所述确定操作包括:获取各个交换机的AFT,并对所述AFT中各个网络节点进行ping测试;Continuously perform a determination operation within a preset time limit, the determination operation includes: acquiring the AFT of each switch, and performing a ping test on each network node in the AFT;
获取所述预设的时限结束后得到的各个交换机的AFT。Acquire the AFT of each switch obtained after the preset time limit expires.
上述的方法,可选的,将满足预设条件的各个连接信息,确定为目标连接信息,包括:In the above method, optionally, each connection information that satisfies the preset condition is determined as the target connection information, including:
对于所述目标连接信息集合中的每个连接信息,For each connection information in the target connection information set,
判断该连接信息对应的交换机是否与目标交换机相连接;Determine whether the switch corresponding to the connection information is connected to the target switch;
若不相连接,则判定该连接信息为目标连接信息;If it is not connected, it is determined that the connection information is the target connection information;
若相连接,则判断该连接信息对应的交换机是否仅与一个所述目标交换机相连接,若是,则判定该连接信息为目标连接信息;If connected, determine whether the switch corresponding to the connection information is only connected to one of the target switches, and if so, determine that the connection information is target connection information;
其中,所述目标交换机为当前所述目标连接信息集合中其余的连接信息分别对应的各个交换机。Wherein, the target switch is each switch respectively corresponding to the remaining connection information in the current target connection information set.
上述的方法,可选的,所述依据所述第一网络拓扑信息及各个所述第二网络拓扑信息确定目标网络拓扑信息,包括:In the above method, optionally, the determining the target network topology information according to the first network topology information and each of the second network topology information includes:
将各个所述第二网络拓扑信息与所述第一网络拓扑信息进行对比得到对比结果;Comparing each of the second network topology information with the first network topology information to obtain a comparison result;
依据所述对比结果,将补充节点对应的网络拓扑信息补充至所述第一网络拓扑信息,其中,所述补充节点为所述第二网络拓扑信息中存在的且所述第一网络拓扑信息中未存在的网络节点;According to the comparison result, the network topology information corresponding to the supplementary node is supplemented to the first network topology information, wherein the supplementary node exists in the second network topology information and in the first network topology information. non-existing network nodes;
将补充后的第一网络拓扑信息确定目标网络拓扑信息。Determine the target network topology information from the supplemented first network topology information.
上述的方法,可选的,若所述补充节点对应的网络拓扑信息为多种,则所述将补充节点对应的网络拓扑信息补充至所述第一网络拓扑信息,包括:In the above method, optionally, if there are multiple types of network topology information corresponding to the supplementary node, the supplementing the network topology information corresponding to the supplementary node to the first network topology information includes:
依据预先设定的主管理器投票权重及每个预先设定的补充管理器投票权重,对所述补充节点对应的多种网络拓扑信息进行投票得到投票结果;According to the preset voting weight of the main manager and the voting weight of each preset supplementary manager, voting on various network topology information corresponding to the supplementary node to obtain a voting result;
确定与所述投票结果对应的网络拓扑信息,并将与所述投票结果对应的网络拓扑信息补充至所述第一网络拓扑信息。Network topology information corresponding to the voting result is determined, and the network topology information corresponding to the voting result is supplemented to the first network topology information.
上述的方法,可选的,所述依据所述第一网络拓扑信息及各个所述第二网络拓扑信息确定目标网络拓扑信息,包括:In the above method, optionally, the determining the target network topology information according to the first network topology information and each of the second network topology information includes:
依据预先设定的主管理器投票权重和各个预先设定的补充管理器投票权重,对所述第一网络拓扑信息及各个所述第二网络拓扑信息进行投票得到投票结果;voting on the first network topology information and each of the second network topology information according to the preset main manager voting weight and each preset supplementary manager voting weight to obtain a voting result;
将所述投票结果对应的网络拓扑信息确定为目标网络拓扑信息。The network topology information corresponding to the voting result is determined as the target network topology information.
一种网络拓扑发现装置,所述网络拓扑发现装置应用于交换域网络中的各个子网络,所述子网络中包括主管理器、至少一个补充管理器和至少一个交换机,所述装置包括:A network topology discovery device, the network topology discovery device is applied to each sub-network in a switching domain network, the sub-network includes a main manager, at least one supplementary manager and at least one switch, and the device includes:
第一确定单元,用于当接收到网络拓扑发现请求时,确定初始连接信息集合;所述初始连接信息集合包括该子网络中每个所述交换机的连接信息,所述连接信息包括交换机的身份标识、交换机的端口标识及与交换机的端口相连接的各个网络节点的身份标识,所述网络节点为交换机或终端设备;a first determining unit, configured to determine an initial connection information set when receiving a network topology discovery request; the initial connection information set includes connection information of each switch in the sub-network, and the connection information includes the identity of the switch an identifier, a port identifier of the switch, and an identifier of each network node connected to the port of the switch, where the network node is a switch or a terminal device;
更新单元,用于将所述初始连接信息集合确定为目标连接信息集合,对所述目标连接信息集合执行更新操作,所述更新操作包括:遍历所述目标连接信息集合中的各个连接信息,将满足预设条件的各个连接信息,确定为目标连接信息,并将各个所述目标连接信息转移至预先建立的目标连接信息存储区域中;将各个所述目标连接信息对应的交换机分别确定为子交换机,并将所述目标连接信息集合中剩余的各个连接信息中包含的所述子交换机下行端口连接的网络节点的身份标识,替换为所述子交换机的身份标识;并将所述目标连接信息集合中剩余的各个连接信息组成新的目标连接信息集合;an update unit, configured to determine the initial connection information set as a target connection information set, and perform an update operation on the target connection information set, where the update operation includes: traversing each connection information in the target connection information set, Each connection information that satisfies the preset condition is determined as target connection information, and each of the target connection information is transferred to a pre-established target connection information storage area; the switches corresponding to each of the target connection information are respectively determined as sub-switches , and replace the identity of the network node connected to the downlink port of the sub-switch included in the remaining connection information in the target connection information set with the identity of the sub-switch; and the target connection information set The remaining connection information forms a new set of target connection information;
判断单元,用于判断所述新的目标连接信息集合中连接信息的数目是否满足预设的连接信息数目阈值,若不满足时,对所述新的目标连接信息集合重新执行所述更新操作,直至当前所组成的新的目标连接信息集合中连接信息的数目满足所述预设的连接信息数目阈值;a judgment unit, configured to judge whether the number of connection information in the new target connection information set satisfies a preset connection information number threshold, and if not, re-execute the update operation on the new target connection information set, Until the number of connection information in the new target connection information set currently formed meets the preset connection information number threshold;
第二确定单元,用于依据当前所述目标连接信息存储区域中的各个目标连接信息,确定第一网络拓扑信息;a second determining unit, configured to determine the first network topology information according to each target connection information in the current target connection information storage area;
发送单元,用于向该子网络中的每个所述补充管理器发送网络拓扑发现指令,以触发每个所述补充管理器确定与其对应的第二网络拓扑信息,并将各个所述第二网络拓扑信息发送至主管理器;The sending unit is configured to send a network topology discovery instruction to each of the supplementary managers in the sub-network, so as to trigger each of the supplementary managers to determine the corresponding second network topology information, and to The network topology information is sent to the main manager;
第三确定单元,用于依据所述第一网络拓扑信息及各个所述第二网络拓扑信息确定目标网络拓扑信息。A third determining unit, configured to determine target network topology information according to the first network topology information and each of the second network topology information.
一种存储介质,所述存储介质包括存储的指令,其中,在所述指令运行时控制所述存储介质所在的设备执行上述的网络拓扑发现方法。A storage medium, the storage medium comprising stored instructions, wherein when the instructions are executed, a device where the storage medium is located is controlled to execute the above network topology discovery method.
一种电子设备,包括存储器,以及一个或者一个以上的指令,其中一个或者一个以上指令存储于存储器中,且经配置以由一个或者一个以上处理器执行上述的网络拓扑发现方法。An electronic device includes a memory, and one or more instructions, wherein the one or more instructions are stored in the memory and configured to perform the above-described network topology discovery method by one or more processors.
与现有技术相比,本发明包括以下优点:Compared with the prior art, the present invention includes the following advantages:
本发明提供了一种网络拓扑发现方法,包括:当任意子网络中的主管理器接收到网络拓扑发现请求时,确定初始连接信息集合;对初始信息集合进行更新操作,将符合预设条件的连接信息转移到预设的目标连接信息存储区域中,并依据预设的目标连接信息中的各个目标连接信息,确定第一网络拓扑信息;向每个补充管理器发送网络拓扑发现指令,以触发每个补充管理器确定与其对应的第二网络拓扑信息,并将各个第二网络拓扑信息发送至主管理器;依据第一网络拓扑信息及各个第二网络拓扑信息确定目标网络拓扑信息。通过获取第一网络拓信息和接收第二网络拓扑信息,能全面的获取当前网络中的各个网络节点的拓扑信息,进而能够精准的进行网络拓扑发现。The present invention provides a network topology discovery method, comprising: when a master manager in any sub-network receives a network topology discovery request, determining an initial connection information set; The connection information is transferred to the preset target connection information storage area, and the first network topology information is determined according to each target connection information in the preset target connection information; a network topology discovery instruction is sent to each supplementary manager to trigger Each supplementary manager determines its corresponding second network topology information, and sends each second network topology information to the main manager; the target network topology information is determined according to the first network topology information and each second network topology information. By acquiring the first network topology information and receiving the second network topology information, the topology information of each network node in the current network can be comprehensively acquired, thereby enabling accurate network topology discovery.
附图说明Description of drawings
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present invention more clearly, the following briefly introduces the accompanying drawings used in the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained from these drawings without creative labor.
图1为本发明提供的一种网络拓扑发现方法的方法流程图;Fig. 1 is a method flow chart of a network topology discovery method provided by the present invention;
图2为本发明提供的一种网络拓扑发现方法的又一方法流程图;Fig. 2 is another method flow chart of a network topology discovery method provided by the present invention;
图3为本发明提供的一种网络拓扑发现方法的一示例图;FIG. 3 is an exemplary diagram of a network topology discovery method provided by the present invention;
图4为本发明提供的一种网络拓扑发现方法的又一示例图;Fig. 4 is another exemplary diagram of a network topology discovery method provided by the present invention;
图5为本发明提供的一种网络拓扑发现方法的又一示例图;Fig. 5 is another exemplary diagram of a network topology discovery method provided by the present invention;
图6为本发明提供的一种网络拓扑发现装置的结构示意图;6 is a schematic structural diagram of a network topology discovery device provided by the present invention;
图7为本发明提供的一种电子设备的结构示意图。FIG. 7 is a schematic structural diagram of an electronic device provided by the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
本发明可用于众多通用或专用的计算装置环境或配置中。例如:个人计算机、服务器计算机、手持设备或便携式设备、平板型设备、多处理器装置、包括以上任何装置或设备的分布式计算环境等等。The present invention may be used in numerous general purpose or special purpose computing device environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet-type devices, multi-processor devices, distributed computing environments including any of the above, and the like.
一种网络拓扑发现方法,其特征在于,所述方法应用于交换域网络中的各个子网络,所述子网络中包括主管理器、至少一个补充管理器和至少一个交换机;所述方法的执行主体可以为主管理器的处理器,所述主管理器可以为计算机终端或各种移动设备,所述方法的方法流程图如图1所示,具体包括:A network topology discovery method, characterized in that the method is applied to each sub-network in a switching domain network, and the sub-network includes a main manager, at least one supplementary manager and at least one switch; the execution of the method The main body may be the processor of the main manager, and the main manager may be a computer terminal or various mobile devices. The method flowchart of the method is shown in FIG. 1 , and specifically includes:
S101:当任意子网络中的主管理器接收到网络拓扑发现请求时,确定初始连接信息集合。S101: When a master manager in any sub-network receives a network topology discovery request, determine an initial connection information set.
本发明实施例提供的方法中,所述初始连接信息集合包括该子网络中每个所述交换机的连接信息,所述连接信息包括交换机的身份标识、交换机的端口标识及与交换机的端口相连接的各个网络节点的身份标识,所述网络节点为交换机或终端设备。In the method provided by the embodiment of the present invention, the initial connection information set includes connection information of each switch in the sub-network, and the connection information includes an identity identifier of the switch, a port identifier of the switch, and a port connected to the switch. The identity of each network node, the network node is a switch or a terminal device.
本发明实施例提供的方法中,所述终端设备可以是具有网卡的设备,例如计算机、带网卡的打印机和带网卡的投影仪等。In the method provided by the embodiment of the present invention, the terminal device may be a device with a network card, such as a computer, a printer with a network card, a projector with a network card, and the like.
本发明实施例提供的方法中,所述交换机的连接信息可以记录为交换机的一个端口连接一个或多个终端设备。In the method provided by the embodiment of the present invention, the connection information of the switch may be recorded as one port of the switch is connected to one or more terminal devices.
本发明实施例提供的方法中,所述初始信息集合中各个交换机的连接信息可以是完整的,也可以是不完整的。In the method provided by the embodiment of the present invention, the connection information of each switch in the initial information set may be complete or incomplete.
本发明实施例提供的方法中,所述身份标识包括IP地址,还可以包括设备类型及设备MAC地址等一种或多种。In the method provided by the embodiment of the present invention, the identity identifier includes an IP address, and may also include one or more of a device type and a device MAC address.
S102:将所述初始连接信息集合确定为目标连接信息集合,对所述目标连接信息集合执行更新操作,所述更新操作包括:遍历所述目标连接信息集合中的各个连接信息,将满足预设条件的各个连接信息,确定为目标连接信息,并将各个所述目标连接信息转移至预先建立的目标连接信息存储区域中;将各个所述目标连接信息对应的交换机分别确定为子交换机,并将所述目标连接信息集合中剩余的各个连接信息中包含的所述子交换机下行端口连接的网络节点的身份标识,替换为所述子交换机的身份标识;并将所述目标连接信息集合中剩余的各个连接信息组成新的目标连接信息集合。S102: Determine the initial connection information set as a target connection information set, and perform an update operation on the target connection information set, where the update operation includes: traversing each connection information in the target connection information set, and meeting the preset requirements Each connection information of the conditions is determined as target connection information, and each of the target connection information is transferred to the pre-established target connection information storage area; the switches corresponding to each of the target connection information are respectively determined as sub-switches, and the The identity of the network node connected to the downlink port of the sub-switch contained in the remaining connection information in the target connection information set is replaced with the identity of the sub-switch; Each connection information constitutes a new set of target connection information.
本发明实施例提供的方法,可选的,所述将所述目标连接信息集合中剩余的各个目标连接信息中包含的所述子交换机下行端口连接的终端设备身份标识,替换为所述子交换机的身份标识的过程中,所述身份标识为IP地址。In the method provided by the embodiment of the present invention, optionally, the terminal device identity of the sub-switch connected to the downlink port included in the remaining target connection information in the target connection information set is replaced by the sub-switch In the process of identifying the identity, the identity is an IP address.
本发明实施例提供的方法中,子交换机的下行端口可以依据子交换机对应的连接信息进行确定,可选的,连接父交换机的端口为上行端口,其余的端口为下行端口。In the method provided by the embodiment of the present invention, the downlink ports of the sub-switches may be determined according to the connection information corresponding to the sub-switches. Optionally, the ports connected to the parent switch are uplink ports, and the remaining ports are downlink ports.
S103:判断新的目标连接信息集合中连接信息的数目是否满足预设的连接信息数目阈值,若不满足,则对所述新的目标连接信息集合重新执行所述更新操作,直至当前所组成的新的目标连接信息集合中连接信息的数目满足所述预设的连接信息数目阈值。S103: Determine whether the number of connection information in the new target connection information set satisfies a preset number of connection information thresholds, and if not, re-execute the update operation on the new target connection information set until the current composition The number of connection information in the new target connection information set satisfies the preset threshold of the number of connection information.
本发明实施例提供的方法,可选的,预设的连接数目阈值可以是由已转移至目标连接信息集合存储区域的连接信息,是否能完整确定第一网络拓扑信息决定的,可选的,当目标连接信息集合中的交换机的连接信息的数目为一条时,则确定交换机的连接信息的数目满足预设的连接数目阈值。In the method provided by this embodiment of the present invention, optionally, the preset connection number threshold may be determined by whether the connection information that has been transferred to the target connection information collection storage area can completely determine the first network topology information, and optionally, When the number of connection information of switches in the target connection information set is one piece, it is determined that the number of connection information of switches satisfies the preset connection number threshold.
S104:依据当前所述目标连接信息存储区域中的各个目标连接信息,确定第一网络拓扑信息。S104: Determine the first network topology information according to each target connection information in the current target connection information storage area.
本发明实施例提供的方法,将所述目标连接信息集合中的各个连接信息进行过滤,并将过滤后的连接信息进行组合,以确定第一网络拓扑信息。In the method provided by the embodiment of the present invention, each connection information in the target connection information set is filtered, and the filtered connection information is combined to determine the first network topology information.
本发明实施例提供的方法,依据连接信息中的端口标识及连接的网络节点身份标识对所述目标连接信息集合中的各个连接信息进行过滤,将冗余信息和/或不符合逻辑的信息剔除。In the method provided by the embodiment of the present invention, each connection information in the target connection information set is filtered according to the port identifier in the connection information and the connected network node identifier, and redundant information and/or illogical information is eliminated. .
本发明实施例提供的方法中,依据所述目标连接信息集合可以确定一种或多种第一网络拓扑信息。In the method provided by the embodiment of the present invention, one or more pieces of first network topology information may be determined according to the target connection information set.
S105:向该子网络中的每个所述补充管理器发送网络拓扑发现指令,以触发每个所述补充管理器确定与其对应的第二网络拓扑信息,并将各个所述第二网络拓扑信息发送至主管理器。S105: Send a network topology discovery instruction to each of the supplementary managers in the sub-network, so as to trigger each of the supplementary managers to determine the second network topology information corresponding to it, and to use the second network topology information for each of the supplementary managers Sent to the main manager.
本发明实施例提供的方法中,所述补充管理器确定与其对应的第二网络拓扑信息的过程可以与所述主管理器确定第一网络拓扑信息的过程一致,也可以不一致,具体由技术人员依据网络运行性能及要求的网络拓扑的精确度决定。In the method provided by the embodiment of the present invention, the process of determining the second network topology information corresponding to the supplementary manager may be consistent with the process of determining the first network topology information by the main manager, or may be inconsistent, and the specific process is determined by the technical personnel. It is determined according to the network performance and the required accuracy of the network topology.
本发明实施例提供的方法中,所述补充管理器的数量可以为一个或多个。In the method provided by the embodiment of the present invention, the number of the supplementary managers may be one or more.
本发明实施例提供的方法中,每一个补充管理器确定第二网络拓扑信息的过程是独立的,当补充管理器的数目为多个时,每个补充管理器都确定一个第二网络拓扑信息。In the method provided by the embodiment of the present invention, the process of each supplementary manager determining the second network topology information is independent, and when the number of supplementary managers is multiple, each supplementary manager determines a piece of second network topology information .
S106:依据所述第一网络拓扑信息及各个所述第二网络拓扑信息确定目标网络拓扑信息。S106: Determine target network topology information according to the first network topology information and each of the second network topology information.
本发明实施例通过的方法中,接收每一个所述补充管理器发送的与其对应的第二网络拓扑信息。In the method adopted in the embodiment of the present invention, the corresponding second network topology information sent by each of the supplementary managers is received.
本发明实施例提供的方法中,当第二网络拓扑信息中存在第一网络拓扑信息中不存在的网络节点时,将该网络节点对应的拓扑信息补充至第一网络拓扑信息,将经过补充后的第一网络拓扑信息确定所述目标网络拓扑信息。In the method provided by the embodiment of the present invention, when there is a network node that does not exist in the first network topology information in the second network topology information, the topology information corresponding to the network node is supplemented to the first network topology information, and after the supplementation The first network topology information of the target network topology information is determined.
本发明实施例提供的方法中,可以通过预先设定的主管理器投票权重及补充管理器投票权重,对所述第一网络拓扑信息及所述第二网络拓扑信息进行投票,以确定目标网络拓扑信息。In the method provided by the embodiment of the present invention, the first network topology information and the second network topology information may be voted on by using the preset voting weight of the main manager and the voting weight of the supplementary manager to determine the target network topology information.
本发明实施例提供的网络拓扑发现方法,包括:当任意子网络中的主管理器接收到网络拓扑发现请求时,确定初始连接信息集合;对初始信息集合进行更新操作,将符合预设条件的连接信息转移到预设的目标连接信息存储区域中,并依据预设的目标连接信息中的各个目标连接信息,确定第一网络拓扑信息;向每个补充管理器发送网络拓扑发现指令,以触发每个补充管理器确定与其对应的第二网络拓扑信息,并将各个第二网络拓扑信息发送至主管理器;依据第一网络拓扑信息及各个第二网络拓扑信息确定目标网络拓扑信息。通过获取第一网络拓信息和接收第二网络拓扑信息,能全面的获取当前网络中的各个网络节点的拓扑信息,进而能够精准的进行网络拓扑发现。The network topology discovery method provided by the embodiment of the present invention includes: when a master manager in any sub-network receives a network topology discovery request, determining an initial connection information set; The connection information is transferred to the preset target connection information storage area, and the first network topology information is determined according to each target connection information in the preset target connection information; a network topology discovery instruction is sent to each supplementary manager to trigger Each supplementary manager determines its corresponding second network topology information, and sends each second network topology information to the main manager; the target network topology information is determined according to the first network topology information and each second network topology information. By acquiring the first network topology information and receiving the second network topology information, the topology information of each network node in the current network can be comprehensively acquired, thereby enabling accurate network topology discovery.
本发明实施例提供的网络拓扑发现方法中,确定初始连接信息集合的过程,如图2所示,具体包括:In the network topology discovery method provided by the embodiment of the present invention, the process of determining the initial connection information set, as shown in FIG. 2, specifically includes:
S201:获取各个交换机的地址转发表(Address Forwarding Table,AFT)。S201: Obtain the address forwarding table (Address Forwarding Table, AFT) of each switch.
本发明实施例提供的方法中,获取各个交换机的AFT的过程,可以包括:通过SNMP获取各个交换机的AFT,或者获取所述主管理器地址解析协议(Address ResolutionProtoco1,ARP)表,并通过所述ARP表确定各个交换机的AFT。In the method provided by the embodiment of the present invention, the process of acquiring the AFT of each switch may include: acquiring the AFT of each switch through SNMP, or acquiring the master address resolution protocol (Address Resolution Protocol, ARP) table, and using the The ARP table determines the AFT of each switch.
S202:获取各个交换机端口所连接的各个网络节点的类型变量值,依据所述类型变量值确定所述各个网络节点的类型。S202: Obtain the type variable value of each network node connected to each switch port, and determine the type of each network node according to the type variable value.
本发明实施例提供的方法中,可选的,所述类型变量值为sysServices变量值。In the method provided by the embodiment of the present invention, optionally, the type variable value is the sysServices variable value.
本发明实施例提供的方法中,通过管理信息库(Management Information Base,MIB)的system组中的sysServices变量值可以确定各个所述各个网络节点的类型,网络节点的具体类型有以下判断方法:In the method provided by the embodiment of the present invention, the type of each of the network nodes can be determined by the sysServices variable value in the system group of the management information base (Management Information Base, MIB), and the specific types of the network nodes have the following judgment methods:
可以通过判断网络节点对应的sysServices值是否大于等于2^(7-1)=64来确定所述网络节点是否是终端设备,如果sysServices变量值大于等于64,说明应用层的值为1,则可以确定网络节点终端设备;Whether the network node is a terminal device can be determined by judging whether the sysServices value corresponding to the network node is greater than or equal to 2^(7-1)=64. If the value of the sysServices variable is greater than or equal to 64, it means that the value of the application layer is 1. Determine network node terminal equipment;
如果所述sysServices变量值为:2^(1–1)+2^(2–1)=3,说明设备类型为二层交换机;If the value of the sysServices variable is: 2^(1–1)+2^(2–1)=3, it means that the device type is a Layer 2 switch;
如果sysServices变量值为:(2^(1–1)+2^(2–1)+2^(3–1)=7,说明设备类型为三层设备,这时有可能为三层交换机或路由器,通过Bridge-MIB来具体区分,其OID值为:.1.3.6.1.2.1.17.1.,如果设备回应,说明是三层交换机,否则为路由器。If the value of the sysServices variable is: (2^(1–1)+2^(2–1)+2^(3–1)=7, it means that the device type is a Layer 3 device, which may be a Layer 3 switch or The router is specifically distinguished by Bridge-MIB, and its OID value is: .1.3.6.1.2.1.17.1. If the device responds, it means that it is a Layer 3 switch, otherwise it is a router.
S203:依据所述AFT及所述各个交换机端口所连接的各个网络节点的类型确定所述初始连接信息集合。S203: Determine the initial connection information set according to the type of each network node connected to the AFT and each switch port.
本发明实施例提供的方法中,获取ATF后,对所述ATF进行处理,得到第一记录表,所述第一记录表的局部如表1所示:In the method provided by the embodiment of the present invention, after acquiring the ATF, the ATF is processed to obtain a first record table, and a part of the first record table is shown in Table 1:
表1Table 1
依据各个网络节点的IP地址及各个网络节点的类型,生成第二记录表,所述第二记录表的局部如表2所示:According to the IP address of each network node and the type of each network node, the second record table is generated, and the part of the second record table is shown in Table 2:
表2Table 2
依据所述第一记录表及所述第二记录表生成初始连接信息集合,所述初始连接信息集合的局部,可以如表3所示:An initial connection information set is generated according to the first record table and the second record table, and the part of the initial connection information set can be as shown in Table 3:
表3table 3
本发明实施例提供的网络拓扑发现方法中,获取所述各个交换机的AFT的过程,可以包括:In the network topology discovery method provided by the embodiment of the present invention, the process of acquiring the AFT of each switch may include:
在预设的时限内连续执行确定操作,所述确定操作包括:获取各个交换机的AFT,并对所述AFT中各个网络节点进行ping测试;Continuously perform a determination operation within a preset time limit, the determination operation includes: acquiring the AFT of each switch, and performing a ping test on each network node in the AFT;
获取所述预设的时限结束后得到的各个交换机的AFT。Acquire the AFT of each switch obtained after the preset time limit expires.
本发明实施例提供的方法,时限的长短可以由技术人员依据实际需求进行调整。In the method provided by the embodiment of the present invention, the length of the time limit can be adjusted by the technical personnel according to actual needs.
本发明实施例提供的方法,通过设置有一个定时器,在预设的定时器时限内不断执行确定操作,能有效的剔除网络中失效的AFT记录。In the method provided by the embodiment of the present invention, by setting a timer, and continuously performing the determination operation within the preset timer time limit, the invalid AFT records in the network can be effectively eliminated.
本发明实施例提供的方法中,将满足预设条件的各个连接信息,确定为目标连接信息,包括:In the method provided by the embodiment of the present invention, each connection information that satisfies the preset condition is determined as the target connection information, including:
对于所述目标连接信息集合中的每个连接信息,For each connection information in the target connection information set,
判断该连接信息对应的交换机是否与目标交换机相连接;Determine whether the switch corresponding to the connection information is connected to the target switch;
若不相连接,则判定该连接信息为目标连接信息;If it is not connected, it is determined that the connection information is the target connection information;
若相连接,则判断该连接信息对应的交换机是否仅与一个所述目标交换机相连接,若是,则判定该连接信息为目标连接信息;If connected, determine whether the switch corresponding to the connection information is only connected to one of the target switches, and if so, determine that the connection information is target connection information;
其中,所述目标交换机为当前所述目标连接信息集合中其余的连接信息分别对应的各个交换机。Wherein, the target switch is each switch respectively corresponding to the remaining connection information in the current target connection information set.
本发明实施例提供的方法,当目标连接信息集合中剩余一条连接信息时,且满足预设的连接信息数目阈值,则将该剩余的连接信息确定为目标连接信息。In the method provided by the embodiment of the present invention, when there is one piece of connection information remaining in the target connection information set and the preset number of connection information threshold is met, the remaining connection information is determined as the target connection information.
本发明实施例提供的方法中,目标连接信息集合中有若干条连接信息,分别判断各条连接信息对应的交换机是否与目标交换机连接。In the method provided by the embodiment of the present invention, there are several pieces of connection information in the target connection information set, and it is respectively determined whether the switch corresponding to each piece of connection information is connected to the target switch.
本发明实施例提供的方法,可选的,若任意一个交换机的连接信息中,存在一个端口的AFT含有目标交换机的身份标识并且至少存在一个端口含有的终端设备身份标识分布在其他目标交换机的不同端口上,则该交换机对应的连接信息不符合预设条件。In the method provided by this embodiment of the present invention, optionally, if in the connection information of any switch, the AFT of one port contains the identity of the target switch, and at least one port contains the terminal device identity that is distributed in different locations of other target switches port, the connection information corresponding to the switch does not meet the preset conditions.
本发明实施例提供的方法中,所述将符合预设条件的连接信息转移至预设的目标连接信息集合存储区域,即,将符合预设条件的连接信息存储至预设的目标连接信息集合存储区域中,并在所述目标连接信息集合中删除所述符合预设条件的连接信息。In the method provided by the embodiment of the present invention, the transfer of the connection information that meets the preset conditions to the preset target connection information set storage area, that is, the connection information that meets the preset conditions is stored in the preset target connection information set. in the storage area, and delete the connection information that meets the preset condition in the target connection information set.
本发明实施例提供的网络拓扑发现方法中,所述依据所述第一网络拓扑信息及各个所述第二网络拓扑信息确定目标网络拓扑信息,包括:In the network topology discovery method provided by the embodiment of the present invention, the determining target network topology information according to the first network topology information and each of the second network topology information includes:
将各个所述第二网络拓扑信息与所述第一网络拓扑信息进行对比得到对比结果;Comparing each of the second network topology information with the first network topology information to obtain a comparison result;
依据所述对比结果,将补充节点对应的网络拓扑信息补充至所述第一网络拓扑信息,其中,所述补充节点为所述第二网络拓扑信息中存在的且所述第一网络拓扑信息中未存在的网络节点;According to the comparison result, the network topology information corresponding to the supplementary node is supplemented to the first network topology information, wherein the supplementary node exists in the second network topology information and in the first network topology information. non-existing network nodes;
将补充后的第一网络拓扑信息确定目标网络拓扑信息。Determine the target network topology information from the supplemented first network topology information.
为了便于理解本发明实施例提供的方法,下面进行举例说明,假设第一网络拓扑信息及第二网络拓扑信息分别只有一种,则依据第一网络拓扑信息及第二网络拓扑信息确定目标网络拓扑信息的过程如下:In order to facilitate understanding of the method provided by the embodiment of the present invention, an example is given below. Assuming that there is only one type of first network topology information and second network topology information, the target network topology is determined according to the first network topology information and the second network topology information. The process of information is as follows:
如图3所示,为本发明实施例提供的第一网络拓扑信息的网络拓扑结构示例图,具体包括:交换机1、交换机2、交换机3、交换机4、终端设备1、终端设备2、终端设备3、终端设备4及终端设备5;As shown in FIG. 3, it is an example diagram of a network topology structure of the first network topology information provided by the embodiment of the present invention, which specifically includes: switch 1, switch 2, switch 3, switch 4, terminal device 1, terminal device 2, terminal device 3. Terminal equipment 4 and terminal equipment 5;
其中,交换机1分别与终端设备1、交换机2及交换机3相连接,交换机2分别与交换机1、终端设备2及交换机4相连接,交换机4分别与交换机2及终端设备5相连接,交换机3分别与交换机1、交换机5、终端设备3及终端设备4相连接,交换机5分别与交换机3及终端设备6相连接。Among them, switch 1 is respectively connected with terminal equipment 1, switch 2 and switch 3, switch 2 is respectively connected with switch 1, terminal equipment 2 and switch 4, switch 4 is connected with switch 2 and terminal equipment 5 respectively, switch 3 is respectively connected with switch 1, terminal equipment 2 and switch 4 respectively. It is connected to the switch 1, the switch 5, the terminal device 3 and the terminal device 4, and the switch 5 is connected to the switch 3 and the terminal device 6 respectively.
如图4所示,为本发明实施例提供的第二网络拓扑信息的网络拓扑结构示例图,具体包括:交换机1、交换机2、交换机3、交换机5、终端设备1、终端设备2、终端设备5、终端设备3及终端设备6;As shown in FIG. 4, it is an example diagram of the network topology structure of the second network topology information provided by the embodiment of the present invention, which specifically includes: switch 1, switch 2, switch 3, switch 5, terminal device 1, terminal device 2, terminal device 5. Terminal equipment 3 and terminal equipment 6;
其中,交换机1分别与终端设备1、交换机2及交换机3相连接,交换机2分别与终端设备5、交换机1及终端设备2相连接,交换机3分别与交换机1、交换机5及终端设备3相连接,交换机5分别与交换机3及终端设备6相连接。The switch 1 is connected to the terminal equipment 1, the switch 2 and the switch 3 respectively, the switch 2 is connected to the terminal equipment 5, the switch 1 and the terminal equipment 2 respectively, and the switch 3 is connected to the switch 1, the switch 5 and the terminal equipment 3 respectively. , the switch 5 is connected to the switch 3 and the terminal device 6 respectively.
将所述第一网络拓扑信息及所述第二网络拓扑信息进行对比可得知,交换机5及终端设备6为第二网络拓扑信息中存在且第一网络拓扑信息中未存在的网络节点;则将交换机5对应的连接信息及终端设备6对应的网络拓扑信息补充至第一网络拓扑信息,将经过补充后的第一网络拓扑信息确定为目标网络拓扑信息,如图5所示,为本发明实施例提供的目标网络拓扑信息的网络拓扑结构实例图,具体包括包括:Comparing the first network topology information and the second network topology information, it can be known that the switch 5 and the terminal device 6 are network nodes that exist in the second network topology information and do not exist in the first network topology information; then The connection information corresponding to the switch 5 and the network topology information corresponding to the terminal device 6 are supplemented to the first network topology information, and the supplemented first network topology information is determined as the target network topology information, as shown in FIG. 5 , which is the present invention. The example diagram of the network topology structure of the target network topology information provided by the embodiment specifically includes:
交换机1、交换机2、交换机3、交换机4、交换机5、终端设备1、终端设备2、终端设备3、终端设备4、终端设备5及终端设备6;Switch 1, Switch 2, Switch 3, Switch 4, Switch 5, Terminal Equipment 1, Terminal Equipment 2, Terminal Equipment 3, Terminal Equipment 4, Terminal Equipment 5, and Terminal Equipment 6;
其中,交换机1分别与终端设备1、交换机2、交换机3相连接;交换机2分别与交换机1、终端设备2、交换机4相连接;交换机4分别与交换机2及终端设备5相连接;交换机3分别与交换机1、交换机5、终端设备3及终端设备4相连接;交换机5分别与交换机3及终端设备6连接。Among them, the switch 1 is respectively connected with the terminal equipment 1, the switch 2 and the switch 3; the switch 2 is respectively connected with the switch 1, the terminal equipment 2 and the switch 4; the switch 4 is connected with the switch 2 and the terminal equipment 5 respectively; the switch 3 is respectively It is connected with switch 1, switch 5, terminal equipment 3 and terminal equipment 4; switch 5 is connected with switch 3 and terminal equipment 6 respectively.
本发明实施例提供的方法,通过将所述第二网络拓扑信息中存在的且第一网络拓扑信息中未存在的网络节点对应的网络拓扑信息补充至所述第一网络拓扑信息,将经过补充的第一网络拓扑信息确定为目标网络拓扑信息。In the method provided by the embodiment of the present invention, by supplementing the network topology information corresponding to the network nodes that exist in the second network topology information and do not exist in the first network topology information to the first network topology information, The first network topology information is determined as the target network topology information.
本发明实施例提供的方法中,可选的,若因初始信息集合中的连接信息完整度不高导致所述第一网络拓扑信息可以表现多种,则此处存在多种处理方式:In the method provided by the embodiment of the present invention, optionally, if the first network topology information can be expressed in multiple ways because the integrity of the connection information in the initial information set is not high, there are multiple processing methods here:
第一种方式为,随机确定一种第一网络拓扑信息,并将所述第二网络拓扑信息中存在的且当前选取的第一网络拓扑信息中未存在的网络节点对应的网络拓扑信息补充至当前选取的第一网络拓扑信息。The first method is to randomly determine a type of first network topology information, and supplement the network topology information corresponding to the network nodes that exist in the second network topology information and do not exist in the currently selected first network topology information to The currently selected first network topology information.
第二种方式为,将多种第一网络拓扑信息分别与所述第二网络拓扑信息进行对比,将第二网络拓扑信息中存在且第一网络拓扑信息中未存在的网络节点对应的拓扑信息,补充至第一网络拓扑信息,然后将与第二网络拓扑信息相似度较大的第一网络拓扑信息确定为目标网络拓扑信息,即可以依据相似度大小进行投票,依据投票结果确定目标网络拓扑信息。The second method is to compare a variety of first network topology information with the second network topology information respectively, and compare the topology information corresponding to the network nodes that exist in the second network topology information but do not exist in the first network topology information. , supplemented to the first network topology information, and then the first network topology information with a greater similarity to the second network topology information is determined as the target network topology information, that is, voting can be performed according to the similarity, and the target network topology can be determined according to the voting result. information.
第三种方式为,先将多种第一网络拓扑信息分别与第二网络拓扑信息进行对比,选取与第二网络拓扑信息相似度较大的第一网络拓扑信息确定为主网络拓扑信息,并将第二网络拓扑信息中存在且当前确定的主网络拓扑信息中未存在的网络节点对应的拓扑信息,补充至当前确定的主网络拓扑信息,并将补充后的主网络拓扑信息确定为目标网络拓扑信息。The third method is to first compare a variety of first network topology information with the second network topology information, select the first network topology information with a greater similarity to the second network topology information to determine the main network topology information, and Supplement the topology information corresponding to the network nodes that exist in the second network topology information but do not exist in the currently determined main network topology information to the currently determined main network topology information, and determine the supplemented main network topology information as the target network topology information.
本发明实施例提供的网络拓扑发现方法,若所述补充节点对应的网络拓扑信息为多种,则所述将补充节点对应的网络拓扑信息补充至所述第一网络拓扑信息,包括:In the network topology discovery method provided by the embodiment of the present invention, if the network topology information corresponding to the supplementary node is multiple, the supplementing the network topology information corresponding to the supplementary node to the first network topology information includes:
依据预先设定的主管理器投票权重及每个预先设定的补充管理器投票权重,对所述补充节点对应的多种网络拓扑信息进行投票得到投票结果;According to the preset voting weight of the main manager and the voting weight of each preset supplementary manager, voting on various network topology information corresponding to the supplementary node to obtain a voting result;
确定与所述投票结果对应的网络拓扑信息,并将与所述投票结果对应的网络拓扑信息补充至所述第一网络拓扑信息。Network topology information corresponding to the voting result is determined, and the network topology information corresponding to the voting result is supplemented to the first network topology information.
本发明实施例提供的方法中,当所述补充节点在不同的第二网络拓扑信息中所对应的网络拓扑信息都不一样时,则对该补充节点对应的多种网络拓扑信息进行投票。In the method provided by the embodiment of the present invention, when the network topology information corresponding to different second network topology information of the supplementary node is different, voting is performed on various network topology information corresponding to the supplementary node.
本发明实施例提供的方法,所述依据所述第一网络拓扑信息及各个所述第二网络拓扑信息确定目标网络拓扑信息,包括:In the method provided by the embodiment of the present invention, the determining target network topology information according to the first network topology information and each of the second network topology information includes:
依据预先设定的主管理器投票权重和各个预先设定的补充管理器投票权重,对所述第一网络拓扑信息及各个所述第二网络拓扑信息进行投票得到投票结果;voting on the first network topology information and each of the second network topology information according to the preset main manager voting weight and each preset supplementary manager voting weight to obtain a voting result;
将所述投票结果对应的网络拓扑信息确定为目标网络拓扑信息。The network topology information corresponding to the voting result is determined as the target network topology information.
本发明实施例提供的方法中,可以直接通过投票的方式来确定目标网络拓扑信息。In the method provided by the embodiment of the present invention, the target network topology information can be directly determined by voting.
本发明实施例提供的方法中,可选的,所述主管理器对应的投票权重大于任意一个补充管理器对应的投票权重,且小于任意两个补充管理器的投票权重之和。In the method provided by the embodiment of the present invention, optionally, the voting weight corresponding to the main manager is greater than the voting weight corresponding to any one supplementary manager, and is smaller than the sum of the voting weights of any two supplementary managers.
本发明实施例提供的方法中,还可以依据所述主管理器的投票权重及所述补充管理器的投票权重,对所述第一网络拓扑信息及各个所述第二网络拓扑信息中包含的各个网络节点的拓扑信息进行投票得到投票结果,依据投票结果确定的各个网络节点的拓扑信息确定为目标网络拓扑信息。In the method provided by the embodiment of the present invention, the first network topology information and each of the second network topology information may be further classified according to the voting weight of the main manager and the voting weight of the supplementary manager. The topology information of each network node is voted to obtain a voting result, and the topology information of each network node determined according to the voting result is determined as the target network topology information.
本发明实施例提供的方法,所述目标网络拓扑信息,可以是网络拓扑图,也可以是网络拓扑表或网络拓扑文本等。In the method provided by the embodiment of the present invention, the target network topology information may be a network topology map, a network topology table or a network topology text, or the like.
本发明实施例在具体应用中,若存在一个交换机数量及终端设备数量较多的大型网络,则可以将该大型网络划分为多个子网络,并设置一个管理主机,每一个子网络中设置有一个主管理器、若干个补充管理器、若干个交换机及若干个终端设备,每个主管理器分别确定与其对应的子网的目标网络拓扑信息,并发送至管理主机,以触发管理主机依据各个子网络中的目标网络拓扑信息确定该大型网络的网络拓扑信息。In a specific application of the embodiment of the present invention, if there is a large network with a large number of switches and a large number of terminal devices, the large network can be divided into multiple sub-networks, and a management host is set, and each sub-network is set with a The main manager, several supplementary managers, several switches and several terminal devices, each main manager determines the target network topology information of its corresponding subnet and sends it to the management host to trigger the The target network topology information in the network determines the network topology information of the large network.
上述各个具体的实现方式,及各个实现方式的衍生过程,均在本发明保护范围内。The above-mentioned specific implementation manners and the derivative processes of each implementation manner are all within the protection scope of the present invention.
与图1所述的方法相对应,本发明实施例还提供了一种网络拓扑发现装置,用于对图1中方法的具体实现,本发明实施例提供的网络拓扑发现装置可以应用于交换域网络中的各个子网络,所述子网络中包括主管理器、至少一个补充管理器和至少一个交换机,其结构示意图如图6所示,具体包括:Corresponding to the method described in FIG. 1 , an embodiment of the present invention further provides a network topology discovery apparatus, which is used to specifically implement the method in FIG. 1 . The network topology discovery apparatus provided by the embodiment of the present invention can be applied to a switching domain. Each sub-network in the network, the sub-network includes a main manager, at least one supplementary manager and at least one switch, and its schematic structural diagram is shown in Figure 6, and specifically includes:
第一确定单元301,用于当接收到网络拓扑发现请求时,确定初始连接信息集合;所述初始连接信息集合包括该子网络中每个所述交换机的连接信息,所述连接信息包括交换机的身份标识、交换机的端口标识及与交换机的端口相连接的各个网络节点的身份标识,所述网络节点为交换机或终端设备;The first determining
更新单元302,用于将所述初始连接信息集合确定为目标连接信息集合,对所述目标连接信息集合执行更新操作,所述更新操作包括:遍历所述目标连接信息集合中的各个连接信息,将满足预设条件的各个连接信息,确定为目标连接信息,并将各个所述目标连接信息转移至预先建立的目标连接信息存储区域中;将各个所述目标连接信息对应的交换机分别确定为子交换机,并将所述目标连接信息集合中剩余的各个连接信息中包含的所述子交换机下行端口连接的网络节点的身份标识,替换为所述子交换机的身份标识;并将所述目标连接信息集合中剩余的各个连接信息组成新的目标连接信息集合;An
判断单元303,用于判断所述新的目标连接信息集合中连接信息的数目是否满足预设的连接信息数目阈值,若不满足时,对所述新的目标连接信息集合重新执行所述更新操作,直至当前所组成的新的目标连接信息集合中连接信息的数目满足所述预设的连接信息数目阈值;Judging
第二确定单元304,用于依据当前所述目标连接信息存储区域中的各个目标连接信息,确定第一网络拓扑信息;The second determining
发送单元305,用于向该子网络中的每个所述补充管理器发送网络拓扑发现指令,以触发每个所述补充管理器确定与其对应的第二网络拓扑信息,并将各个所述第二网络拓扑信息发送至主管理器;The sending
第三确定单元306,用于依据所述第一网络拓扑信息及各个所述第二网络拓扑信息确定目标网络拓扑信息。The third determining
本发明实施例提供的网络拓扑发现装置,包括:当接收到网络拓扑发现请求时,确定初始连接信息集合;对初始信息集合进行更新操作,将符合预设条件的连接信息转移到预设的目标连接信息存储区域中,并依据预设的目标连接信息中的各个目标连接信息,确定第一网络拓扑信息;向每个补充管理器发送网络拓扑发现指令,以触发每个补充管理器确定与其对应的第二网络拓扑信息,并将各个第二网络拓扑信息发送至主管理器;依据第一网络拓扑信息及各个第二网络拓扑信息确定目标网络拓扑信息。通过获取第一网络拓信息和接收第二网络拓扑信息,能全面的获取当前网络中的各个网络节点的拓扑信息,进而能够精准的进行网络拓扑发现。The network topology discovery device provided by the embodiment of the present invention includes: when a network topology discovery request is received, determining an initial connection information set; performing an update operation on the initial information set, and transferring connection information that meets preset conditions to a preset target In the connection information storage area, and according to each target connection information in the preset target connection information, determine the first network topology information; send a network topology discovery instruction to each supplementary manager to trigger each supplementary manager to determine its corresponding and send each second network topology information to the main manager; determine the target network topology information according to the first network topology information and each second network topology information. By acquiring the first network topology information and receiving the second network topology information, the topology information of each network node in the current network can be comprehensively acquired, thereby enabling accurate network topology discovery.
本发明实施例还提供了一种存储介质,所述存储介质包括存储的指令,其中,在所述指令运行时控制所述存储介质所在的设备执行上述网络拓扑发现方法。An embodiment of the present invention further provides a storage medium, where the storage medium includes stored instructions, wherein when the instructions are executed, a device where the storage medium is located is controlled to execute the above network topology discovery method.
本发明实施例还提供了一种电子设备,其结构示意图如图7所示,具体包括存储器401,以及一个或者一个以上的指令402,其中一个或者一个以上指令402存储于存储器401中,且经配置以由一个或者一个以上处理器403执行所述一个或者一个以上指令402进行以下操作:An embodiment of the present invention also provides an electronic device, the schematic structural diagram of which is shown in FIG. 7 , and specifically includes a
当接收到网络拓扑发现请求时,确定初始连接信息集合;所述初始连接信息集合包括该子网络中每个所述交换机的连接信息,所述连接信息包括交换机的身份标识、交换机的端口标识及与交换机的端口相连接的各个网络节点的身份标识,所述网络节点为交换机或终端设备;When a network topology discovery request is received, an initial connection information set is determined; the initial connection information set includes connection information of each switch in the sub-network, and the connection information includes the identity identifier of the switch, the port identifier of the switch, and the The identity of each network node connected to the port of the switch, the network node being a switch or a terminal device;
将所述初始连接信息集合确定为目标连接信息集合,对所述目标连接信息集合执行更新操作,所述更新操作包括:遍历所述目标连接信息集合中的各个连接信息,将满足预设条件的各个连接信息,确定为目标连接信息,并将各个所述目标连接信息转移至预先建立的目标连接信息存储区域中;将各个所述目标连接信息对应的交换机分别确定为子交换机,并将所述目标连接信息集合中剩余的各个连接信息中包含的所述子交换机下行端口连接的网络节点的身份标识,替换为所述子交换机的身份标识;并将所述目标连接信息集合中剩余的各个连接信息组成新的目标连接信息集合;The initial connection information set is determined as a target connection information set, and an update operation is performed on the target connection information set, and the update operation includes: traversing each connection information in the target connection information set, Each connection information is determined as target connection information, and each said target connection information is transferred to a pre-established target connection information storage area; the switches corresponding to each said target connection information are respectively determined as sub-switches, and said The identity of the network node connected to the downlink port of the sub-switch included in the remaining connection information in the target connection information set is replaced with the identity of the sub-switch; and the remaining connections in the target connection information set The information forms a new set of target connection information;
判断所述新的目标连接信息集合中连接信息的数目是否满足预设的连接信息数目阈值,若不满足时,对所述新的目标连接信息集合重新执行所述更新操作,直至当前所组成的新的目标连接信息集合中连接信息的数目满足所述预设的连接信息数目阈值;Judging whether the number of connection information in the new target connection information set satisfies the preset connection information number threshold, if not, re-execute the update operation on the new target connection information set until the current composition The number of connection information in the new target connection information set satisfies the preset connection information number threshold;
依据当前所述目标连接信息存储区域中的各个目标连接信息,确定第一网络拓扑信息;Determine the first network topology information according to each target connection information in the current target connection information storage area;
向该子网络中的每个所述补充管理器发送网络拓扑发现指令,以触发每个所述补充管理器确定与其对应的第二网络拓扑信息,并将各个所述第二网络拓扑信息发送至主管理器;Send a network topology discovery instruction to each of the supplementary managers in the sub-network to trigger each of the supplementary managers to determine the second network topology information corresponding to it, and send each of the second network topology information to main manager;
依据所述第一网络拓扑信息及各个所述第二网络拓扑信息确定目标网络拓扑信息。Target network topology information is determined according to the first network topology information and each of the second network topology information.
需要说明的是,本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。对于装置类实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. For the same and similar parts among the various embodiments, refer to each other Can. As for the apparatus type embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for the relevant part, please refer to the partial description of the method embodiment.
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。Finally, it should also be noted that in this document, relational terms such as first and second are used only to distinguish one entity or operation from another, and do not necessarily require or imply these entities or that there is any such actual relationship or sequence between operations. Moreover, the terms "comprising", "comprising" or any other variation thereof are intended to encompass a non-exclusive inclusion such that a process, method, article or device that includes a list of elements includes not only those elements, but also includes not explicitly listed or other elements inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.
为了描述的方便,描述以上装置时以功能分为各种单元分别描述。当然,在实施本发明时可以把各单元的功能在同一个或多个软件和/或硬件中实现。For the convenience of description, when describing the above device, the functions are divided into various units and described respectively. Of course, when implementing the present invention, the functions of each unit may be implemented in one or more software and/or hardware.
通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到本发明可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例或者实施例的某些部分所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that the present invention can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solutions of the present invention can be embodied in the form of software products in essence or the parts that make contributions to the prior art. The computer software products can be stored in storage media, such as ROM/RAM, magnetic disks, etc. , CD, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of the present invention.
以上对本发明所提供的一种网络拓扑发现方法及装置进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。The method and device for discovering network topology provided by the present invention have been described in detail above. The principles and implementations of the present invention are described with specific examples in this paper. The descriptions of the above embodiments are only used to help understand the present invention. method and its core idea; at the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation and application scope. Invention limitations.
Claims (9)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910209190.0A CN109936480B (en) | 2019-03-19 | 2019-03-19 | Network topology discovery method and device, storage medium and electronic device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910209190.0A CN109936480B (en) | 2019-03-19 | 2019-03-19 | Network topology discovery method and device, storage medium and electronic device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109936480A CN109936480A (en) | 2019-06-25 |
CN109936480B true CN109936480B (en) | 2020-09-15 |
Family
ID=66987673
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910209190.0A Active CN109936480B (en) | 2019-03-19 | 2019-03-19 | Network topology discovery method and device, storage medium and electronic device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109936480B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111030863B (en) * | 2019-12-13 | 2022-06-07 | 苏州浪潮智能科技有限公司 | Node topology information determination method, device, equipment and storage medium |
CN111651644A (en) * | 2020-05-29 | 2020-09-11 | 山东中创软件商用中间件股份有限公司 | Method, system and device for identifying equipment type |
EP4145771A4 (en) * | 2020-06-01 | 2024-01-10 | Siemens Aktiengesellschaft | Network topology construction method and apparatus, and computer readable medium |
CN111970202B (en) * | 2020-08-28 | 2021-09-10 | 电子科技大学 | Network topology discovery method based on three-way sub-topology measurement |
CN114040262B (en) * | 2021-11-04 | 2022-08-05 | 西安数道航空技术有限公司 | Network switch |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101330405A (en) * | 2008-07-02 | 2008-12-24 | 北京亿阳信通软件研究院有限公司 | Method for discovering network topology and related equipment |
CN103475589A (en) * | 2013-09-02 | 2013-12-25 | 福建星网锐捷网络有限公司 | Network topology discovery method and equipment |
CN107040423A (en) * | 2017-05-16 | 2017-08-11 | 上海上讯信息技术股份有限公司 | A kind of method and system of discovering network topology |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6965559B2 (en) * | 2001-10-19 | 2005-11-15 | Sun Microsystems, Inc. | Method, system, and program for discovering devices communicating through a switch |
CN102143007A (en) * | 2011-05-03 | 2011-08-03 | 中国南方电网有限责任公司 | Distribution-based hierarchical network topology discovery method |
CN103117880A (en) * | 2013-02-22 | 2013-05-22 | 浪潮电子信息产业股份有限公司 | Web technology based network topological generation method |
JPWO2014136850A1 (en) * | 2013-03-06 | 2017-02-16 | 日本電気株式会社 | COMMUNICATION SYSTEM, CONTROL DEVICE, TRANSFER NODE, CONTROL METHOD AND PROGRAM |
US10437510B2 (en) * | 2015-02-03 | 2019-10-08 | Netapp Inc. | Monitoring storage cluster elements |
CN105072039A (en) * | 2015-07-31 | 2015-11-18 | 山东蚁巡网络科技有限公司 | Link layer network topology discovery method |
CN109412828B (en) * | 2017-08-18 | 2022-06-14 | 上海诺基亚贝尔软件有限公司 | Method, apparatus and system for network topology discovery in software defined networks |
-
2019
- 2019-03-19 CN CN201910209190.0A patent/CN109936480B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101330405A (en) * | 2008-07-02 | 2008-12-24 | 北京亿阳信通软件研究院有限公司 | Method for discovering network topology and related equipment |
CN103475589A (en) * | 2013-09-02 | 2013-12-25 | 福建星网锐捷网络有限公司 | Network topology discovery method and equipment |
CN107040423A (en) * | 2017-05-16 | 2017-08-11 | 上海上讯信息技术股份有限公司 | A kind of method and system of discovering network topology |
Also Published As
Publication number | Publication date |
---|---|
CN109936480A (en) | 2019-06-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109936480B (en) | Network topology discovery method and device, storage medium and electronic device | |
US9007945B2 (en) | Automated network service discovery and communication | |
CN105024855B (en) | Distributed type assemblies manage system and method | |
CN104753697B (en) | A kind of method, equipment and system controlling the automatic beginning of the network equipment | |
US8838759B1 (en) | Systems and methods for detecting unmanaged nodes within a system | |
CN102917084B (en) | Automatic allocation method of IP address of node inside fat tree structure networking data center | |
US10411742B2 (en) | Link aggregation configuration for a node in a software-defined network | |
WO2017131783A1 (en) | Managing groups of servers | |
US11075814B2 (en) | Sub-topology discovery for operating hybrid solutions | |
EP2869495A1 (en) | Node de-duplication in a network monitoring system | |
JP5826320B2 (en) | Network location service | |
CN101616029A (en) | A kind of method and system that realize discovering network topology | |
CN105119993A (en) | Virtual machine deployment method and apparatus | |
CN110944068A (en) | Automatic recovery from duplicate network addresses | |
CN105580316A (en) | Apparatus and method for monitoring network performance | |
CN110290234A (en) | Method, apparatus, system, equipment and the storage medium that node address is traced to the source | |
US11012304B1 (en) | Networking device replacement system | |
CN108833129B (en) | A network topology discovery method and device | |
CN108768849A (en) | Message processing method and device | |
CN113098776B (en) | A method, device, device and storage medium for determining network topology | |
US20240235991A9 (en) | Adaptive mechanism for network communication | |
CN103178985B (en) | Network equipment polling method, network equipment polling system and network equipment polling device | |
CN106559439B (en) | A kind of method for processing business and equipment | |
CN116319684A (en) | LLMNR query-based dual-stack Windows node IPv6 address rapid detection method and system | |
CN106533818B (en) | Monitoring method and communication method, system and equipment based on NFV resource pool |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |