Slide 1

Slide 1 text

《SDN交換機平台模擬與實務 Day 2》7/24, 7/31

Slide 2

Slide 2 text

SDN Tutorial TAs ✤ 現場有三位助教會協助各位操作 • 林哲緯 • 吳昇蓉 • 李紀萱 • 李哲銓 ✤ 簡報檔下載:

Slide 3

Slide 3 text

Outline ✤ SDN Implementations • LAB1 Developing a hub application (Review) • LAB2 Developing a learning switch application • LAB3 Developing a learning switch with ACLs application ✤ Network Topology Emulator • Overview of Mininet • Basic Mininet Commands • How to make a Network Topology

Slide 4

Slide 4 text

實驗拓墣 Internet . . . . . . . . . . . . SDN Switch host Control plane Data plane host host SDN Switch SDN Switch SDN Switch Legacy Switch

Slide 5

Slide 5 text

Hub Application Review (1/2) h1 ping 8.8.8.8 1.packet 2. OF:packet-in 3. OF:packet-out 4.packet 4.packet Internet Legacy Switch ✤ LAB 1 : Hub ✤ 接上兩台host至switch ✤ ⼀一台ping 8.8.8.8 ✤ 利⽤用另⼀一台host,開啟wireshark,觀察到有收到其封包 ✤ 使⽤用 ping 的 echo time 約1000~2000ms ✤ How does it work ?

Slide 6

Slide 6 text

HubApplication Review (2/2) ✤ LAB 1 : Hub (adding flow) ✤ 接上兩台host至switch ✤ ⼀一台ping 8.8.8.8 ✤ 利⽤用另⼀一台host,開啟wireshark,觀察到有收到其封包 ✤ 使⽤用 ping 的 echo time ⼤大幅減少至 10~20ms ✤ How does it work ? h1 ping 8.8.8.8 1.packet 2. OF:Add flow 3.packet 3.packet Internet Legacy Switch

Slide 7

Slide 7 text

Switch Application 實驗結果 ✤ LAB 2 : Learning switch ✤ 如Part 1 ✤ 利⽤用另⼀一台host,開啟wireshark,觀察到可上網但收不到其封包 ✤ How does it work ? h1 ping h2 1.ARP request 2. OF:packet-in 3. OF:packet-out 4.ARP request 4.ARP request h1 ping h2 8.ARP reply 7. OF:packet-out 5.ARP reply Controller s1:port1->host1 Controller s1:port1->host1 s1:port2->host2 6. OF:packet-in 9. OF:flow-mod s1 Flow Table dst:mac_h1 out:1 dst:mac_h2 out:2

Slide 8

Slide 8 text

Switch with ACLs Application 實驗結果 ✤ LAB 3 : Learning switch with ACLs ✤ 接上⼀一台host至 Switch ✤ 可使⽤用 ping, ssh, FTP 或其他網路協定,但無法使⽤用 HTTP ✤ How does it work ? ✤ 延續Lab2之結果,利⽤用flow-mod⽅方式加入對應之flow ✤ match field 設定為 HTTP 對應的 port number (80) OF:flow-mod

Slide 9

Slide 9 text

Outline ✤ SDN Implementations • LAB1 Developing a hub application (Review) • LAB2 Developing a learning switch application • LAB3 Developing a learning switch with ACLs application ✤ Network Topology Emulator • Overview of Mininet • Basic Mininet Commands • How to make a Network Topology

Slide 10

Slide 10 text

Mininet ✤ Mininet is a network emulator which can create a network of ✤ Virtual hosts ✤ Switches ✤ Controllers ✤ Links
 on a single machine (VM, cloud or native) ✤ Inside this virtual network, each OpenFlow switch is emulated by an Open vSwitch program.

Slide 11

Slide 11 text

Mininet ✤ Mininet hosts run standard Linux network software, and its switches support OpenFlow for highly flexible custom routing. ✤ Mininet is under a permissive BSD Open Source license – we can implement any idea to achieve our goal !

Slide 12

Slide 12 text

Mininet ✤ You can control the virtual network using the Mininet Command- Line Interface (and API). ✤ Inside this virtual network, each OpenFlow switch is emulated by an Open Vswitch program. ✤ Inside this virtual network, each host is emulated by a container (like a VM). ✤ You can execute a real program like ping on a emulate host.

Slide 13

Slide 13 text

Commands

Slide 14

Slide 14 text

Create a minimal topology ✤ Enter the Linux command to create network ✤ Enter the Mininet command to check network : • Display Mininet CLI commands: • Display nodes: $"sudo"mn mininet>'help mininet>'nodes

Slide 15

Slide 15 text

Mininet Commands ✤ Display links: ✤ Dump information about all nodes: ✤ Do all-pairs ping: ✤ Exit the CLI :

Slide 16

Slide 16 text

Changing Topology Size and Type ✤ You can create different topo with --topo • one switch and four hosts:

Slide 17

Slide 17 text

Changing Topology Size and Type ✤ a linear topology (where each switch has one host, and all switches connect in a line)

Slide 18

Slide 18 text

Changing Topology Size and Type ✤ a simple tree topology

Slide 19

Slide 19 text

More Detail Network Setting ✤ Set bandwidth and delay of all links : ✤ Create your custom topology ✤ Remote controller

Slide 20

Slide 20 text

Custom topology --topo-2sw-2host

Slide 21

Slide 21 text

How to make a Network Topologys ✤ Use “sudo python <file>” to execute a testing script

Slide 22

Slide 22 text

✤ To use remote controller: • from mininet.node import RemoteController • net.addController( , controller=RemoteController, ip= ) ✤ Create a mininet object (Line 32): • net = Mininet( topo=topo, link=TCLink ) ✤ Start mininet (Line 33): • net.start() ✤ Stop mininet (Line 41): • net.stop() How to make a Network Topology

Slide 23

Slide 23 text

✤ get nodes by name (Line 39): • net.get('h1', 'h2') ✤ “pingall” test (Line 37): • net.pingAll() How to make a Network Topology

Slide 24

Slide 24 text

About SDNDS-TW ✤ 台灣 SDN 開發者社群: http://sdnds.tw/ ✤ Slack: https://sdnds-tw.slack.com/ or 
 IRC #sdnds-tw on Freenode ✤ 索取Slack頻道邀請函: https://sdnds-tw.herokuapp.com/ ✤ Google group: http://group.sdnds.tw/ ✤ Hackpad: https://sdnds-tw.hackpad.com/

Slide 25

Slide 25 text

Q&A