Efficient and extensible network simulation scene generation method
Technical Field
The invention belongs to the field of network simulation, and particularly relates to a method for generating an efficient and extensible network simulation scene.
Background
With the continuous development of information technology, the modern communication network structure is more and more complex, and the network scale is more and more huge. The network simulation technology is an important means of network design, and provides a convenient solution for network planning, protocol verification and real scene testing. In which, it is often an indispensable link in the actual development process to test and evaluate in advance through the design scheme of the network simulation software, so it is necessary to provide a highly efficient and flexible simulation system for the network designer.
At present, network simulation software is numerous, and NS2, NS 3, OPNET, NetSim, OMNeT + +, J-Sim, QualNet, Mininet and the like (comprising commercial software and open source software) are known. The OPNET is widely applied to business software, adopts an object-oriented three-layer modeling mechanism, and has strong protocol simulation capability, excellent visual interfaces and abundant equipment manufacturer product models; the NS2 is a powerful open source software, adopts a simulation component modeling mechanism of an Otcl split object, and is divided into a topology model, a protocol model and a flow model; qualnet and business version Exata thereof are oriented to TCP/IP protocol level for simulation, and have strong semi-physical simulation and multi-core parallel simulation capabilities; mininet simulates the most advanced network technologies currently, such as SDN. Generally, each network simulation software has a good simulation field, and designers usually need to flexibly select the network simulation software according to simulation requirements and equipment conditions.
Although the simulation software has various characteristics, the simulation software has obvious disadvantages: firstly, the operation is complex, the learning cost is high, and designers often face some inherent simulation difficulties, such as the development environment of the corresponding software which has to spend a lot of time learning in order to use a specific simulation function. On the other hand, solutions of core problems of simulation software for modeling network scenes are very different, for example, OPNET is mainly modeled by a graphical user interface, NS2 is modeled by using an Otcl script, Qualnet provides a graphical interface and supports modification of text files for modeling, and Mininet is directly modeled by using Python language programming. The designer needs to complete a lot of repetitive work for different simulation software to establish the same network scenario. More importantly, no matter the modeling is carried out by using a graphical interface or a text, a native scene modeling mechanism is quite complicated, network nodes, links and service flows need to be manually depicted one by one, the setting of a large number of node coordinates and network parameters is tedious and easy to be wrong, and the network simulation efficiency is severely restricted.
The researchers have proposed a series of improved strategies and function extensions for native modeling mechanisms of simulation software, Lihuijie and the like propose a method for implementing text modeling by using an External Model Access interface (EMA) for OPNET, which avoids the inefficiency of manual modeling of a graphical interface to a certain extent, Canonico and the like propose a method for generating simulation scripts for NS2 by using an Extensible Markup language (XM L) and an Extensible Stylesheet language converter (Extensible Stylesheet L anguage), which also relieves the burden of primary users on learning Otcl language to a certain extent, but the improved strategies are limited to specific simulation software and simple Network topology, and the Description of Model information still stays at the level of simple information record, which fails to fundamentally simplify the simulation script modeling mechanism, on the other hand, some optimized strategies for textual Description of Network topology, such as JoSofttext Description, and the like are proposed by XM and the Description of Network topology is not applied to the Network topology Description of Network topology through XML (XS, RDF.
In summary, because the information of the network simulation scenario has universality, but different network simulation software has different modeling mechanisms, and the native modeling mechanism has the problems of insufficient flexibility and low efficiency, it is necessary to apply the network description to the network simulation field in consideration of the universality and expansibility of the network description language, and provide a simulation scenario generation mechanism which uses interfaces uniformly, is widely applicable to various simulation software, and provides high semantic abstraction.
Disclosure of Invention
The invention aims to solve the technical problem of providing a high-efficiency and extensible network simulation scene generation method which can be effectively applied to various simulation software and remarkably improve the simulation efficiency and has strong compatibility.
In order to solve the technical problems, the technical scheme adopted by the invention is as follows:
a method for generating an efficient and extensible network simulation scene is characterized by comprising the following steps of:
firstly, establishing a simulation software information base: storing the network simulation scene model attribute, the simulation parameter and the support characteristic into a file or a database according to a uniform format;
secondly, constructing an XM L label knowledge base, wherein the construction process comprises the following steps:
(A1) constructing entity labels comprising subnets, nodes, interfaces, links, protocols and applications, wherein the contained attributes or sub labels are consistent with those in the step one, and alias names can be set to shield the difference of simulation software;
(A2) constructing abstract labels, including simple topology or layout labels, complex network labels and logic labels, and specifying input and output parameters and default values of the abstract labels, wherein the simple topology comprises star type, ring type, bus type, tree type, net type, honeycomb type and radial type, the complex network comprises a Waxman generation model, a Tiers generation model, a Transit-Stub generation model and a power-law generation model, and the logic labels comprise references, inclusion, inheritance, exclusion, repetition and variables;
thirdly, describing a network simulation scene by XM L texts, and separately describing a completely universal network topology and partially universal simulation parameters to improve the universality;
and fourthly, designing an XM L parser to convert the simulation scene described by the text into a simulation file of the specific simulation software.
As a limitation to step one in the method: in the first step, the network simulation scene model is divided into a subnet, a node, an interface, a link, a protocol and an application model, and the basic attribute, the optional attribute and the default value of the model are respectively stored according to the form of a triple of 'model, attribute and attribute value'; the subnet attributes comprise names, subnet numbers, subnet masks, containing nodes, center coordinates and ranges, the node attributes comprise names, coordinates, containing interfaces and operating protocols, the interface attributes comprise names and operating protocols, the link attributes comprise names, bandwidths, time delays, types, source objects and destination objects, and the protocol attributes comprise names, attribute names and attribute values. All of the above attributes have default values and only those parameters of interest to the user that need to be modified are recorded.
As a limitation to step three in the present invention: the third step comprises the following steps:
(B1) defining network element entities and connection relations by using entity labels and abstract labels, and improving description efficiency by combining the semantics of the abstract labels, wherein the network description can be sequentially described according to the sequence of subnet-node-interface-link-protocol-application, and the identifiers and the reference labels are used for carrying out forward and backward association, dynamic assignment is realized by using variable labels, and unnecessary parts in elements generated by the abstract labels are removed by using exclusion labels;
(B2) the attribute values of the interested network elements are modified by using the entity tags and the abstract tags, the description efficiency is improved by combining the semantics of the abstract tags, the corresponding attribute names can be set according to simulation software, and the differences of the simulation software can be shielded by using the attribute aliases.
As a limitation to step four in the present invention: the fourth step comprises the following steps:
(C1) representing and storing the entity label and the default attribute value thereof by a data structure in a triple or multi-tuple form comprising elements, attribute names and attribute values according to a label knowledge base;
(C2) expanding the semantic abstract labels into entity labels and attributes according to a label knowledge base;
(C3) and converting the entity label into the final simulation file content according to the target simulation software and the corresponding information base.
As a further limitation to step four in the present invention: in the step (C1), the entity label is represented by a Java class, and the public parent class thereof contains public attributes such as name, identification ID, alias, type, label, parent object and index path;
mapping to a Java class object if the current tag is an entity tag in the step (C2); if the current tag is a simple topological tag in the abstract tag, generating an output parameter according to the input parameter, indicating that some simulation software does not support coordinates and uses link delay to represent a spatial distance, and converting the coordinate distance divided by a distance corresponding to unit delay into specified delay; if the current label is a complex network label in the abstract label, generating a network node and a connection relation by using a corresponding complex network model according to the input parameters, and mapping to a Java class object; if the current label is a logic label in the abstract label, executing conversion according to the label type and the language specification;
in step (C3), the conversion relation needs to be queried and converted according to the entity label type and the target platform parameter, and if the parameter in the entity label uses an alias, the conversion relation needs to be replaced.
Due to the adoption of the technical scheme, compared with the prior art, the invention has the technical progress that:
the network simulation scene generation method provided by the invention can be used for constructing the widely applicable XM L label knowledge base, the information base of various simulation software platforms and the converter thereof, thereby effectively solving the problems of low efficiency, inextensibility and platform dependence of the traditional modeling mode, and being well suitable for emerging simulation environments and constructing efficient simulation platforms.
In conclusion, the invention has the advantages of simple realization, good effect and wide application prospect.
The invention is suitable for the common simulation software at present.
The present invention will be described in further detail with reference to specific examples.
Drawings
FIG. 1 is a flow chart of the present invention;
FIG. 2 is a topological structure diagram of a simulation scenario according to an embodiment of the present invention;
FIG. 3 is a flow chart of a conversion module according to an embodiment of the present invention.
Detailed Description
Method for generating efficient and extensible network simulation scene
The present invention is further described in detail below with reference to the accompanying drawings and embodiments, it is to be understood that the implementation examples described herein are only for illustrating and explaining the present invention, and are not to be construed as limiting the present invention.
The technical scheme adopted by the invention is shown in figure 1, and comprises the following steps:
firstly, establishing a simulation software information base, and storing network simulation scene model attributes, simulation parameters and support characteristics into a file or a database according to a uniform format.
The most popular simulation scenario modeling mode of the OPNET is to compile an XM L file describing network scenario parameters according to a certain rule, wherein the constraint rule is indicated by network.dtd under an installation directory, and the main compiling format is 'entity (including subnet, node, link, service flow and the like), parameter name (including parameter index path) and parameter value', so that the simulation software information base of the OPNET is established as much as possible according to the triple mode when the simulation software information base is constructed.
To maintain brevity and without loss of generality, the extracted software information is shown in the OPNET software information base of table 1, which does not contain public attributes such as name, identifier ID, alias, type, parent, index path, label, etc., and also omits default values, and insignificant attributes such as icon, color, etc. When constructing the information base, only important and frequently used parameters can be extracted initially, and the information base is gradually enlarged along with the increase of the demand.
TABLE 1
Because the OPNET uses a unique three-layer modeling mechanism, namely, nodes and links are associated to lower-layer objects through model attributes, namely, models with the product functions of network equipment manufacturers and custom models are made into model files for upper-layer objects to use, a user only needs to modify model parameters in the upper-layer objects. Thus, as shown in table 1, the OPNET software repository also needs to store parameters of interest in various models for querying.
Secondly, XM L label knowledge base construction, including entity label and abstract label construction, the concrete implementation includes the following substeps:
(A1) and constructing entity labels comprising sub-networks, nodes, interfaces, links, protocols, applications and the like, wherein the contained attributes or sub-labels are consistent with those in the step 1, and alias names can be set to shield the difference of the simulation software.
The Node here means a complete entity that can be considered as having independent functions, not necessarily a single host, router, etc., but a combination thereof, as long as such combination is defined in the software information base (the converter will be responsible for constructing the internal structure of the combination).
(A2) And constructing semantic abstract labels including simple topology or layout labels, complex network labels, logic labels and the like, and specifying input and output parameters and default values of the semantic abstract labels.
The abstract labels that this example builds on demand are shown in table 2.
TABLE 2
In order to improve generality, completely universal network topology and incompletely universal simulation parameters are separately described, and the method specifically comprises the following sub-steps:
(B1) defining network element entities and connection relations by using entity labels and abstract labels, and improving the description efficiency by combining the semantics of the abstract labels;
(B2) the attribute values of the interested network elements are modified by using the entity tags and the abstract tags, the description efficiency is improved by combining the semantics of the abstract tags, the corresponding attribute names can be set according to simulation software, and the differences of the simulation software can also be shielded by using the attribute aliases.
The topology used in the example is shown in FIG. 2, and refers to W L AN example engineering files under AN OPNET installation directory, a simulation scene comprises a single-layer radial (radial) switch and AN AP, wherein the center of the single-layer radial (radial) switch and the center of the AP is a switch, the AP on the upper left corner of the ring is removed, a ring (circle) host matrix taking the AP as the center, a ring (circle) moving track taking the current coordinate as a starting point and the center of the center switch as a circle center is formed by all hosts, and the multiple APs and the hosts can use base labels to quote templates and use var to realize automatic naming.
Designing an XM L parser to convert the simulation scene described by the text into a simulation file of specific simulation software, wherein the specific implementation comprises the following sub-steps:
(C1) representing and storing the entity labels and default attribute values thereof by using a proper data structure according to a label knowledge base;
(C2) expanding the semantic abstract labels into entity labels and attributes according to a label knowledge base;
(C3) and converting the entity label into the final simulation file content according to the target simulation software and the corresponding information base.
In the example, Java classes are used to represent entity tags such as subnets, nodes, links and the like, and public parent classes of the entity tags contain public attributes such as names, identification IDs, aliases, types, labels, parent objects, index paths and the like; the specific code is omitted.
In this example, step (C2) is implemented as shown in fig. 3, sequentially traversing XM L text labels describing the simulation scenario, and performing the following sub-steps according to the label type:
(C2.1) if the current tag is an entity tag, mapping to a Java class object;
(C2.2) if the current label is a simple topological label in the abstract label, generating an output parameter according to the input parameter;
and (C2.3) if the current label is the complex network label in the abstract label, generating a network node and a connection relation by using a corresponding complex network model (capable of quoting the existing model) according to the input parameters, and mapping the network node and the connection relation to the Java class object.
(C2.4) if the current label is a logic label in the abstract label, performing conversion according to the label type and the language specification, wherein the labels such as removal, reference, inheritance and the like are mainly used in the example.
In this example, it is necessary to map the sub-network, the nodes, and the links to generate Java class objects of corresponding quantities, and calculate the coordinates of each node according to a prescribed formula according to the coordinates of the central node, the number of peripheral elements, and the radial distance. The topology used in this example has a ring and radial structure, and the calculation formula thereof involves:
the coordinate calculation formula of the node i in the annular structure is as follows:
for example, in the present embodiment, there are n =6 APs on the ring structure, the starting coordinate (x1, y1) is AP _2 right above center _ breidge, and the coordinates of AP _3 following clockwise are calculated as follows:
the coordinate calculation formula of the ith node and the jth node of the ith layer of the node in the radial structure is as follows:
wherein r isiIs the length of the i-th layer node from the center point, i.e., (x)i1,yi1) And (3) representing the coordinates of the starting node of the ith layer, wherein the calculation formula is as follows:
in the example, the complex network tag is not included, but can be expanded according to needs, and a large amount of literature research and implementation algorithms exist in the generation method of the complex network, and the complex network tag can be merged into the framework of the patent.
It should be understood that parts of the specification not set forth in detail are well within the prior art.
It should be understood that the above description of the preferred embodiments is given for clarity and not for any purpose of limitation, and that various changes, substitutions and alterations can be made herein without departing from the spirit and scope of the invention as defined by the appended claims.