How do you configure hundreds of routers without logging into each one manually? This chapter solves that problem by introducing network automation tools, APIs, and data models like YANG, NETCONF, and RESTCONF, which allow network engineers to manage devices through software instead of typing commands by hand. Understanding these fundamentals is critical for the 350-501 exam because automation is the backbone of modern service provider networks, and the exam will test your ability to differentiate these technologies and their use cases.
Jump to a section
A simple way to picture Network Automation Fundamentals
When you manually order a coffee, you queue up, tell the barista your order, wait, and they make it. This is slow, error-prone, and relies on one person. When your workplace installs a self-ordering machine, everything changes. First, a central touchscreen (the controller) sends a structured order to the machine via a standardised network cable, which leads to the machine interpreting that data and brewing a perfect cup without a human speaking a word.
In network automation, the network administrator (the coffee drinker) no longer logs into each router (the barista) to type commands. Instead, they use a tool like an Ansible playbook (the touchscreen) which sends a standardised message using a data model like YANG (the coffee order format) over a protocol like NETCONF or RESTCONF (the network cable and language). The router then reconfigures itself. This mirrors the coffee machine: you define the desired state (a latte, no sugar), the request is structured and predictable, and the machine executes without needing to know your name or your mood. The old manual way is like shouting over a noisy crowd; the automated way is like sending a text message with a precise order form. It reduces mistakes, saves time, and allows one administrator to manage hundreds of routers just as one machine can serve hundreds of coffee drinkers.
Network automation is the practise of using software to manage and control network devices such as routers, switches, and firewalls without requiring a human to log in and type commands one at a time. To understand this, imagine you manage a fleet of 500 delivery trucks. If you had to walk to each truck, turn a key, and give verbal directions every morning, you'd need a massive team and you'd make lots of mistakes. Instead, you install a central computer that sends a standardised set of instructions to every truck simultaneously. That is network automation.
To make this work, we need three key components: data models, protocols, and tools. Let us start with data models. A data model is like a blueprint or a form. It defines exactly what information can be sent and what format it must be in. The most important data model in networking is YANG (Yet Another Next Generation — yes, the name really is a joke). YANG is a language used to define the configuration and state data of a network device. It is vendor-neutral, meaning Cisco, Juniper, and Huawei devices can all understand YANG models if they support them. Think of YANG as the standardised order form for a fast-food restaurant: it says you can specify a burger type, a drink size, and sides, but you cannot specify a pizza. This prevents confusion.
Next, we have protocols — the language and mechanics for sending that YANG data. Two critical protocols are NETCONF and RESTCONF. NETCONF (Network Configuration Protocol) is like sending a certified letter. It is a connection-oriented protocol that uses XML (eXtensible Markup Language) for data encoding. When a network administrator wants to change a router's IP address, they use NETCONF to open a secure SSH session, send an XML document containing the YANG-modeled change, and the router acknowledges receipt and applies the change. NETCONF is transactional: either the whole change happens or none of it does, preventing half-broken configurations.
RESTCONF is a lighter, web-based alternative. It uses HTTP methods like GET, POST, PUT, and DELETE — the same methods your web browser uses to load a website. Instead of XML only, RESTCONF can use JSON (JavaScript Object Notation), which is more lightweight and easier for web developers to use. RESTCONF is like sending a text message vs. a certified letter: faster and simpler, but less robust for complex transactional changes. For the 350-501 exam, you need to remember that NETCONF supports both configuration and state data retrieval, while RESTCONF is better for simple, web-based interactions.
Now, tools. The most common automation tools are Ansible (by Red Hat), SaltStack, and Cisco's own Network Services Orchestrator (NSO). Ansible is especially popular because it is agentless — you do not install software on the routers. Instead, you run a playbook (a set of instructions) from a central machine, and Ansible uses SSH or NETCONF/RESTCONF to talk to the devices. A typical Ansible playbook might look like a YAML file that reads a YANG model and pushes it to a device.
Together, these components replace the old manual method where an engineer would type 'configure terminal' and painstakingly type each command. Automation reduces configuration errors from 30% to near zero in large networks, it speeds up rollout times from days to minutes, and it enforces consistency — every router gets the same configuration, no typo can sneak in. For the exam, you must know the difference between 'push' and 'pull' automation models. In push (e.g., Ansible), the controller sends configuration to devices. In pull (e.g., Salt in masterless mode), devices fetch their config from a central server. The exam loves to test which tool uses which model.
Define the Desired Configuration State
You start by writing a YANG data model that specifies the exact configuration you want on your devices. For example, you define that each router should have a specific BGP AS number and a list of neighbor IPs. This model acts as the blueprint.
Choose the Protocol and Encoding
You decide whether to use NETCONF (with XML) or RESTCONF (with JSON or XML). For a complex transactional change that must either fully apply or roll back, you choose NETCONF. For a simple read or one-off change, RESTCONF is appropriate.
Select an Automation Tool
You pick a tool like Ansible, SaltStack, or Cisco NSO. Ansible is common because it is agentless. You write a playbook that tells the tool which devices to target and what protocol (NETCONF or RESTCONF) to use to send the YANG model.
Execute the Playbook or Orchestration Script
You run the tool from a central server. It opens connections (SSH for NETCONF, HTTPS for RESTCONF) to each device in parallel, sends the YANG-encoded configuration, and waits for confirmation. The tool logs successes and failures.
Verify and Audit the Changes
You use the same tool or a separate script to query the devices' operational state via NETCONF or RESTCONF GET operations. You confirm that the configuration was applied correctly. All changes are logged for compliance and troubleshooting.
Consider a real scenario: a large internet service provider (ISP) like TalkTalk or Virgin Media needs to upgrade the security settings on 10,000 customer-facing routers across the UK because a new vulnerability was discovered. In the past, a team of 50 engineers would log in via SSH one by one, type the same 20 commands, and hope they did not make a typo. This would take two weeks, and mistakes were common.
Today, using network automation, a single senior engineer can do this in 15 minutes. Here is the step-by-step process: The engineer first creates a YANG data model that defines the new security settings — for example, enabling TCP MD5 authentication on all BGP sessions. They write this YANG model in a file. Then, they write an Ansible playbook that targets all 10,000 devices, specifying that the playbook should use the NETCONF protocol to push the YANG model to each device.
The engineer runs the playbook from a central Linux server. Ansible establishes NETCONF over SSH sessions to each router in parallel (or in batches to avoid overwhelming the network). Each receives the XML-encoded YANG configuration. The router's operating system (like IOS XR or NX-OS) validates the data against its own YANG schema; if it matches, it applies the change. The router then sends back a confirmation message. If any device fails — say because a router is offline or its model doesn't support that YANG feature — Ansible logs that error and the engineer can investigate later.
In the next step, the engineer uses RESTCONF to query the live state of a sample of routers to verify the changes took effect. They can use a simple Python script with the 'requests' library to send a GET request to a RESTCONF endpoint, such as 'https://router-ip/restconf/data/Cisco-IOS-XE-native:native/ip/route'. The response comes back as JSON, and the script parses it to confirm the routes are correct.
This automation eliminates human error, ensures every router is configured identically, and provides a full audit trail — every change is logged by the automation tool. The 350-501 exam expects you to understand that this is the 'day-to-day' reality for service provider network engineers and that automation tools like Ansible are used to enforce infrastructure as code (IaC), where the network configuration is treated as version-controlled code, just like software. The exam will ask you to identify which protocol (NETCONF vs RESTCONF) is best for a transactional change (NETCONF) versus a simple read (RESTCONF).
The 350-501 exam tests 'Network Automation Fundamentals' in a very specific way. You will see between 5 and 10 questions on this topic, typically as multiple-choice, drag-and-drop, or simulation-style questions. The examiners focus on three main areas: the differences between NETCONF and RESTCONF, the role of YANG data models, and the tools used for automation.
A common exam trap is confusing the transport protocol with the data encoding. For example, they might ask, 'Which protocol uses XML exclusively for data encoding?' The answer is NETCONF, because RESTCONF supports both XML and JSON. Another trap is mixing up the API style: they love to ask, 'Which protocol is RESTful?' The answer is RESTCONF, because it uses HTTP verbs. NETCONF uses RPC (Remote Procedure Call) style, not REST.
Here are the exact concepts the exam tests:
YANG as a data modeling language: They will ask you to identify that YANG defines the structure of configuration and state data. They may give you a scenario where a network engineer wants to define a custom configuration parameter; the correct answer is YANG.
NETCONF layers: They test you on the four layers of NETCONF (Content, Operations, Messages, and Secure Transport). You need to know that NETCONF uses SSH as the secure transport layer.
RESTCONF vs NETCONF characteristics: You must memorise that NETCONF supports multiple configuration data stores (candidate, running, startup) while RESTCONF only supports the running datastore by default.
Automation tools: Expect questions asking which tool uses playbooks (Ansible) or which is agentless (Ansible). They may also ask about Cisco NSO for service orchestration.
Trap patterns to watch for:
They will offer an answer choice that says 'NETCONF uses JSON for data encoding' — that is false; NETCONF uses XML exclusively.
They might say 'RESTCONF uses SSH for transport' — false; RESTCONF uses HTTP/HTTPS.
They may describe a scenario where a network engineer wants to make a quick, one-time change to a device's config without requiring a transaction; the best answer is RESTCONF because it is simpler and stateless.
They might ask, 'Which protocol is used to retrieve only the operational state of an interface?' Both NETCONF and RESTCONF can do this, but the exam expects you to know that RESTCONF's GET operation is simpler for retrieval.
To memorise: YANG = data model, NETCONF = XML + SSH + RPC, RESTCONF = XML/JSON + HTTP + REST. Automation tools: Ansible = push model, agentless, playbooks. Cisco NSO = service orchestration, layered architecture. Do not confuse the 'candidate' datastore with the 'running' datastore — NETCONF supports both, RESTCONF only running.
YANG is a data modelling language, not a protocol; it defines the structure of configuration and state data for network devices.
NETCONF uses XML for data encoding and SSH for secure transport, and it supports multiple configuration datastores (candidate, running, startup).
RESTCONF uses HTTP/HTTPS and supports both XML and JSON encoding; it is RESTful and stateless, making it simpler than NETCONF.
Ansible is an agentless automation tool that uses a push model with playbooks written in YAML; it can use NETCONF or RESTCONF as transport protocols.
Automation reduces human error, enforces consistency, and provides an audit trail; it is essential for managing large service provider networks.
The 350-501 exam tests the differences between NETCONF and RESTCONF, the layers of NETCONF, and the role of YANG in vendor-neutral configuration.
Cisco NSO is an orchestration tool that uses YANG models and NETCONF to manage multi-vendor networks at scale.
These come up on the exam all the time. Here's how to tell them apart.
NETCONF
Uses XML exclusively for data encoding
Uses SSH as the secure transport layer
Supports candidate, running, and startup datastores
RESTCONF
Supports both XML and JSON data encoding
Uses HTTP/HTTPS as the transport layer
Only supports the running datastore by default
YANG (Data Model)
Defines the structure and constraints of configuration data
Is a modeling language, not a transport mechanism
Written in a tree-like hierarchy with leaf, list, and container nodes
NETCONF (Protocol)
A protocol that transports YANG-encoded data over SSH
Performs operations like <get>, <get-config>, <edit-config>
Uses RPC-style communication, not REST
Ansible (Push)
Agentless: no software needed on target devices
Uses push model: the control node sends config to devices
Playbooks are written in YAML
SaltStack (Pull/Push)
Optionally uses a salt minion agent on target devices
Supports push and pull models; devices can fetch config
Uses sls files (Salt states) for configuration
RESTCONF (RESTful API)
Uses HTTP verbs: GET, POST, PUT, DELETE
Returns structured data (XML/JSON) that can be parsed by software
Allows automation and idempotent operations
CLI (Command Line Interface)
Uses human-readable commands typed one at a time
Returns unstructured text output that is hard to parse
Manual and error-prone, best for one-off checks
Mistake
NETCONF and RESTCONF are interchangeable and can be used for the exact same tasks.
Correct
NETCONF is for complex, transactional configuration management with multiple datastores; RESTCONF is simpler, stateless, and better for lightweight web-based interactions.
Beginners see both as 'network APIs' and assume they do the same thing, but their architectures and use cases differ significantly.
Mistake
YANG is a protocol like NETCONF, used to send data between devices.
Correct
YANG is a data modelling language that defines the structure and constraints of data; it is not a protocol. NETCONF and RESTCONF are protocols that transport YANG-encoded data.
The term 'data model' is abstract, and beginners often equate all technical terms as 'ways to communicate' rather than separate layers.
Mistake
Ansible is the only automation tool that can use NETCONF.
Correct
Many tools like SaltStack, Puppet, and Cisco NSO can also use NETCONF. Ansible is just one popular option that is agentless.
Because Ansible is well-known and widely taught, beginners assume it is the exclusive tool for NETCONF, but the exam tests knowledge of multiple tools.
Mistake
RESTCONF always uses JSON, never XML.
Correct
RESTCONF supports both JSON and XML as data encoding formats, though JSON is more common because it is lighter and more web-friendly.
Beginners read that RESTCONF is 'lightweight and uses JSON' and forget that XML is also valid, leading to incorrect answers on the exam.
Reveal each answer, then mark whether you got it right. Score 60%+ to unlock the next chapter.
YANG is a data modeling language, not a protocol. It defines the structure and constraints of data, while NETCONF and RESTCONF are protocols that transport that data.
No, NETCONF only supports XML for data encoding. JSON is supported by RESTCONF, not NETCONF.
NETCONF uses XML, SSH, RPC style, and supports multiple datastores (candidate, running). RESTCONF uses HTTP/HTTPS, XML or JSON, RESTful style, and only supports the running datastore by default.
No, Ansible is agentless. It does not require software on the target devices; it connects via SSH or NETCONF/RESTCONF and pushes configuration.
The candidate datastore is a workspace where you can make and validate configuration changes before committing them to the running datastore. It helps prevent half-applied changes.
Service providers manage thousands of devices; manual configuration is error-prone and slow. Automation ensures consistency, reduces downtime, and enables rapid scaling and compliance.
You've finished Network Automation Fundamentals. Continue through the 350-501 study guide to build a complete picture of the exam.
Done with this chapter?