XML schema vs YANG

2,024 views
Skip to first unread message

Jing Zhao

unread,
Jul 28, 2014, 4:44:03 AM7/28/14
to neto...@googlegroups.com
Hi Radek,

The syntax of NETCONF message layer elements such as <hello> and <rpc> are ruled by an XML schema in RFC6241 Appendix B "XML Schema for NETCONF Messages Layer". But the syntax of operation layer elements (different protocol operations) are ruled by a YANG module in Appendix C "YANG Module for NETCONF Protocol Operations".

1. Why different parts of the protocol use different way for its syntax definition? Technically, can we use XML schema to define those protocol operations as well? Or is it because that XML schema is not that powerful as YANG to define operation-related stuff? What's consideration here?

2. What even confused me is that the XML schema used for message layer defines (please see RFC 6241 page 83)  the operation attribute used in <edit-config> (e.g., "merge", or "replace", ..) which is an operation layer element. Shouldn't it be covered by the YANG module?

There must be some misunderstanding of XML schema and YANG due to my limited knowledge of them. Sorry for that.

Thanks,

Jing

Radek Krejčí

unread,
Jul 28, 2014, 5:42:29 AM7/28/14
to Jing Zhao, neto...@googlegroups.com
Hi Jing,

you are right, this is confusing. I believe that the best answer you can get in IETF NETCONF WG mailing list or directly from the RFC authors :)

AFAIK, originally (in RFC 4741) the RPC (<rpc>) and Operations (<edit-config>) level were both described using XML Schema, because in that time there was no YANG language. Then the YANG came to be used to write configuration data models. However, as part of the YANG data models, you can define also new NETCONF operations (e.g. <get-schema> in RFC 6022), so the WG (or RFC 6241 authors) decided to rewrite also NETCONF basic operations definition into a form of a YANG data model. But the YANG has a limitation - you are not able to define XML attributes. It is not important in case of the configuration data, but in case of <edit-config>, NETCONF uses "operation" attribute to distinguish what to do with the given configuration data (as you mentioned in 2.). So the definition of this attribute was kept together with the RPC level definition in XML Schema.

Answer to you first question is generaly "yes", but I'm not sure about the direct support of XML Schema defined data models in today NETCONF tools (at least libnetconf and Netopeer doesn't support it, they require data models in YIN format). However, you can use pyang to convert your data model into various formats (hypertree, dsdl, depend, xmi, yin, tree, jtox, capability, yang, xsd, uml, jstree, jsonxsl).

I hope this will help you :)

Best regards,
Radek

Dne 28.7.2014 10:44, Jing Zhao napsal(a):
--
You received this message because you are subscribed to the Google Groups "Netopeer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netopeer+u...@googlegroups.com.
Visit this group at http://groups.google.com/group/netopeer.
For more options, visit https://groups.google.com/d/optout.

Jing Zhao

unread,
Jul 28, 2014, 8:31:59 PM7/28/14
to neto...@googlegroups.com, yingm...@gmail.com
Thanks Radek! That explains everything.
Reply all
Reply to author
Forward
0 new messages