找回密码
 注册
查看: 4229|回复: 0

How to install the Mininet SDN Network Simulator

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2018-12-20 01:17:48 | 显示全部楼层 |阅读模式
December 3, 2014: ?1 {8 A! V6 ]  O* y, j- s) V
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.
5 p) f3 ?5 b; P! K; v4 T, m  v2 h8 U* S0 [, F  q8 ]
For 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.
, C- P/ V0 \8 @2 a  L1 h7 B
, G8 _7 Z( O7 a  O& MThis 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.
5 X9 N: h; K* X# l# B" E  \4 y: d% p# y3 B3 H1 O
& n& o. f( C/ u$ u2 f
Do not install Mininet on your host computer
6 }& ]" \& K* z0 \Warning: Do not install Mininet on your host computer. Install in in a virtual machine.
: i1 Q/ T! e8 ~6 R6 v
" q9 @6 C; p% S$ P5 I( u) gThe 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.
9 s; K6 K1 n/ y7 `& w! k3 Q% I/ ^; Z% B: d& V
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.2 h6 y/ V9 k6 e2 }9 T2 r

, k3 n, Z" w' K, K7 wUnless you are a Linux expert, ensure that you install Mininet only on a VM.
5 ^1 Q; |" R0 P; R- R
. C* s+ N8 p! e: VInstallation Procedure
) Z) U6 v8 k7 A2 X6 q  x; vThe 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., G% P& M- m% q. L' H
! n7 {4 a5 y6 _9 c( o% l: X
To install Mininet 2.2 Beta on a new virtual machine, we will execute the following steps:9 c8 l9 I3 b0 o7 I! Y- C9 p$ l8 h
0 O0 o% t5 X. U% w; B; I( j
Install Ubuntu Server 14.04 on a new VirtualBox virtual machine image
" E1 K; U1 `5 n, n* E) e7 wUpdate the Ubuntu Server system and install required software! B, _: Y# @/ r5 ^
Install Mininet 2.2 on the Ubuntu Server virtual machine9 l7 ~- u5 s( }5 z' B
Set up the virtual machine to work with the host computer
& ?" C4 i# x8 i% g+ q: A0 M' CLogin to the Ubuntu Server VM and enable X11 forwarding using SSH. I/ n# I1 z9 d2 i" E
Install Ubuntu Server on a VM
; W: d' i! y  N1 u0 ~# g$ n% f/ R% a3 u9 K6 U5 A
Download the Ubuntu Server 14.04 ISO image from ubuntu.com.& y* _/ C' R  o" ^, S5 D; U7 K
, _( d) T5 S3 ~7 @
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.4 ]$ {, c3 k0 |4 J) ~
* _  m" k  l" n! u# L) q) ^5 r
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).. r5 g# [1 Q; x8 ^6 z' s# o) T

7 Q& T2 b- Z! l# Q: J1 i! U! y% TIn 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.' y4 v5 X4 v  H' U$ W9 b

