* Re: [LARTC] tbf and prio blocking some flows entirely
2005-12-04 16:36 [LARTC] tbf and prio blocking some flows entirely Brian J. Murrell
@ 2005-12-04 16:54 ` Andreas Klauer
2005-12-04 18:17 ` Brian J. Murrell
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Andreas Klauer @ 2005-12-04 16:54 UTC (permalink / raw)
To: lartc
On Sunday 04 December 2005 17:36, Brian J. Murrell wrote:
> Even if they end up in 2:3, they should at least be treated fairly.
2:3 will not be treated at all as long as 2:1 and 2:2 (which have higher
priority) are occupied. If the queues in 2:1 and 2:2 resp. never empty,
the packets in 2:3 will never be sent. There is no fair treatment in PRIO.
That's the whole purpose of this scheduler, to give one band of packets
absolute priority over the other.
> What have I done wrong?
This is just out of personal interest, but could you try using instead of
your TBF qdisc, a very simple HTB Qdisc / class with the same bandwidth
limitation? If that solves the problem, then you're suffering from a
problem that I failed to solve when I last tried to use TBF; for some
reason it got stuck on me too.
> So maybe for some reason that last ack is not being dequeued?
I don't understand what you mean by fair treatment, but do try putting all
ACKs into high priority band, then it will have to be dequeued.
Regards,
Andreas Klauer
_______________________________________________
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* Re: [LARTC] tbf and prio blocking some flows entirely
2005-12-04 16:36 [LARTC] tbf and prio blocking some flows entirely Brian J. Murrell
2005-12-04 16:54 ` Andreas Klauer
@ 2005-12-04 18:17 ` Brian J. Murrell
2005-12-04 18:46 ` Patrick McHardy
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Brian J. Murrell @ 2005-12-04 18:17 UTC (permalink / raw)
To: lartc
[-- Attachment #1.1: Type: text/plain, Size: 3111 bytes --]
On Sun, 2005-12-04 at 17:54 +0100, Andreas Klauer wrote:
> On Sunday 04 December 2005 17:36, Brian J. Murrell wrote:
> > Even if they end up in 2:3, they should at least be treated fairly.
>
> 2:3 will not be treated at all as long as 2:1 and 2:2 (which have higher
> priority) are occupied.
Right. I think I said in my last message that both 2:1 and 2:2 were
very quiet (which is what I would expect) and that there was a lot of
traffic going through 2:3. My point there was that even if 2:3 was
processing a lot of packets, since it is an SFQ, everybody should
eventually get use of it.
> If the queues in 2:1 and 2:2 resp. never empty,
> the packets in 2:3 will never be sent.
Understood. But they were empty and lots of packets from 2:3 were being
sent.
> There is no fair treatment in PRIO.
No, it's priority based. Got that. Exactly what I am looking for in
fact.
> That's the whole purpose of this scheduler, to give one band of packets
> absolute priority over the other.
Yup. My "interactive"/latency sensitive traffic should always get best
service.
> This is just out of personal interest, but could you try using instead of
> your TBF qdisc, a very simple HTB Qdisc / class with the same bandwidth
> limitation?
Hrm. OK. But I'm not sure how I would use HTB to replace a classless
TBF though. for TBF I use:
tc qdisc add dev ppp0 root handle 1: tbf rate 120kbit burst 1200 limit 1
So to replace that with HTB I tried:
tc qdisc add dev ppp0 root handle 1: htb default 10
tc class add dev ppp0 parent 1 classid 1:1 htb rate 120kbit
But nothing seems to be getting put into any of the child classes which
are configured as:
tc qdisc add dev ppp0 parent 1:1 handle 2: prio bands 3
tc qdisc add dev ppp0 parent 2:1 handle 10: sfq perturb 20
tc qdisc add dev ppp0 parent 2:2 handle 20: sfq perturb 20
tc qdisc add dev ppp0 parent 2:3 handle 30: sfq perturb 20
I'm probably misunderstanding all of the class naming and handles and
such.
> If that solves the problem, then you're suffering from a
> problem that I failed to solve when I last tried to use TBF; for some
> reason it got stuck on me too.
Well, TBF does not seem to be getting stuck. There is still lots of
traffic moving when these other flows seem to just stop, so TBF can't be
the problem can it? It has to be PRIO, not dequeuing anything for these
particular stalled flows to TBF right?
> I don't understand what you mean by fair treatment, but do try putting all
> ACKs into high priority band, then it will have to be dequeued.
I think I am doing that. I thought that is what:
859K 42M CLASSIFY tcp -- * ppp0 0.0.0.0/0 0.0.0.0/0 tcp flags:0x16/0x10 length 0:128 CLASSIFY set 2:1
in the POSTROUTING chain should be doing. It's the result of the
iptables rule:
iptables -t mangle -I POSTROUTING -o ppp0 -p tcp -m tcp --tcp-flags SYN,RST,ACK ACK -m length --length :128 -j CLASSIFY --set-class 2:1
b.
--
My other computer is your Microsoft Windows server.
Brian J. Murrell
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
[-- Attachment #2: Type: text/plain, Size: 143 bytes --]
_______________________________________________
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* Re: [LARTC] tbf and prio blocking some flows entirely
2005-12-04 16:36 [LARTC] tbf and prio blocking some flows entirely Brian J. Murrell
2005-12-04 16:54 ` Andreas Klauer
2005-12-04 18:17 ` Brian J. Murrell
@ 2005-12-04 18:46 ` Patrick McHardy
2005-12-04 18:56 ` Andreas Klauer
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Patrick McHardy @ 2005-12-04 18:46 UTC (permalink / raw)
To: lartc
Brian J. Murrell wrote:
> I thought I had this all worked out, but it seems not. The following tc
> configuration:
>
> tc qdisc del dev ppp0 root 2> /dev/null > /dev/null
> tc qdisc add dev ppp0 root handle 1: tbf rate 120kbit burst 1200 limit 1
> But it seems that some outbound flows are being blocked entirely. I
> don't think they are being starved though. Even if they end up in 2:3,
> they should at least be treated fairly. But I am producing a flow to
> 66.1.2.3 which does increment the counters in 2:1 but after a few
> packets the flow stalls:
Your burst is too small. It needs to be at least one MTU.
_______________________________________________
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* Re: [LARTC] tbf and prio blocking some flows entirely
2005-12-04 16:36 [LARTC] tbf and prio blocking some flows entirely Brian J. Murrell
` (2 preceding siblings ...)
2005-12-04 18:46 ` Patrick McHardy
@ 2005-12-04 18:56 ` Andreas Klauer
2005-12-04 22:07 ` Andy Furniss
2005-12-04 22:50 ` Brian J. Murrell
5 siblings, 0 replies; 7+ messages in thread
From: Andreas Klauer @ 2005-12-04 18:56 UTC (permalink / raw)
To: lartc
On Sunday 04 December 2005 19:17, Brian J. Murrell wrote:
> > There is no fair treatment in PRIO.
>
> No, it's priority based. Got that. Exactly what I am looking for in
> fact.
Sorry, seems that I misunderstood you in your message in the point that you
meant SFQ and not PRIO when you were talking about fair treatment.
> So to replace that with HTB I tried:
>
> tc qdisc add dev ppp0 root handle 1: htb default 10
> tc class add dev ppp0 parent 1 classid 1:1 htb rate 120kbit
Without additional filter rules, it should be 'default 1', and not 10.
Otherwise HTB will try to put the classes in 1:10, which does not exist,
and instead send them out directly without any shaping at all.
> Well, TBF does not seem to be getting stuck. There is still lots of
> traffic moving when these other flows seem to just stop, so TBF can't be
> the problem can it? It has to be PRIO, not dequeuing anything for these
> particular stalled flows to TBF right?
Hmmm. Well, I was just guessing, because I had this 'stuck' problem with
TBF before. As I said, I never really solved that problem, so I can't say
much about cause and such.
The way I understand it, the root qdisc will get the request to dequeue a
packet, and it will forward this request to the underlying qdiscs. So when
TBF is asked for a packet, it will decide wether to send one or not
(depending on wether there is any bandwidth left). If it wants to dequeue
one, it will forward this request to the underlying queue(s), PRIO in your
case. PRIO will look at it's bands and dequeue a packet from the first
band that has packets queued; in your case, it will have to ask the
underlying SFQ queue to select a packet. SFQ will look at the packets it
has queued and select one based on it's "stochastical fairness" algorithm.
SFQ then returns this packet to PRIO which in turn will return this packet
to TBF which in turn will send this packet on it's way.
Please note that this is all guesswork. I haven't actually looked at the
kernel code for all of that. :-) It might actually work in a totally
different way.
Anyway, if my understanding model is correct, and some packets in your prio
bands get sent and others don't, it should be the fault of SFQ, and not
PRIO, for selecting the wrong packets. My guess before was that TBF was at
fault, allowing too little bandwidth, which would lead to a general
stalling, which would be most noticeable on connections that are bandwidth
intensive.
A completely different reason may be that you've got a bad mixing of flows;
for example, "important" traffic like web browsing etc., and P2P don't go
well together in the same queue. This is simply because P2P has the habit
of opening hundreds of connection, whereas WWW is just one or at least
very few connections.
So if you've got maybe 5 WWW connections and 200 P2P connections flowing
through the same SFQ queue, every connection will be able to send about
the same number of packets, resulting in a lot of P2P packets and very few
WWW packets, just because there are so many more P2P connections there.
For that very reason, in my P2P setups I'm actually using 4 prio bands,
putting P2P alone into the 4th band, so that it may starve when there is
any traffic other than P2P.
> I think I am doing that. I thought that is what:
>
> iptables -t mangle -I POSTROUTING -o ppp0 -p tcp -m tcp --tcp-flags
> SYN,RST,ACK ACK -m length --length :128 -j CLASSIFY --set-class 2:1
I apologize; I'm guilty of not reading your messages carefully enough.
Regards,
Andreas Klauer
_______________________________________________
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* Re: [LARTC] tbf and prio blocking some flows entirely
2005-12-04 16:36 [LARTC] tbf and prio blocking some flows entirely Brian J. Murrell
` (3 preceding siblings ...)
2005-12-04 18:56 ` Andreas Klauer
@ 2005-12-04 22:07 ` Andy Furniss
2005-12-04 22:50 ` Brian J. Murrell
5 siblings, 0 replies; 7+ messages in thread
From: Andy Furniss @ 2005-12-04 22:07 UTC (permalink / raw)
To: lartc
Patrick McHardy wrote:
> Brian J. Murrell wrote:
>
>> I thought I had this all worked out, but it seems not. The following tc
>> configuration:
>>
>> tc qdisc del dev ppp0 root 2> /dev/null > /dev/null
>> tc qdisc add dev ppp0 root handle 1: tbf rate 120kbit burst 1200 limit 1
>
>
>> But it seems that some outbound flows are being blocked entirely. I
>> don't think they are being starved though. Even if they end up in 2:3,
>> they should at least be treated fairly. But I am producing a flow to
>> 66.1.2.3 which does increment the counters in 2:1 but after a few
>> packets the flow stalls:
>
>
> Your burst is too small. It needs to be at least one MTU.
Patrick do you know why prio is requeueing here?
I see the same testing with (a fixed) Brian's setup. If it's to get
length then it's going to be a bit out sometimes with sfq attached - it
will also messup sfq fairness whatever the reason.
Brian - limit is in bytes though you get away with it here by adding
prio/sfq, limit 1 would stop traffic if tbf was alone. Also if you ever
try tbf on ethX then burst/mtu/limit need to be your mtu + 14.
SFQ causes packet reordering when it perturbs and is best for bulk
traffic. I would put a shortish bfifo on interactive class (though in
practice you've kindof lost the battle if your interactive has queued,
so its sfq should be empty when a packet arrives anyway).
Andy.
_______________________________________________
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* Re: [LARTC] tbf and prio blocking some flows entirely
2005-12-04 16:36 [LARTC] tbf and prio blocking some flows entirely Brian J. Murrell
` (4 preceding siblings ...)
2005-12-04 22:07 ` Andy Furniss
@ 2005-12-04 22:50 ` Brian J. Murrell
5 siblings, 0 replies; 7+ messages in thread
From: Brian J. Murrell @ 2005-12-04 22:50 UTC (permalink / raw)
To: lartc
[-- Attachment #1.1: Type: text/plain, Size: 364 bytes --]
On Sun, 2005-12-04 at 19:46 +0100, Patrick McHardy wrote:
>
> Your burst is too small. It needs to be at least one MTU.
Bingo! I guess it's obvious that I don't really understand how burst
works. :-) But setting it to 1600 seems to have solved the problem.
Thanx!
b.
--
My other computer is your Microsoft Windows server.
Brian J. Murrell
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
[-- Attachment #2: Type: text/plain, Size: 143 bytes --]
_______________________________________________
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