Presentation is loading. Please wait.

Presentation is loading. Please wait.

YANG in a Nutshell The YANG Gang IETF 71. YANG has... A reasonable self-contained specification A focus on readers and reviewers Text-based Email, patch,

Similar presentations


Presentation on theme: "YANG in a Nutshell The YANG Gang IETF 71. YANG has... A reasonable self-contained specification A focus on readers and reviewers Text-based Email, patch,"— Presentation transcript:

1 YANG in a Nutshell The YANG Gang IETF 71

2 YANG has... A reasonable self-contained specification A focus on readers and reviewers Text-based Email, patch, and RFC friendly Limited Scope, but extensible Ability to model config data, state data, RPCs, and notifications Experience gained by existing implementations Design is based on four proprietary modeling languages

3 Support for YANG Running code (multiple implementations) People outside the YANG team using it in other WGs in the IETF Backing of several NETCONF implementers Growing group of fans and admirers

4 Semantics and syntax YANG Anything Else Legacy tools Out going XML Semantic World Syntactic World Validation XML Schema Relax-NG Models semantics and data organization Syntax falls out of semantics Think SMI for NETCONF Models semantics and data organization Syntax falls out of semantics Think SMI for NETCONF

5 container system { leaf host-name { type inet:host; description "Name of this host"; } container services { container ssh { presence "Enables SSH"; description "SSH service specific configuration"; // more leafs, containers and stuff here... } Easy to read, easy to learn Grok factor Direct encoding of data hierarchy Grok factor Direct encoding of data hierarchy fred

6 Model-Based Infrastructure YANG can form the infrastructure for the management plane inside the device Not required, but common wisdom Three implementations do this Ease the maintenance, stability, and enhance-ability of the device YANG can form the infrastructure for the management plane inside the device Not required, but common wisdom Three implementations do this Ease the maintenance, stability, and enhance-ability of the device Management Plane CLI Management application YANG Modules YANG Modules S1S2S3 NETCONF Server Subcomponents

7 Constraints using "must" container timeout { leaf access-timeout { description "Maximum time without server response"; units seconds; mandatory true; type uint32; } leaf retry-timer { 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"; } Constrains nodes by XPath expression Also: keyref unique range pattern Also: keyref unique range pattern

8 Extensibility with "augment" augment interfaces/interface { when "type = 'ethernet'"; container ether-options { leaf auto-negotiation { type empty; } fe-0/0/0 ethernet Extends data model Current or imported modules Inserts nodes Into an existing hierarchy Nodes appear in current module's namespace Original (augmented) module is unchanged Allows sparse augmentation Nodes are only added when condition is true "when" is XPath expression Extends data model Current or imported modules Inserts nodes Into an existing hierarchy Nodes appear in current module's namespace Original (augmented) module is unchanged Allows sparse augmentation Nodes are only added when condition is true "when" is XPath expression

9 The "grouping" Statement Defines a reusable collection of nodes Use multiple times A modules may use groupings imported from other modules Refinement Use as structure, record, or object Defines a reusable collection of nodes Use multiple times A modules may use groupings imported from other modules Refinement Use as structure, record, or object YANG Example: grouping target { leaf address { type inet:ip-address; description "Target IP address"; } leaf port { type inet:ip-port; description "Target port number"; } container peer { container destination { uses target; } NETCONF XML Encoding: 192.0.2.1 22

10 The "rpc" Statement Defines RPC method names input parameters output parameters Defines RPC method names input parameters output parameters rpc activate-software-image { input { leaf image-name { type string; } output { leaf status { type string; } image.tgz

11 Tools (yang-central.org) pyang (python) Validates YANG Translates between YANG and YIN (XML) Generates XSD yangto (binary) Validates YANG Generates XSD, dependencies, etc libsmi Translates SMI/SMIv2 MIBs to YANG Other goodies Emacs mode

12 YANGsters Unite! Read the draft There's a lot more in there Join the mailing list yang@ietf.org https://www.ietf.org/mailman/listinfo/yang Try out the tools www.yang-central.org Tutorial at: http://www.yang-central.org/twiki/bin/view/Main/YangTutorials


Download ppt "YANG in a Nutshell The YANG Gang IETF 71. YANG has... A reasonable self-contained specification A focus on readers and reviewers Text-based Email, patch,"

Similar presentations


Ads by Google