Kalua – A DML for NETCONF [email protected] [email protected] [email protected]...

26

Transcript of Kalua – A DML for NETCONF [email protected] [email protected] [email protected]...

Page 2: Kalua – A DML for NETCONF bernd.linowski@nsn.com martin.storch@nsn.com mikko.lahdensivu@nsn.com mehmet.ersue@nsn.com.

Kalua Basics

• In the first place, Kalua is a DML for NETCONF: supports the immediate needs of the NETCONF

protocol provides modeling features for . . .

• the payload of NETCONF get-/edit(-config) operations• NETCONF notifications

uses precedent discussion in RFC 3535 as a guidance

• But Kalua also . . . addresses extensibility and broader applicability integrates data modeling and information modeling

features aims to support also solutions for different other IETF

issues, e.g. in OPS and APPS areas

Page 3: Kalua – A DML for NETCONF bernd.linowski@nsn.com martin.storch@nsn.com mikko.lahdensivu@nsn.com mehmet.ersue@nsn.com.

Kalua Basics (II)

• XML based language Basic parsing / generation / editing support

available everywhere No need to learn a new grammar Basic validation with Kalua XSD

• Kalua is XSD “Mappable” Reuses concepts from XSD

Page 4: Kalua – A DML for NETCONF bernd.linowski@nsn.com martin.storch@nsn.com mikko.lahdensivu@nsn.com mehmet.ersue@nsn.com.

Kalua Basics

Kalua

Model

(XML)

Kalua

Model Schemas

(XSD)

KaluaModel

Schemas

(XSD)

NETCONF

Payload

(XML)

Metamodel Layer

Kalua

Schema

(XSD)

Model Layer

Data Layer

validates

generated from

validates

Page 5: Kalua – A DML for NETCONF bernd.linowski@nsn.com martin.storch@nsn.com mikko.lahdensivu@nsn.com mehmet.ersue@nsn.com.

Kalua Features

• Build-ins based on “XML Schema 1.1 Part 2: Datatypes”• Simple-type Modeling:

Restrictions, Enums, Unions and possible combinations

• Data modeling Attributes, Structures, Sequences, Type-Defs, …

• Essential object-oriented modeling Classes, Inheritance, Relationships, …

• Modularity Model import, Multiple model release support

• Extensibility Typed annotations

Page 6: Kalua – A DML for NETCONF bernd.linowski@nsn.com martin.storch@nsn.com mikko.lahdensivu@nsn.com mehmet.ersue@nsn.com.

Complex Datatype Modeling

• Structures: set of attributes may use attribute

groups may have a key

• Sequences: min & max-length

(unbounded) ordering relevance

• Type-Defs Makes a datatype

available for reuse

<structure><attribute name=“x”>

<type>double</type><attribute/><attribute name=“y”>

<type>double</type></attribute>

</structure>

<sequence minLength=“1” maxLength=“unbounded”>

<type>string</type></sequence>

<typedef name=“Point”> <structure> …</structure>

</typedef>

Page 7: Kalua – A DML for NETCONF bernd.linowski@nsn.com martin.storch@nsn.com mikko.lahdensivu@nsn.com mehmet.ersue@nsn.com.

Modules

• Packages Kalua model elements

• Own namespace• XML mapping

support ns-uri ns-prefix

• May import other modules

…<module name=“SDH”><ns-prefix>sdh</ns-prefix><ns-uri>http://www.xyz.com/sdh</ns-uri><release>S7.0</release>

<import><ns-prefix>tp</ns-prefix><ns-uri>http://www.xyz.com/tp</ns-uri>

</import>…

</module>…

Page 8: Kalua – A DML for NETCONF bernd.linowski@nsn.com martin.storch@nsn.com mikko.lahdensivu@nsn.com mehmet.ersue@nsn.com.

Module Releases

• Identifies a particular release of a module

• Release is typically tied to NE release

• Applies to all model elements in the module

<module name=“SDH”><ns-uri>http://xyz.com/sdh</ns-uri><ns-prefix>sdh</ns-prefix><release>S7.0</release>

</module>

<module name=“SDH”><ns-uri>http://xyz.com/sdh</ns-uri><ns-prefix>sdh</ns-prefix><release>S8.1</release>

</module>

<import><ns-uri>http://xyz.com/sdh</ns-uri><ns-prefix>sdh</ns-prefix><release>S8.1</release>

