CN105450453B - A kind of constructing network topology method based on snmp protocol - Google Patents

A kind of constructing network topology method based on snmp protocol Download PDF

Info

Publication number
CN105450453B
CN105450453B CN201510880806.9A CN201510880806A CN105450453B CN 105450453 B CN105450453 B CN 105450453B CN 201510880806 A CN201510880806 A CN 201510880806A CN 105450453 B CN105450453 B CN 105450453B
Authority
CN
China
Prior art keywords
information
port
address
topology
network
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510880806.9A
Other languages
Chinese (zh)
Other versions
CN105450453A (en
Inventor
王玮
刘旭航
申州
李由
熊铖
陈利民
陆飙
任阳阳
夏萌
张菡
刘毅
张猛
撒兴杰
郑元伟
李伯森
黎皓
张祥忠
刘晓波
于富财
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Information & Communication Branch Of Guizhou Grid Co
University of Electronic Science and Technology of China
Original Assignee
Information & Communication Branch Of Guizhou Grid Co
University of Electronic Science and Technology of China
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 Information & Communication Branch Of Guizhou Grid Co, University of Electronic Science and Technology of China filed Critical Information & Communication Branch Of Guizhou Grid Co
Priority to CN201510880806.9A priority Critical patent/CN105450453B/en
Publication of CN105450453A publication Critical patent/CN105450453A/en
Application granted granted Critical
Publication of CN105450453B publication Critical patent/CN105450453B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/02Standardisation; Integration
    • H04L41/0213Standardised network management protocols, e.g. simple network management protocol [SNMP]
    • 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

Abstract

The constructing network topology method based on snmp protocol that the invention discloses a kind of.The construction method includes topology information acquisition, information extraction, information filtering and topology constructing.The present invention has, and constructs the feature high-efficient, network load is low and topological layout is reasonable.

Description

A kind of constructing network topology method based on snmp protocol
Technical field
The present invention relates to a kind of construction method of computer network topologies, especially a kind of network based on snmp protocol is opened up Flutter construction method.
Background technique
In recent years, with the expansion of network size, hand drawn topology seems very cumbersome and is difficult to update, and network is opened up The method for auto constructing flutterred is developed rapidly, and is had much to the research of topological construction method both at home and abroad, but many researchs It is all based on subrange.Current constructing network topology method can be divided into menu manager domain by building range and multitube is managed Domain, by building protocol hierarchy can be divided into network layer topology building and link layer topology construct, by construction method can be divided by Dynamic detection and active probe.Currently, the automatic building of network topology is still the research topic rich in challenge, research is provided There is efficient, quick, complete and accuracy topological construction method by no means easy.It is different especially when being directed to specific network Topological construction method has different performance and efficiency.Traditional manual construction network topological method is primarily present following lack Point: topology constructing low efficiency, topology update not in time, and building topology easily manual errors occurs, for complex topology planning and constructing Difficulty is big;Make network negative based on ICMP agreement, based on RIP agreement, the topological construction method based on DNS and based on ospf protocol Load is higher, may cause localized network congestion, is not suitable for the huge network of network traffic data.
Summary of the invention
The constructing network topology method based on snmp protocol that the object of the present invention is to provide a kind of.The present invention has, structure Build the feature that high-efficient, network load is low and topological layout is reasonable.
Technical solution of the present invention: a kind of constructing network topology method based on snmp protocol, the construction method include opening up Flutter information collection, information extraction, information filtering and topology constructing.
In constructing network topology method above-mentioned based on snmp protocol, the topology information acquisition is that use is multi-thread Journey mode acquires the SNMP information of real-time storage in the library MIB of router snmp protocol in topological network to be built, SNMP simultaneously Information includes device port IP address information, port information and system information, and collected SNMP information is stored in MySQL data In library.
In constructing network topology method above-mentioned based on snmp protocol, the multithread mode is acquisition SNMP letter Topology information collection process when breath for each router individually creates a thread, and each thread independently uses net-snmp soft The SNMP data request command that part provides.
In constructing network topology method above-mentioned based on snmp protocol, in the library MIB of the snmp protocol by pipe Managing object grouping includes system group, interfaces group and ip group;The system group includes sysName field;It is described Interfaces group include ifDescr field;The ip group includes ipAdEntAddr and ipAdEntNetMask field.
In constructing network topology method above-mentioned based on snmp protocol, the information extraction is, from MySQL database Then middle sysName, ifDescr, ipAdEntAddr and ipAdEntNetMask information for extracting the same period recently will Information is by the sequential storage of nodename, serial number, port type, device port IP address and subnet mask into memory;It is described The same node of serial number all devices port IP address serial number.
In constructing network topology method above-mentioned based on snmp protocol, the information filtering is, first by port class Type is that the information filtering of Vlan, Loopback and Multilink are fallen, secondly according to device port IP address and subnet mask into Row " logical AND " operation obtains the network number where each device port IP address, according to network number, in all devices Port IP The device port IP address belonged in consolidated network number is found in address, will repeat the identical device port being arranged for different port The device port IP address not being attached after IP address, setting but is filtered, and setting for consolidated network number will be belonged to after filtering Standby port IP address retains, and the device port IP address of reservation is generated topology constructing document later.
In constructing network topology method above-mentioned based on snmp protocol, the topology constructing is, according to topology constructing Document obtains the Port IP pair of network node, confirms the Port IP pair between each network node further according to router belonging to port Quantity constructs the adjacency matrix of a n × n by the quantity of network node and Port IP pair, and n is network node quantity, adjacent The element of matrix is the quantity of Port IP pair, carries out topological layout using power guiding placement algorithm according to adjacency matrix later.
Compared with prior art, the SNMP information acquired via topology information is stored in MySQL database by the present invention, it Information extraction and information filtering are carried out from MySQL database afterwards, in this way, realizing topology information collection process with after Continuous information extraction, information filtering and the separation of topology constructing process, effectively having evaded topology information acquisition overall time may be compared with Long problem need not start again to carry out information extraction, information filtering and topology constructing after the completion of topology information acquisition, together When metastable for topological structure network, information filtering can be extracted directly from MySQL database and restores topology, pole It improves efficiency greatly.Compared to manual construction topology, the present invention can more efficiently, quickly and correctly construct network topology.
The present invention carries out network topological information acquisition to the network topology based on snmp protocol, can real-time and accurately obtain Network node information, that is, SNMP information, and constructed network can be updated in real time according to the SNMP information acquired in real time and opened up Flutter, moreover, in collection process caused by network load it is low, will not be to the normal of the biggish network of network especially flow Work impacts.
The present invention carries out topology information acquisition using multithread mode, is each router, that is, network node when acquisition The collection process of SNMP information individually creates a thread, the SNMP data that each thread independently uses net-snmp software to provide Request command (snmpwalk) obtains aforementioned specified SNMP information from router, in this way, can be with high efficiency, mutually do not do It acquires network node SNMP information with disturbing, avoids because network network node that may be present is more, Node distribution is wide, transmission delay High feature causes the case where high acquisition time delay, low efficiency.
The present invention carries out topological layout when carrying out topology constructing, using power guiding algorithm, so that point of layout interior joint Dissipate relatively uniform, the line intersected between node is less, and obtained topological layout is more reasonable.
Detailed description of the invention
Fig. 1 is the smmpwalk data request command that net-snmp software provides;
Fig. 2 is sysName field information example in collected snmp protocol;
Fig. 3 is ifDescr field information example in collected snmp protocol;
Fig. 4 is ipAdEntAddr and ipAdEntNetMask field information example in collected snmp protocol;
Fig. 5 is topology constructing document example;
Fig. 6 is building local topology example.
Specific embodiment
The present invention is further illustrated with reference to the accompanying drawings and examples, but be not intended as to the present invention limit according to According to.
Embodiment 1.A kind of constructing network topology method based on snmp protocol, the construction method include that topology information is adopted Collection, information extraction, information filtering and topology constructing.
Topology information acquisition above-mentioned is to acquire router SNMP in topological network to be built simultaneously using multithread mode The SNMP information of real-time storage in the library MIB of agreement, SNMP information include device port IP address information, port information and system Collected SNMP information is stored in MySQL database by information.
Topology information acquisition above-mentioned is using passive acquisition SNMP information mode, by this way, can exist for network The feature that node is more, Node distribution is remote and information propagation delay time is high, acquired on each router simultaneously using multithread mode SNMP information, to improve collecting efficiency, multithread mode is specifically, be the topology information of each router when acquiring SNMP information Collection process individually creates a thread, the SNMP data request command that each thread independently uses net-snmp software to provide (snmpwalk), request command is as shown in Figure 1, obtain specified SNMP information from router, and when acquisition first confirms that be collected Node (router) opens snmp protocol, inputs a certain device port IP address of all nodes to be collected in network (generally Loopback address), capture program is executed, what capture program can match the library snmp protocol MIB in node to be collected updates for five minutes Rate, every five minutes automatic collections are primary.
Managed object grouping in the library MIB of snmp protocol above-mentioned includes system group, interfaces group and ip Group.Specifically, the object that each group is used is as follows:
System group (node OID is 1.3.6.1.2.1.1)
The main object used in system group objects is sysName.
Object oriented Type Description information
sysName DisplayString The Fully-Qualified Domain Name of managed devices
Interfaces group (node OID is 1.3.6.1.2.1.2)
Main object in Interfaces group is ifDescr.
Ip group (node OID is 1.3.6.1.2.1.4)
The main object used in ip group is ipAdEntAddr and ipAdEntNetMask.
Object oriented Type Description information
ipAdEntAddr IpAddress The a certain particular ip address of the system
ipAdEntNetMask IpAddress The subnet mask of the IP address
It can be used for identifying node router title using sysName object, ifDescr object is for identifying node-routing The a certain particular port type of device, the i.e. Linktype of interface respective links, ipAdEntAddr object can identify node router The IP address of a certain particular port binding, ipAdEntNetMask object is then the corresponding subnet mask of the IP address.Fig. 2, Fig. 3 It is the collected SNMP Examples of information from the library MIB respectively with Fig. 4;Wherein Fig. 2 is sysName word in collected snmp protocol Segment information;Fig. 3 is ifDescr field information in collected snmp protocol;Fig. 4 is in collected snmp protocol IpAdEntAddr and ipAdEntNetMask field information.
Information extraction above-mentioned be sysName, ifDescr that the same period is extracted from MySQL database, Then information is pressed nodename, serial number, port type, device port IP by ipAdEntAddr and ipAdEntNetMask information The sequential storage of address and subnet mask is into memory;The sequence of all devices port IP address of the same node of the serial number Number.
Information filtering above-mentioned is, is first the information filtering of Vlan, Loopback and Multilink by port type Fall, is interfered to avoid because virtual subnet, loopback address and multiplexed port present in network generate building topology, secondly root The network where " logical AND " operation obtains each device port IP address is carried out according to device port IP address and subnet mask Number, according to network number, position is found in all devices port IP address and belongs to the device port IP address in consolidated network number, it will Repeat be the identical device port IP address of different port setting, after setting but the device port IP address that is not attached (i.e. Only have the IP address in the device port IP address belonging network number) it is filtered, setting for consolidated network number will be belonged to after filtering Standby port IP address retains, and the device port IP address of reservation is generated topology constructing document later;Fig. 5 topology constructing document shows Example.
Topology constructing above-mentioned is the Port IP pair of network node to be obtained according to topology constructing document, further according to port institute The router of category confirms the quantity (each Port IP to represent a link) of the Port IP pair between each network node, passes through network The quantity (chain travel permit number) of node and Port IP pair constructs the adjacency matrix of a n × n, and n is network node quantity, adjacency matrix Element be Port IP pair quantity.With three network nodes, that is, Router18, Routetr19 and Router43 building part For topology (as shown in Figure 6), the wherein device port IP address of Router18 are as follows:
The device port IP address of Router43 are as follows:
ipAdEntAddr ipAdEntNetMask
10.41.100.46 255.255.255.252
10.41.100.50 255.255.255.252
10.41.100.54 255.255.255.252
10.41.100.58 255.255.255.252
The device port IP address of Router19:
ipAdEntAddr ipAdEntNetMask
10.31.16.09 255.255.255.252
10.31.16.50 255.255.255.252
10.41.100.2 255.255.255.252
10.41.100.6 255.255.255.252
10.41.100.10 255.255.255.252
10.41.100.14 255.255.255.252
10.41.100.45 255.255.255.252
10.41.100.49 255.255.255.252
10.41.100.53 255.255.255.252
10.41.100.57 255.255.255.252
" logical AND " operation can be carried out by device port IP address and subnet mask, obtain network number where interface, Compare each interface network number, it can be found that Router18 and Router19 there are 4 pairs of Port IP to (i.e. 4 links), be respectively: (10.41.100.1,10.41.100.2), (10.41.100.5,10.41.100.6), (10.41.100.9, 10.41.100.10), (10.41.100.13,10.41.100.14).Also there are 4 pairs of Port IP between Router43 and Router19 It is right, be respectively (10.41.100.45,10.41.100.46), (10.41.100.49,10.41.100.50), (10.41.100.53,10.41.100.54), (10.41.100.57,10.41.100.58).
By above-mentioned Port IP pair, available following adjacency matrix:
After establishing adjacency matrix, topological layout is carried out.When building, topological layout is carried out using power guiding algorithm.Described Power guiding algorithm is by calculating its gravitation and repulsion to the network node of initial random distribution, and all there is reprimands for all nodes Power, but there are gravitation for connected node, move node gradually by the driving of power, finally to reach the flat of power between node Weighing apparatus.Pseudo-code of the algorithm is as follows:
Wherein V indicates that the number of network node of figure, E indicate the number of edges of figure.The space complexity of the algorithm is O (V), is calculated every The time complexity that the repulsive force of a node needs is O (V2), calculate the time complexity that the attraction between each pair of node needs For O (E), the time complexity that mobile node needs is O (V).In conclusion the space complexity of the algorithm is O (V), time Complexity is O (V2)+O(E).Placement algorithm is guided by power, so that the dispersion of layout interior joint is relatively uniform, is intersected between node Line it is less, obtain preferable topological layout, be presented to user one intuitive reasonable topology distribution.

Claims (2)

1. a kind of constructing network topology method based on snmp protocol, which is characterized in that the construction method includes that topology information is adopted Collection, information extraction, information filtering and topology constructing;The described topology information acquisition be acquired simultaneously using multithread mode to The SNMP information of real-time storage in the library MIB of router snmp protocol in topological network is constructed, SNMP information includes device port Collected SNMP information is stored in MySQL database by IP address information, port information and system information;Described is multi-thread Journey mode is individually to create a thread, each line when acquiring SNMP information for the topology information collection process of each router The SNMP data request command that Cheng Duli is provided using net-snmp software;Being managed in the library MIB of the snmp protocol Object grouping includes system group, interfaces group and ip group;The system group includes sysName field;Described Interfaces group includes ifDescr field;The ip group includes ipAdEntAddr and ipAdEntNetMask field;Institute The information extraction stated is that sysName, ifDescr, ipAdEntAddr of same period recently are extracted from MySQL database With ipAdEntNetMask information, information is then pressed into nodename, serial number, port type, device port IP address and subnet The sequential storage of mask is into memory;The serial number of all devices port IP address of the same node of the serial number;Described Information filtering is first to fall the information filtering that port type is Vlan, Loopback and Multilink, secondly according to equipment Port IP address and subnet mask carry out " logical AND " operation and obtain the network number where each device port IP address, according to Network number finds the device port IP address belonged in consolidated network number in all devices port IP address, will repeat as not With the identical device port IP address of port setting, after setting but the device port IP address that is not attached is filtered, mistake The device port IP address for belonging to consolidated network number is retained after filter, the device port IP address of reservation is generated into topological structure later Build document.
2. the constructing network topology method according to claim 1 based on snmp protocol, it is characterised in that: the topology It is configured to, the Port IP pair of network node is obtained according to topology constructing document, confirm each net further according to router belonging to port The quantity of Port IP pair between network node constructs the adjacency matrix of a n × n, n by the quantity of network node and Port IP pair For network node quantity, the element of adjacency matrix is the quantity of Port IP pair, later according to adjacency matrix using power guiding layout Algorithm carries out topological layout.
CN201510880806.9A 2015-12-03 2015-12-03 A kind of constructing network topology method based on snmp protocol Active CN105450453B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510880806.9A CN105450453B (en) 2015-12-03 2015-12-03 A kind of constructing network topology method based on snmp protocol

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510880806.9A CN105450453B (en) 2015-12-03 2015-12-03 A kind of constructing network topology method based on snmp protocol

Publications (2)

Publication Number Publication Date
CN105450453A CN105450453A (en) 2016-03-30
CN105450453B true CN105450453B (en) 2019-04-19

Family

ID=55560259

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510880806.9A Active CN105450453B (en) 2015-12-03 2015-12-03 A kind of constructing network topology method based on snmp protocol

Country Status (1)

Country Link
CN (1) CN105450453B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106331214A (en) * 2016-08-30 2017-01-11 成都科来软件有限公司 Method and system for grouping IP addresses through combination of subnet masks
CN106330564B (en) * 2016-08-31 2019-03-29 电子科技大学 A kind of network topology analytical method based on header-compressed
CN108924013B (en) * 2018-09-06 2020-07-07 北京天元创新科技有限公司 Network flow accurate acquisition method and device
CN111917578A (en) * 2020-07-29 2020-11-10 山东英信计算机技术有限公司 Multi-node network topology management method and device, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101610178A (en) * 2009-07-20 2009-12-23 南京联创科技股份有限公司 Method for obtaining physical layer link network topology based on address forwarding mechanism
CN102546251A (en) * 2011-12-31 2012-07-04 清华大学 Hybrid-detection-technology-based network topology discovery and automatic topology method and system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7200122B2 (en) * 2001-09-06 2007-04-03 Avaya Technology Corp. Using link state information to discover IP network topology
CN102271350A (en) * 2011-03-30 2011-12-07 东方通信股份有限公司 Automatic discovery method of network topology in wireless cluster network management

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101610178A (en) * 2009-07-20 2009-12-23 南京联创科技股份有限公司 Method for obtaining physical layer link network topology based on address forwarding mechanism
CN102546251A (en) * 2011-12-31 2012-07-04 清华大学 Hybrid-detection-technology-based network topology discovery and automatic topology method and system

Also Published As

Publication number Publication date
CN105450453A (en) 2016-03-30

Similar Documents

Publication Publication Date Title
CN105450453B (en) A kind of constructing network topology method based on snmp protocol
CN103825954B (en) A kind of OpenFlow control methods and corresponding plug-in unit, platform and network
CN106487558B (en) A kind of method and apparatus for realizing the scalable appearance of access device
CN103595626B (en) Method for achieving dynamic path planning in ring network
CN107294745B (en) Network topology automatic discovery method and device
CN101702656B (en) Discovery method of network topology based on MPLS-VPN
US20150074260A1 (en) Auto discovery and topology rendering in substation networks
CN107317707B (en) SDN network topology management method based on point coverage set
CN104601482A (en) Traffic cleaning method and device
CN103618677A (en) Network flow regulation method and system
CN102447579B (en) Volume-expansion simulation rehearsal method for electric power dispatching data network based on SP (Service Provider) Guru
CN108880899A (en) A kind of Generating Network Topology Map and server
CN104156534B (en) The objectification power network topology analysis method generated for black-start scheme
CN104125087A (en) Alarm information processing method and device
CN102546243A (en) Fault simulation analysis method for SP Guru-based electric power dispatching data network
CN104219153B (en) Network topology self-discovery method and apparatus based on MAC addresses beam search
CN105790990A (en) Method and system for monitoring and managing power distribution and utilization communication business
CN108243123A (en) Processing method, device, controller and the interchanger of broadcasting packet
CN106357302A (en) Wideband carrier networking method and multifunctional communication module
CN105763457B (en) Multicast message processing method and the network equipment
CN104219100A (en) Information acquiring method and device
CN102420797A (en) Topology mapping method and system
CN102638363A (en) Power dispatching data network equipment upgrading improvement simulation previewing method based on SP Guru
CN110855464A (en) Network topology structure adjusting method and device
CN102571422A (en) SP Gura-based new business roll-out simulation previewing method for power scheduling data network

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB03 Change of inventor or designer information

Inventor after: Wang Wei

Inventor after: Zhang Han

Inventor after: Liu Yi

Inventor after: Zhang Meng

Inventor after: Sa Xingjie

Inventor after: Zheng Yuanwei

Inventor after: Li Bosen

Inventor after: Li Hao

Inventor after: Zhang Xiangzhong

Inventor after: Liu Xiaobo

Inventor after: Yu Fucai

Inventor after: Liu Xuhang

Inventor after: Shen Zhou

Inventor after: Li You

Inventor after: Xiong Cheng

Inventor after: Chen Limin

Inventor after: Lu Biao

Inventor after: Ren Yangyang

Inventor after: Xia Meng

Inventor before: Yang Yao

Inventor before: Liu Yi

Inventor before: Wang Wei

Inventor before: Sa Xingjie

Inventor before: Zheng Yuanwei

Inventor before: Li Bosen

Inventor before: Li Hao

Inventor before: Zhang Xiangzhong

Inventor before: Liu Xiaobo

Inventor before: Yu Fucai

Inventor before: Liu Xuhang

Inventor before: Shen Zhou

Inventor before: Li You

Inventor before: Xiong Cheng

Inventor before: Chen Limin

Inventor before: Lu Biao

Inventor before: Ren Yangyang

Inventor before: Zhang Han

COR Change of bibliographic data
GR01 Patent grant
GR01 Patent grant