<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7226.0">
<TITLE>RE: [LARTC] HFSC Advanced Limiting</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<BR>
<P><FONT SIZE=2>Thank you for your response.<BR>
<BR>
I do know how to shape a specific direction of traffic. Given that I am the ISP sitting between the customer and the Internet, it is trivial for me to shape both directions.<BR>
<BR>
Based on your response, I take it that 'tc filter' takes more of a performance hit than iptables?<BR>
<BR>
And yes, I have read the LARTC HOWTO and Google'd extensively. This is my current rough draft based on my specifications:<BR>
<BR>
#!/sbin/runscript<BR>
<BR>
start_test() {<BR>
PIPEID="1000"<BR>
USERNAME="test"<BR>
BASEUPLOAD="256"<BR>
BASEDOWNLOAD="384"<BR>
MAXUPLOAD="768"<BR>
BURSTUPLOAD=${MAXUPLOAD}<BR>
BURSTLENGTHUPLOAD="2000"<BR>
MAXDOWNLOAD="1500"<BR>
BURSTDOWNLOAD=${MAXDOWNLOAD}<BR>
BURSTLENGTHDOWNLOAD="2000"<BR>
VOIPBASEUPLOAD="80"<BR>
VOIPMAXUPLOAD="128"<BR>
VOIPSHAREDUPLOAD=${VOIPSHAREDUPLOAD}<BR>
VOIPBASEDOWNLOAD="80"<BR>
VOIPMAXDOWNLOAD="128"<BR>
VOIPSHAREDDOWNLOAD=${VOIPSHAREDDOWNLOAD}<BR>
VOIPLATENCY="30"<BR>
P2PBASEUPLOAD="0"<BR>
P2PMAXUPLOAD="256"<BR>
P2PSHAREDUPLOAD=${P2PMAXUPLOAD}<BR>
P2PBASEDOWNLOAD="0"<BR>
P2PMAXDOWNLOAD="384"<BR>
P2PSHAREDDOWNLOAD=${P2PMAXDOWNLOAD}<BR>
GENBASEUPLOAD="168"<BR>
GENMAXUPLOAD="768"<BR>
GENSHAREDUPLOAD=${GENMAXUPLOAD}<BR>
GENBASEDOWNLOAD="384"<BR>
GENMAXDOWNLOAD="1500"<BR>
GENSHAREDDOWNLOAD=${GENMAXDOWNLOAD}<BR>
start_user<BR>
M1=00; M2=07; M3=BA; M4=25; M5=21; M6=B7;<BR>
start_mac<BR>
}<BR>
<BR>
setup_main_devices() {<BR>
einfo "Starting bandwidth management on interfaces ..."<BR>
einfo " - Creating qdiscs on interfaces ..."<BR>
CMD="tc qdisc add dev eth0 root handle 1: hfsc default 1"<BR>
docmd<BR>
CMD="tc qdisc add dev eth1 root handle 2: hfsc default 1"<BR>
docmd<BR>
CMD="tc class add dev eth0 parent 1:0 classid 1:1 hfsc ls m2 100Mbit ul m2 100Mbit"<BR>
docmd<BR>
CMD="tc class add dev eth1 parent 2:0 classid 2:1 hfsc ls m2 100Mbit ul m2 100Mbit"<BR>
docmd<BR>
}<BR>
<BR>
start_user() {<BR>
einfo "Starting bandwidth management for ${USERNAME} ..."<BR>
einfo " - Creating classes on eth0 for upload control ..."<BR>
CMD="tc class add dev eth0 parent 1:0 classid 1:${PIPEID} hfsc ls m1 ${BURSTUPLOAD}Kbit d ${BURSTLENGTHUPLOAD}ms m2 ${BASEUPLOAD}Kbit ul m2 ${MAXUPLOAD}Kbit"<BR>
docmd<BR>
CMD="tc class add dev eth0 parent 1:${PIPEID} classid 1:${PIPEID}0 hfsc sc umax 1500b dmax ${VOIPLATENCY}ms rate ${VOIPBASEUPLOAD}Kbit"<BR>
docmd<BR>
CMD="tc class add dev eth0 parent 1:${PIPEID} classid 1:${PIPEID}1 hfsc ls m2 ${P2PSHAREDUPLOAD}Kbit ul m2 ${P2PMAXUPLOAD}Kbit"<BR>
docmd<BR>
CMD="tc class add dev eth0 parent 1:${PIPEID} classid 1:${PIPEID}2 hfsc rt m2 ${GENBASEUPLOAD}Kbit ls m2 ${GENSHAREDUPLOAD}Kbit ul m2 ${GENMAXUPLOAD}Kbit"<BR>
docmd<BR>
einfo " - Creating classes on eth1 for download control ..."<BR>
CMD="tc class add dev eth1 parent 2:0 classid 2:${PIPEID} hfsc ls m1 ${BURSTDOWNLOAD}Kbit d ${BURSTLENGTHDOWNLOAD}ms m2 ${BASEDOWNLOAD}Kbit ul m2 ${MAXDOWNLOAD}Kbit"<BR>
docmd<BR>
CMD="tc class add dev eth1 parent 2:${PIPEID} classid 2:${PIPEID}0 hfsc sc umax 1500b dmax ${VOIPLATENCY}ms rate ${VOIPBASEDOWNLOAD}Kbit"<BR>
docmd<BR>
CMD="tc class add dev eth1 parent 2:${PIPEID} classid 2:${PIPEID}1 hfsc ls m2 ${P2PSHAREDDOWNLOAD}Kbit ul m2 ${P2PMAXDOWNLOAD}Kbit"<BR>
docmd<BR>
CMD="tc class add dev eth1 parent 2:${PIPEID} classid 2:${PIPEID}2 hfsc rt m2 ${GENBASEDOWNLOAD}Kbit ls m2 ${GENSHAREDDOWNLOAD}Kbit ul m2 ${GENMAXDOWNLOAD}Kbit"<BR>
docmd<BR>
}<BR>
<BR>
docmd() {<BR>
if [[ "${CMD}" ]]; then<BR>
ebegin " - ${CMD}"<BR>
$CMD<BR>
if [[ $? -eq 0 ]]; then<BR>
eend 0;<BR>
else<BR>
eend 1;<BR>
fi<BR>
fi<BR>
}<BR>
<BR>
depend() {<BR>
need net<BR>
}<BR>
<BR>
start() {<BR>
stop<BR>
setup_main_devices<BR>
start_test<BR>
}<BR>
<BR>
stop() {<BR>
ebegin "Stopping QoS ruleset"<BR>
tc qdisc del dev eth0 root 2>&1 1>/dev/null<BR>
tc qdisc del dev eth1 root 2>&1 1>/dev/null<BR>
tc qdisc del dev eth2 root 2>&1 1>/dev/null<BR>
eend 0<BR>
}<BR>
<BR>
restart() {<BR>
stop<BR>
start<BR>
}<BR>
<BR>
$1<BR>
<BR>
Oddly, I keep getting these errors:<BR>
<BR>
<BR>
* Starting bandwidth management on interfaces ...<BR>
* - Creating qdiscs on interfaces ...<BR>
* - tc qdisc add dev eth0 root handle 1: hfsc default 1... [ ok ]<BR>
* - tc qdisc add dev eth1 root handle 2: hfsc default 1... [ ok ]<BR>
* - tc class add dev eth0 parent 1:0 classid 1:1 hfsc ls m2 100Mbit ul m2 100Mbit... [ ok ]<BR>
* - tc class add dev eth1 parent 2:0 classid 2:1 hfsc ls m2 100Mbit ul m2 100Mbit... [ ok ]<BR>
* Starting bandwidth management for test ...<BR>
* - Creating classes on eth0 for upload control ...<BR>
* - tc class add dev eth0 parent 1:0 classid 1:1000 hfsc ls m1 768Kbit d 2000ms m2 256Kbit ul m2 768Kbit... [ ok ]<BR>
* - tc class add dev eth0 parent 1:1000 classid 1:10000 hfsc sc umax 1500b dmax 30ms rate 80Kbit...<BR>
RTNETLINK answers: File exists [ !! ]<BR>
* - tc class add dev eth0 parent 1:1000 classid 1:10001 hfsc ls m2 256Kbit ul m2 256Kbit...<BR>
RTNETLINK answers: File exists [ !! ]<BR>
* - tc class add dev eth0 parent 1:1000 classid 1:10002 hfsc rt m2 168Kbit ls m2 768Kbit ul m2 768Kbit... [ ok ]<BR>
* - Creating classes on eth1 for download control ...<BR>
* - tc class add dev eth1 parent 2:0 classid 2:1000 hfsc ls m1 1500Kbit d 2000ms m2 384Kbit ul m2 1500Kbit... [ ok ]<BR>
* - tc class add dev eth1 parent 2:1000 classid 2:10000 hfsc sc umax 1500b dmax 30ms rate 80Kbit...<BR>
RTNETLINK answers: Invalid argument [ !! ]<BR>
* - tc class add dev eth1 parent 2:1000 classid 2:10001 hfsc ls m2 384Kbit ul m2 384Kbit...<BR>
RTNETLINK answers: Invalid argument [ !! ]<BR>
* - tc class add dev eth1 parent 2:1000 classid 2:10002 hfsc rt m2 384Kbit ls m2 1500Kbit ul m2 1500Kbit...<BR>
RTNETLINK answers: Invalid argument [ !! ]<BR>
<BR>
<BR>
Also, note that I am deleting the qdiscs that exist each time I start the script, so there should not be any entries that still exist when I run the script again.<BR>
<BR>
I'm also not certain if what I am doing here actually achieves my goals, but this is my best guess at the moment.<BR>
<BR>
And, just in case you are wondering, I have not gotten to the 'tc filter' or 'iptables <blah> -j CLASSIFY' parts yet.<BR>
<BR>
Thanks in advance.<BR>
<BR>
Eliot Gable<BR>
Certified Wireless Network Administrator<BR>
Cisco Certified Network Associate<BR>
CompTIA Security+ Certified<BR>
CompTIA Network+ Certified<BR>
Network and Systems Administrator<BR>
Great Lakes Internet, Inc.<BR>
112 North Howard<BR>
Croswell, MI 48422<BR>
810-679-3395<BR>
<BR>
<BR>
<BR>
-----Original Message-----<BR>
From: lartc-bounces@mailman.ds9a.nl on behalf of Jason Boxman<BR>
Sent: Thu 10/13/2005 3:45 PM<BR>
To: lartc@mailman.ds9a.nl<BR>
Subject: Re: [LARTC] HFSC Advanced Limiting<BR>
<BR>
On Thursday 13 October 2005 10:41, Eliot, Wireless and Server Administrator, <BR>
Great Lakes Internet wrote:<BR>
> I am investigating changing our broadband bandwidth control scripts over to<BR>
> HFSC. What I would like to accomplish is this:<BR>
><BR>
> { * DOWNLOAD *<BR>
<BR>
Read the replies to the thread "shape downstream of a ppp link" as the same<BR>
concept applies here. It's difficult to shape ingress traffic. You could,<BR>
nevertheless, employ hfsc in some fashion for ingress either with IMQ or by<BR>
attaching it to the LAN facing side of your network (pretend ingress is<BR>
egress).<BR>
<BR>
<snip><BR>
> What is the maximum number you can use on class IDs?<BR>
<BR>
0xFFF I believe. (If it's actually 0xFFFF someone correct me.)<BR>
<BR>
> How many customers should one router be able to handle with this kind of<BR>
> QoS policy?<BR>
<BR>
That's going to depend on many things, one of which being packet matching. <BR>
Were you going to use `tc filter` or, say, `iptables` matching? For the<BR>
former, with so many clients, others have posted they needed to use `tc<BR>
filter` with hashtables or the performance hit was huge for thousands of `tc<BR>
filter` rules. (i.e. unusable.)<BR>
<BR>
> With a P3 800MHz proccessor in a router, will I be able to implement this<BR>
> complex of a QoS policy and still have it handle 4,000 customers?<BR>
><BR>
> What about 10,000?<BR>
<BR>
Maybe.<BR>
<BR>
> Is there any way to do triple numbering for class IDs (i.e. 1:1:2 instead<BR>
> of 1:12)?<BR>
<BR>
No.<BR>
<BR>
> Also, if you do not know for certain any of the answers to these questions,<BR>
> please do not make conjecture. Only answer with facts. Thank you in advance<BR>
> for any responses to this.<BR>
<BR>
Excellent. Then I'm sure you've read LARTC HOWTO and Google'd extensively<BR>
already.<BR>
<BR>
--<BR>
<BR>
Jason Boxman<BR>
<A HREF="http://edseek.com/">http://edseek.com/</A> - Linux and FOSS stuff<BR>
<BR>
_______________________________________________<BR>
LARTC mailing list<BR>
LARTC@mailman.ds9a.nl<BR>
<A HREF="http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc">http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc</A><BR>
<BR>
<BR>
</FONT>
</P>
</BODY>
</HTML>