Networking Forums

Networking Forums > Computer Networking > Linux Networking > QoS : very simple script needed

Reply
Thread Tools Display Modes

QoS : very simple script needed

 
 
MagicFr
Guest
Posts: n/a

 
      09-04-2004, 03:43 PM
hi,

i try to read howto's and other papers about QoS with Linux... i must
say i understood a little how stuff works, but i cant figure out, how to
make a very simple script.

From what i read, i only need to change the TOS headers.

I have several applications :

1)
- Games
- Interactive stuff ( browsing )

2)
- Web server
- FTP server
- Game Server

3)
- mldonkey

I know the port use for each apps.

So i just want to tag ML donkey to use the slowest fifo(n° 2) in the
fifo_fast.

All my servers ( web,ftp,game) must use the fifo n° 1

And game packet must use the fifo n°0

How could i do this ????

I use iptables for forwarding and firewall rules.

Thanks for any help
Seb.

my linux : RedHat9, i.e. kernek 2.4.80.x
 
Reply With Quote
 
 
 
 
MagicFr
Guest
Posts: n/a

 
      09-04-2004, 05:17 PM
MagicFr wrote:
> hi,
>
> i try to read howto's and other papers about QoS with Linux... i must
> say i understood a little how stuff works, but i cant figure out, how to
> make a very simple script.
>
> From what i read, i only need to change the TOS headers.
>



port 27000:27030 is port used for Counter Strike
port 4662 is used by 'emule'

Seems that it's not working, when i play CS i have 10ms of ping.
If i launch emule , my ping drop beetween 50 to 120 ms.
If i understood correclty the TOS thing, i should not see any diffrence
because emule packet should always wait for other packet to have acces
to internet before them.

CS and emule are running from windows connected to linux gateway by
ethernet card, internet connection is by ethernet too.

ISP www.free.fr Freebox fastpath activated.

My mangle configuration.

*mangle
:PREROUTING ACCEPT [58750:53452959]
:INPUT ACCEPT [57439:53485156]
:FORWARD ACCEPT [4668:345779]
:OUTPUT ACCEPT [41183:5423214]
:POSTROUTING ACCEPT [48551:5947829]

-A PREROUTING -p tcp --sport 27000:27030 -j TOS --set-tos Minimize-Delay
-A PREROUTING -p tcp --dport 27000:27030 -j TOS --set-tos Minimize-Delay
-A PREROUTING -p tcp --dport 4662 -j TOS --set-tos Maximize-Throughput
-A PREROUTING -p udp --dport 4662 -j TOS --set-tos Maximize-Throughput
-A PREROUTING -p tcp --sport 4662 -j TOS --set-tos Maximize-Throughput
-A PREROUTING -p udp --sport 4662 -j TOS --set-tos Maximize-Throughput

-A OUTPUT -p tcp --sport 27000:27030 -j TOS --set-tos Minimize-Delay
-A OUTPUT -p tcp --dport 27000:27030 -j TOS --set-tos Minimize-Delay
-A OUTPUT -p tcp --dport 4662 -j TOS --set-tos Maximize-Throughput
-A OUTPUT -p udp --dport 4662 -j TOS --set-tos Maximize-Throughput
-A OUTPUT -p tcp --sport 4662 -j TOS --set-tos Maximize-Throughput
-A OUTPUT -p udp --sport 4662 -j TOS --set-tos Maximize-Throughput

regards,
Seb
 
Reply With Quote
 
Geoffrey King
Guest
Posts: n/a

 
      09-04-2004, 10:06 PM
On Sat, 04 Sep 2004 17:43:56 +0200, MagicFr wrote:

> i try to read howto's and other papers about QoS with Linux... i must
> say i understood a little how stuff works, but i cant figure out, how to
> make a very simple script.


Step 1 of trying to do anything on Linux, check see if someone else has
done it before you. ie, don't re-invent the wheel, or in this case
wondershaper.

http://lartc.org/wondershaper/

You should be able setup wondershaper to do what you want. Make sure you
read the README file thoroughly.

--
The only thing worse than X Windows: (X Windows) - X

 
Reply With Quote
 
MagicFr
Guest
Posts: n/a

 
      09-05-2004, 10:13 AM
Geoffrey King wrote:

>
> Step 1 of trying to do anything on Linux, check see if someone else has
> done it before you. ie, don't re-invent the wheel, or in this case
> wondershaper.
>
> http://lartc.org/wondershaper/
>
>

U are 100% right I didnt give details enough I already know about
wondershaper But this is NOT what i want. Wondershaper give priority
to upload and small packets against big packets. This wil not work for
what i want to do.

Despite that i tried this script and i do see a difference, amule was
faster against my games

anyway thanks for ur reply

Seb.
 
Reply With Quote
 
P Gentry
Guest
Posts: n/a

 
      09-05-2004, 03:43 PM
