| 1 |
|
| 2 |
Mininet Installation/Configuration Notes |
| 3 |
---------------------------------------- |
| 4 |
|
| 5 |
Mininet 2.3.0 |
| 6 |
--- |
| 7 |
|
| 8 |
The supported installation methods for Mininet are 1) using a |
| 9 |
pre-built VM image, and 2) native installation on Ubuntu. You can also |
| 10 |
easily create your own Mininet VM image (4). |
| 11 |
|
| 12 |
(Other distributions may be supported in the future - if you would |
| 13 |
like to contribute an installation script, we would welcome it!) |
| 14 |
|
| 15 |
1. Easiest "installation" - use our pre-built VM image! |
| 16 |
|
| 17 |
The easiest way to get Mininet running is to start with one of our |
| 18 |
pre-built virtual machine images from <http://mininet.org/> |
| 19 |
|
| 20 |
Boot up the VM image, log in, and follow the instructions on the |
| 21 |
Mininet web site. |
| 22 |
|
| 23 |
One advantage of using the VM image is that it doesn't mess with |
| 24 |
your native OS installation or damage it in any way. |
| 25 |
|
| 26 |
Although a single Mininet instance can simulate multiple networks |
| 27 |
with multiple controllers, only one Mininet instance may currently |
| 28 |
be run at a time, and Mininet requires root access in the machine |
| 29 |
it's running on. Therefore, if you have a multiuser system, you |
| 30 |
may wish to consider running Mininet in a VM. |
| 31 |
|
| 32 |
2. Next-easiest option: use our Ubuntu package! |
| 33 |
|
| 34 |
To install Mininet itself (i.e. `mn` and the Python API) on Ubuntu |
| 35 |
16.04+: |
| 36 |
|
| 37 |
sudo apt-get install mininet |
| 38 |
|
| 39 |
Note: this may install an older version of Mininet which may not |
| 40 |
support Python 3. If you would like the latest version of Mininet, |
| 41 |
consider installing from source as described in the next section. |
| 42 |
|
| 43 |
3. Native installation from source |
| 44 |
|
| 45 |
If you are running Ubuntu, Debian, or Fedora, you may be able to use |
| 46 |
our handy `install.sh` script, which is in `util/`. Please read the |
| 47 |
following sections first. |
| 48 |
|
| 49 |
3.1. Obtaining the Mininet source code |
| 50 |
|
| 51 |
If you're reading this, you've probably already done so, but the |
| 52 |
command to download the Mininet source code is: |
| 53 |
|
| 54 |
git clone git://github.com/mininet/mininet.git |
| 55 |
|
| 56 |
Note that the above git command will check out the latest and greatest |
| 57 |
Mininet (which we recommend!) If you want to run the last |
| 58 |
tagged/released version of Mininet, you can look at the release tags |
| 59 |
using |
| 60 |
|
| 61 |
cd mininet |
| 62 |
git tag |
| 63 |
|
| 64 |
and then |
| 65 |
|
| 66 |
git checkout <release tag> |
| 67 |
|
| 68 |
where <release tag> is the release you want to check out. |
| 69 |
|
| 70 |
3.1.1 *CAUTION: USE AT YOUR OWN RISK!* |
| 71 |
|
| 72 |
`install.sh` can be a bit intrusive and may possibly damage your OS |
| 73 |
and/or home directory, by creating/modifying several directories |
| 74 |
such as `mininet`, `openflow`, `oftest`, `pox`, etc.. We recommend |
| 75 |
trying it in a VM before trying it on a system you use from day to |
| 76 |
day. |
| 77 |
|
| 78 |
Although we hope it won't do anything completely terrible, you may |
| 79 |
want to look at the script before you run it, and you should make |
| 80 |
sure your system and home directory are backed up just in case! |
| 81 |
|
| 82 |
You can change the directory where the dependencies are installed |
| 83 |
using the -s <directory> flag. |
| 84 |
|
| 85 |
util/install.sh -s <directory> ... |
| 86 |
|
| 87 |
3.1.2 Running `install.sh` |
| 88 |
|
| 89 |
Installing a "minimal" version of Mininet with Open vSwitch should |
| 90 |
be reasonably non-perturbing since it should not create directories |
| 91 |
for other tools: |
| 92 |
|
| 93 |
util/install.sh -nv |
| 94 |
|
| 95 |
Note this will not install a controller, so you will have to either |
| 96 |
install your own controller, or use a switch such OVSBridge that does |
| 97 |
not require a controller: |
| 98 |
|
| 99 |
sudo mn --switch ovsbr --test pingall |
| 100 |
|
| 101 |
To install Mininet itself, the OpenFlow reference controller, and |
| 102 |
Open vSwitch, you may use: |
| 103 |
|
| 104 |
util/install.sh -fnv |
| 105 |
|
| 106 |
This should be reasonably quick, and the following command should |
| 107 |
work after the installation: |
| 108 |
|
| 109 |
sudo mn --test pingall |
| 110 |
|
| 111 |
3.1.3 Python 3 and Python 2 support |
| 112 |
|
| 113 |
Mininet supports Python 3 and Python 2. By default, `install.sh` |
| 114 |
will use whatever `python` is on your system. To specify a |
| 115 |
specific version of Pythonm, you can set the PYTHON environment |
| 116 |
variable: |
| 117 |
|
| 118 |
PYTHON=python3 util/install.sh -fnv |
| 119 |
|
| 120 |
You can install Mininet for both Python 3 and Python 2: |
| 121 |
|
| 122 |
PYTHON=python2 util/install.sh -fnv |
| 123 |
PYTHON=python3 util/install.sh -n |
| 124 |
|
| 125 |
Whichever version was installed last will be the default for `mn`. |
| 126 |
As long as Mininet is installed for the appropriate version of |
| 127 |
Python, you can run it using that versinon of Python: |
| 128 |
|
| 129 |
python3 `which mn` |
| 130 |
python2 `which mn` |
| 131 |
|
| 132 |
To install ALL of the software which we use for OpenFlow tutorials, |
| 133 |
including POX, the OpenFlow WireShark dissector, the `oftest` |
| 134 |
framework, and other potentially useful software, you may use: |
| 135 |
|
| 136 |
util/install.sh -a |
| 137 |
|
| 138 |
This takes about 4 minutes on our test system. |
| 139 |
|
| 140 |
3.2. (Experimental) Native installation from source on Fedora: |
| 141 |
|
| 142 |
As root execute the following operations: |
| 143 |
|
| 144 |
* install git |
| 145 |
|
| 146 |
yum install git |
| 147 |
|
| 148 |
* clone the Mininet repository |
| 149 |
|
| 150 |
git clone git://github.com/mininet/mininet.git |
| 151 |
|
| 152 |
* install Mininet, the OpenFlow reference implementation, and |
| 153 |
Open vSwitch |
| 154 |
|
| 155 |
util/install.sh -fnv |
| 156 |
|
| 157 |
* enable and start openvswitch |
| 158 |
|
| 159 |
sudo systemctl enable openvswitch |
| 160 |
sudo systemctl start openvswitch |
| 161 |
|
| 162 |
* test the mininet installation |
| 163 |
|
| 164 |
sudo mn --test pingall |
| 165 |
|
| 166 |
Note that `install.sh -fnv `may not install all dependencies on Fedora, |
| 167 |
and many tests may still fail. |
| 168 |
|
| 169 |
4. Creating your own Mininet/OpenFlow tutorial VM on Ubuntu/Debian |
| 170 |
|
| 171 |
Creating your own Ubuntu Mininet VM for use with the OpenFlow tutorial |
| 172 |
is easy! First, create a new Ubuntu VM. Next, run two commands in it: |
| 173 |
|
| 174 |
wget https://raw.github.com/mininet/mininet/master/util/vm/install-mininet-vm.sh |
| 175 |
time install-mininet-vm.sh |
| 176 |
|
| 177 |
Finally, verify that Mininet is installed and working in the VM: |
| 178 |
|
| 179 |
sudo mn --test pingall |
| 180 |
|
| 181 |
5. Installation on other Linux distributions |
| 182 |
|
| 183 |
Although we don't support other Linux distributions directly, it |
| 184 |
should be possible to install and run Mininet with some degree of |
| 185 |
manual effort. People have even gotten `mn --switch user` to run |
| 186 |
in a ChromeOS container. |
| 187 |
|
| 188 |
In general, you must have: |
| 189 |
|
| 190 |
* A Linux kernel compiled with network namespace support enabled |
| 191 |
|
| 192 |
* An compatible software switch such as Open vSwitch or |
| 193 |
the Linux bridge. |
| 194 |
|
| 195 |
* Python, `bash`, `ping`, `iperf`, etc. |
| 196 |
|
| 197 |
* Root privileges (required for network device access) |
| 198 |
|
| 199 |
We encourage contribution of patches to the `install.sh` script to |
| 200 |
support other Linux distributions. |
| 201 |
|
| 202 |
|
| 203 |
As always, please feel free to submit issues or pull requests for |
| 204 |
installation-related features. |
| 205 |
|
| 206 |
Good luck, and have fun! |
| 207 |
|
| 208 |
Mininet Developers |
| 209 |
|
| 210 |
--- |