dynamic throtteling and qos

Hi guys

I need to implement some form of dynamic throttel between two users of an adsl line. The line syncs at around 4mbps and so to be fair the users should be expecting half that at any given point. However, it seems a huge waste of available bw to hard-limit the users to 2mbps each, as they may not always be using that must. Thus i would like to implement some form of smart/dymanic queue that would be able to detect if both users are draining their bw, and then limit them equaly. But at the same time, should one user be idle or utilizing very little bw, the residule should be allocated to the other user as free bw. However, the moment the the original user of that donated bw requires it back (say for streaming a video etc) the mt should immediatly allocate it back to that user and they will then both be limited/throtteled equaly (assuming both are using max bw, otherwise the idle bw will be allocated to the active user).

The goal here is that the users both experience the best possible service for their connection speed (which cannot be increased). Thus, efficiency is key here. Obviously, if they should choose to run background dl’s their browsing experience will greatly suffer from this, but that is their own responsibility.

I thought about implementing some que trees to achieve this, but would just like to confirm before hand if this would be the best possible method. They both have multiple devices connecting to the network, seperated by address lists.

I briefly read through an article on qos on the wiki, refencing the use of htb etc but i am quite hazy on that and do quite know if that would be the required route for me to follow. Would it be needed for me to implement some form of qos and prioritization as addition to the throtteling?

I anyone can shed some light on this for me, I would really appreciate it, as I am a little out of my deapth hear.

Thanks so much.

The whole idea of qos is dynamic throttling. what you want to accomplish is easily possible. i would go with queue tree with the combination of pcq . create a mangle rule to mark the packets going to those 2 users, create a pcq queue type without specifying a rate limit and set the classifier to ‘dst. address’. and then create a queue tree, set it to capture those marked packets, set the queue type to the pcq type you’ve just created, and set the ‘Max. limit’ a bit lower than your maximum bandwidth available ( as a rule of thumb, its %20 less than the actual bandwidth your purchase from your isp).

Thats it. now pcq will take care of everything. the thing that i love about pcq is the fact that you don’t need to create any extra rule for new users. but i guess you could also get the same result by creating a parent queue with max. limit specified, and add those 2 users as the children, sharing the same priority.