Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Yang in OpenDaylight

7,151 views

Published on

Slides from Talk by Jan Medved on Yang modeling and its support in OpenDaylight meetup

http://www.meetup.com/OpenDaylight-Silicon-Valley/events/212834752

Yang is a data modeling language that is rapidly being adopted to model Netconf, an IETF standardized network management protocol, as well as to model other data interfaces in OpenDaylight. Join us for the talk by expert Jan Medved to learn about Yang and its usage within OpenDaylight.

Published in: Engineering
  • Be the first to comment

Yang in OpenDaylight

  1. 1. Yang Modeling in OpenDaylight Jan Medved
  2. 2. Agenda • Yang Overview • Netconf/Yang in OpenDaylight • Example/Demo • Pointers © 2014 Cisco and/or its affiliates. Presentation_ID All rights reserved. Cisco Public
  3. 3. Yang Overview
  4. 4. YANG is …. • A NETCONF modeling language – Think SMI for NETCONF • Models semantics and data organization – Syntax falls out of semantics • Able to model config data, state data, RPCs, and notifications • Based on SMIng syntax – Text-based • Email, patch, and RFC friendly © 2014 Cisco and/or its affiliates. Presentation_ID All rights reserved. Cisco Public
  5. 5. YANG Concepts RPCs notifications leafs config data types Standard Models © 2014 Cisco and/or its affiliates. Presentation_ID All rights reserved. Cisco Public Proprietary Models containers
  6. 6. YANG .... • Directly maps to XML content (on the wire) • Extensible – Add new content to existing data models • Without changing the original model – Add new statements to the YANG language • Vendor extensions and future proofing • Preserves investment in SNMP MIBs – libsmi translates MIBs to YANG • See tools at www.yang-central.org © 2014 Cisco and/or its affiliates. Presentation_ID All rights reserved. Cisco Public
  7. 7. Semantics and syntax © 2014 Cisco and/or its affiliates. Presentation_ID All rights reserved. Cisco Public YANG XML Schema Relax-NG Anything Else Legacy tools Out going XML Semantic World Syntactic World Validation
  8. 8. YANG values .... • Readers and reviewers time and learning curve – Readability is highest priority • Limited Scope – Doesn't boil the ocean – Maximize utility within that scope – Can be extended in the future • Experience gained by existing implementations – Based on four proprietary modeling languages • Years of experience within multiple vendors • Quality draft backed by running code © 2014 Cisco and/or its affiliates. Presentation_ID All rights reserved. Cisco Public
  9. 9. Modules and submodules • Header statements – yang-version, namespace, prefix • Linkage statement – import and include • Meta information – organization, contact • Revision history – revision © 2014 Cisco and/or its affiliates. Presentation_ID All rights reserved. Cisco Public Mod1 SubA SubX SubY SubZ Mod2 Include Import Include
  10. 10. module acme-module {! namespace "http://acme.example.com/module";! prefix acme;! ! import "yang-types" {! prefix yang;! }! include "acme-system";! ! organization "ACME Inc.";! contact joe@acme.example.com;! description "The module for entities ! implementing the ACME products";! ! revision 2007-06-09 {! description "Initial revision.";! }! …! }! © 2014 Cisco and/or its affiliates. Presentation_ID All rights reserved. Cisco Public
  11. 11. The "leaf" Statement YANG Example:! ! leaf host-name {! type string;! mandatory true;! config true;! description "Hostname for this system";! }! © 2014 Cisco and/or its affiliates. Presentation_ID All rights reserved. Cisco Public • A leaf has – one value – no children – one instance NETCONF XML Encoding:! ! <host-name>my.example.com</host-name>!
  12. 12. The "leaf-list" Statement YANG Example:! ! leaf-list domain-search {! type string;! ordered-by user;! description "List of domain names to search";! }! © 2014 Cisco and/or its affiliates. Presentation_ID All rights reserved. Cisco Public • A leaf-list has: – one value – no children – multiple instances NETCONF XML Encoding:! ! <domain-search>high.example.com</domain-search>! <domain-search>low.example.com</domain-search>! <domain-search>everywhere.example.com</domain-search>!
  13. 13. The "container" Statement YANG Example:! ! container system {! container services {! container ssh {! presence "Enables SSH";! description "SSH service specific configuration";! // more leafs, containers and stuff here...! }! }! }! © 2014 Cisco and/or its affiliates. Presentation_ID All rights reserved. Cisco Public n A container has" n no value" n holds related children" n one instance" NETCONF XML Encoding:! ! <system>! <services>! <ssh/>! </services>! </system>! May have specific meaning (presence) Or may simply contain other nodes
  14. 14. The "must" Statement container timeout {! leaf access-timeout {! description "Maximum time without server response";! units seconds;! mandatory true;! type uint32;! }! leaf retry-timer {! • Constrains nodes by Xpath expression description "Period to retry operation";! units seconds;! type uint32;! must "$this < ../access-timeout" {! error-app-tag retry-timer-invalid;! error-message "The retry timer must be "! + "less than the access timeout";! }! }! }! © 2014 Cisco and/or its affiliates. Presentation_ID All rights reserved. Cisco Public
  15. 15. The "list" Statement YANG Example:! ! list user {! key name;! leaf name {! type string;! }! leaf uid {! type uint32;! }! leaf full-name {! type string;! }! leaf class {! type string;! default viewer;! }! }! © 2014 Cisco and/or its affiliates. Presentation_ID All rights reserved. Cisco Public • A list is – uniquely identified by key(s) – holds related children – no value – multiple instances NETCONF XML Encoding:! !

×