Upgrade to Pro — share decks privately, control downloads, hide ads and more …

SDN Training Day2

SDN Training Day2

SDN Training Day2

John Lin (Che-Wei Lin)

July 31, 2015
Tweet

More Decks by John Lin (Che-Wei Lin)

Other Decks in Technology

Transcript

  1. 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
  2. 實驗拓墣 Internet . . . . . . . .

    . . . . SDN Switch host Control plane Data plane host host SDN Switch SDN Switch SDN Switch Legacy Switch
  3. 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 ?
  4. 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
  5. 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
  6. 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
  7. 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
  8. 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.
  9. 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 !
  10. 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.
  11. 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
  12. Mininet Commands ✤ Display links: ✤ Dump information about all

    nodes: ✤ Do all-pairs ping: ✤ Exit the CLI :
  13. Changing Topology Size and Type ✤ You can create different

    topo with --topo • one switch and four hosts:
  14. Changing Topology Size and Type ✤ a linear topology (where

    each switch has one host, and all switches connect in a line)
  15. More Detail Network Setting ✤ Set bandwidth and delay of

    all links : ✤ Create your custom topology ✤ Remote controller
  16. How to make a Network Topologys ✤ Use “sudo python

    <file>” to execute a testing script
  17. ✤ To use remote controller: • from mininet.node import RemoteController

    • net.addController( <controller name>, controller=RemoteController, ip=<controller 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
  18. ✤ get nodes by name (Line 39): • net.get('h1', 'h2')

    ✤ “pingall” test (Line 37): • net.pingAll() How to make a Network Topology
  19. 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/
  20. Q&A