Network Intent#
A new request was received for a tenant service: a new VLAN on 60 switches across two buildings. The engineer filled in the ticket manually: VLAN ID 4192, gateway 10.2.30.283. Your sharp eye should have already caught the two typos: the VLAN ID was 4092 and the gateway was 10.2.30.238.
Both errors went into the system because the ticket form accepted free text. From the ticket, they moved into a spreadsheet, and a spreadsheet has no idea of what a VLAN ID is (or an IP address). The next engineer who checked it missed the issues because they looked like any other request, and a transposed digit looks right at a glance. The template rendered the configuration and let the issues through. It simply replaced the text without judging.
When the maintenance window started at 02:00, every switch refused the first line of the configuration (each one in its own words, depending on the vendor’s validation logic). Nothing was deployed, which turned out to be the best news of the night, because at least nothing was broken. However, the engineer spent almost one hour reading the different error messages before tracing them back to the form, where they fixed the two digits and re-ran it. Finally, the network was updated an hour and a half later.
Two things would have prevented the issue that night, and both are covered in this chapter. The data should be structured and validated: a VLAN ID is an integer between 1 and 4094, an IP address is an IP address, and there are standards that document them. If the data breaks the rules (the contract), it cannot be saved. And the second: simplify the intake data to the minimum, and encode the data expansion logic within the Intent.
Every automation system starts with one question: What am I actually going to do? Whether you deploy a firewall rule, add an Internet Protocol (IP) address, or configure a VLAN, you should do that according to some intent. The system that holds the intent is the Source of Truth: the reliable representation of what your network should look like.
Intent is the data; the Source of Truth is the system that stores and serves it. This chapter covers the data: what the intent holds, and how to validate that it is correct. Chapter 5 covers the system that stores it, serves it, and decides how multiple data sources can play together consistently.
Without a reliable Source of Truth, network operations become a mess of tribal knowledge. Engineers disagree on what is deployed. Spreadsheets contradict what is actually running. The result is an automation system that does not know what to do. Besides being consistent, the Source of Truth should also answer other questions around the data: “Why was this the original intent? Who approved it? When did it change?”
This chapter looks at the data itself: what belongs in your intent, how to model the level of abstraction, and how to ensure that the data is clean before the rest of the automation can rely on it. If you get this part wrong, nothing built on top of it can be right, however good the machinery around it is.
The first stop is to define what network intent and the Source of Truth are for, and where their boundaries fall.
Fundamentals#
Everything else in the automation system reads from the Source of Truth (SoT), so it has to deliver five things:
Capture everything you need with different abstractions. Represent and store the full intent definition of your network, at the level of detail you need. It starts at the service layer (“add a new branch” or “set up an MPLS service”), and ends with agnostic technical data (IP addresses, circuits, device specs, credential references, maintenance windows). Per-device configuration is not intent: the Executor produces it from this data. The data may be very diverse. Moreover, it should support the data lifecycle, and include not just what is running today, but what you have planned and what you are retiring. In short, the SoT should provide enough data to let you rebuild your network from scratch.
Maintain data integrity, allow flexible representation. Validate everything: check that data types are right, relationships make sense, VLANs are in valid ranges, IP addresses do not duplicate. Track who changed what and when. Let people approve major changes before they stick. If something goes wrong, you can roll back. Your automation needs to trust that the data is accurate, because bad data leads to bad network state and outages.
Support people working in parallel without stepping on each other. Multiple teams should be able to propose changes at the same time. Changes get grouped into atomic bundles: either they all go in or they all fail, no halfway states. You can test changes in a staging area before they go live. For big migrations, you can branch off, do your work, and merge back. You always know which intent is being used now versus what is being proposed.
Allow people and machines to access the data easily and securely. Your system needs Application Programming Interfaces (APIs), such as Representational State Transfer (REST) or GraphQL, so automation can get and modify data. People also need to browse and edit it, through the web UIs and Command Line Interface (CLI) tools of the Presentation layer, which many SoT products embed. Everyone needs solid access controls so they only see what they should. You can have a hundred automation workflows running at the same time, dozens of staff editing data, and external systems syncing in, and it all should stay consistent and responsive.
Embrace data consolidation from other systems. You may already have asset management for hardware, IP systems for addresses, or circuit providers for connectivity. Do not re-create that data by hand. Instead, reference it where it lives or sync a copy in. Make clear rules about which system owns which data. Keep it in sync, in the direction the owning system dictates. This means you get a unified view of everything without reinventing the wheel.
Before diving into implementation details, it is important to understand what the Source of Truth is responsible for, and what it is not, so its boundaries stay clear.
What is in scope
The Source of Truth manages all intent data: the complete definition of what your network should look like. This includes production configurations, staging environments, development branches, and test scenarios. Everything that describes “what you want” lives here.
What is out of scope
The Source of Truth does not do several things that might seem related:
Observability data: The Source of Truth does not store metrics, logs, or runtime state. However, it does define the expectations you will compare against, like threshold values for alerts or baseline performance numbers. The actual observability data lives elsewhere (covered in Chapter 7).
Network interaction: The Source of Truth does not talk to devices or push configurations. It provides the technical-layer data the Executor needs, but it does not turn that data into device syntax or apply it. Both are the Executor’s job (Chapter 6).
Orchestration logic: The Source of Truth does not define the sequence of steps or workflows for deploying changes. It defines the intended final state. How you get there (which devices first, what validation steps, rollback procedures) belongs to the Orchestrator (Chapter 8).
The Source of Truth is the authoritative answer to “what should the network look like?” Everything else in your automation system (execution, monitoring, orchestration) references this truth to do its job. When reality drifts from intent, the Source of Truth tells you what reality should become.
There is a second, less obvious payoff. Automation is rarely about building something once; networks move continuously from one state to the next. Moving from state A to state B is easier when state A is written down. If both the current intent and the new intent are known, automation can compare them, work out what actually has to change, and touch only that. Without a defined starting point, every change begins with rediscovering what is already out there.
Those five goals split across two chapters. This one covers the data; Chapter 5 covers the machinery around it, and the goals and boundaries above hold for both.
So start with the data. Everything else is built on top of it.
Data in Scope#
Data sounds generic, and it is. The intent behind a Source of Truth exists at different levels of abstraction, each with its own purpose. No level is better than another: which ones you need depends on your use cases. Over years of building complete network automation solutions, I have found that two layers cover them, from the most abstract to the most concrete, as Figure 4.1 shows:
- Service layer: covers the high-level abstractions that improve usability, hiding lower-level details that may not be relevant for some personas. For example: “set up an MPLS L3VPN for branch X”.
- Technical layer: covers the low-level abstractions, the infrastructure data your network requires, in agnostic terms (not vendor-specific). For example: “BGP AS 65001, route targets 65001:100, interface admin status, etc.”.
Intent ends at the technical layer. The per-device configuration that reaches a device, such as “interface xe-0/0/0; unit 100;…”, is the Executor’s output, rendered or translated from technical-layer data, as the Where Intent Ends section explains.
A good intent data strategy connects these layers. You can start at the service layer, then generate technical data automatically. But you do not always need both layers: it depends on what you are building.
There is a second way to slice the same question: not by level of abstraction, but by who is asking. Different people and systems meet the same intent at different altitudes.
- A network engineer requests routine changes through the service layer like anyone else, and works in the technical layer (interfaces, IP addresses, routing attributes, VLANs) for the exceptions. They review the configuration the Executor renders before it reaches a device, but they should not be editing per-device configuration by hand.
- A service owner only wants to say what service is needed, where, and with what characteristics. That is the service layer.
- An automation workflow or Artificial Intelligence (AI) agent needs a structured, predictable view it can act on.
Thinking in personas tells you what data is needed, by whom, and at what level of detail. It also stops you from exposing the full 500-field device object to someone who needs five fields of it. The goal is not a separate copy of intent per audience, which is how you end up with five sources of truth; it is one intent with the right view over it for each consumer. The Data Consumption section covers how to build those views.
You do not always need the service layer, but you always need the technical one. Abstract data alone is hard for the other blocks to integrate with, and device-specific syntax belongs to the Executor. The technical layer is the contract between them, so start there.
Technical Layer#
The technical layer is the model of what the network is actually made of: devices, interfaces, VLANs, prefixes, circuits, and much more. The model decides what you can represent and how easily you can use it. As George Box noted: “All models are wrong, but some are useful”. There is no perfect model that works for everyone, but you still need one. In my experience, data modeling is more art than science, but certain patterns show up consistently across successful projects.
The first pattern is the set of data families that show up in most networks, which we work through next.
Data Families#
Comprehensive Source of Truth implementations typically model different data families, but the Inventory is the cornerstone. It defines the objects under management that every other family hangs off, and it takes two forms depending on what you are managing:
- Physical and virtual devices, with whatever identifies each one: name, type, model, platform, and other attributes.
- Cloud services that act as a management unit in their own right, a virtual network for example, with the type of the service and the cloud provider, plus other information.
You may be used to thinking of inventory as devices only. I include here the anchoring cloud services you use to build cloud infrastructure, as another kind of inventory that the other data families reference in the same way.
The families around it fall into two groups. The first describes where the inventory sits and who it belongs to:
- Location: where inventory items are, composed hierarchically: continents, countries, regions, cities, buildings, floors, rooms, whatever matches your actual hierarchy.
- Assets: hardware that has no meaning on its own, only as part of an inventory device, and that nests several levels deep: an expansion module holding cards holding optics. Serial numbers, procurement dates, and warranty terms belong here, on the thing that is serialized.
- Ownership: the tenants, users, or accounts a piece of inventory belongs to. This is usually connected to the authentication mechanism.
- Data Center Infrastructure: racks and rack units, power feeds, PDUs and circuits, cooling zones, and the physical cabling and patch panels between them. Relevant when you are building data centers, and safely skipped when you are not.
And the second group describes what the inventory is configured to do:
- Resource Pools: the ranges you allocate from (e.g., IP prefixes, VLAN IDs, ASNs, DHCP scopes) and the allocations drawn out of them.
- Connectivity: physical circuits (MPLS, Ethernet), virtual tunnels, bandwidth allocations, Quality of Service (QoS) policies.
- Routing: Border Gateway Protocol (BGP) communities, autonomous systems, routing policies, prefix lists, route targets for L3VPN services.
- Services: logical service definitions (L3VPN, L2VPN, firewall traversal), service-to-device mappings, Service Level Agreements (SLAs).
- Virtualization and Cloud: what runs inside a cloud inventory item: subnets, other services.
- Security and Compliance: access control lists, firewall rules, cloud security, security zones, compliance tags, audit requirements.
- Management: Simple Network Management Protocol (SNMP) details, gRPC Network Management Interface (gNMI) subscriptions, Network Time Protocol (NTP) sources, syslog targets, TACACS+/RADIUS integration.
These families are interdependent, and Figure 4.2 shows how. Everything references the inventory, and this makes it the cornerstone: a prefix is assigned to an interface on a device, a service runs across devices, a rack holds them. A well-designed SoT models those relationships explicitly, and the Data Structure has to make that possible.
As you can see, beyond network-specific data, many other data families are needed: users, locations, or secrets. Not all the data falls into the network domain, but the network intent should connect it consistently even when it does not own everything in one data store.
Sometimes the value stored is only a reference to the real one. For example, secret credentials should never be stored in a backend that is not designed for them, and never persisted anywhere else. There are two general use cases:
- The credential the Executor or Collector needs to open a session with a device stays a reference end-to-end: the SoT holds something like
vault://campus/switch-admin, and the Executor resolves it against the vault itself. - A secret that has to appear inside the configuration, such as a BGP MD5 key, an SNMP community, or a RADIUS shared secret, has to reach the device as a real string. The Executor resolves the reference when it renders the configuration, injects the value into the artifact, and writes none of it back to the Source of Truth.
People often ask what a network-specific data source like NetBox buys them over a general-purpose one like ServiceNow. In my experience, both can achieve similar outcomes, but a generic system is company-wide, which makes it harder and slower to evolve to represent the network data you need. That slows the network team down before it can use the system for a complete network representation.
Having covered the kinds of data a network needs, the next section gives the general rules for modeling them.
How to Model the Data#
The families above say what there is to model. These rules decide how, and they hold whichever family you are working in.
Scope the data to your use case, not to everything that exists. The temptation with a fresh SoT is to model the entire network in full fidelity. Resist it. What belongs in scope is whatever your operations consume, and that differs sharply by use case:
- A data center build-out needs physical detail: locations, racks, device positions, cable breakouts.
- An edge or backbone network needs every transit and peering session, with enough attributes to form the adjacency.
- Configuration management needs the inventory that lets you open a session at all: management address, platform type, credentials.
- Network monitoring needs to tell a node-facing port from an uplink, and the utilization threshold that applies to each.
Modeling data nobody reads is not free. It costs schema complexity, validation rules, and someone’s attention to keep it accurate; and stale data is worse than absent data, because people trust it once before they stop trusting anything.
Reuse one model when objects share most of their attributes. When two kinds of object differ in one or two attributes, the tempting shortcut is a model for each. Resist it, for the same reason you resist a model per vendor: every relationship to those objects gets built twice, queried twice, and validated twice. Give the shared model an attribute that carries the difference instead.
Addresses are the classic case. Nearly every network now carries both address families, and a v4 model next to a parallel v6 model is the obvious trap. An interface, a prefix, and a BGP neighbor each need to relate to an address, whatever its family. Model a single address object with a family attribute, and let a dual-stack service hold one prefix of each family. The schema examples later in this chapter accept either family for this reason.
Keep the technical layer vendor-agnostic. This rule decides whether the layer survives your next hardware refresh. An interface is an interface whichever vendor built the box; model it once, in neutral terms. The moment the technical layer encodes platform syntax, you need a parallel model per vendor. The same intent then exists in three places, with three chances to disagree. And onboarding a fourth vendor means modeling the network again from scratch. Do not lock yourself in; let the vendor specifics be handled by the Executor’s adapters, converting the agnostic model into each platform’s format.
Agnostic is the default, but some features exist on only one platform. There is nothing to abstract there, and forcing a common model over them adds complexity for no gain. Model them as platform-specific attributes, clearly marked, and keep them the exception (Chapter 10 covers the options).
How granular should your model be? Model an object individually when something reads it individually. A port that carries a cable, a known endpoint, or its own policy needs its own record, because cabling checks, neighbor validation, and endpoint tracking all start from it. A run of identical access ports that nothing reads one by one does not: say “interfaces 1-40 use this standard template” and track only the exceptions. That is 2 objects to keep accurate instead of 40, and the Executor still renders every port. The cost of an over-granular model is not database size, because a relational store holds millions of rows comfortably. It is the attention needed to keep every record true.
Use transversal classification attributes. All the previous data models have their own particular attributes, but a few classification patterns appear consistently across all network data. Well-designed models include these foundational attributes to keep data manipulation consistent:
- Role: What purpose does this object serve? (core, distribution, access; primary, secondary)
- Status: Is it active, planned, decommissioning, or retired?
- Kind: What type of object is it? (VLAN, device, circuit, service)
Where Intent Ends#
The technical layer is the last layer of intent. Devices do not understand it: each one expects its own syntax, whether CLI lines, a Yet Another Next Generation (YANG) payload, or a REST API model. Turning the vendor-agnostic record into that syntax is not intent, and the Intent block does not do it. The Executor does, through one adapter per platform, either by rendering your own templates or by translating through a vendor’s module (Chapter 6).
That boundary makes the technical-layer schema a contract. The Intent block publishes it and versions it; each Executor adapter declares which versions it accepts and tests itself against them. Vendor syntax never flows up into the technical layer, and templates never flow up into the intent data. Chapter 6 explains why, and when a Source of Truth product’s own rendering feature is still fine to use.
Service Layer#
When you have 50 devices and 30 VLANs, you can manage them individually: create each VLAN, configure each interface, allocate each IP by hand. It is tedious but manageable.
When you have 5,000 devices and hundreds of services, manual management is impossible. Adding a new branch office would mean manually specifying 100+ config items per location. The service layer solves this: operators describe what they want in service terms (“add a branch”), and the system expands that into the complete technical specs.
Reducing the input is the obvious win, but something that may not be so obvious is that a service layer enforces your guardrails for free. When the technical data is generated from rules you wrote once, there is no field left for someone to fill in wrongly. A prefix is taken from the right pool because the expansion logic takes it from the right pool, not because the user chose it right or someone noticed. Compare that to asking an operator for 100 values and validating all 100 afterwards: the service layer prevents the error instead of catching it later via validation.
There are other terms to refer to the service layer concept. One that the industry uses frequently is design-driven automation.
Here is how this works, with an example that translates from the service to the technical layer. The following JavaScript Object Notation (JSON) snippet represents the basic data required to set up a new branch office.
{
"type": "branch_office",
"location": "Dallas, TX",
"size": "small"
}The service layer provides transformer logic that takes this data and expands it into the technical layer, in two phases: render and build. These can be broken down into five steps. The first three (render) claim nothing and can be re-run freely; the last two (build) reserve real resources and write them down.
- Validate the request. The requested type and size are supported, and the location exists.
- Load the associated transformers. For example, the “branch_office” type defines three different services (data, voice, and guest) and requires external circuits. The “small” size, associated with the “branch_office” type, defines how many devices and their type, the size of the IPv4 prefix, and how many VLANs for services.
- Resolve the input data into technical layer data. List all the objects that have to be created to define the intended network state, including dynamic resources that have not been allocated yet. The new location (creating a code from the location name), the devices with the corresponding device type, the future IP prefixes and addresses, etc.
- Allocate dynamic resources. Reserve unique resources that nobody else has reserved yet. Using the requirements (a /22 prefix and 3 VLANs), allocate the available VLANs, the parent /22 prefix, a child /24 prefix per VLAN, and the IPs for each default gateway interface.
- Confirm and persist the objects. Once the plan covering the whole technical layer is complete, commit it and create all the objects (likely hundreds of them, from only three inputs).
Do not confuse this render with the Executor’s rendering of device configuration (Chapter 6): this one produces technical-layer objects instead of configuration artifacts.
That separation into two stages, shown in Figure 4.3, is what lets the team review and approve the data before anything is committed:
- Render covers steps 1 to 3. It produces the candidate plan of technical-layer objects needed to implement the design pattern for the given input data, but it claims no dynamic resources and persists nothing. The VLAN ID and prefix in that plan are proposals, not reservations. It serves as a dry run, showing how the data will be created before you create it.
- Build covers steps 4 and 5. Using the plan from the render, it requests the actual resources and persists the technical-layer objects. This is when the data becomes ready to use, and the first moment anything is taken out of a pool.
Putting the boundary there is what creates the next problem. Because render reserves nothing, two renders of the same request can legitimately return different answers, which complicates the idempotency of the render stage. For example, you prepare a site rollout on Monday and the render allocates VLAN 100, because that is the one available at the time. But if you do not hit “commit”, you may re-run it a few minutes later and get VLAN 101, because someone else has already taken VLAN 100 from the resource pool. That is not idempotent.
That non-idempotency is real, and there are two ways to live with it:
Keep render pure and pin the plan. Two renders can differ, and that is accepted. What gets reviewed is one specific rendered plan, identified by a hash of its inputs and outputs, which is why many design systems store plans content-addressably. Build applies that plan without rendering it again: if a resource in it has been taken meanwhile, build fails loudly and you render again. Render stays cheap and stateless, and the guarantee moves to “build what was reviewed, or stop”.
Let render hold a soft reservation. Render claims the resources it proposes, with an expiry. Re-running the same request returns the same VLAN because the hold is still live, and an abandoned plan releases its resources when the hold lapses. This buys idempotency at the cost of render no longer being free: holds consume inventory, and the expiry is a parameter you tune against how long approvals take.
The first keeps the boundary clean and is the better default. The second pays off when the gap between render and build is long enough that losing resources mid-approval is common.
The service layer is, in the end, a library of your network design patterns: the reusable blocks that expand the data. Conceptually, it could look like Table 4.1:
| Pattern | Components |
|---|---|
| Small Branch Office | • Single edge router, MPLS VPN with a backup BGP peer • 2-3 VLANs (data, voice, guest), QoS for voice • Firewall allows only ERP and VoIP |
| Medium Regional Hub | • Redundant edge routers (active-standby), several MPLS VPNs • 10-15 VLANs (by department, guest, OOB), 6-class QoS • Application-layer firewall policies |
| Data Center Pod | • Two spines, every leaf on both, eBGP unnumbered underlay • EVPN/VXLAN overlay, one VRF and VNI per tenant • ASNs, loopbacks, and VNIs allocated automatically |
Obviously, this high-level pattern definition is not usable as it is. It needs to be codified, and this can take many forms, but it always involves some coding. And because it is code, it needs the same testing discipline as code: a change to one design changes every site built from it, so you want to know what it produces before you ship it. Chapter 11 covers the testing strategy. Each pattern encodes proven architectural decisions. Deviating requires explicit approval, but deploying them should be seen as a normal operation because the transformation is deterministic. The same request and the same design always produce the same plan, as long as the free resources in the pools have not moved, which is why build applies the pinned plan.
The branch example adds a site to a network that already exists. A greenfield data center fabric is where the service layer does the most work, because there is nothing to reconcile yet: every value in the fabric comes from the design. The whole input for one pod is four fields: the site, the pod name, the number of leaf switches, and a profile. The same five steps expand it.
Validation checks that the site has the rack space and power for 16 leaf switches. The “standard” profile loads the shape from the Data Center Pod row of Table 4.1: two spines, every leaf connected to both, and an unnumbered underlay. Render lists the objects: 18 switches with their roles, 32 point-to-point links that need no addresses in this profile, a loopback for each switch, an ASN for each leaf and one shared by the spines. Build allocates them from the site’s pools. Four fields become several hundred objects, and the cabling plan the data center team racks against comes from the same record. When the switches power on, Zero Touch Provisioning (Chapter 6) gives each one its configuration, rendered from those objects, with nobody typing a value.
Tenants follow the same pattern one level up. A request for a new tenant takes a name and a profile, and expands into a VRF, a VNI, and the leaves that carry it.
So who writes them? The network architects. This sounds obvious, yet teams routinely get it wrong. Because a design is code, ownership drifts toward whoever is most comfortable writing code, which is usually the network automation team. That is the wrong home. A design pattern encodes architectural decisions: how a branch is built, which redundancy model applies, where the security boundary sits. The people accountable for those decisions have to be the people who write them down. The network automation team owns the machinery that executes designs; the architects own what the designs say.
Here the network architecture becomes an artifact that sets a design pattern, instead of a document that lives in a wiki and that everyone understands slightly differently. The architect defines the rules the network is built from (with data), and every deviation from them becomes visible. I hope you notice the shift in the job and its impact. Part 4 covers what it asks of the organization.
We all love standardization, but we also have to recognize that it is almost impossible to handle all your network variations with a few design patterns. Having one design for each location is not an option. So how do you handle that?
There are three ways to solve it:
- Add new dimensions to the design pattern. When you realize that there is a factor that changes frequently from use case to use case, codify it. In our example, if the small branch office defaults to Vendor A’s firewall but could use Vendor B or Vendor C instead, add a new input field that picks the vendor. The design pattern then uses it to create the devices.
- Use deviation patterns. These work together with the standard ones and complement them, keeping deviations under control. If a special small office needs a different topology with an extra backup, select a deviation design on top of “small” that adds it. The same deviation works with the other designs too.
- Allow technical layer customization. The last resort: if the exception is a true one-off, it may not deserve the effort of standardizing a pattern. In these cases, you can always reach the lower-level technical data and adjust it as needed.
Last but not least, design patterns need to evolve. New patterns emerge, tools improve, and the branch office you standardized on in 2022 (single router, two VLANs) is not the one you would standardize on now (dual router, four VLANs, tighter security). The problem is that the sites built from the old design are still running it.
The answer is design-as-code with versioning: keep every version of a design, and record on each site which version built it. That one record buys everything else. You can migrate site by site instead of all at once, roll back a version that turns out to be wrong, and test the next one in staging while production stays on the current one. Sites on the old design keep running it, carrying whatever debt that implies, until their turn comes.
I hope that you understand the benefits of the design-driven approach. It is the way to handle data once automation reaches a scale where per-object management is a nightmare. However, I have to warn you that you may meet opposition from teams used to building each site by hand, and the objection is not purely cultural: some of those exceptions are real. Acknowledge that up front. Not everything can be abstracted, and a service layer that insists otherwise gets bypassed within a quarter.
Remember the 80/20 rule here. Aim at the lowest-effort, highest-reward slice of your network and abstract that well. For the rest, offer two escape hatches: codified sub-designs for the exceptions that recur, and plain direct access to the technical layer for the true one-offs. Both keep the work inside the SoT. A design that forbids exceptions does not eliminate them; it just moves them into somebody’s console session, where nothing records that they happened.
That completes the two layers: what the intent says, at each level of detail. What they do not say is how the data is kept correct, stored, reached, and joined with what other systems already hold: the functionalities’ job.
Functionalities#
The two layers describe the data as if it could simply exist. It cannot. Each one has assumed machinery that has not been introduced yet. The render and build boundary of the service layer needs somewhere to persist a plan and a history. The technical layer’s references between devices, prefixes, and VLANs only hold if something enforces them. And the external sources named at the start of this chapter only count as part of the Source of Truth if something joins them to the rest.
Four functionalities supply that machinery, and each one answers a different question: how the data is shaped, how it survives change, how it is reached, and where it comes from. Figure 4.4 maps them to the five goals.
Data Structure: Defines the schema and the constraints that keep bad data out. Validation, uniqueness checks, referential integrity. Clear error messages.
Data Persistence: Stores the intent, answers questions about it, and keeps the complete history. Who changed what, when, and why. Roll back when needed.
Data Consumption: How people and systems get and use the data. The block exposes APIs; people reach it through the web UIs and CLIs of the Presentation layer, which many SoT products embed. Everyone gets access control suited to their role.
Data Federation: Pulls data in from the systems that already own it (Circuits DB, IPAM, etc.) and keeps it synced.
These four are not independent features; they stack. Data Structure decides what counts as valid. Data Persistence keeps the valid data, and its history, safe across concurrent writers. Data Consumption exposes it to everyone who needs it. Data Federation stops the SoT from becoming one more silo by deferring to the systems that are already authoritative.
The first of the four belongs here, with the data, because it decides what the data is allowed to be. The remaining three are the subject of Chapter 5.
Data Structure#
Bad programmers worry about the code. Good programmers worry about data structures and their relationships.
Linus Torvalds
Torvalds was talking about code. In network automation, the data structure is part of the program. The data is so important that it makes the automation good or bad. Defining wrong intent can lead to broken networks or security breaches. The data structure, the constraints that the schema enforces, is your guardian: it stops wrong data from getting in and explains clearly why.
A schema does more than describe the shape of the data. It defines what valid means: which values are allowed, which fields are required, how objects relate to each other, and which constraints have to hold. That turns the schema into a contract: data that conforms to the schema can be trusted to satisfy the rules the schema expresses. Correctness is established once, at the boundary where data is written, instead of being rediscovered by every consumer downstream.
That distinction matters more than it sounds. Without the contract, every workflow that reads a device object has to defend itself: check that the management address is really an address, that the role is one it recognizes, that the site reference still resolves. Ten consumers means ten implementations of the same checks, drifting apart, each failing differently on the same bad record. With the contract, consumers do their job and trust their input. So encode as much of what you know about valid data into the schema as you reasonably can.
Four properties separate a schema you can live with from one you will fight:
Extensible. Existing models cover most of what you need but never all of it, and the model that fits today stops fitting when your next use case arrives. You need room to add fields and objects, plus a credible path to evolve and migrate existing data without losing it or breaking consumers. Extensibility, Polymorphism, and Migrations goes into how.
Reusable. Model each thing once and reference it from everywhere it appears. An IP address belongs to an interface, which belongs to a device. That same address also turns up as a BGP neighbor address, a tunnel endpoint, and a service address. Nesting a fresh copy of the address structure inside each of those leaves you four definitions to keep consistent and no way to answer “where is 192.0.2.1 used?” Define the address once as its own object and relate to it instead. How easy this is depends largely on your persistence choice: relational and graph stores make references natural, while document stores push you toward nesting and leave you maintaining the cross-references by hand (Querying Connected Data covers the trade-off).
Validatable. A schema that cannot reject anything is documentation. Constraints come in two flavors, and you need both:
- Structural validation asks whether the data matches the schema: correct types, required fields present, formats well-formed. Is
mgmt_ipan address, or the string"TBD"? - Semantic validation asks whether the data makes sense: prefixes that do not overlap, references that resolve, fields that are immutable once set, a VLAN ID inside the range this site actually uses.
Structural checks are cheap and local, because they can be decided from the record alone. Semantic checks are the ones that catch outages, and they cost more, because deciding them means consulting the rest of the data.
- Structural validation asks whether the data matches the schema: correct types, required fields present, formats well-formed. Is
Flexible. Every network has a standard and a set of controlled deviations. If the schema admits only the standard, the deviations do not disappear; they move somewhere you cannot see them. Say 70% of your sites fit one service-layer design and the remaining 30% carry small differences that recur: those exceptions should be expressible as patches on top of the standard, so the standard still applies everywhere it can. The same need shows up in the technical layer, where every interface type shares most attributes and each technology adds a few of its own. That is polymorphism, and it is covered below.
Schema Languages#
How you define your data matters. A schema language is what lets you state what valid means in a form a machine can check: the types, the required fields, the relationships, and the constraints. Several exist, no single one wins, and the right choice depends mostly on where your data already lives and who has to read it. Table 4.2 compares the common ones.
| Language | Best for | Strengths | Trade-offs |
|---|---|---|---|
| SQL (DDL) | Data that already lives in a relational database | Mature, universally understood, and enforced by the database itself rather than by a separate step | Changing it means a migration, which makes fast-evolving models painful |
| JSON Schema | Validating documents and API payloads | Readable, excellent tooling, and composable: schemas can reference other schemas | format: ipv4 and friends exist but are annotations by default, so the validator has to be told to assert them |
| YANG | Device-facing models | Purpose-built for networks, and works directly with NETCONF, RESTCONF, and gNMI | Steep learning curve, heavy toolchain, and vendor models that disagree with each other |
| GraphQL (Schema Definition Language, SDL) | Exposing one typed model to many different consumers | Strongly typed, doubles as the documentation, and lets each client fetch exactly the fields it needs | Requires a GraphQL layer in front of whatever stores the data |
| CUE | Keeping schema, validation, and generation in one place | Validates and generates from the same definitions, with invariants enforced rather than documented | Small ecosystem, and unfamiliar to most network teams |
Two notes before moving on. First, the serialization format (YAML, JSON, XML, Protocol Buffers) is a separate decision from the schema language, and the two get conflated constantly. YAML is pleasant to read and validates nothing by itself. Second, most SoT products do not hand you a raw schema language at all; they expose their own modeling layer and generate the rest, which is usually a feature, as long as you can still answer what the model allows and how you change it.
Picking a language settles what you can express. Enforcement is what you do with it: turning those constraints into checks that run on every write, so the contract above actually holds.
Schema and Constraint Enforcement#
The validation types in Table 4.3 span both flavors introduced earlier. Schema and range validation are structural: they can be decided by looking at the record alone. Uniqueness, referential integrity, and business rules are semantic: deciding them means consulting the rest of the data.
| Validation Type | Example Rules | Example Error |
|---|---|---|
| Schema Validation Enforce data types and formats | VLAN id: integer 1-4094 VLAN name: string, max 32 chars VLAN sites: array of site references VLAN status: enum(active, planned, deprecated) | { "id": 5000, "name": "CUSTOMER-VLAN" }→ Error: VLAN ID 5000 exceeds maximum 4094 |
| Uniqueness Constraints Prevent duplicate entries | VLAN 100: unique per site IP 192.0.2.1: unique across IPAM Hostname “pe-01”: unique per region | Attempt to create second “pe-01” in same region → Error: Hostname already exists |
| Referential Integrity Ensure relationships remain valid | Circuit references: site_a, site_b (must exist in Sites), vendor (must exist in Vendors) | Delete site_a referenced by circuit → Options: Reject deletion, Cascade delete, or Orphan with “site unknown” |
| Range Validation Enforce numeric and pattern constraints | BGP AS: 1-4294967294, excluding 23456 (AS_TRANS) IPv4: format: ipv4, not a hand-rolled ^(\d{1,3}\.){3}\d{1,3}$, which accepts 999.999.999.999Interface speed: {1G, 10G, 25G, 40G, 100G} | Interface speed “5G” → Error: Invalid speed, must be one of {1G, 10G, 25G, 40G, 100G} |
| Business Rule Validation Enforce organizational policies | If VLAN status=‘active’ → must have ≥1 site If device type=‘firewall’ → must have security_zone If service type=‘L3VPN’ → route_distinguisher must be unique per VRF | Active VLAN with no sites → Error: Active VLANs must be assigned to at least one site |
For example, using JSON Schema, you can validate your JSON (or YAML) data. This is a JSON Schema that defines a few attributes for a device:
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": ["hostname", "mgmt_ip", "interfaces"],
"additionalProperties": false,
"properties": {
"hostname": {
"type": "string",
"pattern": "^[a-z0-9-]+$"
},
"mgmt_ip": {
"type": "string",
"anyOf": [
{ "format": "ipv4" },
{ "format": "ipv6" }
]
},
"interfaces": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": ["name", "enabled", "vlan"],
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"pattern": "^Ethernet[0-9]+$"
},
"enabled": {
"type": "boolean"
},
"vlan": {
"type": "integer",
"minimum": 1,
"maximum": 4094
}
}
}
}
}
}Those two constraints are the opening story’s missing rules, in the form a machine can enforce: vlan is an integer bounded at 4094, and mgmt_ip has to be an address in either family rather than any string shaped like one.
And Listing 4.3 is a concrete device record that conforms to the schema in Listing 4.2:
{
"hostname": "sw-core-01",
"mgmt_ip": "192.0.2.10",
"interfaces": [
{
"name": "Ethernet1",
"enabled": true,
"vlan": 100
},
{
"name": "Ethernet2",
"enabled": false,
"vlan": 200
}
]
}My advice: reject bad data. Period. I have seen too many “soft validation” systems turn into garbage dumps because “just this once” becomes standard operating procedure. If it is important enough to validate, it is important enough to enforce.
But, as usual, there are exceptions. The following situations may justify relaxing the validation posture:
Policy guidelines (not rules): “You’re using a /22 subnet when we usually use /24” is a warning, not an error. Warn the user, log it, but let them proceed if they confirm the override.
Expensive cross-object checks: If validation takes more than a few seconds, accept the change and validate asynchronously. But still enforce the result: flag the violation, notify the user, and require fixes.
Brownfield network discovery: When you are importing existing configurations, you will find violations everywhere. Flag them, but do not block import. The whole point is to discover what is actually there, even if it violates your ideal model.
Everything else? Reject it. Your automation depends on trustworthy data. Bad data means outages.
However, validation is not free. A hierarchy of validation costs affects design decisions. Practical systems choose a performance target and validate only to that level for synchronous write paths. Three approaches follow from that budget:
- Synchronous validation checks before accepting the write. Types, patterns, and lookups in a local index fit under 10 ms; uniqueness and referential integrity fit under 100 ms. The user gets immediate feedback and the data stays consistent, but every check adds latency to the API response, which slows high-throughput automation. Use it for critical integrity checks and interactive workflows.
- Asynchronous validation accepts the write first and validates later, seconds to hours afterwards, in background consistency checks. The API stays fast, but the data can be inconsistent for a while, and error reporting gets awkward: “the write succeeded, but failed validation five minutes later”. Use it for bulk operations and high-volume automation.
- Hybrid validation runs the cheap checks inline, under 100 ms, and defers the expensive cross-object rules and business logic, with an API endpoint that reports validation status. It costs a more complex implementation and status tracking, and it is what most production systems run.
Also within the validation context, machine learning can catch what static rules cannot (unusual values). Three patterns are common:
- Anomaly detection compares a change against historical ones and questions the outlier: branch VLANs have always landed in 1000-1999, so a request for 2500 gets a confirmation step rather than a rejection.
- Auto-correction proposes the likely intent behind an invalid value, offering /24 for a typed /33 because every other subnet at that site is a /24.
- Embedding comparison flags a device whose configuration diverges from its peers in the same role, catching the NTP server somebody forgot.
All three are suggestions, not gates, so surface only high-confidence findings, or you manufacture alert fatigue. Always show the pattern that triggered the flag, because an operator who cannot see the reasoning will not trust the tool twice. And let people mark false positives, which is both polite and a way to improve the model. Confidence scores matter here for the same reason: they tell the reader how much weight to give a recommendation that nobody is obliged to follow.
After the validation sections, next is how to make the schema extensible.
Extensibility, Polymorphism, and Migrations#
Source of Truth products sit on a spectrum. At one end are opinionated built-in models out of the box, as in NetBox or Nautobot: fast to deploy, decisions already made, and painful when your network does not fit the mold. At the other are fully custom models, as in Infrahub, where you define the schema: a perfect fit with no wasted fields, bought with design time, trial and error, and nobody else’s work to copy. That cost is why even the products built for custom models ship opinionated ones to start from.
Start opinionated. I do not care how special you think your network is. The teams who set out to build their own perfect model are still modeling two years later. The ones who adopted an existing model shipped something valid months ago. You are probably not building a hyperscale cloud. Use what exists, extend it when you hit a real limit rather than an imagined one, and ship.
Which makes extensibility the decision that matters. If tracking a new “cost center” field means rebuilding the schema, walk away; if it is a custom attribute you add in twenty minutes, you have the right tool. Aim for 80% standardization with 20% room for your own reality, and treat “infinitely flexible” as a warning: it usually means infinite configuration before anything works.
Many data models are similar, but not exactly the same. That leaves you two obvious options, both bad: overload one model with fields that only apply to a subset of its objects, or create several specific models that are then hard to connect. The way out is polymorphism: one model, many flavors.
All interfaces are not created equal. A physical optical port and a tunnel interface share some properties, but they are different beasts. You could create completely separate models for each, but that gets messy fast and limits usability.
Better approach: define a shared base model that covers what they have in common, then create specialized variants for the details that differ.
# All interfaces share these basics
interfaces:
- name: "eth0"
type: "physical"
enabled: true
mtu: 1500
ipv4_address: "192.0.2.1/24"
# But a physical optical port has extra stuff
- name: "eth49"
type: "physical_optical"
enabled: true
mtu: 1500
ipv4_address: "192.0.2.5/30"
optics_module: "100GBASE-LR4"
wavelength_nm: 1310
fec: "rs-fec"
# And a tunnel looks totally different under the covers
- name: "tun-vpn-dallas"
type: "tunnel_gre"
enabled: true
mtu: 1476
ipv4_address: "10.0.0.1/30"
tunnel_source: "203.0.113.1"
tunnel_destination: "198.51.100.5"
tunnel_encap: "GRE"
tunnel_key: 100This way, your scripts can query “all interfaces on this device” without knowing whether they are talking to optics or tunnels, because the shared fields are common to both. But when you need optical-specific details (the expected optic type and FEC mode), you can reach into those specialized fields. Add a new interface type down the road? No problem: just add another variant.
Last, extensibility also applies to the lifecycle of the models themselves. Models change, so plan for it.
Networks live for decades. Your model will not stay static. You will add new fields, change how things relate to each other, deprecate stuff that does not work anymore. But you cannot just flip a switch and break everything running on your old schema.
When your model changes, a lot downstream can break. Validators need new rules, APIs change what they return, database queries assume certain columns exist, templates need different field paths, and reports are written against the old structure. All of that needs to adapt, or at least not catastrophically break. Here is how to handle changes without blowing things up:
Mark things as deprecated before you remove them. If a field is going away, tell everyone 2-3 releases ahead of time. Give them a grace period to migrate.
Support field aliases during the transition. Old code asking for
device_name? Route it tohostnameunder the hood. Your API still works, and people have time to update their automation.Create migration helpers. When you restructure data (like moving interfaces from a flat list to nested under devices), provide scripts that do the legwork.
Test with everything that depends on your data. Before rolling out schema changes:
- Does the API still return data the old way? (via aliases)
- Do the Executor’s adapters still render? Each adapter declares the schema versions it accepts, and its contract tests answer this before you ship (Chapter 6).
- Do the SQL queries still work?
- Do integrations with external systems still parse what they get?
Expect mixed versions in production for a while. Big organizations often have devices on three different schema versions simultaneously:
150 devices on schema 1.9 (old) 300 devices on schema 2.0 (current) 50 devices on schema 2.1 (beta testing)Your system needs to handle all three without breaking. That complexity is worth it: networks matter too much to break with careless schema changes.
Data structure is fundamental to managing data, but sooner or later that data has to become durable, and then Chapter 5 picks up. Before it, one question decides what your data looks like on day one: where it comes from when the network already exists.
Brownfield Onboarding#
When you deploy a Source of Truth in an existing network, you face a tricky problem: how do you populate it with current state without just embedding all your legacy cruft as permanent truth?
The wrong approach: Poll your devices and assume “whatever is running = what should be”. You will load all workarounds, hacks, and technical debt straight into the Source of Truth.
The right approach: Use the current network state as a starting point, not as the truth. Snapshot it, load it in, then redesign it until it describes what you actually want. From that point on, the Source of Truth leads and the network follows.
It takes four steps:
Bootstrap: Take a snapshot of your current network (devices, IPs, VLANs, circuits) and load it into the Source of Truth as starting data. You may use the state from a Configuration Management Database (CMDB) if it is accurately populated (something I have yet to see with my own eyes).
Redesign: Over weeks and months, have people review that data and decide what the intended state should be. You will probably want to consolidate redundant VLANs, clean up legacy stuff, standardize naming, and write the design templates for future deployments.
Flip the direction: Once you have the design you want, stop syncing from the network back to the Source of Truth. Now the Source of Truth is the boss. Execution (Chapter 6) pushes changes outward to the network.
Detect drift: Observability (Chapter 7) watches for devices that drift from what the Source of Truth says they should be. When drift happens, operators decide: fix the device or fix the Source of Truth?
You do not need to write this from scratch. Most SoT products ship discovery and onboarding tools, and standalone ones exist. Use one instead of writing the parser yourself.
This approach requires initial effort but avoids the trap of treating deployed state as permanent truth. Your SoT evolves toward clean design intent, even if the network takes time to fully align. You can also keep running discovery in dry-run mode, to double-check that the network has not drifted.
Be clear about what the snapshot buys you, though. It gets you a starting point. It does nothing to keep the data true six months later, when somebody reassigns an address during an incident and tells nobody. Keeping intent and reality aligned after go-live is reconciliation, and Chapter 5 covers it.
With the data modeled, validated, and loaded, it is worth seeing both layers at work on one real network, up to the handoff to the Executor.
Implementation Example#
We return to the campus network from Chapter 3: roughly 800 access and distribution switches from three different vendors, spread across six buildings, A through F. It carries a steady stream of service requests for new VLANs, subnet assignments, routing policy updates, and access control changes.
Today, the only complete record of this network is the network. The switches carry what is actually deployed, spread across 800 devices with no consolidated view, and the rest lives in spreadsheets and in people’s heads.
The problem. When the application team asks for a new VLAN, an engineer looks for a free subnet, works out which switches sit in the target building, and opens a handful of Secure Shell (SSH) sessions to see which VLANs are already there. Nothing records what the intended state of each switch should be, so configuration drift accumulates unnoticed, and adding a design for a new vendor means editing documentation in several places and hoping they stay consistent.
Requirements:
- Let the requester describe the service, not the implementation: no VLAN IDs, no prefixes, no switch lists
- Derive every technical value from that description, so there is no field in which an operator can mistype one
- Validate structure once, at the write boundary, rather than in every consumer downstream
- Keep the technical layer vendor-agnostic, so a new platform means a new Executor adapter and not a new model
- Record what is intended separately from what is deployed, and be able to compare them
The approach. Add a Source of Truth and seed it with a one-time import, following the Brownfield Onboarding steps: the buildings, the switches with their roles and platforms, and the VLANs and prefixes already in use. From then on, the SoT holds the network model: VLAN definitions, the design patterns for the access and distribution layers, and the service-request model that turns a service request into the technical objects the Executor needs. Start with one system on purpose. Some of this data already has an owner elsewhere in a real campus, such as the addresses in an IPAM, and joining those owners into one view is federation. Chapter 5 adds it to this same campus.
This example names no products on purpose. Several products could play each role here, and naming them would date the chapter faster than it would help you. What transfers is the shape of the solution: which data sits at which layer, and what the layers look like once there is a real network behind them. Chapter 5 returns to this same campus for the rest of the architecture.
Let us follow one real request that the Source of Truth has to implement, and look at the actual data at each step. The request is ordinary: the application team wants a new VLAN called app-payments in Building B.
One Request Through the Layers#
The service layer: what the operator types
Everything the operator provides is this:
vlan_service:
name: app-payments
building: B
profile: standardThree fields. Not a VLAN ID, not a prefix, not a list of switches. Those are all derivable, and anything derivable is something an operator can get wrong.
What makes them derivable is a set of expansion rules (transformations) you write once:
profiles:
- name: standard
mask_length: 24
qos_class: af21
mtu: 9216
applies_to_roles: [access, distribution]
- name: high-security
mask_length: 26
qos_class: af31
mtu: 9216
applies_to_roles: [access]
requires_acl: truePlus the rules that consume them. The service name must match ^[a-z][a-z0-9-]{2,15}$. The VLAN ID is the next free one in the range reserved for that building. The prefix is carved from the building supernet at the profile’s mask length. And the service applies to every switch in the building whose role appears in applies_to_roles.
Notice what this buys you beyond brevity. There is no field in which an operator can type a /26 for a standard service, because the mask comes from the profile. This is the guardrail-for-free property from the Service Layer section, made concrete.
The technical layer: what the expansion produces
Listing 4.7 shows what the rules expand the three input fields into.
vlans:
- name: app-payments
vlan_id: 412
building: B
prefix: 10.12.4.0/24
qos_class: af21
mtu: 9216
gateway:
address: 10.12.4.1
mask: 24
switches:
- { name: sw-b-acc-01, role: access, platform: vendor-a }
- { name: sw-b-acc-02, role: access, platform: vendor-a }
- { name: sw-b-dst-01, role: distribution, platform: vendor-b }This is vendor-agnostic on purpose. platform records which vendor a switch is, but nothing about how that vendor expresses a VLAN leaks into this layer, following the rule from the Technical Layer section: the same expanded record has to survive a vendor swap. The listing shows three of Building B’s switches, on two of the campus’s three platforms. A Vendor C switch joins the same record with a different platform value, and nothing else changes.
The campus, in these listings, is IPv4-only to keep them short. A dual-stack campus is mostly the same. The prefix and the gateway become lists (one entry per address family), and the profile gains a second mask length. The allocation comes from the building supernet, and the rules, schema, and templates loop over IPv4 and IPv6. This is the outcome of treating address family as an attribute of a prefix rather than a separate model: an IPv6 rollout is not a schema migration but a simple data change.
The handoff: what the Executor receives
Intent stops at Listing 4.7. Nothing in this chapter turns it into actual device configuration artifacts. This is the role of the Executor, which takes the agnostic data from the technical layer and adapts it per platform (it renders or translates it). Chapter 6 develops it further, with examples for both cases: a template in the Vendor B adapter renders the distribution switch’s configuration from it, and the Vendor C adapter translates it through a module. This decoupling keeps every block bounded, and onboarding a new vendor or platform only requires a proper adapter instead of a new data model.
This closes the write data path, from the three fields an operator typed to the record every adapter works from. One question is left: how much of that record the schema can actually protect.
What the Schema Catches, and What It Does Not#
The VLAN service object gets a schema, and it references the reusable pieces instead of copying them:
{
"$id": "https://example.net/schemas/vlan-service.json",
"title": "VlanService",
"type": "object",
"required": ["name", "vlan_id", "building", "prefix", "gateway"],
"additionalProperties": false,
"properties": {
"name": { "type": "string", "pattern": "^[a-z][a-z0-9-]{2,15}$" },
"vlan_id": { "type": "integer", "minimum": 1, "maximum": 4094 },
"building": { "type": "string" },
"qos_class": { "type": "string", "enum": ["af21", "af31", "ef"] },
"mtu": { "type": "integer", "minimum": 1280, "maximum": 9216 },
"prefix": { "$ref": "prefix.json" },
"gateway": { "$ref": "ip-address.json" },
"switches": { "type": "array", "items": { "$ref": "device-ref.json" } }
}
}ip-address.json is defined once and referenced from here, from BGP neighbors, from tunnel endpoints, and from device management addresses, which is the reusability property: one definition of what an address is, and a single place to ask where a given address is used. device-ref.json does the same job for the switch references.
Note what the schema does not mention. additionalProperties: false means anything not listed here is rejected, so _version and _metadata, the fields the store attaches to every record, have to sit outside the validated document. Chapter 5 shows them on the stored object. The store writes them, and whoever authored the intent cannot. Keeping them out of the schema is what stops a client from forging them.
The more instructive part is what this schema cannot express. It will reject vlan_id: 5000 and the name App_Payments, but it will not catch any of these:
- whether VLAN 412 is already in use in Building B
- whether
10.12.4.0/24sits outside Building B’s supernet - a gateway of
10.12.5.1, which is a valid address but not inside this service’s prefix
Those are the semantic checks from Data Structure, and each one needs to consult other records to decide. Structural validation lives in the schema; semantic validation lives in the SoT’s own rules, and it is the second group that prevents outages.
Notice which half of that distinction the opening story sat in. A VLAN ID of 4192 and an address of 10.2.30.283 are the first kind. The schema rejects both the moment somebody tries to save; three switch parsers only had to do that job because neither field had a type. The three cases above are the second kind. They are no harder to express, but the SoT has to consult the rest of the data before it can tell you no, and it is a design decision rather than a line of schema.
Getting Started#
Reading about intent data is easy. The first week of modeling it is where people stall, usually because the design decisions arrive all at once. The data decisions reduce to three steps.
Pick the objects you need. Work backwards from your device configurations: every value that varies across devices has to come from somewhere, and that somewhere is an object in your model. Device, site, prefix, VLAN, circuit, policy is a reasonable starting set for most networks. Anything that does not vary is still data: keep it in the intent as one global value, not hardcoded in the Executor’s templates, which should only hold the logic that converts data into vendor syntax.
Model them, but do not start from a blank page. Good network models already exist; adopt one and adapt it. For each object settle three things: what it contains (fields, types, what is required), how it relates to the others (references, ownership), and what makes a value invalid. You will revise all three, which is why the schema has to be extensible from day one.
Choose how high-level the entry point should be. You can defer the service layer, but settle early whether you are heading there, because it shapes the technical model underneath it. Teams that bolt abstraction on afterwards usually find their technical layer encoded assumptions that the abstraction now has to fight.
If you start in a brownfield network, as nearly everyone does, snapshot the current state first. Brownfield Onboarding covers why the snapshot is a starting point, not the truth.
Those three get you modeling. Three more follow, and all of them belong to the system around the data: how it is reached, who owns each value, and making something real depend on it. Chapter 5 has them, and closes this campus example with the architecture all of it adds up to.
Summary#
Your automation will be as good as your data is. This chapter presents what Intent is, the two layers of abstraction it may offer (the higher-level service layer and the lower-level technical layer), and explains when to use each. The service layer offers a simpler data model for external integrations, and the technical layer gives the inner blocks the detail they need.
One way or another, a key principle is that the Intent data should be agnostic to your network platforms, with platform-specific data as the marked exception. You have to avoid lock-in and retain the definition of what your network looks like, leaving each platform’s details to the Executor block. This provides a cleaner separation of concerns that simplifies evolution.
Whatever the data model for each layer, the data must be trustworthy, and this requires Data Structure, which defines the schema as a contract that keeps the data clean.
Chapter 5 continues with the functionalities of the Source of Truth, focusing on how to persist changes, how to consume the data, and how to integrate multiple data sources consistently.
References#
- Network Programmability and Automation, 2nd Edition, Matt Oswalt, Christian Adell, Scott S. Lowe, and Jason Edelman (O’Reilly, 2023). How Source of Truth data drives configuration.
- Network Programmability with YANG, Benoit Claise, Joe Clarke, and Jan Lindblad (Addison-Wesley, 2019). The reference on IETF and OpenConfig YANG models.
💬 Found something to improve? Send feedback for this chapter