易陆发现互联网技术论坛

 找回密码
 开始注册
查看: 4225|回复: 0
收起左侧

How to install the Mininet SDN Network Simulator

[复制链接]
发表于 2018-12-20 01:17:48 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?开始注册

x
December 3, 2014% P) R/ K+ W' ~) Q1 B$ U7 n( Z
Most people who use the Mininet network simulator will download and set up the Mininet virtual machine image. However, there are times when we may want to use a different version of Mininet than the one already installed in the Mininet VM.
% F7 T% N. a+ D1 E7 F0 F
2 N1 t, z) Y" |" [" f2 kFor example, we may want to use the newest features of Mininet currently being developed. The Mininet project releases beta-quality source code that user can download and install themselves.  s' r: {5 a" D1 Z

# N' B+ `3 b8 T9 AThis post will show how to install Mininet 2.2 Beta on a virtual machine image running Ubuntu Server. The steps described below should work for any version of Mininet that the user wants to install.
1 m4 J1 p' \4 T( U
  i" e) S$ `( W: I# K) I1 _7 Q; C/ w, U. W
Do not install Mininet on your host computer! s7 o* M6 Q; ~& f% g2 y1 j* `3 l
Warning: Do not install Mininet on your host computer. Install in in a virtual machine.2 ?* c, h: [5 W4 o

% V2 P7 j: d- T  Y5 i! Y" ^" IThe Mininet install script may overwrite files in your home directory (depending on what you already have installed)1. If Mininet makes changes that cause problems on an existing virtual machine, you can just delete the VM and try again with a fresh Ubuntu Server image. But, if you install Mininet directly on your host computer you may cause problems.
8 M- x* ?7 a, W/ D4 O' ?0 k" p% \! }) O6 Z/ Z" {# m3 u( a
In my own experience, I tried installing Mininet on my host computer to see what would happen. After the installation was complete, I encountered system error messages and my current installation of Open vSwitch stopped working on my computer.
6 p/ }+ [2 s7 o2 G6 h4 O- B$ o6 b9 \4 x, f9 r6 b9 E# J
Unless you are a Linux expert, ensure that you install Mininet only on a VM.
/ p5 C9 R/ @# ]# M/ w) l# N/ M* ]" p% V# Y" S$ ^
Installation Procedure
' e# n' {" Q. X: ]$ `" r9 J- jThe Mininet documentation provides installation instructions. In this post we describe the procedure we followed and add a few details we think are helpful. The Mininet documentation also provides information about how to uninstall Mininet, how to install Mininet in other Linux distributions, and other details that we do not cover in this post.* v' n7 Z1 D  v& I" }+ D% k
1 o; d' c$ B" v: c, a  [
To install Mininet 2.2 Beta on a new virtual machine, we will execute the following steps:
7 g# e8 u4 F% U+ N8 e5 w- w- R1 ]7 @% g1 q4 f5 m! s) u
Install Ubuntu Server 14.04 on a new VirtualBox virtual machine image
" h( f& ?  |, D+ |0 l4 O2 xUpdate the Ubuntu Server system and install required software$ [: ~2 B! p) k: X( V" Y; ]" s" O
Install Mininet 2.2 on the Ubuntu Server virtual machine
0 {2 q+ j8 K3 s- S9 i( v, s8 NSet up the virtual machine to work with the host computer
$ m9 N) @" k8 W4 x; LLogin to the Ubuntu Server VM and enable X11 forwarding using SSH
" S. g; F2 X8 l/ u; X" }Install Ubuntu Server on a VM. {1 x# L' ^  ^/ l
0 P% m" z' u! I4 K7 k% j
Download the Ubuntu Server 14.04 ISO image from ubuntu.com.
( ]3 }: }- G7 f! e* D; L+ t" ]. P& g( P6 Z. X/ T9 v
Create a new virtual machine in VirtualBox and install Ubuntu Server on it. Use the steps described in my previous post about installing Debian in a VirtualBox VM. The procedure is the same.
" j* B/ O4 E, ]; p2 e7 H! K& H% |  B
When installing Ubuntu Server, you can use all the default configurations and choose setting specific to your needs that will be obvious to you (like country, keyboard layout, and time zone).( N& U7 S; u$ c& \4 l# M

* ]% v1 f& g- X' N+ kIn our example, I chose to name the server mininet-2-2 and to create a userid brian so all the following examples will use these names. You may choose different names.
5 ?5 C7 Y# N) D- ^3 \# N- U. {, u" A7 b8 j
Update the Ubuntu Server VM
9 k% K8 g; `* @3 w4 i
1 y4 K" t% E5 x6 LFirst download and install system updates.' C0 k4 D% e7 t* q

# P2 Y2 ^4 _) A1 z2 P$ sudo apt-get update( t1 L+ u) Y% [& B; g
$ sudo apt-get upgrade5 _4 @5 P! [0 @( [" T7 \3 o, T4 }
$ sudo apt-get dist-upgrade6 ^( ?7 U% c# ?+ @* n0 W  N
Install required software' A! i4 R# i9 B( G: u% _
/ O5 P( s' A# G- S7 Z
Install git. Git is the software version control system used by the Mininet project.- l$ [, E$ i$ S. S6 h

( R) q3 @+ q' _" |( I7 {" B$ sudo apt-get install git) q( h% h+ Y  s' Q3 [% _8 t
Install Mininet 2.2 from source code
4 H" t9 C, D9 S. l
2 f, Q) p3 m2 N9 I! LUse git to download the Mininet 2.2.0 source code.7 k" N7 x2 K" {

5 t. V$ D) C" B* Z& K$ git clone git://github.com/mininet/mininet
% D( L# ~6 z9 w/ t1 N0 `This creates a folder in the home directory named mininet that contains the project file structure.
+ V! y0 x; b5 d! X. ]+ x  P* @( D0 Z
To find the latest beta version of Mininet, list all tagged releases in the Mininet project.; O* |* [9 ?8 P7 r. A6 p; a' K
8 E- {. H1 |" }1 w1 x, g
$ cd mininet/ K! G! `+ @! s9 L1 c7 b* u3 C3 X* E
$ git tag
! m6 Q+ M! c! c+ t1.0.0' \; `( Y5 Z' H2 @  B
2.0.0
% |+ W1 V2 q6 r  L) M% e. Q2.1.0& i0 \3 S& u# `1 u. T5 N
2.1.0p1
9 l9 n- S; N+ F4 t  B& \! A3 A2.1.0p2! g! ~9 W& q4 G$ c/ ~
2.2.0b05 `9 }, ^# J5 @, W8 d) C: z
2.2.0b1
* A, S- e, g" t! k2.2.0b2
1 {$ N3 `  r6 I2.2.0b3
7 G' t9 d5 s. x: ^8 ?cs244-spring-2012-final
# v; l9 c, b$ y7 J) F4 MAbove, we see the latest available beta release is 2.2.0b3. So, we switch to that branch on our virtual machine.# d$ {/ d( n* D! c

/ s+ f5 e- g0 @% ~$ git checkout -b 2.2.0b36 f3 F1 c) E- N% W! L) N$ d4 _
Switched to a new branch '2.2.0b3'9 h; p" l( C- {) |1 W3 k
The Mininet project provides an install script. Run the script. This will install Mininet 2.2 because the script is run using the files in the Mininet 2.2.0b3 branch.9 Z4 N, b2 n& `" Z
/ _7 P- B: U; x! L, r
$ ~/mininet/util/install.sh -a+ l( }' V5 z+ m! ~' i
After the script stops running, test that the installation was successful. Execute the following command to test the installation. It should run a short Mininet scenario successfully.
! a% P* P+ k! m& H4 z
- C1 C8 g$ N, m, T5 |$ sudo mn --test pingall9 c9 T% W* |- R9 `
Set up the VM to work with the host computer  \2 r! c. S! C7 I4 j2 B! Z
+ T0 a& \. c. f# \
Now we will set up the virtual machine so that we can connect to it from the host computer using SSH.
& Q. h3 I0 N) L0 O% M6 p5 c" R( ~; o% L$ b
Shut down the Ubuntu Server VM.
4 j+ }: C  i- v
3 q2 z1 C/ V: y/ W  o+ _# d' k$ sudo shutdown -h now
$ `$ ?1 v4 H& P3 l. \In VirtualBox, Add a host-only adapter to the VM. Use the procedures listed below in my post about setting up the Mininet VM.
4 k4 W" S$ D/ ^7 ~( A7 N: P' t# J% Q. @4 y, \
Add a Host-only Adapter in VirtualBox
7 P' H5 u( D5 o% v8 ]9 f, oAdd Network Adapter to Mininet virtual machine
8 V& b9 k! F) i. [$ b: O/ hStart the Ubuntu Server VM again and log in via the VirtualBox console window4 S. M6 a6 L( T9 v
Configure a new virtual ethernet interface on the virtual machine
. G5 e1 \/ q3 d) u5 w" hIn the VirtualBox console menu, login to the VM and make a note of the IP address used by the host-only adapter:
: k4 e0 t0 K- E3 p# c, O* B
4 Y' t1 W' r, z) O$ ifconfig eth1
" V) v7 g7 Q' b, Y( ?* iYou may log out of the VirtualBox console if you want.9 E& {0 F( [; v: o8 y

3 P2 o3 l+ d6 n5 T  A% SLogin to the Ubuntu Server VM
2 P) E& F% A" X4 z+ Z
# `" D6 [% F1 y$ d$ SIn our example above, the VM’s host-only adapter IP address is 192.168.56.101. So we will connect to this address via SSH from a terminal window on the host computer. This enables X11 forwarding so we can run X applications, such as Wireshark or MiniEdit.0 m7 O7 O% o  w6 J/ {

