Thursday, November 19, 2020


Multipass is a command line tool for running Ubuntu virtual machines on Mac or Windows. Multipass uses the native virtualization capabilities of the host operating system to simplify the creation of virtual machines.

Docker testbed and Docker DDoS testbed describe how to use containers to experiment with network visibility and control. However, not all software is amenable to running in containers, and so the ability to quickly create and configure virtual machines is a useful complement. This article demonstrates how to use Multipass to quickly build a virtual machine to run Mininet network emulation software.
multipass launch --name=mininet bionic
multipass exec mininet -- sudo apt update
multipass exec mininet -- sudo apt -y install mininet python-ryu
multipass exec mininet -- sudo apt -y install default-jre python-requests hping3
multipass exec mininet -- wget
multipass exec mininet -- tar -xzf sflow-rt.tar.gz
multipass exec mininet -- ./sflow-rt/ sflow-rt mininet-dashboard

Run the above commands in a terminal to create the virtual machine. Multipass commands can easily be scripted to automate the creation and configuration of virtual machines.

multipass list
List the virtual machines.
Name                    State             IPv4             Image
test                    Running      Ubuntu 18.04 LTS

Find the IP address of the mininet virtual machine we just created (

multipass exec mininet -- ./sflow-rt/

Start sFlow-RT.

Use a web browser to connect to the VM and access the Mininet Dashboad application running on sFlow-RT, in this case
multipass exec mininet -- sudo mn --custom sflow-rt/extras/ \
--link tc,bw=10 --topo tree,depth=2,fanout=2 --test iperf
In a separate terminal, run a test using Mininet.
The Mininet Dashboard shows the test traffic, the links in the emulated network carrying the traffic, and the diameter of the emulated network.
The Topology tab shows a Mininet weathermap, displaying a dynamic view of topology in which link widths update in real-time to reflect traffic flowing over the virtual network.

An external SDN controller can be used to control packet forwarding in the network.
multipass exec mininet -- ryu-manager,
Start the Ryu SDN controller in a terminal window.
multipass exec mininet -- sudo mn --custom sflow-rt/extras/ \
--link tc,bw=10 --topo tree,depth=2,fanout=2 \
--controller=remote,ip= --test iperf
Run the same test as before, but this time connecting to the SDN controller. For a more interesting example, Ryu measurement based control describes how to detect and block denial of service attacks using the controller.

There are additional multipass commands available to manage the virtual machine.
multipass shell mininet
Connect to the virtual machine and access a command shell.
multipass stop mininet
Stop the virtual machine.
multipass start mininet
Start the virtual machine.
multipass delete mininet
multipass purge
Delete the virtual machine.

There are a number of Mininet articles on this blog describing projects that can be run using the virtual machine that demonstrate performance aware software defined networking concepts.


  1. snehas-MacBook-Pro:mininet sneha$ multipass exec mininet -- ./sflow-rt/ -Dscript.file=../ryu.js

    2020-12-03T17:55:30-05:00 INFO: Starting sFlow-RT 3.0-1538

    2020-12-03T17:55:31-05:00 INFO: Version check, running latest

    2020-12-03T17:55:31-05:00 INFO: Listening, sFlow port 6343

    2020-12-03T17:55:32-05:00 INFO: Listening, HTTP port 8008

    2020-12-03T17:55:32-05:00 INFO: ../ryu.js started

    2020-12-03T17:55:32-05:00 INFO: app/mininet-dashboard/scripts/metrics.js started

    2020-12-03T17:58:19-05:00 WARNING: ../ryu.js ../ryu.js#37 not found

    2020-12-03T17:58:19-05:00 INFO: ../ryu.js stopped

    snehas-MacBook-Pro:~ sneha$ multipass exec mininet -- ryu-manager,

    loading app

    loading app

    loading app ryu.controller.ofp_handler

    instantiating app None of DPSet

    creating context dpset

    creating context wsgi

    instantiating app of SimpleSwitch

    instantiating app of RestStatsApi

    instantiating app ryu.controller.ofp_handler of OFPHandler

    (12097) wsgi starting up on

    (12097) accepted ('', 44758)

    No such Datapath: 2 - - [03/Dec/2020 17:58:19] "POST /stats/flowentry/add HTTP/1.1" 404 141 0.070637

  2. If you are trying to run the example in Ryu measurement based control, you need to copy the ryu.js file to the mininet virtual machine. You can open a shell in the virtual machine and edit the file.

    1. Yes i did that , as you can see ryu.js file did start running
      2020-12-03T17:55:32-05:00 INFO: ../ryu.js started
      There seems to be something wrong with the path /stats/flowentry/add because of which it is giving 404 error. - - [03/Dec/2020 17:58:19] "POST /stats/flowentry/add HTTP/1.1" 404 141 0.070637

    2. Are you sure that Mininet is connected to the Ryu controller? The "No such Datapath: 2" message indicates that the OpenFlow connection to Ryu hasn't been established and so it doesn't know about switch 2.

    3. Thanks for the reply, you were right mininet was not connected to ryu i missed --controller=remote when creating topology, may be in the documentation that could be added.
      When i used the following command to create topology it worked fine,thanks a ton!!!!

      multipass exec mininet -- sudo mn --custom sflow-rt/extras/ --link tc,bw=10 --topo tree,depth=2 --controller=remote