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

Basic ONOS Tutorial

Eueung Mulyana
February 18, 2018

Basic ONOS Tutorial

Basic ONOS (Open Network Operating System) Tutorial, based on the official wiki page https://wiki.onosproject.org/display/ONOS/Basic+ONOS+Tutorial

Eueung Mulyana

February 18, 2018
Tweet

More Decks by Eueung Mulyana

Other Decks in Technology

Transcript

  1. 3 / 35 Getting Started Import VM + Start Setup

    ONOS Cluster ONOS CLI ONOS GUI Spine Leaf Topology Ref:[Basic ONOS Tutorial]
  2. 13 / 35 Check CLI + Mininet onos> apps -a

    -s + 23 org.onosproject.optical-model 1.12.0 Optical Network Model + 27 org.onosproject.openflow-base 1.12.0 OpenFlow Base Provider + 28 org.onosproject.lldpprovider 1.12.0 LLDP Link Provider + 30 org.onosproject.hostprovider 1.12.0 Host Location Provider + 35 org.onosproject.drivers 1.12.0 Default Drivers + 83 org.onosproject.openflow 1.12.0 OpenFlow Provider Suite + 252 org.onosproject.proxyarp 1.12.0 Proxy ARP/NDP mininet> h11 ping -c3 h41 PING 10.0.0.16 (10.0.0.16) 56(84) bytes of data. --- 10.0.0.16 ping statistics --- 3 packets transmitted, 0 received, 100% packet loss, time 2014ms
  3. 14 / 35 FWD App CLI + Mininet onos> app

    activate fwd Activated org.onosproject.fwd onos> apps -a -s + 23 org.onosproject.optical-model 1.12.0 Optical Network Model + 27 org.onosproject.openflow-base 1.12.0 OpenFlow Base Provider + 28 org.onosproject.lldpprovider 1.12.0 LLDP Link Provider + 30 org.onosproject.hostprovider 1.12.0 Host Location Provider + 35 org.onosproject.drivers 1.12.0 Default Drivers + 83 org.onosproject.openflow 1.12.0 OpenFlow Provider Suite + 252 org.onosproject.proxyarp 1.12.0 Proxy ARP/NDP + 260 org.onosproject.fwd 1.12.0 Reactive Forwarding mininet> h11 ping -c3 h41 PING 10.0.0.16 (10.0.0.16) 56(84) bytes of data. 64 bytes from 10.0.0.16: icmp_seq=1 ttl=64 time=64.1 ms 64 bytes from 10.0.0.16: icmp_seq=2 ttl=64 time=0.748 ms 64 bytes from 10.0.0.16: icmp_seq=3 ttl=64 time=0.105 ms --- 10.0.0.16 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2002ms rtt min/avg/max/mdev = 0.105/21.677/64.180/30.055 ms
  4. onos> app deactivate fwd Deactivated org.onosproject.fwd onos> apps -a -s

    + 23 org.onosproject.optical-model 1.12.0 Optical Network Model + 27 org.onosproject.openflow-base 1.12.0 OpenFlow Base Provider + 28 org.onosproject.lldpprovider 1.12.0 LLDP Link Provider + 30 org.onosproject.hostprovider 1.12.0 Host Location Provider + 35 org.onosproject.drivers 1.12.0 Default Drivers + 83 org.onosproject.openflow 1.12.0 OpenFlow Provider Suite + 252 org.onosproject.proxyarp 1.12.0 Proxy ARP/NDP onos> help onos COMMANDS onos:add-host-intent Installs host-to-host connectivity int onos:add-multi-to-single-intent Installs connectivity intent between m onos:add-optical-intent Installs optical connectivity intent onos:add-point-intent Installs point-to-point connectivity i onos:add-protected-transport Adds ProtectedTransportIntent onos:add-single-to-multi-intent Installs connectivity intent between a onos:add-test-flows Installs a number of test flow rules - onos:add-vnet-intent Installs virtual network connectivity onos:allocations Lists allocated resources onos:annotate-device Annotates network model entities onos:annotate-link Annotates network model entities onos:annotate-port Annotates port entities onos:app Manages application inventory onos:app-ids Lists application ID information onos:apps Lists application information onos:balance-masters Forces device mastership rebalancing onos:cfg Manages component configuration onos:cluster-devices Lists devices of the specified topolog onos:cluster-links Lists links of the specified topology onos:clusters Lists all clusters in the current topo onos:config-link Configure link. onos:config-link-discovery Adds configuration to disable LLDP lin onos:counter Displays the current value of a atomic onos:counters Lists information about atomic counter onos:cycle-intents Installs random intents to test throug onos:device-add-interface Configures a device interface onos:device-configuration [Deprecated]Gets the configuration of onos:device-controllers gets the list of controllers for the g onos:device-interfaces Lists all interfaces or interfaces of 15 / 35 ONOS CLI Commands
  5. onos> devices id=of:0000000000000001, available=true, local-status=connected 34m3s ago, role=MASTER, type=SW id=of:0000000000000002,

    available=true, local-status=connected 34m3s ago, role=STANDBY, type=S id=of:000000000000000b, available=true, local-status=connected 34m3s ago, role=MASTER, type=SW id=of:000000000000000c, available=true, local-status=connected 34m3s ago, role=STANDBY, type=S id=of:000000000000000d, available=true, local-status=connected 34m3s ago, role=STANDBY, type=S id=of:000000000000000e, available=true, local-status=connected 34m3s ago, role=STANDBY, type=S onos> links src=of:0000000000000001/1, dst=of:000000000000000b/1, type=DIRECT, state=ACTIVE, expected=fals src=of:0000000000000001/2, dst=of:000000000000000c/1, type=DIRECT, state=ACTIVE, expected=fals src=of:0000000000000001/3, dst=of:000000000000000d/1, type=DIRECT, state=ACTIVE, expected=fals src=of:0000000000000001/4, dst=of:000000000000000e/1, type=DIRECT, state=ACTIVE, expected=fals src=of:0000000000000002/1, dst=of:000000000000000b/2, type=DIRECT, state=ACTIVE, expected=fals src=of:0000000000000002/2, dst=of:000000000000000c/2, type=DIRECT, state=ACTIVE, expected=fals src=of:0000000000000002/3, dst=of:000000000000000d/2, type=DIRECT, state=ACTIVE, expected=fals src=of:0000000000000002/4, dst=of:000000000000000e/2, type=DIRECT, state=ACTIVE, expected=fals src=of:000000000000000b/1, dst=of:0000000000000001/1, type=DIRECT, state=ACTIVE, expected=fals src=of:000000000000000b/2, dst=of:0000000000000002/1, type=DIRECT, state=ACTIVE, expected=fals src=of:000000000000000c/1, dst=of:0000000000000001/2, type=DIRECT, state=ACTIVE, expected=fals src=of:000000000000000c/2, dst=of:0000000000000002/2, type=DIRECT, state=ACTIVE, expected=fals src=of:000000000000000d/1, dst=of:0000000000000001/3, type=DIRECT, state=ACTIVE, expected=fals src=of:000000000000000d/2, dst=of:0000000000000002/3, type=DIRECT, state=ACTIVE, expected=fals src=of:000000000000000e/1, dst=of:0000000000000001/4, type=DIRECT, state=ACTIVE, expected=fals src=of:000000000000000e/2, dst=of:0000000000000002/4, type=DIRECT, state=ACTIVE, expected=fals onos> hosts id=00:00:00:00:00:01/None, mac=00:00:00:00:00:01, locations=[of:000000000000000b/3], vlan=None id=00:00:00:00:00:02/None, mac=00:00:00:00:00:02, locations=[of:000000000000000b/4], vlan=None id=00:00:00:00:00:03/None, mac=00:00:00:00:00:03, locations=[of:000000000000000b/5], vlan=None id=00:00:00:00:00:04/None, mac=00:00:00:00:00:04, locations=[of:000000000000000b/6], vlan=None id=00:00:00:00:00:05/None, mac=00:00:00:00:00:05, locations=[of:000000000000000b/7], vlan=None id=00:00:00:00:00:06/None, mac=00:00:00:00:00:06, locations=[of:000000000000000c/3], vlan=None id=00:00:00:00:00:07/None, mac=00:00:00:00:00:07, locations=[of:000000000000000c/4], vlan=None id=00:00:00:00:00:08/None, mac=00:00:00:00:00:08, locations=[of:000000000000000c/5], vlan=None id=00:00:00:00:00:09/None, mac=00:00:00:00:00:09, locations=[of:000000000000000c/6], vlan=None id=00:00:00:00:00:0A/None, mac=00:00:00:00:00:0A, locations=[of:000000000000000c/7], vlan=None id=00:00:00:00:00:0B/None, mac=00:00:00:00:00:0B, locations=[of:000000000000000d/3], vlan=None id=00:00:00:00:00:0C/None, mac=00:00:00:00:00:0C, locations=[of:000000000000000d/4], vlan=None id=00:00:00:00:00:0D/None, mac=00:00:00:00:00:0D, locations=[of:000000000000000d/5], vlan=None id=00:00:00:00:00:0E/None, mac=00:00:00:00:00:0E, locations=[of:000000000000000d/6], vlan=None id 00 00 00 00 00 0F/N 00 00 00 00 00 0F l ti [ f 000000000000000d/7] l N 16 / 35 ONOS CLI Commands
  6. onos> flows deviceId=of:0000000000000001, flowRuleCount=3 id=100007a585b6f, state=ADDED, bytes=220077, packets=2717, duration=2102, liveType=UNKNOWN

    id=100009465555a, state=ADDED, bytes=220077, packets=2717, duration=2103, liveType=UNKNOWN id=10000ea6f4b8e, state=ADDED, bytes=0, packets=0, duration=2102, liveType=UNKNOWN, priori deviceId=of:0000000000000002, flowRuleCount=3 id=1000002bbd8d4, state=ADDED, bytes=220239, packets=2719, duration=2103, liveType=UNKNOWN id=10000c70edd85, state=ADDED, bytes=126, packets=3, duration=2103, liveType=UNKNOWN, prio id=10000dc56d70b, state=ADDED, bytes=220239, packets=2719, duration=2103, liveType=UNKNOWN deviceId=of:000000000000000b, flowRuleCount=3 id=10000494083df, state=ADDED, bytes=109917, packets=1357, duration=2103, liveType=UNKNOWN id=100005f2b175b, state=ADDED, bytes=109917, packets=1357, duration=2103, liveType=UNKNOWN id=10000648d5a4f, state=ADDED, bytes=294, packets=7, duration=2103, liveType=UNKNOWN, prio deviceId=of:000000000000000c, flowRuleCount=3 id=1000026a0ffae, state=ADDED, bytes=109917, packets=1357, duration=2103, liveType=UNKNOWN id=1000096b12177, state=ADDED, bytes=252, packets=6, duration=2098, liveType=UNKNOWN, prio id=10000f5cb6cad, state=ADDED, bytes=109674, packets=1354, duration=2098, liveType=UNKNOWN deviceId=of:000000000000000d, flowRuleCount=3 id=1000061e06af9, state=ADDED, bytes=252, packets=6, duration=2103, liveType=UNKNOWN, prio id=10000b4f580c9, state=ADDED, bytes=109674, packets=1354, duration=2098, liveType=UNKNOWN id=10000c023e2a3, state=ADDED, bytes=109917, packets=1357, duration=2103, liveType=UNKNOWN deviceId=of:000000000000000e, flowRuleCount=3 id=100001eb71f99, state=ADDED, bytes=109836, packets=1356, duration=2103, liveType=UNKNOWN id=100002145004b, state=ADDED, bytes=252, packets=6, duration=2098, liveType=UNKNOWN, prio id=10000cc389fc9, state=ADDED, bytes=109836, packets=1356, duration=2103, liveType=UNKNOWN onos> paths of:000000000000000 <TAB> of:0000000000000001 of:0000000000000002 of:000000000000000b of:000000000000000c of:000000000000000d of:000000000000000e onos> paths of:000000000000000e of:000000000000000 <TAB> of:0000000000000001 of:0000000000000002 of:000000000000000b of:000000000000000c of:000000000000000d of:000000000000000e onos> paths of:000000000000000e of:000000000000000b of:000000000000000e/2-of:0000000000000002/4==>of:0000000000000002/1-of:000000000000000b/2; cos of:000000000000000e/1-of:0000000000000001/4==>of:0000000000000001/1-of:000000000000000b/1; cos 17 / 35 ONOS CLI Commands
  7. onos> add-host-intent 00:00:00:00:00:01/None 00:00:00:00:00:10/None Host to Host intent submitted: HostToHostIntent{id=0x0,

    key=0x0, appId=DefaultApplicationId{id=2, name=org.onosproject.cli}, onos> intents Id: 0x0 State: INSTALLED Key: 0x0 Intent type: HostToHostIntent Application Id: org.onosproject.cli Resources: [00:00:00:00:00:01/None, 00:00:00:00:00:10/None] Treatment: [NOACTION] Constraints: [LinkTypeConstraint{inclusive=false, types=[OPTICAL]}] Source host: 00:00:00:00:00:01/None Destination host: 00:00:00:00:00:10/None onos> intents -i Id: 0x0 State: INSTALLED Key: 0x0 Intent type: HostToHostIntent Application Id: org.onosproject.cli Resources: [00:00:00:00:00:01/None, 00:00:00:00:00:10/None] Treatment: [NOACTION] Constraints: [LinkTypeConstraint{inclusive=false, types=[OPTICAL]}] Source host: 00:00:00:00:00:01/None Destination host: 00:00:00:00:00:10/None Installable: [FlowRuleIntent{id=0x100002, key=0x0, appId=DefaultApplicationId{id=72, name=org. 18 / 35 Intents
  8. mininet> h11 ping -c3 h41 PING 10.0.0.16 (10.0.0.16) 56(84) bytes

    of data. 64 bytes from 10.0.0.16: icmp_seq=1 ttl=64 time=0.786 ms 64 bytes from 10.0.0.16: icmp_seq=2 ttl=64 time=0.126 ms 64 bytes from 10.0.0.16: icmp_seq=3 ttl=64 time=0.158 ms --- 10.0.0.16 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 1998ms rtt min/avg/max/mdev = 0.126/0.356/0.786/0.304 ms mininet> h11 ping -c3 h42 PING 10.0.0.17 (10.0.0.17) 56(84) bytes of data. --- 10.0.0.17 ping statistics --- 3 packets transmitted, 0 received, 100% packet loss, time 2008ms onos> flows -s deviceId=of:0000000000000001, flowRuleCount=3 ADDED, bytes=300591, packets=3711, table=0, priority=40000, selector=[ETH_TYPE:bddp], trea ADDED, bytes=300591, packets=3711, table=0, priority=40000, selector=[ETH_TYPE:lldp], trea ADDED, bytes=0, packets=0, table=0, priority=40000, selector=[ETH_TYPE:arp], treatment=[im deviceId=of:0000000000000002, flowRuleCount=5 ADDED, bytes=300753, packets=3713, table=0, priority=40000, selector=[ETH_TYPE:lldp], trea ADDED, bytes=126, packets=3, table=0, priority=40000, selector=[ETH_TYPE:arp], treatment=[ ADDED, bytes=300753, packets=3713, table=0, priority=40000, selector=[ETH_TYPE:bddp], trea ADDED, bytes=294, packets=3, table=0, priority=100, selector=[IN_PORT:1, ETH_DST:00:00:00: ADDED, bytes=294, packets=3, table=0, priority=100, selector=[IN_PORT:4, ETH_DST:00:00:00: deviceId=of:000000000000000b, flowRuleCount=5 ADDED, bytes=150255, packets=1855, table=0, priority=40000, selector=[ETH_TYPE:bddp], trea ADDED, bytes=150255, packets=1855, table=0, priority=40000, selector=[ETH_TYPE:lldp], trea ADDED, bytes=378, packets=9, table=0, priority=40000, selector=[ETH_TYPE:arp], treatment=[ ADDED, bytes=294, packets=3, table=0, priority=100, selector=[IN_PORT:2, ETH_DST:00:00:00: ADDED, bytes=294, packets=3, table=0, priority=100, selector=[IN_PORT:3, ETH_DST:00:00:00: deviceId=of:000000000000000c, flowRuleCount=3 ADDED, bytes=150174, packets=1854, table=0, priority=40000, selector=[ETH_TYPE:bddp], trea ADDED, bytes=252, packets=6, table=0, priority=40000, selector=[ETH_TYPE:arp], treatment=[ ADDED, bytes=150174, packets=1854, table=0, priority=40000, selector=[ETH_TYPE:lldp], trea deviceId=of:000000000000000d, flowRuleCount=3 ADDED, bytes=252, packets=6, table=0, priority=40000, selector=[ETH_TYPE:arp], treatment=[ ADDED, bytes=150174, packets=1854, table=0, priority=40000, selector=[ETH_TYPE:bddp], trea ADDED, bytes=150174, packets=1854, table=0, priority=40000, selector=[ETH_TYPE:lldp], trea deviceId=of:000000000000000e flowRuleCount=5 19 / 35 Intents
  9. mininet> link s2 s11 down onos> flows -s deviceId=of:0000000000000001, flowRuleCount=5

    ADDED, bytes=393903, packets=4863, table=0, priority=40000, selector=[ETH_TYPE:bddp], trea ADDED, bytes=393903, packets=4863, table=0, priority=40000, selector=[ETH_TYPE:lldp], trea ADDED, bytes=0, packets=0, table=0, priority=40000, selector=[ETH_TYPE:arp], treatment=[im ADDED, bytes=0, packets=0, table=0, priority=100, selector=[IN_PORT:1, ETH_DST:00:00:00:00 ADDED, bytes=0, packets=0, table=0, priority=100, selector=[IN_PORT:4, ETH_DST:00:00:00:00 deviceId=of:0000000000000002, flowRuleCount=3 ADDED, bytes=388476, packets=4796, table=0, priority=40000, selector=[ETH_TYPE:lldp], trea ADDED, bytes=126, packets=3, table=0, priority=40000, selector=[ETH_TYPE:arp], treatment=[ ADDED, bytes=388476, packets=4796, table=0, priority=40000, selector=[ETH_TYPE:bddp], trea deviceId=of:000000000000000b, flowRuleCount=5 ADDED, bytes=191079, packets=2359, table=0, priority=40000, selector=[ETH_TYPE:bddp], trea ADDED, bytes=191079, packets=2359, table=0, priority=40000, selector=[ETH_TYPE:lldp], trea ADDED, bytes=378, packets=9, table=0, priority=40000, selector=[ETH_TYPE:arp], treatment=[ ADDED, bytes=294, packets=3, table=0, priority=100, selector=[IN_PORT:3, ETH_DST:00:00:00: ADDED, bytes=0, packets=0, table=0, priority=100, selector=[IN_PORT:1, ETH_DST:00:00:00:00 deviceId=of:000000000000000c, flowRuleCount=3 ADDED, bytes=196911, packets=2431, table=0, priority=40000, selector=[ETH_TYPE:bddp], trea ADDED, bytes=252, packets=6, table=0, priority=40000, selector=[ETH_TYPE:arp], treatment=[ ADDED, bytes=196911, packets=2431, table=0, priority=40000, selector=[ETH_TYPE:lldp], trea deviceId=of:000000000000000d, flowRuleCount=3 ADDED, bytes=252, packets=6, table=0, priority=40000, selector=[ETH_TYPE:arp], treatment=[ ADDED, bytes=196911, packets=2431, table=0, priority=40000, selector=[ETH_TYPE:bddp], trea ADDED, bytes=196911, packets=2431, table=0, priority=40000, selector=[ETH_TYPE:lldp], trea deviceId=of:000000000000000e, flowRuleCount=5 ADDED, bytes=196911, packets=2431, table=0, priority=40000, selector=[ETH_TYPE:lldp], trea ADDED, bytes=294, packets=7, table=0, priority=40000, selector=[ETH_TYPE:arp], treatment=[ ADDED, bytes=196911, packets=2431, table=0, priority=40000, selector=[ETH_TYPE:bddp], trea ADDED, bytes=0, packets=0, table=0, priority=100, selector=[IN_PORT:1, ETH_DST:00:00:00:00 ADDED, bytes=294, packets=3, table=0, priority=100, selector=[IN_PORT:3, ETH_DST:00:00:00: 22 / 35 Intents
  10. 26 / 35 Test Intents via Web UI mininet> py

    h14.IP() 10.0.0.4 mininet> py h22.IP() 10.0.0.7 mininet> h14 ping -c3 h22 PING 10.0.0.7 (10.0.0.7) 56(84) bytes of data. 64 bytes from 10.0.0.7: icmp_seq=1 ttl=64 time=65.2 ms 64 bytes from 10.0.0.7: icmp_seq=2 ttl=64 time=0.085 ms 64 bytes from 10.0.0.7: icmp_seq=3 ttl=64 time=0.107 ms mininet> h11 ping -c3 h41
  11. 27 / 35 Show All Tra c mininet> bgIperf h11

    h41 h11 <--> h41 Press ^Z to continue in background or ^C to abort .......... h11 <--> h41: 20.70 Gbps
  12. 29 / 35 Node Failures onos> shutdown Confirm: halt instance

    root (yes/no): yes onos> Connection to 172.17.0.2 closed by remote host.
  13. 31 / 35 Mastership Re-balancing # via CLI onos> balance-masters

    # or automatically via MLB app onos> apps -s -a + 23 org.onosproject.optical-model 1.12.0 Optical Network Model + 27 org.onosproject.openflow-base 1.12.0 OpenFlow Base Provider + 28 org.onosproject.lldpprovider 1.12.0 LLDP Link Provider + 30 org.onosproject.hostprovider 1.12.0 Host Location Provider + 35 org.onosproject.drivers 1.12.0 Default Drivers + 83 org.onosproject.openflow 1.12.0 OpenFlow Provider Suite + 252 org.onosproject.proxyarp 1.12.0 Proxy ARP/NDP onos> app activate mlb Activated org.onosproject.mlb onos> apps -s -a + 23 org.onosproject.optical-model 1.12.0 Optical Network Model + 27 org.onosproject.openflow-base 1.12.0 OpenFlow Base Provider + 28 org.onosproject.lldpprovider 1.12.0 LLDP Link Provider + 30 org.onosproject.hostprovider 1.12.0 Host Location Provider + 35 org.onosproject.drivers 1.12.0 Default Drivers + 83 org.onosproject.openflow 1.12.0 OpenFlow Provider Suite + 252 org.onosproject.proxyarp 1.12.0 Proxy ARP/NDP + 284 org.onosproject.mlb 1.12.0 Mastership Load Balancer
  14. # shared folders sdn@onos-tutorial:~$ sudo adduser sdn vboxsf # static

    IP sdn@onos-tutorial:~$ cat /etc/network/interfaces # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). source /etc/network/interfaces.d/* # The loopback network interface auto lo iface lo inet loopback # The primary network interface auto enp0s3 iface enp0s3 inet dhcp # The secondary network interface auto enp0s8 iface enp0s8 inet static address 192.168.56.70 netmask 255.255.255.0 network 192.168.56.0 broadcast 192.168.56.255 gatewawy 192.168.56.1 dns-nameservers 8.8.8.8 8.8.4.4 #iface enp0s8 inet dhcp 32 / 35 Some Notes