* Re: [LARTC] Testing traffic control
2003-04-25 21:57 [LARTC] Testing traffic control Patrick Turley
@ 2003-04-25 22:51 ` Stef Coene
2003-04-26 7:53 ` Stef Coene
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Stef Coene @ 2003-04-25 22:51 UTC (permalink / raw)
To: lartc
On Friday 25 April 2003 23:57, Patrick Turley wrote:
> We are just starting to research this stuff - I expect this mailing list
> to save my bacon many times :)
>
> I'd like to hear some ideas on how people test their setups. It seems to
> me that the ideal testing rig would be two computers, one on either side
> the router. Have one computer open up some number of connections with
> various procol characteristics to the other and start blasting data
> through each connection. Have the other computer display the rate at
> which data is being received for each connection in a really cool
> graphical way.
>
> Does anyone here actually have the tools to do this? I would be terribly
> grateful if anyone could point me in the right direction.
I have some scripts. You can find them on www.docum.org. They don't look
really cool, but they can show you what's going on in real-time.
I have a script that uses iptables counters. An other uses the tc counters.
They are both shell scripts and I use them to automate my tests.
I also have some scripts to store the tc counters in a rrd database so you can
graph long term statistics. And I have written a java applet so you can see
real-time graphs.
Stef
--
stef.coene@docum.org
"Using Linux as bandwidth manager"
http://www.docum.org/
#lartc @ irc.oftc.net
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [LARTC] Testing traffic control
2003-04-25 21:57 [LARTC] Testing traffic control Patrick Turley
2003-04-25 22:51 ` Stef Coene
@ 2003-04-26 7:53 ` Stef Coene
2003-04-26 15:52 ` sufcrusher
2003-05-10 12:41 ` Srikanth
3 siblings, 0 replies; 5+ messages in thread
From: Stef Coene @ 2003-04-26 7:53 UTC (permalink / raw)
To: lartc
On Saturday 26 April 2003 03:07, Jannes Faber wrote:
> I've been using TC and HTB for a while now (almost a year). Took a while to
> get it running, but it's ok now (playing CounterStrike on one PC while two
> others are using DirectConnect and Emule are fully using the upstream and
> downstream).
Do you mind sending my some more information? I can add this is an example
setup to my faq.
> Anyway, until recently I was doing it all blind, using iptraf for some
> rough indication of some total values, but that was about it. So I decided
> it was time to make some graphs. So I made a simple perl script (ahum...
> actually I ripped apart a script made by Stef and added my own stuff) using
> rrdtool to store and display all the data.
Thx :)
But if you wrote the script in perl, why don't you use the rrdtool perl
library's?
Stef
--
stef.coene@docum.org
"Using Linux as bandwidth manager"
http://www.docum.org/
#lartc @ irc.oftc.net
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [LARTC] Testing traffic control
2003-04-25 21:57 [LARTC] Testing traffic control Patrick Turley
2003-04-25 22:51 ` Stef Coene
2003-04-26 7:53 ` Stef Coene
@ 2003-04-26 15:52 ` sufcrusher
2003-05-10 12:41 ` Srikanth
3 siblings, 0 replies; 5+ messages in thread
From: sufcrusher @ 2003-04-26 15:52 UTC (permalink / raw)
To: lartc
[-- Attachment #1: Type: text/plain, Size: 2466 bytes --]
----- Original Message -----
From: "Jannes Faber" <jannes@elevate.nl>
To: "Stef Coene" <stef.coene@docum.org>; <pturley@rocksteady.com>;
<lartc@mailman.ds9a.nl>
Sent: Saturday, April 26, 2003 3:07 AM
Subject: Re: [LARTC] Testing traffic control
> I've been using TC and HTB for a while now (almost a year). Took a while
to
> get it running, but it's ok now (playing CounterStrike on one PC while two
> others are using DirectConnect and Emule are fully using the upstream and
> downstream).
>
> Anyway, until recently I was doing it all blind, using iptraf for some
rough
> indication of some total values, but that was about it. So I decided it
was
> time to make some graphs. So I made a simple perl script (ahum... actually
I
> ripped apart a script made by Stef and added my own stuff) using rrdtool
to
> store and display all the data.
>
> I attached it. You'll have to edit it a little for your own situation, but
> it's quite flexible. (I'm not a perl programmer, so expect some ugly C
> constructions).
>
> Basic commands:
>
> rrd_tc without parameters gives some help. But basically you call
> "rrd_tc.pl create" once to create a new database. Then you run "rrd_tc.pl
> collect" and keep it running in the background (nohup or in /etc/rc.local)
> to collect the actual data. Then you use "rrd_tc.pl graph xv stack
> update=10" to display a nice graph and have it updated every 10 seconds.
>
> This script stores and displays the counters for all the different TC
> classes as well as the total up and download from /proc/net/dev.
>
> Jannes Faber
>
> > On Friday 25 April 2003 23:57, Patrick Turley wrote:
> > > through each connection. Have the other computer display the rate at
> > > which data is being received for each connection in a really cool
> > > graphical way.
> > >
> > > Does anyone here actually have the tools to do this? I would be
terribly
> > > grateful if anyone could point me in the right direction.
> > Stef wrote:
> > I have some scripts. You can find them on www.docum.org. They don't
look
> > really cool, but they can show you what's going on in real-time.
> >
> > I have a script that uses iptables counters. An other uses the tc
> counters.
> > They are both shell scripts and I use them to automate my tests.
> >
> > I also have some scripts to store the tc counters in a rrd database so
you
> can
> > graph long term statistics. And I have written a java applet so you can
> see
> > real-time graphs.
> >
> > Stef
>
>
[-- Attachment #2: rrd_tc.pl --]
[-- Type: application/octet-stream, Size: 4407 bytes --]
#!/usr/bin/perl
# Default values (can also be set on the command line)
$arg{sleep} = "10" ; # seconds between readings
$arg{dev} = "eth0";
$arg{tc} = "tc-htb";
$arg{db} = "/var/local/tc.rrd";
$arg{file} = "/tmp/rrd_tc_graph.png";
$arg{time} = "1200";
$max=200000;
foreach my $arg (@ARGV) {
@split = split ( "=", $arg) ;
$arg{$split[0]} = ($split[1] eq "" ? 1 : $split[1]);
}
if ( $arg{create} ) {
system( "test -e $arg{db} && rm -i ". $arg{db});
system( "rrdtool create $arg{db} -s ". $arg{sleep}
. " DS:speed_up:COUNTER:60:U:$max"
. " DS:speed_dn:COUNTER:60:U:$max"
. " DS:speed_1_1:COUNTER:60:U:$max"
. " DS:speed_1_10:COUNTER:60:U:$max"
. " DS:speed_1_11:COUNTER:60:U:$max"
. " DS:speed_1_12:COUNTER:60:U:$max"
. " DS:speed_1_13:COUNTER:60:U:$max"
. " DS:speed_1_14:COUNTER:60:U:$max"
. " RRA:AVERAGE:0.5:1:" . (12 * 30)
. " RRA:AVERAGE:0.5:12:" . (60 * 2)
. " RRA:AVERAGE:0.5:120:" . (6 * 12)
. " RRA:AVERAGE:0.5:720:" . (24 * 7)
. " RRA:AVERAGE:0.5:". (720 * 24) .":". (365)
);
}
elsif ( $arg{graph} ) {
$type0 = ($arg{stack} ? "AREA" : "LINE3");
$type1 = ($arg{stack} ? "STACK" : "LINE2");
$type2 = ($arg{stack} ? "STACK" : "LINE1");
do {
system( "rrdtool graph ". $arg{file} . ($arg{update} eq "" ? "" : " -z ")
. " -s -$arg{time} -e -$arg{sleep} --step 5 -w 600 -h 300 -t \"Traffic ($arg{dev})\" -v \"byte/s\""
. ($arg{stack}
? ""
: " DEF:speed_1_1=$arg{db}:speed_1_1:AVERAGE AREA:speed_1_1#22ff22:\"1_1 (total)\""
)
. " DEF:speed_1_10=$arg{db}:speed_1_10:AVERAGE $type0:speed_1_10#aaaaaa:\"1_10 (cs)\""
. " DEF:speed_1_11=$arg{db}:speed_1_11:AVERAGE $type1:speed_1_11#000000:\"1_11 (ssh)\""
. " DEF:speed_1_12=$arg{db}:speed_1_12:AVERAGE $type1:speed_1_12#ff0000:\"1_12 (www)\""
. " DEF:speed_1_13=$arg{db}:speed_1_13:AVERAGE $type1:speed_1_13#66ffff:\"1_13 (ack)\""
. " DEF:speed_1_14=$arg{db}:speed_1_14:AVERAGE $type2:speed_1_14#0000aa:\"1_14 (rest)\""
. " DEF:speed_up=$arg{db}:speed_up:AVERAGE LINE1:speed_up#aa0000:\"Total UP\""
. " DEF:speed_dn=$arg{db}:speed_dn:AVERAGE"
. " CDEF:speed_dn10=speed_dn,10,/ LINE1:speed_dn10#00aa00:\"Total DOWN/10\""
. " > /dev/null"
);
if($arg{xv}) {
system("xv +nopos -dr 0 0 -poll ". $arg{file} ." &");
$arg{xv} = "";
}
sleep($arg{update});
} while($arg{update});
}
elsif ( $arg{collect} ) {
main () ;
}
else {
print " $0 create [sleep=SEC] [db=FILE]\n"
. " $0 collect [sleep=SEC] [db=FILE] [dev=DEV] [tc=FILE]\n"
. " $0 graph [xv] [stack] [time=SEC] [update=SEC] [file=FILE] [db=FILE]\n"
;
}
sub main {
format STDOUT_TOP =
Classid tokens ctokens bytes speed
------------------------------------------
.
format STDOUT =
@<<<<<<<< @<<<<<<<<@<<<<<< @<<<<< @<<<<<<<
$classid $tokens $ctokens $Sent $speed
.
while (1) {
my $flds="";
my $vals="";
my %acc = get_proccounters();
$flds .= "speed_up:speed_dn";
$vals .= "$acc{up}:$acc{dn}";
my %acc = get_counters () ;
foreach $key (keys(%acc)) {
$classid = $key;
$tokens = $acc{$key}{tokens} ;
$ctokens = $acc{$key}{ctokens} ;
$Sent{$key} = $acc{$key}{Sent} - $acc_vorige{$key}{Sent} ;
$Sent = $Sent{$key} ;
# write ;
$classid =~ s/:/_/;
$flds .= ($flds eq "" ? "" : ":") ."speed_". $classid;
$vals .= ($vals eq "" ? "" : ":") . $acc{$key}{Sent};
}
system("rrdtool update $arg{db} -t ". $flds ." N:". $vals );
sleep ($arg{sleep}) ;
} }
sub get_counters {
my %ACC ;
my @class = `$arg{tc} -s -d class show dev $arg{dev}` ; # Get all class info
foreach my $ele (@class) {
chomp ($ele) ;
my @temp = split(" ",$ele) ;
my $i = 0 ;
foreach my $temp (@temp) {
$i ++ ;
if ( $temp eq "htb" ) {
$classid = $temp[$i] ;
} elsif ( $temp =~ /\d/ ) {
#print "classid $classid $name $temp\n" ;
$ACC{$classid}{$name} = $temp ;
} else {
$temp =~ s/://g ;
$temp =~ s/\(//g ;
$name = $temp ;
}
}
}
return %ACC ;
}
sub get_proccounters {
my %ACC;
my @counters = `cat /proc/net/dev | grep $arg{dev}`;
my @temp = split(":",$counters[0]);
chomp($temp[1]);
my @temp = split(" ", $temp[1]);
$ACC{dn} = $temp[0];
$ACC{up} = $temp[8];
return %ACC;
}
^ permalink raw reply [flat|nested] 5+ messages in thread* [LARTC] Testing traffic control
2003-04-25 21:57 [LARTC] Testing traffic control Patrick Turley
` (2 preceding siblings ...)
2003-04-26 15:52 ` sufcrusher
@ 2003-05-10 12:41 ` Srikanth
3 siblings, 0 replies; 5+ messages in thread
From: Srikanth @ 2003-05-10 12:41 UTC (permalink / raw)
To: lartc
[-- Attachment #1: Type: text/plain, Size: 2575 bytes --]
Probably u can use spirent tool, but i'm not sure of it's graphical
reports with current version,
The next version is coming with more comforatable.
Srikanth
>Message: 2
>Date: Fri, 25 Apr 2003 16:57:03 -0500
>From: Patrick Turley <pturley@rocksteady.com>
>To: lartc@mailman.ds9a.nl
>Reply-To: pturley@rocksteady.com
>Organization: Rock Steady Networks
>Subject: [LARTC] Testing traffic control
>
>We are just starting to research this stuff - I expect this mailing list
>to save my bacon many times :)
>
>I'd like to hear some ideas on how people test their setups. It seems to
>me that the ideal testing rig would be two computers, one on either side
>the router. Have one computer open up some number of connections with
>various procol characteristics to the other and start blasting data
>through each connection. Have the other computer display the rate at
>which data is being received for each connection in a really cool
>graphical way.
>
>Does anyone here actually have the tools to do this? I would be terribly
>grateful if anyone could point me in the right direction.
>
>
>
>
>--__--__--
>
>Message: 3
>From: Stef Coene <stef.coene@docum.org>
>Organization: None
>To: pturley@rocksteady.com, lartc@mailman.ds9a.nl
>Subject: Re: [LARTC] Testing traffic control
>Date: Sat, 26 Apr 2003 00:51:44 +0200
>
>On Friday 25 April 2003 23:57, Patrick Turley wrote:
>
>
>>We are just starting to research this stuff - I expect this mailing list
>>to save my bacon many times :)
>>
>>I'd like to hear some ideas on how people test their setups. It seems to
>>me that the ideal testing rig would be two computers, one on either side
>>the router. Have one computer open up some number of connections with
>>various procol characteristics to the other and start blasting data
>>through each connection. Have the other computer display the rate at
>>which data is being received for each connection in a really cool
>>graphical way.
>>
>>Does anyone here actually have the tools to do this? I would be terribly
>>grateful if anyone could point me in the right direction.
>>
>>
>I have some scripts. You can find them on www.docum.org. They don't look
>really cool, but they can show you what's going on in real-time.
>
>I have a script that uses iptables counters. An other uses the tc counters.
>They are both shell scripts and I use them to automate my tests.
>
>I also have some scripts to store the tc counters in a rrd database so you can
>graph long term statistics. And I have written a java applet so you can see
>real-time graphs.
>
>Stef
>
>
>
[-- Attachment #2: Type: text/html, Size: 3390 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread