Skip to content
Snippets Groups Projects
INSTALL 4.68 KiB
Newer Older
Preliminary Mininet Installation/Configuration Notes
Bob Lantz's avatar
Bob Lantz committed
---
- This is not (yet) a 'release'; things may be broken.

- These installation notes assume you understand how to do things 
  like compile kernels, apply patches, configure networks, write code, 
  etc.. If this is unfamiliar territory, we recommend using one of
  our pre-built virtual machine images.

- To install mininet, with root privileges:

Bob Lantz's avatar
Bob Lantz committed
  # make install

  This places the mininet package in /usr/lib/python-2.5/site-packages/,
  so that 'import mininet' will work, and installs the primary mn
  script (mn) as well as its helper utility (mnexec.)
- Mininet requires a kernel built with network namespace support enabled,
  i.e. with CONFIG_NET_NS=Y
  
  If your kernel doesn't support it, you will need to build and install a 
  kernel that does! >= 2.6.33 works best, but requires a patch to
  ofdatapath and to tun.c (see patches [1] and [2], below.)
  
  2.6.26 works with CONFIG_NET_NS enabled and no additional patches, but
  it is much slower at removing veth interfaces, resulting in much slower
  switch shutdown.
    
Bob Lantz's avatar
Bob Lantz committed
- Mininet should probably be run either on a machine with
  no other important processes, or on a virtual machine.
  Multiple concurrent Mininet instances are not supported.

Bob Lantz's avatar
Bob Lantz committed
- To run the iperf test, you need to install iperf:

    sudo aptitude/yum install iperf

  We assume you already have ping installed. ;-)
  
- You may need other packages to run the examples, e.g.

    sudo aptitude/yum install sshd xterm screen
    
  Consult the appropriate example file for details.
  
- To switch to the most recent OpenFlow 0.8.9 release branch (the most
Bob Lantz's avatar
Bob Lantz committed
  recent one with full NOX support):

  git checkout -b release/0.8.9 remotes/origin/release/0.8.9
Brandon Heller's avatar
Brandon Heller committed
  To compile for Linux 2.6.33, you may need to apply the patch
- Mininet will automatically load and remove kernel module dependencies for
  supported switch types, using modprobe and rmmod - but these modules must be
  in a location where modprobe can find them.
  See ~/mininet/util/modprobe_setup.sh for an example.
Bob Lantz's avatar
Bob Lantz committed
- The reference OpenFlow controller (controller(8)) only supports 16
  switches by default! If you wish to run a network with more than 16
  switches, please recompile controller(8) with larger limits, or use a
  different controller such as nox.
Bob Lantz's avatar
Bob Lantz committed
  
- For scalable configurations, you might need to increase some of your
  kernel limits. Sample params are in sysctl_addon, which can be appended to
  /etc/sysctl.conf (and modified as necessary for your desired
    sudo su -c "cat sysctl_addon >> /etc/sysctl.conf"
  To save the config change, run:

    sudo sysctl -p
Bob Lantz's avatar
Bob Lantz committed
---
[1] OpenFlow Reference Implementation patch for Linux 2.6.33/2.6.33.1

The OpenFlow kernel reference implementation does not compile out of the box
on Linux 2.6.33/2.6.33.1 with network namespaces enabled.

The following workaround modifies it to always use the root namespace, and should
enable it to work with Mininet under 2.6.33.x:

diff --git a/datapath/datapath.c b/datapath/datapath.c
index 4a4d3a2..365aa25 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -47,6 +47,9 @@

#include "compat.h"

+#ifdef CONFIG_NET_NS
+#include <net/net_namespace.h>
+#endif

/* Strings to describe the manufacturer, hardware, and software.  This data 
 * is queriable through the switch description stats message. */
@@ -259,7 +262,11 @@ send_openflow_skb(const struct datapath *dp,
                 struct sk_buff *skb, const struct sender *sender)
{
       return (sender
-               ? genlmsg_unicast(skb, sender->pid)
+#ifdef CONFIG_NET_NS
+               ? genlmsg_unicast(&init_net, skb, sender->pid)
+#else
+               ? genlmsg_unicast(skb, sender->pid)
+#endif
               : genlmsg_multicast(skb, 0, dp_mc_group(dp), GFP_ATOMIC));
}

[2] Linux kernel 2.6.33/2.6.33.1 tun driver patch

The tun driver in Linux 2.6.33/2.6.33.1 doesn't work correctly in a network
namespace. As a result, running the user datapath in a network namespace
(e.g. as is done in examples/scratchnetuser.py) will cause a kernel panic
when sysfs cannot create an entry for a tap interface, since the tun network
device has a missing parent kobj. As a workaround, the following patch
skips creating the sysfs entries when this is the case. This is an acceptable
workaround as long as sysfs entries for tap interfaces are not being actively
used (and they are not currently in Mininet.)

diff linux-2.6.33.1/drivers/net/tun-orig.c linux-2.6.33.1/drivers/net/tun.c 
1009c1009,1011
< 		if (device_create_file(&tun->dev->dev, &dev_attr_tun_flags) ||
---
> 		/* BL workaround: check for null parent kobj */
> 		if (!tun->dev->dev.kobj.sd ||
> 		    device_create_file(&tun->dev->dev, &dev_attr_tun_flags) ||