Add New Notes

This commit is contained in:
geekard
2012-08-08 14:26:04 +08:00
commit 5ef7c20052
2374 changed files with 276187 additions and 0 deletions

7
Zim/OpenFlow/Deploy.txt Normal file
View File

@@ -0,0 +1,7 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2011-05-19T22:49:58+08:00
====== Deploy ======
Created Thursday 19 May 2011

View File

@@ -0,0 +1,254 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2011-05-19T22:50:14+08:00
====== MutiPC ======
Created Thursday 19 May 2011
Create OpenFlow network with
multiple PCs/NetFPGAs
Setup OpenFlow network controlled by NOX with a set of PCs in the Lab in half day.
1. Description of an Example Setup
Configuration Summary
OpenFlow Switches
OpenFlow Controller (NOX 0.6)
2. Hardware Requirements
PCs for OpenFlow Switches
PC for OpenFlow Switch with NetFPGA card
PC for OpenFlow Controller
3. Setup OpenFlow Switches on PCs/NetFPGAs
3.1. Setup OpenFlow Switch on PC
3.1.1. Stanford Software Reference Design
Step1. Download Software
Step2. Compile
Step3. Run OpenFlow Switch
Step4. Let OpenFlow Switch talk to the controller
3.1.2. OpenVswitch Implementation
Step1. Download Software
Step2. Compile
Step3. Run OpenFlow switch
Step4. Let OpenFlow Switch talk to the controller
3.2. Setup OpenFlow Switch on NetFPGA
Step0. Basic Setup of NetFPGA
Step1. Download Software
Step2. Compile
Step3. Run
Step4. Let OpenFlow Switch talk to the controller
4. Controller Setup
Step0. Install Pre-requisite Packages
Step1. Download Software
Step2. Compile
Step3. Run
5. Basic Test
For Stanford reference design OpenFlow implementation
For OpenVswitch OpenFlow implementation
1. Description of an Example Setup
{{./deploy-lab.gif}}
In this page, well create an OpenFlow network with three OpenFlow switches controlled by NOX 0.6 controller. Among three OpenFlow switches, two are PC based software OpenFlow switches and one is NetFPGA based hardware OpenFlow switch. If you dont have NetFPGA board, then just use a PC instead. Lab Setup
Configuration Summary
OpenFlow Switches
Switch IP address to talk to the controller Controller Ethernet Port OpenFlow Ethernet Ports
Switch1 (PC1) 192.168.0.1/255.255.255.0 eth0 eth1, eth2
Switch2 (PC2 with NetFPGA board) 192.168.0.2/255.255.255.0 eth0 nf2c0, nf2c1, nf2c2, nf2c3
Switch3 (PC3) 192.168.0.3/255.255.255.0 eth0 eth1, eth2
OpenFlow Controller (NOX 0.6)
IP address TCP port number
192.168.0.100/255.255.255.0 6633
2. Hardware Requirements
PCs for OpenFlow Switches
These are PC1, PC2, PC3 shown in the figure. Well run OpenFlow software reference design on those PCs. Any PC running Linux 2.6 kernel would work, but there are some dependency on the linux distribution. Please check the release notes in OpenFlow reference design. Depending on the network topology you would like to create, you need to install NICs (network interface cards) on those PCs. Note that NetFPGA only work with 1Gb/s ethernet (not 100Mbps or 10Mbps), so the interface connecting to the NetFPGA interface has to be gigabit ethernet NIC. In the configuration shown in the figure, you need three ethernet ports on each PC.
PC for OpenFlow Switch with NetFPGA card
Go User Guide page in the NetFPGA website (http://netfpga.org/foswiki/bin/view/NetFPGA/OneGig/Guide) to see the requirement of the PC and how to get NetFPGA card. Pre-built system is also available.
PC for OpenFlow Controller
This is for PC4 shown in the figure. Currently we have three different types of OpenFlow controllers, NOX, SNAC and Reference Controller. In this page, we use SNAC 0.6 for the controller. Any Linux PC would work, but we assume it runs Debian Stable (Lenny) in this page.
3. Setup OpenFlow Switches on PCs/NetFPGAs
3.1. Setup OpenFlow Switch on PC
There are two different OpenFlow v1.0 switch implementations available. One is Stanfords software reference design and the other is OpenVswitch (http://openvswitch.org/) implementation. While the former has user-space implementation, the latter has kernel-space implementation. The forwarding performance is (naturally) better in the kernel space implementation. Adding new features would be easier in the user space implementation. Pick the one depending on your need.
3.1.1. Stanford Software Reference Design
Step1. Download Software
$ git clone git://gitosis.stanford.edu/openflow.git
$ cd openflow
$ git checkout -b openflow.v1.0 origin/release/1.0.0
Step2. Compile
$ ./boot.sh
$ ./configure
$ make
Step3. Run OpenFlow Switch
Here we assume eth1 and eth2 will be included in OpenFlow datapath (as shown in Configuration Summary). We also need to assign datapath-id to this OpenFlow switch. The datapath-id has to be unique among the switches controlled by a single OpenFlow controller. One way to pick an unique datapath id is to use MAC address of one of this PCs interface. Lets assume well use datapath-id 0x004E46324304 for this OpenFlow switch.
# ./udatapath/ofdatapath --detach punix:/var/run/dp0 -d 004E46324304 -i eth1,eth2
Note: detach option make it run in background as daemon. punix:/var/run/dp0 is specifying an Unix domain socket file through which we can talk to this switch.
Step4. Let OpenFlow Switch talk to the controller
Then run OpenFlow protocol module talk to the controller. Here we assume the controller is running on 192.168.0.100 port 6633.
# ./secchan/ofprotocol unix:/var/run/dp0 tcp:192.168.0.100:6633
Note that the file name /var/run/dp0 has to be consistent to the UNIX domain socket file name we specified in the previous step.
3.1.2. OpenVswitch Implementation
Another choice is OpenVswitch implementation.
Step1. Download Software
As of Nov 19, 2010, the latest version is “1.1.0 pre2″ and you can download it from the link, http://openvswitch.org/releases/openvswitch-1.1.0pre2.tar.gz
$ wget http://openvswitch.org/releases/openvswitch-1.1.0pre2.tar.gz
$ tar zxvf openvswitch-1.1.0pre2.tar.gz
$ cd openvswitch-1.1.0pre2
Step2. Compile
$ ./boot.sh
$ ./configure --with-l26=/lib/modules/`uname -r`
$ make
Step3. Run OpenFlow switch
Insert OpenFlow kernel module, openvswitch_mod.ko.
$ su -
# /sbin/insmod ./datapath/linux-2.6/openvswitch_mod.ko
Create OpenFlow switch datapath.
# ./utilities/ovs-dpctl adddp dp0
Then, add interface to the datapath. Interfaces names (eth1, eth2) depend on your system.
# ./utilities/ovs-dpctl addif nl:0 eth1
# ./utilities/ovs-dpctl addif nl:0 eth2
Step4. Let OpenFlow Switch talk to the controller
Then let OpenFlow protocol module talk to the controller. Lets assume well use datapath-id 0x004E46324304 for this OpenFlow switch and the controller is running on 192.168.0.100 port 6633.
# ./utilities/ovs-openflowd dp0 --datapath-id=0000004E46324304 tcp:192.168.0.100 port 6633 --out-of-band
3.2. Setup OpenFlow Switch on NetFPGA
Please refer to the following page for the complete instruction: CentOS NetFPGA Install
Step0. Basic Setup of NetFPGA
Please refer http://netfpga.org/foswiki/bin/view/NetFPGA/OneGig/Guide to setup NetFPGA.
Step1. Download Software
$ git clone git://gitosis.stanford.edu/openflow.git
$ cd openflow
$ git checkout -b 1.0.0-netfpga origin/devel/tyabe/1.0.0-netfpga
Step2. Compile
$ ./boot.sh
$ cd ./hw-lib/nf2
$ wget http://gitosis.stanford.edu/downloads/netfpga/openflow_switch.bit.100_3.tar.gz
$ tar zxvf openflow_switch.bit.100_3.tar.gz
$ cd ../../
$ ./configure --enable-hw-tables=nf2
$ make
Step3. Run
Program NetFPGA card as OpenFlow switch.
# /root/NF2/lib/scripts/cpci_reprogram/cpci_reprogram.pl
# nf_download ./datapath/hwtable_nf2/openflow_switch.bit
Here we assume eth1 and eth2 will be included in OpenFlow datapath (as shown in Configuration Summary). We also need to assign datapath-id to this OpenFlow switch. The datapath-id has to be unique among the switches controlled by a single OpenFlow controller. One way to pick an unique datapath id is to use MAC address of one of this PCs interface. Lets assume well use datapath-id 0x004E46324304 for this OpenFlow switch.
# ./udatapath/ofdatapath --detach punix:/var/run/dp0 -d 004E46324304 -i nf2c0,nf2c1,nf2c2,nf2c3
Note: detach option make it run in background as daemon. punix:/var/run/dp0 is specifying an Unix domain socket file through which we can talk to this switch.
Step4. Let OpenFlow Switch talk to the controller
Then run OpenFlow protocol module talk to the controller. Here we assume the controller is running on 192.168.0.100 port 6633.
# ./secchan/ofprotocol unix:/var/run/dp0 tcp:192.168.0.100:6633
Note that the file name /var/run/dp0 has to be consistent to the UNIX domain socket file name we specified in the previous step.
4. Controller Setup
Well setup NOX 0.6 here. For the complete information, visit NOX website.
Step0. Install Pre-requisite Packages
Prerequiste packages depend on the linux distribution on the controller PC. In the case of Debian Stable (Lenny), you have to install the following packages:
$ apt-get install autoconf automake g++ libtool python python-twisted \
swig libboost1.35-dev libxerces-c2-dev libssl-dev make \
libsqlite3-dev python-simplejson \
python-sphinx
Step1. Download Software
$ git clone git://noxrepo.org/nox
$ cd nox
By default, youll get OpenFlow v0.8.9 compatible NOX (as of 5/20/2010). If you want to OpenFlow v1.0 compatible NOX, then you need to checkout the corresponding branch. Here is the instruction:
#### this is only for OpenFlow v1.0 user
$ git branch -a
* master
remotes/origin/HEAD -> origin/master
remotes/origin/destiny
remotes/origin/master
remotes/origin/openflow-0.9
remotes/origin/openflow-1.0
$ git checkout -b nox_v06_ofv1.0 remotes/origin/openflow-1.0
$ git branch -a
master
* nox_v06_ofv1.0
remotes/origin/HEAD -> origin/master
remotes/origin/destiny
remotes/origin/master
remotes/origin/openflow-0.9
remotes/origin/openflow-1.0
Step2. Compile
$ ./boot.sh
$ mkdir build
$ cd build/
$ ../configure
$ make
Step3. Run
Run NOX with routing module only. Routing module will do the shortest path routing.
$ cd src
$ ./nox_core -i ptcp:6633 routing
5. Basic Test
On the controller PC, first check the switches are connected to the controller. You can check this by
$ netstat -an | grep 6663
Assign the IP addresses to Client1 and Client2 (on the same subnet) and run ping to check they can communicate. On each switch, you can run the following command to see the flow table is actually installed.
For Stanford reference design OpenFlow implementation
$ cd <your OpenFlow comipled dir>
$ ./utilities/ovs-dpctl dump-flows unix:/var/run/dp0
For OpenVswitch OpenFlow implementation
$ cd <your OpenFlow comipled dir>
$ ./utilities/ovs-dpctl dump-flows dp0

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

152
Zim/OpenFlow/NOX.txt Normal file
View File

@@ -0,0 +1,152 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2011-03-27T19:54:45+08:00
====== NOX ======
Created Sunday 27 March 2011
1、安装依赖的软件包
$ apt-get install autoconf automake g++ libtool python python-twisted \
swig libxerces-c2-dev libssl-dev make \
libsqlite3-dev python-simplejson \
python-sphinx
注意默认的libboost1.35-devubuntu10.10上没有,可以用下面命令单独安装:
sudo apt-get install libboost-all-dev
或:
sudo apt-get install libboost-dev automake libtool flex bison pkg-
config g++
2、下载NOX软件包
$ git clone git://noxrepo.org/nox
$ cd nox
注意缺省情况下获得的是OpenFlow v0.8.9 compatible NOX (as of 5/20/2010).
如果需要OpenFlow v1.0 compatible NOX, 则需要手动从源代码中检索出相应的分支,方法如下:
#### this is only for OpenFlow v1.0 user
$ git branch -a
* master
remotes/origin/HEAD -> origin/master
remotes/origin/destiny
remotes/origin/master
remotes/origin/openflow-0.9
remotes/origin/openflow-1.0
$ git checkout -b nox_v06_ofv1.0 remotes/origin/openflow-1.0
$ git branch -a
master
* nox_v06_ofv1.0
remotes/origin/HEAD -> origin/master
remotes/origin/destiny
remotes/origin/master
remotes/origin/openflow-0.9
remotes/origin/openflow-1.0
3、编译并安装
$ ./boot.sh
$ mkdir build
$ cd build/
$ ../configure
$ make
$ make check
注意默认的源代码有bug需要手动修复一下否则编译时出现“ configure: error: Could not link against ! ”的错误
解决方法如下:
vim [[~/nox/src/nox_main.cc]]
在文件的开头添加一个头文件语句:
#include <sys/stat.h>
4、运行控制器
$ cd ~/nox/build/src
$ ./nox_core -i ptcp:6633 routing
注意默认编译后的文件有bug运行时会提示如下错误
> 00001|nox|ERR:Cannot change the state of 'python' to INSTALLED:
解决方法如下:
vim ~/nox/build/src/nox/coreapps/pyrt/ pyoxidereactor.py
把133行替换为一下内容
signal.signal(signal.SIGCHLD, lambda : self.callLater(0, reapAllProcesses))
5、测试
$ netstat -an | grep 6663
==================以下为google内容==============================
checking Checking thrift_home set to... /usr/local
checking Checking fb303_home set to... /usr/local
checking Checking smc_home set to... /home/ubuntu/src/scribe/services/
trunk/src
checking Checking fb_home set to... /home/ubuntu/src/scribe/
libfacebook
checking Checking hadoop_home set to... /usr/local
checking for boostlib >= 1.36... yes
checking build system type... i686-pc-linux-gnu
checking whether the Boost::System library is available... yes
checking whether the Boost::Filesystem library is available... yes
configure: error: Could not link against !
Distribution: Ubuntu 10.04
Is any one else facing this issue?
More options Jun 22, 11:16 pm
I was able to solve this by doing:
sudo apt-get install libboost-all-dev
This is in addition to the recommended:
sudo apt-get install libboost-dev automake libtool flex bison pkg-
config g++
../../src/nox_main.cc: In function int<unnamed>::daemon():
../../src/nox_main.cc:201: error: umask was not declared in this scope
make[4]: *** [nox_main.o] Error 1
make[4]: Leaving directory `/home/geekard/nox/build/src'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/geekard/nox/build/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/geekard/nox/build/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/geekard/nox/build'
make: *** [all] Error 2
geekard@geekard:~/nox/build$ vim ../src/nox_main.cc
加一个
#include <sys/stat.h>
> ./nox_core -i ptcp:6633 switch switch_management hostip hosttracker monitoring jsonmessenger
>
> NOX 0.9.0(zaku)~full~beta (nox_core), compiled Nov 15 2010 21:36:36
> Compiled with OpenFlow 0x01
> 00001|nox|ERR:Cannot change the state of 'python' to INSTALLED:
> 'python' ran into an error:
> Unable to construct a Python component:
> Traceback (most recent call last):
> File "./nox/coreapps/pyrt/pyoxidereactor.py", line 364, in instance
> return pyoxidereactor(ctxt)
> File "./nox/coreapps/pyrt/pyoxidereactor.py", line 133, in __init__
> signal.signal(signal.SIGCHLD, self._handleSigchld)
> AttributeError: 'pyoxidereactor' object has no attribute '_handleSigchld'
I think the fix is to change line 133 in pyoxidereactor.py to:
signal.signal(signal.SIGCHLD, lambda : self.callLater(0, reapAllProcesses))
http://comments.gmane.org/gmane.network.nox.devel/1796

View File

@@ -0,0 +1,69 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2011-05-19T20:16:51+08:00
====== NOX install ======
Created Thursday 19 May 2011
http://noxrepo.org/noxwiki/index.php/NOX_Installation
Contents
1 Dependencies
1.1 Debian/Ubuntu
1.1.1 Manual dependencies installation
1.1.2 apt-get
1.2 RedHat Enterprise Linux 6
1.3 Gentoo
2 Installation
3 Verify Installation
===== Dependencies =====
An unofficial list of dependencies can be found on the Dependencies page.
==== Debian/Ubuntu ====
These instructions are tested on Ubuntu 10.04. Manual dependencies installation
You can manually download the nox-dependencies package and get the updated information.
wget http://openflowswitch.org/downloads/debian/binary/nox-dependencies.deb
dpkg --info nox-dependencies.deb
apt-get
If you have root access and want apt-get to resolve the dependencies, you can all the following to your apt-get repositories list.
cd /etc/apt/sources.list.d
sudo wget http://openflowswitch.org/downloads/debian/nox.list
sudo apt-get update
sudo apt-get install nox-dependencies
==== RedHat Enterprise Linux 6 ====
While NOX has been built successfully on prerelease versions of RHEL6, we do not have a dependent package list or specific instructions at this time.
We will update this after RHEL6 is actually released.
==== Gentoo ====
sudo emerge dev-lang/swig dev-libs/boost =dev-python/twisted-8.2.0-r2
Then, add =dev-python/twisted-10.1.0 to package.mask to prevent upgrading to this version of twisted.
===== Installation =====
First, download the latest source code from the git repository and switch to the downloaded folder:
git clone git://noxrepo.org/nox
cd nox
For a branch other than master, you need to see the remote branches and checkout a branch using the following commands. If you want the master(stable) branch, skip this step:
git branch -a
git checkout -b <name of your choice> origin/<remote branch name>
To compile and install NOX:
./boot.sh
mkdir build/
cd build/
../configure
make -j 5
The ../configure step checks for required dependencies. 'make -j 5' should work on a system with 1 GB of RAM; 'make -j' may work on systems with more RAM.
If your dependencies are satisfied, this step should not give any errors. If it does, make sure you have installed the package which was found missing (or old). NOX compiles in six to seven minutes on a laptop with a 1.80 GHz CPU with 2GB RAM. The whole installation process (download code, install dependencies, and compile NOX) in Ubuntu 9.10 takes about 15-20 minutes maximum.
Verify Installation
Once compiled, the nox_core binary will be built in the src directory. Note that nox_core must be run from the build/src directory, and that the build directory must not be moved to a different place in the file system. You can verify that it has built properly by printing out the usage information:
cd src/
./nox_core -h

View File

@@ -0,0 +1,208 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2011-05-19T20:46:20+08:00
====== compile and install ======
Created Thursday 19 May 2011
NOX Installation
===============================
Quick Start From Git
--------------------
For those with all the proper dependencies installed (see below) NOX can
be configured and built using standard autoconf procedure::
git clone git://noxrepo.org/noxcore
cd noxcore/
./boot.sh
mkdir build/
cd build/
../configure
make
make check
If building from the source tarfile, you don't need to run boot.sh.
By default, NOX builds with C++ STL debugging checks, which can slow
down execution speeds by a factor of 10. For a production build,
you will want to turn this off::
./configure --enable-ndebug
Once compiled, the *nox_core* binary will be built in the *src/*
directory. **Note** that nox_core **must** be run from the *src/*
build directory, and that the build directory must not be moved to a
different place in the file system. You can verify that it has built
properly by printing out the usage information::
cd src/
./nox_core -h
If you've gotten this far, then you're ready to test your build
(:ref:`install_test`) or get right to using it (:ref:`sec_use`).
Not So Quick Start
-------------------
Dependencies
^^^^^^^^^^^^^^
The NOX team's internal development environment is standardized around
Debian's Lenny distribution (http://wiki.debian.org/DebianLenny). While
we test releases on other Linux distributions (Fedora, Gentoo, Ubuntu),
FreeBSD and NetBSD, using Lenny is certain to provide the least hassle.
NOX relies on the following software packages. All are available under
Debian as apt packages. Other distributions may require them to be
separately installed from source:
* g++ 4.2 or greater
* Boost C++ libraries, v1.34.1 or greater (http://www.boost.org)
* Xerces C++ parser, v2.7.0 or greater (http://xerces.apache.org/xerces-c)
For Twisted Python support (highly recommended) the following additional packages are required.
* SWIG v1.3.0 or greater (http://www.swig.org)
* Python2.5 or greater (http://python.org)
* Twisted Python (http://twistedmatrix.com)
The user interface (web management console) requires
* Mako Templates (http://www.makotemplates.org/)
* Simple JSON (http://www.undefined.org/python/)
.. warning::
Older versions of swig may have incompatibilities with newer gcc/g++
versions. This is known to be a problem with g++4.1 and swig v1.3.29
Boot Options
^^^^^^^^^^^^^
If building directly from git, the build system needs to be
bootstrapped.
./boot
Configure Options
^^^^^^^^^^^^^^^^^^
The following options are commonly used in NOX configuration. Use
./configure ----help for a full listing:
``--with-python=[yes|no|/path/to/python]`` By default, NOX builds with
an embedded Python interpreter. You can use this option to specify
which Python installation to use, or to build without Python support
(by using --with-python=no). NOX requires that the embedded python
support twisted.
``--enable-ndebug`` This will turn *off* debugging (STL debugging in
particular) and increase performance significantly. Use this whenever
running NOX operationally.
Distribution Specific Installation Notes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
**Debian 5.0 (Lenny):**
Compiling requires the following packages::
apt-get install autoconf automake g++ libtool python python-twisted
swig libboost1.35-dev libxerces-c2-dev libssl-dev make
Running the web server requires json support in python::
apt-get install python-simplejson
To build the documentation you will need to install sphinx::
apt-get install python-sphinx
**Ubuntu 8.04:**
Compiling requires the following packages::
apt-get install autoconf automake g++ libtool python python2.5-dev python-twisted
swig libboost-python1.34.1 libboost-python-dev libboost-serialization-dev
libboost-test-dev libxerces28-dev libssl-dev make
Running the web server requires json support in python::
apt-get install python-simplejson
**Ubuntu 9.04:**
Compiling requires the following packages::
apt-get git-core install autoconf automake g++ libtool python python-dev
python-twisted swig libssl-dev make libboost-dev libxerces-c2-dev
Running the web server requires json support in python::
apt-get install python-simplejson
**Fedora Core 9:+**
From a standard development install, you can build
after installing the following packages::
yum install xerces-c-devel python-twisted libpcap-devel
**Gentoo 2008.0-rc1**
To compile without twisted python you'll need the following packages::
- emerge -av boost
- emerge -av xerces-c
**OpenSUSE 10.3 :**
The boost distribution that comes with OpenSuse is too old. You'll have
to install this from the source:
* boost (http://www.boost.org)
To build NOX (with twisted python) you'll have to installed the
following packages from a base install::
gcc gcc-c++ make libXerces-c-27 libXerces-c-devel
libpcap-devel libopenssl-devel swig python-devel
python-twisted python-curses
**Mandriva One 2008:**
NOX compiled on Mandriva with the following packages installed::
libboost-devel boost-1.35.0 libxerces-c-devel
libopenssl0.9.8-devel libpython2.5-devel
python-twisted swig-devel
If the swig and swig-devel packages are not available from the repository, you
will have to build swig from source.
.. _install_test:
Testing your build
^^^^^^^^^^^^^^^^^^^^
You can verify that NOX built correct by running::
make check
From the build directory. Unittests can be run independently through
the *test* application::
cd src
./nox_core tests
As a simple example, if you've compiled with Twisted try running
*packetdump* using generated traffic::
cd src/
./nox_core -v -i pgen:10 packetdump
This should print out a description of ten identical packets,
and then wait for you to terminate *nox_core* with 'Ctrl-c'.

View File

@@ -0,0 +1,7 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2011-05-19T22:49:58+08:00
====== Deploy ======
Created Thursday 19 May 2011

View File

@@ -0,0 +1,254 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2011-05-19T22:50:14+08:00
====== MutiPC ======
Created Thursday 19 May 2011
Create OpenFlow network with
multiple PCs/NetFPGAs
Setup OpenFlow network controlled by NOX with a set of PCs in the Lab in half day.
1. Description of an Example Setup
Configuration Summary
OpenFlow Switches
OpenFlow Controller (NOX 0.6)
2. Hardware Requirements
PCs for OpenFlow Switches
PC for OpenFlow Switch with NetFPGA card
PC for OpenFlow Controller
3. Setup OpenFlow Switches on PCs/NetFPGAs
3.1. Setup OpenFlow Switch on PC
3.1.1. Stanford Software Reference Design
Step1. Download Software
Step2. Compile
Step3. Run OpenFlow Switch
Step4. Let OpenFlow Switch talk to the controller
3.1.2. OpenVswitch Implementation
Step1. Download Software
Step2. Compile
Step3. Run OpenFlow switch
Step4. Let OpenFlow Switch talk to the controller
3.2. Setup OpenFlow Switch on NetFPGA
Step0. Basic Setup of NetFPGA
Step1. Download Software
Step2. Compile
Step3. Run
Step4. Let OpenFlow Switch talk to the controller
4. Controller Setup
Step0. Install Pre-requisite Packages
Step1. Download Software
Step2. Compile
Step3. Run
5. Basic Test
For Stanford reference design OpenFlow implementation
For OpenVswitch OpenFlow implementation
1. Description of an Example Setup
{{./deploy-lab.gif}}
In this page, well create an OpenFlow network with three OpenFlow switches controlled by NOX 0.6 controller. Among three OpenFlow switches, two are PC based software OpenFlow switches and one is NetFPGA based hardware OpenFlow switch. If you dont have NetFPGA board, then just use a PC instead. Lab Setup
Configuration Summary
OpenFlow Switches
Switch IP address to talk to the controller Controller Ethernet Port OpenFlow Ethernet Ports
Switch1 (PC1) 192.168.0.1/255.255.255.0 eth0 eth1, eth2
Switch2 (PC2 with NetFPGA board) 192.168.0.2/255.255.255.0 eth0 nf2c0, nf2c1, nf2c2, nf2c3
Switch3 (PC3) 192.168.0.3/255.255.255.0 eth0 eth1, eth2
OpenFlow Controller (NOX 0.6)
IP address TCP port number
192.168.0.100/255.255.255.0 6633
2. Hardware Requirements
PCs for OpenFlow Switches
These are PC1, PC2, PC3 shown in the figure. Well run OpenFlow software reference design on those PCs. Any PC running Linux 2.6 kernel would work, but there are some dependency on the linux distribution. Please check the release notes in OpenFlow reference design. Depending on the network topology you would like to create, you need to install NICs (network interface cards) on those PCs. Note that NetFPGA only work with 1Gb/s ethernet (not 100Mbps or 10Mbps), so the interface connecting to the NetFPGA interface has to be gigabit ethernet NIC. In the configuration shown in the figure, you need three ethernet ports on each PC.
PC for OpenFlow Switch with NetFPGA card
Go User Guide page in the NetFPGA website (http://netfpga.org/foswiki/bin/view/NetFPGA/OneGig/Guide) to see the requirement of the PC and how to get NetFPGA card. Pre-built system is also available.
PC for OpenFlow Controller
This is for PC4 shown in the figure. Currently we have three different types of OpenFlow controllers, NOX, SNAC and Reference Controller. In this page, we use SNAC 0.6 for the controller. Any Linux PC would work, but we assume it runs Debian Stable (Lenny) in this page.
3. Setup OpenFlow Switches on PCs/NetFPGAs
3.1. Setup OpenFlow Switch on PC
There are two different OpenFlow v1.0 switch implementations available. One is Stanfords software reference design and the other is OpenVswitch (http://openvswitch.org/) implementation. While the former has user-space implementation, the latter has kernel-space implementation. The forwarding performance is (naturally) better in the kernel space implementation. Adding new features would be easier in the user space implementation. Pick the one depending on your need.
3.1.1. Stanford Software Reference Design
Step1. Download Software
$ git clone git://gitosis.stanford.edu/openflow.git
$ cd openflow
$ git checkout -b openflow.v1.0 origin/release/1.0.0
Step2. Compile
$ ./boot.sh
$ ./configure
$ make
Step3. Run OpenFlow Switch
Here we assume eth1 and eth2 will be included in OpenFlow datapath (as shown in Configuration Summary). We also need to assign datapath-id to this OpenFlow switch. The datapath-id has to be unique among the switches controlled by a single OpenFlow controller. One way to pick an unique datapath id is to use MAC address of one of this PCs interface. Lets assume well use datapath-id 0x004E46324304 for this OpenFlow switch.
# ./udatapath/ofdatapath --detach punix:/var/run/dp0 -d 004E46324304 -i eth1,eth2
Note: detach option make it run in background as daemon. punix:/var/run/dp0 is specifying an Unix domain socket file through which we can talk to this switch.
Step4. Let OpenFlow Switch talk to the controller
Then run OpenFlow protocol module talk to the controller. Here we assume the controller is running on 192.168.0.100 port 6633.
# ./secchan/ofprotocol unix:/var/run/dp0 tcp:192.168.0.100:6633
Note that the file name /var/run/dp0 has to be consistent to the UNIX domain socket file name we specified in the previous step.
3.1.2. OpenVswitch Implementation
Another choice is OpenVswitch implementation.
Step1. Download Software
As of Nov 19, 2010, the latest version is “1.1.0 pre2″ and you can download it from the link, http://openvswitch.org/releases/openvswitch-1.1.0pre2.tar.gz
$ wget http://openvswitch.org/releases/openvswitch-1.1.0pre2.tar.gz
$ tar zxvf openvswitch-1.1.0pre2.tar.gz
$ cd openvswitch-1.1.0pre2
Step2. Compile
$ ./boot.sh
$ ./configure --with-l26=/lib/modules/`uname -r`
$ make
Step3. Run OpenFlow switch
Insert OpenFlow kernel module, openvswitch_mod.ko.
$ su -
# /sbin/insmod ./datapath/linux-2.6/openvswitch_mod.ko
Create OpenFlow switch datapath.
# ./utilities/ovs-dpctl adddp dp0
Then, add interface to the datapath. Interfaces names (eth1, eth2) depend on your system.
# ./utilities/ovs-dpctl addif nl:0 eth1
# ./utilities/ovs-dpctl addif nl:0 eth2
Step4. Let OpenFlow Switch talk to the controller
Then let OpenFlow protocol module talk to the controller. Lets assume well use datapath-id 0x004E46324304 for this OpenFlow switch and the controller is running on 192.168.0.100 port 6633.
# ./utilities/ovs-openflowd dp0 --datapath-id=0000004E46324304 tcp:192.168.0.100 port 6633 --out-of-band
3.2. Setup OpenFlow Switch on NetFPGA
Please refer to the following page for the complete instruction: CentOS NetFPGA Install
Step0. Basic Setup of NetFPGA
Please refer http://netfpga.org/foswiki/bin/view/NetFPGA/OneGig/Guide to setup NetFPGA.
Step1. Download Software
$ git clone git://gitosis.stanford.edu/openflow.git
$ cd openflow
$ git checkout -b 1.0.0-netfpga origin/devel/tyabe/1.0.0-netfpga
Step2. Compile
$ ./boot.sh
$ cd ./hw-lib/nf2
$ wget http://gitosis.stanford.edu/downloads/netfpga/openflow_switch.bit.100_3.tar.gz
$ tar zxvf openflow_switch.bit.100_3.tar.gz
$ cd ../../
$ ./configure --enable-hw-tables=nf2
$ make
Step3. Run
Program NetFPGA card as OpenFlow switch.
# /root/NF2/lib/scripts/cpci_reprogram/cpci_reprogram.pl
# nf_download ./datapath/hwtable_nf2/openflow_switch.bit
Here we assume eth1 and eth2 will be included in OpenFlow datapath (as shown in Configuration Summary). We also need to assign datapath-id to this OpenFlow switch. The datapath-id has to be unique among the switches controlled by a single OpenFlow controller. One way to pick an unique datapath id is to use MAC address of one of this PCs interface. Lets assume well use datapath-id 0x004E46324304 for this OpenFlow switch.
# ./udatapath/ofdatapath --detach punix:/var/run/dp0 -d 004E46324304 -i nf2c0,nf2c1,nf2c2,nf2c3
Note: detach option make it run in background as daemon. punix:/var/run/dp0 is specifying an Unix domain socket file through which we can talk to this switch.
Step4. Let OpenFlow Switch talk to the controller
Then run OpenFlow protocol module talk to the controller. Here we assume the controller is running on 192.168.0.100 port 6633.
# ./secchan/ofprotocol unix:/var/run/dp0 tcp:192.168.0.100:6633
Note that the file name /var/run/dp0 has to be consistent to the UNIX domain socket file name we specified in the previous step.
4. Controller Setup
Well setup NOX 0.6 here. For the complete information, visit NOX website.
Step0. Install Pre-requisite Packages
Prerequiste packages depend on the linux distribution on the controller PC. In the case of Debian Stable (Lenny), you have to install the following packages:
$ apt-get install autoconf automake g++ libtool python python-twisted \
swig libboost1.35-dev libxerces-c2-dev libssl-dev make \
libsqlite3-dev python-simplejson \
python-sphinx
Step1. Download Software
$ git clone git://noxrepo.org/nox
$ cd nox
By default, youll get OpenFlow v0.8.9 compatible NOX (as of 5/20/2010). If you want to OpenFlow v1.0 compatible NOX, then you need to checkout the corresponding branch. Here is the instruction:
#### this is only for OpenFlow v1.0 user
$ git branch -a
* master
remotes/origin/HEAD -> origin/master
remotes/origin/destiny
remotes/origin/master
remotes/origin/openflow-0.9
remotes/origin/openflow-1.0
$ git checkout -b nox_v06_ofv1.0 remotes/origin/openflow-1.0
$ git branch -a
master
* nox_v06_ofv1.0
remotes/origin/HEAD -> origin/master
remotes/origin/destiny
remotes/origin/master
remotes/origin/openflow-0.9
remotes/origin/openflow-1.0
Step2. Compile
$ ./boot.sh
$ mkdir build
$ cd build/
$ ../configure
$ make
Step3. Run
Run NOX with routing module only. Routing module will do the shortest path routing.
$ cd src
$ ./nox_core -i ptcp:6633 routing
5. Basic Test
On the controller PC, first check the switches are connected to the controller. You can check this by
$ netstat -an | grep 6663
Assign the IP addresses to Client1 and Client2 (on the same subnet) and run ping to check they can communicate. On each switch, you can run the following command to see the flow table is actually installed.
For Stanford reference design OpenFlow implementation
$ cd <your OpenFlow comipled dir>
$ ./utilities/ovs-dpctl dump-flows unix:/var/run/dp0
For OpenVswitch OpenFlow implementation
$ cd <your OpenFlow comipled dir>
$ ./utilities/ovs-dpctl dump-flows dp0

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

@@ -0,0 +1,152 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2011-03-27T19:54:45+08:00
====== NOX ======
Created Sunday 27 March 2011
1、安装依赖的软件包
$ apt-get install autoconf automake g++ libtool python python-twisted \
swig libxerces-c2-dev libssl-dev make \
libsqlite3-dev python-simplejson \
python-sphinx
注意默认的libboost1.35-devubuntu10.10上没有,可以用下面命令单独安装:
sudo apt-get install libboost-all-dev
或:
sudo apt-get install libboost-dev automake libtool flex bison pkg-
config g++
2、下载NOX软件包
$ git clone git://noxrepo.org/nox
$ cd nox
注意缺省情况下获得的是OpenFlow v0.8.9 compatible NOX (as of 5/20/2010).
如果需要OpenFlow v1.0 compatible NOX, 则需要手动从源代码中检索出相应的分支,方法如下:
#### this is only for OpenFlow v1.0 user
$ git branch -a
* master
remotes/origin/HEAD -> origin/master
remotes/origin/destiny
remotes/origin/master
remotes/origin/openflow-0.9
remotes/origin/openflow-1.0
$ git checkout -b nox_v06_ofv1.0 remotes/origin/openflow-1.0
$ git branch -a
master
* nox_v06_ofv1.0
remotes/origin/HEAD -> origin/master
remotes/origin/destiny
remotes/origin/master
remotes/origin/openflow-0.9
remotes/origin/openflow-1.0
3、编译并安装
$ ./boot.sh
$ mkdir build
$ cd build/
$ ../configure
$ make
$ make check
注意默认的源代码有bug需要手动修复一下否则编译时出现“ configure: error: Could not link against ! ”的错误
解决方法如下:
vim [[~/nox/src/nox_main.cc]]
在文件的开头添加一个头文件语句:
#include <sys/stat.h>
4、运行控制器
$ cd ~/nox/build/src
$ ./nox_core -i ptcp:6633 routing
注意默认编译后的文件有bug运行时会提示如下错误
> 00001|nox|ERR:Cannot change the state of 'python' to INSTALLED:
解决方法如下:
vim ~/nox/build/src/nox/coreapps/pyrt/ pyoxidereactor.py
把133行替换为一下内容
signal.signal(signal.SIGCHLD, lambda : self.callLater(0, reapAllProcesses))
5、测试
$ netstat -an | grep 6663
==================以下为google内容==============================
checking Checking thrift_home set to... /usr/local
checking Checking fb303_home set to... /usr/local
checking Checking smc_home set to... /home/ubuntu/src/scribe/services/
trunk/src
checking Checking fb_home set to... /home/ubuntu/src/scribe/
libfacebook
checking Checking hadoop_home set to... /usr/local
checking for boostlib >= 1.36... yes
checking build system type... i686-pc-linux-gnu
checking whether the Boost::System library is available... yes
checking whether the Boost::Filesystem library is available... yes
configure: error: Could not link against !
Distribution: Ubuntu 10.04
Is any one else facing this issue?
More options Jun 22, 11:16 pm
I was able to solve this by doing:
sudo apt-get install libboost-all-dev
This is in addition to the recommended:
sudo apt-get install libboost-dev automake libtool flex bison pkg-
config g++
../../src/nox_main.cc: In function int<unnamed>::daemon():
../../src/nox_main.cc:201: error: umask was not declared in this scope
make[4]: *** [nox_main.o] Error 1
make[4]: Leaving directory `/home/geekard/nox/build/src'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/geekard/nox/build/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/geekard/nox/build/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/geekard/nox/build'
make: *** [all] Error 2
geekard@geekard:~/nox/build$ vim ../src/nox_main.cc
加一个
#include <sys/stat.h>
> ./nox_core -i ptcp:6633 switch switch_management hostip hosttracker monitoring jsonmessenger
>
> NOX 0.9.0(zaku)~full~beta (nox_core), compiled Nov 15 2010 21:36:36
> Compiled with OpenFlow 0x01
> 00001|nox|ERR:Cannot change the state of 'python' to INSTALLED:
> 'python' ran into an error:
> Unable to construct a Python component:
> Traceback (most recent call last):
> File "./nox/coreapps/pyrt/pyoxidereactor.py", line 364, in instance
> return pyoxidereactor(ctxt)
> File "./nox/coreapps/pyrt/pyoxidereactor.py", line 133, in __init__
> signal.signal(signal.SIGCHLD, self._handleSigchld)
> AttributeError: 'pyoxidereactor' object has no attribute '_handleSigchld'
I think the fix is to change line 133 in pyoxidereactor.py to:
signal.signal(signal.SIGCHLD, lambda : self.callLater(0, reapAllProcesses))
http://comments.gmane.org/gmane.network.nox.devel/1796

View File

@@ -0,0 +1,69 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2011-05-19T20:16:51+08:00
====== NOX install ======
Created Thursday 19 May 2011
http://noxrepo.org/noxwiki/index.php/NOX_Installation
Contents
1 Dependencies
1.1 Debian/Ubuntu
1.1.1 Manual dependencies installation
1.1.2 apt-get
1.2 RedHat Enterprise Linux 6
1.3 Gentoo
2 Installation
3 Verify Installation
===== Dependencies =====
An unofficial list of dependencies can be found on the Dependencies page.
==== Debian/Ubuntu ====
These instructions are tested on Ubuntu 10.04. Manual dependencies installation
You can manually download the nox-dependencies package and get the updated information.
wget http://openflowswitch.org/downloads/debian/binary/nox-dependencies.deb
dpkg --info nox-dependencies.deb
apt-get
If you have root access and want apt-get to resolve the dependencies, you can all the following to your apt-get repositories list.
cd /etc/apt/sources.list.d
sudo wget http://openflowswitch.org/downloads/debian/nox.list
sudo apt-get update
sudo apt-get install nox-dependencies
==== RedHat Enterprise Linux 6 ====
While NOX has been built successfully on prerelease versions of RHEL6, we do not have a dependent package list or specific instructions at this time.
We will update this after RHEL6 is actually released.
==== Gentoo ====
sudo emerge dev-lang/swig dev-libs/boost =dev-python/twisted-8.2.0-r2
Then, add =dev-python/twisted-10.1.0 to package.mask to prevent upgrading to this version of twisted.
===== Installation =====
First, download the latest source code from the git repository and switch to the downloaded folder:
git clone git://noxrepo.org/nox
cd nox
For a branch other than master, you need to see the remote branches and checkout a branch using the following commands. If you want the master(stable) branch, skip this step:
git branch -a
git checkout -b <name of your choice> origin/<remote branch name>
To compile and install NOX:
./boot.sh
mkdir build/
cd build/
../configure
make -j 5
The ../configure step checks for required dependencies. 'make -j 5' should work on a system with 1 GB of RAM; 'make -j' may work on systems with more RAM.
If your dependencies are satisfied, this step should not give any errors. If it does, make sure you have installed the package which was found missing (or old). NOX compiles in six to seven minutes on a laptop with a 1.80 GHz CPU with 2GB RAM. The whole installation process (download code, install dependencies, and compile NOX) in Ubuntu 9.10 takes about 15-20 minutes maximum.
Verify Installation
Once compiled, the nox_core binary will be built in the src directory. Note that nox_core must be run from the build/src directory, and that the build directory must not be moved to a different place in the file system. You can verify that it has built properly by printing out the usage information:
cd src/
./nox_core -h

View File

@@ -0,0 +1,208 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2011-05-19T20:46:20+08:00
====== compile and install ======
Created Thursday 19 May 2011
NOX Installation
===============================
Quick Start From Git
--------------------
For those with all the proper dependencies installed (see below) NOX can
be configured and built using standard autoconf procedure::
git clone git://noxrepo.org/noxcore
cd noxcore/
./boot.sh
mkdir build/
cd build/
../configure
make
make check
If building from the source tarfile, you don't need to run boot.sh.
By default, NOX builds with C++ STL debugging checks, which can slow
down execution speeds by a factor of 10. For a production build,
you will want to turn this off::
./configure --enable-ndebug
Once compiled, the *nox_core* binary will be built in the *src/*
directory. **Note** that nox_core **must** be run from the *src/*
build directory, and that the build directory must not be moved to a
different place in the file system. You can verify that it has built
properly by printing out the usage information::
cd src/
./nox_core -h
If you've gotten this far, then you're ready to test your build
(:ref:`install_test`) or get right to using it (:ref:`sec_use`).
Not So Quick Start
-------------------
Dependencies
^^^^^^^^^^^^^^
The NOX team's internal development environment is standardized around
Debian's Lenny distribution (http://wiki.debian.org/DebianLenny). While
we test releases on other Linux distributions (Fedora, Gentoo, Ubuntu),
FreeBSD and NetBSD, using Lenny is certain to provide the least hassle.
NOX relies on the following software packages. All are available under
Debian as apt packages. Other distributions may require them to be
separately installed from source:
* g++ 4.2 or greater
* Boost C++ libraries, v1.34.1 or greater (http://www.boost.org)
* Xerces C++ parser, v2.7.0 or greater (http://xerces.apache.org/xerces-c)
For Twisted Python support (highly recommended) the following additional packages are required.
* SWIG v1.3.0 or greater (http://www.swig.org)
* Python2.5 or greater (http://python.org)
* Twisted Python (http://twistedmatrix.com)
The user interface (web management console) requires
* Mako Templates (http://www.makotemplates.org/)
* Simple JSON (http://www.undefined.org/python/)
.. warning::
Older versions of swig may have incompatibilities with newer gcc/g++
versions. This is known to be a problem with g++4.1 and swig v1.3.29
Boot Options
^^^^^^^^^^^^^
If building directly from git, the build system needs to be
bootstrapped.
./boot
Configure Options
^^^^^^^^^^^^^^^^^^
The following options are commonly used in NOX configuration. Use
./configure ----help for a full listing:
``--with-python=[yes|no|/path/to/python]`` By default, NOX builds with
an embedded Python interpreter. You can use this option to specify
which Python installation to use, or to build without Python support
(by using --with-python=no). NOX requires that the embedded python
support twisted.
``--enable-ndebug`` This will turn *off* debugging (STL debugging in
particular) and increase performance significantly. Use this whenever
running NOX operationally.
Distribution Specific Installation Notes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
**Debian 5.0 (Lenny):**
Compiling requires the following packages::
apt-get install autoconf automake g++ libtool python python-twisted
swig libboost1.35-dev libxerces-c2-dev libssl-dev make
Running the web server requires json support in python::
apt-get install python-simplejson
To build the documentation you will need to install sphinx::
apt-get install python-sphinx
**Ubuntu 8.04:**
Compiling requires the following packages::
apt-get install autoconf automake g++ libtool python python2.5-dev python-twisted
swig libboost-python1.34.1 libboost-python-dev libboost-serialization-dev
libboost-test-dev libxerces28-dev libssl-dev make
Running the web server requires json support in python::
apt-get install python-simplejson
**Ubuntu 9.04:**
Compiling requires the following packages::
apt-get git-core install autoconf automake g++ libtool python python-dev
python-twisted swig libssl-dev make libboost-dev libxerces-c2-dev
Running the web server requires json support in python::
apt-get install python-simplejson
**Fedora Core 9:+**
From a standard development install, you can build
after installing the following packages::
yum install xerces-c-devel python-twisted libpcap-devel
**Gentoo 2008.0-rc1**
To compile without twisted python you'll need the following packages::
- emerge -av boost
- emerge -av xerces-c
**OpenSUSE 10.3 :**
The boost distribution that comes with OpenSuse is too old. You'll have
to install this from the source:
* boost (http://www.boost.org)
To build NOX (with twisted python) you'll have to installed the
following packages from a base install::
gcc gcc-c++ make libXerces-c-27 libXerces-c-devel
libpcap-devel libopenssl-devel swig python-devel
python-twisted python-curses
**Mandriva One 2008:**
NOX compiled on Mandriva with the following packages installed::
libboost-devel boost-1.35.0 libxerces-c-devel
libopenssl0.9.8-devel libpython2.5-devel
python-twisted swig-devel
If the swig and swig-devel packages are not available from the repository, you
will have to build swig from source.
.. _install_test:
Testing your build
^^^^^^^^^^^^^^^^^^^^
You can verify that NOX built correct by running::
make check
From the build directory. Unittests can be run independently through
the *test* application::
cd src
./nox_core tests
As a simple example, if you've compiled with Twisted try running
*packetdump* using generated traffic::
cd src/
./nox_core -v -i pgen:10 packetdump
This should print out a description of ten identical packets,
and then wait for you to terminate *nox_core* with 'Ctrl-c'.

View File

@@ -0,0 +1,223 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2011-05-19T23:05:39+08:00
====== OpenFlow 打造弹性化的可控互联网 ======
Created Thursday 19 May 2011
http://www.tektalk.org/2010/11/07/openflow-%E2%80%93-%E6%89%93%E9%80%A0%E5%BC%B9%E6%80%A7%E5%8C%96%E7%9A%84%E5%8F%AF%E6%8E%A7%E4%BA%92%E8%81%94%E7%BD%91/
作者 yeasy | 2010-11-07 15:28 | 类型 互联网, 新兴技术 | 22条用户评论 »
系列目录 Future Internet Technology
OpenFlow 打造弹性化的可控互联网
Open vSwitch 开放虚拟交换标准
Mininet “懒惰”网络研究者的福音
NOX 现代网络操作系统
===== OpenFlow 打造弹性化的可控互联网 =====
==== 2012的故事 ====
2012年的某天你跟往常一样起床打开电脑却发现无法登录到邮箱、无法连接到公司的VPN网络、无法订购任何东西……你会发现一切都简直跟世界末日一样离开了网络现代社会根本无法正常运行。这并不是可笑的无根据的幻想**如果世界末日真的来临,摧毁互联网无疑是最直接有效的办法**,而现代互联网并没有我们想象的那样鲁棒。
从上个世纪70年代初互联网在短短不到40年时间里已经发展成为这个星球上不可或缺的基础设施。然而由于一开始的设计并没有考虑到后来互联网的规模会如此庞大、承载的应用会如此复杂、地位会变得如此重要现代的互联网在过重的压力下已经凸显出太多亟待解决的问题。
* **互联网太危险**,恶意攻击、病毒、木马每年造成上千亿刀的损失;
* **互联网太脆弱**无标度Scale-free的特性让整个网络可以在精心设计的少数攻击下即告崩溃
* **互联网太随意**p2p等应用的出现一度造成各大ISP网络堵塞严重影响传统正常的访问
* **互联网太迟钝**,现代臃肿的路由机制不能支持快速的更新,即便发现问题也无法快速反应;
* **互联网太局促**IPv4的分配地址已经捉襟见肘……
这一切的问题都隐隐的指向了__互联网这个庞然大物最关键的软肋——可控性__。缺乏有效的控制措施让互联网这个为服务人类而设计的机器正在逐渐演变成一头臃肿而暴躁的凶兽挣扎着要摆脱人类所施加的脆弱枷锁。
==== 下一代互联网和GENI ====
为了解决当前互联网的问题不少国家都纷纷提出了下一代互联网计划代表性计划有美国的FINDFuture Internet Network Design未来互联网网络设计和GENI (Global Environment for Network Innovations全球网络创新环境)欧洲的FIRE (Future Internet Research and Experimentation未来互联网研究和实验)中国的CNGI-CERNETChina Next Generation Internet。所有这些计划参与者大都是各个国家产、学、研顶尖的机构。
这三大计划中CNGI-CERNET主要是研究在IPv6体系下的新一代网络而NSF支持的FIND计划计划在不受当前互联网的制约下提出未来互联网的需求从2006年到2014年分三个阶段主要致力于五个问题**是否继续采用分组交换、是否要改变端对端原理、是否要分开路由和包转发、拥塞控制跟资源管理、身份认证和路由问题**。FIND计划最主要的成果之一就是GENI——__一套网络研究的基础平台__同时FIRE计划跟GENI项目合作也非常密切。GENI计划的两大任务是为最前沿的网络科学工程领域革命性研究开路刺激和促进重大社会经济影响的奠基性创新的出现围绕这两大任务GENI致力于打造下一代互联网的虚拟实验室为研究者提供验证创新的架构、协议的灵活、可扩展、可配置的实验平台并促进学术界和业界的相互合作。长期以来缺乏合适的实验平台让各界的专家学者们伤透了脑筋PlanetLab的种种局限已经不能满足广大researcher越来越令人fz的需求了。
毫无疑问GENI的目标将让每个网络研究者为之着迷和激动一套完全可控、可定制、大规模的网络试验床对学术界将意味着大批的顶级paper对业界意味着大量的新标准、新协议。
==== OpenFlow的前世今生 ====
GENI的好处虽多但要部署这个平台无疑是一件太过昂贵的事情于是一个自然的事情就是在目前现有的网络下能否省时省力的干好这个事情
很自然的想法如果我能控制整个Internet就好了而网络中最关键的节点就是交换设备。控制了交换设备就如同控制了城市交通系统中的红绿灯一样所有的流量就可以乖乖听话为我所用。然而现代的交换设备被几家巨头垄断**开放的接口十分有限**能做的事情也十分有限。如果能有一套开放接口、支持控制的交换标准该多好OpenFlow应运而生。
最初的想法其实十分简单无论是交换机还是路由器最核心的信息都存放在所谓的flow table里面用来实现各种各样的功能诸如转发、统计、过滤等。flow table结构的设计很大程度上体现了各个厂家的独特风格。OpenFlow就是试图提出这样一个通用的flow table设计能够满足大家不同的需求同时这个flow table支持远程的访问和控制从而达到控制流量的目的。具体来说OpenFlow的flow table中每一个entry支持3个部分规则操作跟状态。规则无非是用来定义flowOpenFlow里flow定义十分宽泛支持10个域(除了传统的7元组之外增加了交换端口、 以太网类型、Vlan ID)操作就是转发、丢弃等行为状态部分则是主要用来做流量的统计。在此基础上最关键的特性就是支持远端的控制试想如果我要改变entry就必须跑到交换机前重新编程写入得多麻烦而且如果我想获知网络的实时状态咋办有了统一的控制机制我们的网络才变得真正智能可控起来。OpenFlow的控制机制也十分灵活感兴趣的同仁可以参考NOX。
好了有了这个标准只要大家以后生产的交换设备都支持那么学术界以后能做的事情就太多了以前YY无数次的梦想终于开始变成了现实。比如我们可以在正常运行的网络中自己在定义一些特殊的规则**让符合规则的流量按照我们的需求走任意的路径,就仿佛将一张物理网络切成了若干不同的虚拟网络一样**同时运行而又各不干扰我们可以轻而易举的测试各种新的协议以前要做什么处理需要考虑到具体的拓扑结构考虑到box的先后顺序现在好了通过定义不同的flow entry就可以**任意改变流量的运行策略**这也很好的为解决移动性问题提供了便利一个著名的demo是笔记本在不同交换机之间切换虚拟机在两地之间切换运行的游戏不受影响。从这个意义上说OpenFlow将传统的物理固定的硬件定义互联网改造成为了动态可变的软件定义互联网software defined networking。而一个软件定义的可控的互联网除了更加灵活以外毫无疑问**通过恰当的控制算法,将大大提高网络自身的鲁棒性、运行效率以及安全性。**
目前学术界OpenFlow主要是stanford、berkeley、MIT等牵头的研究组在推动而业界据说包括Google在内的几大巨头已经纷纷参与其中最新的版本1.0协议已经发布。牵头人Nick Mckeown曾在Sigcomm08上做过专题的demo后续这几年仍有不少的相关工作在高水平的会议上发表。国内据说清华大学已经有研究机构参与进去。
Nick Mckeown这个人十分有意思主页在http://yuba.stanford.edu/~nickm%EF%BC%89%EF%BC%8C%E7%8E%B0%E4%BB%BBstandford%E7%9A%84AP%EF%BC%8C%E4%BB%8E%E4%BB%96%E6%9C%AC%E4%BA%BA%E6%8F%90%E4%BE%9B%E7%9A%84%E7%AE%80%E5%8E%86%E5%B0%B1%E5%8F%AF%E4%BB%A5%E7%9C%8B%E5%87%BA%EF%BC%8CNick%E5%90%8C%E5%AD%A6%E8%B7%9F%E4%B8%9A%E7%95%8C%E5%85%B3%E7%B3%BB%E5%8D%81%E5%88%86%E7%B4%A7%E5%AF%86%EF%BC%8Cphd%E6%AF%95%E4%B8%9A%E4%B8%A4%E5%B9%B4%E5%B0%B1%E5%88%9B%E5%8A%9E%E4%BA%86%E5%85%AC%E5%8F%B8%EF%BC%8C%E8%BF%98%E5%8F%82%E4%B8%8E%E4%BA%86Cisco%E7%9A%84%E9%A1%B9%E7%9B%AE%EF%BC%8C%E5%90%8E%E6%9D%A5%E6%96%B0%E5%85%AC%E5%8F%B8%E5%8D%96%E7%BB%99Cisco%EF%BC%88Cisco%E8%BF%99%E7%A7%8D%E6%A8%A1%E5%BC%8F%E5%BE%88%E4%B8%8D%E9%94%99%EF%BC%8C%E6%9C%89%E5%85%B4%E8%B6%A3%E7%9A%84%E5%90%8C%E4%BB%81%E5%8F%AF%E4%BB%A5%E6%90%9C%E7%B4%A2%E8%BF%87%E5%BE%80%E6%A1%88%E4%BE%8B%EF%BC%89%E3%80%82%E7%AC%94%E8%80%85%E6%9C%89%E5%B9%B8%E5%9C%A8%E6%9F%90%E6%AC%A1%E5%9B%BD%E9%99%85%E4%BC%9A%E8%AE%AE%E4%B8%8A%E7%A2%B0%E5%88%B0%E7%9C%9F%E4%BA%BA%EF%BC%8C%E7%BB%99%E4%BA%BA%E6%84%9F%E8%A7%89%E6%98%AF%E5%8D%81%E5%88%86%E7%9A%84humorous%E4%B8%94energetic%E7%9A%84%E3%80%82Nick%E5%90%8C%E5%AD%A6%E5%9C%A8%E6%8E%A8OpenFlow%E7%9A%84%E6%97%B6%E5%80%99%E6%98%8E%E6%98%BE%E5%8D%81%E5%88%86%E9%87%8D%E8%A7%86%E8%B7%9F%E4%B8%9A%E7%95%8C%E7%BB%93%E5%90%88%EF%BC%8C%E5%9F%BA%E6%9C%AC%E4%B8%8A%E6%98%AF%E4%B8%80%E8%BE%B9%E5%81%9A%EF%BC%8C%E4%B8%80%E8%BE%B9%E6%8B%89%E7%94%9F%E4%BA%A7%E5%95%86%E7%9A%84%E6%94%AF%E6%8C%81%EF%BC%8C%E5%BE%88%E9%87%8D%E8%A7%86%E5%81%9Ademo%EF%BC%8C%E5%BE%88%E6%97%A9%E5%B0%B1%E5%9C%A8stanford%E7%9A%84%E6%A0%A1%E5%9B%AD%E7%BD%91%E4%B8%AD%E9%83%A8%E7%BD%B2%E4%BA%86OpenFlow做的差不多了再提标准再做宣传就事半功倍了。他的这种发展模式也十分为笔者所推崇。
最后的战役
OpenFlow的出现无疑给现有的交换市场带来了新的巨大的商机。网络行业发展到今天垄断已经十分的严重许多年来交换机制造商已经麻木于每天忙碌提高性能的目标偶尔做点小工作支持下出现的新的需求。而OpenFlow创造了一块前所未有的大蛋糕能否抓住这一机遇不夸张的说是重新瓜分市场的生死之战。目前Cisco、HP、Juniper、NEC等巨头已经纷纷推出了支持OpenFlow的交换设备不仅有固网的移动互联网领域也相关产品开始试水。从另外一个角度看市场的重新瓜分新需求的出现也会给小规模的生产商带来一线生机对于新出现的厂家来说这也许是能争得一席之地最后的战役。
相关资料
官方网站见http://www.openflowswitch.org%EF%BC%8C%E7%9B%AE%E5%89%8D%E6%9C%89%E8%BD%AF%E4%BB%B6%E7%89%88%E6%9C%AC%E3%80%81netfpga版本可供使用支持的交换设备相信很快就可以能够买到。
雁过留声
“OpenFlow 打造弹性化的可控互联网”有22个回复
cls 于 2010-11-07 4:26 下午
好文章
jj 于 2010-11-07 6:34 下午
收到过一个邮件,听起来不错:
We are starting to distribute Pica8 Open Source Cloud Switches :
http://www.pica8.com/
Especially, to have a better overview of the OpenFlow technology, I
would greatly appreciate to invite you to a further reading of the
presentation entitled “FI technologies on cloud computing and trusty
networking” from our partner, Chunghwa Telecom (Leading ISP in Taiwan)
:
http://www.asiafi.net/meeting/2010/summerschool/p/chu.pdf
Moreover, to have a better overview of the specifications :
a) Redundant power supply :
We have a new platform 3295 (~3k USD), 48×1GE + 4×10 GE with dual
power supplies coming up in January.
b) Stacking capabilities :
Pronto 3295 has 4 x 10 Gb uplink, which could be connected to Pronto
3780 (~12k USD), nonblocking 48-port 10GE switch. Totally 12 Pronto
3295 could bind together to construct totally 576 ports without
blocking.
c) Terms of support
We provide different support service. Email support will be 2000 USD
and jump-start engineering consulting and troubleshooting assistance
will be 50K USD per customer.
d) Integration in existing network
The Firmware is based on an Open Source Carrier-Grade Linux Network
Stack stack that includes L2/L3 management for VLAN, LACP, STP/RSTP,
LLDP, OSPF, RIP, static route, PIM-SM, VRRP, IGMP, IGMP Snooping,
IPv6, Radius/Tacacs+ as well as OpenFlow 1.0
e) NMS/Fault Management/Service provisioning integration
OpenFlow/Software Defined Networks :
http://www.thequilt.net/meetings/GENI%2520WKSP/GENI%2520Workshop%2520Presentations/OF-intro-Quilt-workshop%2520(new)%2520-%252016%2520July%25202010.ppt
f) Real MTBF
46410 hours
青云浮水 于 2010-11-07 7:52 下午
意淫而已
jkdo 于 2010-11-07 8:12 下午
与目前已经获得广泛支持的VPN、TE、QOS等相比有何本质不同不解。
理客 于 2010-11-07 11:56 下午
几年前国内863中也有类似的项目。因为IP网络的高速拓展仅仅在实验室模拟可能难以满足将来如果大规模更改网络基础协议架构的巨大风险所以希望在实际网络中的大量设备上留一小片试验田做实验既不影响商业网网络运行又能对基础协议架构进行实地trial比技术问题更大的是运作模式能否被大部分vendor接受的问题
xueruoyun 于 2010-11-09 8:40 下午
03年就被提出来了即所谓的流路由器后来很快被淘汰了这个不太靠谱
slopover 于 2010-11-11 8:24 上午
很早就了解这个内容,但好像一直只是小打小闹
疾风 于 2010-11-12 5:43 上午
不相信可以替代。
也就只在数据中心内用用而已。
Yang 于 2010-11-12 11:44 下午
话说回复“所谓的流路由器”的同学,您真的看文章了吗?
简单的说OpenFlow的目的是在实际的网络上用到的路由和交换设备上允许研究人员跑一些实验。目前都是自己机器上跑simulation或者假设一个小型的testbed跟真实的网络比从规模到topology到traffic model都差太远了。
maygarden 于 2010-11-30 6:50 下午
好文章
是楼主自己写的吗?
牛人啊
qiuxiaofeng 于 2010-12-22 11:54 下午
Openflow 通过集中的controller实现对交换机flow talbe的可编程安全、扩展性会是个问题在云的内部用还可以对互联网上大量细粒度的flow控制可行性方面还需努力。
在互联网上没有一个统一的算法而依赖Openflow对交换机编程来调度flow是不是和三层上不用路由都用流量工程一样呀能行吗
特别不理解为什么允许packet通过controller转发看着象当年ATM和IP融合时的过渡方案。
看来局部的优化Openflow还可用但如题中所说”打造弹性化的可控互联网“只有Openflow怕是不够的如果真要实现programmable还是需要增加新的控制协议象信令一样
清华土著 于 2010-12-24 2:31 上午
支持楼主的文章,金玉良言之后,我接着扔点儿砖吧。
1最初OpenFlow以交换机的形式出现在stanford一伙人的实验室里后来又部署到了他们的楼里。OpenFlow提供了基于包头多个域而不仅仅是mac或IP的交换方式因此被认为细粒度且无所不能。
2稍后吞吐和容量等瓶颈出现。于是有了基于NetFPGA的实现ancs09也有了一些工业界结合的OF switch(HP, NEC, J/C)。在吞吐不是问题的情况下新建连接速度受controller限制和flow table的size始终困扰OpenFlow发展。
3稍后flow table size的问题通过两个思路解决一是使用multi-table(openflow spec 1.1)通过pipeline来解决指数及增长的size二是使用reactive+proactive的双重模式分布查找+动态加载sigcomm10)。个人以为问题离解决还早因为诸位OF的仁兄还停留在TCAM的空间上想问题。
4同时集中控制端的Nox发展也在进行。最早的controler是用于校园内一个building的之后的Ethane/Noxsigcomm07拓展到了enterprise level。也有一个Nox用于data center 基于VL2sigcomm09的讨论但要求10K机器使用多达600+的controller且aggregation的交换层流表有很大局限。个人认为DC中的OF应用还有几个核心问题要解决。
5近期OnixOSDI10通过 存储Network Information Base 类比一下RIB>NIB)完成了一套internet scale的部署方案。由于管控粒度在不同scale下面变得不同可以看出OpenFlow的网络功能越来越接近现有internet。但OpenFlow仍在尽量保留其全局可控性以及first-hop附近的细粒度可控性。个人认为痛苦而漫长的trade-off仍在进行中。
6假如这种trade-off最终收敛了i.e. openflow spec 2.0最终成行了那么OpenFlow确实能带来相当大的变革。从大的讲在全网领域基于OF的FlowVisorOSDI10可以提供互联网分层在同一物理拓扑的网络提供不同逻辑拓扑的交换从小的讲参考OF技术而实现Open vSwitch已经达到了商用水平提供了虚拟交换的多层管控机制www.nicira.com)。
7个人结语OpenFlow的研究是创新和奔放的体现虽然有圈钱的企图试图说服大辽给400所大学安装openflow有炒作的嫌疑sigcommosdi的大肆圈占有对现世的妥协无止境的各种trade-off;但是OpenFlow近8年来一直坚持的理念一直更新的meeting notes一直递增和开放的代码一点点build出来的各种小板子一个个精彩的demo都是要远远大于之前“虽然”里面的东西的。
在大宋,也有几个人在这么坚持。
陈怀临 于 2010-12-24 7:30 上午
这个Future Internet Tech的专题非常好。我们一定要坚持写发表评论。最后弯曲评论可以荣誉出品出专辑。
Will Chie 于 2011-03-01 11:21 下午
根据现在的趋势是不是可以把NGFW中的APP-ID和USER-ID的概念也加进 flow table中
ABC 于 2011-03-02 7:41 下午
控制和转发分离是趋势,我觉得在某个中东小国找个试验田是没问题的,比如巴林或阿联酋。看看效果。
Jie 于 2011-03-31 5:28 上午
跟802.11里面的Access Controller + Thin AP一个道理.
只不过OpenFlow还是理论阶段, CAPWAP已经被客户接受.
一直不喜欢capwap, 因为它破坏了网络的架构, 要把所有的80211报文全部集中到AC上处理(运营商的理由是这样好计费啥的).
15楼上的对, 控制和转发一定会分离, capwap有三种操作模式(local, split, remote)
个人非常喜欢split模式(跟openflow差不多了), 把每个AP的控制报文送到Controller统一处理, 数据转发在本地完成, 这个即不破坏现在的网络结构, 又能做到统一管理.
一开始对capwap抱有怀疑态度的, 总拿它跟snmp相比. 细细想来capwap还是不错的.
有兴趣研究openflow的, 先拿capwap练练手吧
http://www.tektalk.org/2011/03/09/%E5%BC%AF%E6%9B%B2%E6%9C%BA%E4%BC%9A%EF%BC%9Aaruba-networks/
谢建平 于 2011-04-10 5:22 上午
作者说的很对为了解决当前互联网的问题不少国家都纷纷提出了下一代互联网计划代表性计划有美国的FINDFuture Internet Network Design未来互联网网络设计和GENI (Global Environment for Network Innovations全球网络创新环境)欧洲的FIRE (Future Internet Research and Experimentation未来互联网研究和实验)中国的CNGI-CERNETChina Next Generation Internet。所有这些计划参与者大都是各个国家产、学、研顶尖的机构。但补充一点工信部十进制网络标准工作组代表中国国家成员体参加了ISO/IEC JTC1/SC6WG7 “未来网络”的工作会议,其中我与张庆松仼未来网络命名和寻址方案编辑,并己起草了:未来网络技术报告-问题陈述和要求 第2部分:命名和寻址”并经入流转程序文号为6N14581 此文观点之一认为未来网络不一定依靠IP网络而是一个电路交换和分组交换的混合网络。详见www,em777.net
bigrong 于 2011-05-11 7:48 下午
老韩昨天把他写的openflow的文章发给我看非常感谢他能看得起我投入实业之后我才发现自己半瓶子醋咣当的厉害。看了这篇写的很好的文章激起了我对技术废话的想法就再废话几句然后继续开工干活
我觉得类似Open Flow的想法从包交换刚出现到今天已经有多次了之前是协议层面今天是协议加开放编程接口类似TCL在测试编程领域在ATM、QoS领域和MPLS领域都有过多个类似的东西具体名称由于时代久远我就基本上记不住了。比如MPOA比如Diff Serv里的dsvp还是啥都是号称将路由选路的功能与承载平面分离。
但是基本上都没有成功过。华为当年还做过类似的东西在核心网上。几乎所有的大的网络厂商都去支持,我觉得新厂商是为了支持有机会,老厂商支持为了应付客户的需求。但是这几轮下来我觉得看了没有丝毫的兴奋点。
所有的人都在说互联网有问题,要去解决。但是我们发现互联网发展到今天其根本精神一直没有变,可能是产业的原因、历史遗留的原因。也有我认为是很根本的原因。所以我们今天看到实际上互联网不断涌现新的技术,但是本质上是一个在基础核心精神下的打补丁的过程。
我悲观的认为所有革命性的技术除了IPv6因为地址空间确实不够需要进行升级以外可能都不会有真正革命性的出现。当然如果把1Mbps=》10Mbps=》1Gbps=>100Gbps认为是革命性的技术的话另说。
核心还是互联网的商业模式,以及整个社会对它的期待!
Open Flow可能会在一些领域里用用比如无线啊、3G啊或者一些相对窄的领域但是普适领域里会是一个新的故事而已还会被遗忘。就像今天我们更多做的配置是VLANDefault GatewayACL如何防范DHCP或ARP欺骗。昨天和伙伴交流他之前做的酒店网络里有没有双核心多链路上联跑生成树并且做链路trunk的他说没有开始打标的时候还会弄得很漂亮后来客户就会裁减费用……我看低成本让客户用好用、够用、稳定的网络还是关键。
上周替朋友给一个公司主持发布会那家公司叫做飞鱼星。之前和他们marketing的人交流时他们说他们的上网行为管理路由器设计时遵循了上网行为管理的2、8理论。我当时很纳闷儿虽然很长时间不碰技术也确实不知道什么叫2/8理论莫非我很孤陋寡闻。后来听该公司董事长创始人周龙说所谓的2/8理论是指80%的用户只用20%的功能。我觉得这话极度靠谱!
老韩 于 2011-05-11 11:01 下午
飞鱼星我是一直没机会接触,其实很佩服他们的想法和做法的。包括这次他们的转型,角度找得也挺好的。有点像曾经的深信服。
OpenFlow 于 2011-05-13 7:23 上午
斯坦福的同学们真能折腾居然已经有两帮人成立了两个公司来搞这个openFlow.其中一个
http://www.nicira.com/
Nick Mckeown同学赫然在列而且是
Co-Founder
陈怀临 于 2011-05-13 7:44 上午
不错。另外赫然发现Juniper的Robb Enns也去了。我的老熟人呀。在那里做VP E。Robb白人人还是很不错的。很nice。
三千大千世界 于 2011-05-13 8:11 上午
“从另外一个角度看,**市场的重新瓜分**,新需求的出现,也会给小规模的生产商带来一线生机,对于新出现的厂家来说,这也许是能争得一席之地最后的战役。”
有搞头啊~,机会来了:)

View File

@@ -0,0 +1,91 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2011-05-19T23:08:23+08:00
====== 2 ======
Created Thursday 19 May 2011
从虚拟机到虚拟交换
提到虚拟化大家第一印象往往是虚拟机Virtual MachineVMware、Virtualbox这些大名鼎鼎的虚拟机软件不少人都耳熟能详。对企业用户来说虚拟技术最直接的好处是通过灵活配置资源、程序来高资源的利用率从而降低应用成本。近些年随着虚拟化技术、交换技术以及云计算服务的发展虚拟交换Virtual Switch已经越来越多的引起人们的关注。
顾名思义虚拟交换就是利用虚拟平台通过软件的方式形成交换机部件。跟传统的物理交换机相比虚拟交换机同样具备众多优点一是配置更加灵活。一台普通的服务器可以配置出数十台甚至上百台虚拟交换机且端口数目可以灵活选择。例如VMware的ESX一台服务器可以仿真出248台虚拟交换机且每台交换机预设虚拟端口即可达56个二是成本更加低廉通过虚拟交换往往可以获得昂贵的普通交换机才能达到的性能例如微软的Hyper-V平台虚拟机与虚拟交换机之间的联机速度轻易可达10Gbps。
虚拟交换与Open vSwitch
2008年底思科发布了针对VMWare的Nexus 1000V虚拟交换机一时之间在业界掀起不小的风头并被评为当年虚拟世界大会的最佳新产品。或许思科已经习惯了“群星捧月”此后很长一段时间里并没有见到正式的虚拟交换标准形成。除了惠普一年多以后提出了VEPA虚拟以太网端口聚合器其他厂家关注的多做事的少。随着云计算跟虚拟技术的紧密融合以及云安全的角度考虑技术市场曲线已经到了拐点业界已经迫切需要一套开放的VS标准众多门派蠢蠢欲动。
烽烟即燃之际Open vSwitch横空出世以开源技术作为基础遵循Apache2.0许可由Nicira Networks开发主要实现代码为可移植的C代码。它的诞生从一开始就得到了虚拟界大佬——Citrix System的关注。可能有读者对Citrix不熟但说到Xen恐怕就是妇孺皆知了没错Citrix正是Xen的东家。OVS在2010年5月才发布1.0版本。而早在1月初Citrix就在其最新版本的开放云平台ref[2]中宣布将Open vSwitch作为其默认组件并在XenServer5.6 FP1中集成作为其商用的Xen管理器hypervisor。除了Xen、Xen Cloud Platform、XenServer之外支持的其他虚拟平台包括 KVM、VirtualBox等。
OVS官方的定位是要做一个产品级质量的多层虚拟交换机通过支持可编程扩展来实现大规模的网络自动化。设计目标是方便管理和配置虚拟机网络检测多物理主机在动态虚拟环境中的流量情况。针对这一目标OVS具备很强的灵活性。可以在管理程序中作为软件switch运行也可以直接部署到硬件设备上作为控制层。同时在Linux上支持内核态性能高、用户态灵活。此外OVS还支持多种标准的管理接口如Netlow、sFlow、RSPAN,、ERSPAN, 、CLI。对于其他的虚拟交换机设备如VMware的vNetwork分布式交换机跟思科Nexus 1000V虚拟交换机等它也提供了较好的支持。
目前OVS的官方版本为1.1.0pre2,主要特性包括
虚拟机间互联的可视性;
支持trunking的标准802.1Q VLAN模块
细粒度的QoS
每虚拟机端口的流量策略;
负载均衡支持OpenFlow 参考openflow打造弹性化的可控互联网
远程配置兼容Linux 桥接模块代码
OVS获取
由于是开源项目代码获取十分简单最新代码可以利用git从官方网站下载。此外官方网站还提供了比较清晰的文档资料和应用例程其部署十分轻松。当前最新代码包主要包括以下模块和特性
ovs-vswitchd 主要模块实现switch的daemon包括一个支持流交换的Linux内核模块
ovsdb-server 轻量级数据库服务器提供ovs-vswitchd获取配置信息
ovs-brcompatd 让ovs-vswitch替换Linux bridge包括获取bridge ioctls的Linux内核模块
ovs-dpctl 用来配置switch内核模块
一些Scripts and specs 辅助OVS安装在Citrix XenServer上作为默认switch
ovs-vsctl 查询和更新ovs-vswitchd的配置
ovs-appctl 发送命令消息运行相关daemon
ovsdbmonitor GUI工具可以远程获取OVS数据库和OpenFlow的流表。
此外OVS也提供了支持OpenFlow的特性实现包括
ovs-openflowd 一个简单的OpenFlow交换机
ovs-controller 一个简单的OpenFlow控制器
ovs-ofctl 查询和控制OpenFlow交换机和控制器
ovs-pki 为OpenFlow交换机创建和管理公钥框架
tcpdump的补丁解析OpenFlow的消息
结语
IT领域可以称得上是人类历史上最开放创新也是最容易垄断的行业。PC行业wintel帝国曾塑造了不朽的神话证明谁控制了cpu跟os谁就控制了话语权只要PC的软硬件模式不发生革命性变化wintel帝国的地位将是无人能撼的。后起之秀ARM借助重视能耗的东风再加上智能终端技术的大发展才展露头角。而在互联网界思科更是首先把握住了最核心的交换市场早早登上至尊之位即使是步后尘的juniper、huawei也只能是虎口夺食各凭绝技分天下。现在虚拟交换技术的提出将给这一领域带来新的契机究竟鹿死谁手更待后人评说。
参考:
<1> http://openvswitch.org/
<2> http://xen.org/products/cloudxen.html
雁过留声
“Open vSwitch 开放虚拟交换标准”有8个回复
matriz 于 2010-12-21 12:31 上午
virtIO也是这样的做还不是那样
在用户空间里,内存上不知道折腾了几次才到虚拟机上面去,菜早凉了
august.seu 于 2010-12-21 12:44 上午
出来溜溜再下结论。
byapple 于 2010-12-21 6:31 上午
软硬件一起整,凉不了
宋伟 于 2010-12-28 1:46 上午
应该说3com的虚拟交换机和思科的虚拟交换机是两种标准的战争
os9600 于 2010-12-28 2:58 上午
虚拟机之间的交换功能应该部署在服务器以外的网络设备上,让服务器专心做计算,网络专门做交换。
为实现这一目标EVB标准化是关键。
Gary 于 2010-12-28 4:18 上午
虚拟软件交换机还是算了吧,性能很弱,比不上硬件交换机
droplet 于 2010-12-30 2:57 上午
N 1000v有硬件产品吧。
aaa 于 2011-01-11 8:27 上午
请教一下虚拟机间互联的可视性是说可以抓到同一个HOST上的两个虚拟机间的PACKET吗 MS VMWARE 是看不到虚拟机间的PACKET 的。

View File

@@ -0,0 +1,84 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2011-05-19T23:09:29+08:00
====== 3 ======
Created Thursday 19 May 2011
【摘要】在本系列前两篇文章里我们分别介绍了软件定义网络的两大利器——OpenFlow和Open vSwitch。不少研究者可能很有兴趣尝试一下却拿不出太多的时间。本文将介绍一套强大的轻量级网络研究平台——mininet通过它相信大家可以很好地感受到软件定义网络的魅力。
概述篇
作为研究者你是否想过在自己的个人笔记本上就可以搭建一套媲美真实硬件环境的复杂网络并轻松进行各项实验无论是用专业级的硬件实验平台还是用传统的虚拟机都显得太过昂贵且十分不方便进行操作。如果你有类似的需求不妨试试mininet绝对是“懒惰”却又追求效率的研究人员的福音。
stanford大学Nick McKeown的研究小组基于Linux Container架构开发出了这套进程虚拟化的平台。在mininet的帮助下你可以轻易的在自己的笔记本上测试一个软件定义网络software-defined Networks对基于Openflow、Open vSwitch的各种协议等进行开发验证或者验证自己的想法。最令人振奋的是所有的代码几乎可以无缝迁移到真实的硬件环境中学术界跟产业界再也不是那么难以沟通了。想想吧在实验室里一行命令就可以创建一个支持SDN的任意拓扑的网络结构并可以灵活的进行相关测试验证了设计的正确后又可以轻松部署到真实的硬件环境中。
mininet作为一个轻量级软定义网络研发和测试平台其主要特性包括
支持Openflow、OpenvSwitch等软定义网络部件
方便多人协同开发
支持系统级的还原测试
支持复杂拓扑、自定义拓扑
提供python API
很好的硬件移植性Linux兼容结果有更好的说服力
高扩展性支持超过4096台主机的网络结构
实战篇
获取镜像
官方网站已经提供了配置好相关环境的基于Debian Lenny的虚拟机镜像下载地址为http://openflowswitch.org/downloads/OpenFlowTutorial-081910.vmware.zip%EF%BC%8C%E5%8E%8B%E7%BC%A9%E5%8C%85%E5%A4%A7%E5%B0%8F%E4%B8%BA700M%E5%B7%A6%E5%8F%B3%EF%BC%8C%E8%A7%A3%E5%8E%8B%E5%90%8E%E5%A4%A7%E5%B0%8F%E4%B8%BA2.1G%E5%B7%A6%E5%8F%B3%E3%80%82%E8%99%9A%E6%8B%9F%E6%9C%BA%E9%95%9C%E5%83%8F%E6%A0%BC%E5%BC%8F%E4%B8%BAvmware%E7%9A%84vmdk%EF%BC%8C%E5%8F%AF%E4%BB%A5%E7%9B%B4%E6%8E%A5%E4%BD%BF%E7%94%A8vmware workstation或者virtualbox等软件打开。如果使用QEMU和KVM则需要先进行格式转换。后面我们就以这个虚拟os环境为例介绍mininet的相关功能。
登录镜像
默认用户名密码均为openflow建议通过本地利用ssh登录到虚拟机上使用可以设置自动登录并将X重定向到本地比较方便操作。
简单测试
创建网络
mininet的操作十分简单启动一个小型测试网络只需要下面几个步骤。
登录到虚拟机命令行界面打开wireshark使其后台运行, 命令为sudo wireshark &
启动mininet命令为sudo mn则默认创建如下图所示的网络拓扑。
此时进入以mininet>引导的命令行界面
好了从现在开始我们就拥有了一个1台控制节点(controller)、一台交换(switch)、两台主机(host)的网络并且用wireshark进行观测。下面进行几项简单的测试。
查看信息
查看全部节点:
mininet> nodes
available nodes are:
c0 h2 h3 s1
查看链路信息:
mininet> net
s1 <-> h2-eth0 h3-eth0
输出各节点的信息:
mininet> dump
c0: IP=127.0.0.1 intfs= pid=1679
s1: IP=None intfs=s1-eth1,s1-eth2 pid=1682
h2: IP=10.0.0.2 intfs=h2-eth0 pid=1680
h3: IP=10.0.0.3 intfs=h3-eth0 pid=1681
对节点进行单独操作
如果想要对某个节点的虚拟机单独进行命令操作,也十分简单,格式为 node cmd。例如查看交换机s1上的网络信息我们只需要在执行的ifconfig命令前加上s1主机标志即可即 s1 ifconfig同样如果我们想用ping 3个包的方法来测试h2跟h3之间连通情况只需要执行 h2 ping -c 3 h3 即可。得到的结果为
mininet> h2 ping -c 3 h3
PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.
64 bytes from 10.0.0.3: icmp_seq=1 ttl=64 time=7.19 ms
64 bytes from 10.0.0.3: icmp_seq=2 ttl=64 time=0.239 ms
64 bytes from 10.0.0.3: icmp_seq=3 ttl=64 time=0.136 ms
— 10.0.0.3 ping statistics —
3 packets transmitted, 3 received, 0% packet loss, time 2006ms
rtt min/avg/max/mdev = 0.136/2.523/7.194/3.303 ms
在本操作执行后可以通过wireshark记录查看到创建新的流表项的过程这也是造成第一个ping得到的结果偏大的原因。更简单的全网络互ping测试命令是pingall会自动所有节点逐对进行ping连通测试。
常用功能
快捷测试
除了cli的交互方式之外mininet还提供了更方便的自动执行的快捷测试方式其格式为sudo mn test cmd即可自动启动并执行cmd操作完成后自动退出。
例如 sudo mn test pingpair可以直接对主机连通性进行测试sudo mn test iperf启动后直接进行性能测试。用这种方式很方便直接得到实验结果。
自定义拓扑
mininet提供了python api可以用来方便的自定义拓扑结构在mininet/custom目录下给出了几个例子。例如在topo-2sw-2host.py文件中定义了一个mytopo则可以通过topo选项来指定使用这一拓扑命令为
sudo mn custom ~/mininet/custom/topo-2sw-2host.py topo mytopo test pingall
使用友好的mac编号
默认情况下主机跟交换机启动后分配的MAC地址是随机的这在某些情况下不方便查找问题。可以使用mac选项这样主机跟交换机分配到的MAC地址跟他们的ID是一致的容易通过MAC地址较快找到对应的节点。
使用XTerm
通过使用-x参数mn在启动后会在每个节点上自动打开一个XTerm方便某些情况下的对多个节点分别进行操作。命令为
sudo mn -x
在进入mn cli之后也可以使用 xterm node 命令指定启动某些节点上的xterm例如分别启用s1跟h2上的xterm可以用
xterm s1 h2
链路操作
在mn cli中使用link命令禁用或启用某条链路格式为 link node1 node2 up/down例如临时禁用s1跟h2之间的链路可以用
link s1 h2 down
名字空间
默认情况下主机节点有用独立的名字空间namespace而控制节点跟交换节点都在根名字空间root namespace中。如果想要让所有节点拥有各自的名字空间需要添加 innamespace 参数,即启动方式为 sudo mn innamespace
其他操作
执行sudo mn -c会进行清理配置操作适合故障后恢复。
总结篇
除了使用mn命令进行交互式操作以外mininet最为强大之处是提供api可以直接通过python编程进行灵活的网络实验。在mininet/example目录下给出了几个python程序的例子包括使用gui方式创建拓扑、运行多个测试在节点上运行sshd创建多个节点的tree结构网络等等。运行这些程序就可以得到令人信服的结果而且这些程序大都十分短小体现了mininet平台的强大易用性。
另外限于篇幅本文仅对mininet做了较简略的介绍更全面的版本可以从这里找到。此外也建议有兴趣做深入研究的朋友通过阅读参考文献进一步了解更多有趣内容。
参考
<1> A Network in a Laptop : Rapid Prototyping for Software-Defined Networks, Bob Lantz, Brandon Heller, Nick Mckeown, ACM Hotnets 2010;
<2> http://www.openflowswitch.org/foswiki/bin/view/OpenFlow/Mininet

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

@@ -0,0 +1,119 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2011-05-19T23:10:30+08:00
====== 4 ======
Created Thursday 19 May 2011
[注]本系列前面的三篇文章中介绍了软件定义网络SDN的基本概念和相关平台。按照SDN的观点网络的智能/管理实际上是通过控制器来实现的。本篇将介绍一个代表性的控制器实现——NOX。
现代大规模的网络环境十分复杂,给管理带来较大的难度。特别对于企业网络来说,管控需求繁多,应用、资源多样化,安全性、扩展性要求都特别高。因此,网络管理始终是研究的热点问题。
从操作系统到网络操作系统
早期的计算机程序开发者直接用机器语言编程。因为没有各种抽象的接口来管理底层的物理资源(内存、磁盘、通信),使得程序的开发、移植、调试等费时费力。而现代的操作系统提供更高的抽象层来管理底层的各种资源,极大的改善了软件程序开发的效率。
同样的情况出现在现代的网络管理中管理者的各种操作需要跟底层的物理资源直接打交道。例如通过ACL规则来管理用户需要获取用户的实际IP地址。更复杂的管理操作甚至需要管理者事先获取网络拓扑结构、用户实际位置等。随着网络规模的增加和需求的提高管理任务实际上变成巨大的挑战。
而NOX则试图从建立网络操作系统的层面来改变这一困境。网络操作系统Network Operating System这个术语早已经被不少厂家提出例如Cisco的IOS、Novell的NetWare等。这些操作系统实际上提供的是用户跟某些部件例如交换机、路由器的交互因此称为交换机/路由器操作系统可能更贴切。而从整个网络的角度来看,网络操作系统应该是抽象网络中的各种资源,为网络管理提供易用的接口。
实现技术探讨
模型
NOX的模型主要包括两个部分。
一是集中的编程模型。开发者不需要关心网络的实际架构,在开发者看来整个网络就好像一台单独的机器一样,有统一的资源管理和接口。
二是抽象的开发模型。应用程序开发需要面向的是NOX提供的高层接口而不是底层。例如应用面向的是用户、机器名但不面向IP地址、MAC地址等。
通用性标准
正如计算机操作系统本身并不实现复杂的各种软件功能NOX本身并不完成对网络管理任务而是通过在其上运行的各种“应用”Application来实现具体的管理任务。管理者和开发者可以专注到这些应用的开发上而无需花费时间在对底层细节的分析上。为了实现这一目的NOX需要提供尽可能通用General的接口来满足各种不同的管理需求。
架构
组件
下图给出了使用NOX管理网络环境的主要组件。包括交换机和控制服务其上运行NOX和相应的多个管理应用以及1个Network View其中Network View提供了对网络物理资源的不同观测和抽象解析。注意到NOX通过对交换机操作来管理流量因此交换机需要支持相应的管理功能。此处采用支持OpenFlow的交换机。
操作
流量经过交换机时如果发现没有对应的匹配表项则转发到运行NOX的控制器NOX上的应用通过流量信息来建立Network View和决策流量的行为。同样的NOX也可以控制哪些流量需要转发给控制器。
多粒度处理
NOX对网络中不同粒度的事件提供不同的处理。包括网包、网流、Network View等。
应用实现
NOX上的开发支持Python、C++语言NOX核心架构跟关键部分都是使用C++实现以保证性能。代码可以从http://www.noxrepo.org%E8%8E%B7%E5%8F%96%EF%BC%8C%E9%81%B5%E5%BE%AAGPL许可。
系统库
提供基本的高效系统库包括路由、包分类、标准的网络服务DHCP、DNS、协议过滤器等。
相关工作
NOX项目主页在http://noxrepo.org。
其他类似的项目包括SANE、Ethane、Maestro、onix、difane等有兴趣的同学可以进一步研究参考。
系列前一篇
分享到: 新浪微博 QQ空间 开心 人人 Live Digg FB Twitter
(1个打分 平均5.00 / 5)
工具箱
本文链接 | 邮给朋友 | 打印此页 | 11条用户评论 »
雁过留声
“NOX 现代网络操作系统”有11个回复
Will Chie 于 2011-03-01 11:52 下午
读后感:
看这个之前一定要理解open flow作为一个只开发过网络安全设备的我来理解这个flow可以理解为防火墙的session而OF switch就相当于做fast path做的事情。
至于slow path则交由NOX去处理。
NOX是一个带有编程接口的OS相对而言IOS就是不可编程的用户可以通过NOX提供的API编写应用程序来做一些自己想在slow path上做的工作这个可以做很多事情例如负载基于策略的QOS等等并且可以根据流量信息形成自己想表现出来的network view例如TOP10。
不知道以上描述妥不妥,望各位老大指点。
另有一事不明,请教:
形成的network view是放到NOX中最后大家可以共享的么还是自己只能看到自己形成的network view只是通过NOX提供的一些接口展现出来。
Will Chie 于 2011-03-02 12:18 上午
另外像NOX这类controller有没有统一的编程接口至少定义一套通用些的编程接口子集我觉得这个很重要现在智能手机应用就挺郁闷几乎没啥可移植性。
理客 于 2011-03-02 3:28 上午
OPEN FLOW的理想是IP路由和交换设备全开放这基本是在看得见的本世纪内很难完成的任务。但开发一个标准接口根据客户需要把流量从转发设备引出来到外面的server处理完后再回注给转发设备这个是目前现实的有一定意义的事
清华土著 于 2011-03-02 7:19 上午
OpenFlow未必需要全开放只要有接入层支持即可实现相当多的应用例如楼上所说的Flow detour。
kernelchina 于 2011-03-02 7:15 下午
企业内部用还是有意义的吧,不像路由器,主要是在不同的组织之间交换。
Will Chie 于 2011-03-02 7:24 下午
有个问题这些APP的编程能不能简单到让网络管理员很快掌握我觉得对大多数很难。
这样的话如果所谓下代网络普及后会不会出现这样的公司或工作室、自由职业者、兼职者专门按照公司的需求去定制APP甚至会提供一些已有的成熟的解决方案
donge 于 2011-03-07 7:07 上午
open flow是不是用户可以自定义流量特征策略将捕获流量送到controllor中controllor开放一些API供用户再处理这些特征流量。
netsitter 于 2011-03-07 10:42 上午
貌似是:
switch端
if (flow = match_flow(frame) == NULL) {
deliver_to_controller(frame);
} else {
/* deny, permit, qos? blah blah */
flow_process(flow, frame);
}
controller端
frame = frame_rcv();
flow = controller_process(frame);
push_flow_to_switch(flow, frame);
netsitter 于 2011-03-07 10:43 上午
wordpress把空格都去掉了。
sunset3000 于 2011-03-15 6:02 上午
这几个开源项目的初衷还是为大学提供一个实验的环境,从商业应用的角度来说,路还很长。
chinomango 于 2011-03-17 12:45 下午
NOX根本不是一个OS。它只是一个openflow的控制器是一个在LINUX上的小规模应用。做得事情很少主要只是处理一些openflow switch不知道如何转发的包。

View File

@@ -0,0 +1,56 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2011-05-19T22:19:04+08:00
====== TUN&TAP ======
Created Thursday 19 May 2011
http://en.wikipedia.org/wiki/TUN/TAP
From Wikipedia, the free encyclopedia
In computer networking, TUN and TAP are virtual network kernel devices. They are network devices that are supported entirely in software, which is different from ordinary network devices that are backed up by hardware network adapters.
TAP (as in network tap) simulates an Ethernet device and it operates with layer 2 packets such as Ethernet frames. TUN (as in network TUNnel) simulates a network layer device and it operates with layer 3 packets such as IP packets. TAP is used to create a network bridge, while TUN is used with routing.
Packets sent by an operating system via a TUN/TAP device are delivered to a user-space program that attaches itself to the device. A user-space program may also pass packets into a TUN/TAP device. In this case TUN/TAP device delivers (or "injects") these packets to the operating system network stack thus emulating their reception from an external source.
TUN/TAP is used for:
virtual private networks
OpenVPN, Ethernet/IP over TCP/UDP; encrypted, compressed
tinc (protocol) [1], Ethernet/IPv4/IPv6 over TCP/UDP; encrypted, compressed
VTun [2], Ethernet/IP/serial/Unix pipe over TCP; encrypted, compressed, traffic shaping
OpenSSH
ICMPTX [3], IP over ICMP (ping)
NSTX [4], iodine [5], IP over DNS
HTun [6], IP over HTTP
coLinux, Ethernet/IP over TCP/UDP
Hamachi
NeoRouter
VPN-X Java TAP Wrapper, VPN-X can be a P2P VPN, can be a SSL VPN
virtual machine networking
Bochs
coLinux
Hercules (S/390 emulator)
QEMU/Kvm
User-mode Linux
VirtualBox
TUN/TAP drivers are available on at least the following platforms:
FreeBSD
Linux, starting around version 2.1.60
Mac OS X
NetBSD
OpenBSD
Solaris Operating System
Microsoft Windows 2000/XP/Vista
QNX, only tap driver
[edit] External links
http://vtun.sourceforge.net/
http://www.kernel.org/pub/linux/kernel/people/marcelo/linux-2.4/Documentation/networking/tuntap.txt
http://tuntaposx.sourceforge.net/ - tun/tap driver for Mac OS X
http://www.whiteboard.ne.jp/~admin2/tuntap/ - modified tun driver with tap support for Solaris
http://backreference.org/2010/03/26/tuntap-interface-tutorial/ Tun/Tap Tutorial

View File

@@ -0,0 +1,78 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2011-03-27T19:55:49+08:00
====== openvswitch ======
Created Sunday 27 March 2011
有两种不同的 OpenFlow v1.0 switch 实现,一种是 Stanford's software reference design另一种是penVswitch (http://openvswitch.org/) 实现。
两者的区别是前者是user-space 实现后者是kernel-space实现因此后者的性能要比前者好但是在用户空间的实现较易添加新功能。
一、[[../openflow(Stanford).txt|Stanford Software Reference 的安装(略)]]
1、运行OpenFlow switch
./udatapath/ofdatapath --detach punix:/var/run/dp0 -d 004E46324304 -i eth1,eth2
2、添加交换机与控制器的连接通道
./secchan/ofprotocol unix:/var/run/dp0 tcp:192.168.0.100:6633
注意:.代表当前openflow编译后的目录对于编译后安装的openflow交换机可以直接指定命令而不需前加路径
二、OpenVswitch Implementation
1、下载相关软件包
$ wget http://openvswitch.org/releases/openvswitch-1.1.0pre2.tar.gz
$ tar zxvf openvswitch-1.1.0pre2.tar.gz
$ cd openvswitch-1.1.0pre2
2、配置并编译
$ ./boot.sh
$ ./configure --with-l26=/lib/modules/`uname -r`
$ make
注意
1、系统上要有内核源代码没有的话可用下面语句安装一个
sudo apt-get install linux-source-2.6.35
cd [[/usr/src/linux-source-2.6.35]]
sudo tar xjvf linux-source-2.6.35.tar.bz2
2、在配置时执行下条语句
sudo ./configure --with-l26=/lib/modules/`uname -r`/build --with-l26-source=/usr/src/linux-source-2.6.35/linux-source-2.6.35
3、安装
sudo make install
默认安装到/usr/local目录下
4、运行OpenFlow switch
#sudo [[/sbin/insmod]] ~/openvswitch-1.1.0pre2[[/datapath/linux-2.6/openvswitch_mod.ko]]
5、交换机的 Pipeline 缺省是空的生成交换datapath
# ./utilities/ovs-dpctl add-dp dp0
6、添加交换机控制的接口接口
# ./utilities/ovs-dpctl add-if nl:0 eth2
7、添加交换机与控制器的连接通道
./utilities/ovs-openflowd dp0 --datapath-id=0000004E46324304 tcp:192.168.0.100 port 6633 --out-of-band
命令行解释:
--datapath-id 用于唯一的指定与同一个控制器相连的不同交换机可以用交换机的MAC地址指定
tcp:192.168.0.100 port 6633 指定控制器的IP和监听端口号

View File

@@ -0,0 +1,160 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2011-03-27T19:56:15+08:00
====== single pc ======
Created Sunday 27 March 2011
1、安装依赖软件
sudo apt-get install vde2 graphviz gv qemu genisoimage psmisc \
debootstrap git git-core screen xterm python2.5 python-xml
注意python2.5 python-xml 在ubuntu10.10中已经被移除了,可以安装用 python 代替
2、下载openflowvms
git clone git://openflowswitch.org/openflow-vms.git openflowvms
3、将下列路径加到各环境变量中
[[/home/yourlogname/openflowvms/pylib]] directory is in your PYTHONPATH
/home/yourlogname/openflowvms/bin directory is in your PATH
如:
vim [[/etc/profile]]
export PATH=$PATH:/home/yourlogname/openflowvms/bin
export PYTHONPATH=[[/home/yourlogname/openflowvms/pylib]]
4、下载相关软件包
http://openflowswitch.org/downloads/diskimages/openflowvms-image.tgz
http://openflowswitch.org/downloads/diskimages/kernel.bin
http://openflowswitch.org/downloads/diskimages/openflow1.0-bin.tgz
各软件包的内容如下:
hda.dsk disk image used for the hosts running on qemu
kernel.bin kernel image used for the hosts running on qemu
ofdatapath openflow switch (userspace)
ofprotocol openflow protocol module (used to communicate to the controller)
dpctl openflow datapath control command
如果以前安装了openflow则最后一个文件不用下载了直接从系统中copy就可以了。
5、建立工作目录并将相关 文件见如下放置
<working directory>
|- openflow.cd
|- ofprotcol
|- dpctl
|- ofdatapath
|- kernel.bin
|- hda.dsk
6、设置仿真网络的拓扑结构文件
cp openflowvms/samples/2hosts-1ofsw.vms.xml <working directory>/2hosts-2ofsw.vms.xml
vim <working directory>/2hosts-2ofsw.vms.xml
将其修改为如下内容(加粗的为添加的内容)
<network name="Simple Network">
<of_mem>48</of_mem>
<openflowswitch name="of1">
<!--To let spawn an xterm-->
** <xterm>true</xterm> **
</openflowswitch>
<openflowswitch name="of2">
** <xterm>true</xterm> **
</openflowswitch>
<host name="host1">
** <ip><static>192.168.100.1</static></ip> **
** <xterm>true</xterm> **
</host>
** <host name="host2">**
** <ip><static>192.168.100.2</static></ip> **
** <xterm>true</xterm> **
** </host>**
<link end1="of1" end2="host1" />
** <link end1="of1" end2="of2" /> **
<link end1="of2" end2="host2" />
</network>
该文件描述的拓扑结构如下:
{{~/OpenFlow/Slide2.gif}}
7、验证配置文件有无错误
xmlstarlet val -e -s [[/home/geekard/openflowvms/xsd/vms.xsd]] 2hosts-2ofsw.vms.xml
注意:这条语句执行后会报错(xterm对象有误),但 没有关系。
8、画出配置文件代表的拓扑结构图
vms-draw.py 2hosts-2ofsw.vms.xml
注意直接执行这条语句时会报错提示找不到vmxml, 可以在其前面手动加上python库路径就可以了如下所示
PYTHONPATH=/home/geekard/openflowvms/pylib vms-draw.py 2hosts-2ofsw.vms.xml
9、本机 运行controller , 它在后台监听QEMU虚拟机里的OpenFlow Switch的连接请求
controller ptcp: &
10、验证controller是否在后台运行
netstat -n |grep 6633
11、运行仿真系统
vms-start.py -u 2hosts-2ofsw.vms.xml
对于kernel space switch , 用下个命令代替
vms-start.py 2hosts-2ofsw.vms.xml
12、停止仿真
./<your network name>-stop.sh
或:
vms-start.py -k
<your network name>-stop.sh是运行vms-start.py后在当前工作目录自动产生的<your network name>为2hosts-2ofsw.vms.xml文件
中指定的网络名。
13、远程登陆虚拟主机和交换机
等虚拟主机和交换机启动完成后,关闭其窗口,然后执行一下命令
screen -r ***
***代表2hosts-2ofsw.vms.xml文件中指定的主机或交换机名如: of1,of2, host1 , host2 ,就可以登陆到上面去
11、测试OpenFlow Switch
screen -r of1
cd /cdrom
./dpctl **dump-flows** unix:/tmp/ofsw
show
status
show-protostat
dump-tables
dump-ports
probe
ping
注意: **dump-flows** 可以替换为任意dpctl支持的命令。

View File

@@ -0,0 +1,188 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2011-03-27T19:55:20+08:00
====== standford ======
Created Sunday 27 March 2011
====== Ubuntu系统安装及测试openflow的步骤 ======
一、获得源代码:
sudo apt-get install git-core automake m4 pkg-config libtool
git clone git://openflowswitch.org/openflow.git
cd openflow
[[./boot.sh]]
或者:
wget http://openflowswitch.org/downloads/openflow-1.0.0.tar.gz
tar xzf openflow-1.0.0.tar.gz
cd openflow-1.0.0
二、编译并安装user-space 交换机
./configure
make
sudo make install
注意:默认的安装位置是:/usr/local .
为了以后测试通过,需把下列文件复制到解压的目录中
cp [[/usr/local/bin/controller]] <OpenFlow ---Directory>/controller/
cp [[/usr/local/bin/ofprotocol]] <OpenFlow----Directory>/secchan/
cp [[/usr/local/bin/ofdatapath]] <OpenFlow----Directory>/udatapath/
cp [[/usr/local/bin/dpctl]] <OpenFlow----Directory>/utilities/
cp <OpenFlow----Directory>/regress/bin/{veth.map ,of_generic_eth.map}
三、安装Wireshark 协议分析软件
sudo apt-get install wireshark libgtk2.0-dev
cd utilities/wireshark_dissectors/openflow
make
sudo make install
四、测试套件设置(Regression Suite)
1、 首先安装测试套件依赖的软件
cd ~/<your openflow-dir>
sudo regress/scripts/install_deps.pl
sudo regress/scripts/install_perlmods_apt
2、卸载avahi-daemon它会在测试时发送干扰数据包
sudo apt-get remove avahi-daemon
or
sudo apt-get install sysv-rc-conf
sudo sysv-rc-conf avahi-daemon off
3、禁用ipv6, 它会在测试时发送干扰数据包
% sudo vi /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
% sudo vi /etc/modprobe.d/blacklist.conf
blacklist net-pf-10
blacklist ipv6
4、为了使上述 设置生效,需要重其电脑
% sudo shutdown -r now
五、执行测试
1、设置环境变量
cd ~/
cp <openflow-dir>/regress/scripts/env_vars .
vim env_vars
将其中的" OF_ROOT "设为 <openflow-dir>所在的路径
2、将env_vars中的环境变量导入到当前shell中
su
source [[~/env_vars]]
3、加载虚拟网络接口
veth_setup.pl
然后验证是否有veth{0,1...7}出现
/sbin/ifconfig | more
4、开启Wireshark网络流量分析软件
wireshark &
设置抓包的网络接口: Capture->Interfaces and select the lo (loopback) interface.
5、执行user-space交换机、控制器测试
of_user_veth_test.pl
6、当安装了openVswitch后测试方法如下
1、设置环境变量
vim env_vars
将其中的"OFT_OVS_ROOT "设为 openvswitch所在的路径
如:
export OFT_OVS_ROOT=/home/geekard/openvswitch-1.1.0pre2
2、将env_vars中的环境变量导入到当前shell中
su
source [[~/env_vars]]
3、加载虚拟网络接口
veth_setup.pl
然后验证是否有veth{0,1...7}出现
/sbin/ifconfig | more
4、开启Wireshark网络流量分析软件
wireshark &
设置抓包的网络接口: Capture->Interfaces and select the lo (loopback) interface.
5、测试kernel -space 交换机
of_ovs_veth_test.pl
可以通过如下命令查看,交换机内核模块[[/datapath/linux-2.6/openvswitch_mod.ko|openvswitch_mod.ko(位于 ~/openvswitch-1.1.0pre2]][[/datapath/linux-2.6/openvswitch_mod.ko]]
)是否被装载
lsmod |grep openvswitch
6、测试用户空间交换机
of_ovs_user_veth_test.pl
可以通过如下命令查看:
ps auxww
结果可能如下:
root 12866 1.0 0.5 11976 8040 pts/0 S+ 23:01 0:00 /usr/bin/perl -w /home/geekard/openflow/regress/bin/of_ovs_user_veth_test.pl
root 13189 0.0 0.0 4232 1524 pts/0 S+ 23:01 0:00 /home/geekard/openvswitch-1.1.0pre2/utilities/ovs-openflowd netdev@br0 --ports=veth1,veth3,veth5,veth7 tcp:127.0.0.1:6633 --listen=ptcp:6634 --fail=closed --inactivity-probe=999999
root 13199 16.0 0.5 11632 7712 pts/0 S+ 23:02 0:00 /usr/bin/perl -w /home/geekard/openflow/regress/projects/black_box/regress/test_packet_out/run.pl --map=/home/geekard/openflow/regress/bin/veth.map --controller=tcp:localhost:6633,tc
====== 单机测试: ======
1、切换到root账户
su
2、启动控制器
controller punix:/var/run/controller.sock &
3、启动user-space交换机
ofdatapath --no-slicing punix:/var/run/ofdata.sock -i eth0,eth1 &
注意eth0,eth1 不能配有IP地址
dhcpcd -k eth* 去掉获得的ip地址
ofprotocol unix:/var/run/ofdata.sock unix:/var/run/controller.sock &
然后插在eth0,eth1口的设备就可以互相通信了。

View File

@@ -0,0 +1,223 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2011-05-19T23:05:39+08:00
====== OpenFlow 打造弹性化的可控互联网 ======
Created Thursday 19 May 2011
http://www.tektalk.org/2010/11/07/openflow-%E2%80%93-%E6%89%93%E9%80%A0%E5%BC%B9%E6%80%A7%E5%8C%96%E7%9A%84%E5%8F%AF%E6%8E%A7%E4%BA%92%E8%81%94%E7%BD%91/
作者 yeasy | 2010-11-07 15:28 | 类型 互联网, 新兴技术 | 22条用户评论 »
系列目录 Future Internet Technology
OpenFlow 打造弹性化的可控互联网
Open vSwitch 开放虚拟交换标准
Mininet “懒惰”网络研究者的福音
NOX 现代网络操作系统
===== OpenFlow 打造弹性化的可控互联网 =====
==== 2012的故事 ====
2012年的某天你跟往常一样起床打开电脑却发现无法登录到邮箱、无法连接到公司的VPN网络、无法订购任何东西……你会发现一切都简直跟世界末日一样离开了网络现代社会根本无法正常运行。这并不是可笑的无根据的幻想**如果世界末日真的来临,摧毁互联网无疑是最直接有效的办法**,而现代互联网并没有我们想象的那样鲁棒。
从上个世纪70年代初互联网在短短不到40年时间里已经发展成为这个星球上不可或缺的基础设施。然而由于一开始的设计并没有考虑到后来互联网的规模会如此庞大、承载的应用会如此复杂、地位会变得如此重要现代的互联网在过重的压力下已经凸显出太多亟待解决的问题。
* **互联网太危险**,恶意攻击、病毒、木马每年造成上千亿刀的损失;
* **互联网太脆弱**无标度Scale-free的特性让整个网络可以在精心设计的少数攻击下即告崩溃
* **互联网太随意**p2p等应用的出现一度造成各大ISP网络堵塞严重影响传统正常的访问
* **互联网太迟钝**,现代臃肿的路由机制不能支持快速的更新,即便发现问题也无法快速反应;
* **互联网太局促**IPv4的分配地址已经捉襟见肘……
这一切的问题都隐隐的指向了__互联网这个庞然大物最关键的软肋——可控性__。缺乏有效的控制措施让互联网这个为服务人类而设计的机器正在逐渐演变成一头臃肿而暴躁的凶兽挣扎着要摆脱人类所施加的脆弱枷锁。
==== 下一代互联网和GENI ====
为了解决当前互联网的问题不少国家都纷纷提出了下一代互联网计划代表性计划有美国的FINDFuture Internet Network Design未来互联网网络设计和GENI (Global Environment for Network Innovations全球网络创新环境)欧洲的FIRE (Future Internet Research and Experimentation未来互联网研究和实验)中国的CNGI-CERNETChina Next Generation Internet。所有这些计划参与者大都是各个国家产、学、研顶尖的机构。
这三大计划中CNGI-CERNET主要是研究在IPv6体系下的新一代网络而NSF支持的FIND计划计划在不受当前互联网的制约下提出未来互联网的需求从2006年到2014年分三个阶段主要致力于五个问题**是否继续采用分组交换、是否要改变端对端原理、是否要分开路由和包转发、拥塞控制跟资源管理、身份认证和路由问题**。FIND计划最主要的成果之一就是GENI——__一套网络研究的基础平台__同时FIRE计划跟GENI项目合作也非常密切。GENI计划的两大任务是为最前沿的网络科学工程领域革命性研究开路刺激和促进重大社会经济影响的奠基性创新的出现围绕这两大任务GENI致力于打造下一代互联网的虚拟实验室为研究者提供验证创新的架构、协议的灵活、可扩展、可配置的实验平台并促进学术界和业界的相互合作。长期以来缺乏合适的实验平台让各界的专家学者们伤透了脑筋PlanetLab的种种局限已经不能满足广大researcher越来越令人fz的需求了。
毫无疑问GENI的目标将让每个网络研究者为之着迷和激动一套完全可控、可定制、大规模的网络试验床对学术界将意味着大批的顶级paper对业界意味着大量的新标准、新协议。
==== OpenFlow的前世今生 ====
GENI的好处虽多但要部署这个平台无疑是一件太过昂贵的事情于是一个自然的事情就是在目前现有的网络下能否省时省力的干好这个事情
很自然的想法如果我能控制整个Internet就好了而网络中最关键的节点就是交换设备。控制了交换设备就如同控制了城市交通系统中的红绿灯一样所有的流量就可以乖乖听话为我所用。然而现代的交换设备被几家巨头垄断**开放的接口十分有限**能做的事情也十分有限。如果能有一套开放接口、支持控制的交换标准该多好OpenFlow应运而生。
最初的想法其实十分简单无论是交换机还是路由器最核心的信息都存放在所谓的flow table里面用来实现各种各样的功能诸如转发、统计、过滤等。flow table结构的设计很大程度上体现了各个厂家的独特风格。OpenFlow就是试图提出这样一个通用的flow table设计能够满足大家不同的需求同时这个flow table支持远程的访问和控制从而达到控制流量的目的。具体来说OpenFlow的flow table中每一个entry支持3个部分规则操作跟状态。规则无非是用来定义flowOpenFlow里flow定义十分宽泛支持10个域(除了传统的7元组之外增加了交换端口、 以太网类型、Vlan ID)操作就是转发、丢弃等行为状态部分则是主要用来做流量的统计。在此基础上最关键的特性就是支持远端的控制试想如果我要改变entry就必须跑到交换机前重新编程写入得多麻烦而且如果我想获知网络的实时状态咋办有了统一的控制机制我们的网络才变得真正智能可控起来。OpenFlow的控制机制也十分灵活感兴趣的同仁可以参考NOX。
好了有了这个标准只要大家以后生产的交换设备都支持那么学术界以后能做的事情就太多了以前YY无数次的梦想终于开始变成了现实。比如我们可以在正常运行的网络中自己在定义一些特殊的规则**让符合规则的流量按照我们的需求走任意的路径,就仿佛将一张物理网络切成了若干不同的虚拟网络一样**同时运行而又各不干扰我们可以轻而易举的测试各种新的协议以前要做什么处理需要考虑到具体的拓扑结构考虑到box的先后顺序现在好了通过定义不同的flow entry就可以**任意改变流量的运行策略**这也很好的为解决移动性问题提供了便利一个著名的demo是笔记本在不同交换机之间切换虚拟机在两地之间切换运行的游戏不受影响。从这个意义上说OpenFlow将传统的物理固定的硬件定义互联网改造成为了动态可变的软件定义互联网software defined networking。而一个软件定义的可控的互联网除了更加灵活以外毫无疑问**通过恰当的控制算法,将大大提高网络自身的鲁棒性、运行效率以及安全性。**
目前学术界OpenFlow主要是stanford、berkeley、MIT等牵头的研究组在推动而业界据说包括Google在内的几大巨头已经纷纷参与其中最新的版本1.0协议已经发布。牵头人Nick Mckeown曾在Sigcomm08上做过专题的demo后续这几年仍有不少的相关工作在高水平的会议上发表。国内据说清华大学已经有研究机构参与进去。
Nick Mckeown这个人十分有意思主页在http://yuba.stanford.edu/~nickm%EF%BC%89%EF%BC%8C%E7%8E%B0%E4%BB%BBstandford%E7%9A%84AP%EF%BC%8C%E4%BB%8E%E4%BB%96%E6%9C%AC%E4%BA%BA%E6%8F%90%E4%BE%9B%E7%9A%84%E7%AE%80%E5%8E%86%E5%B0%B1%E5%8F%AF%E4%BB%A5%E7%9C%8B%E5%87%BA%EF%BC%8CNick%E5%90%8C%E5%AD%A6%E8%B7%9F%E4%B8%9A%E7%95%8C%E5%85%B3%E7%B3%BB%E5%8D%81%E5%88%86%E7%B4%A7%E5%AF%86%EF%BC%8Cphd%E6%AF%95%E4%B8%9A%E4%B8%A4%E5%B9%B4%E5%B0%B1%E5%88%9B%E5%8A%9E%E4%BA%86%E5%85%AC%E5%8F%B8%EF%BC%8C%E8%BF%98%E5%8F%82%E4%B8%8E%E4%BA%86Cisco%E7%9A%84%E9%A1%B9%E7%9B%AE%EF%BC%8C%E5%90%8E%E6%9D%A5%E6%96%B0%E5%85%AC%E5%8F%B8%E5%8D%96%E7%BB%99Cisco%EF%BC%88Cisco%E8%BF%99%E7%A7%8D%E6%A8%A1%E5%BC%8F%E5%BE%88%E4%B8%8D%E9%94%99%EF%BC%8C%E6%9C%89%E5%85%B4%E8%B6%A3%E7%9A%84%E5%90%8C%E4%BB%81%E5%8F%AF%E4%BB%A5%E6%90%9C%E7%B4%A2%E8%BF%87%E5%BE%80%E6%A1%88%E4%BE%8B%EF%BC%89%E3%80%82%E7%AC%94%E8%80%85%E6%9C%89%E5%B9%B8%E5%9C%A8%E6%9F%90%E6%AC%A1%E5%9B%BD%E9%99%85%E4%BC%9A%E8%AE%AE%E4%B8%8A%E7%A2%B0%E5%88%B0%E7%9C%9F%E4%BA%BA%EF%BC%8C%E7%BB%99%E4%BA%BA%E6%84%9F%E8%A7%89%E6%98%AF%E5%8D%81%E5%88%86%E7%9A%84humorous%E4%B8%94energetic%E7%9A%84%E3%80%82Nick%E5%90%8C%E5%AD%A6%E5%9C%A8%E6%8E%A8OpenFlow%E7%9A%84%E6%97%B6%E5%80%99%E6%98%8E%E6%98%BE%E5%8D%81%E5%88%86%E9%87%8D%E8%A7%86%E8%B7%9F%E4%B8%9A%E7%95%8C%E7%BB%93%E5%90%88%EF%BC%8C%E5%9F%BA%E6%9C%AC%E4%B8%8A%E6%98%AF%E4%B8%80%E8%BE%B9%E5%81%9A%EF%BC%8C%E4%B8%80%E8%BE%B9%E6%8B%89%E7%94%9F%E4%BA%A7%E5%95%86%E7%9A%84%E6%94%AF%E6%8C%81%EF%BC%8C%E5%BE%88%E9%87%8D%E8%A7%86%E5%81%9Ademo%EF%BC%8C%E5%BE%88%E6%97%A9%E5%B0%B1%E5%9C%A8stanford%E7%9A%84%E6%A0%A1%E5%9B%AD%E7%BD%91%E4%B8%AD%E9%83%A8%E7%BD%B2%E4%BA%86OpenFlow做的差不多了再提标准再做宣传就事半功倍了。他的这种发展模式也十分为笔者所推崇。
最后的战役
OpenFlow的出现无疑给现有的交换市场带来了新的巨大的商机。网络行业发展到今天垄断已经十分的严重许多年来交换机制造商已经麻木于每天忙碌提高性能的目标偶尔做点小工作支持下出现的新的需求。而OpenFlow创造了一块前所未有的大蛋糕能否抓住这一机遇不夸张的说是重新瓜分市场的生死之战。目前Cisco、HP、Juniper、NEC等巨头已经纷纷推出了支持OpenFlow的交换设备不仅有固网的移动互联网领域也相关产品开始试水。从另外一个角度看市场的重新瓜分新需求的出现也会给小规模的生产商带来一线生机对于新出现的厂家来说这也许是能争得一席之地最后的战役。
相关资料
官方网站见http://www.openflowswitch.org%EF%BC%8C%E7%9B%AE%E5%89%8D%E6%9C%89%E8%BD%AF%E4%BB%B6%E7%89%88%E6%9C%AC%E3%80%81netfpga版本可供使用支持的交换设备相信很快就可以能够买到。
雁过留声
“OpenFlow 打造弹性化的可控互联网”有22个回复
cls 于 2010-11-07 4:26 下午
好文章
jj 于 2010-11-07 6:34 下午
收到过一个邮件,听起来不错:
We are starting to distribute Pica8 Open Source Cloud Switches :
http://www.pica8.com/
Especially, to have a better overview of the OpenFlow technology, I
would greatly appreciate to invite you to a further reading of the
presentation entitled “FI technologies on cloud computing and trusty
networking” from our partner, Chunghwa Telecom (Leading ISP in Taiwan)
:
http://www.asiafi.net/meeting/2010/summerschool/p/chu.pdf
Moreover, to have a better overview of the specifications :
a) Redundant power supply :
We have a new platform 3295 (~3k USD), 48×1GE + 4×10 GE with dual
power supplies coming up in January.
b) Stacking capabilities :
Pronto 3295 has 4 x 10 Gb uplink, which could be connected to Pronto
3780 (~12k USD), nonblocking 48-port 10GE switch. Totally 12 Pronto
3295 could bind together to construct totally 576 ports without
blocking.
c) Terms of support
We provide different support service. Email support will be 2000 USD
and jump-start engineering consulting and troubleshooting assistance
will be 50K USD per customer.
d) Integration in existing network
The Firmware is based on an Open Source Carrier-Grade Linux Network
Stack stack that includes L2/L3 management for VLAN, LACP, STP/RSTP,
LLDP, OSPF, RIP, static route, PIM-SM, VRRP, IGMP, IGMP Snooping,
IPv6, Radius/Tacacs+ as well as OpenFlow 1.0
e) NMS/Fault Management/Service provisioning integration
OpenFlow/Software Defined Networks :
http://www.thequilt.net/meetings/GENI%2520WKSP/GENI%2520Workshop%2520Presentations/OF-intro-Quilt-workshop%2520(new)%2520-%252016%2520July%25202010.ppt
f) Real MTBF
46410 hours
青云浮水 于 2010-11-07 7:52 下午
意淫而已
jkdo 于 2010-11-07 8:12 下午
与目前已经获得广泛支持的VPN、TE、QOS等相比有何本质不同不解。
理客 于 2010-11-07 11:56 下午
几年前国内863中也有类似的项目。因为IP网络的高速拓展仅仅在实验室模拟可能难以满足将来如果大规模更改网络基础协议架构的巨大风险所以希望在实际网络中的大量设备上留一小片试验田做实验既不影响商业网网络运行又能对基础协议架构进行实地trial比技术问题更大的是运作模式能否被大部分vendor接受的问题
xueruoyun 于 2010-11-09 8:40 下午
03年就被提出来了即所谓的流路由器后来很快被淘汰了这个不太靠谱
slopover 于 2010-11-11 8:24 上午
很早就了解这个内容,但好像一直只是小打小闹
疾风 于 2010-11-12 5:43 上午
不相信可以替代。
也就只在数据中心内用用而已。
Yang 于 2010-11-12 11:44 下午
话说回复“所谓的流路由器”的同学,您真的看文章了吗?
简单的说OpenFlow的目的是在实际的网络上用到的路由和交换设备上允许研究人员跑一些实验。目前都是自己机器上跑simulation或者假设一个小型的testbed跟真实的网络比从规模到topology到traffic model都差太远了。
maygarden 于 2010-11-30 6:50 下午
好文章
是楼主自己写的吗?
牛人啊
qiuxiaofeng 于 2010-12-22 11:54 下午
Openflow 通过集中的controller实现对交换机flow talbe的可编程安全、扩展性会是个问题在云的内部用还可以对互联网上大量细粒度的flow控制可行性方面还需努力。
在互联网上没有一个统一的算法而依赖Openflow对交换机编程来调度flow是不是和三层上不用路由都用流量工程一样呀能行吗
特别不理解为什么允许packet通过controller转发看着象当年ATM和IP融合时的过渡方案。
看来局部的优化Openflow还可用但如题中所说”打造弹性化的可控互联网“只有Openflow怕是不够的如果真要实现programmable还是需要增加新的控制协议象信令一样
清华土著 于 2010-12-24 2:31 上午
支持楼主的文章,金玉良言之后,我接着扔点儿砖吧。
1最初OpenFlow以交换机的形式出现在stanford一伙人的实验室里后来又部署到了他们的楼里。OpenFlow提供了基于包头多个域而不仅仅是mac或IP的交换方式因此被认为细粒度且无所不能。
2稍后吞吐和容量等瓶颈出现。于是有了基于NetFPGA的实现ancs09也有了一些工业界结合的OF switch(HP, NEC, J/C)。在吞吐不是问题的情况下新建连接速度受controller限制和flow table的size始终困扰OpenFlow发展。
3稍后flow table size的问题通过两个思路解决一是使用multi-table(openflow spec 1.1)通过pipeline来解决指数及增长的size二是使用reactive+proactive的双重模式分布查找+动态加载sigcomm10)。个人以为问题离解决还早因为诸位OF的仁兄还停留在TCAM的空间上想问题。
4同时集中控制端的Nox发展也在进行。最早的controler是用于校园内一个building的之后的Ethane/Noxsigcomm07拓展到了enterprise level。也有一个Nox用于data center 基于VL2sigcomm09的讨论但要求10K机器使用多达600+的controller且aggregation的交换层流表有很大局限。个人认为DC中的OF应用还有几个核心问题要解决。
5近期OnixOSDI10通过 存储Network Information Base 类比一下RIB>NIB)完成了一套internet scale的部署方案。由于管控粒度在不同scale下面变得不同可以看出OpenFlow的网络功能越来越接近现有internet。但OpenFlow仍在尽量保留其全局可控性以及first-hop附近的细粒度可控性。个人认为痛苦而漫长的trade-off仍在进行中。
6假如这种trade-off最终收敛了i.e. openflow spec 2.0最终成行了那么OpenFlow确实能带来相当大的变革。从大的讲在全网领域基于OF的FlowVisorOSDI10可以提供互联网分层在同一物理拓扑的网络提供不同逻辑拓扑的交换从小的讲参考OF技术而实现Open vSwitch已经达到了商用水平提供了虚拟交换的多层管控机制www.nicira.com)。
7个人结语OpenFlow的研究是创新和奔放的体现虽然有圈钱的企图试图说服大辽给400所大学安装openflow有炒作的嫌疑sigcommosdi的大肆圈占有对现世的妥协无止境的各种trade-off;但是OpenFlow近8年来一直坚持的理念一直更新的meeting notes一直递增和开放的代码一点点build出来的各种小板子一个个精彩的demo都是要远远大于之前“虽然”里面的东西的。
在大宋,也有几个人在这么坚持。
陈怀临 于 2010-12-24 7:30 上午
这个Future Internet Tech的专题非常好。我们一定要坚持写发表评论。最后弯曲评论可以荣誉出品出专辑。
Will Chie 于 2011-03-01 11:21 下午
根据现在的趋势是不是可以把NGFW中的APP-ID和USER-ID的概念也加进 flow table中
ABC 于 2011-03-02 7:41 下午
控制和转发分离是趋势,我觉得在某个中东小国找个试验田是没问题的,比如巴林或阿联酋。看看效果。
Jie 于 2011-03-31 5:28 上午
跟802.11里面的Access Controller + Thin AP一个道理.
只不过OpenFlow还是理论阶段, CAPWAP已经被客户接受.
一直不喜欢capwap, 因为它破坏了网络的架构, 要把所有的80211报文全部集中到AC上处理(运营商的理由是这样好计费啥的).
15楼上的对, 控制和转发一定会分离, capwap有三种操作模式(local, split, remote)
个人非常喜欢split模式(跟openflow差不多了), 把每个AP的控制报文送到Controller统一处理, 数据转发在本地完成, 这个即不破坏现在的网络结构, 又能做到统一管理.
一开始对capwap抱有怀疑态度的, 总拿它跟snmp相比. 细细想来capwap还是不错的.
有兴趣研究openflow的, 先拿capwap练练手吧
http://www.tektalk.org/2011/03/09/%E5%BC%AF%E6%9B%B2%E6%9C%BA%E4%BC%9A%EF%BC%9Aaruba-networks/
谢建平 于 2011-04-10 5:22 上午
作者说的很对为了解决当前互联网的问题不少国家都纷纷提出了下一代互联网计划代表性计划有美国的FINDFuture Internet Network Design未来互联网网络设计和GENI (Global Environment for Network Innovations全球网络创新环境)欧洲的FIRE (Future Internet Research and Experimentation未来互联网研究和实验)中国的CNGI-CERNETChina Next Generation Internet。所有这些计划参与者大都是各个国家产、学、研顶尖的机构。但补充一点工信部十进制网络标准工作组代表中国国家成员体参加了ISO/IEC JTC1/SC6WG7 “未来网络”的工作会议,其中我与张庆松仼未来网络命名和寻址方案编辑,并己起草了:未来网络技术报告-问题陈述和要求 第2部分:命名和寻址”并经入流转程序文号为6N14581 此文观点之一认为未来网络不一定依靠IP网络而是一个电路交换和分组交换的混合网络。详见www,em777.net
bigrong 于 2011-05-11 7:48 下午
老韩昨天把他写的openflow的文章发给我看非常感谢他能看得起我投入实业之后我才发现自己半瓶子醋咣当的厉害。看了这篇写的很好的文章激起了我对技术废话的想法就再废话几句然后继续开工干活
我觉得类似Open Flow的想法从包交换刚出现到今天已经有多次了之前是协议层面今天是协议加开放编程接口类似TCL在测试编程领域在ATM、QoS领域和MPLS领域都有过多个类似的东西具体名称由于时代久远我就基本上记不住了。比如MPOA比如Diff Serv里的dsvp还是啥都是号称将路由选路的功能与承载平面分离。
但是基本上都没有成功过。华为当年还做过类似的东西在核心网上。几乎所有的大的网络厂商都去支持,我觉得新厂商是为了支持有机会,老厂商支持为了应付客户的需求。但是这几轮下来我觉得看了没有丝毫的兴奋点。
所有的人都在说互联网有问题,要去解决。但是我们发现互联网发展到今天其根本精神一直没有变,可能是产业的原因、历史遗留的原因。也有我认为是很根本的原因。所以我们今天看到实际上互联网不断涌现新的技术,但是本质上是一个在基础核心精神下的打补丁的过程。
我悲观的认为所有革命性的技术除了IPv6因为地址空间确实不够需要进行升级以外可能都不会有真正革命性的出现。当然如果把1Mbps=》10Mbps=》1Gbps=>100Gbps认为是革命性的技术的话另说。
核心还是互联网的商业模式,以及整个社会对它的期待!
Open Flow可能会在一些领域里用用比如无线啊、3G啊或者一些相对窄的领域但是普适领域里会是一个新的故事而已还会被遗忘。就像今天我们更多做的配置是VLANDefault GatewayACL如何防范DHCP或ARP欺骗。昨天和伙伴交流他之前做的酒店网络里有没有双核心多链路上联跑生成树并且做链路trunk的他说没有开始打标的时候还会弄得很漂亮后来客户就会裁减费用……我看低成本让客户用好用、够用、稳定的网络还是关键。
上周替朋友给一个公司主持发布会那家公司叫做飞鱼星。之前和他们marketing的人交流时他们说他们的上网行为管理路由器设计时遵循了上网行为管理的2、8理论。我当时很纳闷儿虽然很长时间不碰技术也确实不知道什么叫2/8理论莫非我很孤陋寡闻。后来听该公司董事长创始人周龙说所谓的2/8理论是指80%的用户只用20%的功能。我觉得这话极度靠谱!
老韩 于 2011-05-11 11:01 下午
飞鱼星我是一直没机会接触,其实很佩服他们的想法和做法的。包括这次他们的转型,角度找得也挺好的。有点像曾经的深信服。
OpenFlow 于 2011-05-13 7:23 上午
斯坦福的同学们真能折腾居然已经有两帮人成立了两个公司来搞这个openFlow.其中一个
http://www.nicira.com/
Nick Mckeown同学赫然在列而且是
Co-Founder
陈怀临 于 2011-05-13 7:44 上午
不错。另外赫然发现Juniper的Robb Enns也去了。我的老熟人呀。在那里做VP E。Robb白人人还是很不错的。很nice。
三千大千世界 于 2011-05-13 8:11 上午
“从另外一个角度看,**市场的重新瓜分**,新需求的出现,也会给小规模的生产商带来一线生机,对于新出现的厂家来说,这也许是能争得一席之地最后的战役。”
有搞头啊~,机会来了:)

View File

@@ -0,0 +1,91 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2011-05-19T23:08:23+08:00
====== 2 ======
Created Thursday 19 May 2011
从虚拟机到虚拟交换
提到虚拟化大家第一印象往往是虚拟机Virtual MachineVMware、Virtualbox这些大名鼎鼎的虚拟机软件不少人都耳熟能详。对企业用户来说虚拟技术最直接的好处是通过灵活配置资源、程序来高资源的利用率从而降低应用成本。近些年随着虚拟化技术、交换技术以及云计算服务的发展虚拟交换Virtual Switch已经越来越多的引起人们的关注。
顾名思义虚拟交换就是利用虚拟平台通过软件的方式形成交换机部件。跟传统的物理交换机相比虚拟交换机同样具备众多优点一是配置更加灵活。一台普通的服务器可以配置出数十台甚至上百台虚拟交换机且端口数目可以灵活选择。例如VMware的ESX一台服务器可以仿真出248台虚拟交换机且每台交换机预设虚拟端口即可达56个二是成本更加低廉通过虚拟交换往往可以获得昂贵的普通交换机才能达到的性能例如微软的Hyper-V平台虚拟机与虚拟交换机之间的联机速度轻易可达10Gbps。
虚拟交换与Open vSwitch
2008年底思科发布了针对VMWare的Nexus 1000V虚拟交换机一时之间在业界掀起不小的风头并被评为当年虚拟世界大会的最佳新产品。或许思科已经习惯了“群星捧月”此后很长一段时间里并没有见到正式的虚拟交换标准形成。除了惠普一年多以后提出了VEPA虚拟以太网端口聚合器其他厂家关注的多做事的少。随着云计算跟虚拟技术的紧密融合以及云安全的角度考虑技术市场曲线已经到了拐点业界已经迫切需要一套开放的VS标准众多门派蠢蠢欲动。
烽烟即燃之际Open vSwitch横空出世以开源技术作为基础遵循Apache2.0许可由Nicira Networks开发主要实现代码为可移植的C代码。它的诞生从一开始就得到了虚拟界大佬——Citrix System的关注。可能有读者对Citrix不熟但说到Xen恐怕就是妇孺皆知了没错Citrix正是Xen的东家。OVS在2010年5月才发布1.0版本。而早在1月初Citrix就在其最新版本的开放云平台ref[2]中宣布将Open vSwitch作为其默认组件并在XenServer5.6 FP1中集成作为其商用的Xen管理器hypervisor。除了Xen、Xen Cloud Platform、XenServer之外支持的其他虚拟平台包括 KVM、VirtualBox等。
OVS官方的定位是要做一个产品级质量的多层虚拟交换机通过支持可编程扩展来实现大规模的网络自动化。设计目标是方便管理和配置虚拟机网络检测多物理主机在动态虚拟环境中的流量情况。针对这一目标OVS具备很强的灵活性。可以在管理程序中作为软件switch运行也可以直接部署到硬件设备上作为控制层。同时在Linux上支持内核态性能高、用户态灵活。此外OVS还支持多种标准的管理接口如Netlow、sFlow、RSPAN,、ERSPAN, 、CLI。对于其他的虚拟交换机设备如VMware的vNetwork分布式交换机跟思科Nexus 1000V虚拟交换机等它也提供了较好的支持。
目前OVS的官方版本为1.1.0pre2,主要特性包括
虚拟机间互联的可视性;
支持trunking的标准802.1Q VLAN模块
细粒度的QoS
每虚拟机端口的流量策略;
负载均衡支持OpenFlow 参考openflow打造弹性化的可控互联网
远程配置兼容Linux 桥接模块代码
OVS获取
由于是开源项目代码获取十分简单最新代码可以利用git从官方网站下载。此外官方网站还提供了比较清晰的文档资料和应用例程其部署十分轻松。当前最新代码包主要包括以下模块和特性
ovs-vswitchd 主要模块实现switch的daemon包括一个支持流交换的Linux内核模块
ovsdb-server 轻量级数据库服务器提供ovs-vswitchd获取配置信息
ovs-brcompatd 让ovs-vswitch替换Linux bridge包括获取bridge ioctls的Linux内核模块
ovs-dpctl 用来配置switch内核模块
一些Scripts and specs 辅助OVS安装在Citrix XenServer上作为默认switch
ovs-vsctl 查询和更新ovs-vswitchd的配置
ovs-appctl 发送命令消息运行相关daemon
ovsdbmonitor GUI工具可以远程获取OVS数据库和OpenFlow的流表。
此外OVS也提供了支持OpenFlow的特性实现包括
ovs-openflowd 一个简单的OpenFlow交换机
ovs-controller 一个简单的OpenFlow控制器
ovs-ofctl 查询和控制OpenFlow交换机和控制器
ovs-pki 为OpenFlow交换机创建和管理公钥框架
tcpdump的补丁解析OpenFlow的消息
结语
IT领域可以称得上是人类历史上最开放创新也是最容易垄断的行业。PC行业wintel帝国曾塑造了不朽的神话证明谁控制了cpu跟os谁就控制了话语权只要PC的软硬件模式不发生革命性变化wintel帝国的地位将是无人能撼的。后起之秀ARM借助重视能耗的东风再加上智能终端技术的大发展才展露头角。而在互联网界思科更是首先把握住了最核心的交换市场早早登上至尊之位即使是步后尘的juniper、huawei也只能是虎口夺食各凭绝技分天下。现在虚拟交换技术的提出将给这一领域带来新的契机究竟鹿死谁手更待后人评说。
参考:
<1> http://openvswitch.org/
<2> http://xen.org/products/cloudxen.html
雁过留声
“Open vSwitch 开放虚拟交换标准”有8个回复
matriz 于 2010-12-21 12:31 上午
virtIO也是这样的做还不是那样
在用户空间里,内存上不知道折腾了几次才到虚拟机上面去,菜早凉了
august.seu 于 2010-12-21 12:44 上午
出来溜溜再下结论。
byapple 于 2010-12-21 6:31 上午
软硬件一起整,凉不了
宋伟 于 2010-12-28 1:46 上午
应该说3com的虚拟交换机和思科的虚拟交换机是两种标准的战争
os9600 于 2010-12-28 2:58 上午
虚拟机之间的交换功能应该部署在服务器以外的网络设备上,让服务器专心做计算,网络专门做交换。
为实现这一目标EVB标准化是关键。
Gary 于 2010-12-28 4:18 上午
虚拟软件交换机还是算了吧,性能很弱,比不上硬件交换机
droplet 于 2010-12-30 2:57 上午
N 1000v有硬件产品吧。
aaa 于 2011-01-11 8:27 上午
请教一下虚拟机间互联的可视性是说可以抓到同一个HOST上的两个虚拟机间的PACKET吗 MS VMWARE 是看不到虚拟机间的PACKET 的。

View File

@@ -0,0 +1,84 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2011-05-19T23:09:29+08:00
====== 3 ======
Created Thursday 19 May 2011
【摘要】在本系列前两篇文章里我们分别介绍了软件定义网络的两大利器——OpenFlow和Open vSwitch。不少研究者可能很有兴趣尝试一下却拿不出太多的时间。本文将介绍一套强大的轻量级网络研究平台——mininet通过它相信大家可以很好地感受到软件定义网络的魅力。
概述篇
作为研究者你是否想过在自己的个人笔记本上就可以搭建一套媲美真实硬件环境的复杂网络并轻松进行各项实验无论是用专业级的硬件实验平台还是用传统的虚拟机都显得太过昂贵且十分不方便进行操作。如果你有类似的需求不妨试试mininet绝对是“懒惰”却又追求效率的研究人员的福音。
stanford大学Nick McKeown的研究小组基于Linux Container架构开发出了这套进程虚拟化的平台。在mininet的帮助下你可以轻易的在自己的笔记本上测试一个软件定义网络software-defined Networks对基于Openflow、Open vSwitch的各种协议等进行开发验证或者验证自己的想法。最令人振奋的是所有的代码几乎可以无缝迁移到真实的硬件环境中学术界跟产业界再也不是那么难以沟通了。想想吧在实验室里一行命令就可以创建一个支持SDN的任意拓扑的网络结构并可以灵活的进行相关测试验证了设计的正确后又可以轻松部署到真实的硬件环境中。
mininet作为一个轻量级软定义网络研发和测试平台其主要特性包括
支持Openflow、OpenvSwitch等软定义网络部件
方便多人协同开发
支持系统级的还原测试
支持复杂拓扑、自定义拓扑
提供python API
很好的硬件移植性Linux兼容结果有更好的说服力
高扩展性支持超过4096台主机的网络结构
实战篇
获取镜像
官方网站已经提供了配置好相关环境的基于Debian Lenny的虚拟机镜像下载地址为http://openflowswitch.org/downloads/OpenFlowTutorial-081910.vmware.zip%EF%BC%8C%E5%8E%8B%E7%BC%A9%E5%8C%85%E5%A4%A7%E5%B0%8F%E4%B8%BA700M%E5%B7%A6%E5%8F%B3%EF%BC%8C%E8%A7%A3%E5%8E%8B%E5%90%8E%E5%A4%A7%E5%B0%8F%E4%B8%BA2.1G%E5%B7%A6%E5%8F%B3%E3%80%82%E8%99%9A%E6%8B%9F%E6%9C%BA%E9%95%9C%E5%83%8F%E6%A0%BC%E5%BC%8F%E4%B8%BAvmware%E7%9A%84vmdk%EF%BC%8C%E5%8F%AF%E4%BB%A5%E7%9B%B4%E6%8E%A5%E4%BD%BF%E7%94%A8vmware workstation或者virtualbox等软件打开。如果使用QEMU和KVM则需要先进行格式转换。后面我们就以这个虚拟os环境为例介绍mininet的相关功能。
登录镜像
默认用户名密码均为openflow建议通过本地利用ssh登录到虚拟机上使用可以设置自动登录并将X重定向到本地比较方便操作。
简单测试
创建网络
mininet的操作十分简单启动一个小型测试网络只需要下面几个步骤。
登录到虚拟机命令行界面打开wireshark使其后台运行, 命令为sudo wireshark &
启动mininet命令为sudo mn则默认创建如下图所示的网络拓扑。
此时进入以mininet>引导的命令行界面
好了从现在开始我们就拥有了一个1台控制节点(controller)、一台交换(switch)、两台主机(host)的网络并且用wireshark进行观测。下面进行几项简单的测试。
查看信息
查看全部节点:
mininet> nodes
available nodes are:
c0 h2 h3 s1
查看链路信息:
mininet> net
s1 <-> h2-eth0 h3-eth0
输出各节点的信息:
mininet> dump
c0: IP=127.0.0.1 intfs= pid=1679
s1: IP=None intfs=s1-eth1,s1-eth2 pid=1682
h2: IP=10.0.0.2 intfs=h2-eth0 pid=1680
h3: IP=10.0.0.3 intfs=h3-eth0 pid=1681
对节点进行单独操作
如果想要对某个节点的虚拟机单独进行命令操作,也十分简单,格式为 node cmd。例如查看交换机s1上的网络信息我们只需要在执行的ifconfig命令前加上s1主机标志即可即 s1 ifconfig同样如果我们想用ping 3个包的方法来测试h2跟h3之间连通情况只需要执行 h2 ping -c 3 h3 即可。得到的结果为
mininet> h2 ping -c 3 h3
PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.
64 bytes from 10.0.0.3: icmp_seq=1 ttl=64 time=7.19 ms
64 bytes from 10.0.0.3: icmp_seq=2 ttl=64 time=0.239 ms
64 bytes from 10.0.0.3: icmp_seq=3 ttl=64 time=0.136 ms
— 10.0.0.3 ping statistics —
3 packets transmitted, 3 received, 0% packet loss, time 2006ms
rtt min/avg/max/mdev = 0.136/2.523/7.194/3.303 ms
在本操作执行后可以通过wireshark记录查看到创建新的流表项的过程这也是造成第一个ping得到的结果偏大的原因。更简单的全网络互ping测试命令是pingall会自动所有节点逐对进行ping连通测试。
常用功能
快捷测试
除了cli的交互方式之外mininet还提供了更方便的自动执行的快捷测试方式其格式为sudo mn test cmd即可自动启动并执行cmd操作完成后自动退出。
例如 sudo mn test pingpair可以直接对主机连通性进行测试sudo mn test iperf启动后直接进行性能测试。用这种方式很方便直接得到实验结果。
自定义拓扑
mininet提供了python api可以用来方便的自定义拓扑结构在mininet/custom目录下给出了几个例子。例如在topo-2sw-2host.py文件中定义了一个mytopo则可以通过topo选项来指定使用这一拓扑命令为
sudo mn custom ~/mininet/custom/topo-2sw-2host.py topo mytopo test pingall
使用友好的mac编号
默认情况下主机跟交换机启动后分配的MAC地址是随机的这在某些情况下不方便查找问题。可以使用mac选项这样主机跟交换机分配到的MAC地址跟他们的ID是一致的容易通过MAC地址较快找到对应的节点。
使用XTerm
通过使用-x参数mn在启动后会在每个节点上自动打开一个XTerm方便某些情况下的对多个节点分别进行操作。命令为
sudo mn -x
在进入mn cli之后也可以使用 xterm node 命令指定启动某些节点上的xterm例如分别启用s1跟h2上的xterm可以用
xterm s1 h2
链路操作
在mn cli中使用link命令禁用或启用某条链路格式为 link node1 node2 up/down例如临时禁用s1跟h2之间的链路可以用
link s1 h2 down
名字空间
默认情况下主机节点有用独立的名字空间namespace而控制节点跟交换节点都在根名字空间root namespace中。如果想要让所有节点拥有各自的名字空间需要添加 innamespace 参数,即启动方式为 sudo mn innamespace
其他操作
执行sudo mn -c会进行清理配置操作适合故障后恢复。
总结篇
除了使用mn命令进行交互式操作以外mininet最为强大之处是提供api可以直接通过python编程进行灵活的网络实验。在mininet/example目录下给出了几个python程序的例子包括使用gui方式创建拓扑、运行多个测试在节点上运行sshd创建多个节点的tree结构网络等等。运行这些程序就可以得到令人信服的结果而且这些程序大都十分短小体现了mininet平台的强大易用性。
另外限于篇幅本文仅对mininet做了较简略的介绍更全面的版本可以从这里找到。此外也建议有兴趣做深入研究的朋友通过阅读参考文献进一步了解更多有趣内容。
参考
<1> A Network in a Laptop : Rapid Prototyping for Software-Defined Networks, Bob Lantz, Brandon Heller, Nick Mckeown, ACM Hotnets 2010;
<2> http://www.openflowswitch.org/foswiki/bin/view/OpenFlow/Mininet

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

@@ -0,0 +1,119 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2011-05-19T23:10:30+08:00
====== 4 ======
Created Thursday 19 May 2011
[注]本系列前面的三篇文章中介绍了软件定义网络SDN的基本概念和相关平台。按照SDN的观点网络的智能/管理实际上是通过控制器来实现的。本篇将介绍一个代表性的控制器实现——NOX。
现代大规模的网络环境十分复杂,给管理带来较大的难度。特别对于企业网络来说,管控需求繁多,应用、资源多样化,安全性、扩展性要求都特别高。因此,网络管理始终是研究的热点问题。
从操作系统到网络操作系统
早期的计算机程序开发者直接用机器语言编程。因为没有各种抽象的接口来管理底层的物理资源(内存、磁盘、通信),使得程序的开发、移植、调试等费时费力。而现代的操作系统提供更高的抽象层来管理底层的各种资源,极大的改善了软件程序开发的效率。
同样的情况出现在现代的网络管理中管理者的各种操作需要跟底层的物理资源直接打交道。例如通过ACL规则来管理用户需要获取用户的实际IP地址。更复杂的管理操作甚至需要管理者事先获取网络拓扑结构、用户实际位置等。随着网络规模的增加和需求的提高管理任务实际上变成巨大的挑战。
而NOX则试图从建立网络操作系统的层面来改变这一困境。网络操作系统Network Operating System这个术语早已经被不少厂家提出例如Cisco的IOS、Novell的NetWare等。这些操作系统实际上提供的是用户跟某些部件例如交换机、路由器的交互因此称为交换机/路由器操作系统可能更贴切。而从整个网络的角度来看,网络操作系统应该是抽象网络中的各种资源,为网络管理提供易用的接口。
实现技术探讨
模型
NOX的模型主要包括两个部分。
一是集中的编程模型。开发者不需要关心网络的实际架构,在开发者看来整个网络就好像一台单独的机器一样,有统一的资源管理和接口。
二是抽象的开发模型。应用程序开发需要面向的是NOX提供的高层接口而不是底层。例如应用面向的是用户、机器名但不面向IP地址、MAC地址等。
通用性标准
正如计算机操作系统本身并不实现复杂的各种软件功能NOX本身并不完成对网络管理任务而是通过在其上运行的各种“应用”Application来实现具体的管理任务。管理者和开发者可以专注到这些应用的开发上而无需花费时间在对底层细节的分析上。为了实现这一目的NOX需要提供尽可能通用General的接口来满足各种不同的管理需求。
架构
组件
下图给出了使用NOX管理网络环境的主要组件。包括交换机和控制服务其上运行NOX和相应的多个管理应用以及1个Network View其中Network View提供了对网络物理资源的不同观测和抽象解析。注意到NOX通过对交换机操作来管理流量因此交换机需要支持相应的管理功能。此处采用支持OpenFlow的交换机。
操作
流量经过交换机时如果发现没有对应的匹配表项则转发到运行NOX的控制器NOX上的应用通过流量信息来建立Network View和决策流量的行为。同样的NOX也可以控制哪些流量需要转发给控制器。
多粒度处理
NOX对网络中不同粒度的事件提供不同的处理。包括网包、网流、Network View等。
应用实现
NOX上的开发支持Python、C++语言NOX核心架构跟关键部分都是使用C++实现以保证性能。代码可以从http://www.noxrepo.org%E8%8E%B7%E5%8F%96%EF%BC%8C%E9%81%B5%E5%BE%AAGPL许可。
系统库
提供基本的高效系统库包括路由、包分类、标准的网络服务DHCP、DNS、协议过滤器等。
相关工作
NOX项目主页在http://noxrepo.org。
其他类似的项目包括SANE、Ethane、Maestro、onix、difane等有兴趣的同学可以进一步研究参考。
系列前一篇
分享到: 新浪微博 QQ空间 开心 人人 Live Digg FB Twitter
(1个打分 平均5.00 / 5)
工具箱
本文链接 | 邮给朋友 | 打印此页 | 11条用户评论 »
雁过留声
“NOX 现代网络操作系统”有11个回复
Will Chie 于 2011-03-01 11:52 下午
读后感:
看这个之前一定要理解open flow作为一个只开发过网络安全设备的我来理解这个flow可以理解为防火墙的session而OF switch就相当于做fast path做的事情。
至于slow path则交由NOX去处理。
NOX是一个带有编程接口的OS相对而言IOS就是不可编程的用户可以通过NOX提供的API编写应用程序来做一些自己想在slow path上做的工作这个可以做很多事情例如负载基于策略的QOS等等并且可以根据流量信息形成自己想表现出来的network view例如TOP10。
不知道以上描述妥不妥,望各位老大指点。
另有一事不明,请教:
形成的network view是放到NOX中最后大家可以共享的么还是自己只能看到自己形成的network view只是通过NOX提供的一些接口展现出来。
Will Chie 于 2011-03-02 12:18 上午
另外像NOX这类controller有没有统一的编程接口至少定义一套通用些的编程接口子集我觉得这个很重要现在智能手机应用就挺郁闷几乎没啥可移植性。
理客 于 2011-03-02 3:28 上午
OPEN FLOW的理想是IP路由和交换设备全开放这基本是在看得见的本世纪内很难完成的任务。但开发一个标准接口根据客户需要把流量从转发设备引出来到外面的server处理完后再回注给转发设备这个是目前现实的有一定意义的事
清华土著 于 2011-03-02 7:19 上午
OpenFlow未必需要全开放只要有接入层支持即可实现相当多的应用例如楼上所说的Flow detour。
kernelchina 于 2011-03-02 7:15 下午
企业内部用还是有意义的吧,不像路由器,主要是在不同的组织之间交换。
Will Chie 于 2011-03-02 7:24 下午
有个问题这些APP的编程能不能简单到让网络管理员很快掌握我觉得对大多数很难。
这样的话如果所谓下代网络普及后会不会出现这样的公司或工作室、自由职业者、兼职者专门按照公司的需求去定制APP甚至会提供一些已有的成熟的解决方案
donge 于 2011-03-07 7:07 上午
open flow是不是用户可以自定义流量特征策略将捕获流量送到controllor中controllor开放一些API供用户再处理这些特征流量。
netsitter 于 2011-03-07 10:42 上午
貌似是:
switch端
if (flow = match_flow(frame) == NULL) {
deliver_to_controller(frame);
} else {
/* deny, permit, qos? blah blah */
flow_process(flow, frame);
}
controller端
frame = frame_rcv();
flow = controller_process(frame);
push_flow_to_switch(flow, frame);
netsitter 于 2011-03-07 10:43 上午
wordpress把空格都去掉了。
sunset3000 于 2011-03-15 6:02 上午
这几个开源项目的初衷还是为大学提供一个实验的环境,从商业应用的角度来说,路还很长。
chinomango 于 2011-03-17 12:45 下午
NOX根本不是一个OS。它只是一个openflow的控制器是一个在LINUX上的小规模应用。做得事情很少主要只是处理一些openflow switch不知道如何转发的包。

56
Zim/OpenFlow/TUN&TAP.txt Normal file
View File

@@ -0,0 +1,56 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2011-05-19T22:19:04+08:00
====== TUN&TAP ======
Created Thursday 19 May 2011
http://en.wikipedia.org/wiki/TUN/TAP
From Wikipedia, the free encyclopedia
In computer networking, TUN and TAP are virtual network kernel devices. They are network devices that are supported entirely in software, which is different from ordinary network devices that are backed up by hardware network adapters.
TAP (as in network tap) simulates an Ethernet device and it operates with layer 2 packets such as Ethernet frames. TUN (as in network TUNnel) simulates a network layer device and it operates with layer 3 packets such as IP packets. TAP is used to create a network bridge, while TUN is used with routing.
Packets sent by an operating system via a TUN/TAP device are delivered to a user-space program that attaches itself to the device. A user-space program may also pass packets into a TUN/TAP device. In this case TUN/TAP device delivers (or "injects") these packets to the operating system network stack thus emulating their reception from an external source.
TUN/TAP is used for:
virtual private networks
OpenVPN, Ethernet/IP over TCP/UDP; encrypted, compressed
tinc (protocol) [1], Ethernet/IPv4/IPv6 over TCP/UDP; encrypted, compressed
VTun [2], Ethernet/IP/serial/Unix pipe over TCP; encrypted, compressed, traffic shaping
OpenSSH
ICMPTX [3], IP over ICMP (ping)
NSTX [4], iodine [5], IP over DNS
HTun [6], IP over HTTP
coLinux, Ethernet/IP over TCP/UDP
Hamachi
NeoRouter
VPN-X Java TAP Wrapper, VPN-X can be a P2P VPN, can be a SSL VPN
virtual machine networking
Bochs
coLinux
Hercules (S/390 emulator)
QEMU/Kvm
User-mode Linux
VirtualBox
TUN/TAP drivers are available on at least the following platforms:
FreeBSD
Linux, starting around version 2.1.60
Mac OS X
NetBSD
OpenBSD
Solaris Operating System
Microsoft Windows 2000/XP/Vista
QNX, only tap driver
[edit] External links
http://vtun.sourceforge.net/
http://www.kernel.org/pub/linux/kernel/people/marcelo/linux-2.4/Documentation/networking/tuntap.txt
http://tuntaposx.sourceforge.net/ - tun/tap driver for Mac OS X
http://www.whiteboard.ne.jp/~admin2/tuntap/ - modified tun driver with tap support for Solaris
http://backreference.org/2010/03/26/tuntap-interface-tutorial/ Tun/Tap Tutorial

