Friday, January 6, 2017

Visualize ns-3 network using PyViz

The steps below can be use to enable the PyViz visualizer for ns-3 python binding. For C++ code, you could follow the steps in the referenced post.

  1. Install prerequisites

    sudo apt-get install python-dev python-pygraphviz python-kiwi python-pygoocanvas python-gnome2 python-gnomedesktop python-rsvg
  2. Change your python code

    import ns.visualizer
    [...]
    cmd = ns.core.CommandLine()
    cmd.Parse(sys.argv)
    [...]
    ns.core.Simulator.Run()
  3. Run your script with command line argument

    your_script.py --SimulatorImplementationType=ns3::VisualSimulatorImpl

    or

    ./waf --pyrun your_script.py --vis



Reference: PyViz

No comments:

Post a Comment