Skip to contentSkip to conversation

Help needed with traffic control script.

LARTC Omry Yadan 2 participants 3 messages Oct 25, 2005 – Oct 26, 2005

lore
Share & tools
lore

Omry Yadan

author
#0 lore raw

Hi.

I am having shaping traffic using tc, I have been trying for a very long time, and I just didn't get it to work the way I want it.

I will really appriciate it if you experts will have a look at my script and tell me what I do wrong.

First, I`ll describe my envornment, than my requirements.

I run a small server on Debian etch with kernel version 2.6.7.

the server ip is 10.0.0.2

I have another machine in the lan, its ip is 10.0.0.1

I am connected to the internet via adsl model that acts as a router (10.0.0.138, I set it to be the gateway for both machines).

my upload capacity is around 110 Kilo-bytes per second.

I want to control engress on the server.

my requrements:

1. I want the server to use no more than 100 Kbps when sending to the internet.

2. I don't want to limit the upload at all to other machines in the network (packets to the network gets free pass).

3. I want good download performence to the server. (prioritize ACK and high TOS packets).

4. I want http traffic to the internet (not to the LAN) get at least 81Kbps (if it needs it).

5. I want other traffic to the internet get at least 9Kbps (if it needs it).

6. I want traffic http traffic to be shared fairly between connected ip addresses, meaning if

two clients connects, one opens many connections and one opens one
connection, I want them both to get approximatly

the same bandwidth.

to do all this, I am trying to create a tree like this:

ROOT_QUEUE (HTB)

+- LAN_QUEUE (HTB, rate 100Mbit)

+- INET_QUEUE (HTB, rate 100Kbps)

+ INET_INTERACTIVE (HTB, rate 10Kbps, ceil 100Kbps, prio 2)

+ INET_DEFAULT (HTB, rate 90Kbps, ceil 100Kbps, prio 1)

+ INET_HTTP (HTB, rate 81Kbps, ceil 90Kbps)

+ SFQ

+ INET_UNCLASSIFIED (HTB, 9Kbps, ceil 90Kbps)

+SFQ

attached is my script, which does not seem to work.

some of the problems with it currently are :

1. unclassified packets (not http) can get bandwidth even if http needs it

2. users with many connections opened to http gets more bandwidth than users with few connections.

Thanks.

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

author
#1 lore raw

had a problem with previous script (debug exit early in it), please look at this one instead.

while writing the previous message I found and fixed some problem in the script.

because of this 'exit' I didn't really test the changnes.

it seems that now "unclassified" packagets no longer grabs bandwidth from http, but on the other hand -

it takes a very long time to open an ssh connection from the server to a machine on the internet while users are downloading.

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

#2 lore raw
In reply to Omry Yadan

had a look.

seems like you change is cosmetic only, or did I missed it?

Quoted 33 lines · panca sorin
Quoted 11 lines · --- Omry Yadan

had a problem with previous script (debug exit early in it), please look
at this one instead.

while writing the previous message I found and fixed some problem in the
script.

because of this 'exit' I didn't really test the changnes.

Quoted 10 lines

it seems that now "unclassified" packagets no longer grabs bandwidth
from http, but on the other hand -

it takes a very long time to open an ssh connection from the server to a
machine on the internet while users are downloading.

What about incomming packets? how can you be sure that interractive traffic gets to you from the internet first when you download something? Priorize control packets, too. (ACK, SYN and SYN ACK).
I modified your script and added some new variables.

Quoted 4 lines

__________________________________
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc