[Linux][Network] Ryuをインストールする

技術のお話し

OpenFlowコントローラで、NTTが開発している「Ryu」のインストールだけやった。備忘録ということで。実際SDNとかは6年ぐらい前に言葉だけは聞いていながら、その適用についてはさっぱりわからず。

先日出席したOSCでもLagopus Switchはソフトウェア実装のOpenFlowスイッチだったり、一体それで何が出来るんだ?と言うのがよく分かってなかったりするので、その勉強のために取り敢えず入れてみたわけですが・・・色々Tipsをその度見るのも面倒なので、ここにまとめときました。

前提パッケージのインストール

# yum install -y python-setuptools python-devel python-crypto \
> python-simplejson autoconf python-pip python-devel gcc gcc-c++ \
> libxml2-devel libxslt-devel

pipのインストール

# easy_install pip

pipを通じた前提パッケージのインストール

# pip install simplejson paramiko PyYAML Jinja2 httplib2 awscli greenlet

ryuのインストール

# pip install ryu

動作確認

# ryu --version
Traceback (most recent call last):
 File "/usr/bin/ryu", line 5, in <module>
 from pkg_resources import load_entry_point
 File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 3011, in <module>
 parse_requirements(__requires__), Environment()
 File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 630, in resolve
 raise VersionConflict(dist,req) # XXX put more info here
pkg_resources.VersionConflict: (netaddr 0.7.5 (/usr/lib/python2.7/site-packages), Requirement.parse('netaddr>=0.7.18'))

あら、うまく行ってない。調べてみるとこんな記事があった。

https://github.com/Ehsan70/RyuApps/blob/master/Errors.md

これに基づき以下コマンドを実行

# pip install -U netaddr six pbr

その上で

# ryu --version
ryu 4.19

各種サンプル

