作業鏈結
ryu的拓撲展示
助教部落格:基於ryu restful api實現的vlan網路虛擬化
實驗環境:
實驗拓撲:
使用ryu的rest api下發流表實現和第2次實驗同樣的vlan:
#交換機s1的指令碼:
#交換機s1接收從1號埠傳送來的資料報,從4號埠將其**給s2
curl -x post -d ',
"actions":[,,
]}'
#交換機s1接收從2號埠傳送來的資料報,從4號埠將其**給s2
curl -x post -d ',
"actions":[,,
]}'
#交換機s1接收從3號埠傳送來的資料報,從4號埠將其**給s2
curl -x post -d ',
"actions":[,,
]}'
#交換機s1將收到的資料報根據其對應的vlan_tag從埠1**
#交換機s1將收到的資料報根據其對應的vlan_tag從埠2**
#交換機s1將收到的資料報根據其對應的vlan_tag從埠3**
#交換機s2的指令碼:
#交換機s2接收從1號埠傳送來的資料報,從4號埠將其**給s1
curl -x post -d ',
"actions":[,,
]}'
#交換機s2接收從2號埠傳送來的資料報,從4號埠將其**給s1
curl -x post -d ',
"actions":[,,
]}'
#交換機s2接收從3號埠傳送來的資料報,從4號埠將其**給s1
curl -x post -d ',
"actions":[,,
]}'
#交換機s2將收到的資料報根據其對應的vlan_tag從埠1**
##交換機s2將收到的資料報根據其對應的vlan_tag從埠2**
#交換機s2將收到的資料報根據其對應的vlan_tag從埠3**
從主機之間連通性的測試結果中可以看出,我們得到了和第2次實驗同樣的vlan。
(3)對比兩種方法,寫出你的實驗體會:
相比於使用ryu的rest api下發流表和直接在open vswitch下發流表這兩種方法,使用ryu的rest api下發流表會更簡單一些,直接編寫然後執行乙個shell指令碼,就能按照需求自動配置好所有的裝置,比open vswitch一一配置更容易修改,也更容易理解和實現。
實驗中先在win 10系統中的editplus中編寫指令碼,再轉入linux執行,因為格式問題導致一直報錯導致執行不了,下次應該直接再linux的gedit中編寫,這樣能避免不必要的錯誤。
2019 SDN上機第6次作業
from mininet.topo import topo class mytopo topo def init self topo.init self s for i in range 2 sw self.addswitch s format i 1 self.addlink s 0 s 1 co...
2019 SDN上機第6次作業
實驗拓撲圖如下 搭建 如下 建立py檔案,並編寫py 如下 from mininet.topo import topo from mininet.net import mininet from mininet.node import remotecontroller,cpulimitedhost f...
2019 SDN上機第6次作業
如下 埠號1發來資料 curl x post d actions 埠號2發來資料 curl x post d actions 埠號3發來資料 curl x post d actions 向埠1 向埠2 向埠3 s2 埠號1發來資料 curl x post d actions 埠號2發來資料 curl...