Virtual Network (or vnet) is a metrically correct framework over which PHY level radio networks can be created to simulate low power (lpw) mesh networks on a single Linux based computer. It consists of two components: virtual radio fabric and virtual net. The virtual fabric simulates the PHY layer and MAC layer for each virtual device. The virtual net facilitates running a higher layer, like a 6LoWPAN IPv6 stack, on top of the virtual fabric for a device.

The virtual network helps to test networks with

  • Large number of nodes (current levels run with networks of 7500 nodes), or;
  • Complex topologies;

which are difficult to do using physical devices.

It also aides with the stack and application development for

  • Testing of new features, such a routing algorithms or application components, in various network scenarios;
  • Regression testing of full firmware suites using script test cases, and;
  • Diagnosing customer deployments.

The virtual fabric simulates a network of low power devices which can transmit and receive. The number of nodes, the physical locations (x,y) and the receive sensitivity, on a real world basis, of each node in the network can be preconfigured using a configuration file. The virtual fabric reads the information from this configuration file and creates virtual nodes running a virtual PHY and MAC based on the contents of this file. The nodes can be moved later and new nodes can also be added to the network as needed with the help of vnet commands. Virtual net can be used to run an application such as a JupiterMesh network manager and LoWPAN stack on top of the virtual fabric. This enables the virtual nodes to form a network as a border router or join a network as a router and communicate with other nodes on the network.

The overall virtual network is divided into two major components – virtual fabric and virtual net. Virtual fabric code is written in C, while virtual net consists of Python scripts.

The virtual fabric mimics a real world radio network and simulates packet transmission among virtual radio devices. It also simulates the path loss and noise, just like in a real world scenario. It consists of a virtual PHY layer and has the MAC layer on top of it. In the virtual fabric, the virtual nodes are spread across a two dimensional grid. Each virtual node has a position in the grid, identified by the X and Y coordinate. The unit of these values is in meters. A user can specify the coordinates for each node at the time of initialization of the network. The coordinates can be changed later, to move a virtual node across the grid. This enables the user to create various network topologies in the virtual network. Each virtual node in the virtual fabric is given a unique Unix socket, over which MCP is used, to form the interface to the MAC layer of a node. The virtual fabric also has a sniffer module that can be used to sniff packets which are being transmitted among the virtual nodes.

Each virtual node in the network is represented by a process running in a separate Linux kernel namespace. Although all the virtual nodes are running on a single machine, each node can see only its set of resources i.e. its own network interface, its own version of the file system and its own set of processes running within that node.  When a new virtual node is created, a new namespace is started in the system, and an initialization process is executed inside that namespace which becomes the root process of the namespace.

A typical flow of messages in the virtual net is:

The virtual net can send messages to the virtual fabric to modify the simulated parameters of a virtual node. The user can execute various vnet commands to change some of these parameters.

A Graphical viewer has been added to the sniffer component to allow for real time visualization of the underlying network. A sample of this is shown in the video clip below, which depicts the start of a rectangular 1000 node network showing the router advertisements as the network forms.


This can be seen as ROLL/RPL in action., with the network being formed and knots in the formation being untangled in time.