RFC 8340 and the YANG Tree Diagram Representation
Short answer
A RFC 8340 defines the YANG tree diagram representation, while RFC 6020, RFC 7950, and RFC 8525 cover YANG 1.0, YANG 1.1, and YANG Library, making RFC 8340 the only match for tree notation.
Question
Key Takeaways
YANG tree diagrams are defined by RFC 8340, which standardizes the compact bracket-and-prefix notation used to render a module's schema. RFC 8340 is correct because the requested artifact is the tree representation itself, whereas RFC 6020 and RFC 7950 define YANG language versions and RFC 8525 defines YANG Library.
Expert Analysis
The decisive condition is that the requested artifact is a textual tree rendering of a YANG schema rather than the YANG language or a module inventory, and RFC 8340 is the document that defines that notation.
RFC 8340 supplies the tree-diagram notation that renders a YANG schema with prefixes and bracket branches
RFC 8340, titled YANG Tree Diagrams, standardizes the compact, text-based view that tools such as pyang and YANG Suite display when asked for a tree. The output begins with module: <module-name> and then uses indentation, +-- branches, vertical bars and node annotations to show a module's hierarchy. A read-write leaf appears with an rw flag and a type in brackets; a list gains a *, a leaf-list uses [type], a choice is shown as (choice-name) and its cases as :(case-name), and RPCs or notifications use their own markers. Those conventions are not cosmetic: they give operators a portable way to compare schemas, confirm parent-child relationships and spot configuration versus state nodes without reading the full YANG text. The notation is deliberately independent of how data is encoded on the wire. It does not define a NETCONF payload, a RESTCONF media type, a JSON object or a YANG-library inventory; it defines how a schema is drawn. That is why the phrase tree diagram representation maps directly to RFC 8340 and not to the base YANG specification. The RFC is the reference for the artifact itself, so it remains the answer even though every other option is also a legitimate YANG-related standard.
Selecting RFC 6020, RFC 7950 or RFC 8525 substitutes a different YANG artifact
Each remaining number points to a real, adjacent YANG document, which is exactly what makes the distractors plausible.
- B — RFC 6020: This specifies YANG version 1, the original data modeling language and its syntax for modules, typedefs, groupings, containers, lists and leafs; picking it describes the language that a module is written in, not the notation used to render that module as a tree.
- C — RFC 7950: This is YANG 1.1, the revised language specification that adds features such as action statements, notification refinements and more flexible leafrefs; it changes what a valid model may contain, while leaving the tree-diagram conventions to the separate representation document.
- D — RFC 8525: This defines the YANG Library data model, which lets a server report which modules and submodules it implements, their revisions and conformance information; it is an inventory mechanism for runtime capability discovery, not a drawing format for schema hierarchy.
Choosing any of these would answer a neighboring standards question—language version, revision or module inventory—while leaving the requested tree representation undefined. The cost is not that the alternatives are unrelated; it is that each names a different layer of the YANG ecosystem and therefore cannot satisfy the definitional condition.
The boundary separates RFC 6020/7950 language versions, RFC 8525 module inventory and RFC 8340 tree notation
Use a concrete module such as ietf-interfaces to see the layers. RFC 6020 and RFC 7950 govern what can be written inside ietf-interfaces.yang: the module statement, namespace, prefix, containers, lists, leafs, types, mandatory flags and version-specific constructs. If a server implements that module, RFC 8525's YANG Library can report the module name, revision and feature set in a data tree that a client retrieves; it answers which models are present on the device, not how the model's schema looks. RFC 8340 then governs the rendering a human reads, for example a top line module: ietf-interfaces followed by +--rw interfaces and beneath it +--rw interface* [name]. The same module can be valid under YANG 1.1, listed in YANG Library, and printed as an RFC 8340 tree, because these are separate concerns: language grammar, runtime inventory and human-readable schema notation. Confusing them is easy because all four RFCs concern YANG and all can appear in automation workflows. The boundary is the artifact being requested. A tree diagram is an output format; a YANG version is a grammar; YANG Library is operational metadata. Only RFC 8340 defines the bracket-and-prefix display conventions that make the output recognizable as a tree.
When an objective names a representation format, anchor RFC 8340 to the tree-diagram artifact, not the YANG language version
The transferable rule is to map the named artifact to the document that defines it before recalling version numbers. If the task calls for a tree diagram, a schema hierarchy, or the output of pyang -f tree, choose RFC 8340. If it calls for YANG 1.0 grammar, choose RFC 6020; for YANG 1.1, choose RFC 7950; for module inventory and conformance reporting, choose RFC 8525. The same discipline separates other representations: JSON encoding of YANG-modeled data belongs to RFC 7951, while XML payload rules arise from the NETCONF/YANG specifications rather than from the tree-diagram RFC. A useful practical test is whether the requested output can be pasted into a text file and read without a protocol exchange. RFC 8340 output is exactly that: a static, human-oriented drawing of a module. A YANG Library response, by contrast, is runtime data retrieved from a server, and a YANG module is source code. Applying that test prevents a familiar number such as RFC 7950 from winning merely because YANG 1.1 is widely used. The operative evidence is the phrase tree diagram representation: it names an RFC 8340 artifact, so the matching document, not the language version, is the defensible choice.
Official Reference
https://www.rfc-editor.org/rfc/rfc8340.html
This link opens the official vendor documentation in a new tab.
Exam Strategy
Memorize the YANG RFCs by artifact rather than by number alone: RFC 6020 is YANG 1.0, RFC 7950 is YANG 1.1, RFC 8340 is YANG tree diagrams, and RFC 8525 is YANG Library. When a prompt names a representation, diagram, library, or encoding, match the document title to that artifact before checking language versions. Eliminate answers that define the model's grammar or runtime inventory when the requested output is a human-readable schema rendering; if you can picture pyang -f tree output, you have already identified RFC 8340.
Related Analysis
Practice All 300-435 Questions
Access 150 questions with complete answers and detailed explanations.
View Full 300-435 Practice Test →