1 / 15

Yang & Netconf

Simple tutorial. Yang & Netconf. Yang - M odules and submodules. Header statements yang-version, namespace, prefix Linkage statement import and include Meta information organization, contact Revision history revision. Yang - M odules and submodules. module besip-module {

summer
Télécharger la présentation

Yang & Netconf

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Simple tutorial Yang & Netconf

  2. Yang - Modulesand submodules • Header statements • yang-version, namespace, prefix • Linkage statement • import and include • Meta information • organization, contact • Revision history • revision

  3. Yang - Modules and submodules module besip-module{ namespace "besip"; prefix acme; import “my-types" { prefix mt; } include “some-submodule"; organization “BesipInc."; contact joe@mail.com; description “Example module"; revision 2011-08-15 { description "Initial revision."; } … }

  4. Yang - Statements • basic • leaf • leaf-list • container • list • special • must • when • augment

  5. Yang - Types • Integral • {,u}int{8,16,32,64} • String • string, enumeration, boolean • Binary data • binary • Bit fields • bits • References • instance-identifier, keyref • Other • typedef, union, grouping

  6. Yang - Example NETCONF <user> <name>glocks</name> <full-name>Goldie</full-name> <class>intruder</class> </user> <user> <name>snowey</name> <full-name>Snow</full-name> <class>free-loader</class> </user> <user> <name>rzull</name> <full-name>Repun</full-name> </user> YANG list user { key name; leaf name { type string; } leaf uid { type uint32; } leaf full-name { type string; } leaf class { type string; default viewer; } }

  7. Yang - RPC NETCONF <rpcxmlns="urn:mumble"> <activate> <inputText>some text </inputText> </activate> </rpc> <rpc-reply> <activate> <status> current status </status> </activate> </rpc> YANG rpc activate { input { leaf inputText{ type string; } } output { leaf status { type string; } } }

  8. Netconf • netconfd program is a NETCONF-over-SSH server implementation • driven directly by YANG files • robust and secure database interface using standard NETCONF protocol operations • Supports <candidate>, <running>, and <startup> databases • support for database locking, editing, validation • subtreeand full XPathfiltering • Complete XML 1.0 implementation with full support for XML Namespaces

  9. Netconf – DBs (XML document)

  10. Netconf - Session • Start session • Exchanging <hello> tag elements <hello> <capabilities> <capability>first-capability</capability> <!- - tag elements for additional capabilities - -> </capabilities> </hello> • End session <close-session> <kill-session>

  11. Netconf - Requests • Operation requests <rpc> <get-interface-information> <interface-name>ge-2/3/0</interface-name> <detail/> </get-interface-information> </rpc> <rpc-reply xmlns="URN" xmlns:junos="URL"> <ok/> </rpc-reply>

  12. Netconf - Requests • Configuration requests – get config <rpc> <get-config> <source> <candidate/> </source> <filter type="subtree"> <configuration> <system> <login/> </system> </configuration> </filter> </get-config> </rpc>

  13. Netconf - Requests • Configuration requests – edit config <rpc> <edit-config> <target> <candidate/> </target> <config> <configuration> <system> <login> <user> <name>admin</name> <full-name>Administrator</full-name> <class>superuser</class> </user> </login> </system> </configuration> </config> </edit-config> </rpc>

  14. Netconf - Operations • <get> Retrieve <running> or state data. • <get-config> Retrieve all or part of a configuration. • <edit-config> Edit the target configuration. • <copy-config> Copy an entire configuration. • <delete-config> Delete a configuration. • <commit> Activate edits in <candidate>. • <cancel-commit> Cancel a confirmed-commit operation. • <discard-changes> Discard edits in <candidate>. • <load> Load a YANG module. • <get-schema> Retrieve a YANG or YIN module definition file. • <create-subscription>Start receiving notifications.

  15. Netconf - Operations • <lock> Lock a database. • <unlock> Unlock a database. • <partial-lock> Lock part of the <running> database. • <partial-unlock> Unlock part of the <running> database. • <validate> Validate a database. • <get-my-session> Retrieve session customization parameters. • <close-session> Terminate the current session. • <kill-session> Terminate a NETCONF session. • <set-my-session> Set the session customization parameters. • <set-log-level> Set the logging verbosity level. • <restart>Restart the server. • <shutdown> Shutdown the server.

More Related