All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] tc statistics
@ 2001-05-29 16:41 Serguei I. Ivantsov
  2001-07-03 16:56 ` [LARTC] TC statistics Nayak, Ramakrishna
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Serguei I. Ivantsov @ 2001-05-29 16:41 UTC (permalink / raw)
  To: lartc

Hi!

How can I treat the output of "tc -s class ls dev eth0" below ?
What does it means "overlimits", "backlog"?
Why there is no "dropped" packets?

class cbq 10:400 parent 10:1 leaf 802c: rate 4Kbit (bounded,isolated) prio 5
 Sent 10621 bytes 26 pkts (dropped 0, overlimits 38)
 rate 649bps 2pps backlog 16p
  borrowed 0 overactions 7 avgidle -2.18325e+06 undertime 1.43414e+06

--
 Regards,
  Serguei I. Ivantsov

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/2.4Routing/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [LARTC] TC statistics
  2001-05-29 16:41 [LARTC] tc statistics Serguei I. Ivantsov
@ 2001-07-03 16:56 ` Nayak, Ramakrishna
  2001-07-03 18:31 ` xplorer
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Nayak, Ramakrishna @ 2001-07-03 16:56 UTC (permalink / raw)
  To: lartc

All,

What kind of statistics are available using tc?

I have the following rules and I want to see the statistics something
like number of packets transmitted from each queue.

The rules:

tc qdisc add dev eth0 root handle 1: prio bands 3 priomap 0 1 2

tc qdisc add dev eth0 parent 1:1 handle 2: pfifo limit 1024
tc qdisc add dev eth0 parent 1:2 handle 3: pfifo limit 1024
tc qdisc add dev eth0 parent 1:3 handle 4: pfifo limit 1024

tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 divisor 1

tc filter add dev eth0 parent 1:0 prio 1 u32 match udp src 0x06B8 0xffff
flowid 1:1
tc filter add dev eth0 parent 1:0 prio 1 u32 match udp dst 0x06B8 0xffff
flowid 1:1

I tried looking at the stats using:

tc -stats filter show dev eth0

and this just lists all the filters.

Thanks,
..Ram

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/2.4Routing/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [LARTC] TC statistics
  2001-05-29 16:41 [LARTC] tc statistics Serguei I. Ivantsov
  2001-07-03 16:56 ` [LARTC] TC statistics Nayak, Ramakrishna
@ 2001-07-03 18:31 ` xplorer
  2001-07-03 20:11 ` Nayak, Ramakrishna
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: xplorer @ 2001-07-03 18:31 UTC (permalink / raw)
  To: lartc

Quoting "Nayak, Ramakrishna" <rnayak@3eti.com>:

> All,
> 
> What kind of statistics are available using tc?
> 
> I have the following rules and I want to see the statistics something
> like number of packets transmitted from each queue.
> 
> The rules:
> 
> tc qdisc add dev eth0 root handle 1: prio bands 3 priomap 0 1 2
> 
> tc qdisc add dev eth0 parent 1:1 handle 2: pfifo limit 1024
> tc qdisc add dev eth0 parent 1:2 handle 3: pfifo limit 1024
> tc qdisc add dev eth0 parent 1:3 handle 4: pfifo limit 1024
> 
> tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 divisor 1
> 
> tc filter add dev eth0 parent 1:0 prio 1 u32 match udp src 0x06B8 0xffff
> flowid 1:1
> tc filter add dev eth0 parent 1:0 prio 1 u32 match udp dst 0x06B8 0xffff
> flowid 1:1
> 
> I tried looking at the stats using:
> 
> tc -stats filter show dev eth0
> 
> and this just lists all the filters.
> 

you can view you bands by TC -S QDISC
BUT see description of PRIOMAP usage i have posted 2 days ago

Oh one more note: SRC and DST are define "Source IP" and "Destination IP"
for source port you must use SPORT, for destination port - DPORT.




---
This message contains no viruses. 
Guaranteed by Kaspersky Anti-Virus.
www.antivirus.lv

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/2.4Routing/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [LARTC] TC statistics
  2001-05-29 16:41 [LARTC] tc statistics Serguei I. Ivantsov
  2001-07-03 16:56 ` [LARTC] TC statistics Nayak, Ramakrishna
  2001-07-03 18:31 ` xplorer
