add event graph changes for whitelist and data loss

parent 681cf9a6
#!/bin/bash
MODE=$1
BRO_PATH=/opt/bro/etc
BRO_PATH="/usr/local/bro/etc"
MON_INTF=`sudo ifconfig -a | grep -1 10.1 | grep eth. | cut -d' ' -f1`
echo $MON_INTF
sudo yum -y install cmake make gcc gcc-c++ flex bison libpcap-devel openssl-devel python-devel swig zlib-devel
sudo yum -y install expect wget git
sudo apt-get -y install cmake make gcc gcc-c++ flex bison libpcap-devel openssl-devel python-devel swig zlib-devel
sudo apt-get -y install expect wget git
if [ "$MODE" == "src" ]; then
git clone --recursive git://git.bro.org/bro
cd bro
......
......@@ -194,9 +194,9 @@ def bandwidthTest(bw=5, controllerip="localhost"):
h3.cmd('sudo ethtool -K h3-eth0 tso off')
h3.cmd("ifconfig h3-eth0 mtu 900")
print "sleep for 5 sec before sending traffic"
sleep(5)
h1.cmd(tg_cmd)
#print "sleep for 5 sec before sending traffic"
#sleep(5)
#h1.cmd(tg_cmd)
CLI(net)
#stop the traffic generation
......
To get the ground truth traffic graph:
./drawEvtGraph.sh ground-truth/txrate0.csv ground
./drawEvtGraph.sh ground-truth/txrate0.csv ground noarrow
To get the traffic graph with whitelisting
./drawEvtGraph.sh with-whitelist/txrate0.csv white
./drawEvtGraph.sh with-whitelist/txrate0.csv white showregion
To get the traffic graph without whitelisting
./drawEvtGraph.sh without-whitelist/txrate0.csv nowhite
./drawEvtGraph.sh without-whitelist/txrate0.csv nowhite noarrow
......@@ -2,6 +2,7 @@
ep_csv_input=$1
output_name=$2
whitelist=$3
start_timestamp=`head -1 $ep_csv_input | cut -d',' -f1`
export start_timestamp
......@@ -35,6 +36,10 @@ export tap_start_second
export white_start_second
export white_end_second
./evt_gnu_graph.scr
if [ "$whitelist" == "showregion" ]; then
./white-evt_gnu_graph.scr
else
./evt_gnu_graph.scr
fi
rm -vf $src1_filename $src2_filename $dst_filename $tap_filename
......@@ -8,8 +8,6 @@ start_timestamp="`echo $start_timestamp`"
service1_timestamp="`echo $src1_start_second`"
service2_timestamp="`echo $src2_start_second`"
tap_timestamp="`echo $tap_start_second`"
white_start_timestamp="`echo $white_start_second`"
white_end_timestamp="`echo $white_end_second`"
set terminal pdfcairo enhanced font "Times-Roman,20" size 12,18
set output output_filename
......@@ -53,17 +51,6 @@ set arrow from x,0 to x,y as 1
set label 3 "Event 3" at x-d,y font "Times-Roman,20"
y=3
x=white_start_timestamp
set arrow from x,0 to x,y as 1
set label 4 "WhiteStart" at x-d,y font "Times-Roman,20"
x=white_end_timestamp
set arrow from x,0 to x,y as 1
set label 5 "WhiteEnd" at x-d,y font "Times-Roman,20"
y=2.5
set arrow from white_start_timestamp,y to white_end_timestamp,y as 5
set label 6 "60 sec" at white_start_timestamp+27,y+0.1 font "Times-Roman,20"
ysize = 0.5
xsize = 1
......
#!/usr/bin/gnuplot
src1_input="`echo $src1_filename`"
src2_input="`echo $src2_filename`"
dst_input="`echo $dst_filename`"
tap_input="`echo $tap_filename`"
output_filename="`echo $output_filename`"
start_timestamp="`echo $start_timestamp`"
service1_timestamp="`echo $src1_start_second`"
service2_timestamp="`echo $src2_start_second`"
tap_timestamp="`echo $tap_start_second`"
white_start_timestamp="`echo $white_start_second`"
white_end_timestamp="`echo $white_end_second`"
set terminal pdfcairo enhanced font "Times-Roman,20" size 12,18
set output output_filename
set timefmt '%s'
set datafile separator ","
set title "Event Series Graph"
set grid
set yrange [0:5]
set ytics 1
set xrange [0:250]
set xtics 50
set multiplot layout 4,1 columnsfirst
set style arrow 1 lt 4 lw 2
set style arrow 2 lt 1 lw 1
set style arrow 5 heads filled size screen 0.03,5,5 ls 1
set style func linespoints
set style line 1 lt 2 lc rgb "black" lw 3
set style line 2 lt 2 lc rgb "blue" lw 3
set style line 3 lt 2 lc rgb "yellow" lw 2
set style line 4 lt 2 lc rgb "orange" lw 2
set key autotitle column
set key on left
#event arrows
y=2
d=10 #displacement
x=service1_timestamp
set arrow from x,0 to x,y as 1
set label 1 "Event 1" at x-d,y font "Times-Roman,20"
x=tap_timestamp
set arrow from x,0 to x,y as 1
set label 2 "Event 2" at x-d,y font "Times-Roman,20"
x=service2_timestamp
set arrow from x,0 to x,y as 1
set label 3 "Event 3" at x-d,y font "Times-Roman,20"
y=3
x=white_start_timestamp
set arrow from x,0 to x,y as 1
set label 4 "WhiteStart" at x-d,y font "Times-Roman,20"
x=white_end_timestamp
set arrow from x,0 to x,y as 1
set label 5 "WhiteEnd" at x-d,y font "Times-Roman,20"
y=2.5
set arrow from white_start_timestamp,y to white_end_timestamp,y as 5
set label 6 "60 sec" at white_start_timestamp+27,y+0.1 font "Times-Roman,20"
ysize = 0.5
xsize = 1
set title "(a) TCP Source Traffic Activity"
set ylabel "Mb/s out"
plot src1_input using ($1-start_timestamp):(($2*8)/(1024*1024)) title 'out' with lines ls 1 , \
src1_input using ($1-start_timestamp):(($3*8)/(1024*1024)) title 'in' with lines ls 2 , \
src1_input using ($1-start_timestamp):(($4*8)/(1024*1024)) title 'error-out' with lines ls 3 , \
src1_input using ($1-start_timestamp):(($5*8)/(1024*1024)) title 'error-in' with lines ls 4
set title "(b) PCAP Replay Source Traffic Activity"
set ylabel "Mb/s out"
plot src2_input using ($1-start_timestamp):(($2*8)/(1024*1024)) title 'out' with lines ls 1 , \
src2_input using ($1-start_timestamp):(($3*8)/(1024*1024)) title 'in' with lines ls 2 , \
src2_input using ($1-start_timestamp):(($4*8)/(1024*1024)) title 'error-out' with lines ls 3 , \
src2_input using ($1-start_timestamp):(($5*8)/(1024*1024)) title 'error-in' with lines ls 4
set title "(c) Destination Traffic Activity"
set ylabel "Mb/s out"
plot dst_input using ($1-start_timestamp):(($2*8)/(1024*1024)) title 'out' with lines ls 1 , \
dst_input using ($1-start_timestamp):(($3*8)/(1024*1024)) title 'in' with lines ls 2 , \
dst_input using ($1-start_timestamp):(($4*8)/(1024*1024)) title 'error-out' with lines ls 3 , \
dst_input using ($1-start_timestamp):(($5*8)/(1024*1024)) title 'error-in' with lines ls 4
set title "(d) Enterprise Network Gateway Traffic Activity"
set ylabel "Mb/s out"
set xlabel "Time"
plot tap_input using ($1-start_timestamp):(($2*8)/(1024*1024)) title 'out' with lines ls 1 , \
tap_input using ($1-start_timestamp):(($3*8)/(1024*1024)) title 'in' with lines ls 2 , \
tap_input using ($1-start_timestamp):(($4*8)/(1024*1024)) title 'error-out' with lines ls 3 , \
tap_input using ($1-start_timestamp):(($5*8)/(1024*1024)) title 'error-in' with lines ls 4
unset multiplot
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment