# cbq or hfsc?



## dpetka2001 (Feb 24, 2011)

Hi there, 

I would like to set up my FreeBSD machine to do the routing for my internal network and also would like to use pf for bandwidth management across 3 machines in my network

I've read the pf handbook on the OpenBSD site and it only gives information about the cbq scheduler I've read that there is also hfsc and my question is which one of the two I should prefer.

Under which circumstances does one prefer cbq over hfsc and vice versa?

Thanks in advance.


----------



## dpetka2001 (Feb 25, 2011)

Does anyone have any suggestions on whether I should use cbq or hfsc?

Or it doesn't matter which one I should use?


----------



## Eldiemo (Mar 1, 2011)

I prefer HFSC but maybe CBQ suits more to your needs.
Search and read about the differences, then make your choice.

If you decide to use HFSC then the following link will explain a lot how to configure HFSC.

https://calomel.org/pf_hfsc.html

Cheerz,


----------



## dpetka2001 (Mar 2, 2011)

I've read that link. Could you please help me understand the use of linkshare? Realtime should be used for guaranteeing a minimum bandwidth to a queue. How about linkshare?


----------



## Eldiemo (Mar 2, 2011)

Realtime is guaranteed. Linkshare is the same as bandwidth with the option of using the service curve. Upperlimit will kick in as a border.

The service curve you only need for some bursting power. You don't need linkshare, bandwidth is enough.

CBQ will be fine but when you choose HFSC then use something like this:


```
altq on $interface bandwidth 10Mb hfsc queue {bulkqueue, A, B, C}
queue bulkqueue bandwidth 1Mb priority 10 qlimit 500 hfsc (upperlimit 1Mb default)
queue A         bandwidth 3Mb priority 9  qlimit 500 hfsc (realtime 2Mb)
queue B         bandwidth 3Mb priority 8  qlimit 500 hfsc (realtime 2Mb)
queue C         bandwidth 3Mb priority 7  qlimit 500 hfsc (realtime 2Mb)
```

Instead of realtime you can also use upperlimit and play with the priorities and the given bandwidth.


----------



## dpetka2001 (Mar 3, 2011)

In your example if 3 queues don't use bandwidth at all, then will the fourth one be able to use it? Ffor example will queue C be able to use all 10Mb if any of the others queues don't use any bandwidth at all? I thought that with linkshare you define which of the queues will be able to use the unneeded bandwidth...am I wrong?


----------



## Eldiemo (Mar 3, 2011)

No need for HFSC with that setup. You can make the perfect configuration with CBQ.

Read this information and I'am sure you'll be fine.

http://www.openbsd.org/faq/pf/queueing.html#altq


----------



## dpetka2001 (Mar 4, 2011)

But i would like to play with both schedulers to see if there is any difference.

So could you please enlighten me as far as the use of linkshare is concerned?? If that's not too much trouble for you.

Thanks in advance.


----------

