Skip to main content
PacketMentor logo
Open menu
← All topics
Automation & Programmability Foundational

Model-Driven Programmability: Why It Matters

Model-driven programmability means every device exposes the same YANG-shaped data over NETCONF, RESTCONF, or gNMI. One schema, three transports. Why Cisco cares and what it unlocks.

Quick summary
  • Model-driven = YANG schema defines data, NETCONF/RESTCONF/gNMI carry it. Same meaning on every supported device.
  • Benefits: machine-readable config, standard CRUD operations, streaming telemetry on change, cross-vendor compatibility (where YANG models agree).
  • Replaces screen-scraping show commands with structured queries that always return consistent fields.

Mental model

Cisco objective 5.1 says “Describe the value of model driven programmability for infrastructure automation”.

Model-driven programmability means every device exposes the same YANG-defined data. YANG is the schema language; NETCONF (XML/SSH), RESTCONF (JSON/HTTPS), and gNMI (Protobuf/gRPC) are three different transports that all carry YANG-shaped data.

Compared to the old “SSH + screen-scrape show interface” world, model-driven is:

  • Structured — data has typed fields, not free text to parse with regex.
  • Consistent — asking the same question of the same model gives the same shape every time.
  • Bidirectional — same tree you read is the tree you write.
  • Streamable — gNMI pushes updates on change instead of you polling.

The before-and-after

Before (screen-scraping)

output = ssh.send("show ip interface brief")
# Parse free text:
for line in output.splitlines():
    if line.startswith("GigabitEthernet"):
        parts = line.split()
        # fragile: columns move when IOS version changes
        name, ip, _, _, status, protocol = parts[:6]

If Cisco adds a column to show ip int brief next IOS release, your parser breaks.

After (model-driven)

r = requests.get(
    "https://10.0.0.1/restconf/data/ietf-interfaces:interfaces-state",
    auth=("admin", "cisco"),
    headers={"Accept": "application/yang-data+json"},
)
for intf in r.json()["ietf-interfaces:interfaces-state"]["interface"]:
    print(intf["name"], intf.get("oper-status"))

Structured JSON. Field names come from the published YANG model. If Cisco adds a field, the existing code keeps working.

The four benefits

1. Machine-readable, structured data

JSON or XML with named fields and types. No regex. No fragile string splitting.

2. Standard CRUD operations

Same four verbs across every YANG container: GET, POST, PUT/PATCH, DELETE. Learn once, use everywhere.

3. Push instead of poll (gNMI)

Subscribe to a telemetry stream: /interfaces/interface/state/counters. Device pushes updates on-change (or every N ms). Server-side cost drops from “ask 1000 switches every 30 sec” to zero when nothing changed.

4. Cross-vendor compatibility (partially)

IETF standard models (ietf-interfaces, ietf-routing) work the same on Cisco, Juniper, Arista. Vendor-specific features (Cisco-IOS-XE-native) still exist but the “common 80%” is shared.

Where it shows up in Cisco land

  • IOS XE and NX-OS both expose NETCONF (port 830), RESTCONF (443), and gNMI (50051).
  • Catalyst Center and NSO are controllers that themselves speak NETCONF/RESTCONF upstream.
  • gNMI telemetry is how modern dashboards (Cisco Nexus Dashboard, Grafana + telegraf) get sub-second interface counters.

Comparison: SNMP vs model-driven

SNMPModel-driven (NETCONF/RESTCONF/gNMI)
Age19882011+
ModelMIBs (SMI schema)YANG
TransportUDP (SNMPv1/2c unencrypted) or SNMPv3SSH, HTTPS, gRPC
PayloadBER-encoded binaryXML / JSON / Protobuf
Write supportYes but rare in practiceYes, first-class
StreamingNo (traps are per-event, limited)Yes (gNMI subscribe)
ScopeMostly reads for monitoringFull read + write + stream

SNMP is not going away for legacy monitoring. Model-driven is where new tooling is being built.

FAQ

Do I need to learn YANG to use RESTCONF? Enough to read a small snippet and know what a leaf vs container vs list is. See the YANG + RESTCONF topic.

Can I replace SNMP with gNMI today? On modern Cisco gear, yes. gNMI telemetry is strictly better for high-rate counters. SNMP persists for legacy devices and third-party integrations.

Is OpenConfig competing with Cisco YANG? OpenConfig is an industry-group alternative YANG module set, broader scope. Cisco ships both: standard IETF models, OpenConfig models, and vendor-specific Cisco-* models. All coexist on the same device.

Is model-driven only for configuration, or also for state? Both. YANG models distinguish config true (writable) vs state (read-only operational data). Same tree.

Master this on a real network

Want this drilled into reflex?

1:1 weekly sessions, live feedback on your labs, and US interview prep: built around the CCNA Automation® exam blueprint. Free first session. No card on file until you decide.

Claim my free session →

Get the free CCNA 12-week roadmap

You're already reading up on Model-Driven Programmability: Why It Matters. The roadmap is the order I recommend studying every CCNA topic in: with what to lab each week and where Model-Driven Programmability: Why It Matters fits. A written personal reply, not an autoresponder. Expect it within one business day.

Personal reply from a senior network engineer. No third-party tracking. Unsubscribe any time.