Dec. 13, 2013, 3:27 p.m.
最近做毕设,大致了解了下 NOX网络控制器 和openflow相关知识。
nox是openflow网络中处于 控制层 的一种控制器。其代码主要由C++编写 ,官方网站中的nox-classic为c++与python混写的旧版nox ,新版的nox为了追求高效的性能而放弃python,完全只支持c++。
我们项目对性能没有过高要求,故选择了便于开发组件的nox-classic
要搭建一个实验环境,首先我们需要安装nox
git clone https://github.com/noxrepo/nox-classic
cd ./nox-classic
./boot.sh
./configure
make
sudo make install
简单说来就这几行命令,每一步都不报错的话就安装成功了。。。
而实际情况是, nox-classic版本已经许久没有维护,故会有这样那样的报错
这里说几个我遇到的:
1. boot.sh 提示
src/tests/../Make.vars:56: `pkglibdir' is not a legitimate directory for `SCRIPTS'
src/tests/Makefile.am:1: `src/tests/../Make.vars' included from here
src/utilities/../Make.vars:56: `pkglibdir' is not a legitimate directory for `SCRIPTS'
src/utilities/Makefile.am:1: `src/utilities/../Make.vars' included from here
autoreconf: automake failed with exit status: 1
这时可以使用本patch
diff --git a/src/Make.vars b/src/Make.vars
index d70d6aa..93b2879 100644
--- a/src/Make.vars
+++ b/src/Make.vars
@@ -53,7 +53,7 @@ AM_LDFLAGS += -export-dynamic
endif
# set python runtimefiles to be installed in the same directory as pkg
-pkglib_SCRIPTS = $(NOX_RUNTIMEFILES) $(NOX_PYBUILDFILES)
+pkgdata_SCRIPTS = $(NOX_RUNTIMEFILES) $(NOX_PYBUILDFILES)
BUILT_SOURCES = $(NOX_PYBUILDFILES)
# Runtime-files build and clean rules
2. configure 时提示swig库必须大于1.3时 可以卸载当前系统版本的swig 并到swig官网下载一个1.3.X版本的swig
3.make 时 提示
error: 'ptrdiff_t' was not declared in this scope
可以使用这个patch
diff --git a/src/nox/lib/netinet/netinet_wrap.cc b/src/nox/lib/netinet/netinet_wrap.cc
index 0e89f2b..c49571b 100644
--- a/src/nox/lib/netinet/netinet_wrap.cc
+++ b/src/nox/lib/netinet/netinet_wrap.cc
@@ -8,6 +8,7 @@
* interface file instead.
* ----------------------------------------------------------------------------- */
+#include<cstddef>
#define SWIGPYTHON
#define SWIG_PYTHON_DIRECTOR_NO_VTABLE
剩下的应该都很好解决了
然后安装一个mininet以模拟有openflow交换机的网络