Introduction
Wireless Network Reproduction (aka WNR) is a network emulator which allows developers to exactly reproduce any kind of terrible network condition on your own mobile device, or even Android/iOS emulators running on Mac OS.
Features
Aspects that can be controlled by WNR include:
- Bandwidth
- Latency
- Packet loss
- Packet corruption
- Packet reordering
- Packet duplication
- Packet throttling
You could run WNR in two different mode:
- Gateway Mode: First share your internet connection through Internet-Sharing, and then WNR would shape / interfere the network traffic between your MacBook and your mobile device, just like a router.
- Emulator Mode: Just start an Android / iOS emulator, specify the process name in WNR, and then you will have emulated network condition in your virtual machine. In this mode you don't need a real mobile phone.
Advantages
- Extremely Customizable: WNR is designed to reproduce any type of network condition, which means that it is not just simply shaping the network traffic like
tc
orATC
, but forcing the network to act as some specific pattern. With WNR, we could not only produce a bandwidth limited network, but also make the bandwidth vary by time, and even approach a user defined curve. The example configuration is here, and its actual effect is shown below. - Apply on Process: When running WNR on your host, you can choose to shape network traffic only for a specific process, and dump the entire conversation into a
.pcap
file, which could be used for detailed analyze.
Requirements
- A MacBook running OS X Yosemite / EI Capitan
- An Android/iOS mobile phone, or emulators like GenyMotion, Droid4X, etc.
Download
For Chinese users, please download WNR through Baidu Yun.
For other users, check Github releases for latest build.
Getting Started
- Download WNR from URL links above.
- Extract and save it into your hard drive.
- Run this app, click "Network Emulator" button, and enter your root password.
- If this is your first time to run this, you need to disable kernel extension checking according to the prompt.
- Restart your Mac and run this app again, you may see the emulator interface shown above.
- Click "Add Configuration" and select a default configuration or your customized ones.
- If you need to inspect on packets transmitted from / to your device, then select a position to save
.pcap
files. - If you want to run emulation on real device, then start "Internet-Sharing" of macOS, and switch emulator mode to "WiFi" instead of "Local".
- If you want to run emulation on Android virtual machine, you need to specify the PID or process name ("vboxheadless" for VirtualBox based Android emulators) of your Android emulator.
- Finally, when everything is ready, click "Start" and check if the emulator is working as expected.
Notice
- DO NOT run this application directly in dmg image!!! You should first extract it from image, save it into a local folder, and then try to run it.
- Path to the application should NOT contain any non-ASCII characters, otherwise it would encounter an error.
Examples
Network Emulation
The following animation shows the basic usages of WNR.
Bandwidth Limitation
The following animation shows how to limit bandwidth of a specific process such as wget
.
TCP Connection Analyze
We use a time-related function bandwidth(t) = 256 + 1024 * sin(t/4) (KB/s)
to emulate some sort of dynamic bandwidth limitation, and then use TCP data visualization of WNR to show the actual bandwidth variation, which results in the figure shown below:
Contributions
Please use Github issues for requests.
We guarantee that we will try our best to meet the need of new features / bug fixes in first 30 issues; and we actively welcome pull requests.
ChangeLog
Changes are tracked as Github commits and releases.
License
Wireless Network Reproduction is BSD-licensed.