All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] Strange pings.
@ 2005-04-19 22:55 tc
  2005-04-21 23:34 ` Andy Furniss
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: tc @ 2005-04-19 22:55 UTC (permalink / raw)
  To: lartc

Hi.

The configuration script is at the bottom.

My configuration looks similar to this:
    imq0
     |
    1:1  (12mbit)
     |
    1:2  (10mbit)
     |
    3:0  
     |
    3:1  (256kbit)
    / \
 3:2   3:3
icmp   (rest)

both 3:2 and 3:3 have rate 1kbit ceil 256kbit

Icmp bucklet have priority 1 (better), "rest" bucklet have prio 2 (worse)



I tested the script with heavy download from machine 192.168.1.2 in the background.
While the download was going I pinged 192.168.1.1.

All works fine, except pings...
They should be low, and they almost are :)

Pings are fine (0.4ms) for about 120 seconds, then i got pings similar to this:

64 bytes from 192.168.1.1: icmp_seqê ttld time=0.3 ms
64 bytes from 192.168.1.1: icmp_seqë ttld time=0.4 ms
64 bytes from 192.168.1.1: icmp_seqí ttld timeÑ.0 ms
64 bytes from 192.168.1.1: icmp_seqì ttld time#.0 ms
64 bytes from 192.168.1.1: icmp_seqî ttld timeW.0 ms
64 bytes from 192.168.1.1: icmp_seqï ttld timeâ.0 ms
64 bytes from 192.168.1.1: icmp_seqñ ttld time(.0 ms
64 bytes from 192.168.1.1: icmp_seqó ttld timea.0 ms
64 bytes from 192.168.1.1: icmp_seqò ttld timeì.0 ms
64 bytes from 192.168.1.1: icmp_seqô ttld time2.0 ms
64 bytes from 192.168.1.1: icmp_seq\x100 ttld timee.0 ms
64 bytes from 192.168.1.1: icmp_seq\x101 ttld time=4.0 ms
64 bytes from 192.168.1.1: icmp_seq\x102 ttld time6.0 ms
64 bytes from 192.168.1.1: icmp_seq\x103 ttld timei.0 ms
64 bytes from 192.168.1.1: icmp_seq\x104 ttld time=8.0 ms
64 bytes from 192.168.1.1: icmp_seq\x105 ttld time@.0 ms
64 bytes from 192.168.1.1: icmp_seq\x106 ttld times.0 ms
64 bytes from 192.168.1.1: icmp_seq\x107 ttld time\x12.0 ms
64 bytes from 192.168.1.1: icmp_seq\x108 ttld time=0.3 ms
64 bytes from 192.168.1.1: icmp_seq\x109 ttld time=0.3 ms

Then it is stable (0.4ms) for some time.

The same situation repeats in about 60 second delay.

Maybe someone solved this problem?

Thanks for any advice.

Yours sincerly
      Maciek


PS. Please don't ask me why this configuration is so strange, I have
some reasons to use schemes like this one.

PPS. Is it possible to create a filter that will match all packets?



##### script

iptables -t mangle -F PREROUTING
iptables -t mangle -F POSTROUTING
iptables -t mangle -A PREROUTING -i ! lo  -j IMQ --todev 0
iptables -t mangle -A POSTROUTING -o ! lo  -j IMQ --todev 1

tc qdisc del root dev imq0
tc qdisc del root dev imq1

tc qdisc add dev imq0 root handle 1 htb default 2
tc qdisc add dev imq1 root handle 1 htb default 2
tc class add dev imq0 parent 1:0 classid 1:1 htb rate 12mbit burst 2k prio 1 quantum 2048
tc class add dev imq1 parent 1:0 classid 1:1 htb rate 12mbit burst 2k prio 1 quantum 2048
tc class add dev imq0 parent 1:1 classid 1:2 htb rate 10mbit burst 2k prio 1 quantum 2048
tc class add dev imq1 parent 1:1 classid 1:2 htb rate 10mbit burst 2k prio 1 quantum 2048
tc qdisc add dev imq0 parent 1:2 handle 3 htb default 3
tc qdisc add dev imq1 parent 1:2 handle 3 htb default 3

tc class add dev imq0 parent 3:0 classid 3:1 htb rate 256kbit burst 2k prio 1 quantum 2048
tc class add dev imq1 parent 3:0 classid 3:1 htb rate 64kbit  burst 2k prio 1 quantum 2048

tc class add dev imq0 parent 3:1 classid 3:2 htb rate 1kbit ceil 256kbit burst 2k prio 1 quantum 2048
tc class add dev imq1 parent 3:1 classid 3:2 htb rate 1kbit ceil 64kbit  burst 2k prio 1 quantum 2048
tc class add dev imq0 parent 3:1 classid 3:3 htb rate 1kbit ceil 256kbit burst 2k prio 2 quantum 2048
tc class add dev imq1 parent 3:1 classid 3:3 htb rate 1kbit ceil 64kbit  burst 2k prio 2 quantum 2048

tc qdisc add dev imq0 parent 3:2 handle 12:0 pfifo limit 4
tc qdisc add dev imq1 parent 3:2 handle 12:0 pfifo limit 4
tc qdisc add dev imq0 parent 3:3 handle 13:0 pfifo limit 4
tc qdisc add dev imq1 parent 3:3 handle 13:0 pfifo limit 4

tc filter add dev imq0 protocol ip parent 3:0 prio 1 u32 match ip protocol 1 0xFF flowid 3:2
tc filter add dev imq1 protocol ip parent 3:0 prio 1 u32 match ip protocol 1 0xFF flowid 3:2
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

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

* Re: [LARTC] Strange pings.
  2005-04-19 22:55 [LARTC] Strange pings tc
@ 2005-04-21 23:34 ` Andy Furniss
  2005-04-22 21:08 ` tc
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Andy Furniss @ 2005-04-21 23:34 UTC (permalink / raw)
  To: lartc

tc@forest.one.pl wrote:

> 64 bytes from 192.168.1.1: icmp_seq• ttld time‰.0 ms

Which is about 2 packets @ 256kbit. I tested and got the same behaviour 
with a simple setup, but max ping about 45 because htb dequeues in pairs 
by default. If you change #define hysteresis from 1 to 0 in 
net/sched/sch_htb.c then it's more accurate. Setting Quantum to your MTU 
may also help.

> Then it is stable (0.4ms) for some time.
> 
> The same situation repeats in about 60 second delay.
> 
> Maybe someone solved this problem?

Give interactive class more rate than it needs. Latency was OK for me 
with ICMP class rate 255kbit ceil 256kbit.

> 
> PPS. Is it possible to create a filter that will match all packets?

I don't know about all, but all per protocol like -

.. protocol ip prio 10 u32 match u32 0 0 ..
.. protocol arp prio 11 u32 match u32 0 0 ..

Andy.



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

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

* Re: [LARTC] Strange pings.
  2005-04-19 22:55 [LARTC] Strange pings tc
  2005-04-21 23:34 ` Andy Furniss
