LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 07-13-2015, 08:17 PM   #1
tomschuring
LQ Newbie
 
Registered: Nov 2010
Posts: 13

Rep: Reputation: 0
tc to limit download speed not working


i have a simple set of rules to limit download speed from port 80, but when i download (using wget) that speed is broken by a factor of 56 times..
so i reckon i'm doing something wrong.

tc rules:
Code:
sudo /sbin/tc qdisc del dev ppp0 root
sudo /sbin/tc qdisc add dev ppp0 root handle 1: htb default 30
sudo /sbin/tc class add dev ppp0 parent 1: classid 1:1 htb rate 1Kbit
sudo /sbin/tc filter add dev ppp0 protocol ip parent 1:0 prio 1 u32 match ip dport 80 0xffff flowid 1:1
wget:
Code:
wget http://ftp.au.debian.org/debian/dists/squeeze/main/binary-armel/Packages.gz
--2015-07-14 10:53:14--  http://ftp.au.debian.org/debian/dists/squeeze/main/binary-armel/Packages.gz
Resolving ftp.au.debian.org... 218.100.43.30
Connecting to ftp.au.debian.org|218.100.43.30|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8214629 (7.8M) [application/x-gzip]
Saving to: `Packages.gz'
100[======================================================================>] 8,214,629   56.8K/s   in 4m 4s   

2015-07-14 11:02:24 (32.8 KB/s) - `Packages.gz' saved [8214629/8214629]
i can see the rule is being triggered, it's just not limiting the speed

cbq.init stats output:
Code:
### eth0: queueing disciplines

qdisc pfifo_fast 0: root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
 Sent 6252435 bytes 22005 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0 

### ppp0: queueing disciplines

qdisc htb 1: root refcnt 2 r2q 10 default 30 direct_packets_stat 182
 Sent 35543 bytes 580 pkt (dropped 1781, overlimits 2670 requeues 0) 
 backlog 0b 2p requeues 0 

### ppp0: traffic classes

class htb 1:1 root prio 0 rate 1000bit ceil 1000bit burst 1600b cburst 1600b 
 Sent 22238 bytes 401 pkt (dropped 1781, overlimits 0 requeues 0) 
 rate 936bit 2pps backlog 0b 3p requeues 0 
 lended: 398 borrowed: 0 giants: 0
 tokens: -6997893 ctokens: -6997893


### ppp0: filtering rules

filter parent 1: protocol ip pref 1 u32 
filter parent 1: protocol ip pref 1 u32 fh 800: ht divisor 1 
filter parent 1: protocol ip pref 1 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:1  (rule hit 2343 success 2182)
  match 00000050/0000ffff at 20 (success 2182 )
any hints ?

Last edited by tomschuring; 07-13-2015 at 08:19 PM. Reason: updated cbq.init stats output
 
Old 07-21-2015, 02:46 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,850

Rep: Reputation: 161Reputation: 161
The filter command should be like follow,
sudo /sbin/tc filter add dev ppp0 protocol ip parent 1 prio 1 u32 match ip dport 80 0xffff flowid 1:10
 
1 members found this post helpful.
  


Reply

Tags
bandwidth, tc



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
Limit the download speed of KVM based VM priyanss Linux - Newbie 2 11-22-2013 05:01 AM
limit download speed qrange Linux - Networking 1 03-29-2011 08:47 AM
applying download speed limit iptables qwertyjjj Linux - Server 12 11-10-2010 05:44 PM
Upload speed limiting to increase download speed dangerousdave Linux - Networking 6 02-16-2010 03:19 PM
Why is my internet upload speed greater than my download speed? km4hr Linux - Networking 1 05-27-2008 08:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:08 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration