Summary of the invention
The objective of the invention is in order to solve the problem of the restriction can't carrying out of tested equipment in laboratory environment Validity Test, propose a kind of sofeware simulation method of new large number quipments webmaster performance, stability, ability to communicate and managerial ability.This method can be implemented in a large amount of emulator of structure on the computer, each emulator uses different authentic and valid IP address in this computer, can set up a communication that is equivalent to real equipment with network management system and be connected, have independently data transmit-receive passage.This sofeware simulation method is independent of network management system, need not carry out any modification to network management system itself.Adopt this method, can be under the situation of computer resource outside the occupying volume not, hundreds and thousands of emulators of independent emulation, for the network management system test provides the running environment that is equivalent to the engineering site large number quipments, the test of carrying out performance, stability, ability to communicate and the managerial ability of network management system for the tester provides directly effectively means of testing.
Method of on a computer large number quipments being carried out software emulation of the present invention may further comprise the steps:
The first step, extract the needed fundamental of description equipment, generate the specific descriptions information of all emulators according to fundamental; Described fundamental comprises IP address and two information of subnet mask of equipment at least;
Second step, starting device simulation software carry out simulation initialisation; Obtain the specific descriptions information of the emulator that remains; Create the emulator communication respectively and handle public module, emulator data processing public module and emulator data transmission public module;
Emulator communication in the 3rd step, the difference starting device simulation software is handled public module, emulator data processing public module and emulator data and is sent public module;
The establishment of above-mentioned each public module and start separate, no specific order.
The 4th step, set up all emulators and be connected, create and start the Data Receiving submodule of each emulator with the communication of network management system; The access arrangement simulation status receives and handles all emulator data.
In the first step of said method, described specific descriptions information both can be saved in the file, also can store in the database.
In second step of said method, after equipment simulation software is obtained the specific descriptions information of the emulator that remains, set up emulator and specifically describe the information index table.
Further may further comprise the steps in second step of said method: the IP address and the subnet mask of the emulator that all are selected are added in the computer of operational outfit simulation software; Or this step generates emulator specific descriptions information in the first step after, adopt manual mode to add one by one and finish.
In second step of said method, three steps, the emulator data send public module and independently exist, or its function is synthesized in emulator data processing public module.
In the 4th step of said method, its concrete operations step is as follows:
1, emulator communication processing public module is intercepted the connection request from network management system.
2, from connect socket information, extract the IP address of emulator.
3, specifically describe the specific descriptions information of obtaining corresponding emulator the information index table according to the IP address of extracting from emulator.
4, the validity and the legitimacy that connect are judged.
5, legal and valid webmaster connection request is received, and communication is connected socket descriptor add in the corresponding emulator specific descriptions information.
6, legal and valid webmaster connection request is received after, create and start this emulator Data Receiving submodule.
7, repeated for the 1st step to the 6th step, the communication of finishing all emulators connects, and the establishment and the startup of each emulator Data Receiving submodule.
Emulator communication processing public module, each emulator Data Receiving submodule, emulator data processing public module, emulator data send public module and have the characteristics of concurrent execution, the 1st step to the 6th step is in the process that circulation is carried out, emulator data processing public module, each emulator Data Receiving submodule, emulator data send public module and are in equally in the circulation execution, do not influence the execution of follow-up the 8th, 9 steps.
8, the emulator data that each emulator Data Receiving submodule receives are obtained in the circulation of emulator data processing public module, handle.
9, the emulator data send the public module circulation and obtain the emulator data to webmaster to be sent.The emulator communication that this module is obtained in the packet to be sent connects socket descriptor, sends the data to network management system.
Adopt method of on computers large number quipments being carried out software emulation provided by the invention, overcome and attempted to utilize a large amount of computers to simulate the resource consumption problem that individual equipment realizes that large number quipments emulation is faced respectively, also do not needed network management system is done any change simultaneously.In the method provided by the invention, each emulator exists with the communication of real equipment equivalence with network management system and is connected, has independently data transmit-receive passage, realized the emulation of large number quipments truly, for the test of network management system provides a kind of running environment that is equivalent to the engineering site large number quipments, the test of carrying out performance, stability, ability to communicate and the managerial ability of network management system for the tester provides directly effectively means of testing.
Embodiment
Be elaborated below with reference to accompanying drawings and in conjunction with a specific embodiment, so that purpose of the present invention, technical scheme and advantage are had more deep understanding.
Fig. 1 has provided network management system and equipment simulation software operates in same the schematic diagram in the computer.Under this pattern, the IP address of the emulator that remains and subnet mask are all added in this machine, and network management system can be divided into different subnets according to IP address range with these emulators and manage.
Fig. 2 has provided network management system and equipment simulation software and has operated in schematic diagram in the various computing machine respectively.Under this pattern, the IP address and the subnet mask of the emulator that remains are divided into groups, add to respectively in the computer (being computer 2) of operation simulation software, network management system is divided into different subnets with these emulators according to IP address range and manages.
Fig. 3 has provided network management system and equipment simulation software and has operated in another schematic diagram in the various computing machine respectively.Different with Fig. 2 is: under this pattern, simulation software runs in many computers, every several equipment of Computer Simulation.The IP address and the subnet mask of the emulator that remains are divided into some groups, add to respectively in the corresponding calculated machine (being that computer 2 is to computer M).
Fig. 4 has provided large number quipments software emulation principle schematic.Comprise public module and each emulator Data Receiving submodule such as emulator communication processing, emulator data processing, the transmission of emulator data.Wherein: the connection request that emulator communication processing module is responsible for intercepting network management system, in case listen to the connection of network management system, the legitimacy and the validity that at first judge to connect, if connect legal effectively, then create and start corresponding emulator Data Receiving submodule.After emulator Data Receiving submodule receives data, data are submitted to emulator data processing public module, after emulator data processing public module was handled, the data after will handling according to data category submitted to that the emulator data send public module or the communication layer is handled.The emulator data send public module and send the data to network management system, so circulate, and finish the software emulation of equipment.Whenever receive a legal and valid and connect, just start an emulator Data Receiving submodule, what emulators are arranged, just start what emulator Data Receiving submodules, thereby realize the purpose of large number quipments emulation.
Fig. 5 has provided a kind of embodiment, i.e. the software emulation schematic flow sheet of a large amount of SDH equipment.Its concrete implementation step is described as follows:
The first step, extract the needed fundamental of description equipment, generate the specific descriptions information of all emulators according to fundamental; The equipment fundamental comprises IP address and two information of subnet mask of equipment at least.
Step 301 extracts the needed fundamental of description equipment.
Describing the required fundamental of SDH equipment is requisite information of SDH equipment of the unique correct sign of equipment simulation software and network management system.In the present embodiment, the fundamental of describing SDH equipment comprises: device identification ID, device type, IP address of equipment and subnet mask.
Step 302 generates the specific descriptions information of all emulators according to fundamental.
The quantity for the treatment of emulation SDH equipment may be as few as one, hundreds and thousands of of as many as, and each treats that emulator specifically describes information for corresponding one group, specific descriptions information is specialized by the equipment fundamental and is obtained.Specific descriptions information both can be saved in the file, also can store in the database.
In the present embodiment, the specific descriptions information for the treatment of emulation SDH equipment is saved in the Excel file, the fundamental of the corresponding emulator of field in the Excel table: device identification ID, device type, IP address of equipment, subnet mask, each row is represented the specific descriptions information of an emulator in the table.
Emulation SDH device identification ID correctly distinguishes one of key element of each equipment as the SDH network management system, can be numeral, also may be specific coding, can independently use, and also may describe an equipment with information such as IP addresses.In all devices that a network management system is managed, emulation SDH equipment has the whole network unique identification.
Each emulation SDH equipment as with the entity of network management system communication, have unique IP address and subnet mask.
Device type is used to distinguish dissimilar equipment.
The specific descriptions information of all emulation SDH equipment can obtain by direct editor Excel file, also can directly derive from the configuration data of network management system.In the present embodiment, adopt and from network management system, directly derive the specific descriptions information that the form mode is obtained all emulation SDH equipment.
Second step, starting device simulation software carry out simulation initialisation; Obtain the specific descriptions information of the emulator that remains; Create the emulator communication respectively and handle public module, emulator data processing public module and emulator data transmission public module.
Step 303, the starting device simulation software carries out simulation initialisation.
Be used for the computer of emulation testing, the starting device simulation software enters the simulation initialisation state.
Step 304, equipment simulation software are obtained the specific descriptions information of the emulator that remains, and set up emulator and specifically describe the information index table.
In the present embodiment, it is Hash table that emulation SDH equipment specifically describes the information index table, with the IP address of equipment is index, stored in each node in the table with IP address corresponding emulation SDH equipment and specifically described information, and in the whole process that emulation SDH device data is handled, need some key characteristic data of preserving or transmitting, connect socket descriptor etc. as the communication of each emulation SDH equipment.IP address by emulator can find corresponding emulation SDH equipment specific descriptions information and key characteristic data fast in specifically describing the information index table.
Step 305 is created the emulator communication respectively and is handled public module, emulator data processing public module and emulator data transmission public module.
Wherein, the emulator data send public module and can independently exist, and also its function can be synthesized in emulator data processing public module; The establishment of each module is separate, no specific establishment order.
In the present embodiment, the emulator data send public module and exist as standalone module.
Step 306, the IP address and the subnet mask of the emulator that all are selected are added in the computer of operational outfit simulation software.
On the computer of operational outfit simulation software, select the suitable network adapter, the IP address and the subnet mask that are used to add emulation SDH equipment.Do not having the configures physical network interface card or do not inserting on the computer of physical network and carry out device emulation if desired, then Objunctive network adaptor or loopback adapter can be installed earlier, then the IP address and the subnet mask of emulator be added in Objunctive network adaptor or the loopback adapter.
The IP address of emulator and subnet mask can be added in one or more network adapter in same the computer, both can manually add, and also can adopt the software automatic batch to add.
Emulator communication in the 3rd step, the difference starting device simulation software is handled public module, emulator data processing public module and emulator data and is sent public module.
Step 307, public module is handled in the emulator communication in the starting device simulation software.
Step 308, the emulator data processing public module in the starting device simulation software.
Step 309 starts the emulator data and sends public module.
Step 307,308,309 is not activated sequence requirement in realization.In the present embodiment, start according to step 307,308,309 order.
The 4th step, set up all emulators and be connected, create and start the Data Receiving submodule of each emulator with the communication of network management system; The access arrangement simulation status receives and handles all emulator data.
Step 310, emulator communication processing public module is intercepted the connection request from network management system.
This module is responsible for intercepting all connections from network management system.
Step 311, the IP address of from connect socket information, extracting emulator.
After emulator communication processing public module whenever receives a connection request, at first from connect socket information, extract IP address to be connected, i.e. the IP address of emulation SDH equipment.
Step 312 is obtained corresponding equipment according to the IP address of extracting and is specifically described information from emulator specific descriptions information index table.
The emulator communication is handled public module after obtaining the IP address, specifically describes at emulation SDH equipment according to the IP address and finds corresponding specific descriptions information in the information index table.
Step 313 is judged the validity and the legitimacy that connect.To directly discard invalid or illegal connection.
The emulator communication is handled public module after the extraction of finishing emulation SDH equipment specific descriptions information, and the legitimacy and the validity that connect are judged.
In the present embodiment, whether whether whether the specific descriptions information of mainly judging this emulation SDH equipment exist, allow to insert, connect and exist or the like.
Step 314 is received legal and valid webmaster connection request, and communication is connected socket descriptor adds in the corresponding emulator specific descriptions information.
Legal and valid is connected, the emulator communication is handled public module and is received this connection request, the communication of this connection device is connected socket descriptor as one of emulation SDH equipment specific descriptions information, be saved in the specific descriptions information node corresponding in the emulation SDH equipment specifying information concordance list.
Step 315 after legal and valid webmaster connection request received, is created and is started this emulator Data Receiving submodule.
The emulator communication is handled public module after receiving an effective connection request, creates and start the Data Receiving submodule of this emulation SDH equipment immediately.The corresponding data of emulation SDH equipment receive submodule, receive what effectively connections just create and start what emulation SDH device datas reception submodule.
Step 316 repeated for the 310th step to the 315th step, and the communication of finishing all emulators connects, and the establishment and the startup of each emulator Data Receiving submodule.
Emulator communication processing public module, each emulator Data Receiving submodule, emulator data processing public module, emulator data send public module and have the characteristics of concurrent execution, the 310th step to the 315th step is in the process that circulation is carried out, do not influence the execution of follow-up each step, emulator data processing public module, each emulator Data Receiving submodule, emulator data send public module and are in equally in the circulation execution.
Step 317, the emulator data that each emulator Data Receiving submodule receives are obtained in the circulation of emulator data processing public module, handle.
Emulator data processing public module at first extracts the IP address of emulation SDH equipment after getting access to data, find the specific descriptions information of equipment in emulation SDH equipment specific descriptions information index table according to the IP address.Then data are carried out other processing.For the data that needs are replied, according to the data that emulation SDH equipment specifically describes information and receives, the structure response message is submitted to the emulator data and is sent public module.Submit to the data of application layer process for needs, then the data and the emulation SDH equipment specifying information that receive are submitted to the application layer correlation module in the lump.
Step 318, emulator data send the public module circulation and obtain the emulator data to webmaster to be sent.The emulator communication that this module is obtained in the packet to be sent connects socket descriptor, sends the data to network management system.
This module is obtained to be sent to behind the emulation SDH device data of webmaster, at first extract the IP address of emulator, specifically describe in the information index table at emulation SDH equipment according to the IP address then and find specific descriptions information, connect socket descriptor according to the communication in the specific descriptions information again, send the data to network management system.
The emulator data send the data transmission that public module is responsible for all emulators, in the present embodiment, exist as a standalone module.