LOGBOOK

HELP

Quiz Entry - updated: 2026.12.01

In model-driven network programmability, how do YANG, NETCONF, RESTCONF, XML and JSON fit together?

They are layers of one stack: YANG defines what the data is, NETCONF or RESTCONF defines how you reach and change it, and XML or JSON is the encoding the data travels in.

One YANG model on top, NETCONF and RESTCONF as the two protocols below it, XML and JSON as the encodings at the bottom

* One model, two protocols, two encodings: the same severity leaf can travel as XML or JSON. *

The names are easy to mix up because they always appear together, but each answers a different question:

Layer Question it answers Options
Data model What can be configured or read, with which types and structure? YANG
Protocol How do I read, change, validate and commit that data? NETCONF (XML RPCs over SSH) or RESTCONF (HTTP methods over HTTPS)
Encoding How is one concrete piece of data written down on the wire? XML (NETCONF, RESTCONF) or JSON (RESTCONF)

Because the model sits underneath both protocols, they are interchangeable views of the same data. On a Cisco IOS XE router, interfaces/interface[name]/enabled is the same YANG leaf whether you fetch it with a NETCONF <get-config> or a RESTCONF GET, and whether it comes back as XML or JSON. That is the whole advantage over the CLI: the contract (the model) stays fixed, while tools pick whichever protocol and format suit them.

Tip: Model, method, format. YANG is the model, NETCONF/RESTCONF the method, XML/JSON the format.

Go deeper:

From Quiz: ITIA / Network Programmability: CLI, REST APIs, YANG, NETCONF and RESTCONF | Updated: Dec 01, 2026