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

How to install the Mininet SDN Network Simulator

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2018-12-20 01:17:48 | 显示全部楼层 |阅读模式
December 3, 2014
& h) G; B& [& e5 l' V) }8 YMost 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.
+ R# l8 {+ ^" n/ Q
  r/ {* ]3 @. M7 i" rFor 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.
* f9 j1 Y3 V/ q$ ]! G' g% h% z2 d$ b& E1 ^# h8 {$ }7 c
This 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./ M$ J& f* `) ^9 x" q4 ?
  U( s4 Y0 P4 A/ h* q% D  E: F

0 R1 ^, k; M. ZDo not install Mininet on your host computer4 ^' ^% ^  @$ A# z5 f. {
Warning: Do not install Mininet on your host computer. Install in in a virtual machine.5 P# X. F# l3 D
; w: J& W0 P3 p
The 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.6 w* e8 h' \: O; a: W
) d: R  G) K6 e! v" r4 h
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., ]$ L, j8 b+ P1 g* ?

, D0 r% Z0 G9 A6 _9 `Unless you are a Linux expert, ensure that you install Mininet only on a VM.  {4 m6 g/ z/ [" C6 Q9 }

# |& S6 y0 Z+ t: B1 [Installation Procedure4 M& F0 ?' y) k* Q1 K
The 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.
) Z: J1 Y% Z/ [$ j' H+ b+ d; K6 o- e1 _5 F' b
To install Mininet 2.2 Beta on a new virtual machine, we will execute the following steps:! M7 H4 j( y) t2 s/ O$ a" Z

! {# `: j) f  f4 I; P& m9 |Install Ubuntu Server 14.04 on a new VirtualBox virtual machine image. W+ _9 F7 \- m3 v8 c
Update the Ubuntu Server system and install required software; W2 B3 f/ W" @' X
Install Mininet 2.2 on the Ubuntu Server virtual machine
& D, t8 A9 @# A  [5 t8 \Set up the virtual machine to work with the host computer
  D2 c" O# A" w% y2 }. i+ ^Login to the Ubuntu Server VM and enable X11 forwarding using SSH
. n: [# ~* i, T( e/ f$ aInstall Ubuntu Server on a VM# J1 q6 P) z9 e- I' ^) ?

8 `. x* b; U; Y/ w+ P! fDownload the Ubuntu Server 14.04 ISO image from ubuntu.com.
" s$ ]. Q$ V% T. h# N, k5 W# q+ O9 W& Y) G7 `
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.
0 c5 d4 S7 S. J! d- M4 \
1 Q1 n, x/ _% r7 l3 w* t  ^) cWhen 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).6 J- L% `, V% a, `; k
: j# r: \' D/ v' B1 c. B# I
In 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.; o: l' B; m$ g

+ Z$ l% C* y% I* m! iUpdate the Ubuntu Server VM
" ?6 {$ B* s! [! J  y" x
5 B! q( }" ^! X9 q8 zFirst download and install system updates.
- V$ ?- u) h+ C  ]) P6 U# `$ U
2 S2 C2 Z8 Q' _5 I% X$ sudo apt-get update
! F9 i* E, L( {0 L6 K$ sudo apt-get upgrade
( O9 m, O9 Q& e6 S6 c$ sudo apt-get dist-upgrade
1 N: V4 w+ M( E2 s, _& cInstall required software
. [  k9 d- l3 ~7 G$ p; A) C/ X& y( m
1 k! V, R, A& l: b$ ?- pInstall git. Git is the software version control system used by the Mininet project.5 _5 g$ t. r' t! F5 {7 F

" T/ g+ F- T' z9 \# L$ sudo apt-get install git
- ?) M+ H! z% K( ?% l+ r- C' nInstall Mininet 2.2 from source code
: \# f# K+ E. i9 {, L; V; w, \/ x! e7 N& x
Use git to download the Mininet 2.2.0 source code.- b1 Z. H! J5 I6 o9 X! E

' g4 d9 r2 L0 [; C! |) `$ git clone git://github.com/mininet/mininet
  s6 w* A1 w4 ], `2 H' c: }This creates a folder in the home directory named mininet that contains the project file structure.
( _: l& W/ i: Y& I" Y& r, n0 |: |- `3 m" Z' ?0 X
To find the latest beta version of Mininet, list all tagged releases in the Mininet project.% a% ^/ m- ?9 S" E& s. P

& m7 C" p" H  T0 j- B7 U6 ]6 T$ cd mininet( m' U( z) H( c; o$ H+ j/ e
$ git tag3 v/ n3 I9 [3 v
1.0.0
+ g2 ^7 U* ]3 i% D: S$ R2.0.0
  ]. v4 t3 w+ Y8 \2.1.0
9 L$ t1 C  X$ u2.1.0p1
. d8 K( A: W4 K2.1.0p20 ?% M/ C+ [2 `' h6 _0 f+ J0 Y* D
2.2.0b0
6 J; I* k( Q) f0 ]' l2.2.0b1
8 O0 n/ Z' Z" l: S" z2.2.0b24 l& o- g1 Q: |( r1 T" T9 _7 y
2.2.0b3- i+ s% H; g+ g9 l' }' P
cs244-spring-2012-final4 b$ M8 p: B0 J# c: t6 @. {( F
Above, we see the latest available beta release is 2.2.0b3. So, we switch to that branch on our virtual machine.+ C1 d0 l# }3 \1 M3 u- c6 p+ I
( a: v$ F' u$ T; Q' o% L
$ git checkout -b 2.2.0b3/ Q( O! t% a, s! p' q; e5 S5 X
Switched to a new branch '2.2.0b3'
/ Q) Y( T3 M2 S0 c4 \% B( MThe 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 ^2 Q1 C$ M# |/ o5 e; w4 p

$ s! u* ]0 e2 u, V4 u3 ?  y( J' N$ ~/mininet/util/install.sh -a1 x3 u9 E0 t6 ]
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.7 Z( |. y' L5 y) b9 R
6 Y; X. [$ R8 z0 E% x' H# ^
$ sudo mn --test pingall; [6 O4 m7 j+ _  V5 p! g
Set up the VM to work with the host computer
9 S4 n, B; m4 H0 o" l' `) I8 H" X  |; `, _1 J
Now we will set up the virtual machine so that we can connect to it from the host computer using SSH.
6 ^, c0 W! W( w& A) A. X& z7 a* t, J" \7 w& B- m0 N: X4 l5 _  r
Shut down the Ubuntu Server VM.
$ X! p0 v: h- b( ~% H7 _- \* x5 L( a3 t5 Z
$ sudo shutdown -h now
2 Q3 E4 s. O4 j9 q7 H1 d0 |6 c; uIn VirtualBox, Add a host-only adapter to the VM. Use the procedures listed below in my post about setting up the Mininet VM.; e; T4 K$ u# B0 I4 ~. F! ^

, S6 U* o* S4 n( K8 l: P% @Add a Host-only Adapter in VirtualBox
/ a' b* o7 v, O. S4 YAdd Network Adapter to Mininet virtual machine
% Q/ R4 y& z1 }9 rStart the Ubuntu Server VM again and log in via the VirtualBox console window
: o; ~3 l; z8 w! o8 B2 s7 m% YConfigure a new virtual ethernet interface on the virtual machine
$ J- _" l0 a1 qIn the VirtualBox console menu, login to the VM and make a note of the IP address used by the host-only adapter:. |. i( V: p* _' D' @
: u( U8 _. C$ M- m. @3 Q! G
$ ifconfig eth1
# r4 Z( T: t% y4 P" j& VYou may log out of the VirtualBox console if you want.
. s8 t3 W9 E9 ?8 a; d4 q  I) K' f0 M
Login to the Ubuntu Server VM
3 z9 [: \5 y, G) ?% f
% a: T+ R, x; ?In 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.& b1 }. C8 P  Y% S4 |
: w; \. ?( t* m7 e' `* g5 X) N
admin@Host:~$ ssh -Y brian@192.168.56.101! D+ r+ K5 f' d" T, p; z
brian@mininet-2-2:~$
) @- a# {1 W# T% O3 P- IIn 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 i0 h9 g( i3 O8 z5 x, p- F" g- @3 _+ Y: U
Conclusion
+ v' m0 O- p- g+ W! l; p# dWe installed Mininet 2.2 Beta on a virtual machine running Ubuntu Server 14.04.6 T; H8 p: u1 T& t

1 y4 ~' L" b5 o# T! B/ k1 u" MSee 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:01 , Processed in 0.015926 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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