PoxMininet2.0的安裝和初級使用SDNAP原創SDN聯合播報_第1頁
PoxMininet2.0的安裝和初級使用SDNAP原創SDN聯合播報_第2頁
PoxMininet2.0的安裝和初級使用SDNAP原創SDN聯合播報_第3頁
PoxMininet2.0的安裝和初級使用SDNAP原創SDN聯合播報_第4頁
PoxMininet2.0的安裝和初級使用SDNAP原創SDN聯合播報_第5頁
已閱讀5頁,還剩7頁未讀 繼續免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

Pox+Mininet2.0 的安裝和初級使用 SDNAP原創 SDN聯合播報系統:DistributorID:UbuntuDescription: Release: 12.04Codename: precise硬件: 單臺PCMininet2.0、OpenvSwitch 的安裝最簡單也是最常用的使用方法是下載打包好了的Mininet/UbuntuVM(/mininet/mininet/downloads/)。這個VM包括了Mininet,所有的openflow相關的文件和預裝的軟件,也可以調整內核配置來支持更大的 Mininet網絡。上述的VM直接可以拿來用,但是要用像 VirtualBox 的軟件來使用,這里就不贅述。接下來,按照我們的環境來搭建測試組網正式開始。首先進行源更新及安裝、升級: apt-getupdate ,apt-getupgrade。如果是初安裝完的系統可能會更新較慢,建議將源更新設定到比較近、網絡好的服務器,或者自己搭的服務器。如果升級過Ubuntu系統或者使用的Mininet是舊版(1.0),需要把之前的Mininet和OpenVswitch從/usr/local/中刪除。sudorm-rf/usr/local/bin/mn/usr/local/bin/mnexec\/usr/local/lib/python*/*/*mininet*\/usr/local/bin/ovs-*/usr/local/sbin/ovs-*下一步,安裝基礎的 Mininet包sudoapt-getinstallmininet/precise-backports這里需要安裝的軟件及庫文件在

90M

左右,包括了

mininet

,openvswitch-common ,openvswitch-controller ,openvswitch-datapath-dkms ,openvswitch-pki ,openvswitch-switch ,python2.7 等。root@10-6-2-133:/home/ubuntu#mn –versionMininet安裝完畢,下面簡單測試下root@10-6-2-133:/home/ubuntu#sudomn –testpingallCreatingnetworkAddingcontrollerAddinghosts:h1h2Addingswitches:Jul1413:45:44|00001|stream_unix|ERR|/tmp/stream-unix.17367.0:connectionto/var/run/openvswitch/db.sockfailed:NosuchfileordirectoryJul1413:45:44|00002|reconnect|WARN|unix:/var/run/openvswitch/db.sock:connectionattemptfailed(Nosuchfileordirectory)Jul1413:45:45|00003|stream_unix|ERR|/tmp/stream-unix.17367.1:connectionto/var/run/openvswitch/db.sockfailed:NosuchfileordirectoryJul1413:45:45|00004|reconnect|WARN|unix:/var/run/openvswitch/db.sock:connectionattemptfailed(Nosuchfileordirectory)ovs-vsctlexitedwithcode-14Errorconnectingtoovs-dbwithovs-vsctlMakesurethatOpenvSwitchisinstalled,thatovsdb-serverisrunning,andthat“ovs-vsctlshow”workscorrectly.Youmaywishtotry”serviceopenvswitch-switchstart”.從提示發現,Mininet需要開啟service:openvswitch-switchroot@10-6-2-133:/home/ubuntu#serviceopenvswitch-switchstartFATAL:Moduleopenvswitchnotfound.*InsertingopenvswitchmoduleModulehasprobablynotbeenbuiltforthiskernel.Installtheopenvswitch-datapath-sourcepackage,thenread/usr/share/doc/openvswitch-datapath-source/README.DebianFATAL:Moduleopenvswitchnotfound.*Insertingopenvswitchmodule模塊openvswitch 插入失敗,此模塊沒有編譯。在安裝Mininet

基礎安裝包的時候安裝了

openvswitch

的相關包,唯獨

openvswitch-datapath-source

