SDN模擬器ONOS Install Guide


ONOS Install Guide

Date:2018-03-06                                  Author:BurlyLuo
Mail:olaf.luo@foxmail.com                        recommend browser :Firefox
What is ONOS?
ONOS stands for Open Network Operating System. ONOS provides the control plane for a software-defined network (SDN), managing network components, such as switches and links, and running software programs or modules to provide communication services to end hosts and neighboring networks.

    If you are familiar with server operating systems, you will find that ONOS provides some analogous types of functionality, including APIs and abstractions, resource allocation, and permissions, as well as user-facing software such as a CLI, a GUI, and system applications.
    If you are familiar with traditional "inside the box" switch operating systems, you will find that ONOS manages your entire network rather than a single device, which can dramatically simplify management, configuration, and deployment of new software, hardware and services.
    If you are familiar with SDN controllers, you should feel right at home because the ONOS platform and applications act as an extensible, modular, distributed SDN controller.

<From ONOS wiki:https://wiki.onosproject.org/>

 

 

為了在本地獲得一個快捷的ONOS環境,我們可以采用官網封裝好的virtualbox 虛擬鏡像來快速部署ONOS環境

http://onlab.vicci.org/onos/vm/onos-tutorial-1.0.0r161-ovf.zip

下邊開始安裝步驟的介紹:

1.下載當前版本的VirtualBox安裝包。鏈接:http://sw.bos.baidu.com/sw-search-sp/software/6bda11b7d3256/VirtualBox-5.1.30.18389-Win.exe
//推薦使用VirtualBox,因為相比於VMWare來說,一是:免費,二是:相對對物理機的資源消耗更少。
2.下載ONOS官網封裝好的ONOS zip包。鏈接:http://onlab.vicci.org/onos/vm/onos-tutorial-1.0.0r161-ovf.zip
//下載完成的zip文件解壓開來以后可以看到如下文件:onos-tutorial-1.0.0.ovfonos-tutorial-1.0.0.vmdk //注意核實//
3.在VirtualBox中導入ONOS包onos-tutorial-1.0.0.ovf。
主要步驟截圖:
First Step:

  2:瀏覽文件onos-tutorial-1.0.0.ovf進入VirtualBox。如下圖:

   [首次安裝請保持所有選項默認]

點擊導入即可。

導入完成以后:

登錄虛擬機內的 Guest OS 帳號和密碼如下:
USERNAME:tutorial1
PASSWORD:tutorial1

打開以后界面如下:

打開以后雙擊快捷方式ONOS和Mininet來迅速啟動一個SDN的控制器ONOS和Mininet[An Instant Virtual Network on your Laptop (or other PC)]

本實驗所有的聯系都是使用相同的網絡拓撲 ( 如下圖所示 ) 。網絡中有 6 台交換機, 4 台外邊的交換機上連接了 6 台主機,這 4 台交換機又連接到中間互連
的 2 台交換機上。

打開ONOS的Gui之前還得做一個動作,來激活ONOS-GUI的feature:

在ONOS的CLI中安裝ONOS-GUI的feature。

ONOS>feature:install onos-gui

//這時候查看8181端口處於LISTEN狀態。//

雙擊桌面ONOS GUI快捷方式即可進入ONOS的圖形化界面。

關於Mininet添加交換機和host過程如下:

//

*** Creating network
*** Adding controller
*** Adding hosts:
h11 h12 h13 h14 h15 h16 h21 h22 h23 h24 h25 h26 h31 h32 h33 h34 h35 h36 h41 h42 h43 h44 h45 h46
*** Adding switches:
s1 s2 s11 s12 s13 s14
*** Adding links:
(h11, s11) (h12, s11) (h13, s11) (h14, s11) (h15, s11) (h16, s11) (h21, s12) (h22, s12) (h23, s12) (h24, s12) (h25, s12) (h26, s12) (h31, s13) (h32, s13) (h33, s13) (h34, s13) (h35, s13) (h36, s13) (h41, s14) (h42, s14) (h43, s14) (h44, s14) (h45, s14) (h46, s14) (s1, s2) (s11, s1) (s11, s2) (s12, s1) (s12, s2) (s13, s1) (s13, s2) (s14, s1) (s14, s2)
*** Configuring hosts
h11 h12 h13 h14 h15 h16 h21 h22 h23 h24 h25 h26 h31 h32 h33 h34 h35 h36 h41 h42 h43 h44 h45 h46
*** Starting controller
c0
*** Starting 6 switches
s1 s2 s11 s12 s13 s14
*** Starting CLI:
mininet>

