User bandwidth control

Support forum for routers of all shapes and sizes. As long as it's router based and doesn't fall into the other categories, this is the place to ask your questions.
Post Reply
trogoz
Newbie
Newbie
Posts: 7
Joined: Wed Apr 02, 2014 12:10 pm
Location: italy

User bandwidth control

Post by trogoz » Wed Oct 08, 2014 5:00 pm

Hi all!
I installed routertech firmware on my old Flynet Roper router, but I am struggling with user bandwidth control.
My objective is to share the connection with other users without causing game lags. I mostly play League of Legends.

I tried to set QoS on three different routers (the Flynet one, the isp router adb da2200 and a d-link dsl 2640b) but heavy traffic by youtube streaming and torrent causes huge lag spikes and even disconnections from LoL servers regardless of packet priority settings with QoS.

I tried both rshaper and netshaper, but the situation did not change much: even under restricted connections (verified by netspeed online monitor) heavy traffic is still responsible of disconnections.
My hypotesis is that somehow the packet flooding causes generic packet drops, including both VIP (gaming) packets and youtube/torrent packets. Maybe the router can't stand that much traffic.

I also tried to alter the iptables FORWARD rules, having success at some extent. I tried limiting the connections on my iphone with the following rules:
iptables -I FORWARD 1 -d 192.168.1.2 -m limit --limit 500/sec -j ACCEPT
iptables -I FORWARD 2 -d 192.168.1.2 -j DROP

this way the youtube videos on my iphone load really slowly, but I can play with almost no lag (I tested this briefly, this will be further investigated).

I am asking for any help/comments/advices for possible solutions or any help regarding the cause of the problem.
Can it be hardware related? Can I solve this by buying a better router?

Notes: I live in Italy, my connection is 8 Mbps download / 0.6 Mbps upload .
User avatar
thechief
RouterTech Team
RouterTech Team
Posts: 12067
Joined: Wed Feb 01, 2006 10:22 pm
Location: England, the Centre of Africa
Contact:

Re: User bandwidth control

Post by thechief » Wed Oct 08, 2014 9:10 pm

Reduce the number of connections for your torrents.
The Chief: :afro: Be sure to read the Firmware FAQ and do a Forum Search before posting!
No support via PM. Ask all questions on the open forum.
trogoz
Newbie
Newbie
Posts: 7
Joined: Wed Apr 02, 2014 12:10 pm
Location: italy

Re: User bandwidth control

Post by trogoz » Thu Oct 09, 2014 12:15 am

Dear thechief,
Thanks for your answer! Unfortunately even in absence of torrent clients the lag is present, so limiting the number of torrents will not solve the problem completely.
As you suggested, I added some rules to limit the number of connections on torrent ports.
I was just wondering if someone more experienced with shapers or qos could clarify why normal traffic can affect VIP traffic even if countermeasures are taken or how to solve this situation.
User avatar
thechief
RouterTech Team
RouterTech Team
Posts: 12067
Joined: Wed Feb 01, 2006 10:22 pm
Location: England, the Centre of Africa
Contact:

Re: User bandwidth control

Post by thechief » Thu Oct 09, 2014 8:54 am

I'm no networking guru, but if you have already tried 3 different routers, I am dubious as to whether getting another consumer router would solve the problem. It seems that someone (or something - e.g., a clever program) is managing to circumvent your controls. Before splashing out on an expensive router that may not get the job done, you may want to see what exactly is happening on your network. Have you had a look at the system logs, and the output of dmesg ? If they don't give a clear answer, you may want to install a tool (e.g., wireshark or something similar) that will reveal all.

You may also want to enable IPAccount, and then check everybody's bandwidth, to see who is using up all your bandwidth.
The Chief: :afro: Be sure to read the Firmware FAQ and do a Forum Search before posting!
No support via PM. Ask all questions on the open forum.
trogoz
Newbie
Newbie
Posts: 7
Joined: Wed Apr 02, 2014 12:10 pm
Location: italy

