SDN Lab 02 助教:林賢哲 林佳瑩 sdn@imslab.org 2015.11.05
Outline l Highlight l Prologue l Environment introduction l Lab 2-1 create a simple SDN network l Questions part 1 l Lab 2-2 OpenFlow13 vs Legacy Switch l Questions part 2
Highlight
Highlight 熟悉 Estinet 的操作 觀察 SDN 與傳統網路之異同
Prologue Read or Die!!!!
Prologue How to use Estinet on my PC? Several ways to get image which has Estinet with license key Computers @ 65304(windows) - go to C:\Users\User\Documents\Virtual Machine\Fedora - compress the fedora folder and save to your USB TA s USB Download link: https://drive.google.com/open?id=0b0ucp82m_32pcdizqwrmlw1imvk Putting files in the path of your VMware Notes: If you can t find the path of VMware, you can create another useless vm first to make VMware create path.
Prologue Choose I moved it when you open VMware for the first time If you choose it wrong accidently, Estinet can t be executed. Please tell TAs to solve the problem.
Prologue ChooseEstinet Kernel when booting up Fedora (3.11.10.estinet20150430.fc20) 20 (Heisenbug)
Prologue Account Estinet Password Estinet Root_password sdn2015
Prologue Wireshark openflow plugin You need to install this plugin to get openflow packets in wireshark. Download link : https://drive.google.com/file/d/0b0ucp82m_32pt0o1wmlregvac0u/view?usp=sh aring Moveopenflow.soto /usr/lib64/wireshark/plugins/1.10.14 You can use the command below # cp {path of openflow.so} /usr/lib64/wireshark/plugins/1.10.14/
Environment introduction Estinet 9.0
Environment introduction Estinet 9.0 VMware Workstation Player https://my.vmware.com/web/vmware/free Fedora 20 fedora archive link
Environment introduction Execute Estinet Step 4: 視窗一指令 [root@localhost ~]# dispatcher Step 5: 視窗二指令 [root@localhost ~]# coordinator Notes : You can use command # dispatcher_coordinator_estinetgui to execute them together Step 6: 視窗三指令 [root@localhost ~]# estinetgui 13
Environment introduction Steps of simulation 14
Environment introduction [D] 模式 : 繪製拓撲 (Draw Topology) 15
Environment introduction [E] 模式 : 編輯屬性 (Edit Property) 模擬時傳送端的指令 1 2 3 模擬時傳送端的指令 : Start time 1 (sec) Stop time 10 (sec) Command: ttcp -t -s -p 8000 1.0.1.2 16
Environment introduction 模擬時接收端的指令 1 2 3 模擬時接收端的指令 : Start time 1 (sec) Stop time 10 (sec) Command: ttcp -r -s -p 8000 17
Environment introduction 為什麼模擬器內預設應用程式的起始時間是 1 秒鐘? 真實世界的應用程式並不預期作業系統的時間會少於 1 秒鐘 ( 如 Java,OpenDaylight 控制器等 ) 在模擬器內執行這類型的應用程式, 並設定啟動時間小於 1 秒, 將會發生不正常的行為 18
Environment introduction Node Editor 位置 雙擊 Node Host 視窗 Node Editor 滑鼠右鍵點擊 Node Node Editor 19
Environment introduction [R] 模式 : 執行模擬 (Run Simulation) 切換 [R] 模式時詢問訊息 3 1 模擬程式啟動執行 2 若跳出此 warning, 請開啟 Terminal, 輸入 # systemctl stop firewalld.service 來關閉防火牆 20
Environment introduction [P] 模式 : 結果播放 (Play Back) 21
Environment introduction 播放工具控制選項 Frame-rate Control Time Scroll Bar Control Panel Time LCD Time Granularity Control Playing-speed Control 22
Environment introduction 封包箭頭的意義 Link 的顏色 無封包在此 link 中傳送有封包在此 link 中傳送 箭頭大小 長度 : 依據封包長度 傳輸 bandwidth 及 link delay 顯示傳送失敗符號 :X 箭頭顏色 23
Environment introduction 箭頭顏色 有線網路 IPsrc = NodeA or IPdst = NodeB, 該 link 顯示為藍色, 否則為紅色 無線網路 根據封包種類的不同, 其箭頭顏色 箭頭旁的文字各不相同 (80211a DATA) 24
Lab 2-1 create a simple SDN network
Lab 2-1 create a simple SDN network Controller : Ryu OpenFlow : 1.3 Installation and Setup Check the slides last week. No need to worry. Already done for you. 26
Lab 2-1 create a simple SDN network [D] 模式 : 控制面 (Control Plane) OpenFlow Controller OpenFlow Controller Switch OpenFlow 1.3 Switch 27
Lab 2-1 create a simple SDN network 自動連接到 Controller Switch 28
Lab 2-1 create a simple SDN network 連接 Controller 29
Lab 2-1 create a simple SDN network [D] 模式 : 資料面 (Data Plane) 部署 Host Node 5~8 30
Lab 2-1 create a simple SDN network 連接 Host 到 OpenFlow 1.3 Switch 31
Lab 2-1 create a simple SDN network [E] 模式 :G_Setting->Simulation 設定模擬時間及模擬速度 of course you can set different time other than 200 secs 32
Lab 2-1 create a simple SDN network [E] 模式 : 設定節點資訊 1 2 3 33
Lab 2-1 create a simple SDN network 4 Copy to all modules on all nodes with the same type 5 34
Node 1./ryu-manager ofctl_rest.py simple_switch_13.py Start Time: 1 sec Stop Time: 200 sec Command:./ryu-manager ofctl_rest.py simple_switch_13.py 35
Node Node 5 8 Start Time: 1 sec Stop Time: 200 sec Command: ttcp -t -u -s -p 8000 1.0.2.4 Start Time: 1 sec Stop Time: 200 sec Command: ttcp -r -u -s -p 8000 -w node8.log 36
Lab 2-1 create a simple SDN network Tcpdump(add on the nodes you want to monitor) tcpdump -U -i eth1 -w controller.log Start Time: 1 sec Stop Time: 200 sec Command: tcpdump -U -i eth1 -w controller.log Notes: number of eth is the same as the port ID The parameter of w means filename of log
Lab 2-1 create a simple SDN network Tcpdump After simulation, you can usethe command belowin terminal # wireshark {path to the log file}
Lab 2-1 create a simple SDN network [R] 模式 : 執行模擬 : Simulation Run 模擬中進入 OFSwitch_V13 模組 1 2 39
Lab 2-1 create a simple SDN network Openanother Terminal Use curl at run time to get switches ID # curl http://1.0.1.1:8080/stats/switches 1.0.1.1 is your controller s IP Use curl at run time to add flow For example, forward packets from port 2 to port 4 (check the slides last week) # curl -X POST -d '{"dpid": "3", "cookie":1, "priority":"0", "match":{"in_port":2}, "actions":[{"type":"output", "port":4}]}' http://1.0.1.1:8080/stats/flowentry/add
Lab 2-1 create a simple SDN network [R] 模式 :Run Simulation 期間, 查看 switches 的 Flow Table 4 3 41
Lab 2-1 create a simple SDN network [P] 模式 : 模擬結果 42
Questions Part 1
Questions part 1 觀察 flow table 從沒有 flow 到有 flow ( 截圖 ) (20pt) 用 wireshark 分析 log 檔, 解釋在 ryu 上有無執行 simple_switch_13.py 的差異 ( 說明為主, 截圖為輔 ) (30pt) Flow Packets
Lab 2-2 OpenFlow13 vs Legacy Switch
Lab 2-2 OpenFlow13 vs Legacy Switch [D] 模式 : 繪製網路拓撲 OpenFlow Controller OpenFlow Controller Switch OpenFlow 1.3 Switch Switch 46
Lab 2-2 OpenFlow13 vs Legacy Switch [E] 模式 : 設定模擬時間 47
Lab 2-2 OpenFlow13 vs Legacy Switch [E] 模式 :SDN 網路拓撲設定 設定 Node3 ~ Node12 中的 OFSwitch_V13 模組 Controller IP 為 Node1 的 IP 48
Node 1 Nox 1.3 控制器的啟動指令 Start Time: 1 sec Stop Time: 50 sec Command: nox_core -i ptcp: switch Notes: You can use nox or ryu as you like. 49
Node Node 13 24 Start Time: 1 sec Stop Time: 50 sec Command: ttcp -t -s -p 8000 1.0.2.12 Start Time: 1 sec Stop Time: 50 sec Command: ttcp -r -s -p 8000 -w node24.log 50
Node Node 17 20 Start Time: 1 sec Stop Time: 50 sec Command: ttcp -t -s -p 8002 1.0.2.8 Start Time: 1 sec Stop Time: 50 sec Command: ttcp -r -u -s -p 8002 -w node20.log 51
Node Node 35 46 Start Time: 1 sec Stop Time: 50 sec Command: ttcp -t -s -p 8001 1.0.3.12 Start Time: 1 sec Stop Time: 50 sec Command: ttcp -r -s -p 8001 -w node46.log 52
Node Node 39 42 Start Time: 1 sec Stop Time: 50 sec Command: ttcp -t -s -p 8003 1.0.3.8 Start Time: 1 sec Stop Time: 50 sec Command: ttcp -r -s -p 8003 -w node42.log 53
Lab 2-2 OpenFlow13 vs Legacy Switch [R] 模式 : Simulation Run [P] 模式 : 傳統交換器 : 執行 Learning Bridge Protocol, 將 ARP 要求 Flood 給整個網路, 直到透過 Node46 及 Node42 的 ARP 回覆才知道收端的位置 SDN 網路 : 先由 OpenFlow 控制器收集整體網路的資訊, 在傳統網路找到目的地的同時,SDN 架構中的控制器仍在蒐集網路資訊 54
Lab 2-2 OpenFlow13 vs Legacy Switch 送端送出 ARP Request 封包 55
Lab 2-2 OpenFlow13 vs Legacy Switch 傳統交換器網路將 ARP 要求 Flood 給整個網路 56
Lab 2-2 OpenFlow13 vs Legacy Switch 收端 Node42 ARP 回覆 57
Lab 2-2 OpenFlow13 vs Legacy Switch 收端 Node46 ARP 回覆 58
Lab 2-2 OpenFlow13 vs Legacy Switch 控制器蒐集網路資訊 59
Lab 2-2 OpenFlow13 vs Legacy Switch SDN 開始通訊 60
Questions Part 2
Grading Please describe the difference of the packets behaviors between SDN and traditional network. Tag some snapshot to promote your points. (50pt)
Reference EstiNet 網路模擬實驗與應用 作者 : 王協源, 陳永昇, 柯志亨, 思銳科技追蹤作者 新功能介紹 出版社 : 旗標