View File

@@ -0,0 +1,78 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2011-03-27T19:55:49+08:00
====== openvswitch ======
Created Sunday 27 March 2011
有两种不同的 OpenFlow v1.0 switch 实现,一种是 Stanford's software reference design另一种是penVswitch (http://openvswitch.org/) 实现。
两者的区别是前者是user-space 实现后者是kernel-space实现因此后者的性能要比前者好但是在用户空间的实现较易添加新功能。
一、[[../openflow(Stanford).txt|Stanford Software Reference 的安装(略)]]
1、运行OpenFlow switch
./udatapath/ofdatapath --detach punix:/var/run/dp0 -d 004E46324304 -i eth1,eth2
2、添加交换机与控制器的连接通道
./secchan/ofprotocol unix:/var/run/dp0 tcp:192.168.0.100:6633
注意:.代表当前openflow编译后的目录对于编译后安装的openflow交换机可以直接指定命令而不需前加路径
二、OpenVswitch Implementation
1、下载相关软件包
$ wget http://openvswitch.org/releases/openvswitch-1.1.0pre2.tar.gz
$ tar zxvf openvswitch-1.1.0pre2.tar.gz
$ cd openvswitch-1.1.0pre2
2、配置并编译
$ ./boot.sh
$ ./configure --with-l26=/lib/modules/`uname -r`
$ make
注意
1、系统上要有内核源代码没有的话可用下面语句安装一个
sudo apt-get install linux-source-2.6.35
cd [[/usr/src/linux-source-2.6.35]]
sudo tar xjvf linux-source-2.6.35.tar.bz2
2、在配置时执行下条语句
sudo ./configure --with-l26=/lib/modules/`uname -r`/build --with-l26-source=/usr/src/linux-source-2.6.35/linux-source-2.6.35
3、安装
sudo make install
默认安装到/usr/local目录下
4、运行OpenFlow switch
#sudo [[/sbin/insmod]] ~/openvswitch-1.1.0pre2[[/datapath/linux-2.6/openvswitch_mod.ko]]
5、交换机的 Pipeline 缺省是空的生成交换datapath
# ./utilities/ovs-dpctl add-dp dp0
6、添加交换机控制的接口接口
# ./utilities/ovs-dpctl add-if nl:0 eth2
7、添加交换机与控制器的连接通道
./utilities/ovs-openflowd dp0 --datapath-id=0000004E46324304 tcp:192.168.0.100 port 6633 --out-of-band
命令行解释:
--datapath-id 用于唯一的指定与同一个控制器相连的不同交换机可以用交换机的MAC地址指定
tcp:192.168.0.100 port 6633 指定控制器的IP和监听端口号

