A kind of method for discovering network topology and system based on double layer network agreement
Technical field
The present invention relates to data center network topologys, send out more particularly to a kind of network topology based on double layer network agreement
Existing method and system.
Background technique
With the development of cloud computing technology, large enterprise, public institution of government have all possessed the data center of oneself.And with
The continuous amplification of business demand, the IT infrastructure such as the server of data center, storage equipment, the network equipment are more and more,
Network topology structure also becomes increasingly complex.In order to guarantee operation system it is efficient, reliable, steadily run, to operation maintenance personnel
Technical requirements are also higher and higher.
In order to realize the operation management of efficiently and accurately, the network topology structure model at the acquisition current data center of automation
Figure is significant to data center's maintenance work.
Summary of the invention
Goal of the invention: a kind of method for discovering network topology and system based on double layer network agreement is provided, to solve enterprise
Data center's automation obtains the demand of network topology.
Technical solution: for achieving the above object, the invention adopts the following technical scheme:
A kind of Network Topology Discovering System based on double layer network agreement, including SNMP acquisition unit, algorithm analytical unit,
Data storage cell and Web display unit;Wherein:
SNMP acquisition unit is used for the information provided based on snmp protocol acquisition interchanger, the feature letter including the interchanger
Breath, LLDP neighbor table, ARP table and interface relationship table;
The data for the source interchanger that algorithm analytical unit is used to provide SNMP acquisition unit are analyzed, and neighbours are being obtained
On the basis of switch feature information, the neighbor switch of each interchanger is obtained step by step using recursive algorithm, in conjunction with the friendship
The ARP table and interface relationship table changed planes obtain the MAC Address and IP address information of the direct-connected host of the equipment, form network topology mould
Type;
Data storage cell is used for the network topology model for obtaining algorithm analytical unit, with device node record, line
The form of relation record is saved in relevant database, provides data basis to draw network topology;
Web display unit is as the web services on browser access server, to the telephone net node in database, master
Machine node, interface and line relation data are arranged, to connect the most interchanger of interchanger number as root node, spanning tree
Shape network topology model is sent to browser end according to from top to bottom, and evenly arranged principle realizes automation layout.
Optionally, LLDP neighbor table be using collected interchanger as source interchanger, with source switchboard direct connection other
Interchanger passes through its available whole neighbor switch of the LLDP neighbor table of acquisition source interchanger as neighbor switch
In MAC Address, manufacturer's brand, model, systematic name information and source interchanger and neighbor switch connection relationship, source exchange
The port sequence number of pusher side and the port name of neighbor switch.
Optionally, ARP table: the interchanger generally used in the construction of current data center all supports ARP protocol, source interchanger
Will record currently has the host of data exchange or the source passed through of IP address, MAC Address, data exchange of the network equipment to hand over it
It changes planes side slogan, forms IP address-MAC Address-port sequence incidence relation.
Optionally, interface relationship table: exchanger side port in source is mentioned in the form of sequence number in LLDP neighbor table and ARP table
For needing to be converted into specific port name by internal interface relation table, port name and end being contained in interface relationship table
Mapping relations one by one between mouth sequence number.
In another embodiment, a kind of method for discovering network topology based on double layer network agreement, comprising the following steps:
(1) it specifies one to be used as source interchanger, and acquires the characteristic item of source interchanger;
(2) telephone net node is generated, and database is written;
(3) LLDP table, ARP table and the interface relationship table for acquiring source interchanger, obtain IP address and source exchanger side interface
The IP-Interface table of title;
(4) LLDP table is parsed, the characteristic item of neighbor switch is obtained, in conjunction with IP-Interface table, analysis obtains neighbours
The IP address of interchanger obtains the detailed features information list of whole neighbor switch of the source interchanger in this way;
(5) neighbor switch characteristic information is write respectively as telephone net node, port corresponding relationship as line relationship
Enter database;
(6) source interchanger IP-Interface table is analyzed, it is identical as any neighbor switch ignores interface name
IP address, retain the interface name IP address different from any neighbor switch;
(7) the IP-Interface table analysis in the IP combination step (3) retained in step (6) obtains " IP address-MAC
Address-source exchange interface title " information group, is compiled as end host device node respectively and port connection relationship is saved in pair
In the database answered;
(8) according to the operation of step (6) (7), the record in the interchanger IP_Interface table of source is handled one by one,
Until all traversal is completed;
(9) telephone net node increased newly using in database is repeated step (1) and is arrived as source interchanger using recursive algorithm
(8);
(10) step (9) are repeated until without telephone net node is increased newly.
Further, recursive algorithm process are as follows:
(101) it is based on First source interchanger S0Characteristic item, LLDP neighbor table, ARP table, interface relationship table, obtain S0All
Neighbor switch S01, S02, S03..., S0nCharacteristic item;
(102) it is based on S01Characteristic item, LLDP neighbor table, ARP table, interface relationship table are carried out to it and is acquired, is obtained
Its whole neighbours S11, S12, S13..., S1mCharacteristic item;
(103) it is based on S11Its neighbor switch characteristic item is further obtained, and so on;
(104) in S01Downwards after acquisition, to S02Acquisition downwards, and and so on, it is completed until to the whole network interchanger
The acquisition of characteristic item, neighbor table, ARP table, interface relationship table.
In another embodiment, a kind of method for discovering network topology based on double layer network agreement, comprising the following steps:
(1) it specifies one to be used as access switch, acquires the characteristic item of access switch;
(2) it generates telephone net node and database is written;
(3) LLDP neighbor table, ARP table, interface relationship table are acquired to access switch;Obtain IP address and source exchanger side
The IP-Interface table of interface name;
(4) analysis obtains the information list of neighbor switch;
LLDP table is parsed, the characteristic item of neighbor switch is obtained, in conjunction with IP-Interface table, analysis obtains neighbours' exchange
The IP address of machine obtains the detailed features information list of whole neighbor switch of the source interchanger in this way;
(5) it generates telephone net node and database is all written;
Neighbor switch characteristic information is respectively written into number as telephone net node, port corresponding relationship as line relationship
According to library;
(6) ARP table IP address-port relationship is analyzed;
Source interchanger IP-Interface table is analyzed, interface name IP identical with any neighbor switch is ignored
Address retains the interface name IP address different from any neighbor switch;
(7) judge whether inflow port name is identical as any neighbor switch inflow port name;If so, thening follow the steps
(9);If it is not, thening follow the steps (8);
(8) it obtains connecting on direct-connected host ip, MAC Address and the access switch of access switch with the host
Simultaneously database is written in port;
(9) judge whether access switch ARP entry traverses to finish;If so, thening follow the steps (10);If it is not, then returning
Step (6);
(10) successively using the interchanger increased newly in database as access switch;
(11) judge the record for whether having newly-increased interchanger in database;If so, then return step (3);If it is not, terminating.
The utility model has the advantages that compared with existing topology discovery system for networks, technical method of the present invention have as
Lower advantage: 1) being acquired in real time using based on snmp protocol, direct-connected with the LLDP agreement and ARP protocol information analysis that get
The network feature information of interchanger and host equipment, make full use of the real time information of interchanger itself, accuracy and real-time compared with
It is high;2) algorithm that the whole network interchanger is successively acquired by the way of recursive query allows the automatic discovery of network topology not exchanged
The limitation of machine connection level;3) topological node data are saved using database technology, can not only stablizes and saves Topology g eneration
Model result, moreover, according to the rule appointed, other drawing softwares can also node according to topological model, line relationship
Data drawing topological graph shape.
Detailed description of the invention
Fig. 1 is that the present invention is based on the signals of the application scenarios of the automatic topology discovery method of double layer network protocol realization
Figure;
Fig. 2 is present system schematic diagram;
Fig. 3 is the method for the present invention flow chart;
Fig. 4 is that the discovering network topology result that the present invention obtains illustrates.
Specific embodiment
The present invention is supplied to data center machine room administrator, is used for dynamic generation data center Network Topology for Real-Time figure,
Facilitate administrator to understand the real-time network topology connection relationship in current data center, is used cooperatively with other function, it can be real-time
Show equipment room data on flows, equipment CPU, memory service condition etc. facilitate administrator intuitively to check the operation shape of calculator room equipment
Condition.The present invention is done with reference to the accompanying drawings and detailed description and is further illustrated, it is of the invention above-mentioned or other
The advantages of aspect, will become apparent.
As shown in Figure 1, being method for discovering network topology and systematic difference scene based on double layer network agreement, the present invention
It operates in automatic topology discovery server S.The whole network interchanger has enabled LLDP agreement and SNMPv2 protocol function, and
It is configured with identical SNMP community word, the management IP address of interchanger can be accessed by server S.Server S acquires in real time
The information such as switch feature information, LLDP neighbor table, ARP table, interface relationship table, it is internal to be obtained by running algorithm analytical unit
Topological connection relation is simultaneously saved in database by data storage cell.When the Web by external browser access server S takes
When business, browser end is sent by the network topology data in database, generates the network topology figure of tree.
As shown in Fig. 2, a kind of Network Topology Discovering System based on double layer network agreement of the invention, including SNMP acquisition
Unit, algorithm analytical unit, data storage cell and Web display unit;Wherein:
SNMP acquisition unit is used for the information provided based on snmp protocol acquisition interchanger, the feature letter including the interchanger
Breath, LLDP neighbor table, ARP table and interface relationship table;
The data for the source interchanger that algorithm analytical unit is used to provide SNMP acquisition unit are analyzed, and neighbours are being obtained
On the basis of switch feature information, the neighbor switch of each interchanger is obtained step by step using recursive algorithm, in conjunction with the friendship
The ARP table and interface relationship table changed planes obtain the MAC Address and IP address information of the direct-connected host of the equipment, form network topology mould
Type;
Data storage cell is used for the network topology model for obtaining algorithm analytical unit, with device node record, line
The form of relation record is saved in relevant database, provides data basis to draw network topology;
Web display unit is as the web services on browser access server, to the telephone net node in database, master
Machine node, interface and line relation data are arranged, to connect the most interchanger of interchanger number as root node, spanning tree
Shape network topology model is sent to browser end according to from top to bottom, and evenly arranged principle realizes automation layout.
LLDP neighbor table: using collected interchanger as source interchanger, make with other interchangers of source switchboard direct connection
For neighbor switch, the MAC Address of its available whole neighbor switch of LLDP neighbor table by acquiring source interchanger, factory
In commodity board, model, systematic name information and source interchanger and neighbor switch connection relationship, the port of source exchanger side
The port name of sequence number and neighbor switch;
ARP table: the interchanger generally used in the construction of current data center all supports ARP protocol, source exchange opportunity record
Currently there are the host of data exchange or the source exchanger side that is passed through of IP address, MAC Address, data exchange of the network equipment with it
Port numbers form IP address-MAC Address-port sequence incidence relation;
Interface relationship table: exchanger side port in source is provided in the form of sequence number in LLDP neighbor table and ARP table, is needed
It is converted into specific port name by internal interface relation table, contains port name and port sequence number in interface relationship table
Between mapping relations one by one.
In one embodiment, a kind of method for discovering network topology based on double layer network agreement of the invention, including following step
It is rapid:
(1) it specifies one to be used as access switch (source interchanger), and acquires the characteristic item of source interchanger;
(2) telephone net node is generated, and database is written;
(3) LLDP table, ARP table and the interface relationship table for acquiring source interchanger, obtain IP address and source exchanger side interface
The mapping table (IP-Interface table) of title;
(4) LLDP table is parsed, characteristic item (including the neighbor switch side, source exchanger side port of neighbor switch are obtained
The information such as title), in conjunction with IP-Interface table, analysis obtains the IP address of neighbor switch, obtains the source interchanger in this way
Whole neighbor switch detailed features information list;
(5) neighbor switch characteristic information is write respectively as telephone net node, port corresponding relationship as line relationship
Enter database;
(6) source interchanger IP-Interface table is analyzed, it is identical as any neighbor switch ignores interface name
IP address, retain the interface name IP address different from any neighbor switch;
(7) the IP-Interface table analysis in the IP combination step (3) retained in step (6) obtains " IP address-MAC
Address-source exchange interface title " information group, is compiled as end host device node respectively and port connection relationship is saved in pair
In the database answered;
(8) according to the operation of step (6) (7), the record in the interchanger IP_Interface table of source is handled one by one,
Until all traversal is completed;
(9) telephone net node increased newly using in database is repeated step (1) and is arrived as source interchanger using recursive algorithm
(8);
(10) step (9) are repeated until without telephone net node is increased newly.
Recursive algorithm process are as follows:
(101) it is based on First source interchanger S0Characteristic item, LLDP neighbor table, ARP table, interface relationship table, obtain S0All
Neighbor switch S01, S02, S03..., S0nCharacteristic item;
(102) it is based on S01Characteristic item, LLDP neighbor table, ARP table, interface relationship table are carried out to it and is acquired, is obtained
Its whole neighbours S11, S12, S13..., S1mCharacteristic item;
(103) it is based on S11Its neighbor switch characteristic item is further obtained, and so on;
(104) in S01Downwards after acquisition, to S02Acquisition downwards, and and so on, it is completed until to the whole network interchanger
The acquisition of characteristic item, neighbor table, ARP table, interface relationship table.
As shown in figure 3, a kind of method for discovering network topology based on double layer network agreement, comprising the following steps:
(1) it specifies one to be used as access switch (source interchanger), acquires the characteristic item of access switch;
(2) it generates telephone net node and database is written;
(3) LLDP neighbor table, ARP table, interface relationship table are acquired to access switch;Obtain IP address and source exchanger side
The mapping table (IP-Interface table) of interface name;
(4) analysis obtains the information list of neighbor switch;
LLDP table is parsed, characteristic item (including the neighbor switch side, source exchanger side port name of neighbor switch are obtained
Etc. information), in conjunction with IP-Interface table, analysis obtains the IP address of neighbor switch, obtains the complete of the source interchanger in this way
The detailed features information list of portion's neighbor switch;
(5) it generates telephone net node and database is all written;
Neighbor switch characteristic information is respectively written into number as telephone net node, port corresponding relationship as line relationship
According to library;
(6) ARP table IP address-port relationship is analyzed;
Source interchanger IP-Interface table is analyzed, interface name IP identical with any neighbor switch is ignored
Address retains the interface name IP address different from any neighbor switch;
(7) judge whether inflow port name is identical as any neighbor switch inflow port name;If so, thening follow the steps
(9);If it is not, thening follow the steps (8);
(8) it obtains connecting on direct-connected host ip, MAC Address and the access switch of access switch with the host
Simultaneously database is written in port;
(9) judge whether access switch ARP entry traverses to finish;If so, thening follow the steps (10);If it is not, then returning
Step (6);
(10) successively using the interchanger increased newly in database as access switch;
(11) judge the record for whether having newly-increased interchanger in database;If so, then return step (3);If it is not, terminating.
Node, the line relation information for saving network topology model in the database can be obtained by step as above.
The Web service of server where accessing network autodiscovery system by browser, server-side carry out the data in database
It arranges, finds root node interchanger, and using it as root node, the topological connection relation model of tree is generated, before returning to
Platform browser end, browser can generate corresponding network topology figure according to backstage return information, using drawing plug-in unit, such as scheme
Shown in 4.