</import>

Page 9: Kalua – A DML for NETCONF bernd.linowski@nsn.com martin.storch@nsn.com mikko.lahdensivu@nsn.com mehmet.ersue@nsn.com.

Attribute Groups

• Equivalent to attribute groups in XML Schema

• Bundles attributes• Reused by

Structures Classes other attribute groups

• Does not define a type

…<attribute-group name=“FTP_Access”><attribute name=“ftpServerAddress”>

<type>string</type>…

<attribute/><attribute name=“ftpServerPort”>

<type>unsignedShort</type>…

</attribute></attribute-group>…

…<use attribute-group=“FTP_Access”> …

Page 10: Kalua – A DML for NETCONF bernd.linowski@nsn.com martin.storch@nsn.com mikko.lahdensivu@nsn.com mehmet.ersue@nsn.com.

Classes• Blueprints for

network elements or abstract entities

• Defines a type• Has it’s own identity• potentially independent

life-cycle• Endpoint of relationships• May be abstract• May use attribute groups

…<class name=“Location”></abstract><attribute name=“locId”> <type>string</type></attribute><key><member>locId</type>

</key></class>…

Page 11: Kalua – A DML for NETCONF bernd.linowski@nsn.com martin.storch@nsn.com mikko.lahdensivu@nsn.com mehmet.ersue@nsn.com.

Class Inheritance

• Establishes an “is-a” relationship

• Reuse of features from base class attributes keys relationships

• Avoid multiple-inheritance for the sake of reduced complexity

…<class name=“Location”> <!–- see previous slide --></class>…

…<class name=“GridLocation”><super-class>Location</super-class><attribute name=“x”>…

<attribute name=“y”>…

</class>…

Page 12: Kalua – A DML for NETCONF bernd.linowski@nsn.com martin.storch@nsn.com mikko.lahdensivu@nsn.com mehmet.ersue@nsn.com.

Reference Relationships

• Connect a source and a target class

• Relate instances regardless of their context of use

• Specify the multiplicity of the relationship (e.g. 1:1, 1:n, n:m)

• May be read-only• May specialize a base

relationship

…<relationship name=“locatedAt”><kind><reference/></kind><source><class>ManagedObject</class><role>locatedObject</role>

</source><target><class>Location</class><role>location</role><maxCardinality>1</maxCardinality>

</target></relationship>…

Page 13: Kalua – A DML for NETCONF bernd.linowski@nsn.com martin.storch@nsn.com mikko.lahdensivu@nsn.com mehmet.ersue@nsn.com.

Calculated Relationships

• Explicit relationships derived from configuration data

• Read-only • Avoids “informally

described” relationships

• Condition determines related instances

• Dynamic (re-)evaluation whenever a relationship is queried

…<relationship name=“ConnectedTo”><kind><condition>$source/remoteLinkId =

$target/linkId and$source/remoteTslot =$target/tslot

</condition></kind><source><class>PCM_TP</class><role>localTP</role>

</source><target><class>PCM_TP</class><role>remoteTP</role>

</target></relationship>…

Page 14: Kalua – A DML for NETCONF bernd.linowski@nsn.com martin.storch@nsn.com mikko.lahdensivu@nsn.com mehmet.ersue@nsn.com.

Typed Annotations

• Annotations enhance semantics of

existing DML elements Address new modeling

needs

• Annotation Types Force correct usage of

model extensions Define annotation

properties

…<annotation-type name=“SMI_Ref”><annotatable-type>class

</annotatable-type><annotation-property-type name=“OID”><pattern>

[0-9]+(\.[0-9]+)* </pattern></annotation-property-type>

</annotation-type>…

<class name=“BroadbandRouter”> ...<annotation name=“SMI_Ref”><e name=“OID”>1.3.6.1.4.1.999</e>

</annotation>...

</class>

Page 15: Kalua – A DML for NETCONF bernd.linowski@nsn.com martin.storch@nsn.com mikko.lahdensivu@nsn.com mehmet.ersue@nsn.com.

Thank you!

For more information please read:

NETCONF Data Modeling Language Requirementshttp://tools.ietf.org/html/draft-linowski-netconf-dml-requirements-01

Kalua - A Data Modeling Language for NETCONFhttp://www.ietf.org/internet-drafts/draft-ersue-netconf-kalua-dml-01.txt

