Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
traffic shaping
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Exci
Apprentice
Apprentice


Joined: 12 Jul 2002
Posts: 265
Location: The Netherlands, Zoetermeer

PostPosted: Fri Aug 15, 2003 3:11 am    Post subject: traffic shaping Reply with quote

I just wrote a simple script to cap my http and ftp server to 8KB/s
and I tried to cap the download speed of my clients.

I am using CBQ atm but I want to port it to HTB tomorrow.

My idea was to make a class that contains the max rate of my download speed - a few % (720, 768 would be max) and make that one bounded.
After that I wanted to make 'subclasses' for every client that has a rate of 512 and let it unbounded.

This way A client can download with a max of 720 by borrowing from other clients.

The Best way would be to let it equal around all clients (so that would be 'max-rate / number of clients' (thinking out loud helps ;))

ok for this (without my latest idea) I have this:

Code:

tc qdisc add dev eth1 root handle 2:0 cbq bandwidth 100Mbit avpkt 1000 cell 8

tc class add dev eth1 parent 2:0 classid 2:1 cbq bandwidth 100Mbit rate 700Kbit weight 72Kbit prio 8 allot 1514 cell 8 maxburst 20 avpkt 1000 bounded

tc class add dev eth1 parent 2:1 classid 2:5 cbq bandwidth 100Mbit rate 100Mbit weight 10Mbit prio 8 allot 1514 cell 8 maxburst 20 avpkt 1000
tc class add dev eth1 parent 2:1 classid 2:12 cbq bandwidth 100Mbit rate 512Kbit weight 51.2Kbit prio 5 allot 1514 cell 8 maxburst 20 avpkt 1000
tc class add dev eth1 parent 2:1 classid 2:13 cbq bandwidth 100Mbit rate 512Kbit weight 51.2Kbit prio 5 allot 1514 cell 8 maxburst 20 avpkt 1000
tc class add dev eth1 parent 2:1 classid 2:14 cbq bandwidth 100Mbit rate 512Kbit weight 51.2Kbit prio 5 allot 1514 cell 8 maxburst 20 avpkt 1000
tc class add dev eth1 parent 2:1 classid 2:15 cbq bandwidth 100Mbit rate 512Kbit weight 51.2Kbit prio 5 allot 1514 cell 8 maxburst 20 avpkt 1000

tc qdisc add dev eth1 parent 2:5 handle 5555: sfq perturb 10
tc qdisc add dev eth1 parent 2:12 handle 6802: sfq perturb 10
tc qdisc add dev eth1 parent 2:13 handle 6803: sfq perturb 10
tc qdisc add dev eth1 parent 2:14 handle 6804: sfq perturb 10
tc qdisc add dev eth1 parent 2:15 handle 6805: sfq perturb 10

# filters
tc filter add dev eth1 parent 2:0 protocol ip prio 1 u32 match ip dst 192.168.0.2 match ip src 0.0.0.0/0 flowid 2:12
tc filter add dev eth1 parent 2:0 protocol ip prio 1 u32 match ip dst 192.168.0.3 match ip src 0.0.0.0/0 flowid 2:13
tc filter add dev eth1 parent 2:0 protocol ip prio 1 u32 match ip dst 192.168.0.4 match ip src 0.0.0.0/0 flowid 2:14
tc filter add dev eth1 parent 2:0 protocol ip prio 1 u32 match ip dst 192.168.0.5 match ip src 0.0.0.0/0 flowid 2:15


I did not test if allot because of the following problem (but it seems to work):

I have a nfs host on the box that does this traffic shaping and I listen to mp3s and watch movies through nfs but with this trafficshaping it is slowed.

so What I want is somehow filter out the NFS and give that the max speed (100mbits)

anyone that has a clue or some pointers for this problem or traffic shaping tips? (my only source for rtfm was the advanced routing howto)
Back to top
View user's profile Send private message
69link
n00b
n00b


Joined: 18 Apr 2003
Posts: 53
Location: Sweden

PostPosted: Fri Aug 15, 2003 6:59 am    Post subject: Reply with quote

I guess you can do the most with tc filter, but to me it was much easier marking packets using iptables.

Look at this thread for ideas on how to do that: https://forums.gentoo.org/viewtopic.php?t=65244
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum