From my experience working with netem and tc, it seemed like a great tool for testing purposes but I could not find any good documentations on it. As a result, I never really fully understood the relationship between qdisc, netem, the filter chains, and so on. At the time I read [1] (and chapters after it) but I wasn't able to comprehend it as I think I just lack the in depth networking knowledge needed.
Does anyone know of any good resources to learn this stuff more systematically?
Now that said (and without being too self-promotional), I did manage to make an OpenWRT package[2] that allows WiFi clients to select different speeds/latencies/packet loss settings to emulate different connections (3G, bad/lossy connections, etc). This was particularly good for testing web apps on devices that don't have the ability to emulate networks and it provides a simpler way to do it than the official way by Apple/Google, imo.
> ... but I could not find any good documentations on it.
Completely agree. I wanted to set up some simple traffic shaping on gcp and aws nodes my students will be using for some networking projects. I've used both netem and tc in the past, years ago, but I found the documentation still seems just as abysmal. The netem documentation in particular is impenetrable. It seems to sit at just the anti-sweet spot between being "low level", explaining in detail how the implementation actually accomplishes things, and "high level", explaining abstractions and concepts of how one might use the tool. The user is left with a mishmash of both, with no way to see how all the various extremely picky implementation details fit together into any kind of coherent usable system. In the end, I am left with the feeling that the code is probably a collection of hacks and spaghetti with no clear vision or goal of how anything works, and the documentation is just a reflection of that.
Shameless plug: I made a wireless network emulator [0] for my dissertation. It's a userspace implementation with a lot of extra user/kernel context switches for every packet, so too slow for emulating latencies and only deals with packet loss. But it takes wireless congestions into consideration, and can emulate CSMA/CA. For one node this wouldn't make a difference, but for multiple nodes where interference is a problem, it's a bit more realistic than just setting arbitrary packet loss.
If you need to build your own network emulator for unusual purposes, have a look at the TUN/TAP system.
I was able to build a network device connected to a Verilog simulation (running in Verilator), allowing a simulated device to communicate with a real host. This avoided the lengthy build times and user contention of running it on the real target FPGA, which was in an expensive device we only had one of.
10 comments
[ 2.7 ms ] story [ 27.9 ms ] threadDoes anyone know of any good resources to learn this stuff more systematically?
Now that said (and without being too self-promotional), I did manage to make an OpenWRT package[2] that allows WiFi clients to select different speeds/latencies/packet loss settings to emulate different connections (3G, bad/lossy connections, etc). This was particularly good for testing web apps on devices that don't have the ability to emulate networks and it provides a simpler way to do it than the official way by Apple/Google, imo.
[1]: http://lartc.org/howto/lartc.qdisc.terminology.html
[2]: https://github.com/shuhaowu/trafficcop
Completely agree. I wanted to set up some simple traffic shaping on gcp and aws nodes my students will be using for some networking projects. I've used both netem and tc in the past, years ago, but I found the documentation still seems just as abysmal. The netem documentation in particular is impenetrable. It seems to sit at just the anti-sweet spot between being "low level", explaining in detail how the implementation actually accomplishes things, and "high level", explaining abstractions and concepts of how one might use the tool. The user is left with a mishmash of both, with no way to see how all the various extremely picky implementation details fit together into any kind of coherent usable system. In the end, I am left with the feeling that the code is probably a collection of hacks and spaghetti with no clear vision or goal of how anything works, and the documentation is just a reflection of that.
[0] https://github.com/squirrel-land/squirrel
EDIT: typos
It's a wrapper around Netem's tc interface, which makes things a bit easier to understand.
https://github.com/tomakehurst/saboteur
https://english.stackexchange.com/questions/111787/what-is-t...
http://stackoverflow.com/questions/1584617/simulator-or-emul...
https://www.quora.com/What-is-the-difference-between-a-simul...
I'm going to go out on a limb and say it's definitely an emulator:
https://en.wikipedia.org/wiki/Network_emulation
vs
https://en.wikipedia.org/wiki/Network_simulation
I was able to build a network device connected to a Verilog simulation (running in Verilator), allowing a simulated device to communicate with a real host. This avoided the lengthy build times and user contention of running it on the real target FPGA, which was in an expensive device we only had one of.