htb, tbf, cbq, etc are just type of queues. They are different in the way they proceed the traffic. In the grand scheme of things, you should understand the basic concept is as follow (I hope I get this right as it's been about 15+ years since last time I've used TC ;)):
- queueing is a method of handling or avoiding congestion
- queueing always happens on
- queueing can be achieved using different algorithms, which will give you different way of handling the traffic / preferring one over another, giving more fairness, etc
- classes are added to queues. One queue can have multiple classes.
- filters are used to select traffic / put traffic in classes.
To your questions now:
How should I order the classes?
Typically order classes hierarchically. You have a
root class and then you attach this class to a queue. You can then attach other child classes to the root class and they will all follow the same queueing discipline.
What are the steps that I should take care of?
- create queue
- add a root class & associate it with the queue
- add child classes to the root class
- add filters to put traffic to classes
What is the best type of qdisc to use?
This depends entirely on the type of traffic you're looking to queue. How aggressive do you want to be with it, how strict, fairness, etc, etc. You should read about the different queues disciplines and how one handles the traffic compared to another. There used to be a really good website - lartc.org, but I just tried opening it and ... it doesn't seem to be up & running anymore.
Check This which can help you.
Also check this one http://intronetworks.cs.luc.edu/1/html/queuing.html