沒有安裝,所以接下來安裝之。root@10-6-2-133:/home/ubuntu#module-assistantauto-installopenvswitch-datapathPs:若無module-assistant ,apt-getinstallmodule-assistant編譯模塊后再次嘗試啟動服務:root@10-6-2-133:/home/ubuntu#serviceopenvswitch-switchrestartovs-brcompatdisnotrunningKillingovs-vswitchd(30133)Killingovsdb-server(30124)Startingovsdb-serverConfiguringOpenvSwitchsystemIDsStartingovs-vswitchdiptablesalreadyhasaruleforgre,notexplicitlyenablingroot@10-6-2-133:/home/ubuntu#serviceopenvswitch-controllerrestartRestartingovs-controllerovs-controller下面查看ovs的各項運行狀態root@10-6-2-133:/home/ubuntu#ps-ea|grepovs30201pts/0 00:00:00ovsdb-server30202? 00:00:00ovsdb-server30210pts/0 00:00:00ovs-vswitchd30211? 00:00:00ovs-vswitchd一切準備就緒,那就測試 Mininet是否可用啦root@10-6-2-133:/home/ubuntu#sudomn –testpingallCreatingnetworkAddingcontrollerAddinghosts:h1h2Addingswitches:s1Addinglinks:(h1,s1)(h2,s1)Configuringhostsh1h2StartingcontrollerStarting1switchess1Ping:testingpingreachabilityh1->h2h2->h1Results:0%dropped(0/2lost)Stopping2hostsh1h2Stopping1switchess1?Stopping1controllersc0Donecompletedin0.423seconds到此,Mininet和OpenvSwitch 安裝完畢。已經成功了一半了,哈哈!Pox的初級使用Pox是Nox的年輕點的同胞兄弟。核心意義在于,利用python的強大,提供了快速開發的平臺和網絡原型的控制軟件。聽著晦澀,其實就是python輕巧、便捷,開發起來舒服。相對上面稍微復雜的安裝,Pox的安裝就簡單多了,就叫綠色版的controller吧。相對其他的controller(Nox,Floodlight等),Pox集成的東西也簡單多了,所以才需要二次開發嘛。root@10-6-2-133:/home/ubuntu#gitclone/noxrepo/pox.gitCloninginto ’pox’?remote:Countingobjects:12980,done.remote:Compressingobjects:100%(5820/5820),done.remote:Total12980(delta7488),reused12582(delta7113)Receivingobjects:100%(12980/12980),5.90MiB|22KiB/s,done.Resolvingdeltas:100%(7488/7488),done.Ps:git—-n.飯桶,無用的人,其實是GnuInteractiveTools的縮寫,哈哈。先來體驗下 pox吧root@10-6-2-133:/home/ubuntu/pox#./pox.pyopenflow.of_01 –etal.pox.py

是程序的入口,需要

openflow.of_01

庫解釋后面的參數。Pox

默認開啟

6633

端口監聽,也可以在

address

后面指定

port

。root@10-6-2-133:/home/ubuntu/pox#./pox.pyopenflow.of_01 – –port=6666etal.也可以運行組件,組件就是要用到的 app。root@10-6-2-133:/home/ubuntu/pox#./pox.pyopenflow.of_01––ThisprogramcomeswithABSOLUTELYNOWARRANTY.Thisprogramisfreesoftware,andyouarewelcometoredistributeitundercertainconditions.Type’help(pox.license) ’fordetails.Ready.POX>會有POX>輸入提示,在這里可以編輯 MSG或者調用組件的接口接下來將Mininet,Pox聯合使用,打開三個terminal,一個運行Pox,一個Mininet。Mininet和Pox的運行先后無關,因為Mininet始終在連接指定的controllerip。Mininet建立的topo為switch–h1,連接到本地 controller的6666端口|h2root@10-6-2-133:/home/ubuntu#mn–CreatingnetworkAddingcontrollerAddinghosts:h1h2Addingswitches:s1Addinglinks:(h1,s1)(h2,s1)Configuringhostsh1h2StartingcontrollerStarting1switchess1StartingCLI:mininet>mininet>dumpPox運行

l2_pairs

組件,該組件可以抽取

packet

——in

中的dst_mac

src_mac

,根據源和目的端口下發

flowentry

到switch

,即工作在交換機模式。root@10-6-2-133:/home/ubuntu/pox#./pox.pyopenflow.of_01 – –port=6666etal.INFO:forwarding.l2_pairs:Pair-Learningswitchrunning.INFO:openflow.of_01:[00-00-00-00-00-011]connectedPox上提示INFO:openflow.of_01:[00-00-00-00-00-011]connected 有switch連接上,key為1。現在查看switch上的flowentry,沒有flowentrymininet>dpctldump-flows***s1————————————————————————現在讓h1pingh2,觸發flowentry 的下發,有兩條flowentry,并且h1可以ping通h2mininet>h1pingh2— —3pack

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論