Skip to content
Visual explainer 2h to learn 4 steps

SDN & network automation concepts

Explain control and data plane separation and how networks are configured as code.

By Invicly Tech, , in Computer Networking. About 10 minutes to read.

Topic 47 of 51

In short

Software-defined networking separates the control plane, which decides where traffic should go, from the data plane, which forwards packets. A central controller programs many devices through APIs, so the network can be managed as one system and configured as code. Cloud VPCs are SDN in practice.

Explained simply

Every router and switch does two jobs. First it thinks: it talks to its neighbours and decides which way each destination should go. That is the control plane. Then it works: it moves each packet out of the right port, millions of times a second. That is the data plane.

In a traditional network, every device does its own thinking, and engineers configure each one by hand, box by box. With a hundred switches, that means a hundred chances for a typo, and nobody has a full picture of the network.

Software-defined networking (SDN) moves much of the thinking to central software called a controller. The controller sees the whole network and tells each device what to do through an API. The devices mostly just forward packets.

Even without a full SDN controller, the same idea changes daily work. Engineers now describe the network in files, keep those files in Git, review changes like code, and let tools such as Ansible push the configuration to every device the same way.

Press Play on a diagram to walk through it one step at a time.

LayersSDN architecture
  1. 1
    Applications and intent

    Policies such as isolate tenant A.

  2. 2
    Northbound API

    REST APIs for automation.

  3. 3
    SDN controller

    Global view; computes forwarding state.

  4. 4
    Southbound API

    OpenFlow, NETCONF, gNMI.

  5. 5
    Data plane

    Switches and virtual switches forward packets.

FlowA network change as code
  1. 1
    Edit variables

    Add VLAN 40 in a YAML file

  2. 2
    Pull request

    Colleague reviews the diff

  3. 3
    CI checks

    Lint, then a dry run with --check --diff

  4. 4
    Merge and apply

    Pipeline runs the playbook

  5. 5
    Verify

    Tests confirm VLAN and reachability

  6. 6
    Roll back if needed

    Revert the commit and re-run

In depth

Control, data and management planes

The data plane forwards packets: it looks up the destination in a forwarding table and sends the packet out, often in specialised chips (ASICs) at line rate. The control plane builds that table: routing protocols like OSPF and BGP, ARP and spanning tree run here, on the device's CPU. The management plane is how humans and tools configure and monitor the device: SSH, SNMP, NETCONF, APIs and syslog.

In classic networks, all three live in every box, and the control plane is distributed: each router computes routes on its own from what its neighbours tell it. This is robust, since no single brain can fail, but it is hard to apply a consistent policy everywhere. SDN centralises the control plane, logically if not physically, so one system knows the full topology and computes forwarding state for all devices. Cloud VPCs are a large SDN: when you add a route in the console, a controller programs the virtual switches on thousands of hosts.

CompareTraditional versus software-defined
Traditional
  • Each device runs its own control plane
  • Configured box by box, often by CLI
  • No single global view
  • Robust, but policy drifts
Software-defined
  • Central controller computes state
  • Devices programmed via APIs
  • Global view of topology and policy
  • Controller must be highly available

Controllers and OpenFlow

OpenFlow was the first widely known SDN protocol. A switch keeps flow tables; each entry has match fields (such as input port, MAC addresses, VLAN, IP addresses, TCP ports), a priority, counters and instructions like forward to port 3, drop, or send to the controller. The switch connects to the controller over TCP, usually port 6653, often protected with TLS.

When a packet matches no entry, the switch can send it to the controller in a packet-in message. The controller decides what to do, installs a rule with a flow-mod message so later packets are handled in hardware, and may send the first packet back with packet-out. Open-source controllers include ONOS and OpenDaylight. In practice, pure OpenFlow found its strongest use in research, campus experiments and some large operators; most enterprise and data centre SDN today uses vendor controllers and protocols like NETCONF, gNMI and BGP EVPN, while virtual switches such as Open vSwitch still support OpenFlow.

SequenceReactive flow setup with OpenFlow
Host A
Switch
Controller
  1. 1First packet to host B
    Host A to Switch: First packet to host B
  2. 2packet-in: no matching flow
    Switch to Controller: packet-in: no matching flow
  3. 3flow-mod: match dst B, output port 7
    Controller to Switch: flow-mod: match dst B, output port 7
  4. 4packet-out: send the first packet
    Controller to Switch: packet-out: send the first packet
  5. 5Next packets match in hardware
    Host A to Switch: Next packets match in hardware

Intent-based networking

Intent-based networking raises the level further. Instead of writing device commands, you state the outcome you want, such as "guests may reach only the internet" or "the payment app must never share a segment with the guest network". The system then translates that intent into configuration for each device, applies it, and keeps checking that the live network still matches the intent.

The loop has three parts: translation (intent to policy to device config), activation (pushing the config) and assurance (collecting telemetry and verifying the result, raising an alert or fixing drift when reality differs). Commercial examples include Cisco Catalyst Center (formerly DNA Center) and Juniper Apstra. The value is consistency and continuous verification; the risk is that the translation layer is complex, so teams still need to understand what is pushed underneath.

CycleThe intent-based networking loop
  1. 1
    Declare intent

    Guests reach only the internet

  2. 2
    Translate

    Turn intent into policies and device config

  3. 3
    Activate

    Push config to switches, routers, firewalls

  4. 4
    Assure

    Collect telemetry; compare reality with intent

  5. 5
    Remediate

    Alert or fix drift, then keep checking

  6. Back to step 1

Automation with APIs and Ansible