@ 2001-07-03 20:11 ` Nayak, Ramakrishna
  2003-07-02 12:44 ` [LARTC] tc statistics Joerg Hartmann
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Nayak, Ramakrishna @ 2001-07-03 20:11 UTC (permalink / raw)
  To: lartc



> 
> Quoting "Nayak, Ramakrishna" <rnayak@3eti.com>:
> 
> > All,
> > 
> > What kind of statistics are available using tc?
> > 
> > I have the following rules and I want to see the statistics 
> something
> > like number of packets transmitted from each queue.
> > 
> > The rules:
> > 
> > tc qdisc add dev eth0 root handle 1: prio bands 3 priomap 0 1 2
> > 
> > tc qdisc add dev eth0 parent 1:1 handle 2: pfifo limit 1024
> > tc qdisc add dev eth0 parent 1:2 handle 3: pfifo limit 1024
> > tc qdisc add dev eth0 parent 1:3 handle 4: pfifo limit 1024
> > 
> > tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 divisor 1
> > 
> > tc filter add dev eth0 parent 1:0 prio 1 u32 match udp src 
> 0x06B8 0xffff
> > flowid 1:1
> > tc filter add dev eth0 parent 1:0 prio 1 u32 match udp dst 
> 0x06B8 0xffff
> > flowid 1:1
> > 
> > I tried looking at the stats using:
> > 
> > tc -stats filter show dev eth0
> > 
> > and this just lists all the filters.
> > 
> 
> you can view you bands by TC -S QDISC
> BUT see description of PRIOMAP usage i have posted 2 days ago
> 
> Oh one more note: SRC and DST are define "Source IP" and 
> "Destination IP"
> for source port you must use SPORT, for destination port - DPORT.
> 

	What is the difference between sport/dport you mention above and
src/dst found in 
	file iproute2/tc/f_u32.c function parse_udp? 

	What is the usage for both?

Thanks,

..Ram



_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/2.4Routing/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [LARTC] tc statistics
  2001-05-29 16:41 [LARTC] tc statistics Serguei I. Ivantsov
                   ` (2 preceding siblings ...)
  2001-07-03 20:11 ` Nayak, Ramakrishna
@ 2003-07-02 12:44 ` Joerg Hartmann
  2003-07-02 13:08 ` Simon Stemplinger
  2007-02-12 15:49 ` Bob Puff
  5 siblings, 0 replies; 7+ messages in thread
From: Joerg Hartmann @ 2003-07-02 12:44 UTC (permalink / raw)
  To: lartc

Hello,

i have to write a script to visualize the output of tc -s class show dev 
eth0 with rrdtool.
Or does anybody know of such a script , which is available for download ?

I assume the bps in "rate 5728bps 34pps" is Byte per Second.
Is that right ?
How can i set all the counters back to zero ?
I did not found anything in the manpage of tc.

regards
			Joerg
-- 
Jörg Hartmann		Tel: +49 391 40 00 125
J.Hartmann@megalearn.de


_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [LARTC] tc statistics
  2001-05-29 16:41 [LARTC] tc statistics Serguei I. Ivantsov
                   ` (3 preceding siblings ...)
  2003-07-02 12:44 ` [LARTC] tc statistics Joerg Hartmann
@ 2003-07-02 13:08 ` Simon Stemplinger
  2007-02-12 15:49 ` Bob Puff
  5 siblings, 0 replies; 7+ messages in thread
From: Simon Stemplinger @ 2003-07-02 13:08 UTC (permalink / raw)
  To: lartc

Joerg Hartmann wrote:
> Hello,
> 
> i have to write a script to visualize the output of tc -s class show dev 
> eth0 with rrdtool.
> Or does anybody know of such a script , which is available for download ?
> 
> I assume the bps in "rate 5728bps 34pps" is Byte per Second.
> Is that right ?
> How can i set all the counters back to zero ?
> I did not found anything in the manpage of tc.
> 
> regards
> 			Joerg

Hi Joerg,

i use this script.  It is not yet complete and as I am not very good in 
shell programming, you can probably do better, but it works ;-)

regards,
	Simon


---- snip -----
#!/bin/bash

TC=/root/bin/tc
CLASS=$2

usage ()
{
   echo
   echo "Usage: $0 option class"
   echo
   echo "  Options:  -r   show rate"
#  echo "            -s   show avg packet size"
   echo
   exit
}

# print uptime and hostname
printuptime ()
{
   test -z "$(uptime|grep day)" && echo 0 days
   test -z "$(uptime|grep day)" || echo $(uptime | awk {'print $3'}) days
   hostname
}

# an error has happened... return 0 traffic
error ()
{
   echo 0
   echo 0
   printuptime
   exit
}


rate()
{
   RATE=`echo $STATS|cut -f2 -d' '`
   echo $RATE
   echo 0
   printuptime
   exit
}

# read info about class
test -z $CLASS && usage
STATS=`$TC -s class ls dev ppp0|grep -A1 $CLASS|grep Sent`

# parse arguments
test $1 = "-r" && rate
#test $1 = "-s" && size

# else
usage


_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [LARTC] tc statistics
  2001-05-29 16:41 [LARTC] tc statistics Serguei I. Ivantsov
                   ` (4 preceding siblings ...)
  2003-07-02 13:08 ` Simon Stemplinger
@ 2007-02-12 15:49 ` Bob Puff
  5 siblings, 0 replies; 7+ messages in thread
