Statistics
| Branch: | Tag: | Revision:

mininet / INSTALL @ 52c700ff

History | View | Annotate | Download (7.44 KB)

1

    
2
Preliminary Mininet Installation/Configuration Notes
3

    
4
Pre-Beta release, 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
2. Script-based kernel and OpenFlow installation for Ubuntu/Debian Lenny
69

    
70
  If you are running Ubuntu 10.04 or Debian Lenny, you may be able to use the
71
  util/install.sh script to install a compatible Linux kernel as well as
72
  other software including the OpenFlow reference implementation, the Open
73
  vSwitch switch implementation, and the NOX OpenFlow controller. Assuming
74
  the mininet source tree is installed in ~/mininet, the steps to run
75
  install.sh are as follows:
76

    
77
  % cd
78
  % time ~/mininet/util/install.sh
79
  % sudo reboot  # to load new kernel
80
  % ~/mininet/util/install.sh -c  # to clean out unneeded kernel stuff
81

    
82
  This installs a lot of useful software, but it will take a while (20
83
  minutes or more, depending on your network connection, computer, etc..)
84

    
85
  If install.sh cannot be used for some reason, or if you don't want to
86
  install all of these components (they're useful!), the kernel and
87
  OpenFlow software requirements are descibed in steps [3] and [4],
88
  which follow.
89

    
90
  If you successfully used install.sh, congratulations! You're basically
91
  done. Proceed to step [6] for additional advice.
92
      
93
3. Linux Kernel requirements
94

    
95
  Mininet requires a kernel built with network namespace support enabled,
96
  i.e. with CONFIG_NET_NS=Y, such as the kernel shipped with
97
  Ubuntu 10.04 LTS, currently 2.6.32. On Ubuntu 10.04, you should not need
98
  to install or build a custom kernel, although 2.6.33+ is faster at
99
  tearing down virtual ethernet pairs.
100

    
101
  For Ubuntu and Debian, we provide a 2.6.33 kernel package which you may be
102
  able to install using "util/install.sh -x". Note our kernel package
103
  requires an ext2 or ext3 root file system, so it won't work if you have
104
  a default Ubuntu install, which uses ext4.
105
  
106
  If your kernel wasn't compiled with CONFIG_NET_NS=Y, you will need to 
107
  build and install a  kernel that does! >= 2.6.33 works better, but may 
108
  be harder to get working, depending on your Linux distribution.
109
  
110
  A script for building Debian packages for 2.6.33.1 is provided in
111
  mininet/util/kbuild. You may wish to read it, as it applies patches
112
  to enable 2.6.33.1 to build under debian-stable, and to enable the
113
  tun driver to work correctly with Mininet.
114
    
115
  Earlier kernels (e.g. 2.6.29) work with CONFIG_NET_NS enabled and no
116
  additional patches, but are much slower at removing veth interfaces,
117
  resulting in much slower switch shutdown.
118

    
119
  For scalable configurations, you might need to increase some of your
120
  kernel limits. Sample params are in util/sysctl_addon, which can be
121
  appended to /etc/sysctl.conf (and modified as necessary for your
122
  desired configuration):
123

    
124
    sudo su -c "cat sysctl_addon >> /etc/sysctl.conf"
125

    
126
  To save the config change, run:
127

    
128
    sudo sysctl -p
129
    
130
4. OpenFlow software and configuration requirements
131

    
132
  Mininet requires either the reference OpenFlow switch implementation
133
  (from openflowswitch.org) or Open vSwitch (openvswitch.org) to be
134
  installed. "make test" requires the reference user space
135
  implementations as well as Open vSwitch. Note the reference kernel
136
  implementation is not currently included in OpenFlow 1.0.
137
  
138
  On Ubuntu and  Debian, the install.sh script may be used with the '-f'
139
  option to install the OpenFlow reference implementation, the '-v' option
140
  to build Open vSwitch, and the '-m' option to install the Open vSwitch
141
  kernel module into /lib/modules (note: you must build Open vSwitch first!)
142
  
143
  Mininet will automatically load and remove kernel module dependencies
144
  for supported switch types, using modprobe and rmmod - but these
145
  modules must be in a location where modprobe can find them (e.g.
146
  something like /lib/modules/`uname -r`/kernel/drivers/net/)
147

    
148
  The reference OpenFlow controller (controller(8)) only supports 16
149
  switches by default! If you wish to run a network with more than 16
150
  switches, please recompile controller(8) with larger limits, or use a
151
  different controller such as nox. A patch to controller(8) is included
152
  as util/openflow-patches/controller.patch.
153
  
154
5. Other software dependencies
155

    
156
  On Ubuntu and Debian, other Mininet dependencies may be installed using
157
  the '-n' option of the install.sh script.
158

    
159
  To run the iperf test, you need to install iperf:
160

    
161
    sudo aptitude/yum install iperf
162

    
163
  We assume you already have ping installed. ;-)
164
  
165
  To use xterm or sshd with Mininet, you need the following:
166

    
167
    sudo aptitude/yum install sshd xterm screen
168
    
169
  Some examples may have additional requirements - consult the specific
170
  example file for details.
171
  
172
  The install.sh script has an '-x' option to install the version of
173
  NOX from the OpenFlow tutorial.
174
  
175
6. Other notes and recommendations
176

    
177
  Mininet should be run either on a machine with
178
  no other important processes, or on a virtual machine (recommended!)
179
  
180
  Multiple concurrent Mininet instances are not supported!
181

    
182
Good luck!
183

    
184
---
185

    
186
Historical information on OpenFlow 0.8.9 and the reference kernel module:
187

    
188
  The kernel reference implementation has been deprecated, but it may
189
  be possible to get it work with Mininet.
190
  
191
  To switch to the most recent OpenFlow 0.8.9 release branch (the most
192
  recent one with full NOX support and kernel datapath support) in your
193
  OpenFlow git tree:
194

    
195
   git checkout -b release/0.8.9 remotes/origin/release/0.8.9
196
  
197
  A patch to enable datapath.c to compile with recent kernels
198
  is included in util/openflow-patches/datapath.patch.
199
  
200
  In OpenFlow 1.0, switch port numbering starts at 1 (for better or for worse.)
201
  To run with previous versions of OpenFlow, it may be necessary
202
  to change SWITCH_PORT_BASE from 1 to 0 in node.py.
203

    
204
  
205
  
206
  
207