Upload
michelle-holley
View
74
Download
2
Embed Size (px)
Citation preview
Introduction to OpenDaylight &
Application Development Luis Gomez Principal Engineer, Brocade | TSC Member, Test and Releng committer OpenDaylight. Anil Vishnoi Principal Engineer, Brocade | TSC & Board Member, OVSDB PTL, OpenFlow committer.
Some content from: Colin Dixon, David Meyer, Neela Jaques, and Lisa Caywood
Outline • Introduc)on…
• …toSDN• …toOpenDaylight…
• What’sinOpenDaylight• Applica)ondevelopmentwithOpenDaylight
Introduction
dst port
0E 6
dst port
0E 6
0A 1
dst port
0E 6
0A 1
0C 4
Traditional SDN (OpenFlow) The separation of the control and data planes
• Modernswitches• Control/dataplanebothonswitch• Dataplane:fast,readstables• Controlplane:slow,writestables
• SDN• Decouplecontrol/dataplanes• Dataplaneontheswitch• Controlplaneelsewhere,e.g.,anx86server,candofancierthings
SwitchChip
ControlPlaneCPU
Ports,1-6
SDNController
Thisgetssmaller,turnsinto
controllertoswitchchiptranslator
Mostfeaturesgohere
0A->0E0A->0E0A->0C
Tablemiss,sendtocontroller
Installtableentry,sendpacket
0C->4
Modern, Inclusive SDN
control
mgmt
control
mgmt
control
mgmt
VendorA VendorB VendorC
LogicallyCentralized
SDNController
NorthboundAPI
IndustryStandardControl/Management
ProtocolsStandardModelingLanguage
VendorA
control
mgmt
control
mgmt
VendorB VendorC
control
mgmt
What is OpenDaylight OpenDaylightisanOpenSourceSo9wareprojectundertheLinuxFounda=onwiththegoaloffurtheringtheadop)onandinnova)onofSo9wareDefinedNetworking(SDN)throughthecrea)onofacommonindustrysupportedplaYorm.
Tocreatearobust,extensible,opensourcecodebasethatcoversthemajorcommoncomponentsrequiredtobuildanSDNsolu)on
Code
Togetbroadindustryacceptanceamongstvendorsandusers:•Usingitdirectlyorthroughvendorproducts•VendorsusingOpenDaylightincommercialproducts
Acceptance
Tohaveathrivingandgrowingtechnicalcommunitycontribu)ngtothecodebase,usingthecodeincommercialproducts,andaddingvalueabove,belowandaround.
Community
OpenDaylight Community • LikeanyOpenSourceProject,OpenDaylightprimarilyconsistsofthosewhoshowuptodothework.
• Runningaround400commitsperweekover12months,trendingup• 30Days:~1463commits,~126contributors(Aug202016—Sep192016)• 12Months:~23,623commits,~511contributors(Sep192015—Sep192016)
• Strongintegra)onandtes)ngcommunity• Thisstuffreallymaders
Source: https://www.openhub.net/p/opendaylight
OpenDaylight Releases • Hydrogen(firstrelease)
• February2014• 13projects,1.3mlinesofcode
• Helium(secondrelease)• October2014• 25projects,2.1mlinesofcode
• Lithium(thirdrelease)• June2015• 41projects,2.4mlinesofcode
• Beryllium(forthrelease)• February2016• 51projects,2.9mlinesofcode
• Boron(Fijhrelease)• September2016• 56projects,3.6mlinesofcode
• Carbon(CurrentRelease)• April2017• 75+projects
Source: https://www.openhub.net/p/opendaylight
OpenDaylight Community
What’s in OpenDaylight
ServiceAbstrac)onLayer/Core
OpenDaylight platform
OpenFlowEnabledDevices OpenvSwitches Addi=onalVirtual&
PhysicalDevices
DataPlaneElements(VirtualSwitches,Physical
DeviceInterfaces)
ControllerPlaUormServices/Applica=ons
OVSDB NETCONF PCMM/COPSSNBILISP PCEP SNMPSXP SouthboundInterfaces&
ProtocolPluginsOpenFlow
USCCAPWAP OPFLEX
ControlPlaneFunc=ons
OpenDaylightAPIsREST/RESTCONF/NETCONF/AMQP
DataStore(Config&Opera)onal) Messaging(No)fica)ons/RPCs)
LACP
AAAAuthoriza=onFilter
NetworkAbstrac=ons(Policy/Intent)
GraphicalUserInterfaceApplica=onandToolkit(DLUX/NeXTUI)
IoTH^p/CoAP
OF-Config
EmbeddedControllerApplica=ons
IndependentNetworkApplica=ons
• AAA• HostTracker• InfrastructureU=li=es• L2Switch• LISPService• LinkAggrega=onControl
Protocol• OpenFlowForwardingRules
Manager• OpenFlowStatsManager• OpenFlowSwitchManager• TopologyProcessing
• NetIDE• NetVirt• NeutronNorthbound• OVSDBNeutron• SNIntegra=onAggregator• ServiceFunc=onChaining• TimeSeriesDataRepository• UnifiedSecureChannelMgr• UserNetworkInterfaceMgr• VirtualTenantNetworkMgr
• AtriumRouter• Cardinal• Cen=nel–StreamingDataHdlr• ControllerShield• DeviceDiscovery,ID&Mgmt• DOCSISAbstrac=on• Eman• Genius• NATApplica=on
• ALTOProtocolManager• FabricasaService• GroupBasedPolicyService• NEMO• NetworkIntentComposi=on
OCPBGP
Network Applications
AtriumRouter
OSPF
OSPF
BGP
Core
Edge
RouteReflector
Core
Edge
RouteReflector
EdgeEdge
BGP
Link-State,IPv4,IPv6andFlowspecroutes
MPLSLSPsviaPCEP
Edge
BGP
PCE-P
OSPF
OSPF
PCE-P
OSPF
BGP
OSPF
BGP
OSPF
OSPF
OSPF
BGP
App
PCE-P
RESTCONF
BGP
Topology
BGP/PCEPPlugin
ServiceFunc)onChaining
VirtualTenantNetworks
Cloud and NFV Applications
Netvirt(OVSDB)
Netvirt(L3VPN)
DC-GW DC-GW
ODL ODL
iBGPiBGP
OVS
OVS OVS
OVS
MPLSoGRE
MPLSoGRE
VM1 VM3
10.0.0.1
10.0.0.2
VM2
20.0.0.1
VM4200.0.0.2
200.0.0.1 210.0.0.1
210.0.0.2
Prefix10.0.0.2LabelL1NH200.0.0.2
Prefix10.0.0.1LabelL2NH200.0.0.1
Prefix20.0.0.2LabelL5NH210.0.0.2
Prefix20.0.0.1LabelL6NH210.0.0.1
DC-GW–ASBR(WAN)eBGPVxLAN
VxLAN
MPLSoGRE
MPLSoGRE
Prefix10.0.0.2LabelL7NH230.0.0.1
Prefix10.0.0.1LabelL8NH230.0.0.1
Prefix20.0.0.2LabelL3NH220.0.0.1
Prefix20.0.0.1LabelL4NH220.0.0.1
220.0.0.1 230.0.0.1 20.0.0.2
SFC+Netvirt(OPNFV)
Visibility And Control
Applications
Cen)nel
IoTDataManagement
TimeSeriesDataRepository
Interfaces And Extensions
Cardinal
NetIDE
UniversalSecureChannel
Network Abstractions
FABRICASASERVICE
GROUPBASEDPOLICY
NETWORKINTENTCOMPOSITION
Application Development
with OpenDaylight
Technologies used in ODL • ProgrammingLanguage–Java.• ModellingLanguage-YANG• BuildSystem-Maven• BasicPlaYormofODL–Karaf,whichispoweredbyOSGi
• HotDeployment• Dynamicloadingmodules/bundles• YoucanconnectremotelytoKarafconsoleusingSSH• Dynamicconfigura)on–Allkarafconfigura)onfilesarein/etc
• BlueprintContainerfordependencyinjec)onacrossbundlesthatruninanOSGiframework.
OSGi Framework (Equinox)
FeatureA SAL
FeatureB
Karaf
ODL Platform Overview • MicroServicesArchitecture
• ODLemploysamodel-drivenapproachtodescribethenetwork,thefunc)onstobeperformedonitandtheresul)ngstate
• InMD-SAL,anyapporfunc)oncanbebundledintoaservicethatisthenloadedintothecontroller.
• Onlyinstalltheprotocolsandservicesyouneed• Fine-grainedservicestobecreatedthencombinedtogethertosolvemorecomplexproblems.
• Mul=protocolSupport• ODLplaYormsupportsOpenFlow,OpenFlowextensions,NETCONF,BGP/PCEP,OVSDB,SNMPandmanymore.
• Integra=onwithOtherOpenSourceprojects-OpenStack,OPNFV
ServiceAbstrac=onLayer/Core
OpenFlowEnabledDevices OpenvSwitches Addi=onalVirtual&PhysicalDevices
DataPlaneElements(VirtualSwitches,PhysicalDeviceInterfaces)
StandardizedSouthboundInterfaces&ProtocolPlugins
ControlPlaneFunc=ons
OpenDaylightAPIsAAAAuthoriza=onFilter
NetworkAbstrac=ons(Policy/Intent)
GraphicalUserInterfaceApplica=onandToolkit(DLUX/NeXTUI)
EmbeddedControllerApplica=ons
DataStore(Config&Opera)onal)
ProtocolPlugin
Model
API
Applica)on(Processing)
API
Model
An Operational View of OpenDaylight
Messaging(No)fica)ons/
RPCs)
IndependentNetworkApplica=ons
Model-DrivenServiceAbstrac)onLayer(MD-SAL)
Core Architecture
No)fica)ons
RPCs
YANGModels
Data
App/Service App/Service
Plugin Plugin
ControllersinaCluster
MD-SAL, Data Store & Yang • Tree:Modeldataisrepresentedinahierarchicalstructure.• Parentsandchildren:Modelitemshaveupward(parent)and
downward(child)rela)onship.• YANG:Itprovides‘container’,‘list’,‘leaf’typesofdata.• Forexample:
• Container:parentoflist.• List:childofContainer,parentofLeaf.• Leaf:childofList.
• Storage:DataisbeingstoredintotheMD-SALDataStoreinTreestructure
• Eventno=fica=ons:Usercanlistenforno)fica)onsindica)ngthatsomebodyorsomethinghaschangeddataassociatedwithyourmodeltree.
Yang Modelling – Basic Concepts • YANGisadatamodelinglanguageusedtomodelconfigura)onandstatedatamanipulated.• YANGmodelsthehierarchicalorganiza)onofdataasatreeinwhicheachnodehasaname,andeitheravalueorasetofchildnodes.
Data Modeling
SomeYANGconstructsandthecorrespondingJavageneratedcode
OSGi: Container for Multiple Applications BasicJava• JVM:Anapplica)onrunsinitsownvirtualmachine.• Oneapplica=on:Eachapplica)onrunsinitsownJVM.OSGi• Container:Providescontainerinwhichmul)ple
applica)ons(akacomponents,services,bundles)canrun.• Manyapplica=ons:Standardinfrastructureforsuppor)ng
mul)pleapplica)ons,referencestocomponents,services,etc.
• Dynamicloading:Allowscomponentstobeloadedandunloadeddynamicallywhileothersarerunning.
OSGi: Karaf KarafBasics• Lightweight:Alighterimplementa)onofthe
OSGiframework.• Features:Applica)ons,Components,
Services,Bundles,etc.,arecalled‘features’.• Console:AClientapplica)onforexamining
andmanagingfeatures.KarafStructure• Tree-likestructure,similartoMaven
repository,intowhichfeaturear)factsareplaced.
Controller Application Models InternalApplica)ons• MustadheretoMD-SALapplica)onstructureandrequirements.• MustbewrideninJava.• Canbereac=veorproac=ve,i.e.canbebuilttoreceivepacketssent
tocontroller-ornot.• CancommunicatewithotherappsusingtheirRESTAPIs.• Cannotrunonaremotesystem.ExternalApplica)ons• CannotexposeMD-SALmodelsorservices.• CannotcallJavaAPIsofinternalapps.• Canbewrideninanylanguage.• Canbeproac=veonly,i.e.cannotreceivepacketssenttocontroller.
(Althoughcanreceiveno)fica)onfromMD-SALDataStore)• Canrunonanysystem.
Application Development Process ● Archetype: Run the OpenDaylight Maven
archetype to create your application(s) ● Model: Modify the model to suit your needs. ● Code: Modify your code to implement your
application’s functionality. ● Build: Build your application using Maven. ● Install: Install your application into ODL. ● Test: Test your application using Logger and
Eclipse remote debugging. ● Repeat.
Application Development Process (contd) YANGModel(s)
YangTools
GeneratedAPI
ServiceImplementa)on
MavenBuildTools
KarafFeatureDefini)on
MavenBuildTools
MavenBuildTools
1
2
3
OSGiAPIJAR
OSGiIMPLJAR KarafKAR
4
Controller
5
• OSGiAPIJAR• OSGIIMPLJAR• Features.xml
Deploy
ArcheType mvnarchetype:generate-DarchetypeGroupId=org.opendaylight.controller\-DarchetypeAr)factId=opendaylight-startup-archetype\-DarchetypeVersion=1.3.0-SNAPSHOT\-DarchetypeRepository=hdp://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/\-DarchetypeCatalog=hdp://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/archetype-catalog.xml
Archetype(Contd.) • Youwillbepromptedfor:-
• groupId:(enteryourprojectgroupId)• ar)factId:projectar)factId• version:(versionofyourproject)• package:(acceptdefault)• classPrefix:usuallyderivedfromar)factId• copyright:companyname• copyrightYear:2016
Archetype Example for Sample App • groupId:(org.opendaylight.sampleapp)• ar)factId:sampleapp• version:(0.1.0-SNAPSHOT)• package:(acceptdefault)(org.opendaylight.sampleapp)• classPrefix:Sampleapp• copyright:Opendaylight• copyrightYear:2016
Model-generated Code ModelImplementa)on• ModelCode:Declara)onsofyour
modelobjectsandmembers.• Implementa=onCode:Codeto
handleini)aliza)on,modelchangeevents,RPCcalls,no)fica)ons,etc.
ModelDefini)on• Data:Containers,lists,leafs.• RPCs:CallableAPIsincludingthedata
passedasparameterstoeachcall.• No=fica=ons:Publishedevents
receivedbyregisteredlisteners
Code • Startdevelopingyourapplica)on
• Phase0• JustalogmessageinSampleappProvider.java
• Phase1• DefineaYangModelandaccesstheDataStoreusingRESTAPI
• Phase2• RegisteraClusteredDataTreeChangeListenerstolistenforChanges• Readtheincomingdataandlogamessageinthecallback
• Phase3• InjectthenecessarydependenciessuchasdataBrokerusingBlueprint• WireupthenecessaryfeaturedependenciessuchasOpenFlowPluginusingfeature.xml• Installflowsintheswitch
Build Parameters • Mavenisthebuildsystemused.
• Copythesewngs.xmlfile• cp-n~/.m2/sewngs.xml{,.orig}• wget-q-O-hdps://raw.githubusercontent.com/opendaylight/odlparent/stable/boron/sed)ngs.xml
• Usethemvncommand• mvncleaninstall• -DskipTests–Dcheckstyle.skip• Op)ons
• -o• -nsu• -rf:<bundle_to_resume_from>• -mvnclean-Dmaven.repo.local=<pathofm2>-gs<pathofsewngs.xml>install• -U
Installation - Karaf
• cdto<features>/karaf/target/assembly/bin• ./karaf(withcleanop)on)
• Onthekarafconsole• Opendaylight-user@root>feature:list• Opendaylight-user@root>feature:install<feature-name>• Opendaylight-user@root>bundle:list|grep<bundle-name>• Opendaylight-user@root>bundle:services<bundle-id>• Opendaylight-user@root>bundle:diag<bundle-id>
Test -- Rest APIs • Opendaylight has significant REST API support
• Restconf allows for checking config and operational state
• Feature: install odl-restconf • WEB Browser lists the Northbound APIs that are auto generated
• http://localhost:8181/apidoc/explorer/index.html
Open Research Questions
How to get there from here • HowdowedeploySDNwhenit’snotgreenfield
• Becausepredymuchnothingisactuallygreenfield
• Hybridswitches,hybridnetworks,legacyprotocolsforinteroperability,etc.• OpenDaylightsupportsSNMP,BGP,LISP,NETCONF,etc.
• Trustandstability• Currentnetworksbuildon40yearsofcode/experience• HowcanSDNcompetewiththat?
• Borrowgoodcode/ideasfromlegacycode• Providebedervisibility,debugging,etc.• Modelchecking,verifica)on,etc.
55
Centralized vs. Distributed (Consistency, Clustering and Federation)
• SDNpromisesa(logically)centralizedcontrolplane
• Inprac)ce,wehaveadistributedclusterofcontrollers,ratherthanjustonesothat
• wecantoleratefaults• wecanscaleoutourperformance• innetworkpar))onstherearecontrollersonbothsides
• Providingconsistency,federa)on,scale-out,dealingwithCAPtrade-offs,etc.isHARD
http://events.linuxfoundation.org/sites/events/files/slides/sdn-consistency-ods2014.pdf https://www.youtube.com/watch?v=XQ-lnB3x30g
Hardware Diversity • OpenFlow1.0providedalowestcommondenominatorAPI
• Realhardwareismuchmorediverse• andhasmanymorecapabili)es
• Exposingthisdiversitywithoutburdeningdeveloperswithper-deviceprogrammingishard
• SomeAdempts• P4:ProgrammingProtocol-IndependentPacketProcessors• TTPsfromtheONF’sFAWG
57
hdps://www.youtube.com/watch?v=bcaBS6w_k_ohdp://events.linuxfounda)on.org/sites/events/files/slides/TTPs%20and%20NBIs%20for%20ods2014-final_0.pdfhdp://arxiv.org/pdf/1312.1719v1.pdf
OpenDaylight Resources: • IRC:#opendaylightonfreenode:hdp://webchat.freenode.net/• Mailinglists:hdp://lists.opendaylight.org/• Wiki:hdp://wiki.opendaylight.org/• Documenta=on:hdps://docs.opendaylight.org• Git/Gerrit:hdp://git.opendaylight.org/
• Createanaccount:hdps://iden)ty.opendaylight.org/carbon/user-registra)on/user-registra)on.jsp
• Projects:hdps://wiki.opendaylight.org/view/Project_list• Individualpageshavelinkstomee)ng)mes,code,bugs,IRCchannels,etc.
• Mee=ngs:hdps://wiki.opendaylight.org/view/Mee)ngs
Application Development Resources: • hdps://wiki.opendaylight.org/view/
GewngStarted:Pulling,_Hacking,_and_Pushing_All_the_Code_from_the_CLI• hdps://wiki.opendaylight.org/view/GewngStarted:Development_Environment_Setup• hdps://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-
SAL:Startup_Project_Archetype• hdps://wiki.opendaylight.org/view/BestPrac)ces• hdps://www.opendaylight.org/plaYorm-overview/• hdps://wiki.opendaylight.org/view/Presenta)ons#OpenDaylight_Summit_Seadle• hdps://www.youtube.com/user/opendaylightproject