What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Simulating low-bandwidth AND low-latency network?

velocd

New Around Here
Hello,

Long-time Merlin user here. Thank you maintainers for the dedication to this project.

I need to simulate low-bandwidth and low-latency for a few different mobile devices on my network to test some of my mobile apps in a poor network situation. I know I can use QoS to bandwidth-limit a client, but how about increasing latency? I have SSH on my router (AC86U). I'm running a few months old Merlin version, don't remember which (not home atm).

Would something like this work, or is there a better or easier method?
https://gist.github.com/denilsonsa/5176e1c9b6a119594ce0

Ideally increasing latency by client would be nice, similar to QoS bandwidth limiter, but if it can only be done for all clients at once then that is okay too.
 
If you run a VM then most host software lets you add loss/latency to a virtual Nic. Make the guest a basic Linux router and the default gw for your test devices and your good.


Sent from my iPhone using Tapatalk
 
I'm not sure I understand the VM solution. I was hoping to do this at the router level (my ASUS Merlin router) and not at the client, as that's what I currently do (using Network Link Conditioner for iOS/MacOS). I'm looking for a device/OS agnostic solution so any device on my network can be bandwidth/latency controlled without having special software or settings installed on them, even my Nest smart thermostat if I so desired.
 
Take a look at Wanem, it’s a router in a VM that does exactly what you want. Clients just need their default gw updated to point at it and it will degrade and onward route traffic to your main router.


Sent from my iPhone using Tapatalk
 
Take a look at Wanem, it’s a router in a VM that does exactly what you want. Clients just need their default gw updated to point at it and it will degrade and onward route traffic to your main router.


Sent from my iPhone using Tapatalk

I suspected that's what it was, but that's still a bit of a problem. I'd really like not to have to individually configure my clients whenever I want to network test my apps. If I want to use my normal network on my devices, I don't want to have to unconfigure them from the VM. I also don't want to run a VM all the time when I have a router that I suspect can do the same. I'm ideally looking for a solution that lets me configure my router to simulate poor network so that when I'm developing I can just go to the router, enable the poor network, and start testing. When I'm done, I go back to the router and turn off the poor network.
 
It might be possible with Asuswrt-Merlin with Entware packages; but it’ll be a very manual setup, I doubt you’ll find something as neat as that live iso VM.
It’s also possible/likely that some of the packages to control the packet loss etc (such as tc) are already in use to do things like QOS, so you’d have to work out how to lever your needs into the existing config/use case.

Have a look at Fresh’s QOS script, it might give you some clues on how you can do some detrimental targeted traffic shaping.


Sent from my iPhone using Tapatalk
 
This may or may not work for you:
Code:
# modprobe xt_statistic
# iptables -I INPUT -m statistic --mode random --probability 0.2 -j DROP
# iptables -I OUTPUT -m statistic --mode random --probability 0.2 -j DROP
EDIT: Thinking about it, just using the FORWARD chain might be better than INPUT/OUTPUT.

EDIT 2: Yep, FORWARD is better. So that's:
Code:
# modprobe xt_statistic
# iptables -I FORWARD -m statistic --mode random --probability 0.2 -j DROP
EDIT 3: A quick look at the source code makes me think the statistic module isn't included in Merlin's firmware, whereas I use John's which does have it.
 
Last edited:

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top