160
Zim/OpenFlow/single_pc.txt Normal file
View File

@@ -0,0 +1,160 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2011-03-27T19:56:15+08:00
====== single pc ======
Created Sunday 27 March 2011
1、安装依赖软件
sudo apt-get install vde2 graphviz gv qemu genisoimage psmisc \
debootstrap git git-core screen xterm python2.5 python-xml
注意python2.5 python-xml 在ubuntu10.10中已经被移除了,可以安装用 python 代替
2、下载openflowvms
git clone git://openflowswitch.org/openflow-vms.git openflowvms
3、将下列路径加到各环境变量中
[[/home/yourlogname/openflowvms/pylib]] directory is in your PYTHONPATH
/home/yourlogname/openflowvms/bin directory is in your PATH
如:
vim [[/etc/profile]]
export PATH=$PATH:/home/yourlogname/openflowvms/bin
export PYTHONPATH=[[/home/yourlogname/openflowvms/pylib]]
4、下载相关软件包
http://openflowswitch.org/downloads/diskimages/openflowvms-image.tgz
http://openflowswitch.org/downloads/diskimages/kernel.bin
http://openflowswitch.org/downloads/diskimages/openflow1.0-bin.tgz
各软件包的内容如下:
hda.dsk disk image used for the hosts running on qemu
kernel.bin kernel image used for the hosts running on qemu
ofdatapath openflow switch (userspace)
ofprotocol openflow protocol module (used to communicate to the controller)
dpctl openflow datapath control command
如果以前安装了openflow则最后一个文件不用下载了直接从系统中copy就可以了。
5、建立工作目录并将相关 文件见如下放置
<working directory>
|- openflow.cd
|- ofprotcol
|- dpctl
|- ofdatapath
|- kernel.bin
|- hda.dsk
6、设置仿真网络的拓扑结构文件
cp openflowvms/samples/2hosts-1ofsw.vms.xml <working directory>/2hosts-2ofsw.vms.xml
vim <working directory>/2hosts-2ofsw.vms.xml
将其修改为如下内容(加粗的为添加的内容)
<network name="Simple Network">
<of_mem>48</of_mem>
<openflowswitch name="of1">
<!--To let spawn an xterm-->
** <xterm>true</xterm> **
</openflowswitch>
<openflowswitch name="of2">
** <xterm>true</xterm> **
</openflowswitch>
<host name="host1">
** <ip><static>192.168.100.1</static></ip> **
** <xterm>true</xterm> **
</host>
** <host name="host2">**
** <ip><static>192.168.100.2</static></ip> **
** <xterm>true</xterm> **
** </host>**
<link end1="of1" end2="host1" />
** <link end1="of1" end2="of2" /> **
<link end1="of2" end2="host2" />
</network>
该文件描述的拓扑结构如下:
{{~/OpenFlow/Slide2.gif}}
7、验证配置文件有无错误
xmlstarlet val -e -s [[/home/geekard/openflowvms/xsd/vms.xsd]] 2hosts-2ofsw.vms.xml
注意:这条语句执行后会报错(xterm对象有误),但 没有关系。
8、画出配置文件代表的拓扑结构图
vms-draw.py 2hosts-2ofsw.vms.xml
注意直接执行这条语句时会报错提示找不到vmxml, 可以在其前面手动加上python库路径就可以了如下所示
PYTHONPATH=/home/geekard/openflowvms/pylib vms-draw.py 2hosts-2ofsw.vms.xml
9、本机 运行controller , 它在后台监听QEMU虚拟机里的OpenFlow Switch的连接请求
controller ptcp: &
10、验证controller是否在后台运行
netstat -n |grep 6633
11、运行仿真系统
vms-start.py -u 2hosts-2ofsw.vms.xml
对于kernel space switch , 用下个命令代替
vms-start.py 2hosts-2ofsw.vms.xml
12、停止仿真
./<your network name>-stop.sh
或:
vms-start.py -k
<your network name>-stop.sh是运行vms-start.py后在当前工作目录自动产生的<your network name>为2hosts-2ofsw.vms.xml文件
中指定的网络名。
13、远程登陆虚拟主机和交换机
等虚拟主机和交换机启动完成后,关闭其窗口,然后执行一下命令
screen -r ***
***代表2hosts-2ofsw.vms.xml文件中指定的主机或交换机名如: of1,of2, host1 , host2 ,就可以登陆到上面去
11、测试OpenFlow Switch
screen -r of1
cd /cdrom
./dpctl **dump-flows** unix:/tmp/ofsw
show
status
show-protostat
dump-tables
dump-ports
probe
ping
注意: **dump-flows** 可以替换为任意dpctl支持的命令。

