My Wiki!

ns3 simulation

ns3 installation

  yum install gccxml
  sudo yum install qwt5-qt4.x86_64 qwt5-qt4-devel.x86_64
  sudo yum install libsqlite3x.x86_64 libsqlite3x-devel.x86_64
  sudo yum install libpcap-devel
  
  sudo yum install pygoocanvas python-kiwi graphviz-python
  sudo yum install graphviz-devel
  sudo yum install python-pip
  sudo easy_install pygraphviz
      
  cd
  mkdir workspace
  cd workspace
  hg clone http://code.nsnam.org/bake
  
  export BAKE_HOME=`pwd`/bake
  export PATH=$PATH:$BAKE_HOME
  export PYTHONPATH=$PYTHONPATH:$BAKE_HOME
  
  ./bake.py
  ./bake.py configure -e ns-3-allinone -e pybindgen-0.17.0.868 -e netanim-3.105
  # enable all modules
  ./bake.py configure -a
  ./bake.py check
  ./bake.py download
  ./build.py --enable-examples --enable-tests
  ./bake.py build
  ./bake.py show
  
  cd source/ns-3.20/
  ./waf -d optimized --enable-examples --enable-tests configure
  

Add module

  cd workspace
  bake.py -e openflow

Pyviz

Openflow

Project

  mkdir scratch/pjs1
  touch scratch/pjs1/pjs1_sim.cc
  

Run pjs1.cc simulation

  ./waf --run pjs1
  

Quickstart

/**
 * Scenarios: 100 nodes, multiple simultaneous flows, multi-hop ad hoc, routing,
 * and mobility
 *
 * QUICK INSTRUCTIONS:
 *
 * To optimize build: 
 * ./waf -d optimized configure
 * ./waf
 *
 * To compile:
 * ./waf --run multirate
 *
 * To compile with command line(useful for varying parameters):
 * ./waf --run "multirate --totalTime=0.3s --rateManager=ns3::MinstrelWifiManager"
 *
 * To turn on NS_LOG:
 * export NS_LOG=multirate=level_all
 * (can only view log if built with ./waf -d debug configure)
 *
 * To debug:
 * ./waf --shell
 * gdb ./build/debug/examples/wireless/multirate
 *
 * To view pcap files:
 * tcpdump -nn -tt -r filename.pcap
 *
 * To monitor the files:
 * tail -f filename.pcap
 *
 */

Debug

  ./waf --run td_lte_wifi --command-template="gdb --args %s "

lte wifi


Navigation