* Traffic shaping - class ID 16bit limit?
@ 2011-08-25 16:28 Miroslav Kratochvil
2011-08-25 16:39 ` Stephen Hemminger
0 siblings, 1 reply; 6+ messages in thread
From: Miroslav Kratochvil @ 2011-08-25 16:28 UTC (permalink / raw)
To: netdev
Hello everyone,
the question is simple: What should I do if I need to have more than
2^16 subclasses of a classful queuing discipline (in, say, hfsc or
htb)?
I bumped into this problem while writing some kind of traffic shaping
software and thinking about scalability. As there still are other ways
to have more than 64k "classes" (like grouping some subclasses into
separate qdiscs), those ways have significant drawbacks (require more
tc-filter rules and decisions, generally more processing power, and
the structure is quite hard to maintain).
Technically the ClassID seems to be "hardcoded" as a 16bit value, but
after some source searching, I haven't found any good reason for it to
be 16-bit only.
I understand that those ID's are usually handled together with another
16bit Qdisc ID, which would add up to a quite big number (possibly
unpleasant on some architectures) if those were both 32bit.
I also completely understand that in most cases of common usage
there's absolutely no need to have this big amount of subclasses, but
on the other hand there's still no reason to have "64k classes enough
for everyone". :D
Of course if there's some obvious method to solve this, or a patch, or
some kind of workaround that I haven't found, please let me know about
it, I will happily use it.
Thanks for any suggestions,
Mirek Kratochvil
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Traffic shaping - class ID 16bit limit?
2011-08-25 16:28 Traffic shaping - class ID 16bit limit? Miroslav Kratochvil
@ 2011-08-25 16:39 ` Stephen Hemminger
2011-08-25 17:06 ` Miroslav Kratochvil
2011-08-25 20:26 ` jamal
0 siblings, 2 replies; 6+ messages in thread
From: Stephen Hemminger @ 2011-08-25 16:39 UTC (permalink / raw)
To: Miroslav Kratochvil; +Cc: netdev
On Thu, 25 Aug 2011 18:28:01 +0200
Miroslav Kratochvil <exa.exa@gmail.com> wrote:
> Technically the ClassID seems to be "hardcoded" as a 16bit value, but
> after some source searching, I haven't found any good reason for it to
> be 16-bit only.
Granted it was a poor choice in the initial design.
It is wired into the API and changing it would be quite painful.
You might be able to do the same thing by splitting traffic
into multiple virtual devices (dummy or ifb) and then doing
another layer.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Traffic shaping - class ID 16bit limit?
2011-08-25 16:39 ` Stephen Hemminger
@ 2011-08-25 17:06 ` Miroslav Kratochvil
2011-08-25 17:10 ` Stephen Hemminger
2011-08-26 16:53 ` David Miller
2011-08-25 20:26 ` jamal
1 sibling, 2 replies; 6+ messages in thread
From: Miroslav Kratochvil @ 2011-08-25 17:06 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev
>> Technically the ClassID seems to be "hardcoded" as a 16bit value, but
>> after some source searching, I haven't found any good reason for it to
>> be 16-bit only.
>
> Granted it was a poor choice in the initial design.
> It is wired into the API and changing it would be quite painful.
>
I was feeling something like that would come.
If I get it correctly, the API change would consist of:
- some netlink protocol change
- slight modification of qdisc_class_hash
- modifications in all (four?) hierarchical schedulers
- tiny expansion of userspace tc utility
which isn't that painful (except for the CBQ part), but I'm probably
missing something, and presumably the change would take some time to
get mainstream -- probably way more time than writing a hfsc clone
that is controlled using some other interface than tc/netlink. :(
(but hey! I have a topic for school work!)
> You might be able to do the same thing by splitting traffic
> into multiple virtual devices (dummy or ifb) and then doing
> another layer.
>
My scenario looks pretty simple, mostly like a big hashing filter
attached at the device root, flowid'ing the stuff to leaf classes.
Could you please provide some simple illustration of splitting that
into multiple devices? I guess that the main problem with this
approach would be that my subclasses usually don't share anything in
common, especially not any pretty IP prefixes that would allow good
splitting.
Anyway, thanks very much for response!
-mk
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Traffic shaping - class ID 16bit limit?
2011-08-25 17:06 ` Miroslav Kratochvil
@ 2011-08-25 17:10 ` Stephen Hemminger
2011-08-26 16:53 ` David Miller
1 sibling, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2011-08-25 17:10 UTC (permalink / raw)
To: Miroslav Kratochvil; +Cc: netdev
On Thu, 25 Aug 2011 19:06:58 +0200
Miroslav Kratochvil <exa.exa@gmail.com> wrote:
> >> Technically the ClassID seems to be "hardcoded" as a 16bit value, but
> >> after some source searching, I haven't found any good reason for it to
> >> be 16-bit only.
> >
> > Granted it was a poor choice in the initial design.
> > It is wired into the API and changing it would be quite painful.
> >
>
> I was feeling something like that would come.
>
> If I get it correctly, the API change would consist of:
>
> - some netlink protocol change
> - slight modification of qdisc_class_hash
> - modifications in all (four?) hierarchical schedulers
> - tiny expansion of userspace tc utility
And all the magic compatiablity layers to make old code
work with new code.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Traffic shaping - class ID 16bit limit?
2011-08-25 16:39 ` Stephen Hemminger
2011-08-25 17:06 ` Miroslav Kratochvil
@ 2011-08-25 20:26 ` jamal
1 sibling, 0 replies; 6+ messages in thread
From: jamal @ 2011-08-25 20:26 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Miroslav Kratochvil, netdev
On Thu, 2011-08-25 at 09:39 -0700, Stephen Hemminger wrote:
> Granted it was a poor choice in the initial design.
> It is wired into the API and changing it would be quite painful.
>
You should be able to have infinite queues if you use the
hierachies. i.e each hierachy should expose a new 16 bit
namespace.
cheers,
jamal
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Traffic shaping - class ID 16bit limit?
2011-08-25 17:06 ` Miroslav Kratochvil
2011-08-25 17:10 ` Stephen Hemminger
@ 2011-08-26 16:53 ` David Miller
1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2011-08-26 16:53 UTC (permalink / raw)
To: exa.exa; +Cc: shemminger, netdev
From: Miroslav Kratochvil <exa.exa@gmail.com>
Date: Thu, 25 Aug 2011 19:06:58 +0200
>>> Technically the ClassID seems to be "hardcoded" as a 16bit value, but
>>> after some source searching, I haven't found any good reason for it to
>>> be 16-bit only.
>>
>> Granted it was a poor choice in the initial design.
>> It is wired into the API and changing it would be quite painful.
>>
>
> I was feeling something like that would come.
>
> If I get it correctly, the API change would consist of:
>
> - some netlink protocol change
> - slight modification of qdisc_class_hash
> - modifications in all (four?) hierarchical schedulers
> - tiny expansion of userspace tc utility
There is precedence as we had to make the routing table rule ID larger
and were successfully able to do so using netlink attributes.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-08-26 16:53 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-25 16:28 Traffic shaping - class ID 16bit limit? Miroslav Kratochvil
2011-08-25 16:39 ` Stephen Hemminger
2011-08-25 17:06 ` Miroslav Kratochvil
2011-08-25 17:10 ` Stephen Hemminger
2011-08-26 16:53 ` David Miller
2011-08-25 20:26 ` jamal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).