NetSim map view supports OpenStreetMaps which provides free editable maps of the world. Road traffic conditions can be modeled conveniently in Simulation of Urban Mobility(SUMO) which is an Open Source traffic simulation software.
Steps for setting up SUMO:
1. Download the open street map file (.osm) for the region over which you prefer to perform VANET simulations. Use the link https://www.openstreetmap.org/export for this purpose. Use the search text box to search for specific locations in map and use the Export button to download the map.osm file.
2. Create a new folder and place map.osm file in it.
3. Open command prompt and change directory to SUMO binary folder (<SUMO_HOME>\bin)
4. Using netconvert utility in SUMO convert the map.osm file to an equivalent map.net.xml network file using the command:
netconvert --osm-files map.osm -o map.net.xml
5. On successful execution of the command map.net.xml file will get created in the output directory specified.
6. To interpret the OSM-data an additional typemap-file is required. The sample file osmPolyconvert.typ.xml which is present in "<SUMO_HOME>\data\typemap" can be reused for this purpose. Copy osmPolyconvert.typ.xml to the output directory containing map.net.xml and map.osm files.
7. Using the typemap file typemap.xml import polygons from OSM-data to produce a Sumo-polygon file with the POLYCONVERT utility. Use the following command:
polyconvert --net-file map.net.xml --osm-files map.osm --type-file typemap.xml -o map.poly.xml
8. On successful execution of the above command a map.poly.xml file will get created in the output directory.
9. Now for the network that we have created, random trips can be easily generated using randomtrips.py that is available in "<SUMO_HOME>/tools" directory. Use the followiing command to generate random trips for 10 vehicles.
randomTrips.py -r map.rou.xml -n map.net.xml -e 10
For executing the command change directory to "<SUMO_HOME>/tools".
10. Upon successful execution of the command map.rou.alt.xml and map.rou.xml files will get created in the output directory.
11. In the map.rou.xml file contains the vehicle definitions, the id and the routes the vehicles will take. The vehicle id's are by default numbers which start from 0.
12. Rename vehicle names to avoid conflict with NetSim. Vehicle names can be renamed to V1, V2, V3 etc preferably so that the same names can be assigned to the devices in NetSim.
13. To configure SUMO for better visualization of the network that we have modeled, create a SUMO GUI settings file file.settings.xml. Here user can specify the zoom level, the X and Y coordinate to be centered while opening the network, the delay etc. Set your prefered x, y, zoom and delay values and save. Place the file in the same directory along with the previously generated files.
14. Create a SUMO configuration file (sumo.cfg) which is required to load the network in SUMO-GUI. This file contains the path of the other files related to the network. Place the file in the same directory along with the previously generated files.
15. The map.sumo.cfg file can be used to load the road traffic network that we have created, in SUMO-GUI.
Steps for setting up NetSim:
VANET Simulations over map view can be performed easily in the Single MANET module in NetSim v10.2 with a few customization done in the back-end files. Configuration.xsd file and Property.xml file are attached with this article.
1. Download attachments in this article.
2. Rename Configuration.xsd in the <NetSim_Installation_Directory>/bin folder of NetSim and place the downloaded Configuration.xsd file there.
3. Rename the Property.xml file present in <NetSim_Installation_Directory>/Docs/xml folder and place the downloaded Property.xml.
4. Open NetSim Single MANET module in NetSim.
5. Click on Environment Settings button and set the Simulation Environment to Map View
Note: Internet connectivity is required for working with NetSim Map View. Also if you are getting any error while attempting to load OpenStreetMaps in NetSim UI please refer the article: https://tetcos.freshdesk.com/solution/articles/14000086564--error-connecting-to-the-internet-opening-in-grid-view-netsim-v10-2
6. Decide the location on the map were you want to place the devices, using Zoom In and Zoom Out options. You can either use the buttons available in the GUI or use Mouse Scroll achieve Zoom.
7. Place the devices in the GUI as per the number of vehicles you have configured in SUMO. The devices can be placed in the GUI randomly, since initial positions and movement will be as per the device placement and routes taken, in SUMO.
8. Device icons can be changed optionally to make it more realistic. To change icons right click on any device and select Change Icon. NetSim supports any jpe, jpeg or png images as icons.
9. Right click on any device and select properties. In the Under General Properties set the Mobility_Model as SUMO. Set the path of SUMO Configuration (sumo.cfg) file along with the file name in the Sumo File text box. In the Device_Name text box enter the vehicle name as per the vehicle id configured in the sumo routes file (rou.xml) file. Do this for all devices that were dropped.
10. Go to the Interface1_WIRELESS in the device properties and set the DATALINK_LAYER and PHYSICAL_LAYER protocol to IEEE1609 from the Protocol drop down list.
11. Click and drop application icon and select properties after right clicking on it.
12. Configure traffic between the vehicles as per your requirement.
13. Enable advanced features - Packet Trace, Event Trace and Dynamic Metrics optionally.
14. Click on Run Simulation button. It is preferable to specify the simulation time less than or equal to the end time specified in sumo configuration (sumo.cfg) file.
15. As simulation starts SUMO interface(Vanet.exe) command line will be initialized in parallel and will be displaying the step calculations done in SUMO during runtime. SUMO interface window will be terminated before simulation in NetSim is over, since SUMO takes care of road traffic conditions whereas NetSim takes care of the Network Communication and instantiates the TCP/IP stack for each device taking part in the simulation.
16. At the end of the simulation NetSim will provide a detailed performance metrics along with packet trace, event trace, link and application throughput plots based on the user configuration done. NetSim animation window which appears at the end of the simulation can be ignored and closed.
17. To visualize vehicular movement during runtime, run the simulation with Play & record animation option selected. NetSim animation window which appears at the start of the simulation can be ignored and closed.
18. Now in addition to the SUMO Interfacing console, SUMO-GUI will be loaded in parallel. Vehicular movement can be visualized here by configuring the coloring schemes for better visibility. The following window can be obtained by clicking on the colored palette just before the camera icon. Under vehicles, set Show As to 'simple shapes' and set Exaggerate by to 20 or any other value as per your preference and click on Use button.
19. You will now start seeing vehicle movement in SUMO-GUI as per the number of vehicles, departure time and routes configured in the routes (rou.xml)file. You can zoom in and out and move the map regions to visualize it better.
20. Once simulation ends in NetSim, SUMO GUI termination command will be initiated, which will stop the animation in SUMO. NetSim animation window which appears at the end of the simulation can be ignored and closed.
For further reference and documentation related to SUMO visit: http://sumo.sourceforge.net/userdoc/