A definitive, example-driven, HFSC Reference Thread
-
@KOM:
Thanks a lot George for your contribution. I've seen you here before and I've read all your HFSC posts, but I didn't think you were around much anymore.
Question: As I was creating the queues as per your directions, the GUI kept yelling at me 10-11 times about this same error:
(There were errors loading the rule(s): pfctl: the sum of the child bandwidth higher than parent root_em0 - The line in question reads (0): )
Did you see this? I went through and checked everything again and it looks good, but I still have the errors. Is this normal when you're building the queues manually?
When I look at Status - Queues, all I have are Root Queue and qLink. All the others aren't being shown.
That message shows up when the sum of the bandwidth assigned to the children queues is higher than the parent queue. There must be some value not set properly. Probably the bandwidth of the interface itself? (leave it blank)
You can post the generated rules from rules.debug and we'll see…
-
In my lab, I gave it an arbitrary bandwidth of 9Mb/s up/down. Then I followed your directions exactly and pumped in all the specified percentages. Did you mean to say that actual percentages should be used in the GUI, or were you meaning that we should pump in n% of the actual bandwidth number? maybe I'll run through it again here at home. Won't be back in the office until Monday.
Edit: SO I just spun up the lab and tried it. I set WAN and LAN bandwidth to 9Mb/s. I created qLink next, set it to default, gave it bandwidth 20% and LS 20%. Then I created qInternet and gave it UL 95% LS 95%. As soon as I applied it, the same error appears. See attached pics.
-
Dont put the bandwidth vaule on LAN and WAN. Put the value on qInternet. Leave the WAN and LAN blank and you should not get the error.
You want the qDNS to be under the qInterent. qLink and qInternet should be on the same level.
-
Thank you. That wasn't clear to me. No errors when I applied the shaper.
Edit: Not so fast. I went to Status - Queues and it failed to load the queues at all, and the error appeared in the statusbox again.
-
I would blow it all away and redo it from scratch. I can try it in my lab later and see what I get.
-
Dont put the bandwidth vaule on LAN and WAN. Put the value on qInternet. Leave the WAN and LAN blank and you should not get the error.
You want the qDNS to be under the qInterent. qLink and qInternet should be on the same level.
Yep, exactly. The idea is not to limit the interface itself but the queues, since you might have local devices lying on your WAN subnet
-
I went back to my snapshot and tried again with the bandwidth value removed from WAN and LAN and added to both qInternet queues. Same result with a slightly different error:
(There were errors loading the rule(s): pfctl: linkshare sc exceeds parent sc root_em0 - The line in question reads (0): )
-
Are you staggering the queues though?
It should be like this:
LAN
qLink - 20%
qInternet - 95% of your real download vaule
qDNS - x%
qBulk - y%x + y have to be less than value of qInternet
-
I know what it's going on here. You should not type "95%" but the real amount, in Mbps or Kbps, that represents the 95% of your real speed
-
Where, in the Bandwidth combobox or the service curve variable boxes? Or both?
Edit: Never mind. It seems to not like using % at all. I had to convert everything to Kb and Mb instead of %, and then finally my queues appeared in Status.
It should be like this:
LAN
qLink - 20%
qInternet - 95% of your real download vaule
qDNS - x%
qBulk - y%I had the proper parent/child hierarchy but that wasn't my problem.
In your example, what is the relationship between qLink and qInternet as far as bandwidth is concerned? They are both at the same level, but qLink has 20% and qInternet has 95% for a total of 115%. I don't know how that is.
-
Since there is no value on LAN , the value on qLink does not matter as it is default and for local traffic. The only thing that matters is the value on qInternet . That defines how much the child queues have.
It's kind of weird I know but it does work.
-
Since there is no value on LAN , the value on qLink does not matter as it is default and for local traffic.
Can you leave it blank or must you provide some value, which is then subsequently ignored?
Set qDNS as having 30% realtime and 10% linkshare (and bandwidth).
Another question, sorry. What is the bandwidth relationship above, and how does it figure into the parent/child calculations? If I have parent qInternet at 10Mb and children qDNS at 1 Mb and qBulk at 9Mb, do I set qDNS's RT to 300Kb and LS to 100Kb as per 30%/10% above? Is it supposed to add up to 1 Mb, the bandwidth total for the parent qInternet?
-
It needs a value. 20% is fine for a random value. qDNS can be set at whatever you want. I just used 30% as an example.
-
But what's qDNS's relationship between RT, LS and bandwidth? LS and bandwidth are the same variable, so for my example, where qDNS bandwidth is 1Mb, I would set LS to 1 Mb and RT to 3 Mb (30%)? If so, that extra 2Mb above what the bandwidth setting is, where does that come from?
-
I wouldn't set the RT to anything except for your priority queues. RT say it gets X amount of bandwidth ALL the time so if you give qDNS 3MBIT then it gets 3Mbit all the time. So that extra 2Mbit comes from whatever qInternet is set for , your case 9Mbit.
-
I would only ever use RT for VoIP traffic and ACK, typically. OK, so it draws from the parent queue. Sorry for asking endless questions but it's the only way to wrap my head around the whole thing and connect the dots between all the elements so that it makes sense. I don't like following instructions without knowing what I'm doing and why,
-
No worries. That is the best way to learn.
-
Thanks sideout, georgeman.
A couple things:
georgeman:
I know you specify this in the text, but in the floating match rules we still do not apply "quick" right? This means that the qBulk rule has to come before the more specific qDNS rule. One might be misled by the order in the text.
sideout/all:
The realtime queue you're discussing only applies when there's contention/congestion right? If I specify 30% realtime for qDNS and there is no DNS traffic being placed in the queue, the other queues are not absentmindedly robbed of the 30% bandwidth, if I understand things.
This has all been a really big help. I appreciate it. I am currently implementing the solution provided by georgeman on my bench. More later.
-
From my understanding - RT means that X% is taken automatically for that queue even if there is no traffic in the queue. At least that is the way it reads to me. For what I use it for , qGaming that is a non issue as my use of HFSC is with traffic shaping at LAN parties so qGaming is my highest priority queue. I use the following queues:
LAN
qInternet - bandwidth - 50MBit - I have 4 cable modems but putting in 200Mbit here would not be the correct thing to do as I cannot bond them to get 200Mbit
qGaming - gaming traffic - RT 30% / bandwidth - 40% / LS - 40%
qHTTPSTeam - bandwidth - 20% / LS 20%
qWEBTraffic - bandwidth - 20% / LS 20%
qACK - bandwidth - 20% / LS 20%qLink - bandwidth - 20% / LS - 20% - default queue
WAN - 5MBIT - I have 4 WAN's so each are 5Mbit upload
qLink - bandwidth - 10% / LS - 10% - Default queue
qGaming - bandwidth 40% / RT - 20% / LS 40%
qHTTPSteam - bandwidth - 20% / LS 20%
qWEBTraffic - bandwidth - 20% / LS 20%
qACK - bandwidth - 10% / LS 10%I use the floating rules to put DNS in the qGaming so it gets good response. General web traffic goes into qWEBTraffic and then I use rules to put Steam traffic into qHTTPSteam.
I use interface rules to direct gaming traffic out different wans via gateway groups. I allocate one modem / wan to like LoL gaming traffic , another to BF4 . I dedicate one modem to strictly web traffic and another modem is reserved for staff use and downloads as I have a limiter on for DHCP addresses to restrict all TCP connections to typically 25Mbit for everyone.This way I can get the best ping times and still give everyone bandwidth to do what they need without being too restrictive.
-
I'd like to see your ruleset if it isn't too much trouble.