LinuxQuestions.org
Visit Jeremy's Blog.
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 06-03-2005, 12:51 PM   #1
<Ol>Origy
Member
 
Registered: Aug 2003
Location: Slovenia
Distribution: Arch, Debian, Embedded
Posts: 136

Rep: Reputation: 15
Request for a simple net script edit


I'm having some trouble with my internet connection. I have a linux PC box I use as a router/gateway. The thing is that whenever someone on my subnet uses one of those P2P programs, the pings increase dramatically making any PC games almost unplayable over the network at the same time. Now I found a way to decrease the pings by adding I script I found on a website to my /etc/rc.d/ firewall.
Here is what I use:

Code:
#!/bin/bash
#Example config for an adsl link with 1024Kbit downstream and 256Kbit upstream

iptables -t mangle -A OUTPUT -m length --length 0:500 -j MARK --set-mark 3
iptables -t mangle -A OUTPUT -m length --length 500:1500 -j MARK --set-mark 4

#We assume masqueraded machines on eth0 should also have their upload tuned 

iptables -t mangle -A PREROUTING -i eth0 -m length --length 0:500 -j MARK --set-mark 3
iptables -t mangle -A PREROUTING -i eth0 -m length --length 500:1500 -j MARK --set-mark 4

tc qdisc add dev ppp0 root handle 10: cbq bandwidth 10Mbit avpkt 1000 mpu 64

tc class add dev ppp0 parent 10:0 classid 10:1 cbq bandwidth 10Mbit \
    rate 51Kbit allot 1514 prio 1 maxburst 10 avpkt 100 isolated
tc class add dev ppp0 parent 10:0 classid 10:2 cbq bandwidth 10Mbit \
    rate 180Kbit allot 1514 prio 8 maxburst 2 avpkt 1500 bounded

tc filter add dev ppp0 parent 10:0 protocol ip handle 3 fw flowid 10:1
tc filter add dev ppp0 parent 10:0 protocol ip handle 4 fw flowid 10:2
The normal ping to one of our local ISP servers is 20 ms. Before I integrated this code into my firewall, the pings used to reach up to 1600 ms. Now they reach to about 500 ms which is still too high. Now I'd like to know if there is a way to reduce the pings even further. The thing I understood from that script is that it sorts the packets into 2 groups depending on their size and sends out the little ones first. The bigger ones are sent last. Now I would like to ask someone if he can edit this script since I do not quite understand what this script does and I wouldn't want to mess with it myself.

Here's what I came up with:
Would it be possible to edit the script and let the firewall sort the packets into 3 different groups (instead of 2) depending on their size. The little ones up to 150 bytes (that most games use) would have the highest priority and be sent before any other. The second group should have packets in size from 150 to 500 bytes which would get sent before the 3rd group but after the 1st one. And finally the third group with all the packets beyond 500 bytes in size being sent last.

Would this idea of mine make any difference in pings?
If this doesn't work, what else should I do to decrease the pings (other than purchase a faster connection or block P2P traffic)?


Thank you for your time.
 
  


Reply



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
Simple request regarding route The Joker Linux - Networking 2 11-18-2005 06:01 PM
DAY 1 on SUSE92: Autodial net upon Konqueror request? Premadonna Linux - Newbie 1 07-15-2005 12:26 PM
script request lgualteri Programming 7 06-17-2005 10:19 AM
Simple Question - How To Edit With Recovery CD? rrrssssss Linux - Newbie 1 04-22-2005 06:08 AM
Simple question - how to edit config file in Suse 9.1? rollo Linux - Distributions 3 07-18-2004 08:47 AM

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

All times are GMT -5. The time now is 02:09 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