//

mininet> nodes
available nodes are:
c0 h11 h12 h13 h14 h15 h16 h21 h22 h23 h24 h25 h26 h31 h32 h33 h34 h35 h36 h41 h42 h43 h44 h45 h46 s1 s11 s12 s13 s14 s2
mininet> net
h11 h11-eth0:s11-eth3
h12 h12-eth0:s11-eth4
h13 h13-eth0:s11-eth5
h14 h14-eth0:s11-eth6
h15 h15-eth0:s11-eth7
h16 h16-eth0:s11-eth8
h21 h21-eth0:s12-eth3
h22 h22-eth0:s12-eth4
h23 h23-eth0:s12-eth5
h24 h24-eth0:s12-eth6
h25 h25-eth0:s12-eth7
h26 h26-eth0:s12-eth8
h31 h31-eth0:s13-eth3
h32 h32-eth0:s13-eth4
h33 h33-eth0:s13-eth5
h34 h34-eth0:s13-eth6
h35 h35-eth0:s13-eth7
h36 h36-eth0:s13-eth8
h41 h41-eth0:s14-eth3
h42 h42-eth0:s14-eth4
h43 h43-eth0:s14-eth5
h44 h44-eth0:s14-eth6
h45 h45-eth0:s14-eth7
h46 h46-eth0:s14-eth8
s1 lo:  s1-eth1:s2-eth1 s1-eth2:s11-eth1 s1-eth3:s12-eth1 s1-eth4:s13-eth1 s1-eth5:s14-eth1
s2 lo:  s2-eth1:s1-eth1 s2-eth2:s11-eth2 s2-eth3:s12-eth2 s2-eth4:s13-eth2 s2-eth5:s14-eth2
s11 lo:  s11-eth1:s1-eth2 s11-eth2:s2-eth2 s11-eth3:h11-eth0 s11-eth4:h12-eth0 s11-eth5:h13-eth0 s11-eth6:h14-eth0 s11-eth7:h15-eth0 s11-eth8:h16-eth0
s12 lo:  s12-eth1:s1-eth3 s12-eth2:s2-eth3 s12-eth3:h21-eth0 s12-eth4:h22-eth0 s12-eth5:h23-eth0 s12-eth6:h24-eth0 s12-eth7:h25-eth0 s12-eth8:h26-eth0
s13 lo:  s13-eth1:s1-eth4 s13-eth2:s2-eth4 s13-eth3:h31-eth0 s13-eth4:h32-eth0 s13-eth5:h33-eth0 s13-eth6:h34-eth0 s13-eth7:h35-eth0 s13-eth8:h36-eth0
s14 lo:  s14-eth1:s1-eth5 s14-eth2:s2-eth5 s14-eth3:h41-eth0 s14-eth4:h42-eth0 s14-eth5:h43-eth0 s14-eth6:h44-eth0 s14-eth7:h45-eth0 s14-eth8:h46-eth0
c0
mininet> links
h11-eth0<->s11-eth3 (OK OK)
h12-eth0<->s11-eth4 (OK OK)
h13-eth0<->s11-eth5 (OK OK)
h14-eth0<->s11-eth6 (OK OK)
h15-eth0<->s11-eth7 (OK OK)
h16-eth0<->s11-eth8 (OK OK)
h21-eth0<->s12-eth3 (OK OK)
h22-eth0<->s12-eth4 (OK OK)
h23-eth0<->s12-eth5 (OK OK)
h24-eth0<->s12-eth6 (OK OK)
h25-eth0<->s12-eth7 (OK OK)
h26-eth0<->s12-eth8 (OK OK)
h31-eth0<->s13-eth3 (OK OK)
h32-eth0<->s13-eth4 (OK OK)
h33-eth0<->s13-eth5 (OK OK)
h34-eth0<->s13-eth6 (OK OK)
h35-eth0<->s13-eth7 (OK OK)
h36-eth0<->s13-eth8 (OK OK)
h41-eth0<->s14-eth3 (OK OK)
h42-eth0<->s14-eth4 (OK OK)
h43-eth0<->s14-eth5 (OK OK)
h44-eth0<->s14-eth6 (OK OK)
h45-eth0<->s14-eth7 (OK OK)
h46-eth0<->s14-eth8 (OK OK)
s1-eth1<->s2-eth1 (OK OK)
s11-eth1<->s1-eth2 (OK OK)
s11-eth2<->s2-eth2 (OK OK)
s12-eth1<->s1-eth3 (OK OK)
s12-eth2<->s2-eth3 (OK OK)
s13-eth1<->s1-eth4 (OK OK)
s13-eth2<->s2-eth4 (OK OK)
s14-eth1<->s1-eth5 (OK OK)
s14-eth2<->s2-eth5 (OK OK)
mininet>

 

