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

ONOS Developer Workshop at ONS - Thomas Vachuska

ONOS Developer Workshop at ONS - Thomas Vachuska

ONOS Project

June 15, 2015
Tweet

More Decks by ONOS Project

Other Decks in Technology

Transcript

  1. Developer Workshop Sessions • ONOS Fundamentals ◦ architecture, checking out,

    building & running ONOS • ONOS Distributed Core ◦ OSGi, anatomy of a core subsystem, distributed stores & primitives • ONOS App Development ◦ background, Maven archetypes, app deployment on ONOS cluster • ONOS Interfaces ◦ component config service, flow objective service, intent service ◦ CLI, REST and GUI overview • Wrap-up
  2. ONOS Fundamentals 8:30-10:00 • ONOS Overview (~30) ◦ tenets, architecture,

    tiers, subsystems ◦ general subsystem structure • Getting started with ONOS (~30) ◦ check-out code, environment customization and build ◦ describe Maven, hierarchical POM structure ◦ run ONOS locally on developer machine ◦ CLI & GUI demo with a simple mininet topology (torus,8,8,2) • Code organization (~30) ◦ importing ONOS source into IDE (demo with IntelliJ) ◦ core (api, net, stores), web (gui, rest), providers (openflow, netconf)
  3. Architectural Tenets • High-availability, scalability and performance ◦ required to

    sustain demands of service provider & enterprise networks • Strong abstractions and simplicity ◦ required for development of apps and solutions • Protocol and device behaviour independence ◦ avoid contouring and deformation due to protocol specifics • Separation of concerns and modularity ◦ allow tailoring and customization without speciating the code-base
  4. ONOS Distributed Architecture NB Core API Distributed Core (state management,

    notifications, high-availability & scale-out) SB Core API Protocols Providers Protocols Providers Protocols Providers Protocols Providers Apps Apps
  5. ONOS Distributed Architecture NB Core API Distributed Core (state management,

    notifications, high-availability & scale-out) SB Core API Protocols Providers Protocols Providers Protocols Providers Protocols Providers Apps Apps Distributed Core (state management, notifications, high-availability & scale-out) SB Core API NB Core API Providers Providers Providers Providers Protocols Protocols Protocols Protocols
  6. ONOS Core Subsystems Device Link Host Topology Flow Rule Path

    Packet Statistics Intent Application Leadership Messaging Storage Region Mastership Driver Group Security Flow Objective Event OpenFlow NetConf OVSDB Core Cluster . . . Proxy ARP Mobility L2 Forwarding REST API GUI CLI Network Cfg. SDN IP / BGP Packet / Optical Tunnel . . . OSGi / Apache Karaf Network Virt. Device Cfg. Config UI Extension External Apps Graph Discovery Tenant . . .
  7. Manager Component Manager Component ONOS Core Subsystem Structure Provider Component

    Provider Component App Component Listener notify command command sync & persist add & remove query & command App Component Provider Component Manager Component Manager Component ProviderRegistry Provider ProviderService Service AdminService Listener notify register & unregister command command sensing add & remove query & command Protocols Store Store Provider Component ProviderRegistry Provider ProviderService register & unregister sensing Protocols Service AdminService Store Store sync & persist ProviderRegistry ProviderRegistry Provider Provider ProviderService ProviderService AdminService AdminService Service Service Listener Listener
  8. ONOS Fundamentals 8:30-10:00 • ONOS Overview (~30) ◦ tenets, architecture,

    tiers, subsystems ◦ general subsystem structure • Getting started with ONOS (~30) ◦ check-out code, environment customization and build ◦ describe Maven, hierarchical POM structure ◦ run ONOS locally on developer machine ◦ CLI & GUI demo with a simple mininet topology (torus,8,8,2) • Code organization (~30) ◦ importing ONOS source into IDE (demo with IntelliJ) ◦ core (api, net, stores), web (gui, rest), providers (openflow, netconf)
  9. Development Pre-Requisites • Bash (or similar shell) • Oracle Java

    Development Kit 8+ http://www.oracle.com/technetwork/java/javase/downloads • Apache Maven 3.3.x+ https://maven.apache.org/download.html • Apache Karaf 3.0.3+ (for local development) http://karaf.apache.org/index/community/download.html • IDE of your choice (IntelliJ, Eclipse, …)
  10. Getting started with ONOS • Check-out ONOS code via git

    • Tailor bash environment for ONOS development • Build ONOS via Maven • Run ONOS locally on developer machine • Activate pre-installed reactive forwarding application • Test ONOS via a mininet simulated network • Explore ONOS GUI & CLI
  11. Check-out ONOS code • Open a new terminal shell and

    clone ONOS repo: $ git clone https://gerrit.onosproject.org/onos
  12. Tailor shell for ONOS development • Edit the shell profile:

    $ vi ~/.bash_profile • Add the following lines at the top: export ONOS_ROOT=~/onos source $ONOS_ROOT/tools/dev/bash_profile • Source the modified shell profile $ source ~/.bash_profile
  13. Build ONOS via Maven • Change directory to your ONOS

    root and invoke Maven $ cd ~/onos $ mvn clean install • Alternatively, use onos-build command or ob alias from anywhere $ onos-build
  14. Run ONOS locally • Use onos-karaf command or ok alias

    to setup and run ONOS via Apache Karaf $ onos-karaf clean • Use ONOS shell commands to explore onos> summary onos> nodes onos> apps -s
  15. Activate reactive forwarding app • Use app command to activate

    a pre-installed app: onos> app activate org.onosproject.fwd
  16. Test ONOS via mininet • Start ONOS gui via onos-gui

    command or gui alias: $ onos-gui • Start 8x8 torus topology with 2 hosts per switch: $ sudo mn --topo torus,8,8,2 \ --controller remote,ip=192.168.56.1 • Ping all hosts in mininet mininet> pingall
  17. Explore ONOS GUI & CLI • Enable host display via

    tool icon or H key • Explore Devices, Links and Hosts views, etc. • Explore ONOS CLI via the following shell commands: onos> summary onos> devices onos> links onos> hosts onos> flows onos> onos:*
  18. ONOS Fundamentals 8:30-10:00 • ONOS Overview (~30) ◦ tenets, architecture,

    tiers, subsystems ◦ general subsystem structure • Getting started with ONOS (~30) ◦ check-out code, environment customization and build ◦ describe Maven, hierarchical POM structure ◦ run ONOS locally on developer machine ◦ CLI & GUI demo with a simple mininet topology (torus,8,8,2) • Code organization (~30) ◦ importing ONOS source into IDE (demo with IntelliJ) ◦ core (api, net, stores), web (gui, rest), providers (openflow, netconf)
  19. Tour of ONOS code-base • Import ONOS into IDE •

    Tour of ONOS core (api, net, stores, etc.) • Tour of other areas (apps, providers, web, etc.)
  20. ONOS Distributed Core 10:30-12:00 • ONOS, OSGi & Apache Karaf

    (~15) ◦ OSGi bundles, Karaf features & SCR components ◦ use bundle:*, feature:*, scr:* commands & webconsole • Anatomy of an ONOS Core Subsystem (~15) ◦ use device subsystem as an example • Distributed stores & primitives (~60) ◦ physically distributed & logically centralized ◦ deep dive on distributed topology stores (devices, links, hosts) ◦ other types of state treatment for other types of state ◦ primitives, e.g. eventually consistent/strongly consistent map, leadership, distributed set, distributed queue, atomic counter
  21. feature repo z feature repo y OSGi Bundles & Karaf

    Features bundle bundle bundle bundle bundle feature feature bundle bundle feature feature repo x bundle bundle feature
  22. OSGi Bundles & Karaf Features • OSGi bundles are Java

    JAR files with an enhanced Manifest ◦ bundles have name and version ◦ bundles explicitly require/import other Java packages ◦ bundles explicit provide/export Java packages for others • Karaf features are means to install or uninstall a set of bundles as a group ◦ features are defined via an XML artifact - a feature repository ◦ features reference, but do not deliver the bundle JAR artifacts • Karaf uses Maven repos as OSGi Bundle Repositories for retrieval of feature and bundle artifacts
  23. Service Component Runtime • Components are effectively stateful singletons whose

    life-cycle is controlled by the framework ◦ components defined by OSGI-INF/*.xml files at run-time ◦ ONOS uses maven-scr-plugin to convert Java annotations to OSGI- INF/*.xml files at compile-time • Components can provide @Services to others • Components can @Reference services from others • @Activate, @Modified and @Deactivate methods serve as component life-cycle hooks
  24. Bundle & Feature Shell Commands • Bundle related commands onos>

    bundle:* • Feature related commands onos> feature:* • Service Component Runtime related commands onos> scr:*
  25. ONOS Distributed Core 10:30-12:00 • ONOS, OSGi & Apache Karaf

    (~15) ◦ OSGi bundles, Karaf features & SCR components ◦ use bundle:*, feature:*, scr:* commands & webconsole • Anatomy of an ONOS Core Subsystem (~15) ◦ use device subsystem as an example • Distributed stores & primitives (~60) ◦ physically distributed & logically centralized ◦ deep dive on distributed topology stores (devices, links, hosts) ◦ other types of state treatment for other types of state ◦ primitives, e.g. eventually consistent/strongly consistent map, leadership, distributed set, distributed queue, atomic counter
  26. Manager Component Manager Component Anatomy of an ONOS subsystem Provider

    Component Provider Component App Component Listener notify command command sync & persist add & remove query & command App Component Provider Component Manager Component Manager Component ProviderRegistry Provider ProviderService Service AdminService Listener notify register & unregister command command sensing add & remove query & command Protocols Store Store Provider Component ProviderRegistry Provider ProviderService register & unregister sensing Protocols Service AdminService Store Store sync & persist ProviderRegistry ProviderRegistry Provider Provider ProviderService ProviderService AdminService AdminService Service Service Listener Listener
  27. Device Subsystem - Northbound • DeviceManager component exposes DeviceService to

    apps and other services ◦ note the @Component and @Service annotations • Apps can subscribe to asynchronous DeviceEvent notifications via DeviceListener mechanism • DeviceManager also exposes DeviceAdminService to privileged apps for select administrative actions
  28. Device Subsystem - Southbound • DeviceManager offers DeviceProviderRegistry service •

    DeviceProvider entities can register and acquire a reference to DeviceProviderService • Core uses registered DeviceProvider for sending edicts and queries down to the environment in a protocol- agnostic manner • Provider uses issued DeviceProviderService for sending device and port sensory data up to the core in a protocol-agnostic manner
  29. Device Subsystem - East / West • DeviceManager delegates to

    peer DeviceStore all cluster-related tasks ◦ manager becomes DeviceStoreDelegate to the DeviceStore • DeviceStore is responsible for indexing, persisting and synchronizing the global device and port state with all cluster peers • DeviceStore delegates incoming DeviceEvents to its DeviceStoreDelegate for local actions and for local event dispatching
  30. ONOS Distributed Core 10:30-12:00 • ONOS, OSGi & Apache Karaf

    (~15) ◦ OSGi bundles, Karaf features & SCR components ◦ use bundle:*, feature:*, scr:* commands & webconsole • Anatomy of an ONOS Core Subsystem (~30) ◦ use device subsystem as an example • Distributed stores & primitives (~60) ◦ physically distributed & logically centralized ◦ deep dive on distributed topology stores (devices, links, hosts) ◦ other types of state treatment for other types of state ◦ primitives, e.g. eventually consistent/strongly consistent map, leadership, distributed set, distributed queue, atomic counter
  31. Distributed Stores & Primitives “The unavoidable price of reliability is

    simplicity.” — C.A.R. Hoare “Simplicity is prerequisite for reliability.” — E. W. Dijkstra
  32. Distributed State Management • Using specific examples - introduce various

    distributed state management primitives ONOS provides
  33. Distributed Primitive: Leadership • Support for mutual exclusion in a

    distributed setting • Available as a primitive for applications to consume • Implemented via the Raft consensus protocol • Cluster majority is needed to reach consensus
  34. Deep dive into Topology state • Formulate the problem •

    Evaluate solution space • Description of ONOS’ approach • Performance evaluation
  35. E

  36. E

  37. F

  38. F E

  39. Pros Cons • Simple • Fast • Dropped messages •

    Reordered messages How to address the cons without sacrificing the pros?
  40. C1 C2 C1 1 2 3 Switch Mastership Terms We

    track this in a strongly consistent store
  41. 2.1 2.2 2.3 2.4 2.5 2.6 1.4 1.2 1.3 1.1

    3.2 3.3 3.1 2.7 2.8 C1 C2 C1 1 2 3 Switch Event Numbers
  42. Each event has a unique logical timestamp (Switch ID, Term

    Number, Event Number) Partial Ordering of Events
  43. • Each instance has a full copy of network topology

    • Events are timestamped on arrival and broadcasted • Stale events are dropped on receipt To Summarize
  44. • Each instance has a full copy of network topology

    • Events are timestamped on arrival and broadcasted • Stale events are dropped on receipt To Summarize What about dropped messages?
  45. • If you are the observer, Eventual Consistency is the

    best option • For topology state, ONOS provides monotonic read consistency • View should be consistent with the network, not with other views A model for state tracking
  46. Link Up/Down Latency • Since we use LLDP & BDDP

    to discover links, it takes longer to discover a link coming up than going down • Port down event trigger immediate teardown of the link.
  47. • EventualConsistency is necessary but not sufficient • Some state

    requires stronger guarantees ◦ Reservations is a prime example • Hard to layer abstractions when you a have a store that only provides weak guarantees Next topic: Strong consistency
  48. • Forwarding plane rules • Programmed onto individual switches •

    Control plane is the arbiter of truth Final example: Flows
  49. Flows • Primary-backup replication • Switch master is primary and

    next master is backup • Fast read/write access • Minimal overhead on failover Primary Backup
  50. Flow Throughput results • Single instance can install over 500K

    flows per second • ONOS can handle 3M local and 2M non local flow installations • With 1-3 ONOS instances, the flow setup rate remains constant no matter how many neighbours are involved • With more than 3 instances injecting load the flow performance drops off due to extra coordination requires.
  51. Intent Latency Results • Less than 100ms to install or

    withdraw a batch of intents • Less than 50ms to process and react to network events o Slightly faster because intent objects are already replicated
  52. ONOS Dev Workshop Outline • ONOS Fundamentals ◦ architecture, checking

    out, building & running ONOS • ONOS Distributed Core ◦ OSGi, anatomy of a core subsystem, distributed stores & primitives • ONOS App Development ◦ background, Maven archetypes, app deployment on ONOS cluster • ONOS Interfaces ◦ component config service, flow objective service, intent service ◦ CLI, REST and GUI overview • Wrap-up
  53. ONOS App Development 13:15-14:45 • Installing ONOS cluster from onos.tar.gz

    (~10) ◦ untar, onos-service, onos-form-cluster • ONOS Applications (~10) ◦ OSGi bundles, Karaf features, ONOS apps & OAR files ◦ application lifecycle - install, activate, deactivate, uninstall ◦ ONOS CLI & GUI • Developing ONOS apps (~50) ◦ use mvn archetype:generate and onos-create-app ◦ archetype overlays for CLI and UI - generated & pre-canned ◦ iterative and demonstrating use of onos-app tool or GUI
  54. Install ONOS cluster from tar.gz • Install ONOS on all

    three instances ◦ we will use iTerm to do so simultaneously $ onos-cell demo && onos-iterm-cli • Fetch ONOS bits via wget $ wget http://downloads.onosproject.org/onos-1.3.0.dev.tar.gz • Untar bits $ tar zxf onos-1.3.0.dev.tar.gz
  55. Start ONOS instances • Start ONOS $ cd onos-1.3.0.dev $

    bin/onos-service server & • Verify install as individual instances $ bin/onos onos> nodes • Check logs $ tail -f log/karaf.log
  56. Form ONOS cluster • Form ONOS cluster from individual instances

    $ bin/onos-form-cluster 10.128.11.1 10.128.11.2 10.128.11.3 • Verify install as a cluster $ bin/onos onos> nodes • Check logs $ tail -f log/karaf.log
  57. Setup test network • Connect mininet to cluster machines $

    sudo mn --topo tree,3,4 --controller remote,... • Activate proxy ARP and reactive forwarding apps onos> app activate org.onosproject.proxyarp onos> app activate org.onosproject.fwd • Issue pingall a few times to show unencumbered flow mininet> pingall mininet> pingall
  58. ONOS App Development 13:15-14:45 • Installing ONOS cluster from onos.tar.gz

    (~10) ◦ untar, onos-service, onos-form-cluster • ONOS Applications (~10) ◦ OSGi bundles, Karaf features, ONOS apps & OAR files ◦ application lifecycle - install, activate, deactivate, uninstall ◦ ONOS CLI & GUI • Developing ONOS apps (~50) ◦ use mvn archetype:generate and onos-create-app ◦ archetype overlays for CLI and UI - generated & pre-canned ◦ iterative and demonstrating use of onos-app tool or GUI
  59. multi-bundle app Bundles, Features & ONOS Apps simple app multi-feature

    & multi-bundle app bundle bundle bundle bundle bundle feature.xml features.xml bundle bundle features.xml features.xml bundle .oar .oar .oar app.xml app.xml app.xml
  60. Bundles, Features & ONOS Apps • Apps are delivered via

    ONOS App aRchive (.oar) files ◦ OAR is a JAR with app.xml, features.xml and bundle artifacts ◦ onos-maven-plugin generates an *.oar file as part of Maven build • Apps are managed on the entire ONOS cluster ◦ via REST API: GET|POST|DELETE /onos/v1/applications ◦ via shell tool: onos-app {install|activate|deactivate|uninstall} ◦ via CLI: onos:app {install|activate|deactivate|uninstall} ◦ via GUI Applications view • Back-end installation and activation is done via normal feature & bundle services
  61. Developing ONOS apps • Maven archetypes ◦ onos-bundle-archetype - basis

    for an ONOS bundle or an app ◦ onos-cli-archetype - overlay for apps with CLI extensions ◦ onos-ui-archetype - overlay for apps with GUI extensions ◦ onos-api-archetype - basis for an app Java API bundle • Run mvn archetype:generate to create a working minimal project module • For simpler usage run onos-create-app shell tool ◦ simply a convenience wrapper for mvn
  62. ONOS App Development 13:15-14:45 • Installing ONOS cluster from onos.tar.gz

    (~10) ◦ untar, onos-service, onos-form-cluster • ONOS Applications (~10) ◦ OSGi bundles, Karaf features, ONOS apps & OAR files ◦ application lifecycle - install, activate, deactivate, uninstall ◦ ONOS CLI & GUI • Developing ONOS apps (~50) ◦ use mvn archetype:generate and onos-create-app ◦ archetype overlays for CLI and UI - generated & pre-canned ◦ iterative and demonstrating use of onos-app tool or GUI
  63. Minimal ONOS app project • Create minimal app project via

    onos-create-app tool $ onos-create-app app org.oneping oneping 1.0-SNAPSHOT • Build the app via Maven $ cd oneping $ mvn clean install • Deploy the app to ONOS cluster via onos-app tool $ onos-app 10.128.11.1 install! target/oneping*.oar
  64. Code & deploy OnePingOnly app • “Code” our app as

    OnePing.java • Rebuild the app via Maven and redeploy it $ mvn clean install $ onos-app 10.128.11.1 reinstall! target/oneping*.oar
  65. Show one-ping-only enforcement • Issue one ping between two hosts

    mininet> h1 ping -c1 h2 mininet> h1 ping -c1 h3 • Issue another ping between the same two hosts mininet> h1 ping -c1 h2 • Show failed second ping and messages in the logs
  66. ONOS app overlay archetypes • Some ONOS archetypes can be

    used to enhance an existing project with additional capabilities ◦ add CLI extensions ◦ add GUI extensions ◦ others in future • Simply run onos-create-app tool in the same project • First show that sample command does not exist onos> sample
  67. Overlay CLI archetype • Overlay CLI additions via onos-create-app $

    onos-create-app cli org.oneping oneping 1.0-SNAPSHOT • Rebuild and redeploy the enhanced app $ mvn clean install $ onos-app 10.128.11.1 reinstall! target/oneping*.oar • Show that sample command now exists onos> sample
  68. Overlay GUI archetype • Show existing GUI navigation menu •

    Overlay GUI additions via onos-create-app and rebuild $ onos-create-app ui org.oneping oneping 1.0-SNAPSHOT • Rebuild and redeploy the enhanced app $ mvn clean install $ onos-app 10.128.11.1 reinstall! target/oneping*.oar • Refresh GUI and show enhanced GUI navigation menu
  69. ONOS Interfaces 15:15-17:00 • Component Config Service (~10) • Device

    Drivers Service (~10) • Flow Objective Service (~15) • Intent Service (~15) • GUI overview (~15) • CLI overview (~5) • REST API overview (~5) • Wrap-up & Final QA (~15)
  70. ONOS Core Subsystems Device Link Host Topology Flow Rule Path

    Packet Statistics Intent Application Leadership Messaging Storage Region Mastership Driver Group Security Flow Objective Event OpenFlow NetConf OVSDB Core Cluster . . . Proxy ARP Mobility L2 Forwarding REST API GUI CLI Network Cfg. SDN IP / BGP Packet / Optical Tunnel . . . OSGi / Apache Karaf Network Virt. Device Cfg. Config UI Extension External Apps Graph Discovery Tenant . . .
  71. ONOS Interfaces 15:15-17:00 • Component Config Service (~10) • Device

    Drivers Service (~10) • Flow Objective Service (~15) • Intent Service (~15) • GUI overview (~15) • CLI overview (~5) • REST API overview (~5) • Wrap-up & Final QA (~15)
  72. Component Config Subsystem • Provide centralized and cluster-wide component configuration

    • Avoid drift between configurations on cluster instances • Built atop the OSGi ConfigurationAdmin service • Components accept configuration via standard OSGi @Modified hook • Catalogue of config properties for each component generated at build-time via onos-maven-plugin
  73. Component Config Subsystem • Component registers its properties on activation

    void registerProperties(getClass()); • Component unregisters its properties on deactivation void unregisterProperties(getClass(), false); • Component provides configuration method hook @Modified public void modified(ComponentContext context) { … }
  74. ONOS Interfaces 15:15-17:00 • Component Config Service (~10) • Device

    Drivers Service (~10) • Flow Objective Service (~15) • Intent Service (~15) • GUI overview (~15) • CLI overview (~5) • REST API overview (~5) • Wrap-up & Final QA (~15)
  75. Device Driver Subsystem • Isolate device-specific code • Allow asynchronous

    delivery & dynamic loading ◦ by ON.Lab, vendors or others • Allow abstracting of how to interact with devices ◦ via Java API (Behaviour interfaces) • Avoid a monolithic driver approach ◦ different facets of behaviour can come from different sources • Facilitate specialization via inheritance ◦ families of devices share many similar characteristics
  76. Driver • Representation of a specific family of devices or

    a specific device ◦ has a unique name, e.g. ciena-6500 ◦ supports set of Behaviour classes ◦ may inherit behaviours from another Driver • DefaultDriver is a default implementation class
  77. DriverAdminService • Service for tracking driver providers Set<DriverProvider> getProviders() registerProvider(DriverProvider)

    unregisterProvider(DriverProvider) • DriverProvider provides a set of driver definitions Set<Driver> getDrivers()
  78. DriverService Service for locating appropriate drivers for the device •

    by driver name • by manufacturer, H/W version & S/W version patterns • by supported behaviour • by device ID
  79. Behaviour & HandlerBehaviour • Behaviour is an interface for talking

    about a device • HandlerBehaviour is an interface for interacting with a device ◦ OpenFlowController ◦ OpenFlowPipeliner ◦ ...
  80. DriverData & DriverHandler • DriverData is a container for data

    about a device ◦ provides behaviours for talking about a device ◦ has parent driver • DriverHandler is a context for interacting with a device ◦ provides behaviours for interacting with a device ◦ has DriverData ◦ has parent driver
  81. ONOS Interfaces 15:15-17:00 • Component Config Service (~10) • Device

    Drivers Service (~10) • Flow Objective Service (~15) • Intent Service (~15) • GUI overview (~15) • CLI overview (~5) • REST API overview (~5) • Wrap-up & Final QA (~15)
  82. Flow Objective Subsystem • Problem: Applications today must be pipeline

    aware, effectively making them applicable to specific HW. Controller Platform ? ? ?
  83. Flow Objective Subsystem • Problem: Applications today must be pipeline

    aware, effectively making them applicable to specific HW.
  84. Flow Objective Abstraction • Problem: Applications currently must be pipeline

    aware, effectively making applicable on specific HW. Flow objectives enable developers to write applications once for all pipelines First attempt at interoperability between OF 1.3 switch
  85. Flow Objective Service • Applications use Objective to take advantage

    multi-table architectures • Other services also make use of the Objective service (eg. Intent Service) • Device driver translates objectives to the specific flow rules for a given device
  86. Flow Objectives • Flow Objectives describe a SDN application’s objective

    behind a flow it is sending to a device • We currently only have three types of objectives: 1. Filtering Objective 2. Forwarding Objective 3. Next Objective
  87. Filtering Objective • Filter -> only Permit or Deny options

    • On criteria (match fields) Example: Peering Router Switch Port : X Permit: MAC 1, VLAN 1, IP 1, 2, 3 Permit: MAC 1, VLAN 2, IP 4, 5
  88. Filtering Objective • Filter -> only Permit or Deny options

    • On criteria (match fields) Example: Peering Router Switch Port : X Permit: MAC 1, VLAN 1, IP 1, 2, 3 Permit: MAC 1, VLAN 2, IP 4, 5
  89. Next Objective • Next -> next hop for forwarding •

    Similar to OF group • Keyed by a NextId used in Forwarding Objectives
  90. Forwarding Objective • Forwarding: { Selector -> Next Id }

    • Forwarding Types: Specific or Versatile ◦ Specific -> MAC, IP, MPLS forwarding tables ◦ Versatile -> ACL table • NextId is resolved to whatever the driver previously built for the corresponding Next Objective
  91. Flow Objective Summary • Flow Objective Service: Abstraction for applications

    to be pipeline unaware while benefiting from scalable, multi-table architectures • Aims to make it simple to write apps • First attempt at achieving interoperability between OF 1.3 implementations
  92. ONOS Interfaces 15:15-17:00 • Component Config Service (~10) • Device

    Drivers Service (~10) • Flow Objective Service (~15) • Intent Service (~15) • GUI overview (~15) • CLI overview (~5) • REST API overview (~5) • Wrap-up & Final QA (~15)
  93. Building Network Applications Objective: Connect Host 1 and Host 2

    1. Read/discover the topology Host 2 Host 1
  94. Building Network Applications Objective: Connect Host 1 and Host 2

    1. Read/discover the topology 2. Compute a path Host 2 Host 1
  95. Building Network Applications Objective: Connect Host 1 and Host 2

    1. Read/discover the topology 2. Compute a path 3. Build flow objectives for each device Host 1 Host 2
  96. Building Network Applications Objective: Connect Host 1 and Host 2

    1. Read/discover the topology 2. Compute a path 3. Build flow objectives for each device 4. Install rules in consistent way Host 1 Host 2
  97. Building Network Applications Objective: Connect Host 1 and Host 2

    1. Read/discover the topology 2. Compute a path 3. Build flow objectives for each device 4. Install rules in consistent way Host 1 Host 2
  98. Building Network Applications What can go wrong? • Missing /

    rejected / dropped rules ◦ Monitor devices connections ◦ Send barriers between rule updates ◦ Poll flow state Host 1 Host 2
  99. Building Network Applications What can go wrong? • Missing /

    rejected / dropped rules ◦ Monitor devices connections ◦ Send barriers between rule updates ◦ Poll flow state • Topology changes ◦ Listen to switch, port, link and host events ◦ Compute new path that leverage or remove old flows Host 1 Host 2
  100. Building Network Applications • Each application requires complex path computation

    and rule installation engines and state machines • Inconsistent behavior in the face of failures ◦ Failures may be handled in different ways (or not at all) • Bugs need to fixed in multiple places (applications) • Expensive to upgrade/refactor behavior across all applications; e.g. ◦ Improve performance ◦ Support new types of devices ◦ Implement better algorithms • Difficult or impossible to resolve conflicts with other applications
  101. Intent Subsystem • Provides high-level, network-centric interface that focuses on

    what should be done rather than how it is specifically programmed • Abstracts unnecessary network complexity from applications • Maintains requested semantics as network changes • High availability, scalability and high performance
  102. Intent Example COMPILATION INSTALLATION Flow Rule Batch Flow Rule Batch

    Flow Rule Batch Flow Rule Batch Path Intent Path Intent Host to Host Intent
  103. Intent Compilers • Produce more specific Intents given the environment

    • Works on high-level network objects, rather than device specifics • “Stateless” – free from HA / distribution concerns
  104. Intent Installers • Transform Intents into device commands • Allocate

    / deallocate network resources • Define scheduling dependencies for workers • “Stateless”
  105. Intent Framework Design Southbound Physical Network Host to Host Intent

    Compiler Path Intent Installer Path Intent Installer Applications Intent Service API Intent Extension Service API Intent Manager Intent Store Intent Objective Tracker Intent Worker Core Topology API Resource API … Flow Objective API Intent Cleanup
  106. ONOS Interfaces 15:15-17:00 • Component Config Service (~10) • Device

    Drivers Service (~10) • Flow Objective Service (~15) • Intent Service (~15) • GUI overview (~15) • CLI overview (~5) • REST API overview (~5) • Wrap-up & Final QA (~15)
  107. GUI Overview • Single page application at /onos/ui ◦ AngularJS

    ◦ d3.js (Data-Driven Documents) ◦ SVG ◦ Web-Socket • Shared web-socket for asynchronous & bidirectional exchange • REST also used for select few interactions • Dynamically extensible navigation & views ◦ apps can contribute new views at run-time
  108. ONOS Interfaces 15:15-17:00 • Component Config Service (~10) • Device

    Drivers Service (~10) • Flow Objective Service (~15) • Intent Service (~15) • GUI overview (~15) • CLI overview (~5) • REST API overview (~5) • Wrap-up & Final QA (~15)
  109. CLI Overview • Built using Apache Karaf shell mechanism ◦

    ssh -p8101 … ◦ onos shell tool provided for convenience • All commands in onos: namespace • Most arguments support TAB-completion • Plain-text output format for human readability • JSON output format for easy scripting via --json option • Noun oriented ◦ a few verb-oriented exceptions will be addressed
  110. REST API Overview • Core REST APIs available under path

    /onos/v1 ◦ all resources support read (get) ◦ not all resources support write (post/put/delete) yet • Resources available today: /topology /devices /links /hosts /paths /flows /intents /cluster /applications /configuration /config
  111. ONOS Dev Workshop Outline • ONOS Fundamentals ◦ architecture, checking

    out, building & running ONOS • ONOS Distributed Core ◦ OSGi, anatomy of a core subsystem, distributed stores & primitives • ONOS App Development ◦ background, Maven archetypes, app deployment on ONOS cluster • ONOS Interfaces ◦ component config service, flow objective service, intent service ◦ CLI, REST and GUI overview • Wrap-up
  112. Wrap-Up • Browse ONOS Wiki https://wiki.onosproject.org/ • Watch ONOS how-to

    screencasts on YouTube https://goo.gl/8Druv0 • Browse ONOS Java API http://api.onosproject.org/ • Join ONOS [email protected] mailing list https://wiki.onosproject.org/display/ONOS/ONOS+Mailing+Lists • Engage with ONOS developers & community