Finding a missing supporting link with RFC 8345 network topology
Use a local Node.js example to match directional service links to a carrier network and pinpoint a missing dependency.
Archive retrospective · Topic year 2018
In this article
Which direction of the service uses the link?
A shop sends payment requests from site A to site C. The inventory shows the forward leg across A to B and B to C. Return traffic has its own legs from C to B and B to A. If the service catalogue reduces all of that to a single green A–C line, a technician replacing a link can miss which direction depends on it. The help desk may then see a failing request and a healthy return path under the same service identifier without a way to separate the two facts. In March 2018 the IETF published RFC 8345, a common YANG model for networks and topologies. It makes it possible to store a logical service connection beside its explicit references to the lower-level links that carry it. The example uses that relationship to identify one affected service direction after a single inventory record disappears.
How the identifiers are scoped
The ietf-network module organizes networks and their nodes. The ietf-network-topology module adds links and the termination points located on nodes. A physical port or a logical interface can be a termination point. Node identity has meaning within a network. The example has a node named a in both fibre and service. An explicit supporting-node reference can connect their representations when that relationship is needed. The model treats a link as point-to-point and directional. To describe both directions, give each link its own identifier and supporting references. The supporting-network list declares a dependency on a lower-layer network. A supporting-link reference identifies a link within that network using network-ref and link-ref. Another network may use the same link identifier. Checking both names prevents the test from finding a match in the wrong place. The example verifies the presence of each named dependency. A path query would have to determine traversal separately.
Index links before checking references
Build one set of link identifiers per network. Then read the supporting-link list on each service link. A dependency is missing if the network is absent from the snapshot or its set lacks the requested link. Each result carries four fields: the owning network, the affected link, the referenced network, and the referenced link. This identifies a record that an operator can inspect. A comparison of total link counts could miss the same change if a different link appeared at the same time. The JSON example uses ietf-network:networks for the root member and network for its list, which belongs to the same module. The link list is named ietf-network-topology:link because it is defined by a different module. RFC 7951 explains when the module name has to qualify a JSON member. Preserving the names at those boundaries matters when a consumer reads augmented topology records from multiple modules.
import assert from 'node:assert/strict';
const LINK = 'ietf-network-topology:link';
const NETWORKS = 'ietf-network:networks';
function missingSupportingLinks(snapshot) {
const networks = snapshot[NETWORKS].network;
const linksByNetwork = new Map(networks.map(network => [
network['network-id'],
new Set((network[LINK] ?? []).map(link => link['link-id']))
]));
return networks.flatMap(network =>
(network[LINK] ?? []).flatMap(link =>
(link['supporting-link'] ?? [])
.filter(reference => !linksByNetwork
.get(reference['network-ref'])
?.has(reference['link-ref']))
.map(reference => ({
network: network['network-id'],
link: link['link-id'],
missingNetwork: reference['network-ref'],
missingLink: reference['link-ref']
}))
)
);
}
Remove one record and add it back
I ran the local .mjs example on Node.js 24.19.0. It starts with two networks and two directed service links. There are no missing references on the first pass. I then remove only b-c from fibre. The second pass reports one missing reference for service and checkout-outbound. The return direction, checkout-inbound, stays clear because c-b and b-a are still present. Putting b-c back returns an empty result again. Assertions check all three outcomes. The 2018 date belongs to the RFC. The executable is a current Node.js script operating on a constructed JSON snapshot. The test measures how a dependency scanner reacts to a missing directional record in that snapshot. Device behavior during a physical outage requires a separate observation. In particular a failure on a physical cable can affect both directions, which is a different case from removing one directional record from inventory.
const endpoints = (source, dest) => ({
source: { 'source-node': source },
destination: { 'dest-node': dest }
});
const physicalLink = (source, dest) => ({
'link-id': source + '-' + dest,
...endpoints(source, dest)
});
const node = id => ({ 'node-id': id });
const support = id => ({ 'network-ref': 'fibre', 'link-ref': id });
const before = {
[NETWORKS]: {
network: [
{
'network-id': 'fibre',
node: ['a', 'b', 'c'].map(node),
[LINK]: [
physicalLink('a', 'b'),
physicalLink('b', 'c'),
physicalLink('c', 'b'),
physicalLink('b', 'a')
]
},
{
'network-id': 'service',
'supporting-network': [{ 'network-ref': 'fibre' }],
node: ['a', 'c'].map(node),
[LINK]: [
{
'link-id': 'checkout-outbound',
...endpoints('a', 'c'),
'supporting-link': [support('a-b'), support('b-c')]
},
{
'link-id': 'checkout-inbound',
...endpoints('c', 'a'),
'supporting-link': [support('c-b'), support('b-a')]
}
]
}
]
}
};
const after = structuredClone(before);
const fibre = after[NETWORKS].network.find(network => network['network-id'] === 'fibre');
fibre[LINK] = fibre[LINK].filter(link => link['link-id'] !== 'b-c');
const baseline = missingSupportingLinks(before);
const afterRemoval = missingSupportingLinks(after);
fibre[LINK].push(physicalLink('b', 'c'));
const results = {
node: process.version,
baseline,
afterRemoval,
restored: missingSupportingLinks(after)
};
assert.deepEqual(results.baseline, []);
assert.deepEqual(results.afterRemoval, [{
network: 'service',
link: 'checkout-outbound',
missingNetwork: 'fibre',
missingLink: 'b-c'
}]);
assert.deepEqual(results.restored, []);
console.log(JSON.stringify(results, null, 2));
Read intended and operational views together
The desired configuration and the state observed by a device can diverge. RFC 8345 describes configured topology entries whose supporting references become dangling after a change. With the datastore architecture of RFC 8342, such an entry can remain in the intended datastore while it is omitted from the operational view. It can become operational again when the support returns or when the dependency is reconfigured to a resource that exists. A new configuration request can be checked against current support before it is applied. A comparison in a collector can take the requested service links from the intended view and the carrier links from a contemporaneous operational snapshot. Keep the network identifier with each directional link identifier through the comparison. A view containing only operational records may already have dropped the dependent overlay link. If collection windows or network scopes differ, inspect those differences before concluding that the underlying link disappeared.
Use the result in a maintenance record
Start with read-only collection. Retain the observation time, the source system, and the set of networks covered by the run. A repeated result for the same service direction and carrier link can update one maintenance record with its latest observation. After the network record reappears, check the service measurement for that direction and record both results. The distinction matters if the inventory recovers before application traffic does. The scanner checks references in the supplied data. Service capacity, latency and delivery need their own measurements. The example leaves schema conformance, endpoint checks, cycle detection and duplicate keys to separate validation. In an operations workflow, a comparison like this can tell the service team which directed dependency changed and which collector supplied that observation. The carrier team can then inspect one named link while the application team repeats its test for the affected direction.
Reader discussion
Which alternative architecture would you try for the same problem?
No comments yet. Be the first to contribute.
Write a comment