Marionnet network simulator test drive

May 2, 2013 — 12 Comments

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.

marionnet-desktop-shot-done

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.

Marionnet installation

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).

Marionnet documentation

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

Start Marionnet by running the command:

$ marionnet.byte

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.

The Marionnet Linux network simulator graphical user interface

The Marionnet network simulator graphical user interface

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.

Marionnet devices

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:

MachineMachine: 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.

HubHub: 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.

SwitchSwitch: 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.

RouterRouter: 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 networkLayer-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.

TAP interface to real worldReal 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 cableStraight Cable: The Straight Cable device creates a connection between two network elements. You must use the correct cable type, either straight or crossover, or the connection will not pass data.

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 cableCrossover Cable: The Crossover Cable device creates a connection between two network elements. You must use the correct cable type, either crossover or straight, or the connection will not pass data.

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

Device Port type
Machine MDI
Hub MDIX
Switch MDIX
Router MDI
Layer-2 network MDIX

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:

Connection Cable required
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.

Two Machines

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.

Marionnet Linux Network Simulator add machine

Marionnet Add Machine dialogue box

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.

Marionnet Linux network Simulator crossover cable dialog box

Marionnet Add Crossover Cable dialogue box

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.

Marionnet Linux Network Simulator - Two <em>machines connected with crossover cable

Two machines connected with crossover cable

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 CtrlC 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.

remove crossover cable menu command

Remove Crossover Cable 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.

add switch dialog box

Marionnet Add Switch dialogue box

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).

add straight cable dialogue box

Marionnet Add Straight cable dialogue box

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.

Marionnet Add Router dialogue box

Marionnet 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.

A router connects two networks

A router connects two networks: 10.0.100.0/24 and 10.0.200.0/24

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.

Configure routing

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:

Machine m1:

m1:~# route add default gw 10.0.100.1 eth0

Machine m2:

m2:~# route add default gw 10.0.100.1 eth0

Machine m3:

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

Wireshark

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.

wireshark marionnet linux network simulator

Wireshark running on machine m1

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

or

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

Quit Marionnet

To quit Marionnet, use the menu command:

Project → Quit

Conclusion

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.

12 responses to Marionnet network simulator test drive

  1. Another problem solved: lack of DHCP and DNS server. Solution is simple: download Mandriva 2010 image from Marionnet site http://www.marionnet.org/downloads/contrib/filesystems/mandriva2010.tgz It’s French based but easy to setup (ask Google).

  2. Thanks for the excellent article. I am having an issue though. I did the test-drive step by step, but when I reached the wireshark part, my terminal wouldn’t open wireshark. I got a message, “(wireshark:2477): Gtk-WARNING **: cannot open display: 172.23.0.254:0

    Have you seen/heard of this before? Do you know of a solution?

    Thanks!

    Lowell

    • Hi Lowell,

      Did you follow my procedure for installing Marrionnet? See the section titled “Ensure X is Configured Correctly” in my post: http://www.brianlinkletter.com/install-the-marionnet-network-simulator-on-debian-linux-6-0/.

      The error you report indicates that the X server running on the UML virtual node cannot find the display on the host computer.

      Marionnet uses TCP to communicate between virtual machine X clients and the host X server. In Debian and Ubuntu, listening to TCP is disabled by default for security reasons. This will block communication between Marionnet virtual nodes and the host computer. In my experience, the Marionnet install script did not make all the necessary changes to the configuration files to enable TCP. You need to do it manually using the procedure I described in the post I referenced above.

      Regards,
      Brian

      • Brian,

        Thanks again for your help. I had missed the details when completing the installation. Everything works great now.

        V/R

        Lowell

  3. Thanks for the excellent website!

    I’ve been leading network class for beginners since few years. I began with Imunes, and starting from 2012 I switched to Marionnet. As you pointed out, it contains now outdated filesystems of virtual machines. Perhaps you know if there is any document describing how to prepare such filesystem?

    Thanks again for the very useful overview of the network simulators

    Best regards
    Maciej

  4. Hello again,

    I have been working on connecting a small simulated network to the internet through the Marionnet Gateway. However, it only seems to work if the Gateway is in the same domain as the machines on the network. So far, I’ve been able to install a gateway inside of each domain in my network and each domain can connect to the internet, and I have a router connecting the domains within the network. But it seems like I should be able to have one Gateway connected to the router and all domains should be able to hit the internet through that port on the router, but I can’t seem to understand how this would work. I can’t find any documentation on this problem either. Have you attempted this and how did you do it if you did.

    Thanks again for all the information you have already provided.

    Lowell

    • Hi Lowell,

      When you say “Marionnet Gateway” do you mean the “Marionnet Real World Interface”? That’s the icon with a globe on it. That creates a TAP interface which is a bridged connection so it will not perform any gateway or routing functions. I assume you use the term “gateway” and “router” to define the same thing: a router. Is that correct?

      I haven’t used the Marionnet Real World Interface and there is no Marionnet documentation so I can’t be of more help. Sorry.

      Brian

      • You are correct, I was referring to the Marionnet Real World Interface. They call it a gateway. I am attempting to connect it to a router and have the computers connect to the internet through the router using the Real World interface. It works really well if the computer is directly connected to the interface or if a few computers are connected to it through a switch.

        Lowell

Leave a Reply

Text formatting is available via select HTML. <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*