Background technology
Topology information collection is the basis of whole network cluster management, and it is based upon on the basis of the adjacent device information that has stored this equipment in the interior equipment of collecting topology scope.The process of so-called collecting topology, exactly from the collecting topology initiating equipment, the syntople information aggregating of equipment of all being supported collecting topologies in the collecting topology scope is to the collecting topology initiating equipment.
The method of prior art is divided into based on the collecting topology of two-layer protocol with based on two kinds of the collecting topologies of three layer protocols.Collecting topology based on two-layer protocol, be meant all collecting topology messages, all be carried on the two-layer protocol, but two-layer protocol itself does not provide network routing function, so existing implementation method, all carry out based on tree network, by being that up direction sends the topology report to the tree root node direction, the place gathers whole network topology at the tree root node.This collecting topology mode, for non-tree topology such as mesh topology, collection method will lose efficacy.
Based on the collecting topology of three layer protocols, mainly be meant collecting topology based on IP (Internet protocol).All topological report messages are forwarded to the equipment of initiating collecting topology all by the network layer Routing Protocol of standard, and form whole net topology.The mode of this collecting topology causes each node in the whole topology, all will realize complicated routing algorithm, and this then can't implement for the low-end product that some do not have router feature.
The collecting topology of prior art can not guarantee the integrality of the topology information collected, generally adopts the method that regularly refreshes the topology to remedy, even collect unsuccessfully, also can not influence for a long time.But for the cluster management of the network equipment, if collecting topology is incomplete, direct result is exactly that individual network device can't add cluster, causes administrative vulnerability.
In addition, in order to solve the circulatory problems in the collecting topology process, prior art adopts a kind of spanning tree algorithm, carries out according to tree, owing to all need on each network equipment in the topology to move the algorithm that generates tree, makes the process relative complex.
Summary of the invention
The object of the present invention is to provide a kind of easy whole network topology information collection method.
For achieving the above object, the technical solution used in the present invention is: a kind of network topology information acquisition method, at first send topology information collection request message according to its adjacent node information to adjacent node from local node by topology information collection equipment, comprise the field that is used to limit message relay times in the request message, repeat following operation:
The node of receiving request message returns the response message that comprises this nodal information and this node and adjacent node link information to topology information collection equipment;
Judge whether message relay times reaches limits value, if, end operation; If not, continue following the processing;
The node of receiving request message is transmitted request message to all of its neighbor node separately.
After adopting said method, in the collecting topology scope of appointment, each equipment in the network all can be received the topology information collection request, and to this request of collecting topology device responds, response message includes the link information of the information of this equipment and it and all of its neighbor equipment, therefore, collecting topology equipment can be collected the self information of all devices and the interconnect information between them, realize collecting network topology information, make network management system go out network topological diagram, with basis as cluster management according to this information structuring.
Embodiment
Below in conjunction with drawings and Examples the inventive method is described further.
Flow process shown in Figure 1 is: at first send topology information collection request message according to its adjacent node information to adjacent node from local node by topology information collection equipment, comprise the field that is used to limit message relay times in the request message, repeat following operation:
The node of receiving request message returns the response message that comprises this nodal information and this node and adjacent node link information to topology information collection equipment;
Judge whether message relay times reaches limits value, if, end operation; If not, continue following the processing;
The node of receiving request message is transmitted request message to all of its neighbor node separately.The field of restriction message relay times is in order to control the scope of collecting topology, can be integer, and initial value subtracts 1 with this field during each device forwards request message after setting, and field value is 0 o'clock, will no longer transmit request message.
Can comprise the source path field that is used to put down in writing the message sending order in the described request message, comprise the response path field that is used to determine the message sending order in the described response message, when sending request message at every turn, the device identification of this node is write the source path field, and the response path field draws by the respective sources path field is reverse.The path is exactly the sequenced arrangement of device identification of the equipment of all processes, equipment is before its adjacent device is given in the request of forwarding, the device identification of oneself in the interpolation of the source path field end of this request message, during request message that certain device responds is received, need be with the content reversed order of the source path field of the request message path of message in response.In example shown in Figure 2, when device A sent topology request message 1 to equipment B, the source path field of this message only was 1 device identification, i.e. A.Equipment B is being transmitted this request to before its adjacent device, and the device identification of oneself on adding at the source path end of this request message is so the source path field of request message 2,3 is A, B; When request message that certain device responds is received, need be with the content reversed order of the source path field of respective request message path field in response, promptly the response path field of equipment D, E response message 4,5 is B, A.
In order further to prevent message circulation forwarding, when certain equipment is received the topology information collection request,, then abandon this message if the source routing field of this message has comprised the device identification of this equipment.A last address is not this equipment if the destination address of this message is the source path field, is transmitted to its adjacent device according to the path indication.
When the topology request message spreads in network, certain equipment may be received the request message that is transmitted to it from a plurality of adjacent devices, send the response message that repeats in order to prevent to receive the request message of repetition, comprise the collecting topology identification field in the described request message, its value produces when initiating the topology information collection request by topology information collection equipment, the each collection finishes, this value is added 1 as the collecting topology sign of collecting next time, comprise the collecting topology identification field in the described response message, its value is got the collecting topology identification field values in the respective request message, after receiving request message, judge whether the collecting topology sign is identical with the message collecting topology sign that has responded, if identical, then abandon this request message; Otherwise, handle this request message.
When the topology request message spreads in network, a large amount of network equipments can be received topology request simultaneously, send response message simultaneously, may cause network congestion and collecting topology device busy, in order to reduce the appearance of this situation, each equipment can postpone to wait for certain hour before sending the topology request message.In concrete the enforcement, order is returned response message to transmitting the T1 that waits for a period of time between the request message; When transmitting request message, transmit adjacent node sequence consensus in its order and the response message one by one by the device port order.For example can establish T1=(X+ Δ) millisecond, wherein X is a determined value, Δ is a random number, comprise the maximum of Δ and the time interval value that device port is transmitted one by one in the described collecting topology request message, the reference value of X can be 200 milliseconds in concrete the enforcement, and the time interval value that device port is transmitted one by one can be 20 milliseconds.
In order further to guarantee the integrality of collecting topology, when topology information collection equipment is received response message, the node device that returns this message is write down and is designated responsive node, the node identification that do not respond in its adjacent node is responsive node not, after waiting for a period of time, responsive node is not specified the collecting topology operation.When the response of certain equipment of discovery is not received, will be by specifying the collecting topology process, collect the topology information of this equipment, in this case, because collecting topology equipment has been grasped from self arriving the routing iinformation of this designated equipment according to the equipment room annexation of collecting,, do not need to adopt the above-mentioned mode of broadcasting step by step so can adopt the addressing of source routing mode, thereby the minimizing network congestion improves and carries out efficient.