LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 04-14-2005, 07:32 AM   #1
laotalax
LQ Newbie
 
Registered: Apr 2005
Posts: 9

Rep: Reputation: 0
HTB configuration problem


Hello,

I've got a lan + routrer (Mandrake 10.1) + 64 kB/s channel. I want to shape traffic among users, so I've given the highest priority to the http traffic - rate 40kbps ceil 64kbps, then I've limited the usage of th external ftp server ip 212.59.13.36 to rate 8kbps ceil 8kbps (I want everyone to use my local ftp rather than external), finally I've given rate 16kbps ceil 24kbps to all the other traffic. So I've written a script and put it into etc/rc.d/rc.local:

# eth1 is plugged to DSL
tc qdisc add dev eth1 root handle 1: htb default 4

tc class add dev eth1 parent 1: classid 1:1 htb rate 64kbps ceil 64kbps
tc class add dev eth1 parent 1:1 classid 1:2 htb rate 40kbps ceil 64kbps
prio 1
tc class add dev eth1 parent 1:1 classid 1:3 htb rate 8kbps ceil 8kbps
prio 3
tc class add dev eth1 parent 1:1 classid 1:4 htb rate 16kbps ceil 24kbps
prio 2

tc filter add dev eth1 protocol ip parent 1:0 prio 1 u32 match ip sport 80
0xffff flowid 1:2
tc filter add dev eth1 protocol ip parent 1:0 prio 3 u32 match ip src
212.59.13.36 match ip dst 192.168.0.0/24 flowid 1:3

tc qdisc add dev eth1 parent 1:2 handle 2: sfq perturb 10
tc qdisc add dev eth1 parent 1:3 handle 3: sfq perturb 10
tc qdisc add dev eth1 parent 1:4 handle 4: sfq perturb 10

But it doesn't work. It doesn't shape any traffic, moreover whenever anyone is connected to that ftp the channel is usually congested and it is impossible to browse inet. Please, help if you can. Thanks in advance.
 
Old 04-14-2005, 06:04 PM   #2
fr_laz
Member
 
Registered: Jan 2005
Location: Cork Ireland
Distribution: Debian
Posts: 384

Rep: Reputation: 32
Hi,

I may be all wrong, but are your users on your local LAN and downloading from a remote FTP server ?
If so, then QoS won't help very much, since there's no point to use QoS on incomming trafic from a DSL line.
The heavy trafic you have is incomming trafic from the ftp server, but when it hits your Linux box (or QoS enabled router) the harm is allready done : ftp trafic has used your DSL bandwidth, it's only dropped when incomming your box...
QoS on icoming trafic can only have a meaning if both your network links have the same rate. If you wabt to have real QoS in your case, you enable it on your ftp server also.

In case I misunderstood you, please forgive me.
 
Old 04-21-2005, 01:37 AM   #3
frostschutz
Member
 
Registered: Apr 2004
Distribution: Gentoo
Posts: 63

Rep: Reputation: 16
With that script of yours, you're only shaping what users are sending to the internet, and not what they are receiving from the internet. So it doesn't do anything for http which is download traffic, and nothing for ftp downloads. It should do something for ftp uploads, though, as long as those filter rules work.

To affect download traffic, you'll have to shape incoming packets, if you are on a router probably by shaping outgoing traffic of the LAN interface. @fr_laz while it is true that shaping incoming traffic like that isn't the optimal solution, reordering / dropping incoming packets on the router can improve usability a lot.
 
Old 04-21-2005, 04:42 AM   #4
fr_laz
Member
 
Registered: Jan 2005
Location: Cork Ireland
Distribution: Debian
Posts: 384

Rep: Reputation: 32
Hi

Quote:
reordering / dropping incoming packets on the router can improve usability a lot
Ok, I'll give a try, even though I really don't think the improve will be noticeable...
I'll try your script too. I also wanted to have a look at hping, that's the moment to set up a lab
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
htb.init divide trafic in groups ? Problem .. sys7em Linux - Networking 0 08-18-2005 05:35 AM
QoS with HTB: Multi-session problem diaskimo Linux - Networking 0 08-01-2005 08:21 PM
HTB as a child of another HTB - doesn't work ddaas Linux - Networking 5 07-25-2005 03:21 AM
problem configuring htb abhishekg Linux - Networking 2 04-02-2005 12:15 PM
How To HTB linuxcolor Fedora 1 02-15-2005 07:46 AM


All times are GMT -5. The time now is 03:38 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration