120 likes | 227 Vues
NETMOD Architecture. Phil Shafer phil@juniper.net IETF 72. Components of NETMOD. YANG Data modeling language and semantics Hierarchy of nodes Constraints on those nodes Mapping rules of YANG to XML Content on the wire YIN (XML-based syntax for YANG)
E N D
NETMOD Architecture Phil Shafer phil@juniper.net IETF 72
Components of NETMOD • YANG • Data modeling language and semantics • Hierarchy of nodes • Constraints on those nodes • Mapping rules of YANG to XML • Content on the wire • YIN (XML-based syntax for YANG) • Semantically equivalent, fully reversible, XML-based syntax • Same content, different format: more "<"s and ">"s • YIN is simply the data model in an XML syntax • Can be manipulated using existing XML tools (e.g., XSLT) • Mapping rules of YANG to DSDL • Including annotations for DSDL to preserve top-level semantics • Standard type library for use by YANG • yang-types.yang in draft-netmod-yang
Building Network Mgmt Solutions with YANG • NETCONF content defines two players: • Clients (Managers, Applications) • Servers (Agents, Devices) • NETCONF content can be handled in two ways: • Specific: hardcoded • Generic: driven by meta-data • YANG modules define machine-readable, human-oriented models which support the needs of all four areas
Where does YANG fit? Tells the app developer what the data can be modeled Specific App Tells the app's XML handler how to parse/build content Generic App Defines XML on the wire Tells the device parser how to parse/build content Generic Device Specific Device Tells the device developer what the model requires
Things you can generate from YANG • IDL Code generators (stubs) • Structure/Object definitions • Serializers, deserializers, etc • Specific code to enforce constraints • Database table definitions (SQL "create table" statements) • Meta-data • Drive CLI operation (completion, validation, etc) • Drive database instance creation • Documentation • API Docs • Release notes • UI Definitions • Support for Web pages • XSLT, XUL, SVG, VRML
Building Network Mgmt Solutions with YANG Some selected use cases: • Device developer / native implementation • On-device DSDL validation • Generic browser • VPN application developer
First Step:Write the YANG Module • Models are written in YANG • Both standard and proprietary content are supported • YANG is canonical form of model YANG Modules
Use Case #1:Device developer • Developer reads the models • Write code to support the model • Uses model's hierarchy • Enforces model's constraints • Transforms model view into device implementation, if needed YANG Modules Device Impl
Use Case #2:On-device DSDL validation • Compile YANG using toolset • Generate DSDL schema files • Device uses schema to validate configuration data • As data arrives in NETCONF operations, it can be checked • At validation time (commit), the entire config can be validated • DSDL can enforce hierarchy and many YANG constraints YANG Modules Config DSDL Schema Files Device
Use Case #3:Generic Browser • Compile YANG using toolset • Generate YIN files • Use XSLT to transform YIN into XSLT files • Use XSLT files to generate web pages for web-based config browser • Config -> [XSLT] -> XHTML YANG Modules YIN files App XSLT files Config
Use Case #4:VPN Application • Developer reads the models • Write code to support the model • Uses model's hierarchy • Enforces model's constraints • Transforms model into user-oriented view of VPNs • Uses generic YANG/ NETCONF library to send/recv data from the device, but uses VPN-cognoscent code to manipulate config data YANG Modules VPN App Impl
Deliverables • Architecture document • Informational RFC • YANG data modeling language and semantics • Proposed Standard • Mapping rules of YANG to XML • Proposed Standard • YIN (XML-based syntax for YANG) • Proposed Standard • Mapping rules of YANG to DSDL • Proposed Standard • Standard type library for use by YANG • Proposed Standard