Summary and instance application analysis of current number mainstream network simulation software
Written: Zhou Xiang
Abstract: Network simulation is a basic means of conducting network technology research. During the research of new technologies, due to various reasons, the implementation of the actual network system is often high or unrealistic. In this case, the simulation has become one of the best available tests, assessments, and verification. This paper briefly introduces and evaluates the current number of mainstream network simulation software, and the two mainstream network simulation software OPNets and NS2 use case-comparative analysis, and finally summarizes various network simulation software.
Keywords: network simulation network simulation modeling OPNET MODELER NS2
1 Introduction
Network simulation is also known as network simulation, because of various network simulation, there is also the meaning of "simulation", that is, network simulation can replace the real application environment to draw reliable operation results and data, or imitation Some behaviors and features in a system process. As the name suggests, network simulation is the use of computer programs to model the communication network, and the operation of the communication network is imitated through the program. So why do you want to communicate network simulation?
Today, the network researchers should constantly think about new network protocols and algorithms on the other hand, to develop forward-looking basic research for network development; on the other hand, it is necessary to study how to use and integrate existing resources, so that the network reaches the network The highest efficiency. Regardless of which aspect requires verification and analysis of the new network scheme. Studies on network technology generally have three ways:
(1) Analysis method is to conduct preliminary analysis of the objects and dependent network systems of the studies, according to certain limited conditions and reasonable hypothesis, describe the research object and system, abstract the mathematical analysis model of research objects, using mathematics The analysis model solves the problem (2) The experimental method is to design a reasonable hardware and software configuration environment that the research institute is designed, establishing test beds and laboratories, implementing research on network protocol, network behavior and network performance on real-world network. . (3) Simulation method, apply network simulation software to establish the simulation model of the network system studied, run this model on the computer, and analyze the output of the run.
However, there is a large limit in the first two methods. The effectiveness and accuracy of the analysis method are greatly limited. When a system is very complicated, the system cannot be described in detail in some restriction assumptions. The limitations of the experimental method are very high cost, reconfiguration or shared resources is difficult, and it is not flexible. The simulation method can greatly make up for the shortcomings of the first two methods. The simulation method can design the network model required to design, with relatively few times and cost to understand the various characteristics of the network under different conditions, and obtain the rich and effective data of network research. Network simulation has undoubtedly provides a convenient, efficient verification and analysis method, so network simulation technology is getting bigger and bigger.
2. Evaluation of several mainstream network simulation software
There are currently many excellent network simulation software, including OPNET, NS2, MATLAB, etc., which provides a good network simulation platform for network researchers. The mainstream network simulation software uses discrete event simulation technology, and provides a wealth of network simulation model libraries and advanced language programming interfaces, which undoubtedly improves the flexibility and convenience of simulation software. The various mainstream network simulation software will be briefly evaluated.
Opnet Modeler
Opnet Modeler is one of the four series of network simulation software products of OPNet Technology. Its mainly user-oriented users can meet the simulation needs of large complex networks. Opnet Modeler has the following features:
(1) Provide three layers modeling mechanisms, the bottom is the process model, and the protocol is described in the state machine; secondly, the Node model is composed of the corresponding protocol model, reflects the device characteristics; the top layer is a network model. Three-layer model and actual network, equipment, protocol levels completely correspond to the network-related characteristics; (2) provides a relatively complete basic model library, including: routers, switches, servers, clients, ATM devices , DSL equipment, ISDN devices, etc. At the same time, OpNet Technology will provide additional dedicated model libraries for different enterprise users, but it will be charged; (3) DISCRETE EVENT DRIVEN, compared to time driver, computational efficiency is large improve. (4) Adding a mixed modeling mechanism, combining the packet-based analysis method and statistical mathematical modeling method can be obtained from very detailed simulation results, which greatly improves simulation efficiency. (5) OPNet has a wealth of statistic collection and analysis functions. It can directly collect the performance statistical parameters of the common network levels, which can easily prepare and output simulation reports. (6) Provide an interface with a network management system, a traffic monitoring system, which can easily establish an emulation model using existing topologies and flow data, while also verifying the simulation results. NS2
NS2 (Network Simulator, Version 2) is an object-oriented network emulator, essentially a discrete event simulator. NS2 is developed by UC Berkeley. Itself has a virtual clock, all simulations are driven by discrete events. At present, NS2 can be used to simulate a variety of different IP networks, some simulations have been implemented: network transport protocols, such as TCP and UDP; business source traffic generators, such as FTP, Telnet, Web CBR, and VBR; routing queue management mechanism, For example, DROPTAI, RED and CBQ; routing algorithms, such as Dijkstra, etc. The NS2 also implements multicast and some MAC sub-protocols for the simulation of the LAN.
NS2 uses C and OTCL as a development language. NS can be said to be an OTCL script interpreter, which contains the simulation event scheduler, network component object library, and network building model libraries. The event scheduler calculates the simulation time, and activates the current event in the event queue, performs some relevant events, network components communicate with each other by passing the group, but this does not cost the simulation time. All network components that need to take simulation time to handle grouping must use event scheduler. It first issues an event for this group, and then wait for this event to be scheduled back to make the next processing work. Another use of an event scheduler is a timing. NS is written in OTCL and C . Due to efficiency, NS separates the implementation of data channels and control channels. To reduce the processing time of packets and events, the basic network components objects on the event scheduler and data channels are written and compiled, which are visible to the OTCL interpreter by mapping.
When the simulation is complete, the NS will generate one or more text-based tracking files. As long as you add some simple statements in the TCL script, these files will contain detailed tracking information. These data can be used for the next analysis process, and the entire simulation process can be displayed using NAM.
Matlab
MATLAB software is a scientific computing system environment for numerical calculations and graphics processing by MathWorks, USA. MATLAB is an abbreviation for English Matrix Laboratory (Matrix Lab). In the MATLAB environment, users integrate programming, numerical computing, graphical drawing, input and output, file management, etc. MATLAB provides a math system environment for human-computer interaction. The basic data structure of the system is a matrix. When generating a rectangular interim, it does not require a clear dimension description. MATLAB can save a lot of programming time compared to program design that makes numerical values calculated by the C language or Fortran language. The MTALAB system consists of five main parts: (1) Matalb language system. MATLAB is a high-level matrix / array language. With conditional control, function call, data structure, input and output, object-oriented, and other program language characteristics. Using it can make a small scale, complete the basic task of the algorithm design, and algorithm experiment, or large-scale programming, develop complex applications. (2) MATLAB working environment includes the ways and methods of management of variables in the work space, as well as various tools for development, commissioning, and managing M files. (3) Graphic image system. This is the basis of the MATLAB graphics system, including completion of the high-level MATLAB commands such as 2D and 3D data illustrations, image processing, animation generation, graphic display, etc., including low-level MATLAB commands such as characteristic control of graphics images, and development Various tools for the GUI application. (4) Matlab mathematics library. This is the general name of various mathematical algorithms used by MATLAB. Including algorithms of various primary functions, including matrix operation, matrix analysis, etc. High-level mathematical algorithm, etc. (5) MATLAB application interface. This is MATLAB to provide users with a library that allows users to use C programs or Fortran programs in the MATLAB environment, including calls from Matlab, read and write MAT files.
It can be seen that MATLAB is a very powerful system that sets numerical calculations, graphics management, and program development. In addition, Matlab also has a strong functional extension ability, with its main system, can be equipped with a wide variety of toolboxs to complete some specific tasks.
Cassap
Cassap is the US Synopsys (Xinsi Technology) company developed a simulation software mainly applied to digital signal processing and network communication. It can simulate three levels of concept, architecture, algorithm. Cassap uses a data stream-driven emulator that increases 8-16 times higher than the clock cycle. Cassap provides more than 1,000 high-level modules, and can automatically generate behavior or RTL-level VHDLs in the required modules, and can also generate a variety of DSP code for DSP processors for software implementation. CASSAP can be widely used in analyzing and evaluating algorithms, digital transmission systems such as communication, images, multimedia, etc., and provides special development platforms for GSM, CDMA, DECT and other standards.
SPW
SPW simulation software is Cadence's product, which provides an ideal environment for modular design, simulation and implementation of electronic systems, is an ideal environment for algorithm development, filter design, C code generation, hard / software structure joint design, and hardware synthesis . A SPW has a significant feature that he provides an HDS interface and a MATLAB interface. Many models in matlab can be transferred directly into the SPW, then generate C-language simulation code or HDL language simulation code using HDS. SPW is usually applicable to wireless and wired carrier communication, multimedia and network design and analysis.
3. Example analysis
The last section briefly introduced 5 network simulation software, which is more commonly used in OpNet Modeler and NS2, most universities and research units use these two tools to conduct network research and design analysis. This section will showcase the characteristics of these two network simulation software through an example, and compare the two software. In this example, we use the network's topology as shown in Figure 1, there are 5 nodes in the figure, where 0, 1, 2 nodes are transmitting nodes, and the 4 node is the receiving node. Below is a simulation process using OPNet Modeler and NS2.
Figure 1: Topological structure of the simulation network
3.1 Network simulation using NS2
In this section, the author will simulate the network in FIG. 1 using NS2. The first step in using the NS2 for network simulation is to write an OTCL script. In the OTCL script file (Example_ns2.tcl), the author first defines 5 nodes and connects 4 of these 5 nodes:
# Define 5 nodes set n0 [$ ns node] set n2 [$ ns node] set n3 [$ ns node] set n4 [$ ns node] # Define 4 Side $ NS DUPLEX-LINK $ n3 1MB 100ms DROPTAIL $ NS DUPLEX-LINK $ N3 1MB 100MS DROPTAIL $ NS DUPLEX-LINK $ N2 $ N3 1MB 100MS DROPTAIL $ NS DUPLEX-LINK $ N3 $ N4 1MB 100MS DROPTAIL
To define the nodes N0, N1, N2 as the sending node, the Traffic Source is connected to nodes N0, N1, N2, we can define the following functions:
Proc attach-expoo-trafficient {node sink size burst idle rate} {# get an emulator instance set ns [simulator instance]
# Establish a connection node UDP object set source [new agent / udp] $ ns attach-agent $ node $ souck
Object # establish traffic source and provided traffic parameter set traffic [new Application / Traffic / Exponential] $ traffic set packetSize_ $ size $ traffic set burst_time_ $ burst $ traffic set idle_time_ $ idle $ traffic set rate_ $ rate $ traffic attach-agent $ Source
# Establish a sender and recipient's relationship $ ns Connect $ Source $ SINK RETURN $ Traffic}
The above function returns the handle of the source, so we can use the following statement to connect 3 transmission sources from N0, N1, N2:
SET SOURCE0 [ATTACH-Expoo-Traffic $ N0 $ SINK0 200 2S 1S 100K] set Source1 [attach-expoo-traffic $ N1 $ SINK1 200 2S 1S 200K] set source2 [attach-expoo-traffic $ n2 $ sink2 200 2s 1s 300K ]
From the above code we can see that the peak transmitting rate of each data transmission source is 100kbit / s, 200kbit / s and 300kbit / s, respectively. The following code is used to define the receiver (N4 associated with 3 SINK objects):
Set sink0 [new agent / lossmonitor] set sink1 [new agent / lossmonitor] set sink2 [new agent / lossmonitor] $ NS Attach-agent $ N4 $ sink1 $ ns attach-agent $ n4 $ n4 $ n4 $ n4 $ n4 $ n4 $ n4 $ ns attach-agent $ n4 $ n4 $ n4 $ n4 $ n4 $ ns attach-agent $ n4 $ n4 $ SINK2 At the same time, three files are defined to save each receiver (SINK) received data per second:
Set f0 [open out0.tr w] set f1 [open out1.tr w] set f2 [open out2.tr w]
In the script, the author defines a RECORD function to record the data interested in the network simulation:
PROC RECORD {} {Global Sink0 SINK1 SINK2 F0 F1 F2 # gets the simulator instance set ns [simulator instance] # Settings every 0.5 seconds will call this function once set time 0.5 # Record how many bytes are received by receiving nodes? SET BW0 [$ SINK0 SET BYTES_] SET BW1 [$ SINK1 SET BYTES_] SET BW2 [$ SINK2 SET BYTES_] # Get the current Time SET NOW [$ NS NOW] # 向 文件 带 带 (Mbit / s) Puts $ f0 "$ now * 8/1000000]" PUTS $ F1 "$ now [EXPR $ BW1 / $ TIME * 8/1000000]" Puts $ F2 "$ now [expr $ bw2 / $ Time * 8/1000000] "# Resets the byte received by the receiver to 0 $ sink0 set bytes_ 0 $ sink1 set bytes_ 0 $ sink2 set bytes_ 0 # Recall RECORD Function $ ns at [EXPR $ NOW $ TIME] "replad"}
At the end of the script, the author defines the Finish function to close the file and open the XGRAPH observation and operation:
Proc Finish {} {Global F0 F1 F2 # Close Output Files $ F0 Close $ F1 Close $ F2 # Call XGRAPH Display Network Simulation Curve EXEC XGRAPH OUT0.TR OUT1.TR OUT2.TR -GEOMETRY 800X400 & EXIT 0}
When the simulation network is running, we can set up the RECORD function at the beginning and start the sender to send data at 10 seconds after running, and stop sending data at 50 seconds after running, and finally call the Finish function to use XGRAPH to display the operation result ( Displays the data receiving speed of the receiving).
2 is a network simulation result displayed by XGRAPH. From the figure, it can be seen that the receiving rate curve of each data receiving end (notes the peak reception rate of the three data receiving ends is 100kbit / s, 200kbit / s and 300kbit / s) This is the same as the peak transmission rate previously defined in the script.
Figure 2: Simulation results of NS2 displayed with XGRAPH
3.2 Network simulation using opnet
In this section, the author will simulate the network shown in Figure 1 using OPNet Moderler 8.0. For the simple network structure shown in Figure 1, it is unnecessary to write a script in the OPNet Moderler. In most simulation experiments, the OPNet Moderler only allows users to complete through their interface. In the example of this section, the network topology is shown in FIG. 3 in the OPNET MODERLER. In the OPNet Moderler, the author used three Ethernet workstations (Ethernet_station_adv) to represent three data source nodes N0, N1, N1, N1, N2 in the network, using two switches (Ethernet4_Switch_adv) to represent network traffic transfer nodes N3 and N4, with Three Ethernet workstations (Ethernet_station_adv) to represent three data receivers SINK1, SINK2, and SINK3 in the network. The link to each node is 10Baset. Then, since the ratio of the output flow rate to be limited to N0, N1 and N2 is 1: 2: 3, the intervals of the transmit packets of N0, N1, and N2 can be set, respectively, respectively, respectively, index distribution of index from the mean having 6, 3, and 2, respectively. Finally, the network analog run time can be set to 1 hour (60 minutes), take 10,000 sample points, and the load (LOAD) statistical curve of each receiving end (SINK1, SINK2, and SINK3) can be obtained as shown in Figure 4.
Figure 3: Interface for simulating the network of Figure 1 using OPNet Moderler
As can be seen from Figure 4, the load curve density of SINK1, SINK2, and SINK3 increases, and the peak and mean of the load are also increased in turn. Through the simulation process of NS2 and OPNet Modeler, the output rate of each data source is approximately proportional to the data input rate of the receiving end in the case where the link service rate is sufficiently large.
Figure 4: Load curve for each SINK obtained using OPNet Modeler
3.3 Comparative Analysis
By comparing the operations and data observation results of NS2 and OPNet Modeler, we can analyze both software from both software functions and operational ease of use.
In terms of software function, the OPNet Modeler is completely detailed, which can be set in detail on the arrival time distribution of packets, packet length distribution, network node type, and link type, etc., and can be provided through network devices and application scenarios provided by different manufacturers. To design your own simulation environment, users can easily select the network topology in the library. The choice of NS2 is not as rich as OPNet Modeler, and can only establish logical network structures through script based on actual simulation, and the results of the viewing requires other software assistance.
In terms of operational ease of use, the superiority of OpNet Modeler is unquestionable because it can get more detailed and real simulation results with less operations. NS2 is to achieve network simulation by writing scripts and C code, and it is very difficult to establish complex network results in this way.
Of course, NS2 is free software, free, which is the biggest advantage compared to opnet, and as a user, it can be easily extended relatively easier to expand NS2.
4. Summary
This paper introduces the concept of network simulation and the technical characteristics and application scope of the concept of network simulation and the current network simulation software; and simulates the reader by simulating the same network structure in NS2 and OPNet Modeler. Provides the sensual understanding of the network simulation process. Network simulation provides a bridge that envisaged to implement, so it is an important part of a computer network design and analysis.
references