Background technology
Two a large amount of etale topologies find that automatically algorithm all is based on bridge MIB (Management InformationBase, management information bank) information realizes, this is because the bridge MIB (bridge MIB is equally applicable to the source routing bridge) of bridge can reflect the MAC Address collection that each port of bridge is learnt, and each equipment all has unique MAC; By the relation between these MAC Address collection, can judge the annexation of these equipment rooms.
Though the information of bridge MIB is found very important to two etale topologies, but the content of bridge MIB all has an ageing time, node dotldTpAgingTime at the group dotldTp of bridge MIB has made regulation to ageing time, and the IEEE802.1D-1990 recommendation is 300 seconds, if also promptly nearest 300 seconds certain port can be learnt special MAC, during then this MAC is retained in and transmits, otherwise this MAC will remove from transmit.
In order to guarantee automatically to find the accuracy of topology, need when using algorithm, guarantee to comprise in the transmitting of bridge the MAC of destination host; General processing all is to have webmaster to be responsible for pinged device, has guaranteed that message passes through bridge.The concrete steps that realize the renewal of bridge MIB by the webmaster pinged device are: a, obtain the inner all equipment of subnet; B, all Ping is once to each equipment; The algorithm of two etale topologies is found in c, beginning automatically.For instance, topology as shown in Figure 1a supposes that A, B, C are switches, by webmaster Ping equipment F equipment the time, can cause the bridge MIB of B and C to upgrade, because the port that has frame to pass through switch transmits the Ping message to destination device.
All be to initiate Ping by webmaster in this scheme, because these characteristics, there are some shortcomings in this scheme, and these shortcomings can be illustrated by network topology shown in Figure 2:
1, the position of webmaster will have a strong impact on the effect of Ping, for example be Ping equipment F equally, compare with Fig. 1, and the position that Fig. 2 initiates the webmaster of Ping can cause all the switch bridge MIB except that E to upgrade;
Even 2 from webmaster Ping all devices, also can't learn mutually between some equipment, as equipment E and the F among the figure;
Summary of the invention
Technical problem to be solved by this invention provides a kind of can the renewal by the optional position initiation bridge tube reason information bank in network, and can guarantee that arbitrary bridge tube reason information bank can both carry out complete method for updating in the network.
For this reason, the invention provides a kind of update method of bridge tube reason information bank, comprise the following steps:
1) structure contains the protocol massages of specified network facility information;
2) send described protocol massages to the interior network equipment of network;
3) network equipment that receives protocol massages arrives described specified network equipment according to the specified network facility information transmission response message that described protocol massages contains.
Further, described protocol massages can specifically comprise the following steps: in the step 1) for ICMP (Internet Control MessageProtocol, Internet Control Message Protocol) message
11) icmp packet of structural type 8 codes 0;
12) revising IP heading source address is the IP address of specified network equipment;
13) recomputate the IP message verification and;
14) value of modification IP heading checksum field.
Further, the described specified network facility information IP address that is equipment in the network.
The present invention also provides another bridge tube reason information bank method for updating, carries out following processing one by one for each network equipment in the subnet:
A) be taken at the IP address of the net mask and the network equipment to be processed;
B) structure has the icmp packet that source IP address is the IP address of the described network equipment to be processed;
C) IP address range of determining according to subnet mask sends described icmp packet one by one;
D) receive the network equipment echo reply message of described icmp packet to the network equipment to be processed.
Wherein, be specially step B):
B1) icmp packet of structural type 8 codes 0;
B2) revise the IP address of IP heading source IP address for handling the network equipment;
B3) recomputate the IP message verification and;
B4) value of modification IP heading checksum field.
Wherein, the concrete steps of obtaining subnet mask steps A) are:
A1) judge whether started SNMP in the network (Simple Network Management Protocol, Simple Network Management Protocol) service;
A2) if the ipAddrTable that then utilizes SNMP to serve obtains subnet mask, forwards step B to);
A3) if not, the icmp packet of transmission types 17 codes 0 then;
A4) icmp packet of type of receipt 18 codes 0;
A5) analytic message obtains subnet mask.
Wherein, step C) also can be:
Subnet of ip address according to subnet mask is determined sends described icmp packet to subnet of ip address.
Wherein, the described network equipment can be switch, and the transmission of described message is by the network management workstation in the network.
In method provided by the present invention, because in the ping method of initiating by webmaster, because the icmp packet that sends has been done correction, source IP address in its IP message is revised and controlled, therefore can control the network equipment that receives protocol massages response message is turned back to arbitrary network equipment in the subnet, therefore, for each network equipment, send icmp packet after the modification with this network appliance IP address by webmaster, just can guarantee that it learns the all-network equipment in the subnet, upgrade its bridge mib information.
Further, after each network equipment in the network is all repeated the renewal process of above-mentioned bridge MIB, will make the bridge MIB of whole subnet carry out whole updating, the bridge tube reason information bank that is the arbitrary network equipment in the network all will obtain complete renewal, and the network equipment information in the correct reflection subnet is new situation more.
In addition and since can control IC MP response message return the destination, carry out autotelic ping so webmaster can be controlled the ping method, thereby broken away from that the equipment bridge MIB that ping process causes upgrades, the study situation is to the dependence of webmaster position.
Embodiment
The main thought of method provided by the present invention is, the bridge MIB of the network equipment has the function that automatic study is upgraded when E-Packeting, therefore, as long as the control message is by all devices in the network, and guarantee the mutual study between any two equipment, the bridge MIB of the network equipment is carried out complete renewal with regard to guaranteeing.In a specific embodiment of the present invention, mainly be to have utilized icmp packet, method by equipment in the ping network, the destination of control response message, thereby make message have purpose to transmit, behind all devices in the traversal processing subnet, then per unit bridge MIB can be carried out complete renewal, the bridge MIB that finally obtains in the whole network upgrades.
Further the specific embodiment of the present invention is described in detail below in conjunction with accompanying drawing.
As shown in Figure 3, the overall procedure of the update method of bridge MIB provided by the present invention can be summarized to retouch and is divided into three steps, specifically:
At step S1, at first need to construct protocol massages with specified network facility information.In a specific embodiment of the present invention, be to have the ICMP newspaper of specifying source IP address by structure zhang to realize.In fact; those of skill in the art in this area can know; a lot of protocol massages can be used for realizing thought of the present invention; make the network equipment that receives message that response message is turned back to specified network equipment as long as can control this protocol massages; therefore; the icmp packet that is utilized in the present embodiment just schematically, is not represented limiting the scope of the invention.
Utilizing icmp packet to construct special method of message can be with reference to the step S11-S14 among the figure 5, that is:
At step S11, selected needs are the network equipment N of new bridge MIB more.Can in subnet, select a network equipment arbitrarily, be designated as equipment N, obtain the relevant information of this network equipment then, certainly the most important thing is the IP address information, this can realize by multiple means, for example, can get the bridge mib information of this equipment by the SNMP service, also can know the IP address range of the network equipment, and the IP address sends the ICMP request message in this scope by obtaining the subnet mask of network equipment place subnet, carry out record for the IP address of equipment of replying, can choose an IP address of equipment then therein wantonly and get final product, perhaps, more succinct, can be in the IP address range that subnet mask is determined, select one by one, no matter whether equipment exists, and all is assumed to be the more equipment of new bridge MIB, circulation or processing together, in a word, selected equipment, the method for particularly obtaining IP address of equipment is not essential place of the present invention, no matter use which kind of method, as long as can obtain the IP address of equipment in the network, therefore, the whole bag of tricks of mentioning here all is schematic.
As mentioned above, though obtain subnet mask is not core concept of the present invention place, but in certain embodiments, still critical step comparatively, particularly construct message after, when all devices in network sends, be in some specific embodiments among the step S2 of this method, need at first obtain subnet mask, so we introduced the method for obtaining subnet mask in step S2, its method is equally applicable to this step when obtaining this information, does not repeat them here.
At step S12, structure has the icmp packet of type 8 codes 0, i.e. ICMP request message.Those skilled in the art know that usually, icmp packet is in the IP datagram internal transmission, and therefore, the icmp packet of structure need add the IP datagram head when sending, therefore,
At step S13, the source IP address of revising the IP heading is the IP address of pending network equipment N;
At step S14, recomputate the IP message verification and.
By above-mentioned steps, just finished the construction process of a complete icmp packet.
At step S2, send posttectonic agreement newspaper zhang other equipment in the subnet.Usually, this need send from the operated equipment of webmaster.Can learn all devices in the subnet in order to ensure the network equipment, though can be by selectively sending, just can upgrade the bridge MIB of all devices in the net, and the more new capital on each equipment is complete, but for easy and safe, preferably protocol massages is sent on all devices in the subnet, but this just needs to obtain the protocol massages address of all-network equipment in the network, for example, in the specific embodiment that utilizes the ICMP agreement of the present invention, just need know the IP address of all-network equipment in the subnet, because ICMP is encapsulated in the IP agreement and transmits, for this reason, can obtain the IP address of all-network equipment in the subnet by some ways, for example, can obtain the IP address list of all possible equipment in the subnet according to subnet IP and mask.Send the ICMP request to these equipment successively,, then have ICMP and reply if some equipment exists.In a specific embodiment of the present invention, adopted the method that sends protocol massages to subnet place IP address field one by one, also can guarantee effectively message is sent to all devices in the subnet, but it is schematic that this explanation remains, be not unique, for example, the order that sends message can be to send one by one, also can be to send simultaneously, or to subnet address transmission etc.
With reference to figure 2, if adopted the method that sends protocol massages to subnet place IP address field, must at first obtain the address of the subnet network segment, it is subnet mask, above we also repeatedly to mention the purposes of obtaining subnet mask be multiple, in view of the above, provide a kind of method of concrete acquisition subnet address in the specific embodiment of the present invention, be described below:
At step S21, judge whether have SNMP in the network (Simple Network ManagementProtocol, Simple Network Management Protocol) service.As long as have the network equipment of supporting the SNMP service in the network, just can judge that network internal storage serves at SNMP.If judged result for being, then enters step S22, if judged result then enters step S23 for not;
At step S22, there is SNMP service in the network owing to judged, so can show to obtain subnet mask by the ipAddrTable that obtains SNMP and provide
At step S23, if there is not the SNMP service in the network, then can't serve and obtain subnet mask by SNMP, owing to all support the ICMP agreement in the general networking, therefore then can further utilize the ICMP agreement to obtain subnet mask, Class1 7 codes 0 " address mask request " function is provided in the ICMP agreement, therefore, the arbitrary network equipment of icmp packet by transmission types 17 codes 0 in the network, therefore can obtain subnet mask, the ICMP of network equipment transmission types 17 codes 0 in subnet newspaper zhang.
At step S24, behind the transmission address mask request function, the icmp packet of type of receipt 18 codes 0, i.e. " address mask reply " message.
At step S25, resolve the address mask reply message that receives and to obtain the subnet address.
Certainly; the mode of obtaining subnet mask is diversified; in specific embodiment provided by the present invention; mainly obtain subnet mask by above-mentioned two kinds of two kinds of agreements commonly used in the network; those of ordinary skill in the ability can be expected other alternative methods easily, and the scope that the present invention protected reaches certainly in this variation.
Behind the completing steps S2, just enter step S3, after step S3 sends protocol massages exactly, specify the network equipment that receives response message to receive the agreement response message, thereby finish the learning process to the network equipment of echo reply message, the bridge MIB of this network equipment has just finished the study to all echo reply message facility informations in the network.
Below promptly be renewal process,, then can finish the renewal of the bridge MIB of all devices in the network if all devices in the network is all repeated said process to a certain network equipment bridge MIB in the network.
For a better understanding of the present invention, further set forth bridge MIB update method provided by the present invention below in conjunction with Fig. 6 by a specific embodiment.
Suppose to have the network shown in Fig. 6 a, and suppose in present networks, newly to have added equipment F, and suppose that F is a switch device, then need the bridge MIB of F is upgraded, have following step according to algorithm of the present invention:
1. positioning equipment F obtains the IP address of equipment F in subnet 1;
2. the IP address with equipment F is the source IP address structure icmp packet of IP heading in the icmp packet;
By the equipment of webmaster in subnet for example equipment D send amended icmp packet;
4. equipment D shows that to F echo reply icmp packet D and F learn the other side mutually;
5. send amended icmp packet by webmaster to equipment E;
6. equipment E responds icmp packet to F, shows that E and F learn the other side mutually; A, B, C are if switch, certainly also learnt mutually with F, reached the purpose that equipment F bridge MIB is upgraded this moment, but for the purpose of safe, all IP addresses that we can continue in device A, B, C even subnet send amended icmp packet, guarantee the complete renewal of equipment F bridge MIB.
Need to prove especially, common, the initiation of Ping message is by webmaster, we mention in background technology, the scheme of prior art makes the renewal of bridge MIB depend on the position of webmaster, use method provided by the present invention and then do not have the problems referred to above, promptly the position of webmaster does not influence the mutual study between the mutual machine.For example, with reference to figure 7, when supposing that webmaster is connected to subnet 1 by D, use method provided by the present invention, those skilled in the art can readily appreciate that the study situation between its switch is the same with the effect of Fig. 6: D and F, E and F can both learn mutually.
Though described the present invention by embodiment, those of ordinary skills know, without departing from the spirit and substance in the present invention, just can make the present invention that many distortion and variation are arranged, and scope of the present invention is limited to the appended claims.