MagicFr <(E-Mail Removed)> wrote in message news:<4139f8df$0$26980$(E-Mail Removed)>...
> MagicFr wrote:
> > hi,
> >
> > i try to read howto's and other papers about QoS with Linux... i must
> > say i understood a little how stuff works, but i cant figure out, how to
> > make a very simple script.
> >
> > From what i read, i only need to change the TOS headers.
> >

>
>
> port 27000:27030 is port used for Counter Strike
> port 4662 is used by 'emule'
>
> Seems that it's not working, when i play CS i have 10ms of ping.
> If i launch emule , my ping drop beetween 50 to 120 ms.
> If i understood correclty the TOS thing, i should not see any diffrence
> because emule packet should always wait for other packet to have acces
> to internet before them.
>
> CS and emule are running from windows connected to linux gateway by
> ethernet card, internet connection is by ethernet too.
>
> ISP www.free.fr Freebox fastpath activated.
>
> My mangle configuration.
>
> *mangle
> :PREROUTING ACCEPT [58750:53452959]
> :INPUT ACCEPT [57439:53485156]
> :FORWARD ACCEPT [4668:345779]
> :OUTPUT ACCEPT [41183:5423214]
> :POSTROUTING ACCEPT [48551:5947829]
>
> -A PREROUTING -p tcp --sport 27000:27030 -j TOS --set-tos Minimize-Delay
> -A PREROUTING -p tcp --dport 27000:27030 -j TOS --set-tos Minimize-Delay
> -A PREROUTING -p tcp --dport 4662 -j TOS --set-tos Maximize-Throughput
> -A PREROUTING -p udp --dport 4662 -j TOS --set-tos Maximize-Throughput
> -A PREROUTING -p tcp --sport 4662 -j TOS --set-tos Maximize-Throughput
> -A PREROUTING -p udp --sport 4662 -j TOS --set-tos Maximize-Throughput
>
> -A OUTPUT -p tcp --sport 27000:27030 -j TOS --set-tos Minimize-Delay
> -A OUTPUT -p tcp --dport 27000:27030 -j TOS --set-tos Minimize-Delay
> -A OUTPUT -p tcp --dport 4662 -j TOS --set-tos Maximize-Throughput
> -A OUTPUT -p udp --dport 4662 -j TOS --set-tos Maximize-Throughput
> -A OUTPUT -p tcp --sport 4662 -j TOS --set-tos Maximize-Throughput
> -A OUTPUT -p udp --sport 4662 -j TOS --set-tos Maximize-Throughput
>
> regards,
> Seb


Note that all you're doing here is setting bits in the TOS field if
the headers. They've never been consistently honored (or honored at
all for the most part) outside a lan. Any benfit you will derive will
be at your end as the packets get queued and forwarded on your
machine. You're probably more interested in fwmark than TOS.

Can't remember offhand what doc explains the usefulness of the TOS
bits re: iproute2 -- probably in lartc.html somewhere. They are not
as useful by themselves as you might think.

Usually, this kind of thing is done when there are many (20+ ?) users
on a subnet sharing bandwidth, so I'm not sure how much benenfit
you'll see on a small lan with just 2 or 3 hosts.

You're headed in the right direction, but much more has to be done to
really get what you're looking for. Been several years since I've
played with this (gamers and p2p users), so I would direct you here
for an example:
http://lartc.org/howto/lartc.cookboo...nat.intro.html

Note that unless you use a qdisc _other_ than the default, you won't
see much difference -- the default is made to process packets quickly,
fifo.

Be prepared to spend some time with this to get it right, but the
example should get you started.

hth,
prg
email above disabled
 
Reply With Quote
 
MagicFr
Guest
Posts: n/a

 
      09-05-2004, 06:10 PM

hmm i think ur so right i used the tc -s qdisc that should tell me
where the things are bufferised ( if im correct ), and whith the TOS
changed , i see nothing with this command .. wich certainly means,
nothings is queued correctly

Thanks for the URL, seems to be a well explained ( 4 noobies like me ).
I'll start with that

Thanks.

Seb

> http://lartc.org/howto/lartc.cookboo...nat.intro.html
>
> Note that unless you use a qdisc _other_ than the default, you won't
> see much difference -- the default is made to process packets quickly,
> fifo.
>
> Be prepared to spend some time with this to get it right, but the
> example should get you started.
>
> hth,
> prg
> email above disabled

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple mail "server" program needed - advice needed please Andrew Sayers Home Networking 12 08-24-2006 04:03 PM
Cool 'n Simple IPTables Firewall Script - see the FIXME Coenraad Loubser Linux Networking 1 04-21-2005 07:36 AM
Sign-in script needed tracy Windows Networking 1 07-06-2004 10:12 PM
simple dual-homed iptables script bad_knee Linux Networking 0 02-27-2004 03:51 PM
Simple proxy-arp setup needed Jonas Simpson Linux Networking 1 09-30-2003 04:58 PM



1 2 3 4 5 6 7 8 9 10 11