When developing software that communicates over a network it is desirable to test for correct functioning in different scenarios on a real network. Computer networks can have largely varying degrees of complexity, nodes can spontaneously become unreachable, connections between nodes have limited bandwidth, may introduce delays or bit errors and packets can arrive in a different order or become lost.
The goal of this thesis is to develop a simple tool that uses a text based description to create a virtual computer network using Linux network namespaces. The tool can then start specific programs on different network nodes and process a list of tests to be run for fully automated testing of networked software in a fashion similar to unit testing. Network namespaces allow partitioning the set of available network interfaces on a system into subsets. Processes bound to a network namespace can only access the interfaces of one such subset.
Similarly, routing tables and ip tables can be configured per network namespace. Thus, network namespaces and special, pipe-like virtual network devices that transport packets between namespaces can be used to create virtual networks on a single system. Furthermore, special packet schedulers that introduce delay, packet loss or limit bandwidth can be used for emulating realistic network behavior with minimal overhead, compared to virtual machine based solutions, allowing for much larger and more complex networks.