[LARTC] Anyone have the userguide's tc script and the corresponding ethloop input files?

CcM beatlelittle@yahoo.com.cn
Thu, 3 Feb 2005 14:08:24 +0800 (CST)


--0-460035923-1107410904=:50430
Content-Type: text/plain; charset=gb2312
Content-Transfer-Encoding: 8bit

Thanks a lot, it's really a good way, I'll try it!
 

Stef Coene <stef.coene@docum.org> wrote:
On Monday 31 January 2005 04:26, CcM wrote:
> I'm trying to get picture from ethloop and gnuplot. But the output seems
> weird. I still do not know why and want some examples.
>
> Thanks in advance.
This is the only script I found.
It uses monitor.pl that I use to get the counters. But you can also see the 
original code from Devik in comments that uses ethloop. I hope this will 
help you.
burst.sh is a script that creates the tc setup I want to test. client1 and 
client2 are actually ttcp commands to generate traffic. So the script 
launchs 2 programs to generate traffic, monitor.pl to get some counters, 
kills the running ttcp programs, parse the output and use gnuplot to plot it.

# set -x
CEIL="1000kbps"

./burst.sh $CEIL

(sleep 3 ; ./client1 ) &
(sleep 6 ; ./client2 ) &

monitor.pl end=30 sleep=500000
kill `ps -ef | grep ttcp | awk '{print $3}'`
kill `ps -ef | grep ttcp | awk '{print $2}'`
DATA=/tmp/bb_speed.log
PIX="OUT.png"

#DATA=$1.out
#PROG=$1
#PIX=$2.png
#if [ "$2" = "" ]; then PIX=$1.png; fi

#ethloop < $1 > $1.out

#cat >.plotperl <<"EOF"
#$ln=0; $lx=-1000;
#while (<>) {
#if(/^(\d+)\s+R\s+(\d+)\s+(\d+)/) {
#$x = $1/1000; $y = -0.1; $y1 = $y+0.02; $y2 = $y + 0.05;
#if ($x-$lx<2) { $ln=($ln+1)%3; } else { $ln=0; }
#$y-=$ln*0.04; $lx=$x; $lb=$3;
#$lb=int($3/1000)."k" if ($lb>=10000);
#print "set label '$2:$lb' at $x,graph $y center\n";
#print "set arrow from $x,graph $y1 to $x,graph $y2\n";
#}
#}
#EOF
#perl .plotperl $PROG > .plot

cat >.plot <set y2t
set title "HTB burst test, ceil = $CEIL"
set grid
set nokey
set bmargin 5
set key spacing 1.4 box
set data style linespoints
set term png medium color xffffff x000000 x404040 xc00000 x009000 x0000ff 
xc09000 xc000c0 x0090c0 x804020
#set term png small xffffff x000000 x404040 xc00000 x009000 x0000ff \\
#xc09000 xc000c0 x0090c0 x804020
set out "$PIX"
set label "time [s]" at graph -0.02,graph -0.05 right
set ylabel "rate [Bps]"
set ytics nomirror
#set noy2tics

plot '$DATA' using (\$1/2):2 title 'flow 1 rate',\\
'$DATA' using (\$1/2):4 title 'flow 2 rate',\\
'$DATA' using (\$1/2):(\$2+\$4) title 'total rate (0+1)'

EOF

gnuplot .plot
#xview $PIX
cp $PIX $CEIL.png
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/



---------------------------------
Do You Yahoo!?
注册世界一流品质的雅虎免费电邮
--0-460035923-1107410904=:50430
Content-Type: text/html; charset=gb2312
Content-Transfer-Encoding: 8bit