Page 16: Kalua – A DML for NETCONF bernd.linowski@nsn.com martin.storch@nsn.com mikko.lahdensivu@nsn.com mehmet.ersue@nsn.com.

Back-UP Slides

Page 17: Kalua – A DML for NETCONF bernd.linowski@nsn.com martin.storch@nsn.com mikko.lahdensivu@nsn.com mehmet.ersue@nsn.com.

Kalua Example: Partial Lock RPC<kalua:module name="NCPL" xmlns:kalua="urn:ietf:params:xml:ns:kalua:1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:ietf:params:xml:ns:kalua:1:\Users\kalua\kalua.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <presentation>NETCONF partial lock</presentation> <description>NETCONF partial lock operations</description> <ns-uri>urn:ietf:params:xml:ns:netconf:partial-lock:1.0</ns-uri> <ns-prefix>ncpl</ns-prefix> <release>1</release> <organization>IETF</organization> <import> <ns-uri>urn:ietf:params:xml:ns:netconf:base:1.0</ns-uri> <ns-prefix>nc</ns-prefix> </import> <attribute-group name="lock_id_attribute"> <attribute name="lock_id"> <type>kalua:unsignedInt</type> </attribute> </attribute-group> <operation name="partial_lock"> <description>This operation defines the element for partial-lock RPC operation.</description> <input>

Page 18: Kalua – A DML for NETCONF bernd.linowski@nsn.com martin.storch@nsn.com mikko.lahdensivu@nsn.com mehmet.ersue@nsn.com.

Kalua Example: Partial Lock RPC (II) <attribute name="config_name"> <type>nc:config_name</type> </attribute> <attribute name="select"> <sequence> <type>kalua:string</type> </sequence> </attribute> </input> <output> <use> <attribute-group>lock_id_attribute</attribute-group> </use> </output> </operation> <operation name="partial_unlock"> <description>This operation defines the element for partial-unlock RPC operation. </description> <input> <use> <attribute-group>lock_id_attribute</attribute-group> </use> </input> </operation></kalua:module>

Page 19: Kalua – A DML for NETCONF bernd.linowski@nsn.com martin.storch@nsn.com mikko.lahdensivu@nsn.com mehmet.ersue@nsn.com.

DHCP Example <kalua:module name="DHCP" xmlns:kalua="urn:ietf:params:xml:ns:kalua:1"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:ietf:params:xml:ns:kalua:1

C:\Users\kalua\kalua.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><presentation>DHCP</presentation><description>DHCP example, as in http://tools.ietf.org/html/draft-presuhn-rcdml-03#appendix-C</description><ns-uri>http://example.org/ns/dhcp</ns-uri><ns-prefix>dhcp</ns-prefix><release>1</release><organization>Nokia Siemens Networks</organization><import>

<ns-uri>urn:ietf:params:xml:ns:netmod:base</ns-uri><ns-prefix>ndl</ns-prefix>

</import><import>

<ns-uri>http://example.com/ns/int</ns-uri><ns-prefix>int</ns-prefix><description>interfaces</description>

</import><class name="dhcp">

<attribute name="default_lease_time"><presentation>default-lease-time</presentation><type>kalua:int</type>

</attribute><attribute name="max_lease_time">

<presentation>max-lease-time</presentation><type>kalua:int</type>

</attribute></class>

Page 20: Kalua – A DML for NETCONF bernd.linowski@nsn.com martin.storch@nsn.com mikko.lahdensivu@nsn.com mehmet.ersue@nsn.com.

DHCP Example (II)<relationship name="subnets">

<kind><containment/>

</kind><source>

<class>dhcp</class><role>parent</role>

</source><target>

<class>subnet</class><role>children</role>

</target></relationship><typedef name="rangeType">

<structure><attribute name="dynamic_bootp">

<presentation>dynamic-bootp</presentation><type>kalua:boolean</type><defaultValueLiteral>true</defaultValueLiteral>

</attribute><attribute name="low">

<mandatory/><type>ndl:ipAddress</type>

</attribute><attribute name="high">

<mandatory/><type>ndl:ipAddress</type>

</attribute></structure>

</typedef>

Page 21: Kalua – A DML for NETCONF bernd.linowski@nsn.com martin.storch@nsn.com mikko.lahdensivu@nsn.com mehmet.ersue@nsn.com.

