The Network#
The VLAN automation had been running for three weeks in the lab. Three switches, one of each vendor, every workflow passing, so the team felt confident and tried to promote it to production.
The first production run stopped partway when the maintenance window closed, and the team re-ran it the next night, as designed. On the re-run, 23 of the 800 campus switches failed. All from the same Vendor C platform (the ones using an older firmware version, not available in the lab).
The playbook checked the error response from each device after pushing the VLAN configuration. On Vendor C’s current firmware, an already-existing VLAN returns the error code duplicate-vlan. On the older firmware version, the same condition returned vlan-exists. The playbook had been written to treat duplicate-vlan as an idempotency signal, meaning “this already exists.” It had not been written to handle vlan-exists, so it treated that response as a failure. All 23 switches reported failure for a change they had applied the night before, so the team had to spend time validating something that was already correct.
The automation was not wrong. The network had an opinion that nobody on the team knew about.
This chapter addresses the block that was always implicit throughout Part 2: the network itself. Every building block built so far was designed by the automation team and behaves according to its documented interfaces. The network was inherited. It has quirks, diverse interfaces, firmware inconsistencies, and capabilities that vary by vendor, platform, and software generation. This chapter answers three questions: what do we need from the network to make automation reliable, how do we safely validate automation logic before it touches production, and how does the automation stay stable while the network keeps changing?
Fundamentals#
Chapter 3 introduced The Network as one of the seven blocks in the NAF Framework: the only block the automation team does not “own” (it is in the scope of network engineering). They configure it, observe it, and model its intent, but they did not build the operating system, the data model, or the Application Programming Interface (API). That dependency shapes every design decision in the Network Automation Platform (NAP) above it.
Chapter 6 covered the Executor’s write path and Chapter 7 the Collector’s read path. Both treat one thing as given: that the device on the other end exposes a reliable, consistent interface. This chapter asks whether that assumption holds, and what to do when it does not. The two paths usually meet on the same device and often on the same protocol.
This chapter closes Part 2. The six previous chapters built the NAP: a place to store intent, a way to execute it, a way to observe results, an engine to coordinate everything, and surfaces to expose it to consumers. This chapter addresses the thing the NAP was always pointing at.
Three goals define The Network block’s contribution to the NAP:
Support the full network infrastructure spectrum. A large NAP may talk to campus switches, data center fabrics, cloud VPCs, Kubernetes overlays, overlay controllers, and legacy gear simultaneously. Each type exposes different programmable interfaces. The NAP must handle all of them without collapsing into a single lowest-common-denominator abstraction.
Validate automation and new designs before they reach production. A lab catches logic errors, interface contract violations, and device quirks at the cost of minutes, instead of hours in a production incident. It is also where new network designs are tried before any hardware is ordered.
Keep the NAP stable as the network evolves. New vendors are added. Firmware versions change. New infrastructure types arrive. The NAP must be designed to absorb this change through abstraction strategies, not through ad hoc patches to every workflow whenever the network changes.
What is in scope
- The interfaces through which the Executor and Collector reach network devices, and how to choose one per device and operation
- The testing environments and methodologies that validate automation before production
- Abstraction strategies for managing multi-vendor and multi-platform heterogeneity
- The implications of cloud, Kubernetes, and overlay networking for automation design
What is out of scope
- Configuration rendering and template code (the Executor’s adapters, Chapter 6)
- Execution mechanics: how automation tooling executes a task, including the adapters that speak each interface (Executor, Chapter 6)
- The telemetry collection pipeline: how metrics flow into the time-series database (Observability, Chapter 7)
The boundary is consistent: this chapter covers the network’s side of each interface, not the NAP’s side. That boundary is what the three functionalities below are organized around.
Functionalities#
The NAP can only work with the network as the network allows. Every design decision in the previous six chapters ultimately resolves to one question: what does the device on the other end of the connection support? That holds for how intent is stored, how execution runs, how telemetry is collected, how workflows are coordinated, and how consumers are served. This chapter examines that constraint directly.
The constraint reaches every block. A device that only speaks Command Line Interface (CLI) forces the Executor’s adapter into screen scraping. A device missing an OpenConfig path leaves the Collector with a vendor-specific workaround or a gap. The topology caps what the Orchestrator can run in parallel: a batch size, safe for a flat access layer, can partition a leaf-spine fabric if it hits several spines at once.
Every other block’s contract is one the automation team wrote and can change. The network’s is discovered, varies by firmware release, and sometimes contradicts its own documentation. A contract you cannot set, you at least write down: the Source of Truth (SoT) records OS version, interface capability, and topology role next to the inventory, because they gate adapter selection, collection method, and concurrency. A SoT without them is incomplete in ways that only show at execution time. Figure 10.1 maps the Network goals to the functionality that delivers each one.
- Programmable Interfaces: the full range of network types the NAP must automate, and the interface each one exposes to the Executor and Collector.
- Simulation and Testing Environments: the toolchain for pre-production validation. Where different lab environment types fit, how they connect to the Saga Pattern from Chapter 8, and how to scale them.
- Abstraction Strategies: structural approaches that allow the NAP to remain stable as the underlying network changes, regardless of vendor, platform generation, or interface protocol.
The first one decides everything downstream, because a device that exposes nothing programmable cannot be automated whatever the rest of the NAP looks like.
Programmable Interfaces#
The network is heterogeneous by nature: a spectrum of infrastructure types accumulated over years, each with its own interface model, abstraction level, and automation maturity. Different teams often built them in parallel; Chapter 11 and Chapter 14 explore the ownership boundaries. A modern NAP can span campus switches, data center fabrics, cloud VPCs, overlay controllers, Kubernetes clusters, service provider WAN infrastructure, and hyperscaler-managed forwarding planes, simultaneously. The NAP must handle all of them. The infrastructure type determines what interface is available. The NAP adapts to that reality; it cannot mandate a uniform interface.
This is a high-level recap of different network infrastructure scenarios you may have to tackle, depending on the nature of your company:
Campus and branch switching is the core scenario I used as the example throughout Part 2: multi-vendor physical switches, three platforms in one fleet. Modern campus gear exposes CLI, NETCONF, and gRPC Network Management Interface (gNMI) simultaneously. Automation maturity is high for equipment from the past five to seven years; it is patchy for legacy gear still running decade-old firmware.
Data center fabric topology is typically leaf-spine, often from a smaller vendor set: Arista, Cisco Nexus, NVIDIA Cumulus, or automation-native open networking platforms. Interface uniformity is higher than campus; change management is stricter. EVPN/VXLAN overlays add a management plane above the fabric that may have its own API, separate from the individual device interface. This is also where open networking platforms land first. SONiC and DENT run Network Operating System (NOS) software on commodity hardware, and SONiC-based platforms (Cisco 8000 and a growing ODM ecosystem) are now common in hyperscaler-influenced and large-scale enterprise data centers.
Service provider and WAN infrastructure (carrier-grade routers, MPLS networks, Segment Routing SRv6 fabrics) has its own automation challenges: scale, protocol complexity, and the dual concern of control-plane configuration and traffic engineering policy. NETCONF and Yet Another Next Generation (YANG) models are well-established in this space; platforms like Cisco IOS-XR and Junos have mature YANG coverage. The NAP often targets a controller (SR-PCE, Crosswork, NSO) instead of the individual devices.
Cloud networking: AWS VPC, Azure VNet, GCP VPC, and others, reached through Representational State Transfer (REST) APIs with eventual consistency. There is no “pushing a config” and waiting for a synchronous confirmation: the change is accepted, then converges. Chapter 6 covers what that means for the Executor: create, poll, verify, and short-lived tokens instead of device credentials.
SD-WAN and overlay networks (Cisco SD-WAN, Versa, VMware VeloCloud) are controller-managed. The automation target is the controller API instead of the individual device. The physical underlay still exists but is managed entirely through the overlay’s abstraction. This affects both execution and observability: the Executor writes policy to the controller; telemetry about traffic, path selection, and policy enforcement also flows through the controller’s northbound interface.
Kubernetes networking at the CNI layer inverts the device model entirely. The network is defined through Kubernetes API objects: NetworkPolicy, Services, Ingress, and custom resources from CNI plugins such as Cilium or Calico. The device disappears as an automation target. The Kubernetes API is the interface. Network policies are code, not device configuration. Many environments are converging on this: declarative intent, controller-reconciled state, no direct device access.
DPUs and SmartNICs (NVIDIA BlueField, Intel IPU, Marvell Octeon) represent a shift in where network processing happens. In some data centers, especially hyperscale and Artificial Intelligence (AI) clusters, a DPU sits in every server to offload network functions: VXLAN encapsulation, encryption, firewall policy enforcement, load balancing, and microsegmentation. This offloads these functions from the host Central Processing Unit (CPU) and from network appliances to the SmartNIC firmware. The consequence for automation: “the network device” is no longer only a switch or router in the rack. Functions previously managed through dedicated network appliance APIs are now managed through the DPU management plane and its vendor SDK, a new interface category that standard NETCONF and gNMI tooling does not yet reach cleanly.
Wireless networks (Cisco Catalyst Center, Aruba Central, Juniper Mist) are controller-based; the automation target is the controller API. Relevant whenever VLAN provisioning extends to wireless SSIDs alongside wired switch ports, as it would in the campus scenario.
Out-of-band and management networks carry every other interface in this list. Console servers, terminal servers, management switches, and jump hosts are the path the Executor’s writes and the Collector’s reads actually travel, which makes this the one infrastructure type whose failure takes the NAP with it. Two consequences follow:
- It is a target like any other. Management VRFs, the ACLs deciding which hosts may reach a device’s management plane, and console server access all belong in the SoT and under automated configuration, even though many teams still maintain them by hand.
- It needs a stricter change policy than the data plane. A change that breaks in-band reachability can be recovered over out-of-band, while a change that breaks out-of-band reachability needs someone to drive to the site. Where the device supports it, a confirmed commit is the device-side mitigation, which is why that capability is on the checklist in the Per-Device Interface Selection section below.
The Network block is not only switches, routers, and controllers. The services every device and host depends on, such as Domain Name System (DNS), Dynamic Host Configuration Protocol (DHCP), and Network Time Protocol (NTP), belong to it too, and the NAP automates them like any other target. A new campus VLAN is not usable until its DHCP scope exists and its gateway resolves in DNS. Keep the data and the service apart: the scopes and records are intent, owned by the IPAM in the campus example of Chapter 5, while the servers that answer requests are the network. DDI products (DNS, DHCP, and IPAM in one) often host both, which is one tool implementing two blocks.
The list is not exhaustive. What matters is that automating any non-trivial network means dealing with several of these types at once. The Executor and Collector must route each operation to the correct interface type. The SoT must model intent at a level above the individual interface. The NAP has to absorb, somehow, the network complexity as a design constraint.
Programmable Interface Types#
Each infrastructure type exposes one or more interface types to the NAP. The same physical switch may expose many simultaneously. The NAP adapts to what is available, with preferences that reflect reliability, structure, and scale. There is no universal mandate for the interface type; the right choice depends on what the device supports and what the operation requires.
- CLI over Secure Shell (SSH) is universal, legacy, and fragile. Screen-scraping and text parsing break when firmware changes output formatting or adds new fields. Error codes are inconsistent across vendors and across firmware versions. CLI is still the only option for older gear. The recommendation is to minimize its use and avoid building workflows that depend on it for anything more than the devices that have no alternative (the last resort). Setting an interface description looks like:
interface GigabitEthernet0/1
description uplink-to-core- NETCONF is structured, transactional, and correct when it works. It supports atomic operations and rollback where the device implements the optional candidate and confirmed-commit capabilities, and its data model is machine-parseable. The transport layer (XML over SSH) is generally reliable; the data model layer is where the gaps are. Vendor YANG model quality varies significantly: a device may claim NETCONF support but have incomplete or proprietary models for features the NAP needs. IETF and OpenConfig YANG models standardize the intent layer; vendor-native YANG models fill the gaps. The same interface description via NETCONF:
<config>
<interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
<interface>
<name>GigabitEthernet0/1</name>
<description>uplink-to-core</description>
</interface>
</interfaces>
</config>- RESTCONF is the HTTP-based equivalent of NETCONF, using the same YANG models but exposed over REST semantics. It is useful when teams are more comfortable with Hypertext Transfer Protocol (HTTP) tooling than with NETCONF’s XML/SSH transport. The data model is the same; only the transport differs. Vendor support is less uniform than NETCONF. The same interface description via RESTCONF:
PATCH /restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet0%2F1
Content-Type: application/yang-data+json
{
"ietf-interfaces:interface": [
{
"name": "GigabitEthernet0/1",
"description": "uplink-to-core"
}
]
}- gNMI and gNOI are gRPC Remote Procedure Call (gRPC)-based protocols. gNMI handles telemetry and configuration read/write; gNOI handles operational commands. Modern and scale-friendly. Vendor support is getting broader, though the models are not always compatible across vendors. Chapter 7 covered gNMI from the Collector’s perspective. This chapter covers the device-side prerequisite: the device must support gNMI subscriptions at the OS version the NAP targets. The same interface description via gNMI SetRequest:
path: /interfaces/interface[name=GigabitEthernet0/1]/config/description
value: "uplink-to-core"- Vendor REST APIs (eAPI, NX-API, Cumulus NVUE, and similar) are machine-readable but not standardized across vendors. Useful as a gap-filler when NETCONF or gNMI is absent or incomplete for a specific operation. NVIDIA Cumulus switches expose NVUE, a structured REST API with a consistent JavaScript Object Notation (JSON) schema, as their primary programmatic interface; Arista and Cisco Nexus expose eAPI and NX-API respectively as alternatives to NETCONF. Treat these as adapter-layer concerns, not as a foundation for a vendor-neutral NAP. The same interface description via Arista eAPI (JSON-RPC over HTTPS), where the interface follows Arista’s own naming:
{
"jsonrpc": "2.0",
"method": "runCmds",
"params": {
"version": 1,
"cmds": [
"enable",
"configure",
"interface Ethernet1",
"description uplink-to-core"
],
"format": "json"
},
"id": "1"
}- Cloud and controller APIs follow REST patterns with eventual consistency. The async operation model is a design requirement, not a limitation to work around. For SD-WAN, wireless, and DPU management planes, the controller API is often the only available interface. Adding a description to an AWS VPC illustrates the pattern. The call returns success, but EC2 is eventually consistent: a describe call straight after may not show the tag yet, so the Executor polls before it verifies:
POST https://ec2.eu-west-1.amazonaws.com/ HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Authorization: AWS4-HMAC-SHA256 ...
Action=CreateTags
&ResourceId.1=vpc-0a1b2c3d4e5f67890
&Tag.1.Key=Description
&Tag.1.Value=uplink-to-core
&Version=2016-11-15- The Kubernetes API is declarative, controller-reconciled, and consistent across vendors. NetworkPolicy, Services, and CNI custom resources are the automation targets. There is no direct device access; the API server is the sole interface. A network isolation policy for the
app-paymentsservice:
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: app-payments-isolation
namespace: production
spec:
podSelector:
matchLabels:
app: app-payments
policyTypes:
- Ingress
ingress:
- from:
- namespaceSelector:
matchLabels:
name: app-payments- SONiC CONFIG_DB (Redis) is the native interface for SONiC-based platforms. The interface is the operating system’s own configuration store rather than a protocol on top of it, and the SONiC and Open Networking section explains how it works. The same interface description, as a CONFIG_DB fragment:
{
"PORT": {
"Ethernet0": {
"description": "uplink-to-core",
"admin_status": "up"
}
}
}Per-Device Interface Selection#
When a device exposes multiple interfaces, the NAP must choose one per operation type and maintain that choice consistently. A campus switch exposing CLI, NETCONF, and gNMI simultaneously requires a decision, not a mix-and-match approach that varies by workflow or engineer preference. Pick one protocol per operation type and keep to it. Two protocols for the same operation is what to avoid.
Figure 10.2 shows the resulting choice for each kind of operation.
Read the grid by operation instead of by protocol. Both gNMI and NETCONF can write configuration and read state, so the preferred column reflects operational strengths rather than protocol exclusivity: NETCONF’s transactions and rollback make it the usual choice for configuration, and gNMI’s streaming subscriptions make it the usual choice for telemetry. The fallback column fills gaps where a model is incomplete for a specific feature, and CLI is for gear with no structured interface at all.
The third row is the one teams forget. Even a current platform with complete NETCONF coverage still needs CLI or gNOI for actions that live outside the configuration model: clearing counters, installing an image, saving the running configuration, collecting a support bundle. gNOI is the structured answer where a device implements it, and the NAP should prefer it over screen-scraping the same command. What it should not do is pretend the category does not exist and leave every team to bolt on a CLI path under pressure.
The read path follows the same order. Chapter 7 applies it to collection: streaming telemetry first, flow export for who uses the capacity, Simple Network Management Protocol (SNMP) as the compatibility floor, and CLI scraping last.
Two device capabilities deserve a place on the evaluation checklist alongside the protocol itself, because they decide what the NAP can safely do and they vary by platform and release:
- Confirmed commit. The device applies the change and reverts it automatically if the NAP does not confirm within a timer. This is the device-side protection against a push that cuts the NAP’s own path to the device, and it is the difference between a bad change costing a retry and costing a site visit. Support is uneven, so it belongs in the SoT as a per-platform attribute, and a fleet that mixes supporting and non-supporting platforms needs the fallback Chapter 6 describes: a pre-change snapshot and an external rollback path. Chapter 16 shows it inside a closed loop.
- Configuration replace. Whether the device can accept a full declared configuration and remove what is no longer in it, rather than only merging additions. Merge-only interfaces can add a VLAN but cannot converge a device back to intent, because nothing deletes the lines intent no longer contains. Chapter 6 sets out the gradient this sits on, merge then replace then overwrite, ordered by blast radius, and the advice to pick the narrowest one that achieves the change. What belongs here is the prior question: which of the three the device supports at all, because a platform that only merges cannot be reconciled, and that decides whether drift remediation is possible on it.
From the perspective of the two architecture blocks that interact with the programmable interfaces:
The Executor needs idempotency or at least reliable error codes distinguishing “already exists” from “failed”, structured error responses, and state verification capability after apply. The
vlan-existsversusduplicate-vlanproblem from the opening story was a failure of the first condition: the error code semantics changed between firmware versions.The Collector needs structured reads, streaming telemetry subscriptions, and consistent data models so the Observability layer does not need per-device parsers. gNMI is the preferred subscription protocol where supported: it is structured, hierarchical, and schema-validated at the device, which eliminates the per-device text parsing that dominated SNMP-era collection.
However, the error code that opened this chapter was documented nowhere; the team found it by running the workflow against a device. That is the question the next functionality answers: where do you run the workflow first, when the only thing that behaves like a network device is a network device?
Simulation and Testing Environments#
The network is production infrastructure. Unlike an application backend, there is no staging server to test against by default. Building one is the job of this functionality. Without one, this quote applies:
Everyone has a test environment. Some are lucky enough to also have a separate production one.
Michael Stahnke
Testing network automation has always been harder than testing application code. A network is a distributed system with many components the automation team does not control: neighboring ASes at peering points, upstream transit providers, customer-managed CPE, wireless clients, and cloud infrastructure operated by third parties. A service provider testing a routing policy change cannot spin up a mock Border Gateway Protocol (BGP) peer from a transit provider to validate the full behavior. An enterprise testing a WAN failover workflow cannot control how the MPLS provider responds.
The simulation environments described in this section are the best available substitute: they reproduce what the team controls, accept the limitations of what they cannot, and focus validation on the logic layer where bugs actually live.
I have tested in production more often than I would tell an auditor. It usually worked, and that is the dangerous part: every success made the next shortcut feel safer. The lab exists so that “it worked last time” stops being your test plan.
Simulation serves a second audience, and it is the one that was using labs long before automation arrived. A lab is where a new design gets validated before any hardware is ordered. Does this EVPN control plane converge the way the design document claims? Does the route-reflector topology survive losing a reflector, and does the leaf-spine ECMP distribute the way the capacity model assumed? That work needs full-NOS behavior more than fast startup, which is why it lives in the VM-based environments and physical labs below, outside the commit-level pipeline.
The two uses share a toolchain and almost nothing else: design validation asks whether the network is right, and the pre-production gate asks whether the automation is right. This chapter spends most of its time on the second because it is the new one, but a team that already runs a design lab has most of what the gate needs.
The testing pyramid from Chapter 2 (unit, integration, end-to-end) applies directly here. Unit tests validate individual automation modules in isolation, typically with mock device responses. Integration tests validate multi-step interactions: the SoT API returns the expected data structure, the Executor’s adapter renders it correctly and handles the device response correctly. End-to-end tests validate the full workflow against something that behaves like a real network device. Simulation environments are the end-to-end layer.
Environment Types#
The right environment depends on what the test needs to validate. There is a spectrum, from high-fidelity environments worth investing in for production-confidence testing, down to low-cost environments that suit routine CI/CD pipelines. Table 10.1 runs it in that order, from the real hardware to the lightest emulation, and ends with an approach that emulates nothing at all.
| Environment type | Startup | Control plane | Forwarding | CI/CD fit |
|---|---|---|---|---|
| Physical hardware lab | N/A (always on) | Yes | Hardware | Manual |
| VM-based emulation | Minutes | Yes | Software | Limited |
| Container-based emulation | Seconds | Yes | Software | Native |
| Configuration analysis | Seconds | Modeled | Modeled, no packets | Native |
Physical hardware labs are a rack of actual switches and routers, often mirroring the production architecture patterns. Use them for hardware-specific behavior, performance testing, and the scenarios emulation cannot reproduce at all: optics, transceivers, ASIC-level forwarding behavior, and anything where the silicon is the thing under test. The cost is significant: capital investment, power and space, and the operational overhead of keeping the lab topology synchronized with production architecture. Labs that drift from production patterns provide false confidence. The value is real; the maintenance discipline is the challenge.
VM-based emulation runs full NOS images as virtual machines. Use it for protocol interoperability, design validation, and full-NOS behavior testing, where the question is how the network behaves. Forwarding is software, as it is in a container below, so a VM lab buys NOS completeness rather than hardware realism: the full feature set, the real control plane, the vendor’s own code paths. The trade-off is cost: more memory and CPU per node, minutes to start instead of seconds, and limited integration with automated pipelines. Not practical for routine commit-level testing.
Container-based emulation uses lightweight network OS images running as containers, connected by virtual links. Topology startup takes seconds. Use it for automation logic, interface contract validation, and workflow testing, which is most of what a pipeline needs to check. It is the practical starting point for most teams and the default for routine CI/CD: every change to the automation itself, a new workflow version or a changed template, runs the same workflow code against a containerized topology, catching logic errors before production. Packets do forward: veth pairs carry traffic, BGP sessions establish, and a trunk passes frames. What a container cannot reproduce is the hardware: ASIC forwarding behavior, line-rate throughput, Quality of Service (QoS) queueing, and anything involving optics. For validating automation logic, software forwarding is enough, and the investment pays back in the first incident it prevents.
Configuration analysis boots nothing. A tool such as Batfish parses the rendered configurations and builds a model of the network from them: which routes each device learns, which ACL a flow hits, whether two paths are really redundant. It answers in seconds, covers every device the SoT knows rather than the few that fit in a lab, and needs no vendor images. What it cannot see is runtime behavior, because nothing runs: an error code, a timing issue, or a firmware quirk like the opening story’s. So it complements emulation instead of replacing it. Analysis checks what the configuration means; emulation checks what the automation does.
Digital twins are live replicas of the production topology, fed by the Source of Truth (same device models, topology, and current intent, rendered by the same adapters as production) and current state from Observability. A digital twin mirrors what production actually looks like right now, not an approximation. The operational cost is significant: maintaining synchronization between the digital twin and production requires continuous reconciliation. It is a maturity-level investment, appropriate for teams that have already validated their NAP at scale and need the highest level of pre-production confidence.
Building that environment by hand, starting each image and wiring each virtual link, stops being practical past a handful of nodes. Lab orchestration tools do that part, and the Solutions Landscape section later in this chapter compares them. What matters first is where the lab sits in the deployment sequence.
Simulation as the Pre-Production Gate#
Chapter 8 introduced the Saga Pattern: every step in a workflow carries a compensating action that runs if a later step fails. That is what makes a failed production change recoverable. Simulation adds the step before the Saga begins. Run the workflow against a simulated topology first, and a logic error costs a simulation run instead of a rollback across 800 switches. When a change goes through the gate, only a passing run proceeds to the production target. Figure 10.3 shows the gate.
Four steps make it work:
- The SoT exports the topology definition for the target scope, including the OS version of every device in it.
- The simulation environment is instantiated with matching vendor images, OS versions pinned to the SoT intended state.
- The same workflow that will run in production runs against the simulation target first.
- Any step that fails in simulation triggers investigation before production execution proceeds.
Step 2 is the one teams skip, and the Known Limitations section below explains why it decides the result.
This gate only works where there is something to instantiate, which means the physical domain. You cannot start a wireless controller, an SD-WAN orchestrator, or a cloud VPC in a lab topology, and those domains are half of what the Programmable Interfaces section cataloged. They are not exempt from the gate; they need a different one.
For a controller, the equivalent is a sandbox tenant or a non-production controller instance, which most vendors offer and which is the only real test of a controller API. For cloud, it is a separate account or project plus the provider’s own dry run. terraform plan against the real API returns the exact resources a change would create, modify, and destroy. That catches the same class of error a lab run catches. Both cost less than a container lab and both are skipped more often, because neither looks like a lab.
A passing simulation run clears only the first gate in a sequence that continues in production, one wave at a time, and the gates between waves are workflow steps that Chapter 8 covers in its Validating Health at Each Wave Gate section.
Not every request needs a lab run, because the lab is the most expensive gate. Chapter 11 runs this gate as part of the NAP and decides which changes go through it: every change to the automation itself, and the requests whose workflow definition asks for it, such as high-risk ones. Topologies live in version control and sync with SoT exports, and the change workflow starts a lab when a change needs one, so the gate runs without anyone remembering to start it. The same lab serves later chapters too. Chapter 16 proves a closed loop in it before pointing the loop at production, and Chapter 18 makes a simulation run a mandatory what-if before an agent proposes a change.
Known Limitations#
The map is not the territory.
Alfred Korzybski
Simulation reduces risk. It does not remove it, and three limits are worth naming before a team starts reading a passing lab run as proof.
The firmware fidelity gap. A container image usually ships recent NOS code, and the quirks that break automation usually live in old code. Unless the image is pinned to the firmware version the SoT records for those devices, the lab reproduces the firmware you wish you had rather than the one in the rack. Pinning is what turned the opening story around: the Vendor C nodes in that containerlab topology ran the production version, which is why vlan-exists surfaced in the lab instead of in production. What simulation reliably catches is logic errors, interface contract violations, YANG model gaps, and topology-level failures. What it cannot catch is a device state nobody thought to reproduce.
The live-endpoint gap. A lab has no users on it. You cannot simulate four thousand connected endpoints, their DHCP renewals, their 802.1X supplicants, the MAC table churn of a working floor, or the badge reader and label printer that stop when a VLAN moves underneath them. This is the limitation that matters most for the chapter’s own example, because a campus VLAN change rarely fails on the switch; it fails on what was plugged into it. State the boundary precisely: simulation validates the configuration path, not the service impact on live endpoints. The wave gate’s service-state check is where that gap gets closed, and it closes it in production, on one wave at a time, which is the reason waves exist.
The snowflake problem. Simulation is as good as the network it represents. If you have a fleet of hundreds of individually customized configurations, each with its own history and exceptions, it cannot be represented by any topology small enough to run in a pipeline. The practical argument for standardized design patterns, golden templates, and SoT-driven configuration: a well-designed network is a simulatable network, and the value of the lab compounds with the discipline of the design. It also makes simulation a joint output of the network and automation teams. The engineer who knows which sites are truly identical and which carry undocumented exceptions is a network engineer, and without that knowledge the topology is a guess.
A lab proves the NAP works against the network you have today. It says nothing about the vendor that gets added next quarter, or the firmware release that changes an error code again. That is the last functionality’s problem.
Abstraction Strategies#
The NAP must not be rebuilt for each new infrastructure type. This section designs the automation layer to absorb change: today’s heterogeneity, and next year’s infrastructure types.
The same architecture applies to an enterprise, a service provider, or a hyperscaler. In every domain, the network interface sits between the NAP and everything behind it. It is the single boundary both the write path and the read path cross, which is also why one firmware change can take out configuration and telemetry at the same time. Figure 10.4 shows two domains; an overlay domain, reached through its controller’s API, would add one more of the same shape.
The Source of Truth models intent across every domain as one service model in the technical layer. The Executor’s adapters then render or translate that model into what each inventory item expects: CLI lines for one switch, a YANG payload for another, an API request body for a cloud VPC. The Orchestrator may branch the workflow by network domain. The Executor picks the adapter for each target from SoT data and delivers the change through it.
That split is the backbone of this section. Abstraction happens in two places, and each has one owner:
- The vendor-agnostic model belongs to the Intent block. The technical layer describes the network once, in neutral terms, and its schema is the contract every adapter consumes (Chapter 4). A new vendor means a new adapter, not a new model.
- Everything vendor-specific belongs to the Executor’s adapters. Rendering or translating the model into the platform’s syntax, speaking the protocol, managing the session, following the device’s operation model, and reading its error codes are all adapter work (Chapter 6). A new protocol or OS version means a new adapter version, not a new model.
The Collector mirrors the Executor on the read path. One collection adapter per protocol reads the device, and the Observability Processor normalizes the result into one schema (Chapter 7). Many collector tools embed the Processor, which is the same responsibility hosted in the same tool, not a change of owner. The opening story’s bug sat on the delivery half of the adapter: the VLAN syntax was right, and the adapter misread what the device said back.
Dimensions of Heterogeneity#
Before choosing a strategy, it helps to know which kind of heterogeneity it has to absorb, because they are not all the same problem. Table 10.2 lists the dimensions and how the NAP absorbs each.
| Dimension | What varies | NAP design response |
|---|---|---|
| Multi-vendor physical | CLI syntax, YANG models, and error codes | One adapter per platform: templates or a module for the syntax, and delivery over the device’s interface |
| Firmware generations (same vendor) | Syntax or behavior changes between OS versions | The Executor picks the adapter version that matches the OS version the device reports |
| Physical vs. cloud | Synchronous apply vs. async REST with eventual consistency | The cloud adapter translates the intent into API calls through a provider module, then runs create, poll, verify |
| Physical vs. overlay | A controller abstracts the underlay and becomes the target | The controller’s adapter renders controller policy. Executor and Collector talk to the controller, not the devices |
| Edge vs. core | Blast radius: an access switch reload drops only its own hosts; a spine is redundant, but every rack depends on it | Orchestrator sizes waves by blast radius: spines drained one at a time and never two in one wave, and core rollback must fit the maintenance window |
Every row but the last lands in the Executor’s adapters: what the device expects to receive is their rendering or translation half, and how it is reached or how it answers is their delivery half. The last row is the exception, because the Orchestrator only sees heterogeneity where it changes the shape of a rollout.
Three strategies keep the adapters small. They are not alternatives to choose between. They stack, in this order:
- Start with the Adapter Pattern, which Chapter 6 covers: one adapter per platform in the Executor, which renders or translates and then delivers, all accepting the same input. It works on the fleet you have today and needs nothing from your vendors. Its limit is the breadth of the catalog, not the number of devices: each new vendor, OS version, or interface means new or updated code.
- Adopt a common data model where you have tested that the vendor implements the paths you need. It shrinks the rendering each adapter does, without removing the adapters.
- Converge the operating system only where you still choose the platform, which in most organizations means new data center builds and nothing else.
The first one needs no more explanation here. The next two sections take the other two, and the last one covers what happens to all three during a firmware migration.
Community and Industry-Driven YANG Models#
The Adapter Pattern absorbs heterogeneity by writing code per vendor. A common data model attacks it one level up. If every vendor exposed the same schema for the same feature, most of that per-vendor code would not need to exist: the NAP writes intent once against a standard model and expects it to work on any compliant device.
Network engineering has run this experiment before, and the result is worth remembering before betting a NAP on it. SNMP Management Information Bases (MIBs) were the first attempt at a common network data model. MIB-II, IF-MIB, and BGP4-MIB gave every vendor a shared vocabulary for basic monitoring, and private enterprise MIBs covered everything else. Both halves of that outcome held: the standard MIBs worked for the common case, and nothing beyond the common case was reachable without vendor-specific work. YANG inherits the same split. What it improves is the model, hierarchical and richly typed where MIBs were a flat table of OIDs, and the transport, transactional over NETCONF or gNMI where SNMP was polled. What it does not change is the economics. Standards cover the common case; vendor extensions remain unavoidable for the full feature set.
Three families of YANG models coexist in production networks, and the distinction decides which one the NAP targets:
- IETF models are developed through the IETF standards process and published as RFCs or Internet-Drafts. They are the foundational standards:
ietf-interfaces,ietf-routing,ietf-bgp. Adoption is broad but slow, and the process is thorough but takes years. Vendor implementations often arrive two to four years after publication, and only on newer platforms. - OpenConfig models are developed by the OpenConfig consortium, an operator-driven group including Google, AT&T, and Deutsche Telekom. OpenConfig iterates faster than the IETF and is more operationally focused. It covers many of the same functional areas with different schema design choices. Most production gNMI deployments use OpenConfig paths.
- Vendor-native models are each vendor’s own extensions:
Cisco-IOS-XE-native,junos-conf-root,arista-intf-augments. These expose features the standard models do not cover, and they are often required for anything beyond the common-denominator functions. Nokia SR OS is a useful case to check your assumptions against: its native models (nokia-conf,nokia-state) are the complete interface, standard-model coverage is partial, and teams automating it in depth generally end up on the native models. Treat that as the pattern rather than the exception. For any platform, the question is not whether it supports OpenConfig but which of the paths you actually need it supports, and the only way to find out is to query the device.
The three families are the YANG equivalent of the MIB split, with one extra layer in the middle. IETF models are the standard MIBs, vendor-native models are the private enterprise MIBs, and OpenConfig is the layer SNMP never had: a standard written by the operators who have to run it rather than by a standards process alone. A heterogeneous network navigates all three at once.
A YANG module defining an interface looks like this (simplified from ietf-interfaces):
module ietf-interfaces {
container interfaces {
list interface {
key "name";
leaf name { type string; }
leaf description { type string; }
leaf enabled { type boolean; default true; }
}
}
}The same structure appears in OpenConfig (openconfig-interfaces) and in vendor-native models, but with different paths, different leaf names, and different default semantics. The YANG module defines the schema; the Executor’s adapter maps between the standard and the vendor reality, and carries the result to the device over the protocol (NETCONF or gNMI).
The practical reality of OpenConfig: vendor implementations vary in completeness. A device may claim OpenConfig support but only implement a subset of the model: reads work, writes do not; or the interface model works but the BGP model is absent.
Beyond missing paths, the more insidious problem is inconsistent data. A device returns a value for an OpenConfig path but in the wrong unit, with a different type, or with fields that should be null populated with vendor-specific defaults. A gNMI subscription that works in SAMPLE mode may fail silently in ON_CHANGE mode on the same device.
These are the everyday reality of operating a multi-vendor NAP that relies on OpenConfig in production (not rare edge cases). The standard works on paper; the vendor implementation requires the same per-device investigation the standard was supposed to eliminate. OpenConfig reduces that work significantly, but does not eliminate it. Plan for device-specific testing before relying on a new OpenConfig path in production automation.
YANG translation products such as Cisco NSO take this idea to its end: the team writes to one model, and the product’s drivers handle every vendor. Chapter 6 places NSO in the ownership split.
Abstraction buys uniformity at the cost of feature access. Every vendor has proprietary capabilities with no equivalent in standard models. A team using OpenConfig must choose: ignore the feature, add a vendor extension, or maintain a vendor-specific override path. There is no clean answer. Most automation work concentrates in functions well-covered by standard models (VLANs, BGP, interfaces), and proprietary features matter but are rarely the core use case. Gate feature usage on the OS version the device reports, checked against the one the SoT records; never assume uniform support.
SONiC and Open Networking#
The two strategies above absorb heterogeneity via the per-platform adapters that handle each vendor and the common models that reduce how much translating is left. Open networking attacks a different part of the problem. If the same network operating system runs on hardware from many vendors, the vendor axis collapses: one configuration interface, one data model, one adapter, whatever silicon is underneath. Converging the OS across platforms is the only strategy in this section that removes a dimension of heterogeneity rather than absorbing it. The constraint is that you can only apply it where you still get to choose the platform.
SONiC’s configuration interface is a Redis database with a YANG-structured schema: uniform, programmatic, and designed for automation from the start. The vendor-specific adapter work that consumes effort in multi-vendor physical environments does not apply here. The same automation logic works across all SONiC-based platforms regardless of the underlying hardware vendor.
A VLAN entry in the SONiC CONFIG_DB looks like:
{
"VLAN": {
"Vlan412": {
"vlanid": "412"
}
},
"VLAN_MEMBER": {
"Vlan412|Ethernet0": {
"tagging_mode": "untagged"
}
}
}This JSON is loaded into CONFIG_DB with config load, or written through the SONiC management REST API. There is no CLI to parse, no XML to construct. The NAP writes structured data; SONiC’s orchagent reconciles it to the hardware forwarding tables.
This is the design direction open networking advocates for: a network interface designed for automation rather than adapted to it. Teams introducing SONiC-based platforms alongside traditional gear will find the SONiC adapter to be the simplest to write and the most reliable to operate.
SONiC has moved well beyond its Microsoft Azure origins, and the vendor list is much longer. SONiC is now a Linux Foundation project, with Microsoft still its largest contributor, and other vendors (e.g., Arista, Dell, Cisco, and NVIDIA) run SONiC on some of their platforms. Alongside them, ODM vendors including Edgecore, Celestica, and UfiSpace ship branded SONiC platforms. A SONiC-based platform is now commercially available at most price and performance tiers, which is what makes the single-NOS strategy something other than a lock-in with extra steps.
The mature use case is the data center leaf-spine fabric. Hyperscalers have run SONiC at scale for about a decade, and enterprise data centers are now following, so EVPN/VXLAN overlay, BGP routing, ECMP load balancing, and 400G/800G interface support are all well-validated. The automation story is the strongest part: gNMI, YANG, and the Redis-backed CONFIG_DB are native interfaces, not retrofits, so a SONiC fleet can be managed with the same tooling that manages any other gNMI-enabled platform.
Outside the data center fabric, SONiC is still arriving. Disaggregated routing platforms, where SONiC runs on high-port-count routers, extend the open NOS model to routing use cases, and upstream SONiC now includes SRv6 support, the technology service providers use for traffic engineering and network slicing. Campus deployments remain rare, and the constraint is hardware rather than software: the ecosystem for campus form factors is thinner.
For teams building new fabrics today, the question is no longer whether SONiC is production-ready in the data center, because it is. The open question is whether a given vendor’s SONiC fork and release cadence will stay aligned with upstream across the fabric’s lifecycle, because a fork that drifts hands you back the per-vendor adapter you adopted SONiC to avoid.
Managing Coexistence During Firmware Migration#
The Adapter Pattern assumes a known, stable OS version per device. During a rolling firmware upgrade, that assumption breaks: devices in the same role, managed by the same NAP, run different OS versions simultaneously for days or weeks. The abstraction layer that worked yesterday on firmware 10.12 may not work on firmware 10.13 until a new adapter path is added.
The SoT records intended state for every attribute the NAP operates on, and OS version is one of them. The intended version is what the operations team approved; the running version is what the device reports. That part is not a special case.
It is the same intent-versus-reality pattern that applies to intended VLANs, intended BGP neighbors, and intended interface descriptions. What makes OS version different is the consequence of divergence. For most attributes, divergence is drift to reconcile. For OS version, it also selects the adapter path, because the same vendor’s firmware behaves differently between releases. So before the Executor applies configuration, it reads the running OS version from the device in a lightweight pre-execution check, because the device is authoritative for its own version, and it picks the adapter for that version. It never assumes the intended version is already deployed.
This distinction matters practically. The SoT says a Vendor C switch should run release 10.13. The device reports it is running 10.12.1006. Unless that switch is part of a planned upgrade, the NAP does not guess which version is right. It halts and asks.
What it does with the answer depends on the task. If the task is the firmware upgrade itself, or the SoT marks the device as mid-migration, a mismatch is expected: the Executor picks the adapter for the running version and carries on. Otherwise a mismatch is drift, and the Executor halts. It reports both versions, records them for the upgrade plan and the drift reports, and waits for a human to decide. Applying configuration to a device on an unexpected release is how a change meets behavior nobody tested, from different error codes to different defaults to an absent feature.
Once a device is upgraded and the running version matches intent, the adapter selection stabilizes. During a planned migration window, two adapter paths for the same vendor may be active simultaneously.
The Implementation Example below shows this class of problem end-to-end. Any NAP managing a multi-version fleet will meet it, and per-version adapter logic, driven by the version read from the device at execution time, is the systematic mitigation.
The Solutions Landscape covers only one of this chapter’s three functionalities. The network’s interfaces are given to you, and the tooling behind the abstraction strategies is covered in Chapters 4 and 6. Simulation is the part you install.
Solutions Landscape#
This landscape covers the lab orchestration tools that build the simulation environment. They take a topology description, start the network OS images, wire the virtual links between them, and tear the whole thing down when the test finishes. This approach makes a lab disposable, which makes it usable in a pipeline, as well as for training network engineers. Every block of the NAP can run against it.
The tools listed here are examples for explanatory purposes, not recommendations. Each makes a different bet about fidelity, speed, and automatability. Evaluate them against your team’s capabilities, existing tooling, and the environments you actually need to reproduce.
Three questions separate the lab tools from each other. Does it run container images or full virtual machines? Does it expose an API a pipeline can call, or a GUI an engineer drives? And does it describe the topology at the wiring level, which node connects to which port, or at the service level, which nodes run BGP?
Container-based, ready for a pipeline
- containerlab: runs network OS containers (Arista cEOS, FRR, SONiC, VyOS, and others) from a declarative topology file and wires them with virtual links. The de facto standard for container labs; a topology starts in seconds, which makes it the routine CI/CD gate.
- clabernetes: containerlab spread across a Kubernetes cluster instead of one machine, so simulation runs go in parallel rather than in a queue. For teams whose single lab host has become the bottleneck.
- netlab: describes what the topology should accomplish (“these three nodes run BGP”, “these nodes share a VLAN”) and generates both the containerlab file and the per-vendor initial configuration. For labs that mirror a production network model without hand-wiring every link.
- vrnetlab: wraps vendor VM images as containers, which is how an IOS-XR or Junos node joins a containerlab topology. For vendors that publish no container image.
VM-based, GUI-first
- EVE-NG and GNS3: full VM emulation with broad vendor coverage, full-NOS behavior including the data plane, and GUI topology design. For protocol and design testing, legacy platforms, and multi-vendor interoperability; the cost is resources, startup time, and limited pipeline integration.
Model-based, no emulation
- Batfish: open-source configuration analysis. It reads the rendered configurations and answers reachability, routing, and ACL questions without booting a device, which makes it a cheap check before the lab run rather than a substitute for it.
Commercial
- Cisco Modeling Labs: a managed, shared VM lab with a REST API, which is where EVE-NG and GNS3 stop at the GUI. For Cisco-centric environments that need IOS-XE, IOS-XR, and NX-OS VMs.
One question cuts across them: can a pipeline start the topology without a human in the loop? containerlab, clabernetes, netlab, and vrnetlab all can, which is why those are the ones that end up in CI/CD. EVE-NG and GNS3 are GUI-first and belong to the design workflow. Cisco Modeling Labs sits between the two. A team that wants the gate to run on its own, for every change to the automation and every request whose definition asks for it, needs at least one tool from the first group, whatever else it runs alongside.
The second question, wiring level or service level, is easier to see in code than to describe. A containerlab topology, here two switches from two vendors’ images and unrelated to the campus platforms, states which node connects to which port:
name: two-switch-lab
topology:
nodes:
s1:
kind: cisco_cat9kv # VM-backed: no vendor container
image: vrnetlab/cisco_cat9kv:17.9.4
s2:
kind: arista_ceos # native container image
image: ceos:4.31.2F
links:
- endpoints: ["s1:eth1", "s2:eth1"]A similar two-node scenario in netlab states what the topology is for, and netlab renders the wiring and the initial per-vendor configuration from that on top of a virtualization solution like containerlab:
nodes:
s1:
device: iosvl2
module: [ vlan ]
s2:
device: eos
module: [ vlan ]
links:
- s1:
s2:
vlans:
app-payments:
id: 412
links: [ s1-s2 ]As a rough starting point, containerlab alone covers most teams, because the images that matter are all reachable from it, vendor VMs included once vrnetlab wraps them. Add netlab when writing topology files by hand becomes the work rather than the setup. Add clabernetes when one host stops being enough.
Tools change faster than the problem they exist to work around, and the problem is easiest to see in one run, end-to-end.
Implementation Example#
We have followed the same campus network through all of Part 2, and every chapter assumed the device on the other end would behave the way its documentation says. Here, the assumption gets tested before production pays for it being wrong.
Scenario: The campus VLAN workflow is ready: eight weeks of development, three vendors modeled, idempotency tested against a three-node lab. The team wants to deploy to 800 switches across buildings A through F. Before any of that, the workflow runs against a simulated Building B: 24 switches, 8 of each vendor, with every image pinned to the OS version the SoT records for that device.
Requirements:
- Build the simulation topology from the Source of Truth, not by hand
- Pin every image to the OS version the SoT records for that device
- Run the same workflow code that will run in production, with no simulation-only branches
- Assert observed state after the run, not the workflow’s exit code
- Catch a vendor-specific interface failure before any production device is touched
- Expand to production in waves once simulation passes, not in one operation
Blocks involved:
- Source of Truth: holds the Building B inventory, the intended OS version per device, and the VLAN state the simulation has to start from
- Orchestration: runs the same workflow against the simulation target that it will later run against production, and compensates when a step fails
- Execution: applies the configuration through the per-vendor adapter, which is where the bug turns out to be
- Observability: supplies the post-change state each gate asserts against
- Presentation: carries the request in and the outcome back out, unaffected by any of this
- The Network:
- Programmable Interfaces: NETCONF for configuration on all 24 nodes, gNMI or SNMP for telemetry depending on the platform, and the per-vendor error semantics behind them
- Simulation and Testing Environments: netlab over containerlab, with the Vendor C nodes pinned to the production firmware line
- Abstraction Strategies: an adapter registry that branches by vendor and by OS version
Unlike most of Part 2, this example names tools. The point of it is that image fidelity decides the outcome, and that cannot be shown with generic boxes. Any equivalent tool from the Solutions Landscape section plays the same role. The device platforms stay generic, as they do across Part 2: Vendor A, Vendor B, and Vendor C. What matters is that there are three of them, and that one of them disagrees with its own documentation.
Implementation Flow#
The run takes six steps, and only the last one touches production. Figure 10.5 shows the path, including the failure that sent it back through a fix; the list below walks through each step.
Export the topology from the Source of Truth. The SoT holds the Building B inventory with an intended OS version per device. There are 8 Vendor A switches on release 8.4.2, 8 Vendor B on 5.2.1, and 8 Vendor C on 10.12.1006, an older firmware line that predates that vendor’s 10.13. The export produces a netlab topology definition carrying node types, vendor image tags mapped to those intended versions, and the VLAN state the simulation should start from: VLANs 409, 410, and 411 already configured on every switch, matching production. That last detail is what makes 412 the right ID to test with, because Chapter 4 allocates the next free one in the range reserved for the building.
Instantiate the simulation environment. netlab renders the export into a containerlab topology file. containerlab runs on a shared Linux host in the team’s CI/CD environment. Sizing it is the unglamorous part. Only one of the three platforms ships a native container image, at roughly 2 GB per node; the other two are vendor VMs wrapped by vrnetlab, at 4 to 6 GB each. Twenty-four nodes in that mix need about 110 GB at peak, so the lab runs on a 128 GB host. A container-only lab of 24 nodes would need 48 GB. The Vendor C nodes run an image pinned to 10.12.1006, matching the SoT, not whatever the vendor ships today. All 24 nodes are up and answering on their management interfaces within three minutes, most of which is the VM-backed nodes booting.
Run the production workflow against the simulation target. The Orchestrator triggers the Chapter 8 workflow with the simulation inventory as the target scope instead of the production inventory. Nothing else about the workflow changes, which is the condition that makes the result mean anything. The first three steps complete. The SoT records are checked for completeness, and the pre-check confirms VLAN 412 does not exist on any of the 24 nodes. The approval gate passes under the simulation target’s own policy, which names the pipeline as its approver in configuration, not in a branch of the workflow.
The fourth step, the deploy fan-out across all 24 simulated switches through the Executor, creates VLAN 412 on every node, and the run passes. The simulation gate then runs the same workflow a second time. That is the idempotency check from Chapter 6: re-run the job, and nothing should change. Eight Vendor A nodes report no change. Eight Vendor B nodes report no change. Eight Vendor C nodes fail, all with
vlan-exists. The idempotency check in the Vendor C adapter treatsduplicate-vlanas a no-op and has no handler forvlan-exists, so the Executor reports failure. A third of the scope failing is far beyond the change’s threshold, so the run halts and the gate fails. The opening story’s re-run, reproduced in a lab.No production device has been touched. The failure cost is container startup time and a thirty-minute investigation.
Diagnose and fix. Vendor C’s 10.12 release notes explain it.
vlan-existswas introduced in 10.11.1, replacingduplicate-vlanfor duplicate VLAN detection, and 10.13 reverted toduplicate-vlanfor consistency with the rest of that vendor’s range. The fix is to addvlan-existsto the idempotency error code list in the Vendor C adapter, keyed by OS version: 10.11 through 10.12.x returnsvlan-exists, 10.13 and later returnsduplicate-vlan. The adapter registry now branches on the running version.Before re-running, the team adds the expected post-change state to the simulation gate: after both runs, VLAN 412 exists on all 24 nodes, the second run changed nothing, and the Saga compensation never fired. It is the same kind of state check the wave gates run, and the gate closes only when the workflow completes and the check passes.
Re-run in simulation. The corrected adapter runs against the same containerlab topology. Both runs pass on all 24 nodes: the first creates VLAN 412, the second changes nothing, the Saga completes without compensation, and the SoT shows VLAN 412 present on every Building B node.
Expand to production in waves. A passed simulation gate authorizes the first wave, not the whole fleet. The Orchestrator runs the same workflow against Building B in production, 24 switches, and the wave gate asserts the four wave-gate checks against the Observability layer, not against the devices. It passes. Two more buildings follow, then the remainder: 800 switches across buildings A through F, zero failures on the Vendor C nodes. The application team’s ticket closes when the Orchestrator completes, and Observability confirms VLAN 412 on every expected interface inside the convergence window.
Solution Summary#
Do not skip the simulation gate when the team feels confident. It runs before the production Saga begins. On this run it stood between a firmware quirk buried in release notes and the time the opening story’s team spent auditing which switches had been configured.
What made the catch possible was fidelity, not cleverness. The OS version in simulation matched production because the SoT recorded what production runs, and the NAP ran the exact same workflow code against it. A topology built from the latest vendor images would have passed clean, and the bug would have surfaced at 02:00 on the production fleet. The investment is containerlab setup, version-pinned images, and a SoT export mechanism. The return is finding device-specific bugs while they are still cheap.
All seven building blocks appear in this run, as they have throughout Part 2. The Network is the one block the team did not build, and it is the one that decided how the first attempt went.
One VLAN, one firmware quirk, and all seven blocks doing their part. The summary steps back from the example to what this chapter, and Part 2 as a whole, leave you with.
Summary#
The network infrastructure is what makes this automation framework relevant. There are other automation frameworks available, but the NAF focuses on network operations, so this block shapes the rest.
The first consideration to keep in mind is that there are many different flavors of network infrastructure: different environments (e.g., campus networks, internet service providers, cloud data centers, cloud services) and different platforms and vendors, each one with its own characteristics. A capable network automation solution should be ready to accommodate them all, acknowledging their differences and the interfaces they provide, and promoting abstraction strategies that can simplify the complexity of the Executor.
Moreover, adopting simulation in this layer for pre-production environments increases the coverage of potential risk impact on the production infrastructure and builds trust in the outcome of the automation. This has always been challenging in networking because of the distributed nature of it, but there are some options to consider around it: virtual platform labs and configuration analysis.
That completes Part 2: the seven building blocks of the NAF Framework. None of them works in isolation. There are contracts between them (where the boundaries are set), and they offer you a clear plan to map them to the tools you prefer. Part 3 turns from designing the blocks to running them as a solid Network Automation Platform.
References#
- Network Programmability with YANG, Benoit Claise, Joe Clarke, and Jan Lindblad (Addison-Wesley, 2019). The reference on YANG models, NETCONF, and RESTCONF.
- Network Programmability and Automation, 2nd Edition, Matt Oswalt, Christian Adell, Scott S. Lowe, and Jason Edelman (O’Reilly, 2023). Practical NETCONF, gNMI, and YANG tooling.
- Infrastructure as Code, 2nd Edition, Kief Morris (O’Reilly, 2021). Repeatable, testable, version-controlled infrastructure.
💬 Found something to improve? Send feedback for this chapter