[root@OpenFlow ~]# cd /usr/lib/python2.7/site-packages/ryu/app
[root@OpenFlow app]# ls -al
合計 712
drwxr-xr-x 4 root root 4096 11月 4 22:40 .
drwxr-xr-x 12 root root 4096 11月 4 22:40 ..
-rw-r--r-- 1 root root 0 5月 9 15:36 __init__.py
-rw-r--r-- 1 root root 139 11月 4 22:40 __init__.pyc
-rw-r--r-- 1 root root 3647 5月 9 15:36 bmpstation.py
-rw-r--r-- 1 root root 3088 11月 4 22:40 bmpstation.pyc
-rw-r--r-- 1 root root 1787 5月 9 15:36 cbench.py
-rw-r--r-- 1 root root 1763 11月 4 22:40 cbench.pyc
-rw-r--r-- 1 root root 817 5月 9 15:36 conf_switch_key.py
-rw-r--r-- 1 root root 230 11月 4 22:40 conf_switch_key.pyc
-rw-r--r-- 1 root root 3903 5月 9 15:36 example_switch_13.py
-rw-r--r-- 1 root root 3106 11月 4 22:40 example_switch_13.pyc
drwxr-xr-x 3 root root 99 11月 4 22:40 gui_topology
drwxr-xr-x 2 root root 4096 11月 4 22:40 ofctl
-rw-r--r-- 1 root root 27324 5月 9 15:36 ofctl_rest.py
-rw-r--r-- 1 root root 19306 11月 4 22:40 ofctl_rest.pyc
-rw-r--r-- 1 root root 5936 5月 9 15:36 rest_conf_switch.py
-rw-r--r-- 1 root root 6893 11月 4 22:40 rest_conf_switch.pyc
-rw-r--r-- 1 root root 38647 5月 9 15:36 rest_firewall.py
-rw-r--r-- 1 root root 30982 11月 4 22:40 rest_firewall.pyc
-rw-r--r-- 1 root root 40143 8月 30 05:42 rest_qos.py
-rw-r--r-- 1 root root 32310 11月 4 22:40 rest_qos.pyc
-rw-r--r-- 1 root root 70965 5月 9 15:36 rest_router.py
-rw-r--r-- 1 root root 61392 11月 4 22:40 rest_router.pyc
-rw-r--r-- 1 root root 3967 5月 9 15:36 rest_topology.py
-rw-r--r-- 1 root root 4450 11月 4 22:40 rest_topology.pyc
-rw-r--r-- 1 root root 55673 5月 9 15:36 rest_vtep.py
-rw-r--r-- 1 root root 52893 11月 4 22:40 rest_vtep.pyc
-rw-r--r-- 1 root root 4027 5月 9 15:36 simple_monitor_13.py
-rw-r--r-- 1 root root 4163 11月 4 22:40 simple_monitor_13.pyc
-rw-r--r-- 1 root root 3755 5月 9 15:36 simple_switch.py
-rw-r--r-- 1 root root 3590 11月 4 22:40 simple_switch.pyc
-rw-r--r-- 1 root root 3294 5月 9 15:36 simple_switch_12.py
-rw-r--r-- 1 root root 3029 11月 4 22:40 simple_switch_12.pyc
-rw-r--r-- 1 root root 4742 5月 9 15:36 simple_switch_13.py
-rw-r--r-- 1 root root 3545 11月 4 22:40 simple_switch_13.pyc
-rw-r--r-- 1 root root 3916 5月 9 15:36 simple_switch_14.py
-rw-r--r-- 1 root root 3266 11月 4 22:40 simple_switch_14.pyc
-rw-r--r-- 1 root root 3889 5月 9 15:36 simple_switch_igmp.py
-rw-r--r-- 1 root root 3418 11月 4 22:40 simple_switch_igmp.pyc
-rw-r--r-- 1 root root 3350 5月 9 15:36 simple_switch_igmp_13.py
-rw-r--r-- 1 root root 3285 11月 4 22:40 simple_switch_igmp_13.pyc
-rw-r--r-- 1 root root 4328 5月 9 15:36 simple_switch_lacp.py
-rw-r--r-- 1 root root 3875 11月 4 22:40 simple_switch_lacp.pyc
-rw-r--r-- 1 root root 3877 5月 9 15:36 simple_switch_lacp_13.py
-rw-r--r-- 1 root root 3679 11月 4 22:40 simple_switch_lacp_13.pyc
-rw-r--r-- 1 root root 4265 5月 9 15:36 simple_switch_rest_13.py
-rw-r--r-- 1 root root 4298 11月 4 22:40 simple_switch_rest_13.pyc
-rw-r--r-- 1 root root 4954 5月 9 15:36 simple_switch_snort.py
-rw-r--r-- 1 root root 4379 11月 4 22:40 simple_switch_snort.pyc
-rw-r--r-- 1 root root 4979 5月 9 15:36 simple_switch_stp.py
-rw-r--r-- 1 root root 4389 11月 4 22:40 simple_switch_stp.pyc
-rw-r--r-- 1 root root 4591 5月 9 15:36 simple_switch_stp_13.py
-rw-r--r-- 1 root root 4428 11月 4 22:40 simple_switch_stp_13.pyc
-rw-r--r-- 1 root root 3793 5月 9 15:36 simple_switch_websocket_13.py
-rw-r--r-- 1 root root 4326 11月 4 22:40 simple_switch_websocket_13.pyc
-rw-r--r-- 1 root root 4384 5月 9 15:36 ws_topology.py
-rw-r--r-- 1 root root 5205 11月 4 22:40 ws_topology.pyc
-rw-r--r-- 1 root root 10137 5月 9 15:36 wsgi.py
-rw-r--r-- 1 root root 14023 11月 4 22:40 wsgi.pyc

これを最初は用いて、色々挙動とか試してみるといいらしいっす。で、これに接続するためにMininetなるものを導入しようとしているのですが、どうもCentOSでは苦労しそうなようなので、おとなしくUbuntuで構築してみようかなと思っています。

Tags:

Comments are closed

PAGE TOP