<DIV>Thanks a lot, it's really a good way, I'll try it!</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR><B><I>Stef Coene &lt;stef.coene@docum.org&gt;</I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">On Monday 31 January 2005 04:26, CcM wrote:<BR>&gt; I'm trying to get picture from ethloop and gnuplot. But the output seems<BR>&gt; weird. I still do not know why and want some examples.<BR>&gt;<BR>&gt; Thanks in advance.<BR>This is the only script I found.<BR>It uses monitor.pl that I use to get the counters. But you can also see the <BR>original code from Devik in comments that uses ethloop. I hope this will <BR>help you.<BR>burst.sh is a script that creates the tc setup I want to test. client1 and <BR>client2 are actually ttcp commands to generate traffic. So the script <BR>launchs 2 programs to generate traffic, monitor.pl to get some counters, <BR>kills the running ttcp programs, parse the output and use gnuplot to plot it.<BR><BR># set -x<BR>CEIL="1000kbps"<BR><BR>./burst.sh $CEIL<BR><BR>(sleep 3 ; ./client1 ) &amp;<BR>(sleep 6 ; ./client2 ) &amp;<BR><BR>monitor.pl end=30
 sleep=500000<BR>kill `ps -ef | grep ttcp | awk '{print $3}'`<BR>kill `ps -ef | grep ttcp | awk '{print $2}'`<BR>DATA=/tmp/bb_speed.log<BR>PIX="OUT.png"<BR><BR>#DATA=$1.out<BR>#PROG=$1<BR>#PIX=$2.png<BR>#if [ "$2" = "" ]; then PIX=$1.png; fi<BR><BR>#ethloop &lt; $1 &gt; $1.out<BR><BR>#cat &gt;.plotperl &lt;&lt;"EOF"<BR>#$ln=0; $lx=-1000;<BR>#while (&lt;&gt;) {<BR>#if(/^(\d+)\s+R\s+(\d+)\s+(\d+)/) {<BR>#$x = $1/1000; $y = -0.1; $y1 = $y+0.02; $y2 = $y + 0.05;<BR>#if ($x-$lx&lt;2) { $ln=($ln+1)%3; } else { $ln=0; }<BR>#$y-=$ln*0.04; $lx=$x; $lb=$3;<BR>#$lb=int($3/1000)."k" if ($lb&gt;=10000);<BR>#print "set label '$2:$lb' at $x,graph $y center\n";<BR>#print "set arrow from $x,graph $y1 to $x,graph $y2\n";<BR>#}<BR>#}<BR>#EOF<BR>#perl .plotperl $PROG &gt; .plot<BR><BR>cat &gt;.plot &lt;<EOF<BR>set y2t<BR>set title "HTB burst test, ceil = $CEIL"<BR>set grid<BR>set nokey<BR>set bmargin 5<BR>set key spacing 1.4 box<BR>set data style linespoints<BR>set term png medium color xffffff x000000
 x404040 xc00000 x009000 x0000ff <BR>xc09000 xc000c0 x0090c0 x804020<BR>#set term png small xffffff x000000 x404040 xc00000 x009000 x0000ff \\<BR>#xc09000 xc000c0 x0090c0 x804020<BR>set out "$PIX"<BR>set label "time [s]" at graph -0.02,graph -0.05 right<BR>set ylabel "rate [Bps]"<BR>set ytics nomirror<BR>#set noy2tics<BR><BR>plot '$DATA' using (\$1/2):2 title 'flow 1 rate',\\<BR>'$DATA' using (\$1/2):4 title 'flow 2 rate',\\<BR>'$DATA' using (\$1/2):(\$2+\$4) title 'total rate (0+1)'<BR><BR>EOF<BR><BR>gnuplot .plot<BR>#xview $PIX<BR>cp $PIX $CEIL.png<BR>_______________________________________________<BR>LARTC mailing list / LARTC@mailman.ds9a.nl<BR>http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/<BR></BLOCKQUOTE><p><br><hr size=1>
<b>Do You Yahoo!?</b><br>
<a href="http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/" target=blank>注册世界一流品质的雅虎免费电邮</a>
--0-460035923-1107410904=:50430--