Marionnet is an open-source network simulator that creates a network composed of Linux virtual machines. A group of educators at the Université Paris 13 created Marionnet so they could use it as an educational tool. Marionnet allows students to build and configure networks, and save their configurations for future use. It also allows teachers to prepare exercises and tests.
The Marionnet network simulator uses User-Mode Linux (UML) and Virtual Distributed Ethernet (VDE). We will explore the Marionnet graphical user interface and test Marionnet’s functionality as we work through a basic simulated network scenario.
I described installing Marionnet on a Linux machine in a previous post. So, we will assume Marionnet is already installed and the X server configuration changes have been completed. We also assume the Marionnet daemon is configured to run at startup, or that you have already manually started the daemon (this was also described in the previous post).
Unfortunately, the Marionnet project lacks good user documentation. The Marionnet wiki has a few specific HOWTO documents related to installing Marionnet and creating filesystems for Marionnet, but provides no instructions on how to use Marionnet.
The only user documentation currently available (at the time of this post) is the paper, Marionnet: a virtual network laboratory and simulation tool, which was presented by the Marionnet development team at the SimulationWorks 2008 conference. That paper summarizes the Marionnet user interface and operation, but lacks details. Still, I found it useful as a starting point.
When testing the Marionnet network simulator, I had to figure out how things worked by experimenting. So, this post is longer than other test-drive posts because I am documenting what I learned about operating the Marionnet network simulator. I hope this post will help others use Marionnet.
Start Marionnet by running the command:
A splash screen showing some information about the Marionnet software will appear. Click on the splash screen to make it go away. then you will see the Marionnet GUI.
Create a new project
Then, select the command from the Marionnet window to start a new project:
Project → New
In the dailogue box that appears, enter the project file name and the folder in which to save the project file. Marionnet project file names have the “.mar” extension and they store the network topology information and the COW file systems for the UML virtual machines associated with each network element created in the project so node configurations are saved in the project file.
Once a project is created (or opened) you will be able to add routers and link to the GUI and start experimenting.
After creating a new project you will add devices and cables to the canvas by using the Devices Palette on the left side of the Marionnet user interface. The devices are described below:
Machine: The Machine device is a UML virtual computer running a Linux operating system. The virtual computer uses a filesystem provided by the Marionnet project. The user can select a specific filesystem to run, if more than one is available.
Hub: The hub device reproduces all received Ethernet frames out all of its connected ports. Hubs are useful for intercepting traffic in a virtual network. For example, one could connect a virtual computer running Wireshark to a hub that connects other devices to each other and monitor all traffic passing between the other devices attached to the hub.
Switch: The Switch operates like an Ethernet switch. Received frames are sent out the port connected to the addressed node. The virtual switch is implemented by the VDE process so it supports a lot of functionality. The user can configure STP and VLANs so it is possible to do some complex experiments with Link-layer networking in Marionnet.
Router: The Router device is a virtual machine running a lightweight Linux filesystem, named Pinocchio by the Marionnet development team. The router virtual machine runs quagga as its routing engine so it supports dynamic routing protocols. No routing protocols are running when the router is started so you will have to configure and enable routing protocols using the router terminal.
Layer-2 Network: The Layer-2 network device represents a “cloud” that would be made up of an unknown number of network elements and it operates like a 2-port hub. The Marionnet documentation suggests that this element is useful for emulating network effects like delay and packet loss, which are configured in the Defects tab on the GUI. But, I don’t see how this differs from just configuring the same defects on a cable. I doubt that this network element is useful.
Real World Access: The Real world access device provide a TAP driver connection to the host machine’s Ethernet interface. This device would be used to connect the simulated network to equipment attached to the ethernet interface of the host computer.
Working with cables
Marionnet accounts for the cases where either straight or crossover Ethernet cables may be necessary. In a Marionnet network simulation scenario, if you use the wrong the of cable in the wrong situation, the connection will not work.
Straight Cables must be used when connecting a device that has an MDI port to a device that has an MDIX port, such as when connecting a Machine device to a Switch device.
Crossover Cables must be used when connecting together two network devices that would usually have MDI ports, such as Machine devices and Router devices.
Crossover Cables must be used when connecting network devices that would normally have MDIX ports, such as Switch devices, Hub devices or Layer two network devices
I believe that the Marionnet developers created the program logic to enforce these types of connections so they could provide a more realistic network emulation for the students using the program. Knowing where to use crossover cables is useful when working with real equipment.
We must take into account Marionnet’s requirements for using the correct cables, according to the rules created by the program’s developers:
|MDI to MDI||Crossover|
|MDI to MDIX||Straight|
|MDIX to MDI||Straight|
|MDIX to MDIX||Crossover|
Note: Many devices manufactured in the past ten years will auto-negotiate the crossover using Auto-MDIX functionality on their Ethernet ports but Marionnet does not consider that case in its network emulation model.
Using the Marionnet network simulator
Now, we will use Marionnet to create a very basic network that includes a few computers, a switch, and a router. We will show how to configure new network elements in Marionnet and how to configure them. We will also show how to run simple network tests in the simulated network.
We will start our test-drive with a very simple network. We will create two virtual computers and connect them to each other with a crossover cable. Then we will configure each computer to communicate with the IP network which should allow data to pass between the two computers.
First, we create two virtual machines using the Machine tool on the Device Palette. Click on the Machine tool and then click on the Add menu item.
Machine → Add
Each time you click on Machine → Add, the Machine configuration box will appear.
Fill in the fields in the dialogue box. In my case, I chose to write the IP address I plan to configure for each virtual machine in the Label box so the address information will appear on the GUI. I left all other fields at their default values.
I gave machine m1 the label 10.0.100.2/24 and gave machine m2 the label 10.0.100.3/24. These are just labels and do not create any configurations on the machines.
Now, two virtual machines appear on the canvas.
Next, we add a Crossover Cable between the machines. Click on the Crossover Cable tool and select Add. A dialogue box will appear.
You can choose the name of the cable so we will use the default name, c1. Select the “from” machine and port and the “To” machine and port so that the cable connects between the eth0 port on machine m1 and the eth0 port on machine m2.
Now, start the simulation by clicking on the Start all button on the Marionnet GUI.
On the canvas, we see two virtual machines running with a crossover cable connecting them together.
Once the virtual machines start up, the terminal window for each virtual machine will appear on the host desktop.
Log into each virtual machine. The userid and password are both “root”.
Note: the Machine devices use a filesystem that does not have the ip command installed so we will use ifconfig and route commands on the machines.
On Machine m1, configure eth0 with the IP address 10.0.100.2/24.
m1:~# ifconfig eth0 10.0.100.2/24 up
On Machine m2, configure eth0 with the IP address 10.0.100.3/24.
m2:~# ifconfig eth0 10.0.100.3/24 up
Now, if we have a connection between the two virtual machines, we should be able to use the ping command to verify that IP packets can pass from one machine to the other over the connection.
Let’s execute the ping command on machine m1, and ping the machine m2.
m1:~# ping 10.0.100.3 PING 10.0.100.3 (10.0.100.3) 56(84) bytes of data 64 bytes from 10.0.100.2: icmp_seq=1 ttl=64 time=21.6 ms 64 bytes from 10.0.100.2: icmp_seq=2 ttl=64 time=0.443 ms
We see that the connection is working.
Stop the ping command by pressing the
C key sequence in the m1 terminal window.
Add a switch
One nice feature of Marionnet is that some changes can be made while the simulation is running. This simulates more real-world scenarios where network elements may be added and cables may be moved while other machines connected to the network are still running.
We will add a switch to the network and connect the machines, m1 and m2, to the switch, s1.
First, we will remove the crossover cable between the two machines. Click on the Crossover Cable device in the Devices Palette, click on Remove and then click on the cable name, c1.
Then we add a switch to the canvas by clicking on the Switch device in the Device Palette and then clicking on Add. The Add Swtich dialogue box will appear. Just use the default settings.
Now, connect machines m1 and m2 to the switch using straight cables. Click on the Straight Cable device in the Devices Palette and then click on Add. Select m1 and S1 in the From and To fields, respectively. The ports will be automatically assigned (or you can select your preference).
Repeat the process to connect machine m2 to switch S1.
Now, start the switch by click on the Start all button on the Marionnet GUI. This will start any devices that are not already started which, at this time, is the switch S1.
You can also, if you desire, select the specific device you want to start by selecting the device type in the Devices Palette, clicking on Start, and then clicking on the name of the device you wish to start.
Now we see two machines connected to a switch.
We can confirm that the two machines can still communicate with each other over this network by executing the same ping command we performed, previously.
m1:~# ping 10.0.100.3 PING 10.0.100.3 (10.0.100.3) 56(84) bytes of data 64 bytes from 10.0.100.2: icmp_seq=1 ttl=64 time=22.9 ms 64 bytes from 10.0.100.2: icmp_seq=2 ttl=64 time=1.17 ms
Add a router
Now, add a router and another machine to the project. Click on the Router device in the Devices Palette and click Add.
You will see the Add Router dialogue box.
In the Add router dialogue window, you can configure the number of ports and the port 0 IP address.
Port 0 address is pre-configured with the provate IP address 192.168.1.254/24. The Marionnet program requires that a router must always have a valid IP address configured on port 0. This default value can be changed in the /etc/marionnet/marionnet.conf file.
The easiest way to connect to the router is to check the Show unix terminal box in the Add Router dialogue box so that Marionnet will open a new xterm window connected to the router when it starts up.
Next, add one more machine, m3, and give it the label 10.0.200.2/24 to indicate the IP address we intend to configure on its interface. Connect machine m3 to port 2 on router R1 using a crossover cable.
Then, connect port 1 on router R1 to switch S1 using a straight cable.
Click the Start all button.
Now, the network consists of three machines, one switch and one router.
We still need to configure the interfaces on each of the new devices.
Note: the Router device uses a filesytem that has the ip command installed so we can use it.
On the xterm window connected to router R1, run the ip command to configure the interfaces eth1 and eth2.
So, to configure port 1 and port 2 on the router R1, which are respectively named eth1 and eth2, with the required IP address, we enter the following commands in the xterm window connected to router R1:
R1:~# ip addr add 10.0.100.1/24 broadcast 10.0.100.255 dev eth1 R1:~# ip link set eth1 up R1:~# ip addr add 10.0.200.1/24 broadcast 10.0.200.255 dev eth2 R1:~# ip link set eth2 up
Also configure the interface eth0 on machine m3 with the IP address 10.0.200.2/24:
m3:~# ifconfig eth0 10.0.200.2/24 up
Now all our “Layer 3” devices (routers and machines) have basic interface configuration completed. Now we need to configure network routing on all these devices so that we can communicate between devices that are on the different networks connected to the router.
Next, now machines m1 and m2 on one networks and m3 on another network. The machines need to have their default gateways configured so they know which interface to which to send packets adressed to a compute not directly attached to their own network.
On each of the machines, enter the following commands to add the default route:
m1:~# route add default gw 10.0.100.1 eth0
m2:~# route add default gw 10.0.100.1 eth0
m3:~# route add default gw 10.0.200.1 eth0
The router R1 does not need any configureation beacsue, in this simple network, it is directly attached to both networks so the Linux system automatically adds those two networks to its routing table.
Now we see that packets can travel from one network to the other by pinging machine m3 from machine m1:
m1:~# ping 10.0.200.2 PING 10.0.200.2 (10.0.200.2) 56(84) bytes of data 64 bytes from 10.0.200.2: icmp_seq=1 ttl=64 time=38.8 ms 64 bytes from 10.0.200.2: icmp_seq=2 ttl=64 time=1.90 ms
The Machine devices have the Wireshark packet analyzer application installed. When you run wireshark on any machine, the GUI appears on the host computer’s desktop.
For example, let’s start wireshark on machine m1:
m1:~# wireshark &
Then, we’ll start wireshark monitoring interface eth0 on machine m1. Use the wireshark menu command Capture → Interfaces…, then click on the Start button on the eth0 interface.
Send some start a ping command on machine m1 to machine m3 and watch the traffic sent and received on m1’s eth0 interface.
A word of warning: if you start wireshark on more than one virtual machine, there is no indication which virtual machine each wireshark window is associated with. Be careful you do not lose track of which window was started on which virtual machine.
Shut down the simulation
To stop the simulation and stop all network elements, click on the Shutdown all button.
Save the project
Marionnet projects can be saved and re-opened. A saved project include the network topology and the copy-on-write filesystems from each virtual machine, router, and switch in the project. Only changes to configuration files are saved so all the configuration changes we made on the machines and router above, which did not change configuration files, will not be saved. But, had we modified the networking and interface configuration files on each machine, we could have saved the configurations and re-used them when we start the project again.
You can save the project at any time by using the Marionnet menu command:
Project → Save
Project → Save as
When you close the project or quit Marionnet, you are asked if you want to save it.
Close the project
You can close the project using the Marionnet menu command:
Project → Close
To quit Marionnet, use the menu command:
Project → Quit
We explored the tools provided by the Marionnet network simulator that make it easy to create and manage virtual machines, routers, switches, and cables in an emulated network.
The Marionnet network simulator is functional and easy to use. Marionnet uses VDE as the switch component, so it will be interesting to explore switching scenarios using VDE, which offers more functionality than the bridge-utils used by some of the other simulators I tested.
However, Marionnet could be updated. The project is bundled with virtual machine filesystems that run older versions of Linux and some of the modern networking commands are not available on some of the filesystems. An advanced user could fix by herself by creating new filesystems based on newer versions of Linux and using them in Marionnet.
In future posts, I’ll discuss managing the way the network is displayed on the canvas, other network simulation functions, advanced functions, ways to extend Marionnet’s capabilities, and some of the apparent bugs I found while testing Marionnet.