Solved

HTB Advanced Config

Posted on 2003-11-07
5
428 Views
Last Modified: 2008-01-09
I have a gentoo distribution kernel 2.4.22 , with latest patch to htb and newest tc executable.
I have a 256kbps bandwidth and i wish to limit with htb clients like 32kbps or 64kbps.
I did that but the problem is that the web pages load very solw. The loading has a big delay.
I i download a file it downloads exactly at the limited speed but the web pages load with a high delay. How do i prioritze web pages before all else in each class of clients ?

Thanks
0
Comment
Question by:-Mihai-
5 Comments
 

Author Comment

by:-Mihai-
ID: 9701326
Also can i priorize certain traffic on certain ports ?
0
 
LVL 1

Accepted Solution

by:
Smudo earned 500 total points
ID: 9701937
Sure, you can priorize traffic on certain ports. You first must mark the packets with iptables:

iptables -t mangle -A TRAFFIC-SHAPING -p tcp --dport 80 -j MARK --set-mark 10

That will queue all packets with dport 80 in class 10. (which you can give the highest priority if necessary)

Here the whole example:

iptables -t mangle -A TRAFFIC-SHAPING -p tcp --dport 80 -j MARK --set-mark 10
iptables -t mangle -A TRAFFIC-SHAPING -s CLIENT1 -j MARK --set-mark 11
iptables -t mangle -A TRAFFIC-SHAPING -s CLIENT2 -j MARK --set-mark 12

tc qdisc add dev eth0 root handle 1: htb default 13
tc class add dev eth0 parent 1: classid 1:1 htb rate 256bit ceil 256kbit

tc class add dev eth0 parent 1:1 classid 1:10 htb rate 10kbit ceil 20kbit prio 0 (don't think that HTTP requests need more :)
tc class add dev eth0 parent 1:1 classid 1:11 htb rate 32kbit ceil 64kbit prio 1 (clients with 32/64kbit permission)
tc class add dev eth0 parent 1:1 classid 1:12 htb rate 64kbit ceil 128kbit prio 2 (clients with 64/128bit permission)
tc class add dev eth0 parent 1:1 classid 1:13 htb rate 50kbit ceil 256kbit prio 3 (DEFAULT class)

tc filter add dev eth0 parent 1:0 prio 1 protocol ip handle 10 fw flowid 1:10
tc filter add dev eth0 parent 1:0 prio 2 protocol ip handle 11 fw flowid 1:11
tc filter add dev eth0 parent 1:0 prio 3 protocol ip handle 12 fw flowid 1:12
tc filter add dev eth0 parent 1:0 prio 4 protocol ip handle 13 fw flowid 1:13

0
 
LVL 3

Expert Comment

by:snedelchev
ID: 13745083
http is burst traffic
tc class add dev eth0 parent 1:1 classid 1:10 htb rate 10kbit ceil 20kbit  burst 10kbit prio 0
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now