Re: User bandwidth control

Post by trogoz » Thu Oct 09, 2014 10:44 am

Thanks a lot for this!
I will sure use IPaccount, as soon as I learn how to use it! It is quite hard to monitor user activities just with "cat /proc/net/ip_conntrack"!!
I checked the dmesg but no relevant output is there to point to any problem!

In the mean time I tried to reduce the --limit 500/sec to --limit 400/sec and it removed lag completely when just my pc and my iphone are online and I start youtube streaming on my iphone while playing.
This is quite a victory for me after struggling so much, next step is applying the limit to the appropriate netmask and testing a more crowded scenario.

I hope to gather even more information via IPaccount and then write a small guide for all players out there!
This is a quite common problem, at least here in Italy.
trogoz
Newbie
Newbie
Posts: 7
Joined: Wed Apr 02, 2014 12:10 pm
Location: italy

Re: User bandwidth control

Post by trogoz » Thu Oct 09, 2014 11:17 am

Ok here are some interesting results!

I disabled rshaperctl module (since I don't use it anymore) and activated IPaccount.

I launched a custom match in LoL without iptables limitations and started a video streaming on youtube with my iphone (second client in the list). I am alone at home now, no other clients are in.

IP Address Upload (bytes) Download (bytes) Last time data transfered
192.168.1.0 289.113 13.207.462 0s
192.168.1.2 196.124 12.987.314 1s
192.168.1.32 92.989 220.148 0s


In just 1 seconds, my iphone eated all the bandwidth, 60 times the one needed by the game.


After limits activation via iptables, the results are completely different:

IP Address Upload (bytes) Download (bytes) Last time data transfered
192.168.1.0 949.665 559.873 6s
192.168.1.2 711.737 208 9s
192.168.1.32 237.928 559.665 6s

I don't know why but the download values are almost null for iphone, even if the videos are loading, and not even that slowly!
Again, this is a victory for me, since I can load videos and play in the meantime, but I'd love to understand why this is possible and how to interpret the ipaccount output.

I will continue investigating while I start writing the mini-guide, thanks again for all your help.
User avatar
thechief
RouterTech Team
RouterTech Team
Posts: 12067
Joined: Wed Feb 01, 2006 10:22 pm
Location: England, the Centre of Africa
Contact:

Re: User bandwidth control

Post by thechief » Fri Oct 10, 2014 12:43 am

It doesn't seem to me that too much data has been transferred. 192.168.1.0 refers to the entire network, which is split into 192.168.1.2 and 192.168.1.32. Each of them has experienced (form what you posted) just a few kilobytes of data.
The Chief: :afro: Be sure to read the Firmware FAQ and do a Forum Search before posting!
No support via PM. Ask all questions on the open forum.
trogoz
Newbie
Newbie
Posts: 7
Joined: Wed Apr 02, 2014 12:10 pm
Location: italy

Re: User bandwidth control

Post by trogoz » Fri Oct 10, 2014 9:36 am

Second line in first table is:
192.168.1.2 196.124 12.987.314 1s

the values are in bytes, so my iphone downloaded 12.987.314 bytes, which is almost 13MBytes of video straming data in just a few seconds (like 10-15 seconds)!
Youtube opens up as many connections as needed to download videos at maximum available bandwidth, this is why it is dreadful while online gaming!
The limitation on iptables prevented this behaviour, the ping is always below 70ms in game!

I am still doing some tests, since yesterday I had some huge lag spikes, but they could be related to other problems with the isp.
User avatar
thechief
RouterTech Team
RouterTech Team
Posts: 12067
Joined: Wed Feb 01, 2006 10:22 pm
Location: England, the Centre of Africa
Contact:

Re: User bandwidth control

Post by thechief » Fri Oct 10, 2014 9:59 am

Code: Select all

Second line in first table is:
192.168.1.2          196.124          12.987.314          1s

the values are in bytes, so my iphone downloaded 12.987.314 bytes, which is almost 13MBytes of video straming data in just a few seconds (like 10-15 seconds)!
Yes, you are right. The problem is that the way the data was displayed above was not well aligned (because the font was not fixed-size), so I missed that. Using the "code" tag as I have just done (instead of "quote") allows us to see the data more clearly. I hope you have unlimited downloads!
The Chief: :afro: Be sure to read the Firmware FAQ and do a Forum Search before posting!
No support via PM. Ask all questions on the open forum.
trogoz
Newbie
Newbie
Posts: 7
Joined: Wed Apr 02, 2014 12:10 pm
Location: italy

Re: User bandwidth control

Post by trogoz » Tue Oct 14, 2014 9:02 am

No good. While the router works in a controlled environment (me home alone, with two or three devices connected, playing and streaming at the same time) the router starts dropping packets and I even got disconnected when the place is crowded.
I am quite sure the hardware of my old router is not enough to withstand the needed work load, and probably this is the reason why the shaping (with rshaper and netshaper) does not work as intended.

In particular, the cpu of my router is the following:
cpu model : MIPS 4KEc V4.8

and the free ram is quite low:

Code: Select all

        total:    used:    free:  shared: buffers:  cached:
Mem:  14516224 14008320   507904        0   610304  4157440
I know no other way to proof that this is a hw problem but trying some pricey router with traffic shaping capabilities.
Am I right?
User avatar
thechief
RouterTech Team
RouterTech Team
Posts: 12067
Joined: Wed Feb 01, 2006 10:22 pm
Location: England, the Centre of Africa
Contact:

Re: User bandwidth control

Post by thechief » Tue Oct 14, 2014 11:36 am

The free RAM is quite fine. There is a lot that can be discarded when needed (remember that this is linux memory management). To be honest, I think the hardware is well up to it. The cpu does pretty much nothing 99% of the time. But clearly, it is not meeting your needs. Before going out to splash on an expensive router that may still not do the job, if you have an old spare computer lying around, you might want to try running SmoothWall on it (it would run perfectly well even on a 14-year old PC with an old Pentium class processor). SmoothWall should give you all the control that you need (and much more), without spending an extra penny (except perhaps for a cheap ethernet card).
The Chief: :afro: Be sure to read the Firmware FAQ and do a Forum Search before posting!
No support via PM. Ask all questions on the open forum.
trogoz
Newbie
Newbie
Posts: 7
Joined: Wed Apr 02, 2014 12:10 pm
Location: italy

Re: User bandwidth control

Post by trogoz » Wed Oct 15, 2014 12:47 pm

Thanks for the advice(s)! The idea of a gateway pc with a linux distro is really appetizing, and it would solve the problem for sure, but it is not feasible at the moment for me. I cannot leave an old pc on 24/7 in the room my router is, at the moment.

I finally decided to install bandwidth control softwares on every pc in my network, to ensure a correct management of bw quotas is enough to solve my problems, before eventually buying a new router.
This way the computational load for bw control is on network clients.
Yesterday tests were quite promising, if this works this means the Flynet Roper was not powerful enough to manage quotas.
Iptables rules I set were meant to drop exceeding packets, this is why that solution partly worked for me while rshaper or netshaper (with shich packets are queued and processed later) did not.

I am pretty sure the hardware load is too much for my current router when everything is up and running. In comparison, I checked the specifications of some new "gaming" routers, and they come up with 256MB of RAM and quadricore processors, which make and abyssal difference in performances.
User avatar
thechief
RouterTech Team
RouterTech Team
Posts: 12067
Joined: Wed Feb 01, 2006 10:22 pm
Location: England, the Centre of Africa
Contact:

Re: User bandwidth control

Post by thechief » Wed Oct 15, 2014 1:56 pm

That's ok then!
The Chief: :afro: Be sure to read the Firmware FAQ and do a Forum Search before posting!
No support via PM. Ask all questions on the open forum.
Post Reply