Summary of the invention
The invention provides address resolution protocol collocation method and device under a kind of network management system, solve the problem that arp entry manual configuration otherness is large, efficiency is low, error rate is high of existing three layer interfaces of webmaster in prior art.
A protocol configuration method under network management system, for the arp entry of three layer interfaces between a plurality of network elements, the method comprises:
From the member port that three layer interface A of the first network element comprise, determine at least one first physical port, and described the first parameter corresponding at least one first physical port of record;
Obtain described the first network element and the link data that at least one second network element is connected, generate corresponding link data parameter;
According to described link data parameter and described the first parameter, find out the second parameter of the second physical port docking with described at least one first physical port in the second network element;
Judge three layer interface B in whether corresponding the second network element of described the second physical port, if so, according to described the second parameter, obtain the MAC Address of three layer interface B;
Described the first parameter is mated with described the second parameter, if the match is successful, according to the IP address of the second network element and described MAC Address, create arp entry and preserve.
The present invention also provides the device of the address resolution protocol configuration under a kind of network management system, and this device comprises:
The first parameter module, the member port connecting for the three layer interface A from the first network element is determined at least one first physical port, and described the first parameter corresponding at least one first physical port of record;
Link data module, for obtaining described the first network element and the link data that at least one second network element is connected, generates corresponding link data parameter;
The second parameter module, for finding out the second parameter of the second physical port that the second network element docks with described at least one first physical port according to described link data parameter and described the first parameter;
Parameter comparison module, for judging three layer interface B of whether corresponding the second network element of described the second physical port, if so, obtains the MAC Address of three layer interface B according to described the second parameter;
Port authorization module, for described the first parameter is mated with described the second parameter, if the match is successful, creates arp entry and preserves according to the IP address of the second network element and described MAC Address;
Beneficial effect:
Adopt the method for the invention, compare with existing manual configuration, due to by the arp entry layoutprocedure of various three layer interfaces in webmaster is carried out to abstract modeling, then use the implementation of XML structure representation model in computer, by XML structure, by series of algorithms, automatically calculate the arp entry of three layer interfaces in webmaster, greatly improve user's allocative efficiency, stopped the probability that webmaster manual configuration is made mistakes, improved the ease for use of network management system.
Embodiment
The present invention program is by carrying out abstract modeling to the arp entry layoutprocedure of various three layer interfaces in webmaster, then use the implementation of XML structure representation model in computer, by XML structure, by series of algorithms, automatically calculate the arp entry of three layer interfaces in webmaster, greatly improve user's allocative efficiency, stopped the probability that webmaster manual configuration is made mistakes, improved the ease for use of network management system.Below in conjunction with Figure of description, the embodiment of the present invention is described further:
As shown in Figure 1, the embodiment of the present invention provides the protocol configuration method under a kind of network management system, specifically comprises step:
Step 101: from the member port that three layer interface A of the first network element connect, determine at least one first physical port, and described the first parameter corresponding at least one first physical port of record;
Step 102: obtain described the first network element and the link data that at least one second network element is connected, generate corresponding link data parameter;
Step 103: the second parameter that finds out the second physical port docking with described at least one first physical port in the second network element according to described link data parameter and described the first parameter;
Step 104: judge three layer interface B in whether corresponding the second network element of described the second physical port, if so, obtain the MAC Address of three layer interface B according to described the second parameter;
Step 105: described the first parameter is mated with described the second parameter, if the match is successful, create arp entry and preserve according to the IP address of the second network element and described MAC Address.
Adopt the method for the invention, compare with existing manual configuration, due to by the arp entry layoutprocedure of various three layer interfaces in webmaster is carried out to abstract modeling, then use the implementation of XML structure representation model in computer, by XML structure, by series of algorithms, automatically calculate the arp entry of three layer interfaces in webmaster, greatly improve user's allocative efficiency, stopped the probability that webmaster manual configuration is made mistakes, improved the ease for use of network management system.
The embodiment of step 101 can be:
First build XML structure, under the root node of described XML structure, comprise two nodes, respectively three layer interface information nodes and link data node, described three layer interface information nodes also comprise two child nodes, be respectively used to record described the first parameter and described the second parameter, described link data node is used for recording described link data parameter.
Building XML structure is specially: by the relation of various three layer interfaces and physical port in webmaster abstract be model as shown in Figure 2, and calculate according to this model construction the XML structure that function represents, the DTD(Document Type Definition of this XML structure, a kind of syntax rule about marker character) as shown in Figure 3.Described XML document contains two child nodes and is respectively l3interfaces(tri-layer interface information nodes) and topolinks(link data node), l3interfaces node comprises again nativel3interfaces node (local three layer interface information nodes, be used for recording the first parameter) and peerl3interfaces node (the other side's three layer interface information nodes, for recording the second parameter).
According to calculating interface name, obtain its bundling port, if bundling port is physical port, according to the DTD of Fig. 3 definition, creates l3interface node, and this node is added under nativel3interfaces node; If bundling port is logic port, find the member port of logic port binding, if this member port is physical port, according to the DTD of Fig. 3 definition, create l3interface node, and this node is added under nativel3interfaces node, if this member port is logic port, further search, until find physical port, and create l3interface node according to the DTD of Fig. 3 definition, and this node is added under nativel3interfaces node.
For the embodiment of obtaining the link data that described the first network element is connected with at least one second network element in step 102, be: from network management data storehouse, obtain described link data, judge that whether described link data is empty, if not empty, generates connection data parameter, if it is empty, process ends
In concrete applied environment, the method that realizes above-mentioned steps can be:
From network management data storehouse, obtain the TOPO link data that current first network element that need to calculate arp entry is connected with other network element, if the TOPO link data obtaining is not for empty, with these TOPO link datas, generate topolink node, and these nodes are added under topolinks node; If the TOPO link data obtaining, for empty, stops calculating.
In step 103, embodiment is: from described the first parameter, obtain the first port-mark of the first physical port, and from described link data parameter acquiring, form institute's link data two craft port comprise the second port-mark and the 3rd port-mark;
Described the first port-mark is mated with described the second port-mark and the 3rd port-mark, if described the first port-mark is identical with described the second port-mark, according to described the 3rd port-mark, create described the second parameter;
If described the first port-mark is identical with described the 3rd port-mark, according to described the second port-mark, create described the second parameter;
If described the first port-mark is not identical with described the 3rd port-mark with described the second port-mark, do not create described the second parameter.
In concrete applied environment, the method that realizes above-mentioned steps can be:
According to topolink nodal information (described link data parameter), search the phyport node (described the first port) under nativel3interfaces node (described local three layer interface information), the name property value of described phyport node (described the first port-mark), if equal the aport value (described the second port-mark) of current topolink node, creates new phyport node according to the value of zport (described the 3rd port-mark); If the name value of described phyport node equals the zport value of current topolink node, according to the value of aport, create new phyport node; If the name value of described phyport node had both been not equal to aport value and has also been not equal to zport value, do not create new phyport node.The phyport of described new establishment can be for creating described the second parameter.
In step 104, embodiment is: whether more described the first physical port is identical to the syndeton of described three layer interface B with described the second physical port to the syndeton of described three layer interface A, if identical, determine three layer interface B in corresponding the second network element of described the second physical port.
Described syndeton comprise described the first physical port to three layer interface A process port number and through the type of port.
In concrete applied environment, the method that realizes above-mentioned steps can be:
According to the phyport node of described new establishment, search this physical port whether exist with nativel3interfaces node under the father node of phyport node logic interfacing of the same type, if existed, the node of the father node same type of the phyport node under establishment and nativel3interfaces, successively create until find three layer interfaces that the second network element is corresponding, according to phyport node, newly create l3interface node (described the second parameter) and add under peerl3interfaces node.According to MAC Address computation rule, obtain the MAC Address of three layer interfaces of the second represented network element of each l3interface node under peerl3interfaces node (described the second parameter).
Embodiment in step 105 is: described the first parameter and the second parameter all comprise interface type, VLAN and IP address, described the first parameter is mated and is comprised with described the second parameter:
Judge that whether the interface type of described the first parameter is identical with the interface type of described the second parameter, if, judge that whether the VLAN of described the first parameter is identical with the VLAN of described the second parameter, if, judge that whether the IP address of described the first parameter and the IP address of described the second parameter are at the same network segment, if so, determine the first parameter and described the second parameter matching success.
In concrete applied environment, the method that realizes above-mentioned steps can be:
Through step 101, after step 103, obtain the XML document shown in Fig. 4, each l3interface node under circulation peerl3interfaces node (described the second parameter), judge whether its type, vlan property value equate, whether ip, mask attribute be at the same network segment, if type, vlan property value equate and ip, mask at the same network segment, according to the value of the name attribute of l3interface node under the value of ip, mac attribute and nativel3interfaces node, create arp entry message, and be saved in ArrayList.The arp entry at the arp entry in ArrayList and interface is merged, obtain needing the arp entry of configuration.
As shown in Figure 5, also provide the device of the address resolution protocol configuration under a kind of network management system according to the method embodiment of the present invention shown in Fig. 1, this device comprises:
The first parameter module 501, the member port comprising for the three layer interface A from the first network element is determined at least one first physical port, and described the first parameter corresponding at least one first physical port of record;
Link data module 502, for obtaining described the first network element and the link data that at least one second network element is connected, generates corresponding link data parameter;
The second parameter module 503, for finding out the second parameter of the second physical port that the second network element docks with described at least one first physical port according to described link data parameter and described the first parameter;
Parameter comparison module 504, for judging three layer interface B of whether corresponding the second network element of described the second physical port, if so, obtains the MAC Address of three layer interface B according to described the second parameter;
Port authorization module 505, for described the first parameter is mated with described the second parameter, if the match is successful, creates arp entry and preserves according to the IP address of the second network element and described MAC Address.
In addition, in order to make the device that the embodiment of the present invention provides can be applicable to all computer systems, this device also comprises:
Structure logging modle 506, be used for building XML structure, under the root node of described XML structure, comprise two nodes, respectively three layer interface information nodes and link data node, described three layer interface information nodes also comprise two child nodes, be respectively used to record described the first parameter and described the second parameter, described link data node is used for recording described link data parameter.
Concrete, described link data module 502 can be found out the annexation between the first network element and every other network element automatically, also for obtaining described link data from network management data storehouse, judge whether described link data is empty, if not empty, generate connection data parameter, if it is empty, process ends.
In concrete applied environment, the method that realizes above-mentioned module can be: from network management data storehouse, obtain the TOPO link data that current first network element that need to calculate arp entry is connected with other network element, if the TOPO link data obtaining is not for empty, with these TOPO link datas, generate topolink node, and these nodes are added under topolinks node; If the TOPO link data obtaining, for empty, stops calculating.
Concrete, described the second parameter module 503 can obtain the physical port information that the second network element is corresponding automatically, for find out described second parameter of the second physical port that the second network element docks with described at least one first physical port according to described link data parameter and described the first parameter, comprises:
From described the first parameter, obtain the first port-mark of the first physical port, and from described link data parameter acquiring, form institute's link data two craft port comprise the second port-mark and the 3rd port-mark;
Described the first port-mark is mated with described the second port-mark and the 3rd port-mark, if described the first port-mark is identical with described the second port-mark, according to described the 3rd port-mark, create described the second parameter;
If described the first port-mark is identical with described the 3rd port-mark, according to described the second port-mark, create described the second parameter;
If described the first port-mark is not identical with described the 3rd port-mark with described the second port-mark, do not create described the second parameter.
In concrete applied environment, the second parameter module 503 can find the second parameter in the following manner: according to topolink nodal information (described link data parameter), search the phyport node (described the first port) under nativel3interfaces node (described local physical port information), the name property value of described phyport node (described the first port-mark), if equal the aport value (described the second port-mark) of current topolink node, creates new phyport node according to the value of zport (described the 3rd port-mark); If the name value of described phyport node equals the zport value of current topolink node, according to the value of aport, create new phyport node; If the name value of described phyport node had both been not equal to aport value and has also been not equal to zport value, do not create new phyport node.The phyport of described new establishment can be for creating described the second parameter.
Concrete, whether described parameter comparison module 504 can automatic Verification the second network element be three layer interfaces, judges that three layer interface B in whether corresponding the second network element of described the second physical port comprise:
Whether more described the first physical port is identical to the syndeton of described three layer interface B with described the second physical port to the syndeton of described three layer interface A, if identical, determines three layer interface B in corresponding the second network element of described the second physical port.
In concrete applied environment, the implementation of above-mentioned module can be: according to the phyport node of described new establishment, search this physical port whether exist with nativel3interfaces node under the father node of phyport node logic interfacing of the same type, if existed, the node of the father node same type of the phyport node under establishment and nativel3interfaces, successively create until find three layer interfaces that the second network element is corresponding, according to phyport node, newly create l3interface node (described the second parameter) and add under peerl3interfaces node.According to MAC Address computation rule, obtain the MAC Address of three layer interfaces of the second represented network element of each l3interface node under peerl3interfaces node (described the second parameter).
Concrete, port authorization module 505 is mated described the first parameter and the second parameter to comprise:
Judge that whether the interface type of described the first parameter is identical with the interface type of described the second parameter, if, judge that whether the VLAN of described the first parameter is identical with the VLAN of described the second parameter, if, judge that whether the IP address of described the first parameter and the IP address of described the second parameter are at the same network segment, if so, determine the first parameter and described the second parameter matching success.
In concrete applied environment, the method that realizes above-mentioned module can be: after the first parameter module 501 to second parameter modules 503, obtain the XML document shown in Fig. 4, each l3interface node under circulation peerl3interfaces node (described the second parameter), judge its type, whether vlan property value equates, whether ip attribute is at the same network segment, if type, vlan property value equate and also ip at the same network segment, according to ip, the value of the name attribute of l3interface node under the value of mac attribute and nativel3interfaces node, create arp entry message, and be saved in ArrayList.The arp entry at the arp entry in ArrayList and interface is merged, obtain needing the arp entry of configuration
Adopt the method for the invention, compare with existing manual configuration, due to by the arp entry layoutprocedure of various three layer interfaces in webmaster is carried out to abstract modeling, then use the implementation of XML structure representation model in computer, by XML structure, by series of algorithms, automatically calculate the arp entry of three layer interfaces in webmaster, greatly improve user's allocative efficiency, stopped the probability that webmaster manual configuration is made mistakes, improved the ease for use of network management system.
Although described the preferred embodiments of the present invention, once those skilled in the art obtain the basic creative concept of cicada, can make other change and modification to these embodiment.So claims are intended to all changes and the modification that are interpreted as comprising preferred embodiment and fall into the scope of the invention.
Obviously, those skilled in the art can carry out various changes and modification and not depart from the spirit and scope of the present invention the present invention.Like this, if within of the present invention these are revised and modification belongs to the scope of the claims in the present invention and equivalent technologies thereof, the present invention is also intended to comprise these changes and modification interior.