Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

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?

share|improve this question
3  
Good question! My thought: as an alternative, maybe connect to a wifi router and throttle the connection there if your router does quality of service or similar? –  Bryan Denny Nov 1 '11 at 15:57
    
Kind of related, here is how to capture packets on a rooted Android device: vbsteven.be/blog/… –  Bryan Denny Nov 1 '11 at 16:01
    
The router configuration is probably the proper way of doing it, and I do have that simulation in place by using WANem. However, I'd like to have a portable way that does not rely on the network configuration, or the network interface for that matter. Basically I want to do a unit test where I run video streaming, increase the packet loss and run the same video again. –  fejd Nov 2 '11 at 8:02
add comment

3 Answers 3

Since your device is rooted you can install a Proxy. I've used TransparentProxy. Then setup a proxy on another machine on your local network. Point TransparentProxy to that proxy and then set your Proxy to throttle. A few proxies that might work include CharlesProxy or Service Capture.

If that doesn't work then you can come at it from the router level. A machine running BSD or Linux can function as a router. Or you can get a Virtual appliance or bootable CD to do it for you.

share|improve this answer
add comment

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.

share|improve this answer
add comment

I would reference this thread: http://serverfault.com/questions/201588/configuring-a-router-to-drop-packets-introduce-latency-corrupt-data

Doesn't seem to be any reason iptables shouldn't work.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.