Software Development with Linux

Network protocol testing

THU, 01 SEP 2011

While the development of new network protocols is not a mainstream activity, it is still pretty fun. Have you already tried it? You should. You do not even need to think of a completely new protocol; you may think of a way to improve or add features to an existing one. Trying to develop your own network protocol is a great learning experience, and learning is good.

But how do you go with testing your new protocol without messing up your real network or buy dedicated network equipment (routers, PCs, etc.)? An easy solution is to virtualize or simulate everything.

Many tools exist for Linux to help you with those tasks. Lets look at some of those.

User-mode Linux : User-mode Linux lets you run a Linux kernel as a normal application. This allow you to run any number of Linux system, without using a virtual machine. This is an easy way to test kernel code, and you can even start the application (the Linux kernel) inside any kind of debugging tool (gdb, valgrind, etc.) to find issue with your changes. A great tutorial to running many User-mode Linux application at the same time is the paper Building Virtual Honeynets using UML.

Network simulators : A network simulator allow you to simulate complete network infrastructure with any characteristics you want. Some tools offer more feature than others, so you should try them all and see which fits your need. For example, some use real network traffic while others lets you simulate everything (no code required!). The best tools in this area are : NIST Net, ns-2, Marionnet, NSC, networksimulator, and WANem.

Wireshark : The famous network protocol analyzer. You can not do any network related works without knowing how to use Wireshark. This is especially try if you want to debug network applications.

Armed with those tools, you can let yourself loose and start having fun with network protocols!