Statistics
| Branch: | Tag: | Revision:

mininet / INSTALL @ f2eaeac7

History | View | Annotate | Download (4.68 KB)

1
Preliminary Mininet Installation/Configuration Notes
2
---
3

    
4
- This is not (yet) a 'release'; things may be broken.
5

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

    
11
- To install mininet, with root privileges:
12

    
13
  # make install
14

    
15
  This places the mininet package in /usr/lib/python-2.5/site-packages/,
16
  so that 'import mininet' will work, and installs the primary mn
17
  script (mn) as well as its helper utility (mnexec.)
18

    
19
- Mininet requires a kernel built with network namespace support enabled,
20
  i.e. with CONFIG_NET_NS=Y
21
  
22
  If your kernel doesn't support it, you will need to build and install a 
23
  kernel that does! >= 2.6.33 works best, but requires a patch to
24
  ofdatapath and to tun.c (see patches [1] and [2], below.)
25
  
26
  2.6.26 works with CONFIG_NET_NS enabled and no additional patches, but
27
  it is much slower at removing veth interfaces, resulting in much slower
28
  switch shutdown.
29
    
30
- Mininet should probably be run either on a machine with
31
  no other important processes, or on a virtual machine.
32
  Multiple concurrent Mininet instances are not supported.
33

    
34
- To run the iperf test, you need to install iperf:
35

    
36
    sudo aptitude/yum install iperf
37

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

    
42
    sudo aptitude/yum install sshd xterm screen
43
    
44
  Consult the appropriate example file for details.
45
  
46
- To switch to the most recent OpenFlow 0.8.9 release branch (the most
47
  recent one with full NOX support):
48

    
49
  git checkout -b release/0.8.9 remotes/origin/release/0.8.9
50
  
51
  To compile for Linux 2.6.33, you may need to apply the patch
52
  included below.
53

    
54
- Mininet will automatically load and remove kernel module dependencies for
55
  supported switch types, using modprobe and rmmod - but these modules must be
56
  in a location where modprobe can find them.
57

    
58
  See ~/mininet/util/modprobe_setup.sh for an example.
59

    
60
- The reference OpenFlow controller (controller(8)) only supports 16
61
  switches by default! If you wish to run a network with more than 16
62
  switches, please recompile controller(8) with larger limits, or use a
63
  different controller such as nox.
64
  
65
- For scalable configurations, you might need to increase some of your
66
  kernel limits. Sample params are in sysctl_addon, which can be appended to
67
  /etc/sysctl.conf (and modified as necessary for your desired
68
  configuration):
69

    
70
    sudo su -c "cat sysctl_addon >> /etc/sysctl.conf"
71

    
72
  To save the config change, run:
73

    
74
    sudo sysctl -p
75

    
76
---
77

    
78
[1] OpenFlow Reference Implementation patch for Linux 2.6.33/2.6.33.1
79

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

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

    
86
diff --git a/datapath/datapath.c b/datapath/datapath.c
87
index 4a4d3a2..365aa25 100644
88
--- a/datapath/datapath.c
89
+++ b/datapath/datapath.c
90
@@ -47,6 +47,9 @@
91

    
92
#include "compat.h"
93

    
94
+#ifdef CONFIG_NET_NS
95
+#include <net/net_namespace.h>
96
+#endif
97

    
98
/* Strings to describe the manufacturer, hardware, and software.  This data 
99
 * is queriable through the switch description stats message. */
100
@@ -259,7 +262,11 @@ send_openflow_skb(const struct datapath *dp,
101
                 struct sk_buff *skb, const struct sender *sender)
102
{
103
       return (sender
104
-               ? genlmsg_unicast(skb, sender->pid)
105
+#ifdef CONFIG_NET_NS
106
+               ? genlmsg_unicast(&init_net, skb, sender->pid)
107
+#else
108
+               ? genlmsg_unicast(skb, sender->pid)
109
+#endif
110
               : genlmsg_multicast(skb, 0, dp_mc_group(dp), GFP_ATOMIC));
111
}
112

    
113
[2] Linux kernel 2.6.33/2.6.33.1 tun driver patch
114

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

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

    
132

    
133

    
134