Mininet overview and installation

本文详细介绍了如何利用Mininet进行网络实验与SDN研究的准备工作,包括基本概念、安装步骤、功能特点及解决安装中遇到的问题。通过实际操作指导,帮助用户快速掌握Mininet的使用,提升网络实验与SDN研究的效率。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

为进行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



资源下载链接为: https://pan.quark.cn/s/abbae039bf2a 无锡平芯微半导体科技有限公司生产的A1SHB三极管(全称PW2301A)是一款P沟道增强型MOSFET,具备低内阻、高重复雪崩耐受能力以及高效电源切换设计等优势。其技术规格如下:最大漏源电压(VDS)为-20V,最大连续漏极电流(ID)为-3A,可在此条件下稳定工作;栅源电压(VGS)最大值为±12V,能承受正反向电压;脉冲漏极电流(IDM)可达-10A,适合处理短暂高电流脉冲;最大功率耗散(PD)为1W,可防止器件过热。A1SHB采用3引脚SOT23-3封装,小型化设计利于空间受限的应用场景。热特性方面,结到环境的热阻(RθJA)为125℃/W,即每增加1W功率损耗,结温上升125℃,提示设计电路时需考虑散热。 A1SHB的电气性能出色,开关特性优异。开关测试电路及波形图(图1、图2)展示了不同条件下的开关性能,包括开关上升时间(tr)、下降时间(tf)、开启时间(ton)和关闭时间(toff),这些参数对评估MOSFET在高频开关应用中的效率至关重要。图4呈现了漏极电流(ID)与漏源电压(VDS)的关系,图5描绘了输出特性曲线,反映不同栅源电压下漏极电流的变化。图6至图10进一步揭示性能特征:转移特性(图7)显示栅极电压(Vgs)对漏极电流的影响;漏源开态电阻(RDS(ON))随Vgs变化的曲线(图8、图9)展现不同控制电压下的阻抗;图10可能涉及电容特性,对开关操作的响应速度和稳定性有重要影响。 A1SHB三极管(PW2301A)是高性能P沟道MOSFET,适用于低内阻、高效率电源切换及其他多种应用。用户在设计电路时,需充分考虑其电气参数、封装尺寸及热管理,以确保器件的可靠性和长期稳定性。无锡平芯微半导体科技有限公司提供的技术支持和代理商服务,可为用户在产品选型和应用过程中提供有
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值