{"id":27605,"date":"2017-05-23T09:52:19","date_gmt":"2017-05-23T07:52:19","guid":{"rendered":"https:\/\/mamchenkov.net\/wordpress\/?p=27605"},"modified":"2017-05-23T09:52:19","modified_gmt":"2017-05-23T07:52:19","slug":"yang-a-data-modeling-language-for-the-network-configuration-protocol-netconf","status":"publish","type":"post","link":"https:\/\/mamchenkov.net\/wordpress\/2017\/05\/23\/yang-a-data-modeling-language-for-the-network-configuration-protocol-netconf\/","title":{"rendered":"YANG &#8211; A Data Modeling Language for the Network Configuration Protocol (NETCONF)"},"content":{"rendered":"<!-- google_ad_section_start -->\n<p>In the spirit of validating everything against a schema\u00a0(<a href=\"https:\/\/mamchenkov.net\/wordpress\/2017\/03\/11\/validating-json-against-schema-in-php\/\">validating JSON<\/a>, <a href=\"https:\/\/mamchenkov.net\/wordpress\/2017\/04\/10\/validating-csv-schema\/\">validating CSV<\/a>), here is another option &#8211; <a href=\"https:\/\/en.wikipedia.org\/wiki\/YANG\">YANG<\/a>:<\/p>\n<blockquote><p><b>YANG<\/b>\u00a0is a data modeling language for the definition of data sent over the <a title=\"NETCONF\" href=\"https:\/\/en.wikipedia.org\/wiki\/NETCONF\">NETCONF<\/a> network configuration protocol. The name is an acronym for &#8220;Yet Another Next Generation&#8221;. The YANG data modeling language was developed by the NETMOD\u00a0working group in the <a title=\"\" href=\"https:\/\/en.wikipedia.org\/wiki\/Internet_Engineering_Task_Force\">Internet Engineering Task Force<\/a> (IETF) and was published as <a class=\"external mw-magiclink-rfc\" href=\"https:\/\/tools.ietf.org\/html\/rfc6020\" rel=\"nofollow\">RFC 6020<\/a> in October 2010. The data modeling language can be used to model both configuration data as well as state data of network elements. Furthermore, YANG can be used to define the format of event notifications emitted by network elements and it allows data modelers to define the signature of remote procedure calls that can be invoked on network elements via the NETCONF protocol. The language, being protocol independent, can then be converted into any encoding format, e.g. <a title=\"XML\" href=\"https:\/\/en.wikipedia.org\/wiki\/XML\">XML<\/a> or <a title=\"JSON\" href=\"https:\/\/en.wikipedia.org\/wiki\/JSON\">JSON<\/a>, that the network configuration protocol supports.<\/p>\n<p>YANG is a modular language representing data structures in an <a title=\"XML\" href=\"https:\/\/en.wikipedia.org\/wiki\/XML\">XML<\/a> tree format. The data modeling language comes with a number of built-in data types. Additional application specific data types can be derived from the built-in data types. More complex reusable data structures can be represented as groupings. YANG data models can use <a class=\"mw-redirect\" title=\"XPATH\" href=\"https:\/\/en.wikipedia.org\/wiki\/XPATH\">XPATH<\/a> expressions to define constraints on the elements of a YANG data model.<\/p><\/blockquote>\n<p>Like many other standards, formats, and tools developed by very smart people, YANG can be used for much more than just networking configuration. \u00a0If you data and states fit into its model, give it a try.<\/p>\n<p>Here are a few resources that you might find useful in the process:<\/p>\n<ul>\n<li><a href=\"https:\/\/tools.ietf.org\/html\/rfc6020\">RFC6020<\/a>,<\/li>\n<li><a href=\"https:\/\/github.com\/Juniper\/netconf-php\">NETCONF PHP Toolkit<\/a> from Juniper,<\/li>\n<li><a href=\"https:\/\/plajjan.github.io\/validating-data-with-YANG\/\">Validating data with YANG<\/a>, blog post by network automation ninja\u00a0Kristian Larsson.<\/li>\n<\/ul>\n<!-- google_ad_section_end -->\n","protected":false},"excerpt":{"rendered":"<!-- google_ad_section_start -->\n<p>In the spirit of validating everything against a schema\u00a0(validating JSON, validating CSV), here is another option &#8211; YANG: YANG\u00a0is a data modeling language for the definition of data sent over the NETCONF network configuration protocol. The name is an acronym for &#8220;Yet Another Next Generation&#8221;. The YANG data modeling language was developed by the NETMOD\u00a0working &hellip; <a href=\"https:\/\/mamchenkov.net\/wordpress\/2017\/05\/23\/yang-a-data-modeling-language-for-the-network-configuration-protocol-netconf\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">YANG &#8211; A Data Modeling Language for the Network Configuration Protocol (NETCONF)<\/span><\/a><\/p>\n<!-- google_ad_section_end -->\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"YANG - A Data Modeling Language for the Network Configuration Protocol (NETCONF) #WebDev #SysAdmin #PHP #YANG","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_links_to":"","_links_to_target":""},"categories":[1,18,133,62,1334],"tags":[3195,38,1366,1330,3527],"keyring_services":[],"class_list":["post-27605","post","type-post","status-publish","format-standard","hentry","category-general","category-programming","category-sysadmin","category-technology","category-web-work","tag-configuration-management","tag-php","tag-validation","tag-web-development","tag-yang"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":27517,"url":"https:\/\/mamchenkov.net\/wordpress\/2017\/04\/10\/validating-csv-schema\/","url_meta":{"origin":27605,"position":0},"title":"Validating CSV schema","author":"Leonid Mamchenkov","date":"April 10, 2017","format":false,"excerpt":"CSV, or comma-separated values, is a very common format for managing all kinds of configurations, as well data manipulation. \u00a0As the linked Wikipedia page mentions, there are a few RFCs that try to standardize the format. \u00a0However, I thought, there is still a lack of schema-type standard that would allow\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":27408,"url":"https:\/\/mamchenkov.net\/wordpress\/2017\/03\/11\/validating-json-against-schema-in-php\/","url_meta":{"origin":27605,"position":1},"title":"Validating JSON against schema in PHP","author":"Leonid Mamchenkov","date":"March 11, 2017","format":false,"excerpt":"GitHub was rather slow yesterday, which affected the speed of installing composer dependencies (since most of them are hosted on GitHub anyway). \u00a0Staring at a slowly scrolling list of installed dependencies, I noticed something interesting. Of course, I've heard of the seld\/jsonlint before. \u00a0It's a port of zaach\/jsonlint JavaScript tool\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":24399,"url":"https:\/\/mamchenkov.net\/wordpress\/2015\/06\/24\/rt-initialdata-and-perls-nested-map\/","url_meta":{"origin":27605,"position":2},"title":"RT initialdata and Perl&#8217;s nested map","author":"Leonid Mamchenkov","date":"June 24, 2015","format":false,"excerpt":"Request Tracker (aka RT) comes with a very powerful, yet not too widely known tool - initialdata. \u00a0This helps with automating\u00a0configuration of the new system and data migration. \u00a0Combined with the power of Perl's map() function, some really awesome things can be done in a jiffy. Here is a snippet\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":18916,"url":"https:\/\/mamchenkov.net\/wordpress\/2013\/12\/05\/moment-js-a-javascript-date-library-for-parsing-validating-manipulating-and-formatting-dates\/","url_meta":{"origin":27605,"position":3},"title":"Moment.js &#8211; A javascript date library for parsing, validating, manipulating, and formatting dates","author":"Leonid Mamchenkov","date":"December 5, 2013","format":"link","excerpt":"Moment.js - A javascript date library for parsing, validating, manipulating, and formatting dates","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":28624,"url":"https:\/\/mamchenkov.net\/wordpress\/2018\/06\/11\/forget-db-a-simple-gdpr-inspired-tool-to-anonymise-confidential-database-data\/","url_meta":{"origin":27605,"position":4},"title":"forget-db &#8211; a simple GDPR inspired tool to anonymise confidential database data","author":"Leonid Mamchenkov","date":"June 11, 2018","format":false,"excerpt":"forget-db: A simple(ish) command line tool written in PHP 7.1 using Laravel Zero and Faker to help you anonymise\/pseudonymise data within your database to support protecting either sensitive information, or peoples right to be forgotten with GDPR compliance. The tool allows you to connect to either mysql, postgres, sqlite or\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":25031,"url":"https:\/\/mamchenkov.net\/wordpress\/2015\/12\/11\/apc-is-dead-long-live-opcache\/","url_meta":{"origin":27605,"position":5},"title":"APC is dead, long live OPcache","author":"Leonid Mamchenkov","date":"December 11, 2015","format":false,"excerpt":"Since this is probably common knowledge by now, this blog post is more a note to my future self. \u00a0APC is dead. \u00a0Don't use it. \u00a0Use OPcache instead. \u00a0APCu is something else. In the last few years I've had so much issues with APC, that I eventually stopped installing it\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/27605","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/comments?post=27605"}],"version-history":[{"count":0,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/27605\/revisions"}],"wp:attachment":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/media?parent=27605"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/categories?post=27605"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/tags?post=27605"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/keyring_services?post=27605"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}