How do I simulate packet loss on an Android device? I'd like to simulate packet loss on a rooted Android device to see how different levels affect video streaming quality. I've tried netem and iptables, without success:

netem:

# tc qdisc change dev rmnet0 root netem loss 0.1%
tc qdisc change dev rmnet0 root netem loss 0.1%
Android does not support qdisc 'netem'
Garbage instead of arguments "loss ...". Try "tc qdisc help".


Is the format wrong or is it possible to add netem support somehow?

iptables:

# iptables -A INPUT -m statistic --mode random --probability 0.01 -j DROP
iptables -A INPUT -m statistic --mode random --probability 0.01 -j DROP
iptables v1.3.7: Couldn't find match `statistic'

Try `iptables -h' or 'iptables --help' for more information.


Is there any other alternative in Android?
It is possible to set network latency and speed using the emulator control functions of the standard Android Developer tools.

If using eclipse:  Select Window\Open Perspective\DDMS
On the screen you will see a tab named "Emulator Control".  In this tab, you will find the Speed and Latency options.  The 'Telephony Settings' at the very top have speed and latency selections.

There are other ways to modify these settings (including scripting them in your emulator setup), but this is the simplest way to access the settings.