Automate | Orchestrate | Remediate
OpenDaylight and YANGA northbound perspective ...
SDN is the physical separation of the network control plane from the forwarding plane and where the control plane controls several devices.
So what should this control plane (SDN Controller) be?The SDN
A platform for deploying SDN applications
Provide (or be associated with) an SDN application development environment
SDN Controller: Platform Requirements
FlexibilityAccommodate a variety of diverse applicationsController applications SHOULD use a common framework and programming model and provide consistent APIs to their client
Scale the development process:No infrastructure code hotspotsIndependent development of controller applications & short integration times
Run-time Extensibility and Modularity:Load new protocol and service/application plugins at run-time.Adapt to data schemas (models) discovered in the network
Performance & Scale
SDN Controller: App Development Requirements
A DSL for modeling to describe internal and external system behavior
Modeling tools for the controller aligned with modeling tools for devices
Code generation from models:Enforce standard API contractsGenerate boilerplate code performing repetitive and error-prone tasksProduce functionally equivalent APIs for different language bindingsModel-to-model adaptations for services and devicesConsumption of aligned device models
In the OpenDaylight Project, these requirements are satisfied with YANG (and YANG extensions) and via the YANG tool-chain, manifested in the MD-SAL
OpenDaylight Solution
YANG models defined in MD-SAL help in generating the bindings for the RESTCONF and the south-bound plugins
OpenDaylight Software Architecture
MD-SAL Overview• Model Driven Service Abstraction Layer (MD-SAL) is the core of Opendaylight
project which helps in connecting between different layer & modules through well
defined API
• The MD-SAL uses YANG as the modeling language for both interface and data
definitions, and provides a messaging and data-centric runtime for such services
based on YANG modelling
• YANG tools is used to compile YANG template and generate Java classes/interfaces
and automatically build REST API doc explorer.
Yangtools
Generates Java code from YANG
Provides ‘codecs’ to convert
Generated Java classes to DOM
DOM to various formats
XML
JSON
Etc.
Codecs make possible automatic:
RESTCONF
NETCONF
AMQP
Other bindings
YANG → Java … why?Immutable: to avoid thread contentionStrongly typed: reduce coding errorsConsistent: reduce learning curveImprovable – generation can be improved and all DTOs get those improvements immediately system wideAutomated Bindings:
restconf – xml and jsonnetconfamqp and xmpp – on the horizon
Runtime Generatable
Consistent Data Transfer Objects (DTOs) everywhere
MD-SAL : Model-Driven Service Abstraction Layer
MD-SAL Details
MD-SAL – The 3 Brokers
Plugin development
14
Annexure
Yang to Java Example - typedef
15
Yang Java
public class BridgeName implements Serializable { private final String _value;
@ConstructorProperties("value") public BridgeName(String _value) { … } public BridgeName(BridgeName source) { this._value = source._value; }
public String getValue() { return _value; } …}
typedef bridge-name { type string;}
Yang to Java Example - grouping
16
Yang Java
public interface BridgeAttributes extends DataObject { BridgeName getBridgeName(); …}
grouping bridge-attributes { leaf bridge-name { type bridge-name; } …}
Yang to Java Eg - container - interface
17
Yang Java
public interface ConnectionInfo extends Augmentable<ConnectionInfo>, ConnectionInfoAttributes { }
container connection-info { uses connection-info-attributes;}
Yang to Java Eg - container - builder
18
Yang Java
public class ConnectionInfoBuilder implements Builder <ConnectionInfo> { /* fields */ public void setRemoteIp(IpAddress value) … public IpAddress getRemoteIp() … public ConnectionInfo build() { return new ConnectionInfoImpl(this); } }
container connection-info { uses connection-info-attributes;}
Yang to Java Example - list - interface
19
Yang Java
public interface ControllerEntry extends Augmentable<ControllerEntry>, Identifiable<ControllerEntryKey> { Uri getTarget();
ControllerEntryKey getKey(); …}
list controller-entry { key “target” leaf target { type inet:uri; }}
Yang to Java Example - list - builder
20
Yang Java
public class ControllerEntryBuilder implements Builder <ControllerEntry> { /* fields */ public ControllerEntryBuilder setTarget(Uri value) { … } … public Uri getTarget(Uri value) {…} ControllerEntryKey getKey() {…} … public ControllerEntry build() { return new ControllerEntryImpl(this); } …}
list controller-entry { key “target” leaf target { type inet:uri; }}
Yang to Java Eg. - rpc service interface
21
Yang Java
public interface HelloService extends RpcService { Future<RpcResult<HelloWorldOutput>> helloWorld( HelloWorldInput input);
}
rpc hello-world { input { leaf name { type string; } } output { leaf greating { type string; } }}
Yang to Java Eg. - rpc - input interface
22
Yang Java
public interface HelloWorldInput extends DataObject, Augmentable<HelloWorldInput> { String getName();
}
rpc hello-world { input { leaf name { type string; } } output { leaf greating { type string; } }}
Yang to Java Example - rpc – input builder
23
Yang Java
public class HelloWorldInputBuilder implements Builder <HelloWorldInput> { /* fields */
public HelloWorldInputBuilder setName(String value) { this._name = value; return this; } public HelloWorldInput build() { return new HelloWorldInputImpl(this); } …}
rpc hello-world { input { leaf name { type string; } } output { leaf greating { type string; } }}
Yang to Java Eg. - rpc - output interface
24
Yang Java
public interface HelloWorldOutput extends DataObject, Augmentable<HelloWorldOutput> { String getGreating();
}
rpc hello-world { input { leaf name { type string; } } output { leaf greating { type string; } }}
Yang to Java Eg. - rpc - output builder
25
Yang Java
public class HelloWorldOutputBuilder implements Builder <HelloWorldOutput> { /* fields */
public HelloWorldOutputBuilder setName(String value) { this._name = value; return this; } public HelloWorldOutput build() { return new HelloWorldOutputImpl(this); } …}
rpc hello-world { input { leaf name { type string; } } output { leaf greating { type string; } }}
Yang to Java Eg. - notification - interface
26
Yang Java
public interface RandomGreetingNotification extends ChildOf<DataObject>, Augmentable<RandomGreetingNotification>, Notification { String getRandomGreeting();}
notification random-greeting-notification { leaf random-greeting { type string; }}
Yang to Java Example - notification - builder
27
Yang Java
public class RandomGreetingNotificationBuilder implements Builder<RandomGreetingNotification> {
public RandomGreetingNotificationBuilder setRandomGreeting(String value) { this._randomGreeting = value; return this; }
public RandomGreetingNotification build() { return new RandomGreetingNotificationImpl(this); } …}
notification random-greeting-notification { leaf random-greeting { type string; }}
28
Thank You
Connect with us@
Email: [email protected] [email protected]
LinkedIn: http://in.linkedin.com/in/arsabapathy
Twitter: https://twitter.com/arsabapathy