YANG in a Nutshell - PowerPoint PPT Presentation

1 / 12
About This Presentation
Title:

YANG in a Nutshell

Description:

Ability to model config data, state data, RPCs, and notifications ... rpc xmlns='urn:mumble' activate-software-image image-name image.tgz /image-name ... – PowerPoint PPT presentation

Number of Views:380
Avg rating:3.0/5.0
Slides: 13
Provided by: Juni153
Category:
Tags: yang | mumble | nutshell

less

Transcript and Presenter's Notes

Title: YANG in a Nutshell


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
  • Models semantics and data organization
  • Syntax falls out of semantics
  • Think SMI for NETCONF

Semantic World
YANG
Syntactic World
Anything Else
XML Schema
Relax-NG
Out going XML
Legacy tools
Validation
5
Easy to read, easy to learn
  • Grok factor
  • Direct encoding of data hierarchy

container system leaf host-name
type inethost description "Name of this
host" container services
container ssh presence "Enables
SSH" description "SSH service
specific configuration" // more
leafs, containers and stuff here...

ltsystemgt lthost-namegtfredlt/host-namegt
ltservicesgt ltssh/gt lt/servicesgt lt/systemgt
6
Model-Based Infrastructure
Management application
  • 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 Modules
CLI
NETCONF Server
YANG Modules
Management Plane
S1
S2
S3
Subcomponents
7
Constraints using "must"
  • Constrains nodes by XPath expression

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 lt
../access-timeout" error-app-tag
retry-timer-invalid error-message
"The retry timer must be "
"less than the access timeout"
  • Also
  • keyref
  • unique
  • range
  • pattern

8
Extensibility with "augment"
  • 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

augment interfaces/interface when "type
'ethernet'" container ether-options
leaf auto-negotiation type empty

ltinterfacesgt ltinterfacegt ltnamegtfe-0/0/0lt/nam
egt lttypegtethernetlt/typegt ltether-optionsgt
ltauto-negotiation/gt lt/ether-optionsgt
lt/interfacegt lt/interfacesgt
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

YANG Example grouping target leaf address
type inetip-address
description "Target IP address" leaf
port type inetip-port
description "Target port number"
container peer container destination
uses target
NETCONF XML Encoding ltpeergt ltdestinationgt
ltaddressgt192.0.2.1lt/addressgt ltportgt22lt/portgt
lt/destinationgt lt/peergt
10
The "rpc" Statement
rpc activate-software-image input
leaf image-name type string
output leaf status
type string
  • Defines RPC
  • method names
  • input parameters
  • output parameters

ltrpc xmlns"urnmumble"gt ltactivate-software-imag
egt ltimage-namegtimage.tgzlt/image-namegt
lt/activate-software-imagegt lt/rpcgt
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_at_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/Ya
    ngTutorials
Write a Comment
User Comments (0)
About PowerShow.com