The tool for mobility generation. Not necessary. SUMO is Simulation of Urban MObility.

    It can help you to build the mobility, then export it as NS2Mobility Trace File, and use NS2MobilityHelper to be used in NS3 code.

    See more, SUMO

    Here I talk a little about SUMO.

    Installation for Linuxmint (Mate)

    SUMO Official Source Code

    1. Download source code from official page.
    2. Install the packages SUMO needed.
      $ sudo apt-get install libgdal1i libgdal-dev g++ libxerces-c3.1 libxerces-c-dev libicu-dev libproj-dev libfox-1.6-dev libgl1-mesa-dev libglu1-mesa-dev python
    3. extract SUMO source code we downloaded at /usr/local/src/
    4. enter the directory you unzip, then build and install it.
      $ sudo ./configure --with-fox-includes=/usr/include/fox-1.6  --with-gdal-includes=/usr/include/gdal --with-proj-libraries=/usr  --with-gdal-libraries=/usr --with-proj-gdal
      $ sudo make && make install
    5. export the path of SUMO directory, make sure your path is right. Maybe you're not the same as mine.
      $ export SUMO_HOME=/usr/local/src/sumo-0.28.0/
    6. You can run SUMO gui if you install correctly.
      $ sumo-gui -c docs/tutorial/hello/data/hello.sumocfg

A Simple Demo - Using the SUMO generated file for NS3 to use.

Reference:SUMO demo

We want to use TraceExporter to convert the SUMO xml files to the NS2 tcl script, then use NS2MobilityHelper to load the script to apply in NS3.

  1. download the topology xml files for SUMO (There are 4 topology xml files)
  2. generate the example.net.xml file
    $ netconvert -n example.nod.xml -e example.edg.xml -o example.net.xml
  3. generate the example.rou.xml file
    $ duarouter -n example.net.xml -f flow.xml -o example.rou.xml
  4. generate netstate dump
    $ sumo -n example.net.xml -r example.rou.xml --netstate-dump netstate.xml
  5. generate the fcd-output for TraceExporter to use.
    $ sumo -c example-config.sumocfg --fcd-output example-for-ns2.xml
  6. export the NS2 Trace file (I use the name "ns2mobility.tcl"). Watch out your path of traceExporter.py. And keep the file of ns2mobility.tcl, this is the most important file during NS3 runtime. traceExporter usage
    $ python /usr/local/src/sumo-0.28.0/tools/traceExporter.py --fcd-input example-for-ns2.xml --ns2mobility-output ns2mobility.tcl
  7. run the ns2 trace file in the example code. Watch out your --traceFile path and --logFile path. I use the mobility example to demo. (The code is at the src/mobility/example/ns3-mobility-trace.cc)

    $ ./waf --run "ns2-mobility-trace --traceFile=/path/to/output/log/file/ns2mobility.tcl --nodeNum=150 --duration=90.0 --logFile=/path/to/output/log/file" --vis

    I turn on the pyviz for demo so you can see the nodes flow during NS3 code running.

    I'm not sure the meaning of all files, but I can guess from the meaning in literature (e.g., edg, nod, rou, flow and net etc.). In order to mislead you to a dillema, there are some clue here, and you need to find by yourself.

    SUMO is a really power mobility simulator. The process I did is offline usage, you can even use it online but I don't know how to do, but I can give you the keyword


results matching ""

    No results matching ""