Developing OpenDaylight Apps with MD-SAL
- J. Medved, E. Warnicke, A. Tkacik. R. Varga
Cisco Sample App: M. Rehak, Cisco February 04, 2014
Developing OpenDaylight Apps with MD-SAL J. Medved, E. Warnicke, - - PowerPoint PPT Presentation
Developing OpenDaylight Apps with MD-SAL J. Medved, E. Warnicke, A. Tkacik. R. Varga Cisco Sample App: M. Rehak, Cisco February 04, 2014 Controller Architecture Network Applica3ons Management D4A Protec3on
Cisco Sample App: M. Rehak, Cisco February 04, 2014
Example: ¡Service ¡Provider ¡Edi2on ¡
Base ¡Network ¡Service ¡Func3ons
¡ ¡ ¡
Management ¡ ¡ GUI/CLI ¡ Controller ¡Pla?orm ¡ Southbound ¡Interfaces ¡ & ¡Protocol ¡Plugins ¡ OpenDaylight ¡APIs ¡(REST) ¡ Data ¡Plane ¡Elements ¡ (Virtual ¡Switches, ¡ Physical ¡Device ¡Interfaces) ¡ Service ¡Abstrac3on ¡Layer ¡(SAL) ¡ (plug-‑in ¡mgr., ¡capability ¡abstrac3ons, ¡flow ¡programming, ¡inventory, ¡…) ¡ OpenFlow ¡ 1.0 ¡ 1.3 ¡ LISP ¡
Topology ¡ Mgr ¡ Stats ¡ Mgr ¡ Switch ¡ Mgr ¡ Affinity ¡ Service ¡ Network ¡Applica3ons ¡ Orchestra3on ¡& ¡Services ¡
OpenFlow ¡Enabled ¡Devices ¡
LISP ¡ Service ¡
NETCONF ¡ BGP ¡ Addi2onal ¡Virtual ¡& ¡Physical ¡ Devices ¡ SNMP ¡ D4A ¡Protec3on ¡ Open ¡vSwitches ¡ PCEP ¡ OVSDB ¡
FRM ¡ ARP ¡ Handler ¡ Host ¡ Tracker ¡
Model-‑Driven ¡SAL ¡(MD-‑SAL) ¡ API-‑Driven ¡SAL ¡(AD-‑SAL) ¡
Base ¡Network ¡Service ¡Func3ons ¡ ¡
Topology ¡ Mgr ¡ Stats ¡ Mgr ¡ Switch ¡ Mgr ¡ FRM ¡ ARP ¡ Handler ¡ Host ¡ Tracker ¡ Affinity ¡ Service ¡ LISP ¡ Service ¡
Service ¡Func3ons ¡
Topology ¡ Exporter ¡ Topology ¡ Exporter ¡ Topology ¡ Exporter ¡ Topology ¡ Exporter ¡ Topology ¡ Exporter ¡ Inventor y ¡ Manager ¡
Base ¡Network ¡Func3ons ¡ ¡ Config ¡ Subsystem ¡
NSF ¡Adapters ¡ NSF ¡Adapters ¡ NSF ¡Adapters ¡ PCEP ¡ Stats ¡ Mgr ¡ FRM ¡
OpenFlow ¡ 1.0 ¡ 1.3 ¡ OpenFlow ¡Enabled ¡Devices ¡ NETCONF ¡ Addi2onal ¡Virtual ¡& ¡Physical ¡ Devices ¡ Open ¡vSwitches ¡ PCEP ¡ BGP-‑LS ¡ SNMP ¡ LISP ¡ OVSDB ¡ OpenFlow ¡ 1.0 ¡ RESTCONF ¡ REST ¡ REST ¡ REST ¡ REST ¡ REST ¡ REST ¡ REST ¡ REST ¡ Management ¡ ¡ GUI/CLI ¡ D4A ¡Protec3on ¡
Example: ¡Service ¡Provider ¡Edi2on ¡
NETCONF ¡
Controller ¡PlaPorm ¡
SB ¡Plugin ¡1 ¡ SB ¡Plugin ¡2 ¡ Service ¡ Plugin ¡1 ¡ Service ¡ Plugin ¡1 ¡
AD-‑SAL ¡
Adapta2on ¡ Request ¡Rou2ng ¡ Plugin ¡NB ¡Java ¡API ¡ REST ¡API ¡ Plugin ¡SB ¡Java ¡API ¡ REST ¡API ¡ Service ¡NB ¡Java ¡API ¡
... ¡ ... ¡
Controller ¡PlaPorm ¡
SB ¡Plugin ¡1 ¡ SB ¡Plugin ¡2 ¡ Service ¡ Plugin ¡1 ¡ Service ¡ Plugin ¡1 ¡
MD-‑SAL ¡
Modeled ¡SB ¡Java ¡API ¡ RESTCONF ¡ Modeled ¡Service ¡NB ¡Java ¡API ¡
... ¡
Request ¡ ¡ Rou2ng ¡ SB ¡Plugin ¡Model ¡
“Is ¡generated ¡from” ¡
NB ¡Service ¡Model ¡
“Is ¡generated ¡from” ¡
SB ¡Model ¡ Data ¡ NB ¡Model ¡ Data ¡ Data ¡Store ¡
Adapta3on ¡ Plugin ¡
AD-‑SAL ¡key ¡services: ¡
MD-‑SAL ¡key ¡services: ¡
Controller ¡PlaPorm ¡
NETCONF ¡
MD-‑SAL ¡
... ¡
BGP-‑LS ¡Topology ¡ Exporter ¡ ¡ OpenFlow ¡Topology ¡ Exporter ¡ ¡ Flow-‑Capable ¡Node ¡ Inventory ¡Manager ¡ ¡ Model ¡
/Opera2onal ¡ /Config ¡ network-‑topo ¡ BGP-‑LS ¡ BGPv4 ¡ BGPv6 ¡ nodes ¡ links ¡ prefixes ¡ n1 ¡ n2 ¡ nx ¡ l2 ¡ l1 ¡
... ¡ ... ¡
lx ¡ p1 ¡ p2 ¡ ... ¡ px ¡ OpenFlow ¡ nodes ¡ nc:1 ¡ nc:2 ¡
BGP-‑LS ¡ Protocol ¡Plugin ¡
Of:n ¡
... ¡
Groups ¡ Tables ¡ Meters ¡ Ports ¡ Table/2 ¡ Table/1 ¡ Table/n ¡ Flow/1 ¡ Flow/2 ¡ Flow/n ¡
... ¡
Table-‑stats ¡ Flow-‑stats ¡ Flow-‑stats ¡
Sta3s3cs ¡Manager ¡ ¡ Model ¡ Model ¡ Model ¡
Model-‑Driven ¡SAL ¡(MD-‑SAL) ¡
Config ¡ Subsystem ¡
RESTCONF ¡ App ¡ NETCONF ¡ Protocol ¡Plugin ¡ ¡ Model ¡ Service/App ¡ Plugin ¡ ¡ Model ¡ Protocol ¡Plugin ¡ ¡ Model ¡ Service/App ¡ Plugin ¡ ¡ Model ¡
... ¡ ... ¡
Network ¡Devices ¡
... ¡
App ¡ Controller ¡Pla?orm ¡ Southbound ¡Interfaces ¡ & ¡Protocol ¡Plugins ¡ Network ¡Applica3ons ¡ Orchestra3on ¡& ¡Services ¡ Data ¡Plane ¡Elements ¡ Clustering ¡
Data ¡Store ¡ Message ¡Bus ¡
Remote ¡Container ¡Instance ¡ Remote ¡Container ¡Instance ¡
Model ¡ Model ¡ Yang ¡Model ¡ Java ¡API ¡Defini2on ¡ Java ¡API ¡Defini2on ¡ Generated ¡API ¡ Defini2on ¡ Module ¡ Implementa2ons ¡
Yang ¡Tools ¡ “Plugin” ¡ OSGI ¡Bundle ¡ 1 ¡ 4 ¡ Generate ¡APIs ¡ Create ¡Plugin ¡Bundle ¡ Deploy ¡ Maven ¡ Build ¡Tools ¡
Module ¡ Implementa2ons ¡ Plugin ¡source ¡code ¡
“API” ¡ ¡ OSGI ¡Bundle ¡ Maven ¡ Build ¡Tools ¡ 2 ¡ 3 ¡ Create ¡API ¡Bundle ¡ 4 ¡ Deploy ¡
Controller ¡
hdp://sdnhub.org/tutorials/opendaylight/ ¡
N ¡
Controller ¡PlaPorm ¡
The ¡Learning ¡Switch ¡ Applica3on ¡
Openflow ¡Protocol ¡Model ¡ (Pkt ¡in,Pkt ¡out) ¡
OpenFlow ¡1.0/1.3 ¡Plugin ¡ OpenFlow ¡Java ¡Library ¡ MD-‑SAL ¡ Switch ¡
No2fica2on ¡ Delivery ¡ Request ¡ ¡ Rou2ng ¡ 1 ¡ 2 ¡ 3 ¡ 4 ¡ 5 ¡ 6 ¡ 7 ¡
/config ¡
Flow ¡
FRM ¡
Request ¡ ¡ Rou2ng ¡
RESTCONF ¡
Flow-‑capable ¡Node ¡Model ¡ (Flow ¡programming) ¡
8 ¡ 9 ¡ 10 ¡ 11 ¡ 12 ¡ 13 ¡ NoBficaBon ¡ RPC ¡ RPC ¡ FlowMod ¡ PktOut ¡ PktIn ¡
> ¡git ¡clone ¡https://git.opendaylight.org/gerrit/p/openflowplugin.git ¡
> ¡cd ¡ ¡openflowplugin/samples/learning-‑switch/ ¡ > ¡mvn ¡clean ¡install ¡
‘openflowplugin/samples/learning-‑switch/target’ ¡
SAL_App_Tutorial ¡
repositories/opendaylight.release/org/opendaylight/integra2on/distribu2ons-‑ base/0.1.1/ ¡
> ¡rm ¡opendaylight/plugins/
Put ¡the ¡‘learning-‑switch-‑0.0.3-‑SNAPSHOT.jar’ ¡bundle ¡into ¡the ¡‘opendaylight/plugins’ ¡folder ¡
Op2onally, ¡add ¡the ¡following ¡line ¡to ¡configura2on/logback.xml ¡file: ¡ <logger ¡name="org.opendaylight.openflowplugin.learningswitch" ¡level="TRACE"/> ¡
¡
> ¡./run.sh ¡-‑of13 ¡
START ¡LEVEL ¡6 ¡ ¡ ¡ ¡ID|State ¡ ¡ ¡ ¡ ¡ ¡|Level|Name ¡ ¡ ¡103|Active ¡ ¡ ¡ ¡ ¡| ¡ ¡ ¡ ¡4|learning-‑switch ¡(0.0.3.SNAPSHOT) ¡
On ¡a ¡Linux ¡console, ¡type: ¡
> ¡netstat ¡-‑lnp ¡| ¡grep ¡'java’ ¡
On ¡a ¡Mac ¡OSX ¡console, ¡type: ¡
> ¡lsof ¡-‑i ¡| ¡grep ¡LISTEN ¡|grep ¡java ¡
> ¡sudo ¡mn ¡-‑-‑topo ¡single,10 ¡ ¡-‑-‑controller ¡'remote,ip=<controller-‑ip-‑ address>,port=6633' ¡-‑-‑switch ¡ovsk,protocols=OpenFlow13 ¡
tree; ¡ ¡
node's ¡parent ¡nodes ¡
InstanceIdentifier<Node> ¡identifier ¡= ¡ InstanceIdentifier.builder(Nodes.class).child(Node.class,new ¡ NodeKey("foo")).build(); ¡
¡
http://localhost:8080/restconf/config/inventory:nodes/node/foo ¡
the ¡ini2al ¡flow ¡into ¡the ¡switch: ¡
On ¡a ¡REST ¡console, ¡issue: ¡
GET ¡http://<contr-‑ip-‑address>:8080/restconf/operational/
Accept ¡Header: ¡application/xml ¡
There ¡should ¡be ¡one ¡flow ¡on ¡the ¡switch ¡forwarding ¡all ¡packets ¡to ¡the ¡ controller ¡
mininet> ¡pingall ¡
6 ¡more ¡flows ¡should ¡be ¡installed ¡in ¡the ¡host. ¡
sudo ¡mn ¡-‑-‑topo ¡tree,3 ¡ ¡-‑-‑controller ¡'remote,ip=192.168.4.1:6653' ¡-‑-‑ switch ¡ovsk,protocols=OpenFlow13 ¡
N ¡
Controller ¡PlaPorm ¡
BGP-‑LS ¡Topology ¡Exporter ¡
Openflow ¡Protocol ¡Model ¡ (Pkt ¡in,Pkt ¡out) ¡
BGP-‑LS ¡Plugin ¡ MD-‑SAL ¡
1 ¡ 2 ¡ 3 ¡ 4 ¡ 5 ¡ 6 ¡
/oper ¡
BGP-‑LS ¡Topology ¡
RESTCONF ¡
Flow-‑capable ¡Node ¡Model ¡ (Flow ¡programming) ¡
MD-‑SAL ¡Set ¡ BGP ¡PDU ¡
/oper ¡
BGP-‑RIB ¡
MD-‑SAL ¡NoBficaBon ¡ MD-‑SAL ¡Set ¡