CHAPTER 5 Simulation Tools 5.1 Introduction A simulation of a system is the operation of a model of the system. The model can be reconfigured and experimented with, usually this is impossible and too expensive or impractical [86] to do in the system itself. The operation of the model can be studied, and hence, properties concerning the behavior of the actual system or its subsystem can be inferred. For example, we may focus on the performance and the validity of the network and present the result before applying these features on the real system. Moreover, networking technologies reduce the time and the cost of using the natural system. Vehicular Ad-hoc Networks (VANETs) are form when vehicles are equipped with devices capable of short-range wireless communication. Accurate simulation of VANETs is a challenging task, requiring both a vehicle mobility model and a network simulation. It is required to use the following two separate simulators in order to analyze and define the routings in VANETs. Traffic Simulator (used for mobility model). Network Simulator (used for network simulation). Both simulators should be jointly used with powerful feedback between them to provide the simulation results as accurate as real life. This section also presents various possibilities for installation and working process of both the simulators. 67
5.2 Traffic Simulator Traffic simulation is the mathematical modeling transportation systems like freeway junctions, major routes, roundabouts, downtown grid systems etc. It helps the computer application software to better plan, design and operates transportation systems. Traffic simulation models are useful from a microscopic, macroscopic and sometimes mesoscopic perspectives. There are many traffic simulators available for the research work such as CanuMobiSim, VanetMobiSim, SUMO/MOVE, TraNs, NCTUns. Among these VanetMobiSim have the strongest strength, because it supports macro mobility and micro mobility model. VanetMobiSim is an extension for the CanuMobiSim, a flexible framework for traffic simulation. 5.2.1 CanuMobiSim CANU (Communication in Ad-hoc Networks for Ubiquitous Computing) [87] mobility simulator is a java-based application with a graphical user interface (GUI). The CanuMobiSim project was started in Germany at the University of Stuttgart [88]. This tool can generate many mobility models like smooth mobility model, pedestrian, graph walk, fluid traffic, activity based mobility models. The patterns drawn by CanuMobiSim are not self-generated but in fact are derived from Markov Graph. CanuMobiSim lacks the ability to generate random graphs and does not include obstacles in the simulation of wireless networks. 68
5.2.2 VanetMobiSim VanetMobiSim (Vehicular Ad-hoc Network Mobility Simulator) [17] is an extension to CanuMobiSim. The scope of CanuMobiSim is limited to some specific areas only; it was unable to produce high levels of details in specific scenarios. Therefore CanuMobiSim was expanded to achieve a high level of realism in the form of VanetMobiSim. Modeling of VanetMobiSim includes car-to-car and car-to-infrastructure relationship. Thus it combines the stop signs, traffic lights and activity based macromobility with the support of human mobility dynamics. It can extract road topologies from TIGER, GDF, random and custom topologies. It allows users to generate trips based on their own assumptions or activity based and can configure the path between the start and end position on the basis of the Dijkstra algorithm, road-speed shortest or densityspeed shortest. VanetMobiSim contains a parser to extract topologies from GDF, TIGER or cluster Voronoi graphs that will be used by network simulators. The Vehicular Ad-hoc Network Mobility Simulator (VanetMobiSim) is a set of extensions to CanuMobiSim, a framework for user mobility modeling used by the CANU [89]. The framework includes a number of mobility models, as well as parsers for geographic data sources in various formats, and a visualization module. The framework is based on the concept of pluggable modules so that it is easily extensible. The set of extensions provided by VanetMobiSim consists mainly of two models. They are as follows: 69
A vehicular spatial model is made up of spatial elements like traffic lights or multi-lane roads, their attributes and the relationships linking these spatial elements in order to describe vehicular areas. This model is created in four different ways: User-defined graph The user defines a set of vertices and edges composing the backbone of the vehicular spatial model. Geographic Data Files (GDF) The backbone data is obtained from GDF files. TIGER/Line Files It is similar to previous one, but based on the TIGER/line files from the US Census Bureau [90]. Random The backbone is randomly generated using the Voronoi tessellations. In chapter 3, these ways have been described in detailed. Any one of these methods MUST be loaded AFTER the Spatial Model, as it controls all data describing the topology. Then, it adds vehicular specific spatial elements such as multi-lane and multiflow roads, stop signs and traffic lights. There are two vehicular-oriented mobility models, which are in support of a microscopic level mobility models: Intelligent Driving Model with Intersection Management (IDM_IM), describing perfectly Car - to- Car and intersection managements. Intelligent Driving Model with Lane Changing (IDM_LC), an overtaking model is also included, which interacts with IDM_IM to manage lanes changes and vehicle accelerations and decelerations. 70
VanetMobiSim offers so many possibilities and features to create realistic scenarios. Besides that, simulation scenarios for VanetMobiSim are defined in XML format using tags, making scenario configuration easier and in a more handy way. Definitely, VanetMobiSim is quite more appropriate in order to generate scenarios for VANETs than other MANETs mobility pattern generators such as CityMob [91] and Bonnmotion [92]. The Appendix A shows the installation process of VanetMobiSim 1.1, Java Development Kit and Apache Ant 1.7. 5.3 Network Simulator Network simulation is a technique where a program models the behavior of a network either by calculating the interaction between the different network entities like hosts or routers, data links, packets etc. using mathematical formulas or actually capturing and playing back observations from a production network. The Appendix B shows the installation process of NS-2.34 and AWK. The Network Simulator 2 (known as NS-2) is a discrete event network simulator targeted at networking research. NS provides a packet level simulation over a lot of protocols, supporting several transport protocols, several forms of multicast, wired networking, several ad-hoc routing protocols and propagation models, data broadcasting, satellite and so on [93]. It also has the possibility of using mobile nodes. The mobility of these nodes may be specified either directly in the simulation file or by using a mobility trace file. In this research work, the trace file is generated by VanetMobiSim. Network Simulator began as a variant of the REAL network simulator in 1989 and has evolved 71
substantially over the past few years. In 1995 Network Simulator development was supported by DARPA through the VINT [94], a collaborative project at LBNL (Lawrence Berkeley National Laboratory), Xerox PARC (Xerox Palo Alto Research Center), UCB (University of California, Berkeley), and USC/ISINS (University of Southern California s Information Sciences Institute). Network Simulator was built using the C++ programming language and provides a simulation interface through OTcl, It has an object-oriented dialect of Tcl (Tool Command Language). The user describes a network topology by writing OTcl scripts, and then the main Network Simulator program simulates that topology with specified parameters. Moreover, NS2 is easily extensible since the simulation kernel source code is available, which implements new routing protocols; propagation models etc, and use them in our simulations. 5.4 Languages and Files Used research work: The following languages and files have been used in the simulation process of this 5.4.1 XML and Trace File According to the research methodology, simulators are different at the microscopic level and this is main criteria for selecting a vehicular mobility simulation. The input to VanetMobiSim is an XML configuration file. The VanetMobiSim page have explained in [Appendix C], how to define vehicular mobility model in VanetMobiSim. 72
A realistic vehicular movement pattern, it is necessary to define in xml file the attributes like velocity of the vehicles, traffic light, number of lanes, trip motion, and road topology etc. After defining a mobility scenario in an xml file, launching the VanetMobiSim framework is necessary in order to produce a node mobility trace file in ns-2 format. The output of xml file at simulation time is 59.586 seconds and trace file examples are shown in figures 5.1 and 5.2. Figure 5.1 XML File Output through VanetMobiSim Figure 5.2 Trace File in NS-2 Format through VanetMobiSim 73
5.4.2 TCL Language Tool Command Language (TCL) [95] is an interpreted script language developed by Dr. John Ousterhout at the University of California, Berkeley. The file is the scripting representation for coding and developing the desired networking scenarios, or vehicular ad-hoc network flow on the road is scripted for generating and associating relevant file. These scenarios are based on various parameters and their settings of generated traffics along with their mobility, reliability and likewise constraints as discussed in last chapter. Initializing the on-demand routing protocol within a TCL file as inputs in association of particular traffic and movement files, the NS-2 simulates accordingly. Finally, as a result, it generates two files i.e. Trace files (*.tr) as the outputs and Network Animator File (*.nam). 5.4.3 AWL Language The AWK utility is a data extraction and reporting tool that uses a data-driven scripting language for the purpose of producing formatted reports. In other words, AWK is an excellent filter and files of text processor. It was created at Bell Labs in 1970s, and its name is derived from the family names of its authors Alfred Aho, Peter Weinberger and Brian Kernighan. A file is treated as a sequence of records, and by default each line is a record. Each line is broken up into a sequence of fields, so we can think of the first word in a line as the first field, the second word as the second field, and so on. AWK reads the input a 74
line at a time. Then a line is scanned for each pattern in the program, and for each pattern that matches, the associated action is executed. AWK is easier to use than most conventional programming languages. It can be considered to be a pseudo C interpreter, as it understands the same arithmetic operators as C. AWK also has string manipulation functions, so it can search for particular strings and modify the output. To use a library function in a file from a program typed in on the command line [96], specify by the syntax awk [options] -f source-file 5.4.4 Trace and NAM File The trace file contains all of the data e.g. how many packets are sent, received, dropped and with what sequence number, type, packet size etc. The trace file is simply available in a text format and could be called as a log file of the simulation with all the information logged in columns format in figure 5.3. Figure 5.3 Trace File of AODV The NAM file consists of all the operations to be performed at the time of simulation with all the positioning and graphical information and their defined parameters. 75
Figure 5.4 NAM File Output This NAM file then can be called or executed by its built-in nam command from the operation component of NS itself. The output example of this file is shown in figure 5.4. 76