4.實現不同host之間的互訪,還得激活一個ONOS的feature  Reactive Forwarding
在未激活該feature時候,做ping測試,發現:
mininet> h11 ping -c3 h41
PING 10.0.0.19 (10.0.0.19) 56(84) bytes of data.
From 10.0.0.1 icmp_seq=1 Destination Host Unreachable
From 10.0.0.1 icmp_seq=2 Destination Host Unreachable
From 10.0.0.1 icmp_seq=3 Destination Host Unreachable
--- 10.0.0.19 ping statistics ---
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2009ms
//同一網段的不同host之間竟然不通。//
"Reactive Forwarding" 是一個非常簡單的 SDN 應用程序,它為每一個被送到控制器的數據包安裝流表。但是此應用默認沒有被加載。使用如下命令查看已經被加載的應用程序列表:
這里順便看一下剛才就好的ONOS—GUI的feature:
onos> list | grep onos-gui
158 | Active |  80 | 1.0.0            | onos-gui                              
onos>
//激活Forwarding 的feature//
ONOS>feature:install onos-app-fwd
查看是否激活的該feature:
onos> list | grep fwd
152 | Active |  80 | 1.0.0            | onos-app-fwd            //已經激活該feature//               
onos>
此時在Mininet中做ping測試:
mininet> h11 ping h12
PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
64 bytes from 10.0.0.2: icmp_seq=1 ttl=64 time=10.2 ms
64 bytes from 10.0.0.2: icmp_seq=2 ttl=64 time=2.06 ms
^C
--- 10.0.0.2 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 2.069/6.183/10.297/4.114 ms
mininet>
//此時ping通//
此時做所有主機之間互ping測試:pingall
結果如下:
mininet> pingall
*** Ping: testing ping reachability
h11 -> h12 h13 h14 h15 h16 h21 h22 h23 h24 h25 h26 h31 h32 h33 h34 h35 h36 h41 h42 h43 h44 h45 h46
h12 -> h11 h13 h14 h15 h16 h21 h22 h23 h24 h25 h26 h31 h32 h33 h34 h35 h36 h41 h42 h43 h44 h45 h46
h13 -> h11 h12 h14 h15 h16 h21 h22 h23 h24 h25 h26 h31 h32 h33 h34 h35 h36 h41 h42 h43 h44 h45 h46
h14 -> h11 h12 h13 h15 h16 h21 h22 h23 h24 h25 h26 h31 h32 h33 h34 h35 h36 h41 h42 h43 h44 h45 h46
h15 -> h11 h12 h13 h14 h16 h21 h22 h23 h24 h25 h26 h31 h32 h33 h34 h35 h36 h41 h42 h43 h44 h45 h46
h16 -> h11 h12 h13 h14 h15 h21 h22 h23 h24 h25 h26 h31 h32 h33 h34 h35 h36 h41 h42 h43 h44 h45 h46
h21 -> h11 h12 h13 h14 h15 h16 h22 h23 h24 h25 h26 h31 h32 h33 h34 h35 h36 h41 h42 h43 h44 h45 h46
h22 -> h11 h12 h13 h14 h15 h16 h21 h23 h24 h25 h26 h31 h32 h33 h34 h35 h36 h41 h42 h43 h44 h45 h46
h23 -> h11 h12 h13 h14 h15 h16 h21 h22 h24 h25 h26 h31 h32 h33 h34 h35 h36 h41 h42 h43 h44 h45 h46
h24 -> h11 h12 h13 h14 h15 h16 h21 h22 h23 h25 h26 h31 h32 h33 h34 h35 h36 h41 h42 h43 h44 h45 h46
h25 -> h11 h12 h13 h14 h15 h16 h21 h22 h23 h24 h26 h31 h32 h33 h34 h35 h36 h41 h42 h43 h44 h45 h46
h26 -> h11 h12 h13 h14 h15 h16 h21 h22 h23 h24 h25 h31 h32 h33 h34 h35 h36 h41 h42 h43 h44 h45 h46
h31 -> h11 h12 h13 h14 h15 h16 h21 h22 h23 h24 h25 h26 h32 h33 h34 h35 h36 h41 h42 h43 h44 h45 h46
h32 -> h11 h12 h13 h14 h15 h16 h21 h22 h23 h24 h25 h26 h31 h33 h34 h35 h36 h41 h42 h43 h44 h45 h46
h33 -> h11 h12 h13 h14 h15 h16 h21 h22 h23 h24 h25 h26 h31 h32 h34 h35 h36 h41 h42 h43 h44 h45 h46
h34 -> h11 h12 h13 h14 h15 h16 h21 h22 h23 h24 h25 h26 h31 h32 h33 h35 h36 h41 h42 h43 h44 h45 h46
h35 -> h11 h12 h13 h14 h15 h16 h21 h22 h23 h24 h25 h26 h31 h32 h33 h34 h36 h41 h42 h43 h44 h45 h46
h36 -> h11 h12 h13 h14 h15 h16 h21 h22 h23 h24 h25 h26 h31 h32 h33 h34 h35 h41 h42 h43 h44 h45 h46
h41 -> h11 h12 h13 h14 h15 h16 h21 h22 h23 h24 h25 h26 h31 h32 h33 h34 h35 h36 h42 h43 h44 h45 h46
h42 -> h11 h12 h13 h14 h15 h16 h21 h22 h23 h24 h25 h26 h31 h32 h33 h34 h35 h36 h41 h43 h44 h45 h46
h43 -> h11 h12 h13 h14 h15 h16 h21 h22 h23 h24 h25 h26 h31 h32 h33 h34 h35 h36 h41 h42 h44 h45 h46
h44 -> h11 h12 h13 h14 h15 h16 h21 h22 h23 h24 h25 h26 h31 h32 h33 h34 h35 h36 h41 h42 h43 h45 h46
h45 -> h11 h12 h13 h14 h15 h16 h21 h22 h23 h24 h25 h26 h31 h32 h33 h34 h35 h36 h41 h42 h43 h44 h46
h46 -> h11 h12 h13 h14 h15 h16 h21 h22 h23 h24 h25 h26 h31 h32 h33 h34 h35 h36 h41 h42 h43 h44 h45
*** Results: 0% dropped (552/552 received)
5.該方式安裝的ONOS本身集成了wireshark工具,如果需要使用到抓包分析的話,可以直接使用,非常方便。
順便提一下,該封裝的虛機默認使用的是NAT模式的網絡,如果對VirtualBox的幾種網絡類型熟悉的話,可以自己更改虛擬網卡的連接方式來實現一些便捷的功能。比如筆者在使用該方式安裝的時候就把網絡更改為橋接方式,[對於新手不建議做此操作]
更多操作請訪問:https://wiki.onosproject.org/display/ONOS/Application+tutorial
wireshak user guide:https://www.wireshark.org/docs/wsug_html_chunked/index.html

wireshark抓包附例。

注意:在虛機中使用wireshark要特別的注意,當抓包結束以后,別忘了stop抓包,否則可能會出現內存被沾滿而系統崩潰。

 

6.如有疑問可郵件聯系。
######################################################################## #Date:2018-03-08 Author:BurlyLuo# #Mail:olaf.luo@foxmail.com Version:v1.0 # ########################################################################
非商業用途轉載無需作者授權,但務必在文章標題下面注明作者 羅偉(Burly Luo)以及可點擊的本博客地址超級鏈接 http://www.cnblogs.com/BurlyLuo/,謝謝合作.

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM