Mininet overview and installation

为进行SDN相关的实验做准备,先初步学习一下Mininet的基本内容。


first look:


http://mininet.org/overview/

Mininet Overview

Mininet is a network emulator which creates a network of virtual hosts, switches, controllers, and links. Mininet hosts run standard Linux network software, and its switchessupport OpenFlow for highly flexible custom routing and Software-Defined Networking.

Mininet supports research, development, learning, prototyping, testing, debugging, and any other tasks that could benefit from having a complete experimental network on a laptop or other PC.

Mininet:

  • Provides a simple and inexpensive network testbed for developing OpenFlow applications
  • Enables multiple concurrent developers to work independently on the same topology
  • Supports system-level regression tests, which are repeatable and easily packaged
  • Enables complex topology testing, without the need to wire up a physical network
  • Includes a CLI that is topology-aware and OpenFlow-aware, for debugging or running network-wide tests
  • Supports arbitrary custom topologies, and includes a basic set of parametrized topologies
  • is usable out of the box without programming, but
  • also Provides a straightforward and extensible Python API for network creation and experimentation

Mininet provides an easy way to get correct system behavior (and, to the extent supported by your hardware, performance) and to experiment with topologies.

Mininet networks run real code including standard Unix/Linux network applications as well as the real Linux kernel and network stack(including any kernel extensions which you may have available, as long as they are compatible with network namespaces.)

Because of this, the code you develop and test on Mininet, for an OpenFlow controller, modified switch, or host, can move to a real system with minimal changes, for real-world testing, performance evaluation, and deployment. Importantly this means that a design that works in Mininet can usually move directly to hardware switches for line-rate packet forwarding.

How it Works

Nearly every operating system virtualizes computing resources using a process abstraction. Mininet uses process-based virtualization to run many (we’ve successfully booted up to 4096) hosts and switches on a single OS kernel. Since version 2.2.26, Linux has supported network namespaces, a lightweight virtualization feature that provides individual processes with separate network interfaces, routing tables, and ARP tables. The full Linux container architecture adds chroot() jails, process and user namespaces, and CPU and memory limits to provide full OS-level virtualization, but Mininet does not require these additional features. Mininet can create kernel or user-space OpenFlow switches, controllers to control the switches, and hosts to communicate over the simulated network. Mininet connects switches and hosts using virtual ethernet (veth) pairs. While Mininet currently depends on the Linux kernel, in the future it may support other operating systems with process-based virtualization, such Solaris containers or !FreeBSD jails.

Mininet’s code is almost entirely Python, except for a short C utility.

Why it’s better

Mininet combines many of the best features of emulators, hardware testbeds, and simulators.

Compared to full system virtualization based approaches, Mininet:

  • Boots faster: seconds instead of minutes
  • Scales larger: hundreds of hosts and switches vs. single digits
  • Provides more bandwidth: typically 2Gbps total bandwidth on modest hardware
  • Installs easily: a prepackaged VM is available that runs on VMware or VirtualBox for Mac/Win/Linux with OpenFlow v1.0 tools already installed.

Compared to hardware testbeds, Mininet

  • is inexpensive and always available (even before conference deadlines)
  • is quickly reconfigurable and restartable

Compared to simulators, Mininet

  • runs real, unmodified code including application code, OS kernel code, and control plane code (both OpenFlow controller code and Open vSwitch code)
  • easily connects to real networks
  • offers interactive performance - you can type at it

Limitations

Mininet-based networks cannot (currently) exceed the CPU or bandwidth available on a single server.

Mininet cannot (currently) run non-Linux-compatible OpenFlow switches or applications; this has not been a major issue in practice.


安装:

首先试图按官网的方法试图通过:
git clone git://github.com/mininet/mininet
git clone git://github.com/mininet/mininet
To install everything (using your home directory): install.sh -a
的方法安装,但是在最后一步,本地系统上会报错一些东东下载失败,这些东东貌似只是我本机上的一些其他软件工具
(后来我去看install.sh的代码,发现其中有apt-get install update,估计是这一命令导致出问题)
所以我们按照官网上的另一种方法(

Option 3: Installation from Packages)安装:


tatostar@junjieshi:~/SDN/Mininet/mininet$ sudo apt-get install mininet
Setting up openvswitch-common (1.9.0-0ubuntu1) ...
Setting up openvswitch-switch (1.9.0-0ubuntu1) ...
 * Inserting openvswitch module
 * /etc/openvswitch/conf.db does not exist
 * Creating empty database /etc/openvswitch/conf.db
 * Starting ovsdb-server
 * Configuring Open vSwitch system IDs
 * Starting ovs-vswitchd
Setting up openvswitch-pki (1.9.0-0ubuntu1) ...
Creating controllerca...
Creating switchca...
Setting up openvswitch-controller (1.9.0-0ubuntu1) ...
 * Starting ovs-controller  ovs-controller                                      2014-01-08T15:00:02Z|00001|stream_ssl|INFO|Trusting CA cert from /etc/openvswitch-controller/cacert.pem (/C=US/ST=CA/O=Open vSwitch/OU=switchca/CN=OVS switchca CA Certificate (2014 Jan 08 23:00:01)) (fingerprint 1b:d6:ad:8f:7f:e2:8a:94:eb:5f:f4:49:1d:af:15:53:52:75:aa:c9)
                                                                         [ OK ]
Setting up python-scipy (0.11.0+dfsg1-1ubuntu2) ...
Processing triggers for ureadahead ...
Setting up mininet (2.0.0-0ubuntu1) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Processing triggers for python-support ...
按要求执行:
sudo service openvswitch-controller stop
sudo update-rc.d openvswitch-controller disable
测试一下通过:
sudo mn --test pingall
然后安装其他工具包:
git clone git://github.com/mininet/mininet
mininet/util/install.sh -fw
知道显示:
gcc -o packet-openflow.os -c -fPIC -I. -I/usr/include/wireshark -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include packet-openflow.c
packet-openflow.c: In function 'dissect_openflow_message':
packet-openflow.c:3006:111: warning: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Wformat]
packet-openflow.c:3006:111: warning: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Wformat]
gcc -o plugin.os -c -fPIC -I. -I/usr/include/wireshark -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include plugin.c
gcc -o openflow.so -shared packet-openflow.os plugin.os -L/usr/lib -L/usr/local/lib
scons: done building targets.
Copied openflow plugin to /usr/lib/wireshark/libwireshark2/plugins/

测试一下是否可用:

tatostar@junjieshi:~/SDN/Mininet/mininet/util$ sudo wireshark &
然后设置好wireshark的监控接口。
tatostar@junjieshi:~/SDN/Mininet/mininet/util$ sudo mn --test pingall --topo linear,4
可以得到:
表明可以使用了。

此外我们在服务器上按option2安装没有问题。
直接得到enjoy mininet~

(后续:
但是我们之后在按walkthrough时发现本地安装时仍然有些附件根据无法正常使用,比如sudo mn -x时,我们的

XTerm 无法显示!所以决定本地上卸载重新安装:

sudo apt-get purge --auto-remove mininet
然后鉴于之前直接使用./install.sh -a时的报错,我们把该脚本的第110行的sudo apt-get update注释掉!再重新运行就不会报错了!
“function kernel {
    echo "Install Mininet-compatible kernel if necessary"
110:   # sudo apt-get update



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值