This tutorial document describes what DCE Cradle is, how we can use it, how we extend it.
Hajime Tazaki, Frederic Urbani, Thierry Turletti
DCE Cradle does not add much overhead in terms of scaling the number of nodes in simulations compared to Network Simulation Cradle and ns-3 native stack.
The paper describing this text was submitted to Workshop on ns-3 2013 (under review).
Hajime Tazaki (tazaki at nict.go.jp)
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.
We need to prepare the following simulation codes to conduct the experiment.
Experiment on ns-3
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.
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
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
run a script
#!/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 node in $NODES
do
echo -n "$stack $node $trial " >>$OUTPUT/sim-time-nnodes.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 --nNodes=$node --seed=$trial -stopTime=64 2>&1 | grep real | awk '{print $2}' >> ${OUTPUT}/sim-time-nnodes.txt
done
done
done
Plot the results of above experiment
run a script
You can gather the text outputs from the above experiments and plot the figure with gnuplot.
#!/bin/bash
#set -x
OUTPUT=$1
mkdir -p ${OUTPUT}
TRIAL="`seq 1 100`"
STACKS="dce dce-linux3 ns3 nsc-linux"
# for Nnodes - RealTime
rm -f ${OUTPUT}/sim-time-nnodes*.dat
for stack in $STACKS
do
cat ${OUTPUT}/sim-time-nnodes.txt | grep "$stack " | dbcoldefine stack node trial time | dbmultistats -k node time |dbsort -n node | dbcol node mean stddev >> ${OUTPUT}/sim-time-nnodes-$stack.dat
done
gnuplot << EndGNUPLOT
set ylabel "Actual Time (s)"
set xlabel "Number of nodes (n)"
set terminal postscript eps lw 3 "Helvetica" 24
set output "${OUTPUT}/sim-time-nnodes.eps"
#set xrange [0:49]
set yrange [0:40]
#set xtics font "Helvetica,16"
set pointsize 1.5
set xzeroaxis
set grid
set key top left
plot \
'${OUTPUT}/sim-time-nnodes-dce.dat' usi 1:2 title "DCE cradle" w lp pt 9, \
'${OUTPUT}/sim-time-nnodes-dce-linux3.dat' usi 1:2 title "DCE cradle (linux-3)" w lp, \
'${OUTPUT}/sim-time-nnodes-ns3.dat' usi 1:2 title "ns-3" w lp pt 6, \
'${OUTPUT}/sim-time-nnodes-nsc-linux.dat' usi 1:2 title "NSC Linux" w lp ,\
'${OUTPUT}/numstack-1000-sim-time-nnodes-nsc-linux.dat' usi 1:2 title "NSC-1000" w lp
set terminal png lw 3 16
set output "${OUTPUT}/sim-time-nnodes.png"
replot
quit
EndGNUPLOT