Upload limit woes & lag in online games

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Author Message
fbacall
DD-WRT Novice


Joined: 10 Mar 2009
Posts: 2

PostPosted: Tue Mar 10, 2009 14:16    Post subject: Upload limit woes & lag in online games Reply with quote
Hi

I live in a house with 5 other people. 2 of them are directly connected to my recently purchased WRT54GL v1.1 running the most recent version of DD-WRT and the rest of us are connected to the router through a switch.

When I try and play certain online games (Counter-Strike Source) when someone else is using the internet (I'm not sure what they do, but I suspect streaming and torrenting are amongst their activities) the in-game connection starts to freeze-up, with long delays between packets (upwards of 3 seconds).

My most recent theory is that the upload bandwidth is getting saturated (we only have 500kbps), and after reviewing the bandwidth graphs in the router interface, it seems quite plausible. I did some searching and found a link to a script generator in which you can specify how much bandwidth each client can use. So I made it so each client is guaranteed a minimum of 50kbps and a maximum of 70kbps upload, and 1000kbps-2000kbps download, but when I visit speedtest.net or whatever it still shows ~500kbps upload whilst the download appears to be limited. Also in the bandwidth graphs it shows the upload usage going between 300kbps and 500kbps despite only 3 people being currently connected.

Sorry for the long post but I've been plagued by this issue since September and I don't really know what else to do.
Sponsor
phuque99
DD-WRT User


Joined: 20 Oct 2008
Posts: 446

PostPosted: Tue Mar 10, 2009 14:24    Post subject: Reply with quote
This maybe a good article for you to read. The principles work, with just a bit more work on ddwrt:

http://www.linksysinfo.org/forums/showthread.php?p=337410
paradigm
DD-WRT User


Joined: 09 Dec 2008
Posts: 116

PostPosted: Tue Mar 10, 2009 15:21    Post subject: Re: Upload limit woes & lag in online games Reply with quote
fbacall wrote:
Hi

I live in a house with 5 other people. 2 of them are directly connected to my recently purchased WRT54GL v1.1 running the most recent version of DD-WRT and the rest of us are connected to the router through a switch.

When I try and play certain online games (Counter-Strike Source) when someone else is using the internet (I'm not sure what they do, but I suspect streaming and torrenting are amongst their activities) the in-game connection starts to freeze-up, with long delays between packets (upwards of 3 seconds).

My most recent theory is that the upload bandwidth is getting saturated (we only have 500kbps), and after reviewing the bandwidth graphs in the router interface, it seems quite plausible. I did some searching and found a link to a script generator in which you can specify how much bandwidth each client can use. So I made it so each client is guaranteed a minimum of 50kbps and a maximum of 70kbps upload, and 1000kbps-2000kbps download, but when I visit speedtest.net or whatever it still shows ~500kbps upload whilst the download appears to be limited. Also in the bandwidth graphs it shows the upload usage going between 300kbps and 500kbps despite only 3 people being currently connected.

Sorry for the long post but I've been plagued by this issue since September and I don't really know what else to do.


Something is probably wrong with the script you are using. I had the same thing happen until I fixed it. Are you trying to use IP ranges? Did you change modprobe to insmod?

If you can, post your script.
shizuo
DD-WRT User


Joined: 10 Feb 2008
Posts: 72

PostPosted: Tue Mar 10, 2009 16:07    Post subject: Reply with quote
If the users are torrenting then even if you throttle their speed you may still be lagged due to amount of connections their torrent clients open. Maybe connlimit and lower timeouts will help. I was in the same situation and used OpenDNS to block torrent sites which works well since the users cannot connect to the torrent trackers.
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10141

PostPosted: Tue Mar 10, 2009 16:29    Post subject: Reply with quote
shizuo wrote:
If the users are torrenting then even if you throttle their speed you may still be lagged due to amount of connections their torrent clients open. Maybe connlimit and lower timeouts will help. I was in the same situation and used OpenDNS to block torrent sites which works well since the users cannot connect to the torrent trackers.

Ever heard of DHT.
fbacall
DD-WRT Novice


Joined: 10 Mar 2009
Posts: 2

PostPosted: Tue Mar 10, 2009 18:35    Post subject: Reply with quote
Thanks for the replies guys.

phuque99 wrote:
This maybe a good article for you to read. The principles work, with just a bit more work on ddwrt:

http://www.linksysinfo.org/forums/showthread.php?p=337410

I had a go at using QoS and prioritizing CS:S over everything else, and even prioritizing my MAC address, but neither seemed to have any effect and infact made it worse at one point.

paradigm wrote:
Something is probably wrong with the script you are using. I had the same thing happen until I fixed it. Are you trying to use IP ranges? Did you change modprobe to insmod?

If you can, post your script.

Erm no, it's still modprobe, I'll try that now.

Here's my script, I was trying to use IP ranges at first, then I changed it to specific IP addresses. I was going to change it to MAC addresses if it worked for IP addresses:
Code:
#--------------------------------------------
#WRT54 Script Generator v1.02
#(C) 2006-2007 Robert "Robson" Mytkowski
#--------------------------------------------
TCA="tc class add dev br0"
TFA="tc filter add dev br0"
TQA="tc qdisc add dev br0"
SFQ="sfq perturb 10"
tc qdisc del dev br0 root
tc qdisc add dev br0 root handle 1: htb
tc class add dev br0 parent 1: classid 1:1 htb rate 8000kbit
$TCA parent 1:1 classid 1:10 htb rate 1000kbit ceil 2000kbit prio 2
$TCA parent 1:1 classid 1:11 htb rate 1000kbit ceil 2000kbit prio 2
$TCA parent 1:1 classid 1:12 htb rate 1000kbit ceil 2000kbit prio 2
$TCA parent 1:1 classid 1:13 htb rate 1000kbit ceil 2000kbit prio 2
$TCA parent 1:1 classid 1:14 htb rate 1000kbit ceil 2000kbit prio 2
$TQA parent 1:10 handle 10: $SFQ
$TQA parent 1:11 handle 11: $SFQ
$TQA parent 1:12 handle 12: $SFQ
$TQA parent 1:13 handle 13: $SFQ
$TQA parent 1:14 handle 14: $SFQ
$TFA parent 1:0 prio 2 protocol ip handle 10 fw flowid 1:10
$TFA parent 1:0 prio 2 protocol ip handle 11 fw flowid 1:11
$TFA parent 1:0 prio 2 protocol ip handle 12 fw flowid 1:12
$TFA parent 1:0 prio 2 protocol ip handle 13 fw flowid 1:13
$TFA parent 1:0 prio 2 protocol ip handle 14 fw flowid 1:14
iptables -t mangle -A POSTROUTING -d 192.168.1.100 -j MARK --set-mark 10
iptables -t mangle -A POSTROUTING -d 192.168.1.101 -j MARK --set-mark 11
iptables -t mangle -A POSTROUTING -d 192.168.1.102 -j MARK --set-mark 12
iptables -t mangle -A POSTROUTING -d 192.168.1.104 -j MARK --set-mark 13
iptables -t mangle -A POSTROUTING -d 192.168.1.108 -j MARK --set-mark 14
TCAU="tc class add dev imq0"
TFAU="tc filter add dev imq0"
TQAU="tc qdisc add dev imq0"
modprobe imq
modprobe ipt_IMQ
ip link set imq0 up
tc qdisc del dev imq0 root
tc qdisc add dev imq0 root handle 1: htb
tc class add dev imq0 parent 1: classid 1:1 htb rate 400kbit
$TCAU parent 1:1 classid 1:10 htb rate 70kbit ceil 80kbit prio 2
$TCAU parent 1:1 classid 1:11 htb rate 70kbit ceil 80kbit prio 2
$TCAU parent 1:1 classid 1:12 htb rate 70kbit ceil 80kbit prio 2
$TCAU parent 1:1 classid 1:13 htb rate 70kbit ceil 80kbit prio 2
$TCAU parent 1:1 classid 1:14 htb rate 70kbit ceil 80kbit prio 2
$TQAU parent 1:10 handle 10: $SFQ
$TQAU parent 1:11 handle 11: $SFQ
$TQAU parent 1:12 handle 12: $SFQ
$TQAU parent 1:13 handle 13: $SFQ
$TQAU parent 1:14 handle 14: $SFQ
$TFAU parent 1:0 prio 2 protocol ip handle 10 fw flowid 1:10
$TFAU parent 1:0 prio 2 protocol ip handle 11 fw flowid 1:11
$TFAU parent 1:0 prio 2 protocol ip handle 12 fw flowid 1:12
$TFAU parent 1:0 prio 2 protocol ip handle 13 fw flowid 1:13
$TFAU parent 1:0 prio 2 protocol ip handle 14 fw flowid 1:14
iptables -t mangle -A PREROUTING -s 192.168.1.100 -j MARK --set-mark 10
iptables -t mangle -A PREROUTING -s 192.168.1.101 -j MARK --set-mark 11
iptables -t mangle -A PREROUTING -s 192.168.1.102 -j MARK --set-mark 12
iptables -t mangle -A PREROUTING -s 192.168.1.104 -j MARK --set-mark 13
iptables -t mangle -A PREROUTING -s 192.168.1.108 -j MARK --set-mark 14
iptables -t mangle -A PREROUTING -j IMQ --todev 0
iptables -I FORWARD -s 192.168.1.100 -p tcp -m connlimit --connlimit-above 200 -j DROP
iptables -I FORWARD -s 192.168.1.101 -p tcp -m connlimit --connlimit-above 200 -j DROP
iptables -I FORWARD -s 192.168.1.102 -p tcp -m connlimit --connlimit-above 200 -j DROP
iptables -I FORWARD -s 192.168.1.104 -p tcp -m connlimit --connlimit-above 200 -j DROP
iptables -I FORWARD -s 192.168.1.108 -p tcp -m connlimit --connlimit-above 200 -j DROP 


edit: Changed modprobe to "insmod" and it seems to be throttling the upload properly now, however my ping seems to have skyrocketted. When I try and ping www.google.com for example my ping starts at around 500, then climbs to 3000 and eventually times out.

shizuo wrote:
If the users are torrenting then even if you throttle their speed you may still be lagged due to amount of connections their torrent clients open. Maybe connlimit and lower timeouts will help. I was in the same situation and used OpenDNS to block torrent sites which works well since the users cannot connect to the torrent trackers.

I thought it might be a connection issue at first, but even when the lag is at it's worst there's only around 500 of 4096 connections open.
shizuo
DD-WRT User


Joined: 10 Feb 2008
Posts: 72

PostPosted: Tue Mar 10, 2009 19:44    Post subject: Reply with quote
phuzi0n: You mean DHT setting in bittorrent clients? If so then yes I've heard of it because I've read how to minimize load put on router by torrenting but when the users have no respect for the person that pays for the internet connection it is a lot easier and satisfying to deny torrent access than to educate users on how to set their bittorrent client up properly when they should have done the research themselves in the first place.

I was made to be bitter about it after being lagged for months because of users torrenting porn videos.

I feel if you pay the bill and users are lagging you the best solution is attempt to block torrents as completely as possible. (sorry about rant)
soulstace
DD-WRT Guru


Joined: 04 Aug 2007
Posts: 6427

PostPosted: Tue Mar 10, 2009 20:07    Post subject: Reply with quote
phuzi0n's point was that DHT can bypass trackers. If a user gets ahold of torrent with DHT enabled, he doesn't need a tracker. Although you can probably block DHT too.

I guess your point is that you try to block users from downloading the torrent in the first place.
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10141

PostPosted: Tue Mar 10, 2009 21:41    Post subject: Reply with quote
The point is more that there will always be ways of circumvention. If you're the only one paying for service then you certainly have the right to do whatever you want but it would likely be better to find a compromise so that you avoid creating tension with the people you live with.

The QoS in the free version GUI of dd-wrt isn't nearly enough to help your gaming experience. For low latency gaming you're going to have to throttle everything else down significantly because that's the only way to insure the ISP sends your packets to you quick enough.
ad5mb
DD-WRT User


Joined: 12 Oct 2008
Posts: 386

PostPosted: Tue Mar 10, 2009 21:53    Post subject: Reply with quote
if you are running Vista...

http://www.wlanbook.com/
paradigm
DD-WRT User


Joined: 09 Dec 2008
Posts: 116

PostPosted: Wed Mar 11, 2009 1:01    Post subject: Reply with quote
fbacall wrote:

edit: Changed modprobe to "insmod" and it seems to be throttling the upload properly now, however my ping seems to have skyrocketted. When I try and ping www.google.com for example my ping starts at around 500, then climbs to 3000 and eventually times out.


Post what you have for a script now after changing it. I presume you tried power cycling the router?

A couple things could be going on. Your allowed upload pipe on the limited IPs is pretty low. Especially considering that there is some leeway in the precision actually allowed. If you just did it, it is possible that the clients are hammering away and haven't yet responded/adapted to the dropped packets.

If I were you, I'd probably increase the cap to something a little more reasonable. At least 100k for ceil.

Do you really have a 8000kbit DOWN, 400 kbit UP pipe? Consistently?

You don't have regular QoS on in the GUI as well, do you?

Also are you sure someone isn't using a unlimited IP and still hammering away? Smile


Last edited by paradigm on Wed Mar 11, 2009 1:43; edited 1 time in total
paradigm
DD-WRT User


Joined: 09 Dec 2008
Posts: 116

PostPosted: Wed Mar 11, 2009 1:25    Post subject: Reply with quote
Also another option, if you want to go nuke and can't get this to work, is pfsense configured as a transparent shaper between the cable modem and the router:

http://www.pfsense.com/

It would allow you to customize queues with extreme low level control.

This would require a linux capable PC with at least two NICs though which would be dedicated to the task. There is also net equalizer ($$$ -- the pay version is actually used by ISPs! -- and the free version which you must config yourself). Then there is another one which requires a higher end dedicated PC, though it is free. But the name escapes me right now...
NXIL
DD-WRT Guru


Joined: 29 Dec 2008
Posts: 649
Location: Southern California

PostPosted: Wed Mar 11, 2009 3:43    Post subject: Reply with quote
Quote:
but when the users have no respect for the person that pays for the internet connection it is a lot easier and satisfying to deny torrent access than to educate users on how to set their bittorrent client up properly when they should have done the research themselves in the first place.


Hey Shiz,

it's not that they don't respect you, it's just that they have no incentive to help you--they have a free connection, and you are getting your head blown off and "powned" because of lag and dropped packets.

Quote:
I was made to be bitter about it after being lagged for months because of users torrenting porn videos.


Personally, I would not let people I did not know and trust share my connection, and download questionable videos--there is illegal stuff that can be downloaded, and if it is, and it's your connection, that could be ugly. Really ugly. (Would you let these douchebags use your car? You would also be liable if they ran someone over. Or crashed into a cop car. Ugly.)

How about asking these people to chip in monthly? Or, do you get something "free" in return from them every month? With extra cash, you could get a faster connection--maybe 2 or 3 up, and 8 down.

Or: you said you were on the switch, downstream from the router. How about you have the router close to you, and the parasites are on the switch, and, in DD-WRT, you throttle the switch's throughput, to reserve more bandwidth for yourself?

GL

NX

_________________
WRT54G v1.1 DD-WRT v24-sp2 (07/22/09) std - build 12548 VINT Eko


SP1: it's a problem.
darksied
DD-WRT Novice


Joined: 06 Oct 2007
Posts: 12

PostPosted: Thu Mar 12, 2009 4:17    Post subject: Reply with quote
I don't know much about these things, but I'll see if I can't help.

Is the script generator you're using the wrt54 script generator? When I used that in the past, it seemed to work, but what I did was a little different. I didn't want to cap everyone all the time, because the people I lived with knew what kinda internet we were all paying for, so they wanted the fast speed; so I had a script I ran ONLY when I was playing online to keep everything lag free. Then I took it off when I was done.

For your script, you're giving them a minimum of 50kb for upload, which is not much, but when you only have 500kb total, that means you can STILL possibly lag in certain situations even if no one is using the internet. So maybe lower that to a 10kb minimum, 20kb max for them (and since this is so low, you WILL get complaints from them, so only do that when you are playing online). Or, what I had to do in extreme lag situations for online games, lower it even more, so they get frustrated and just leave their computer for a while Smile (just kidding really, but if it's necessary....).

For the download scripted limit, I would lower it a lot from 1000-2000kb. If you're keeping in mind that these numbers I'm giving you are an idea to be only used when you're gaming online, then lower it a bit to like 700kb/1400kb just for the duration of the online game.

And, of course, you've added the script to the commands and clicked "save firewall," right? I'm sure you know this, just checking.

Also, I prioritized by mac address and that worked for me. If for some reason you try IP's and those don't work, try mac. Maybe they're not static IP's and if they change, the script won't kick in. After you click on save firewall, restart the router.

Another thing you could try is start with a script where you only limit yourself by mac address. Limit your upload and download to an insanely slow (but still working) amount, just to make sure it's working. If you can't get it to work for you, then there's something else wrong. If you limit yourself easily, then try it for them. And when you write your final script, keep yourself out of it; just limit them, and keep yourself exempt.

I'm sure you've tried most of this, but hopefully it will give you some ideas to try.
paradigm
DD-WRT User


Joined: 09 Dec 2008
Posts: 116

PostPosted: Thu Mar 12, 2009 13:41    Post subject: Reply with quote
darksied wrote:
I don't know much about these things, but I'll see if I can't help.

Is the script generator you're using the wrt54 script generator? When I used that in the past, it seemed to work, but what I did was a little different. I didn't want to cap everyone all the time, because the people I lived with knew what kinda internet we were all paying for, so they wanted the fast speed; so I had a script I ran ONLY when I was playing online to keep everything lag free. Then I took it off when I was done.

For your script, you're giving them a minimum of 50kb for upload, which is not much, but when you only have 500kb total, that means you can STILL possibly lag in certain situations even if no one is using the internet. So maybe lower that to a 10kb minimum, 20kb max for them (and since this is so low, you WILL get complaints from them, so only do that when you are playing online). Or, what I had to do in extreme lag situations for online games, lower it even more, so they get frustrated and just leave their computer for a while Smile (just kidding really, but if it's necessary....).

