Open-source DevOps tools are used to deploy applications and services in datacenter server networks, but they may also enable researchers or students to simulate networks. In this post, we will survey popular open-source DevOps tools and provide links to information that shows how to use them to create network simulation scenarios.
Most open-source network simulators simplify the setup and configuration of virtual machines and the networking connections between virtual machines. DevOps tools such as OpenStack do the same things, although they expose more of the complexities of the virtualized infrastructure to the user.
If you are already using DevOps tools for other activities you may find it useful to also use them when you need to create a simulated network instead of learning to use a network simulator.
Comparing simulators to DevOps tools
Both open-source network simulators and a coordinated set of DevOps tools perform the same role: they orchestrate the setup, interconnection, and configuration of virtual nodes in a virtual network.
Open-source simulators are built to support small-scale simulation scenarios on one computer, although some can run in a distributed mode across multiple computers. DevOps tools are designed to work in datacenters composed of hundred or thousands of servers, and each server may be running dozens of virtual nodes.
Both simulators and DevOps tools support three main functions: virtualization, networking, and configuration.
Most open-source simulation tools use virtual machines or containers to create the virtual hosts and routers in a simulated network. The virtualization technologies used to create these virtual machines are VirtualBox, QEMU, KVM, Linux Namespaces, and User-Mode Linux. Each open-source network simulator supports one or two of these technologies.
Both open-source network simulators and DevOps tools provide virtual machine management functions to orchestrate the setup of a defined network topology composed of virtual machines. Each open-source network simulators does this in its own way; it was what defines the major difference between each type of simulator. Popular open-source DevOps tools that manage virtual machines are Vagrant, Docker, OpenStack, CloudStack, and libvirt.
To create connections between virtual network nodes, open-source network simulators use technologies such as KVM networking, VirtualBox networking, Linux bridging, Open vSwitch, and Virtual Distributed Ethernet. The simulators simplify the setup of these network connections between nodes in the virtual network.
DevOps tools use these same base technologies and, like open-source network simulators, provide functionality to make it easier to set up links between nodes in the virtual network. Vagrant, OpenStack, CloudStack, and Docker are used to define the network topology in which the virtual machines operate. Weave is a DevOps tool that makes Docker container networking easier to manage.
Some open-source network simulators provide functions to configure hosts and routers in the virtual network. Others require users to configure nodes using the each node’s command-line interface after they are created. Open-source simulators usually provide functions to save the state of nodes for future use, either by saving a configuration file and/or by saving snapshots of each node’s filesystem.
DevOps tools are designed to simplify the process of creating virtual node configurations and sending them to newly-created virtual nodes. Some popular DevOps configuration management tools are Ansible, Chef, Puppet, and Salt. OpenStack and CloudStack also provide configuration management and filesystem snapshot management features. Linux shell scripts can also be used to configure nodes.
Using DevOps tools as simulators
Most DevOps tools are used in combination to create a simulated network. For example, one might use Vagrant to create a script that sets up virtual machines in a network using technologies such as KVM and Linux bridging, and use a configuration management tool like Ansible to configure each virtual machine to an initial state. Then users can log into the virtual machines and perform testing related to the simulation scenario.
Below, I list some scenarios that illustrate the use of different combinations of DevOps tools to simulate networking scenarios.
VirtualBox and Vagrant
Michael Sverdlik wrote a procedure that shows how to create reproducible network configurations using Vagrant and VirtualBox. His procedure does not cover configuration of nodes. Users would log into each node and configure it manually.
KVM, Vagrant, and Ansible
Matt Oswalt wrote a procedure to create a virtual lab of open-source routers using KVM, Vagrant, and Ansible. This is a good example of automating the configuration of a networking scenario’s initial state.
Docker, Vagrant, and Puppet
Daniel Masterson wrote a Masters thesis that describes how to create reusable virtual machines to simulate networks for cyber-security testing (PDF file). He used Docker, Vagrant, and Puppet.
Docker and Weave
One could use Weave Net and Weave Scope along with Docker containers to create a network of VMs in a graphical user interface.
KVM and OpenStack
Cisco’s Modeling Labs and their VIRL network simulator uses OpenStack. Ivan Pepelnjak described how Cisco used KVM and OpenStack to simulate network scenarios.
There are probably more good examples of using other DevOps tools to simulate networks. If you know of one please add a comment and I will add it, if it is appropriate.
We reviewed the open-source DevOps tools that may be used to create network simulation scenarios and provided links to information that would help users create simulations using DevOps tools.