News for hackers. Stuff that matters.
Re:Netem: linux network emulator by songgao on Tuesday April 25, 2017 @01:17AM (#14190971)
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.

[0] https://github.com/squirrel-land/squirrel

EDIT: typos

Re:Netem: linux network emulator by pwnna on Monday April 24, 2017 @08:47PM (#14189867)
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.

[1]: http://lartc.org/howto/lartc.qdisc.terminology.html

[2]: https://github.com/shuhaowu/trafficcop

Re:Netem: linux network emulator by kevhito on Tuesday April 25, 2017 @01:16AM (#14190968)
> ... 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.

Re:Netem: linux network emulator by bloat on Tuesday April 25, 2017 @03:38AM (#14191504)
Saboteur is a good tool for some quick and dirty network testing.

It's a wrapper around Netem's tc interface, which makes things a bit easier to understand.

https://github.com/tomakehurst/saboteur

Re:Netem: linux network emulator by jtchang on Monday April 24, 2017 @09:11PM (#14189984)
Super cool. Looks a lot like dummynet in FreeBSD!
Re:Netem: linux network emulator by pjc50 on Tuesday April 25, 2017 @10:17AM (#14193701)
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.

Re:Netem: linux network emulator by epx on Monday April 24, 2017 @09:47PM (#14190121)
Used it in my master dissertation. Great tool.
Re:Netem: linux network emulator by nialv7 on Tuesday April 25, 2017 @05:17AM (#14191909)
This question might be off-topic, but shouldn't this be called a network "simulator"?
Re:Netem: linux network emulator by ragix on Tuesday April 25, 2017 @01:18AM (#14190975)
I've used this to emulate bad dslam uplinks. either on the bras or mitm. It works well.