< draft-bjorklund-netconf-yang-01.txt   draft-bjorklund-netconf-yang-02.txt >
Network Working Group M. Bjorklund, Ed. Network Working Group M. Bjorklund, Ed.
Internet-Draft Tail-f Systems Internet-Draft Tail-f Systems
Intended status: Standards Track February 1, 2008 Intended status: Standards Track February 5, 2008
Expires: August 4, 2008 Expires: August 8, 2008
YANG - A data modeling language for NETCONF YANG - A data modeling language for NETCONF
draft-bjorklund-netconf-yang-01 draft-bjorklund-netconf-yang-02
Status of this Memo Status of this Memo
By submitting this Internet-Draft, each author represents that any By submitting this Internet-Draft, each author represents that any
applicable patent or other IPR claims of which he or she is aware applicable patent or other IPR claims of which he or she is aware
have been or will be disclosed, and any of which he or she becomes have been or will be disclosed, and any of which he or she becomes
aware will be disclosed, in accordance with Section 6 of BCP 79. aware will be disclosed, in accordance with Section 6 of BCP 79.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF), its areas, and its working groups. Note that Task Force (IETF), its areas, and its working groups. Note that
skipping to change at page 1, line 34 skipping to change at page 1, line 34
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
The list of current Internet-Drafts can be accessed at The list of current Internet-Drafts can be accessed at
http://www.ietf.org/ietf/1id-abstracts.txt. http://www.ietf.org/ietf/1id-abstracts.txt.
The list of Internet-Draft Shadow Directories can be accessed at The list of Internet-Draft Shadow Directories can be accessed at
http://www.ietf.org/shadow.html. http://www.ietf.org/shadow.html.
This Internet-Draft will expire on August 4, 2008. This Internet-Draft will expire on August 8, 2008.
Copyright Notice Copyright Notice
Copyright (C) The IETF Trust (2008). Copyright (C) The IETF Trust (2008).
Abstract Abstract
YANG is a data modeling language used to model configuration and YANG is a data modeling language used to model configuration and
state data manipulated by the NETCONF protocol, NETCONF remote state data manipulated by the NETCONF protocol, NETCONF remote
procedure calls, and NETCONF notifications. procedure calls, and NETCONF notifications.
skipping to change at page 6, line 24 skipping to change at page 6, line 24
A.2. Internet Specific Derived Types . . . . . . . . . . . . . 114 A.2. Internet Specific Derived Types . . . . . . . . . . . . . 114
A.3. IEEE 802 Specific Derived Types . . . . . . . . . . . . . 120 A.3. IEEE 802 Specific Derived Types . . . . . . . . . . . . . 120
Appendix B. YIN . . . . . . . . . . . . . . . . . . . . . . . . 123 Appendix B. YIN . . . . . . . . . . . . . . . . . . . . . . . . 123
B.1. Formal YIN Definition . . . . . . . . . . . . . . . . . . 123 B.1. Formal YIN Definition . . . . . . . . . . . . . . . . . . 123
B.2. Transformation Algorithm YANG-2-YIN . . . . . . . . . . . 123 B.2. Transformation Algorithm YANG-2-YIN . . . . . . . . . . . 123
B.2.1. Usage Example . . . . . . . . . . . . . . . . . . . . 125 B.2.1. Usage Example . . . . . . . . . . . . . . . . . . . . 125
B.3. Transformation Algorithm YIN-2-YANG . . . . . . . . . . . 125 B.3. Transformation Algorithm YIN-2-YANG . . . . . . . . . . . 125
B.3.1. Tabulation, Formatting . . . . . . . . . . . . . . . 126 B.3.1. Tabulation, Formatting . . . . . . . . . . . . . . . 126
Appendix C. XML Schema Considerations . . . . . . . . . . . . . 127 Appendix C. XML Schema Considerations . . . . . . . . . . . . . 127
Appendix D. YANG ABNF Grammar . . . . . . . . . . . . . . . . . 128 Appendix D. YANG ABNF Grammar . . . . . . . . . . . . . . . . . 128
Appendix E. Error Responses for YANG Related Errors . . . . . . 146 Appendix E. Error Responses for YANG Related Errors . . . . . . 147
E.1. Error Message for Data that Violates a YANG unique E.1. Error Message for Data that Violates a YANG unique
Statement: . . . . . . . . . . . . . . . . . . . . . . . 146 Statement: . . . . . . . . . . . . . . . . . . . . . . . 147
E.2. Error Message for Data that Violates a YANG E.2. Error Message for Data that Violates a YANG
max-elements Statement: . . . . . . . . . . . . . . . . . 146 max-elements Statement: . . . . . . . . . . . . . . . . . 147
E.3. Error Message for Data that Violates a YANG E.3. Error Message for Data that Violates a YANG
min-elements Statement: . . . . . . . . . . . . . . . . . 146 min-elements Statement: . . . . . . . . . . . . . . . . . 147
E.4. Error Message for Data that Violates a YANG must or E.4. Error Message for Data that Violates a YANG must or
when statement, a length, range or pattern restriction: . 146 when statement, a length, range or pattern restriction: . 147
E.5. Error Message for the "insert" Operation . . . . . . . . 147 E.5. Error Message for the "insert" Operation . . . . . . . . 148
Appendix F. Why We Need a New Modeling Language . . . . . . . . 148 Appendix F. Why We Need a New Modeling Language . . . . . . . . 149
F.1. Why not XSD? . . . . . . . . . . . . . . . . . . . . . . 148 F.1. Why not XSD? . . . . . . . . . . . . . . . . . . . . . . 149
F.2. Why not RelaxNG . . . . . . . . . . . . . . . . . . . . . 149 F.2. Why not RelaxNG . . . . . . . . . . . . . . . . . . . . . 150
F.3. Why not SMIng . . . . . . . . . . . . . . . . . . . . . . 149 F.3. Why not SMIng . . . . . . . . . . . . . . . . . . . . . . 150
Appendix G. ChangeLog . . . . . . . . . . . . . . . . . . . . . 151 Appendix G. ChangeLog . . . . . . . . . . . . . . . . . . . . . 152
G.1. Version -01 . . . . . . . . . . . . . . . . . . . . . . . 151 G.1. Version -02 . . . . . . . . . . . . . . . . . . . . . . . 152
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 153 G.2. Version -01 . . . . . . . . . . . . . . . . . . . . . . . 152
Intellectual Property and Copyright Statements . . . . . . . . . 154 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 154
Intellectual Property and Copyright Statements . . . . . . . . . 155
1. Introduction 1. Introduction
Today, the NETCONF protocol [RFC4741] lacks a standardized way to Today, the NETCONF protocol [RFC4741] lacks a standardized way to
create data models. Instead, vendors are forced to use proprietary create data models. Instead, vendors are forced to use proprietary
solutions. In order for NETCONF to be a interoperable protocol, solutions. In order for NETCONF to be a interoperable protocol,
models must be defined in a vendor-neutral way. YANG provides the models must be defined in a vendor-neutral way. YANG provides the
language and rules for defining such models for use with NETCONF. language and rules for defining such models for use with NETCONF.
YANG is a data modeling language used to model configuration and YANG is a data modeling language used to model configuration and
skipping to change at page 136, line 17 skipping to change at page 136, line 17
key-arg = 1*(identifier sep) key-arg = 1*(identifier sep)
unique-stmt = unique-keyword sep unique-arg-str stmtend unique-stmt = unique-keyword sep unique-arg-str stmtend
unique-arg-str = < a string which matches the rule unique-arg-str = < a string which matches the rule
unique-arg > unique-arg >
unique-arg = 1*(descendant-schema-nodeid 1*sp) unique-arg = 1*(descendant-schema-nodeid 1*sp)
choice-stmt = choice-keyword sep identifier-str optsep choice-stmt = choice-keyword sep identifier-str optsep
"{" stmtsep (";" /
"{" stmtsep
;; these stmts can appear in any order ;; these stmts can appear in any order
[default-stmt stmtsep] [default-stmt stmtsep]
[mandatory-stmt stmtsep] [mandatory-stmt stmtsep]
[status-stmt stmtsep] [status-stmt stmtsep]
[description-stmt stmtsep] [description-stmt stmtsep]
[reference-stmt stmtsep] [reference-stmt stmtsep]
*((short-case-stmt / case-stmt) stmtsep) *((short-case-stmt / case-stmt) stmtsep)
"}" "}")
short-case-stmt = container-stmt / short-case-stmt = container-stmt /
leaf-stmt / leaf-stmt /
leaf-list-stmt / leaf-list-stmt /
list-stmt / list-stmt /
anyxml-stmt anyxml-stmt
case-stmt = case-keyword sep identifier-str optsep case-stmt = case-keyword sep identifier-str optsep
(";" / (";" /
"{" stmtsep "{" stmtsep
skipping to change at page 136, line 50 skipping to change at page 137, line 4
*(case-data-def-stmt stmtsep) *(case-data-def-stmt stmtsep)
"}") "}")
anyxml-stmt = anyxml-keyword sep identifier-str optsep anyxml-stmt = anyxml-keyword sep identifier-str optsep
(";" / (";" /
"{" stmtsep "{" stmtsep
;; these stmts can appear in any order ;; these stmts can appear in any order
[config-stmt stmtsep] [config-stmt stmtsep]
[mandatory-stmt stmtsep] [mandatory-stmt stmtsep]
[status-stmt stmtsep] [status-stmt stmtsep]
[description-stmt stmtsep]
[description-stmt stmtsep]
[reference-stmt stmtsep] [reference-stmt stmtsep]
"}") "}")
uses-stmt = uses-keyword sep identifier-ref-str optsep uses-stmt = uses-keyword sep identifier-ref-str optsep
"{" stmtsep (";" /
"{" stmtsep
;; these stmts can appear in any order ;; these stmts can appear in any order
[status-stmt stmtsep] [status-stmt stmtsep]
[description-stmt stmtsep] [description-stmt stmtsep]
[reference-stmt stmtsep] [reference-stmt stmtsep]
*(refinement-stmt stmtsep) *(refinement-stmt stmtsep)
"}" "}")
refinement-stmt = refine-container-stmt / refinement-stmt = refine-container-stmt /
refine-leaf-stmt / refine-leaf-stmt /
refine-leaf-list-stmt / refine-leaf-list-stmt /
refine-list-stmt / refine-list-stmt /
refine-choice-stmt / refine-choice-stmt /
refine-anyxml-stmt refine-anyxml-stmt
refine-leaf-stmt = leaf-keyword sep identifier-str optsep refine-leaf-stmt = leaf-keyword sep identifier-str optsep
"{" stmtsep (";" /
"{" stmtsep
;; these stmts can appear in any order ;; these stmts can appear in any order
*(must-stmt stmtsep) *(must-stmt stmtsep)
[default-stmt stmtsep] [default-stmt stmtsep]
[config-stmt stmtsep] [config-stmt stmtsep]
[mandatory-stmt stmtsep] [mandatory-stmt stmtsep]
[description-stmt stmtsep] [description-stmt stmtsep]
[reference-stmt stmtsep] [reference-stmt stmtsep]
"}" "}")
refine-leaf-list-stmt = leaf-list-keyword sep identifier-str optsep refine-leaf-list-stmt = leaf-list-keyword sep identifier-str optsep
"{" stmtsep (";" /
"{" stmtsep
;; these stmts can appear in any order ;; these stmts can appear in any order
*(must-stmt stmtsep) *(must-stmt stmtsep)
[config-stmt stmtsep] [config-stmt stmtsep]
[min-elements-stmt stmtsep] [min-elements-stmt stmtsep]
[max-elements-stmt stmtsep] [max-elements-stmt stmtsep]
[description-stmt stmtsep] [description-stmt stmtsep]
[reference-stmt stmtsep] [reference-stmt stmtsep]
"}" "}")
refine-list-stmt = list-keyword sep identifier-str optsep refine-list-stmt = list-keyword sep identifier-str optsep
"{" stmtsep (";" /
"{" stmtsep
;; these stmts can appear in any order ;; these stmts can appear in any order
*(must-stmt stmtsep) *(must-stmt stmtsep)
[config-stmt stmtsep] [config-stmt stmtsep]
[min-elements-stmt stmtsep] [min-elements-stmt stmtsep]
[max-elements-stmt stmtsep] [max-elements-stmt stmtsep]
[description-stmt stmtsep] [description-stmt stmtsep]
[reference-stmt stmtsep] [reference-stmt stmtsep]
*(refinement-stmt stmtsep) *(refinement-stmt stmtsep)
"}" "}")
refine-choice-stmt = choice-keyword sep identifier-str optsep refine-choice-stmt = choice-keyword sep identifier-str optsep
"{" stmtsep (";" /
"{" stmtsep
;; these stmts can appear in any order ;; these stmts can appear in any order
[default-stmt stmtsep] [default-stmt stmtsep]
[mandatory-stmt stmtsep] [mandatory-stmt stmtsep]
[description-stmt stmtsep] [description-stmt stmtsep]
[reference-stmt stmtsep] [reference-stmt stmtsep]
*(refine-case-stmt stmtsep) *(refine-case-stmt stmtsep)
"}" "}")
refine-case-stmt = case-keyword sep identifier-str optsep refine-case-stmt = case-keyword sep identifier-str optsep
(";" /
"{" stmtsep "{" stmtsep
;; these stmts can appear in any order ;; these stmts can appear in any order
[description-stmt stmtsep] [description-stmt stmtsep]
[reference-stmt stmtsep] [reference-stmt stmtsep]
*(refinement-stmt stmtsep) *(refinement-stmt stmtsep)
"}" "}")
refine-container-stmt = container-keyword sep identifier-str optsep refine-container-stmt = container-keyword sep identifier-str optsep
(";" /
"{" stmtsep "{" stmtsep
;; these stmts can appear in any order ;; these stmts can appear in any order
*(must-stmt stmtsep) *(must-stmt stmtsep)
[presence-stmt stmtsep] [presence-stmt stmtsep]
[config-stmt stmtsep] [config-stmt stmtsep]
[description-stmt stmtsep] [description-stmt stmtsep]
[reference-stmt stmtsep] [reference-stmt stmtsep]
*(refinement-stmt stmtsep) *(refinement-stmt stmtsep)
"}" "}")
refine-anyxml-stmt = anyxml-keyword sep identifier-str optsep refine-anyxml-stmt = anyxml-keyword sep identifier-str optsep
(";" /
"{" stmtsep "{" stmtsep
;; these stmts can appear in any order ;; these stmts can appear in any order
[config-stmt stmtsep] [config-stmt stmtsep]
[mandatory-stmt stmtsep] [mandatory-stmt stmtsep]
[description-stmt stmtsep] [description-stmt stmtsep]
[reference-stmt stmtsep] [reference-stmt stmtsep]
"}" "}")
unknown-statement = prefix ":" identifier [sep string] optsep unknown-statement = prefix ":" identifier [sep string] optsep
(";" / "{" *unknown-statement "}") (";" / "{" *unknown-statement "}")
augment-stmt = augment-keyword sep augment-arg-str optsep augment-stmt = augment-keyword sep augment-arg-str optsep
"{" stmtsep "{" stmtsep
;; these stmts can appear in any order ;; these stmts can appear in any order
[when-stmt stmtsep] [when-stmt stmtsep]
[status-stmt stmtsep] [status-stmt stmtsep]
[description-stmt stmtsep] [description-stmt stmtsep]
skipping to change at page 151, line 7 skipping to change at page 152, line 7
truly protocol independent data models. truly protocol independent data models.
A NETCONF specific data modeling language like YANG makes it much A NETCONF specific data modeling language like YANG makes it much
easier to describe data models in a way that maps to NETCONF in a easier to describe data models in a way that maps to NETCONF in a
very straight-forward manner and has therefore been chosen as the very straight-forward manner and has therefore been chosen as the
best approach. Note that the design of YANG actually borrows heavily best approach. Note that the design of YANG actually borrows heavily
from the SMIng work. from the SMIng work.
Appendix G. ChangeLog Appendix G. ChangeLog
G.1. Version -01 G.1. Version -02
o Fixed some grammar bugs.
G.2. Version -01
o Moved text about imports and includes from Identifiers Section 6.2 o Moved text about imports and includes from Identifiers Section 6.2
to Modules and submodules Section 4.2.1. to Modules and submodules Section 4.2.1.
o Clarified how presence containers behave with edit-config o Clarified how presence containers behave with edit-config
operation "none". operation "none".
o Clarified how mandatory leafs behave within non-presence o Clarified how mandatory leafs behave within non-presence
containers. containers.
 End of changes. 31 change blocks. 
36 lines changed or deleted 50 lines changed or added

This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/