Automation and programmability are essential for modern networking, enabling faster deployments, reduced human error, and centralized management.
SDN stands for Software-Defined Networking, a modern approach to networking that separates:
In traditional networks, both planes are integrated into devices, making management complex. SDN separates these planes, allowing for centralized control.
Centralized Management:
Dynamic Network Configurations:
Improved Scalability:
Programmability:
Applications:
Controller:
Network Devices:
Suppose you have three switches, and you want to configure a VLAN across all of them. Without SDN, you'd configure each switch manually. With SDN, you can:
Network automation uses tools or scripts to perform tasks like device configuration, monitoring, and troubleshooting without manual intervention.
Ansible:
Ansible Example:
Configure a VLAN on a Cisco switch.
- name: Configure a switch
hosts: switches
tasks:
- name: Configure VLAN
ios_config:
lines:
- vlan 10
- name Sales
Steps:
Define the hosts file with the switch's IP addresses.
Run the playbook:
ansible-playbook configure_vlan.yaml
Python Scripting with Netmiko:
What is Netmiko?: A Python library for SSH-based automation.
Example: Retrieve the interface status of a Cisco router.
from netmiko import ConnectHandler
device = {
"device_type": "cisco_ios",
"ip": "192.168.1.1",
"username": "admin",
"password": "cisco123"
}
net_connect = ConnectHandler(**device)
output = net_connect.send_command("show ip interface brief")
print(output)
Steps:
Install Netmiko:
pip install netmiko
Run the script to fetch interface details.
REST (Representational State Transfer) APIs allow network devices to be programmatically managed using HTTP methods like:
REST APIs are commonly used in SDN controllers and modern network devices.
Suppose you want to retrieve the interface status of a router using a REST API.
GET Request Example:
Use the following HTTP request:
GET http://router/api/interfaces
Example Python Script:
import requests
url = "http://192.168.1.1/api/interfaces"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
}
response = requests.get(url, headers=headers)
print(response.json())
Steps:
YOUR_ACCESS_TOKEN with the actual API token.Test API Access: Use tools like Postman to manually send API requests.
Check Device API Settings:
show restconf
OpenFlow is one of the first and most well-known southbound protocols in SDN architecture. It defines how the SDN controller communicates with network devices (e.g., switches, routers) to install forwarding rules.
Used by SDN controllers to direct packet forwarding decisions on OpenFlow-compatible switches.
The controller sends flow entries to the devices that specify how to handle traffic.
Enables centralized control and dynamic traffic management.
In an SDN network, when a switch receives a packet with no matching rule, it forwards the packet to the controller for instructions (packet-in message). The controller then responds with a flow-mod message to define future handling of similar packets.
XML-based protocol used to retrieve and edit configuration data on network devices.
Built on top of SSH.
Works well with YANG data models to structure configuration data.
A RESTful API (HTTP-based) interface that exposes YANG-modeled configuration and state data.
Supported on Cisco IOS XE and other modern devices.
Cisco’s implementation of RESTful network management.
| Feature | NETCONF | RESTCONF |
|---|---|---|
| Format | XML | JSON or XML |
| Transport | SSH | HTTPS (HTTP REST interface) |
| Data Model | YANG | YANG |
| Use Case | Precise config retrieval | Web-friendly API access |
JSON (JavaScript Object Notation) is a lightweight, human-readable format used for data interchange, especially in REST APIs.
{
"interface": {
"name": "GigabitEthernet0/1",
"enabled": true,
"ip": {
"address": "192.168.1.1",
"netmask": "255.255.255.0"
}
}
}
REST APIs return data in JSON for easy parsing and readability.
Widely supported by Python, JavaScript, and network automation tools.
APIs require secure access control. CCNA candidates should recognize the following basic authentication methods:
The client authenticates once and receives a token.
All subsequent API calls include the token in the Authorization header.
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Authorization: Basic YWRtaW46Y2lzY28=
Security Note: Basic Auth should always be used with HTTPS to protect credentials.
Both Ansible and Python scripting are used in network automation but serve different purposes and styles.
Agentless: Uses SSH, no software needed on devices.
Uses YAML playbooks to describe desired configurations.
Best suited for bulk device configuration and repetitive tasks.
Example Playbook:
- name: Configure VLAN
hosts: switches
tasks:
- name: Create VLAN 10
ios_config:
lines:
- vlan 10
- name Sales
Offers fine-grained logic and control.
Suitable for custom workflows, decision-making, and error handling.
Requires programming knowledge but provides more flexibility.
Example (Using Netmiko):
from netmiko import ConnectHandler
device = {
"device_type": "cisco_ios",
"ip": "192.168.1.1",
"username": "admin",
"password": "cisco123"
}
net_connect = ConnectHandler(**device)
output = net_connect.send_command("show ip interface brief")
print(output)
| Tool | Approach | Use Case | Best For |
|---|---|---|---|
| Ansible | Declarative | Large-scale deployments | Simplifying repetitive tasks |
| Python | Imperative | Custom logic and scripting | Advanced, conditional workflows |
| Topic | What You Should Know for CCNA |
|---|---|
| OpenFlow | Southbound SDN protocol used between controller and devices |
| RESTCONF / NETCONF | Cisco-supported config protocols; RESTCONF is HTTP-based |
| JSON | REST APIs return data in JSON; know syntax and usage |
| API Authentication | Token-based and Basic Auth – secure access to APIs |
| Ansible vs Python | Know when to use each tool; Ansible = simple bulk ops, Python = custom logic |
What is the key architectural difference between traditional networking and controller-based networking?
Controller-based networking separates the control plane from individual network devices and centralizes it in a controller.
In traditional networking, each device independently makes forwarding and control decisions using distributed protocols. In controller-based networking, the control plane is centralized within a software controller that manages the network devices. The controller communicates with devices using southbound APIs and provides centralized policy management. This architecture simplifies network configuration, enables automation, and allows administrators to manage large networks more efficiently through centralized orchestration.
Demand Score: 72
Exam Relevance Score: 86
Which HTTP method is commonly used in REST APIs to retrieve data from a server?
GET.
REST APIs use standard HTTP methods to perform operations on network resources. The GET method retrieves information from a server without modifying the resource. Other HTTP verbs include POST for creating resources, PUT for updating existing resources, and DELETE for removing them. These methods form the basis of CRUD operations used in network automation systems and management platforms that interact with devices programmatically.
Demand Score: 68
Exam Relevance Score: 84
Which configuration management tool uses playbooks written in YAML to automate network device configuration?
Ansible.
Ansible is a widely used automation tool that allows administrators to manage and configure network devices using playbooks written in YAML. These playbooks define tasks such as configuring interfaces, deploying policies, or updating firmware. Ansible communicates with devices over standard protocols like SSH and does not require agents installed on managed devices. This approach simplifies automation and allows consistent configuration deployment across multiple network devices.
Demand Score: 65
Exam Relevance Score: 83