Presentation is loading. Please wait.

Presentation is loading. Please wait.

Simple tutorial Yang & Netconf.

Similar presentations


Presentation on theme: "Simple tutorial Yang & Netconf."— Presentation transcript:

1 Simple tutorial Yang & Netconf

2 Yang - Modules and 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 “Besip Inc."; contact description “Example module"; revision { description "Initial revision."; …

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

5 Yang - Types Bit fields References Other Integral String Binary data
{,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 YANG list user { <user> key name;
leaf name { type string; } leaf uid { type uint32; leaf full-name { leaf class { default viewer; NETCONF <user> <name>glocks</name> <full-name>Goldie</full-name> <class>intruder</class> </user> <name>snowey</name> <full-name>Snow</full-name> <class>free-loader</class> <name>rzull</name> <full-name>Repun</full-name>

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

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 subtree and full XPath filtering Complete XML 1.0 implementation with full support for XML Namespaces

9 Netconf – DBs (XML document)

10 Netconf - Session Start session End 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>
<source> <candidate/> </source> <filter type="subtree"> <configuration> <system> <login/> </system> </configuration> </filter> </get-config> </rpc>

13 Netconf - Requests Configuration requests – edit config <rpc>
<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.


Download ppt "Simple tutorial Yang & Netconf."

Similar presentations


Ads by Google