By the end of this lesson you can
- Explain why automation helps and name the three planes
- Describe controller based networking and SDN layers and APIs
- Match CRUD to HTTP verbs and read common status codes and auth types
- Read and fix JSON and extract values by path
- Explain what Ansible, Terraform and AI do in network operations, and their risks
Why automate, and the three planes
Typing the same NTP server into 300 devices by hand takes a day and produces a few typos. A script or tool does it in minutes, identically, and can report every device whose config has drifted from the standard. Automation does not replace network engineers; it removes repetitive work so they can design, review and troubleshoot.
Controller based networking centralises management (and sometimes control) logic. Examples: Cisco Catalyst Center (formerly DNA Center) for campus, SD-WAN Manager for WAN, and APIC for ACI data centres. Instead of logging into each switch, you describe what you want once and the controller pushes it.
SDN: underlay, overlay, fabric and APIs
- Underlay: the physical IP network: links, routing, addresses.
- Overlay: virtual networks built as tunnels on top of the underlay, for example VXLAN.
- Fabric: underlay and overlay managed together as one system.
Virtualisation runs on the same idea of abstraction. A type 1 hypervisor runs on bare metal (VMware ESXi, Microsoft Hyper-V, KVM); a type 2 runs on top of an operating system (VirtualBox, VMware Workstation). Virtual machines each carry a full operating system; containers share the host's kernel and are lighter. In networking, a VRF gives one router several separate routing tables, so different customers or departments can even reuse the same addresses.
REST APIs
REST is an architectural style, usually over HTTP: client and server, stateless (every request carries everything needed, including authentication), with resources identified by URLs.
| CRUD | HTTP verb | Example |
|---|---|---|
| Create | POST | Add a device to the inventory |
| Read | GET | List devices |
| Update | PUT (replace) or PATCH (change part) | Change a device's location |
| Delete | DELETE | Remove a device |
| Code | Meaning |
|---|---|
| 200 OK | Success, here is the result |
| 201 Created | A new resource was made |
| 204 No Content | Success, nothing to return |
| 400 Bad Request | Your request is malformed |
| 401 Unauthorized | Not authenticated (missing or bad credentials or token) |
| 403 Forbidden | Authenticated, but not allowed |
| 404 Not Found | No such resource |
| 500 Internal Server Error | The server failed |
Authentication types: HTTP Basic (username and password Base64 encoded, which is encoding not encryption, so HTTPS only), API keys, bearer tokens (often obtained by first POSTing credentials, then sent in a header on each request), and OAuth for delegated access.
Reading JSON
JSON is the most common encoding for API data (XML and YAML are the others you will meet). Its types: an object { } of key value pairs, an array [ ] of values, a string in double quotes, a number, true or false, and null. Keys must be strings in double quotes. Standard JSON allows no comments, no single quotes and no trailing commas.
The JSON above is illustrative, written for this lesson. A real controller's field names may differ, so read what yours returns.
Ansible, Terraform and AI
| Ansible | Terraform | |
|---|---|---|
| Style | Procedural tasks in order, aiming to be idempotent (safe to run twice) | Declarative: describe the end state |
| Language | YAML playbooks | HCL |
| How it reaches devices | Agentless, over SSH or APIs, using modules | Providers that talk to platform APIs |
| Dry run | ansible-playbook --check | terraform plan, then apply |
| Remembers | An inventory of hosts | A state file of what it created |
- name: Set NTP on all routers
hosts: routers
gather_facts: false
tasks:
- name: Push the NTP server
cisco.ios.ios_config:
lines:
- ntp server 192.168.1.100This uses the ios_config module from the cisco.ios collection; the inventory would put your routers in a routers group with ansible_network_os: cisco.ios.ios and ansible_connection: network_cli. Terraform has providers for Cisco platforms (for example IOS XE); the resource names depend on the provider version, so check its documentation before writing one.
AI and machine learning in network operations: predictive and ML tools learn a baseline of normal behaviour, flag anomalies and forecast capacity; generative AI drafts configs, summarises logs and answers questions in plain language. It can also be confidently wrong, so everything it produces is reviewed and lab tested like a junior engineer's change.
Flashcards: do you remember?
Tap a card to flip it. Try to answer in your head first; recalling is what makes it stick.
Quick quiz
Instant feedback on every answer. Score 70% or more to pass this lesson's quiz.
Q1Which HTTP verb reads data?
GET is read.
Q2A script gets 401 from the controller. Most likely:
401 means not authenticated.
Q3Which is valid JSON?
Double quoted keys, lowercase true, no trailing comma.
Q4Which interface does a controller use to configure devices?
Southbound faces the devices.
Q5What makes Ansible different from many tools?
Agentless over SSH or APIs.
Q6Generative AI wrote a config for you. What next?
Treat it like an unreviewed change.
Hands-on lab
Packet Tracer lab 3.14: talk to the Packet Tracer Network Controller with REST
You need: Cisco Packet Tracer (free with a Cisco Networking Academy account; version 9.0.1 was the current download on the NetAcad Resource Hub when this lesson was written). Packet Tracer 8.2 and later include a Network Controller device that, per Cisco's PT FAQ, offers a web GUI and APIs reachable from a browser, Python or Postman. That FAQ page could not be opened directly when this was written (it was read from a search result), so treat the details as UNVERIFIED. Devices: Network Controller, 2 x ISR4331, 1 x 2960, 1 x PC-PT.
Simulator lab, zero risk. This lab runs inside Cisco Packet Tracer, so it touches no real network. Packet Tracer is free with a Cisco Networking Academy account (netacad.com). It simulates a subset of Cisco IOS, so where support for a feature is uncertain we say so instead of promising it works.
Topology and addressing
| Device | Interface | IPv4 address / prefix | Default gateway or note |
|---|---|---|---|
| Controller | Gi0 | 192.168.1.200/24 | gateway 192.168.1.1 |
| R1 | Gi0/0/0 / Gi0/0/1 | 192.168.1.1/24 / 10.0.12.1/30 | |
| R2 | Gi0/0/1 | 10.0.12.2/30 | static route to 192.168.1.0/24 via 10.0.12.1 |
| SW1 | VLAN 1 | 192.168.1.2/24 | gateway .1 |
| Admin-PC | Fa0 | 192.168.1.50/24 | gateway .1 |
Prepare the devices
R1(config)#hostname R1 R1(config)#ip domain-name cwm.lab R1(config)#username admin secret <a long password> R1(config)#crypto key generate rsa modulus 2048 R1(config)#line vty 0 4 R1(config-line)#login local R1(config-line)#transport input ssh R2(config)#ip route 192.168.1.0 255.255.255.0 10.0.12.1Repeat the SSH setup on R2 and SW1.
Controller GUI
From Admin-PC's browser open http://192.168.1.200 (or https, depending on the build), create the admin account, and add R1, R2 and SW1 with their SSH credentials. The section is called something like Provisioning or Discovery; names vary by build and are UNVERIFIED.
Compare views
Read the controller's inventory and topology views and compare them with
show cdp neighborson R1.REST from Admin-PC
Open Desktop, Programming (Packet Tracer's Python environment). The controller is commonly documented with APIC-EM style endpoints:
POST /api/v1/ticketto get a token andGET /api/v1/network-devicewith anX-Auth-Tokenheader. These paths, the header name and the Python modules available inside Packet Tracer are UNVERIFIED for your build: open the controller's own API documentation page and Packet Tracer's sample programs first, then write the script.Read the reply
In the JSON you get back, find an object, an array, a string and a number, and write down the path to each device's hostname, as in the JSON reader in this lesson.
Paper exercise
Outside Packet Tracer: write a short Ansible playbook outline that sets the NTP server on all routers (like the one above), then describe the same intent as a Terraform outline. What would
--checkandterraform planshow you before anything changes?
You are done when: The controller lists R1, R2 and SW1 as managed and reachable; your script prints a successful (200) reply for the token request and for the device list, and a wrong password gives an authentication error (a 401 style code; the exact code in Packet Tracer is UNVERIFIED).
Packet Tracer limits and notes
- Ansible, Terraform, NETCONF and RESTCONF do not run inside Packet Tracer. Practise them later on a Linux machine (Stage 2 of this path prepares you).
- Packet Tracer's Programming environment supports a subset of Python with its own HTTP helper modules; exact module names are UNVERIFIED, so start from its sample programs.
- Field names in a real controller reply may differ from the illustration in this lesson. The AI and machine learning topic has no Packet Tracer lab: as a discussion exercise, take a syslog excerpt and an AI generated root cause, and check whether the logs really support it.
- Packet Tracer simulates a subset of IOS. If a command here is rejected in your version, note it, skip that step and carry on; the concept still applies to real Cisco gear.
Download the lab checklist (.txt) Print it or keep it open beside Packet Tracer.
Key takeaways
- Automation brings speed, consistency and drift detection; engineers still design and review.
- Data, control and management planes; controllers centralise the management side.
- Northbound to the controller, southbound to devices.
- REST: POST, GET, PUT or PATCH, DELETE, and know 200, 201, 204, 400, 401, 403, 404, 500.
- JSON: double quotes, no comments, no trailing commas.
- Protect tokens and secrets, dry run every change, and verify anything AI writes.
Finished the sections, quiz and lab? Mark the lesson complete. Progress is saved only in this browser.