📜 ⬆️ ⬇️

Emulate network problems with WANem

Picture to attract attention Recently, one of the customers of TestLab² wanted to know how its installer will work (with downloading on the fly) on different channels. Suddenly, the first approaches showed that the usual edge, umts and wimax channels (not to mention the wired ones) in our district are lucky enough to work very well.
To create difficult conditions, we found and applied a specialized tool WANem , which I will discuss under the cut.

What is WANem?

This is a knoppix-based distribution kit that allows you to emulate various client network connection conditions. First of all, it is useful for testing and debugging applications that will work in un-understandable conditions without physical immersion in these very conditions.
Rules for work can be created both manually and through a more or less convenient web-interface.

How to apply WANem?

Take any virtualization system and load the LiveCD in it. Or, if you are using VMWare solutions, download a ready-made virtual machine. In the future, I will proceed from the download from the LiveCD.

WANem preparation

  1. Create a new virtual machine (1core / 256ram will be quite enough), indicate the source of the LiveCD download
  2. We confirm download from livecd
  3. Confirm the configuration of all network interfaces via DHCP (or refuse, and later specify the IP manually)
  4. The startup script creates a perc user and asks which password to set for it (ssh is allowed by default)
  5. By specifying the password, we can connect to SSH
  6. We get to the WANem command line interface. Let's start with a simple help command, which will list all available commands with a brief description.
    • help - help output
    • about - display version and copyright
    • clear - clear the screen
    • reset - reset network settings and restart services
    • shutdown - shutting down the system
    • restart - system restart
    • status - show current system status (IP addresses, routes, service states)
    • wanemreset - resetting the rules of WANem itself (if you’ve been wise to the evil and access to the web-interface does not work)
    • assign - specify the IP address manually (if you previously refused DHCP)
    • quit - exit the WANem console

basic setting wanem 3 Open in the browser http: // IP of virtual / WANem / and see the interface to manage. From the menu are available:

Health check

basic setting wanem 3 Inside itself, WANem operates with rules that can be set explicitly in Advanced Mode, or simply selected from those available in Basic Mode. The easiest application scenario is to turn on the mode, say ISDN 128 Kbps and a delay of 500 milliseconds. After saving these settings, you need to command the machine on which the test application is installed to route all of your traffic through WANem.

After this simple action, it is enough to make a traceroute from the test machine to the outside world and make sure that the first hop is the IP of the virtual machine with WANem and that the packet delay ± coincides with the one specified in the settings.
')
Fine tuning

Fine tuning wanem 4 Making sure with the help of Basic Mode that our test station wraps all network traffic through the emulator, you can proceed to more fine-tuning. First of all, you should pay attention to the extensive settings of the random distribution of delays, errors and packet loss packets. Another small step to the realism of emulation.
I will decipher the most incomprehensible options in advance:

For example, you can set the parameters of loss and restoration of communication, you can emulate the presence of a connection but the absence of data packets, the loss or damage of% of packets.
If necessary, WANem can work with several network interfaces at the same time (creating different rules for them), which allows to implement the most sophisticated network configuration.

WANem Alternatives

I know a paid product for Windows called SoftPerfect Connection Emulator ($ 99 / $ 149).
UPD : For OS X, goshakkk_reborn recommends Network Link Conditioner from Xcode.
UPD : For Windows x1shn1k also prompted TMnetSim Network Simulator (freeware, there are versions × 32 and × 64)

findings

Excellent, fairly simple and effective tool. I personally lack a little logging on the WANem side, but I suspect that this is solved by third-party utilities, which have yet to be resolved.

Here are a couple of examples of profiles that we used for tests: CDMA EV-DO rev.A , EDGE .

Official site: wanem.sourceforge.net , distribution ~ 400mb
The latest version: 2.3, 03/15/2011

Source: https://habr.com/ru/post/127274/


All Articles