DHCP Example (III)

<class name="subnet"><attribute name="network">

<type>ndl:ipAddress</type></attribute><attribute name="prefix_length">

<presentation>prefix-length</presentation><type>kalua:int</type>

</attribute><attribute name="range">

<optional/><type>rangeType</type>

</attribute><attribute name="max_lease_time">

<presentation>max-lease-time</presentation><type>kalua:int</type>

</attribute>

Page 22: Kalua – A DML for NETCONF bernd.linowski@nsn.com martin.storch@nsn.com mikko.lahdensivu@nsn.com mehmet.ersue@nsn.com.

DHCP Example (IV)<attribute name="leases"><read-only/><sequence elementName="lease">

<structure><attribute name="ip_address">

<presentation>ip-address</presentation><type>ndl:ipAddress</type>

</attribute><attribute name="starts">

<type>kalua:dateTime</type></attribute><attribute name="ends">

<type>kalua:dateTime</type></attribute><attribute name="mac_address">

<presentation>mac-address</presentation>

<type>ndl:nsapAddress</type></attribute><key scope="local">

<member>ip_address</member></key>

</structure></sequence>

</attribute><attribute name="interface_filter">

<sequence elementName="interface"><type>kalua:string</type>

</sequence></attribute><key scope="global">

<member>network</member><member>prefix_length</member>

</key></class>

Page 23: Kalua – A DML for NETCONF bernd.linowski@nsn.com martin.storch@nsn.com mikko.lahdensivu@nsn.com mehmet.ersue@nsn.com.

DHCP Example (V)<typedef name="rangeType">

<structure><attribute name="dynamic_bootp">

<presentation>dynamic-bootp</presentation><type>kalua:boolean</type><defaultValueLiteral>true</defaultValueLiteral>

</attribute><attribute name="low">

<mandatory/><type>ndl:ipAddress</type>

</attribute><attribute name="high">

<mandatory/><type>ndl:ipAddress</type>

</attribute></structure>

</typedef><relationship name="dhcp_options_Rel">

<kind><containment/>

</kind><source>

<class>dhcp</class><role>dhcp</role>

</source><target>

<class>dhcp_options</class><role>dhcp_options</role>

</target></relationship>

Page 24: Kalua – A DML for NETCONF bernd.linowski@nsn.com martin.storch@nsn.com mikko.lahdensivu@nsn.com mehmet.ersue@nsn.com.

DHCP Example (VI)

<class name="dhcp_options"><presentation>dhcp-options</presentation><attribute name="router_list">

<presentation>router-list</presentation><sequence elementName="router">

<type>ndl:ipAddress</type></sequence>

</attribute><attribute name="domain_list">

<presentation>domain-list</presentation><sequence elementName="domain">

<type>ndl:ipAddress</type></sequence>

</attribute><attribute name="custom">

<structure><attribute name="option"><type>kalua:int</type></attribute><attribute name="ip_address">

<presentation>ip-address</presentation><type>ndl:ipAddress</type>

</attribute><attribute name="string"><type>kalua:string</type></attribute>

</structure></attribute>

</class>

Page 25: Kalua – A DML for NETCONF bernd.linowski@nsn.com martin.storch@nsn.com mikko.lahdensivu@nsn.com mehmet.ersue@nsn.com.

DHCP Example (VII)<relationship name="filtered_interfaces">

<kind><calculated> <condition>$source/interface_filter/interface = $target/ifName</condition></calculated>

</kind><source>

<class>subnet</class><role>filtering_subnet</role><maxCardinality>unbounded</maxCardinality>

</source><target>

<class>int:interface</class><role>filtered_interface</role><maxCardinality>unbounded</maxCardinality>

</target></relationship>

Page 26: Kalua – A DML for NETCONF bernd.linowski@nsn.com martin.storch@nsn.com mikko.lahdensivu@nsn.com mehmet.ersue@nsn.com.

DHCP Example (VIII)<class name="shared_network">

<attribute name="name"><type>kalua:string</type>

</attribute><key scope="global">

<member>name</member></key>

</class><relationship name="shared_network_subnets">

<kind><containment/>

</kind><source>

<class>shared_network</class><role>parent</role>

</source><target>

<class>subnet</class><role>children</role>

</target></relationship>

</kalua:module>