@ 2005-04-22 21:08 ` tc
  2005-04-24 11:03 ` tc
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: tc @ 2005-04-22 21:08 UTC (permalink / raw)
  To: lartc

On Friday 22 of April 2005 01:34, you wrote:
> Which is about 2 packets @ 256kbit. I tested and got the same behaviour 
> with a simple setup, but max ping about 45 because htb dequeues in pairs 
> by default. If you change #define hysteresis from 1 to 0 in 
> net/sched/sch_htb.c then it's more accurate. Setting Quantum to your MTU 
> may also help.
> 
> .. protocol ip prio 10 u32 match u32 0 0 ..
> .. protocol arp prio 11 u32 match u32 0 0 ..
> 
> Andy.

Thank you Andy. I'll try your tips in few days.

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

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

* Re: [LARTC] Strange pings.
  2005-04-19 22:55 [LARTC] Strange pings tc
  2005-04-21 23:34 ` Andy Furniss
  2005-04-22 21:08 ` tc
@ 2005-04-24 11:03 ` tc
  2005-04-24 23:59 ` Andy Furniss
  2005-05-13 23:36 ` Andy Furniss
  4 siblings, 0 replies; 6+ messages in thread
From: tc @ 2005-04-24 11:03 UTC (permalink / raw)
  To: lartc

On Friday 22 of April 2005 01:34, you wrote:
> tc@forest.one.pl wrote:
> 
> > 64 bytes from 192.168.1.1: icmp_seq• ttld time‰.0 ms
> 
> Which is about 2 packets @ 256kbit. I tested and got the same behaviour 
> with a simple setup, but max ping about 45 because htb dequeues in pairs 
> by default. If you change #define hysteresis from 1 to 0 in 
> net/sched/sch_htb.c then it's more accurate. Setting Quantum to your MTU 
> may also help.
ok. I changed hysteresis and I changed quantum.
> 
> > Then it is stable (0.4ms) for some time.
> > 
> > The same situation repeats in about 60 second delay.
> > 
> > Maybe someone solved this problem?
> 
> Give interactive class more rate than it needs. Latency was OK for me 
> with ICMP class rate 255kbit ceil 256kbit.
> 
I can't give 255 kbit to icmp traffic :) But for me 4kbit seems to be enough. 
On testing environment it works fine. But on "real" configuration
the pings are still too long. 
I wonder if one-level configuration (with just one root qdisc) would give
better latency.

> > 
> > PPS. Is it possible to create a filter that will match all packets?
> 
> I don't know about all, but all per protocol like -
> 
> .. protocol ip prio 10 u32 match u32 0 0 ..
> .. protocol arp prio 11 u32 match u32 0 0 ..
> 
It works ok for me, but only with prio 0.

Thanks for help.

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

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

* Re: [LARTC] Strange pings.
  2005-04-19 22:55 [LARTC] Strange pings tc
                   ` (2 preceding siblings ...)
  2005-04-24 11:03 ` tc
@ 2005-04-24 23:59 ` Andy Furniss
  2005-05-13 23:36 ` Andy Furniss
  4 siblings, 0 replies; 6+ messages in thread
From: Andy Furniss @ 2005-04-24 23:59 UTC (permalink / raw)
  To: lartc

tc@forest.one.pl wrote:

> I can't give 255 kbit to icmp traffic :) But for me 4kbit seems to be enough. 
> On testing environment it works fine. But on "real" configuration
> the pings are still too long. 
> I wonder if one-level configuration (with just one root qdisc) would give
> better latency.

I don't know - but I tested with just one root.

> 
> 
>>>PPS. Is it possible to create a filter that will match all packets?
>>
>>I don't know about all, but all per protocol like -
>>
>>.. protocol ip prio 10 u32 match u32 0 0 ..
>>.. protocol arp prio 11 u32 match u32 0 0 ..
>>
> 
> It works ok for me, but only with prio 0.

FWIW prio 1 is the highest for filters 0 is highest for htb.

If you set 0 you end up with a really high pref  - have a look with

tc -s filter ls dev ....

What prio to use depends on what you want, the 10 and 11 are meaningless 
really unless you have other filters and order matters so the match all 
can become match all the packets that didn't match a higher prio filter.

Andy.


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

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

* Re: [LARTC] Strange pings.
  2005-04-19 22:55 [LARTC] Strange pings tc
                   ` (3 preceding siblings ...)
  2005-04-24 23:59 ` Andy Furniss
@ 2005-05-13 23:36 ` Andy Furniss
  4 siblings, 0 replies; 6+ messages in thread
From: Andy Furniss @ 2005-05-13 23:36 UTC (permalink / raw)
  To: lartc

Andy Furniss wrote:

>> PPS. Is it possible to create a filter that will match all packets?
> 
> 
> I don't know about all, but all per protocol like -
> 
> .. protocol ip prio 10 u32 match u32 0 0 ..
> .. protocol arp prio 11 u32 match u32 0 0 ..

You can use

.. protocol all prio 1 u32 match u32 0 0 ..

for some reason when I tried, it gave an error - I must have made a 
mistake as I have just run a script which uses it and it's OK.

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

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

end of thread, other threads:[~2005-05-13 23:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-19 22:55 [LARTC] Strange pings tc
2005-04-21 23:34 ` Andy Furniss
2005-04-22 21:08 ` tc
2005-04-24 11:03 ` tc
2005-04-24 23:59 ` Andy Furniss
2005-05-13 23:36 ` Andy Furniss

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.