Network automation does not require an SDN controller. Modern devices offer model-driven APIs: NETCONF runs over SSH on TCP port 830 and exchanges XML; RESTCONF offers the same data over HTTPS; gNMI uses gRPC and is popular for streaming telemetry. All describe configuration and state with YANG data models, so tools work with structured data instead of screen-scraping CLI text.

Ansible is the most common entry point. It is agentless: it connects over SSH or an API, so nothing is installed on switches. Inventory files list devices and set ansible_network_os (for example cisco.ios.ios) and ansible_connection (ansible.netcommon.network_cli for CLI over SSH, or ansible.netcommon.netconf). Resource modules like cisco.ios.ios_vlans and ios_interfaces take structured data and a state such as merged, replaced or overridden. Run with --check --diff first to see changes without applying them, and keep playbooks and variables in Git so every change is reviewed.

  • NETCONF: TCP 830 over SSH, XML
  • RESTCONF: HTTPS with JSON or XML
  • gNMI: gRPC, streaming telemetry
  • ansible-playbook --check --diff previews changes

Learn it in 4 short steps

About 30m each. Track them with a timer in your plan.

  1. 1
    Separate control and data planes~30m
  2. 2
    Explain controllers and OpenFlow~30m
  3. 3
    Explain intent-based networking~30m
  4. 4
    Automate configs with APIs and Ansible~30m

Key points

  • Control plane: routing decisions. Data plane: per-packet forwarding.
  • Centralised control gives a global view and consistent policy.
  • Network automation uses Ansible, APIs and version-controlled configs.
  • Intent-based networking states the desired outcome, not device commands.

Key terms

Tap a card to flip it. 0/4 known

Examples

text
# Ansible task pushing a VLAN to Cisco switches
- name: Ensure VLAN 30 exists
  cisco.ios.ios_vlans:
    config:
      - vlan_id: 30
        name: VOICE
    state: merged

Pushing VLANs to every access switch with Ansible

A new Voice VLAN must exist on 40 access switches. Step 1: define the switches in an inventory group with the network OS and connection type. Step 2: write a playbook using the ios_vlans resource module with state merged, so existing VLANs stay untouched. Step 3: run with --check --diff to see what would change. Step 4: run it for real, then re-run to confirm it reports no changes (idempotence).

yaml
# inventory.yml
access_switches:
  hosts:
    sw[01:40].office.example.com:
  vars:
    ansible_network_os: cisco.ios.ios
    ansible_connection: ansible.netcommon.network_cli
# vlans.yml
- hosts: access_switches
  gather_facts: false
  tasks:
    - cisco.ios.ios_vlans:
        config: [{ vlan_id: 30, name: VOICE }]
        state: merged

Reading device state with RESTCONF

You want the interface list from a router as structured JSON instead of parsing show output. Step 1: enable RESTCONF on the device (on Cisco IOS XE, the restconf command plus an HTTPS server). Step 2: request the ietf-interfaces YANG model over HTTPS with the right Accept header. Step 3: process the JSON with jq. The same data path works for changes with PUT or PATCH, which is how many controllers and scripts talk to devices.

bash
curl -sk -u admin:"$PASS" \
  -H 'Accept: application/yang-data+json' \
  https://10.0.99.1/restconf/data/ietf-interfaces:interfaces \
  | jq '."ietf-interfaces:interfaces".interface[] | {name, enabled}'

Quick reference

  • Data plane forwards packets; control plane builds tables; management plane configures
  • OpenFlow: match, priority, counters, actions; controller usually on TCP 6653
  • packet-in: switch asks controller; flow-mod: controller installs a rule
  • NETCONF on TCP 830 (SSH), RESTCONF over HTTPS, gNMI over gRPC; all use YANG
  • Ansible is agentless: set ansible_network_os and ansible_connection per group
  • Resource module states: merged adds, replaced swaps per item, overridden replaces all
  • Always run ansible-playbook --check --diff before applying network changes
  • Intent-based loop: translate, activate, assure, remediate

Quick quiz

Pick an answer to see if you're right and why.

Question 1

1Which plane runs OSPF and BGP on a router?

Question 2

2In OpenFlow, what does a switch send when a packet matches no flow entry and the table-miss rule says to ask the controller?

Question 3

3Which protocol uses YANG models over SSH on TCP port 830?

Question 4

4What does the assurance part of intent-based networking do?

0/4 answered

Practice exercises

Try each one yourself first. Use the hint if you get stuck, then compare with the solution.

  1. Exercise 1easy

    For each item, say whether it belongs to the control, data or management plane: an OSPF hello, forwarding a video packet, an SSH login to a switch, an ARP reply, an SNMP poll.

  2. Exercise 2medium

    Write an Ansible playbook that sets the description of interface GigabitEthernet0/1 on all access switches to "Uplink to core" and makes sure it is enabled.

  3. Exercise 3hard

    Design a Git-based workflow for network changes with review, a dry run, automatic deploy and rollback. List the pipeline stages and what each must check.

Check yourself

Answer in your head, reveal, then be honest with yourself.

Feel confident about this topic?

Frequently asked questions

Is SDN the same as network automation?
No. SDN is an architecture where a controller holds the control logic. Network automation means using scripts and tools to configure devices, which you can do with or without SDN.
Is OpenFlow still used?
It is still supported in virtual switches like Open vSwitch and used in research and some operator networks, but most enterprise SDN today uses vendor controllers with NETCONF, gNMI, EVPN and APIs.
Do I need to learn Python for network automation?
It helps a lot. Ansible lets you start with YAML, but Python libraries such as Netmiko, NAPALM and ncclient cover cases Ansible modules do not.
Is a cloud VPC an example of SDN?
Yes. The provider's controllers program virtual switches and routers on their hosts whenever you change subnets, routes or security groups through the API.
ShareXLinkedInWhatsApp