From: Bob Puff @ 2007-02-12 15:49 UTC (permalink / raw)
  To: lartc

Hi Gang,

I'm still experiencing some bandwidth starvation with my script (below), so I
decided to look at the statistics by using:

tc -s qdisc show dev eth0  (where eth0 is the interface I'm trying to
rate-limit outbound packets)

I get, for example:

qdisc sfq 21: quantum 1514b perturb 10sec
 Sent 133527926 bytes 413260 pkts (dropped 0, overlimits 0)

 qdisc sfq 20: quantum 1514b perturb 10sec
 Sent 42622473 bytes 184396 pkts (dropped 0, overlimits 0)

 qdisc htb 1: r2q 10 default 21 direct_packets_stat 0
 Sent 176150399 bytes 597656 pkts (dropped 0, overlimits 137379)

On first appearance, I would think this is telling me that the overall
limiting is kicking in, and I'm not limiting specifically in the class 21
(which is where I want the limiting).

Here's my script:

tc qdisc del dev eth0 root
tc qdisc add dev eth0 root handle 1: htb default 21
tc class add dev eth0 parent 1: classid 1:1 htb rate 370kbit
tc class add dev eth0 parent 1:1 classid 1:20 htb prio 0 rate 100kbit
tc class add dev eth0 parent 1:1 classid 1:21 htb prio 1 rate 200kbit ceil 370kbit
tc qdisc add dev eth0 parent 1:20 handle 20: sfq perturb 10
tc qdisc add dev eth0 parent 1:21 handle 21: sfq perturb 10

# Set high priority for a certain destination IP address:
tc filter add dev eth0 parent 1:0 protocol ip prio 0 u32 \
  match ip dst 147.135.2.0/24 flowid 1:20

# Set high priority for <64 byte packets:
tc filter add dev eth0 parent 1:0 protocol ip prio 0 u32 \
   match ip protocol 6 0xff \
   match u8 0x05 0x0f at 0 \
   match u16 0x0000 0xffc0 at 2 \
   match u8 0x10 0xff at 33 \
   flowid 1:20

# Set high priority for ICMP packets:
tc filter add dev eth0 parent 1:0 protocol ip prio 0 u32 \
   match ip protocol 1 0xff \
   flowid 1:20

# Set high priority for UDP packets (hopefully all VOIP!):
tc filter add dev eth0 parent 1:0 protocol ip prio 0 u32 \
   match ip protocol 17 0xff \
   flowid 1:20


Am I reading this incorrectly?

Bob





_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-02-12 15:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-29 16:41 [LARTC] tc statistics Serguei I. Ivantsov
2001-07-03 16:56 ` [LARTC] TC statistics Nayak, Ramakrishna
2001-07-03 18:31 ` xplorer
2001-07-03 20:11 ` Nayak, Ramakrishna
2003-07-02 12:44 ` [LARTC] tc statistics Joerg Hartmann
2003-07-02 13:08 ` Simon Stemplinger
2007-02-12 15:49 ` Bob Puff

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.