Statistics
| Branch: | Tag: | Revision:

mininet / INSTALL @ f6149e4d

History | View | Annotate | Download (8.32 KB)

1

    
2
Preliminary Mininet Installation/Configuration Notes
3

    
4
Pre-Beta version, August 2010
5

    
6
---
7

    
8
(Disclaimer: we're still pre-beta - things may be broken!)
9

    
10
The easiest way to get Mininet running is to start with one of our pre-built 
11
virtual machine images from:
12

    
13
http://www.openflowswitch.org/foswiki/bin/view/OpenFlow/MininetGettingStarted
14

    
15
Once you have booted up the VM image, all you need to do to install
16
Mininet into it is:
17

    
18
 git clone git://yuba.stanford.edu/mininet.git
19
 cd mininet
20
 sudo make install
21

    
22
At this point, it should be possible to run a simple Mininet configuration
23
from the command line:
24

    
25
 sudo mn
26

    
27
As an alternative, if you are Linux-savvy, do not wish to use the VM
28
image, and wish to take on the challenge of installing Mininet and its
29
dependencies from scratch, the requirements are described below.
30

    
31
---
32

    
33
Mininet Manual Installation Notes
34

    
35
These installation notes assume you understand how to do things like
36
compile kernels, apply patches, configure networks, write code, etc.. If
37
this is unfamiliar territory, or if you run into trouble, we recommend
38
using one of our pre-built virtual machine images (see above.)
39

    
40
If you wish to try to create a VM to run Mininet, you may also wish
41
to look at the Wiki page:
42

    
43
http://www.openflowswitch.org/foswiki/bin/view/OpenFlow/MininetVMCreationNotes
44

    
45
0. Obtaining Mininet
46

    
47
  If you're reading this, you've already done it, but the command to
48
  download mininet is:
49
   
50
  git clone git://yuba.stanford.edu/mininet.git
51
     
52
1. Core Mininet installation
53

    
54
  The core Mininet installation requires gcc, make, python,
55
  and setuptools. On Ubuntu and Debian you may install them with:
56
  
57
  # aptitude install gcc make python setuptools
58

    
59
  To install Mininet itself, with root privileges:
60
  
61
  # cd mininet
62
  # make install
63

    
64
  This places the mininet package in /usr/lib/python-*/site-packages/,
65
  so that 'import mininet' will work, and installs the primary mn
66
  script (mn) as well as its helper utility (mnexec.)
67
  
68
  On Ubuntu and Debian, Mininet's dependencies and core files may be 
69
  installed using mininet/util/install.sh -n
70

    
71
2. Script-based kernel and OpenFlow installation for Ubuntu/Debian Lenny
72

    
73
  If you are running Ubuntu 10.04 or Debian Lenny, you may be able to use the
74
  util/install.sh script to install a compatible Linux kernel as well as
75
  other software including the OpenFlow reference implementation, the Open
76
  vSwitch switch implementation, and the NOX OpenFlow controller. 
77

    
78
  Many different installation options are possible by passing different
79
  options to install.sh; install.sh -h lists them all.
80
  
81
  Assuming the mininet source tree is installed in ~/mininet, the steps to run
82
  install.sh to install everything we use for OpenFlow tutorials are:
83
  
84
  % cd
85
  % time ~/mininet/util/install.sh  # installs tons of stuff
86
  % sudo reboot  # to load new kernel
87
  % ~/mininet/util/install.sh -c  # to clean out unneeded kernel stuff
88

    
89
  This installs a lot of useful software, but it will take a while (20
90
  minutes or more, depending on your network connection, computer, etc..)
91
 
92
  Probably the minimal semi-useful configuration would be to install 
93
  Mininet itself, kernel support if necessary, and either the 
94
  reference OpenFlow switch or Open vSwitch. This could be installed 
95
  as follows:
96
  
97
  % sudo ~/mininet/util/install.sh -knvm
98
  
99
  Respectively, this installs kernel support, core mininet dependencies,
100
  Open vSwitch, and the Open vSwitch kernel module. If a new kernel was
101
  installed, then a reboot may be required.
102

    
103
  If install.sh cannot be used for some reason, or if you don't want to
104
  install all of these components (they're useful!), the kernel and
105
  OpenFlow software requirements are described in steps [3] and [4],
106
  which follow.
107

    
108
  If you successfully used install.sh, congratulations! You're basically
109
  done. Proceed to step [6] for additional advice.
110
      
111
3. Linux Kernel requirements
112

    
113
  Mininet requires a kernel built with network namespace support enabled,
114
  i.e. with CONFIG_NET_NS=Y, such as the kernel shipped with
115
  Ubuntu 10.04 LTS, currently 2.6.32. On Ubuntu 10.04, you should not need
116
  to install or build a custom kernel, although 2.6.33+ is faster at
117
  tearing down virtual ethernet pairs.
118

    
119
  For Ubuntu and Debian, we provide a 2.6.33 kernel package which you may be
120
  able to install using "util/install.sh -k". Note our kernel package
121
  requires an ext2 or ext3 root file system, so it won't work if you have
122
  a default Ubuntu install, which uses ext4.
123
  
124
  If your kernel wasn't compiled with CONFIG_NET_NS=Y, you will need to 
125
  build and install a  kernel that does! >= 2.6.33 works better, but may 
126
  be harder to get working, depending on your Linux distribution.
127
  
128
  A script for building Debian packages for 2.6.33.1 is provided in
129
  mininet/util/kbuild. You may wish to read it, as it applies patches
130
  to enable 2.6.33.1 to build under debian-stable, and to enable the
131
  tun driver to work correctly with Mininet.
132
    
133
  Earlier kernels (e.g. 2.6.29) work with CONFIG_NET_NS enabled and no
134
  additional patches, but are much slower at removing veth interfaces,
135
  resulting in much slower switch shutdown.
136

    
137
  For scalable configurations, you might need to increase some of your
138
  kernel limits. Sample params are in util/sysctl_addon, which can be
139
  appended to /etc/sysctl.conf (and modified as necessary for your
140
  desired configuration):
141

    
142
    sudo su -c "cat sysctl_addon >> /etc/sysctl.conf"
143

    
144
  To save the config change, run:
145

    
146
    sudo sysctl -p
147
    
148
4. OpenFlow software and configuration requirements
149

    
150
  Mininet requires either the reference OpenFlow switch implementation
151
  (from openflowswitch.org) or Open vSwitch (openvswitch.org) to be
152
  installed. "make test" requires the reference user space
153
  implementations as well as Open vSwitch. Note the reference kernel
154
  implementation is not currently included in OpenFlow 1.0.
155
  
156
  On Ubuntu and  Debian, the install.sh script may be used with the '-f'
157
  option to install the OpenFlow reference implementation, the '-v' option
158
  to build Open vSwitch, and the '-m' option to install the Open vSwitch
159
  kernel module into /lib/modules (note: you must build Open vSwitch first!)
160
  
161
  Mininet will automatically load and remove kernel module dependencies
162
  for supported switch types, using modprobe and rmmod - but these
163
  modules must be in a location where modprobe can find them (e.g.
164
  something like /lib/modules/`uname -r`/kernel/drivers/net/)
165

    
166
  The reference OpenFlow controller (controller(8)) only supports 16
167
  switches by default! If you wish to run a network with more than 16
168
  switches, please recompile controller(8) with larger limits, or use a
169
  different controller such as nox. A patch to controller(8) is included
170
  as util/openflow-patches/controller.patch.
171
  
172
5. Other software dependencies
173

    
174
  On Ubuntu and Debian, other Mininet dependencies may be installed using
175
  the '-n' option of the install.sh script.
176

    
177
  To run the iperf test, you need to install iperf:
178

    
179
    sudo aptitude/yum install iperf
180

    
181
  We assume you already have ping installed. ;-)
182
  
183
  To use xterm or sshd with Mininet, you need the following:
184

    
185
    sudo aptitude/yum install sshd xterm screen
186
    
187
  Some examples may have additional requirements - consult the specific
188
  example file for details.
189
  
190
  The install.sh script has an '-x' option to install the version of
191
  NOX from the OpenFlow tutorial.
192
  
193
6. Other notes and recommendations
194

    
195
  If you did not install certain useful packages and you wish to later,
196
  it may be possible to install them using install.sh.
197
  
198
  Mininet should be run either on a machine with
199
  no other important processes, or on a virtual machine (recommended!)
200
  
201
  Multiple concurrent Mininet instances are not supported!
202

    
203
Good luck!
204

    
205
---
206

    
207
Historical information on OpenFlow 0.8.9 and the reference kernel module:
208

    
209
  The kernel reference implementation has been deprecated, but it may
210
  be possible to get it work with Mininet.
211
  
212
  To switch to the most recent OpenFlow 0.8.9 release branch (the most
213
  recent one with full NOX support and kernel datapath support) in your
214
  OpenFlow git tree:
215

    
216
   git checkout -b release/0.8.9 remotes/origin/release/0.8.9
217
  
218
  A patch to enable datapath.c to compile with recent kernels
219
  is included in util/openflow-patches/datapath.patch.
220
  
221
  In OpenFlow 1.0, switch port numbering starts at 1 (for better or for worse.)
222
  To run with previous versions of OpenFlow, it may be necessary
223
  to change SWITCH_PORT_BASE from 1 to 0 in node.py.
224

    
225
  
226
  
227
  
228