For the download scripted limit, I would lower it a lot from 1000-2000kb. If you're keeping in mind that these numbers I'm giving you are an idea to be only used when you're gaming online, then lower it a bit to like 700kb/1400kb just for the duration of the online game.

And, of course, you've added the script to the commands and clicked "save firewall," right? I'm sure you know this, just checking.

Also, I prioritized by mac address and that worked for me. If for some reason you try IP's and those don't work, try mac. Maybe they're not static IP's and if they change, the script won't kick in. After you click on save firewall, restart the router.

Another thing you could try is start with a script where you only limit yourself by mac address. Limit your upload and download to an insanely slow (but still working) amount, just to make sure it's working. If you can't get it to work for you, then there's something else wrong. If you limit yourself easily, then try it for them. And when you write your final script, keep yourself out of it; just limit them, and keep yourself exempt.

I'm sure you've tried most of this, but hopefully it will give you some ideas to try.


One thing to keep in mind when setting the upload (especially) and the download limits with the script is that it will usually only give between 80% - 95% of the actual speed to the user. So a 50 kbps upload might really only be 40 kbps. In my own tests if several web pages are loaded at once, it will possibly exceed that.

The OP said something about ping times increasing when using the script. I went ahead yesterday and upgraded my WRT54GL v1.1 running 10991 eko to 11296 eko and I cna say that I did not experience any significant change in ping time due to the upgrade. 11296 eko seems to be "safe" for use with the script generator and I can verify that it works (at least with the configuration and features I use. See sig). I'm not sure about other builds.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
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
You can attach files in this forum
You can download files in this forum