Summary of the invention
The object of the present invention is to provide a kind of information of equipment in the network and the method and device thereof of topological structure of obtaining automatically, this method and apparatus is with a kind of general protocol platform load bearing equipment information and topology information, realized the interoperability and the interactivity of heterogeneous networks equipment room, and made the network manager can real-time monitor the connection change and the topologies change of the equipment in the current network.
A kind of information of equipment in the network and method of topological structure obtained automatically of the present invention comprises following steps:
The current information that each equipment in a, the network will be stored in respectively in its data storehouse is encoded into GITRP (universal network recognition of devices and topological log-in protocol) message, and this GITRP message that the back of will encoding obtains is given connected all devices with the time interval timed sending of setting separately, wherein the current information in the database comprises the current device information and the topological state information of each equipment self, and the current device information and the topological state information of other equipment in the known network;
Each equipment in b, the network receives the GITRP message that connected all devices comes with the time interval timed sending of setting separately respectively, all GITRP messages that receive are decoded, obtain the current device information and the topological state information of other equipment in the network, and after according to the information that from this GITRP message, obtains the information in its data storehouse of being stored in being upgraded, return step a.
Wherein, among the step a, the current information that each equipment in the network will be stored in respectively in its data storehouse is encoded into the GITRP message, comprises following steps:
A1, respectively with whole current informations of each equipment of storing in the database, comprise current facility information and topological state information, be encoded into a piece of news in the GITRP message;
The message of a2, all devices that step a1 is obtained is formed the GITRP message.
In addition, the network that is suitable for of the present invention is a local area network (LAN).Facility information comprises unit type, production firm, device network address and device product number.The topology state information comprises the topology information of interface connection state information and institute's attached device.
A kind of facility information in the network and device of topological structure of obtaining automatically of the present invention, this device is used for each equipment of network, comprise information stores and update module, GITRP message coding module, GITRP message receiver module, GITRP message sending module and GITRP message decoder module, wherein:
Information stores and update module, be used for storing current information at database, this current packets of information is drawn together the current device information and the topological state information of each equipment self, and the current device information and the topological state information of other equipment in the known network, and the information that the GITRP message decoding back that GITRP message receiver module is received according to GITRP message decoder module obtains is upgraded the information that is stored in the database;
GITRP message coding module, the current information that is used for being stored in the database of information stores and update module is encoded into the GITRP message;
GITRP message sending module, all devices that the described GITRP message that is used for obtaining behind the GITRP message coding module coding connects to network with the time interval timed sending of setting;
GITRP message receiver module is used for receiving the time interval timed sending next GITRP message of all devices to set separately that network connects;
GITRP message decoder module, all GITRP messages that are used for GITRP message receiver module is received are decoded, and obtain the current device information and the topological state information of other equipment in the network.
Wherein, GITRP message coding module also comprises:
The information coding unit is used for comprising current facility information and topological state information with being stored in whole current informations of each equipment of the database of information stores and update module, is encoded into a piece of news in the GITRP message;
GITRP message assembled unit is used for the message composition GITRP message with all devices of information coding unit acquisition.
Device of the present invention further comprises the administrator interface module, and the network manager checks the information that is stored in information stores and the update module by this administrator interface module, thereby monitors the information and the topologies change of equipment in the current network.
The present invention utilizes facility information and the topological state log-on message in the GITRP agreement bearer network, and by each network equipment with facility information and the topological state information of this agreement with oneself, and the facility information of the known network equipment and topological state information are distributed in network and are propagated, status information reporting by each network equipment participant transmission, transmission connects facility information and the topology information in the network, thereby reaches the purpose of obtaining the device topology that connects in the network automatically.The present invention can also monitor the connection change situation of each network equipment in the network in real time by regularly receiving status information reporting that the network equipment sends.
Embodiment
The present invention is further illustrated below in conjunction with drawings and Examples.
The GITRP agreement of the present invention definition is exactly to have carried the facility information in the network and the association attributes of topological state information on existing GARP agreement.GITRP agreement use agreement field 01-80-C2-00-00-28 identity protocol type in the GARP protocol suite of the present invention's definition is an application protocol in the GARP protocol suite.The present invention utilizes the message of this protocol definition in LA Management Room transmission and switching equipment information and topological state information.Can carry a plurality of message in every GITRP message by the GITRP protocol definition, comprise attribute and each list of attribute values of this message in each message.
What Fig. 1 showed is the structural representation of GITRP message according to an embodiment of the invention.As shown in Figure 1, the GITRP message is made up of agreement ID, some message and end mark.Wherein, agreement ID represents the address of GITRP agreement, and the address that defines the GITRP agreement in the present invention is 5, represents with 0x05.Message 1 ... message N represents some the message of carrying in the GITRP message respectively, and wherein N is the positive integer more than or equal to 1.Every message is a complete device attribute list, is divided into attribute type and attribute list.In the present invention, the attribute type in each bar message is used to identify port numbers, shows that promptly information in this message is that a certain port from this equipment obtains, and has also indicated the connection state information of port simultaneously; When the attribute type is 0, show that this message is the attribute message of equipment self; And the attribute list in each bar message is by attribute 1 ... the a plurality of attribute structure entities of attribute M are formed, and are the attribute lists of the port associated device that indicates with attribute type, and wherein M is the positive integer more than or equal to 1.
Simultaneously, attribute structure is made of attribute length, attribute event and property value again.Wherein attribute length is represented the length of this attribute entities; Attribute event is used for marking equipment attribute event type, for example, the type of the attribute event of definition has in the present invention: with hardware media access control layer (MAC) address of 0x01 indication equipment, with 0x02 indication equipment sequence number, with 0x03 indication equipment network ip address, with 0x04 indication equipment subnet, with 0x05 indication equipment gateway, with 0x06 indication equipment title and with 0x07 indication equipment port numbers; Property value is represented the concrete parameter value of this attribute correspondence.
More than be that some device attributes that define among the present invention are represented.Along with the continuous development of network technology, can extend the attribute event list of types and expand according to actual conditions.
Fig. 2 shows is the structural representation of the device of a kind of information of obtaining equipment in the network automatically according to an embodiment of the invention and topological structure.As shown in Figure 2, the device 200 of a kind of information of obtaining equipment in the network automatically of the present invention and topological structure is used for each equipment of network, comprise information stores and update module 230, GITRP message coding module 220, GITRP message sending module 210, GITRP message receiver module 250 and GITRP message decoder module 240, wherein:
Information stores and update module 230, be used for storing current information at database, this current packets of information is drawn together the current device information and the topological state information of each equipment self, and the current device information and the topological state information of other equipment in the known network, and the information that the GITRP message that receives according to 240 pairs of GITRP messages of GITRP message decoder module receiver module 250 decoding back obtains upgrades the information that is stored in the database, forms up-to-date database.Simultaneously information stores and update module 230 also can become the information mapping in the database topology diagram of equipment in the network.Network Management person can recognize current whole topology of networks clear and intuitively by this network topology structure figure.Wherein, facility information comprises unit type, production firm, device network address and device product number; The topology state information comprises the interface connection state information of this equipment and the topology information of institute's attached device.
GITRP message coding module 220, the current information that is used for being stored in the database of information stores and update module 230 is encoded into the GITRP message.This GITRP message coding module 220 further comprises information coding unit 221 and GITRP message assembled unit 222, wherein, information coding unit 221 is used for and will be stored in whole current informations of each equipment of the database of information stores and update module 230, comprise current facility information and topological state information, be encoded into a piece of news in the GITRP message, GITRP message assembled unit 222 is used for the synthetic GITRP message of the message groups of all devices of information coding unit 221 acquisitions.
GITRP message sending module 210 is used for all devices that the GITRP message that GITRP message coding module 220 coding backs obtain is connected to network with the time interval timed sending of setting by network interface.In order to guarantee certain robustness, GITRP message sending module 210 can send two GITRP messages to prevent losing of this GITRP message at every turn.Certainly, GITRP message sending module 210 sends the GITRP message and is not limited to by network interface, can also send the GITRP message by alternate manner.
GITRP message receiver module 250 is used for receiving the time interval timed sending next GITRP message of all devices to set separately that network connects by network interface.In like manner, GITRP message receiver module 250 receives the GITRP message and also is not limited to pass through network interface.
GITRP message decoder module 240, all GITRP messages that are used for GITRP message receiver module 250 is received are decoded, and obtain the current device information and the topological state information of other equipment in the network.
In addition, of the present inventionly obtain facility information in the network automatically and the device 200 of topological structure further comprises administrator interface module 260, the network manager checks the information that is stored in described information stores and the update module 230 by this administrator interface module 260, thereby monitors the information and the topological structure of equipment in the current network.
What Fig. 3 showed is that application the present invention according to an embodiment of the invention obtains the information of equipment and the schematic diagram of topological structure in local area network (LAN).In local area network (LAN) as shown in Figure 3, network equipment ND1, ND2, ND3, ND4, ND5 interconnect by the cascade port, and all contain the information of equipment in the network and a device 200 of topological structure of obtaining automatically of the present invention in each network equipment.
As shown in Figure 3, network equipment ND1 will be stored in the current information in its data storehouse, the current device information and the topological state information that comprise this network equipment ND1 self, and the current device information and the topological state information of other equipment in the known network, press the version of the GITRP message of GITRP shown in Figure 1 (universal network recognition of devices and topology registration) protocol definition, be encoded into the GITRP message, and this GITRP message that the back of will encoding obtains is given connected all devices, i.e. network equipment ND2 by network interface with the time interval timed sending of setting, ND3, ND4.Wherein the time interval of She Dinging is that people set according to actual needs, can be 10 seconds, 20 seconds, 30 seconds, 1 minute, 5 minutes or the like.Network equipment ND1 will be stored in current information in its data storehouse and be encoded into the GITRP message and then comprise following steps:
At first, network equipment ND1 comprises current facility information and topological state information with whole current informations of each equipment of storing in its data storehouse, is encoded into a piece of news in the GITRP message;
Secondly, network equipment ND1 forms the GITRP message with the message of all devices that obtains in the above-mentioned steps.
Wherein, facility information can comprise unit type, production firm, device network address and device product number; Topological state information then can comprise the interface connection state information of this equipment and the topology information of institute's attached device.Below only enumerated the several types of facility information and topological state information, the present invention is not limited to the type of above-mentioned facility information of enumerating and topological state information, along with the continuous development of network technology, also can extend the type of facility information and topological state information or expand according to actual conditions.
In like manner, network equipment ND2, ND3, ND4, ND5 also will be stored in the current information in its data storehouse respectively, the current device information and the topological state information that comprise each equipment self, and the current device information and the topological state information of other equipment in the known network, be encoded into the GITRP message, and the GITRP message that the back of will encoding obtains is given connected all devices by network interface with the time interval timed sending of setting separately.Be that the GITRP message that will obtain after network equipment ND2 will encode is given network equipment ND1 by network interface with the time interval timed sending of setting; The GITRP message that will obtain after network equipment ND3 will encode is given network equipment ND1 by network interface with the time interval timed sending of setting; The GITRP message that will obtain after network equipment ND4 will encode is given network equipment ND1 and ND5 by network interface with the time interval timed sending of setting; And the network equipment ND5 GITRP message that the back obtains of will encoding is given network equipment ND4 by network interface with the time interval timed sending of setting.
When network equipment ND1 receives the GITRP message that connected network equipment ND2, ND3 and ND4 come with the time interval timed sending of setting separately respectively by network interface, network equipment ND1 decodes to the GITRP message that receives respectively, obtain the current device information and the topological state information of other equipment in the network, and the information that is stored in its data storehouse is upgraded according to the information that from the GITRP message that receives, obtains.
Subsequently, current information in its data storehouse after network equipment ND1 will upgrade is encoded into the GITRP message, and the GITRP message that the back of will encoding obtains is given connected network equipment ND2, ND3 and ND4 by network interface with the time interval timed sending of setting certainly.
Like this, the equipment in the whole local area network exchanges the facility information and the topological state information of the facility information of this equipment and topological state information and known other network equipment by the miscellaneous equipment in GITRP agreement and the network.After a period of time, network equipment ND1 just can obtain current latest network topology data, thereby maps out the topology diagram of equipment in the network.Therefore the network manager logs on network equipment ND1 among Fig. 3, just can obtain the information, network configuration of whole topology of networks figure, each connection device etc. by network equipment ND1, and according to the information of acquisition whole network is managed.In fact any network equipment in this network all has current up-to-date topology information, so the network manager also can be by landing the topology diagram that miscellaneous equipment obtains equipment in the whole network, the information of each connection device, network configuration etc.
When the equipment connection situation in the network changed, the network manager can monitor the connection change and the topologies change of the network equipment soon, helped the network manager in time to solve the variety of issue of the existence in the network management.
Though through the present invention is described in conjunction with specific embodiments, for those skilled in the art, according to manyly substituting of making of narration above, revise with variation will be apparent.Therefore, when such substituting, within the spirit and scope that modifications and variations fall into attached claim the time, should being included among the present invention.