DCE Cradle Use-case 3

This tutorial document describes what DCE Cradle is, how we can use it, how we extend it.

Team:

Hajime Tazaki, Frederic Urbani, Thierry Turletti

Key Result(s):

DCE Cradle does not add much overhead in terms of scaling the duration of simulation time compared to Network Simulation Cradle and ns-3 native stack.

Source(s):

The paper describing this text was submitted to Workshop on ns-3 2013 (under review).

Contacts:

Hajime Tazaki (tazaki at nict.go.jp)

Introduction:

DCE Cradle allows us to use ns-3 native application with Linux kerne as a network stack. The key question is: how different/similar DCE Cradle behaves ? This tutorial tries to answer this question with showing the performance of actual simulation time.

Methods:

We need to prepare the following simulation codes to conduct the experiment.

  • ns-3-dev
  • ns-3-dce
  • ns-3-linux
  • Network Simulation Cradle (NSC)
  • DCE Cradle patch

Results:

_images/sim-time-duration.png

Instructions to Replicate This Experiment:

  1. Experiment on ns-3

    1. Setup ns-3-dce

      % mkdir dce-cradle-test
      % cd dce-cradle-test
      % hg clone -r 327 http://code.nsnam.org/furbani/ns-3-dce
      % ./utils/clone_and_compile_ns3_dce.sh
      

      for more information, see the DCE documentation.

    2. patch DCE Cradle extension

      % cd dce-cradle-test
      % wget https://codereview.appspot.com/download/issue6856090_7001.diff
      % cd ns-3-dce
      % patch -p1 < ../issue6856090_7001.diff
      % ./waf
      % ./waf install
      
    3. prepare Network Simulation Cradle

      % cd dce-cradle-test
      % wget http://research.wand.net.nz/software/nsc/nsc-0.5.3.tar.bz2
      % tar xfj nsc-0.5.3.tar.bz2
      % mv nsc-0.5.3 nsc
      % cd nsc
      % ./scons.py
      % cp lib/liblinux2.6.26.so ../build/lib/
      % cd ..
      % cd ns-3-dev
      % /waf configure --prefix=`pwd`/../build --with-nsc=../nsc
      % ./waf
      % ./waf install
      
    4. run a script

       1
       2
       3
       4
       5
       6
       7
       8
       9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      22
      #!/bin/sh
      OUTPUT="output/`date \"+%y%m%d_%H%M\"`"
      mkdir -p ${OUTPUT}
      TRIAL="`seq 1 100`"
      TRIAL_TIME="`seq 1 5`"
      NODES="`seq 1 2 100`"
      DURATIONS="`seq 10 10 400`"
      STACKS="dce dce-linux3 ns3 nsc-linux dce-dccp dce-dccp3"
      PCAP=""
      
      for stack in $STACKS
      do
      for trial in $TRIAL_TIME
      do
      for duration in $DURATIONS
      do
      echo -n "$stack $duration $trial " >>$OUTPUT/sim-time-duration.txt
      NS_ATTRIBUTE_DEFAULT='ns3::TaskManager::FiberManagerType=UcontextFiberManager' /usr/bin/time -p ./build/bin/dce-runner ./build/bin/dce-tcp-ns3-nsc-comparison --stack=$stack --stopTime=$duration --seed=$trial 2>&1 | grep real | awk '{print $2}' >> ${OUTPUT}/sim-time-duration.txt
      done
      done
      
      done
      
  2. Plot the results of above experiment

    1. run a script

      You can gather the text outputs from the above experiments and plot the figure with gnuplot.

       1
       2
       3
       4
       5
       6
       7
       8
       9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      22
      23
      24
      25
      26
      27
      28
      29
      30
      31
      32
      33
      34
      35
      36
      37
      38
      39
      40
      41
      42
      43
      #!/bin/bash
      
      #set -x
      OUTPUT=$1
      
      mkdir -p ${OUTPUT}
      
      TRIAL="`seq 1 100`"
      STACKS="dce dce-linux3 ns3 nsc-linux"
      
      # for Duration - RealTime
      rm -f ${OUTPUT}/sim-time-duration*.dat
      for stack in $STACKS
      do
      cat ${OUTPUT}/sim-time-duration.txt | grep "$stack " | dbcoldefine stack duration trial time | dbmultistats -k duration time |dbsort -n duration | dbcol duration mean stddev >> ${OUTPUT}/sim-time-duration-$stack.dat
      done
      
      gnuplot  << EndGNUPLOT
      set ylabel "Actual Time (s)"
      set xlabel "Simulation Time (s)"
      set terminal postscript eps lw 3 "Helvetica" 24
      set output "${OUTPUT}/sim-time-duration.eps"
      set pointsize 1.5
      set xzeroaxis
      set yrange [0:15]
      set grid
      set key top left
      
      plot \
              '${OUTPUT}/sim-time-duration-dce.dat' usi 1:2 title "DCE cradle" w lp pt 9, \
              '${OUTPUT}/sim-time-duration-dce-linux3.dat' usi 1:2 title "DCE cradle (linux-3)" w lp, \
              '${OUTPUT}/sim-time-duration-ns3.dat' usi 1:2 title "ns-3" w lp pt 6, \
              '${OUTPUT}/sim-time-duration-nsc-linux.dat' usi 1:2 title "NSC Linux" w lp ,\
              '${OUTPUT}/numstack-1000-sim-time-duration-nsc-linux.dat' usi 1:2 title "NSC-1000" w lp 
      
      set terminal png lw 3 16
      set output "${OUTPUT}/sim-time-duration.png"
      replot
      
      quit
      EndGNUPLOT