. k6 v: D) h9 Wadmin@Host:~$ ssh -Y brian@192.168.56.101
& z* G( W+ ^+ ~- p/ F  @  Jbrian@mininet-2-2:~$
# E* z! b2 K6 i" v9 k0 ~- O9 XIn the example above, we have a user account blinklet on the Ubuntu Server named mininet-2-2. You may have defined a different username and server name.
2 e6 J; ^. @, p" d0 {! w1 u. H: u+ K0 U! a3 q6 o& j! L
Conclusion
4 ^/ T4 V3 q" [2 t5 Q4 Y% r8 AWe installed Mininet 2.2 Beta on a virtual machine running Ubuntu Server 14.04.. Y# k$ ^- o' _; l* x$ @) |
, O0 W% q8 I* _7 |/ N7 o5 `' ]! f
See the README.md file in the ~/mininet directory after you download the Mininet source code
您需要登录后才可以回帖 登录 | 开始注册

本版积分规则

关闭

站长推荐上一条 /4 下一条

北京云银创陇科技有限公司以云计算运维,代码开发

QQ|返回首页|Archiver|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )点击这里给我发消息

GMT+8, 2026-4-8 23:53 , Processed in 0.675833 second(s), 24 queries .

Powered by Discuz! X3.4 Licensed

© 2012-2025 Discuz! Team.

快速回复 返回顶部 返回列表