188
Zim/OpenFlow/standford.txt Normal file
View File

@@ -0,0 +1,188 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2011-03-27T19:55:20+08:00
====== standford ======
Created Sunday 27 March 2011
====== Ubuntu系统安装及测试openflow的步骤 ======
一、获得源代码:
sudo apt-get install git-core automake m4 pkg-config libtool
git clone git://openflowswitch.org/openflow.git
cd openflow
[[./boot.sh]]
或者:
wget http://openflowswitch.org/downloads/openflow-1.0.0.tar.gz
tar xzf openflow-1.0.0.tar.gz
cd openflow-1.0.0
二、编译并安装user-space 交换机
./configure
make
sudo make install
注意:默认的安装位置是:/usr/local .
为了以后测试通过,需把下列文件复制到解压的目录中
cp [[/usr/local/bin/controller]] <OpenFlow ---Directory>/controller/
cp [[/usr/local/bin/ofprotocol]] <OpenFlow----Directory>/secchan/
cp [[/usr/local/bin/ofdatapath]] <OpenFlow----Directory>/udatapath/
cp [[/usr/local/bin/dpctl]] <OpenFlow----Directory>/utilities/
cp <OpenFlow----Directory>/regress/bin/{veth.map ,of_generic_eth.map}
三、安装Wireshark 协议分析软件
sudo apt-get install wireshark libgtk2.0-dev
cd utilities/wireshark_dissectors/openflow
make
sudo make install
四、测试套件设置(Regression Suite)
1、 首先安装测试套件依赖的软件
cd ~/<your openflow-dir>
sudo regress/scripts/install_deps.pl
sudo regress/scripts/install_perlmods_apt
2、卸载avahi-daemon它会在测试时发送干扰数据包
sudo apt-get remove avahi-daemon
or
sudo apt-get install sysv-rc-conf
sudo sysv-rc-conf avahi-daemon off
3、禁用ipv6, 它会在测试时发送干扰数据包
% sudo vi /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
% sudo vi /etc/modprobe.d/blacklist.conf
blacklist net-pf-10
blacklist ipv6
4、为了使上述 设置生效,需要重其电脑
% sudo shutdown -r now
五、执行测试
1、设置环境变量
cd ~/
cp <openflow-dir>/regress/scripts/env_vars .
vim env_vars
将其中的" OF_ROOT "设为 <openflow-dir>所在的路径
2、将env_vars中的环境变量导入到当前shell中
su
source [[~/env_vars]]
3、加载虚拟网络接口
veth_setup.pl
然后验证是否有veth{0,1...7}出现
/sbin/ifconfig | more
4、开启Wireshark网络流量分析软件
wireshark &
设置抓包的网络接口: Capture->Interfaces and select the lo (loopback) interface.
5、执行user-space交换机、控制器测试
of_user_veth_test.pl
6、当安装了openVswitch后测试方法如下
1、设置环境变量
vim env_vars
将其中的"OFT_OVS_ROOT "设为 openvswitch所在的路径
如:
export OFT_OVS_ROOT=/home/geekard/openvswitch-1.1.0pre2
2、将env_vars中的环境变量导入到当前shell中
su
source [[~/env_vars]]
3、加载虚拟网络接口
veth_setup.pl
然后验证是否有veth{0,1...7}出现
/sbin/ifconfig | more
4、开启Wireshark网络流量分析软件
wireshark &
设置抓包的网络接口: Capture->Interfaces and select the lo (loopback) interface.
5、测试kernel -space 交换机
of_ovs_veth_test.pl
可以通过如下命令查看,交换机内核模块[[/datapath/linux-2.6/openvswitch_mod.ko|openvswitch_mod.ko(位于 ~/openvswitch-1.1.0pre2]][[/datapath/linux-2.6/openvswitch_mod.ko]]
)是否被装载
lsmod |grep openvswitch
6、测试用户空间交换机
of_ovs_user_veth_test.pl
可以通过如下命令查看:
ps auxww
结果可能如下:
root 12866 1.0 0.5 11976 8040 pts/0 S+ 23:01 0:00 /usr/bin/perl -w /home/geekard/openflow/regress/bin/of_ovs_user_veth_test.pl
root 13189 0.0 0.0 4232 1524 pts/0 S+ 23:01 0:00 /home/geekard/openvswitch-1.1.0pre2/utilities/ovs-openflowd netdev@br0 --ports=veth1,veth3,veth5,veth7 tcp:127.0.0.1:6633 --listen=ptcp:6634 --fail=closed --inactivity-probe=999999
root 13199 16.0 0.5 11632 7712 pts/0 S+ 23:02 0:00 /usr/bin/perl -w /home/geekard/openflow/regress/projects/black_box/regress/test_packet_out/run.pl --map=/home/geekard/openflow/regress/bin/veth.map --controller=tcp:localhost:6633,tc
====== 单机测试: ======
1、切换到root账户
su
2、启动控制器
controller punix:/var/run/controller.sock &
3、启动user-space交换机
ofdatapath --no-slicing punix:/var/run/ofdata.sock -i eth0,eth1 &
注意eth0,eth1 不能配有IP地址
dhcpcd -k eth* 去掉获得的ip地址
ofprotocol unix:/var/run/ofdata.sock unix:/var/run/controller.sock &
然后插在eth0,eth1口的设备就可以互相通信了。