. C- x! h7 {1 H' k/ \. yUpdate the Ubuntu Server VM
9 Z0 M- r) i$ B. r7 J" @; [% t" H6 C- v# }% w
First download and install system updates.
. p& Z( E8 p8 ?
+ {# C4 u5 p, G) q$ sudo apt-get update4 j, h8 ?1 `( {) p, b
$ sudo apt-get upgrade
' T$ p1 Z: [$ L3 y5 l  j$ sudo apt-get dist-upgrade
3 D  r; J! G4 G. g1 `8 ]Install required software
/ }6 [* {- ]  @+ q8 a4 O8 a/ m8 i) L, H
Install git. Git is the software version control system used by the Mininet project.
1 V# I) X1 t2 [" m! v" p" ]! V; i4 n! R' G2 l) W1 k! d2 }
$ sudo apt-get install git
6 K$ _6 H% i$ n% l8 S1 dInstall Mininet 2.2 from source code- ^2 `; \7 \8 l+ S; T) u4 N

; m8 V4 U: \4 J( F1 J& N' ]Use git to download the Mininet 2.2.0 source code.* P$ Z% n, x6 v, C1 j
+ D  b4 e" A. I+ B
$ git clone git://github.com/mininet/mininet
0 n% V% p& F$ x9 i  TThis creates a folder in the home directory named mininet that contains the project file structure.$ U8 z6 q1 r% Y2 X
* {2 E$ r! x  I7 a. `1 V& q
To find the latest beta version of Mininet, list all tagged releases in the Mininet project.
0 J. T7 U  m& z! Z9 n- a3 w* J& L' w9 [
$ cd mininet
" O- {2 w0 M; {" |; C5 E8 `: \$ git tag
/ n! _0 R: C7 D. S# z$ W; W$ I1.0.0
7 ?  G+ i. l# R" n& q+ j! N% X6 i2.0.0
: R& r& ~0 q1 V2.1.0
: X* {3 H  Y$ y2.1.0p1
2 A* `% M; P3 }) D+ `3 R2.1.0p21 V3 ]) b1 \/ J) E
2.2.0b0
  o+ C3 b5 i+ z2.2.0b1
8 Z8 V+ }7 x4 `2 \  I, r8 B2.2.0b2
! F* `2 q6 n! O$ L7 }  B( y2.2.0b3
7 P0 g1 s" n* Q5 b9 z0 f2 ~cs244-spring-2012-final
; |4 t- ]1 R. P' B7 x' [; VAbove, we see the latest available beta release is 2.2.0b3. So, we switch to that branch on our virtual machine.
' ]  }- ^6 h) e7 I/ D0 n' l
# [( a7 i+ @+ z* B/ v% i# K$ git checkout -b 2.2.0b31 j" s* I. n, W( W+ E6 V
Switched to a new branch '2.2.0b3'% V5 [+ L2 e, d% O' B
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.
* e* `' G$ P2 B' T' q2 l/ B! V7 L3 O4 W6 H; O, m7 \$ Y
$ ~/mininet/util/install.sh -a" L; }$ d  ~+ Y0 T$ |( {
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.
, N5 c0 q' l2 b# R
, p( \. _4 \7 g* _( b$ sudo mn --test pingall' O& x1 [* C- i7 }# l' O: R6 k7 }
Set up the VM to work with the host computer
6 U8 r3 X3 ~" A1 {% A+ @6 N  N) C: A: e2 D) }5 y3 d$ Q/ x8 [
Now we will set up the virtual machine so that we can connect to it from the host computer using SSH.
7 h8 t$ \4 B' z7 B! C
( J; H$ m; P/ FShut down the Ubuntu Server VM.
* k$ h4 _( t8 \) Q# w8 @" [
: P7 X  j3 e8 r- m6 P% ?5 y0 V$ sudo shutdown -h now
1 P' m+ R. l$ K6 M* O& G0 EIn VirtualBox, Add a host-only adapter to the VM. Use the procedures listed below in my post about setting up the Mininet VM.
3 ^7 w, i% K! _3 w+ m6 V4 ~5 W/ }: x+ Z6 W
Add a Host-only Adapter in VirtualBox, H" x; I- d. |2 v
Add Network Adapter to Mininet virtual machine
0 U6 a+ [' I* M$ s! V* wStart the Ubuntu Server VM again and log in via the VirtualBox console window5 d9 A7 t9 G, j5 y$ M2 U
Configure a new virtual ethernet interface on the virtual machine* p. D* ^9 X. |3 d4 x3 d
In the VirtualBox console menu, login to the VM and make a note of the IP address used by the host-only adapter:
, c' G7 p; x! n' |; X& H% I7 Y' Q" w& g' J3 h
$ ifconfig eth11 w) U/ n8 b0 h4 \
You may log out of the VirtualBox console if you want.
! _& I/ X# l* G+ J1 e0 O3 @: G  R5 B) y2 p" O1 `! }" X, s
Login to the Ubuntu Server VM2 E& w  q( \) L: a0 H

  k- a5 t! u, U- TIn 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.
9 G; ~; N/ k! a
9 `+ h0 S% D3 s5 b! `admin@Host:~$ ssh -Y brian@192.168.56.101
9 N3 h) V2 N* m$ ibrian@mininet-2-2:~$
* X9 E8 Z0 a, a8 I8 {In 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.: Y* j0 G0 ?+ L& t

* l7 [2 N6 K/ y2 ~- M4 LConclusion
0 S# U1 D5 s9 Q1 D" [7 @We installed Mininet 2.2 Beta on a virtual machine running Ubuntu Server 14.04.: ^; g) d) x6 [& n' s& a
3 M# u6 g9 B; d+ c, Y
See the README.md file in the ~/mininet directory after you download the Mininet source code
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 00:58 , Processed in 0.015667 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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