Skip to content

Network Zones

Network zones need Workflow Engine 0.46.0, neops-core 2.4.0 and Worker SDK 0.5, or later.

A network zone is a network that only its own workers reach; zones may reuse each other’s addresses. 10.0.0.1 in zone-a and 10.0.0.1 in zone-b are different devices. Every job runs in exactly one zone, and only a worker that serves that zone takes it.

Zones are created in the CMS (neops-core): on the web client’s Network zones page, in Django admin, or with networkZoneUpsert. default is reserved: it is the zone of every device that has no zone stored, and no CMS zone can take the name. Workflows name it like any other zone.

Declaring a zone

networkZone is a key on every step kind (function blocks, embedded workflows, workflow references) and on the root workflow. Nested steps inherit it.

networkZone: zone-b                              # a zone in the CMS
networkZone: default                             # the zone of devices with no zone
networkZone: "{{ parameters.zone || 'default' }}" # an expression over parameters
networkZone: { name: zone-b, override: true }    # beat the zone of the device the job runs on
networkZone: { name: "{{ parameters.zone }}", override: true }

A string is short for { name: <string> }, and name takes the same names and expressions. override is a literal true or false, never an expression, and defaults to false.

Where a job runs

  1. Take the nearest networkZone: the step’s own, else its enclosing workflow’s, and so on up to the root. Its override flag comes with it: an outer override: true does not reach a step that declares its own zone.
  2. If that declaration has override: true, the job runs in the declared zone.
  3. Otherwise a job on one device runs in the device’s zone; a job on one interface runs in the zone of the interface’s device. When the run does not hold that device, the zone is the one the lock read for it, else, for a device the interface’s write names by hostname or ip, the zone written beside them. Any other device, one named by an id the run does not hold or by hostname or ip with no zone, has an unknown zone: the CMS finds it by its id, or across every zone. The run then fails with unknown_network_zone, naming the device, rather than guess default.
  4. Any other job (a runOn: global job, a group job, and every step’s ACQUIRE job) runs in the declared zone, else in default.
Declarations Runs on Job zone Why
none r1 in zone-a zone-a device
none sw9, no zone stored default device
workflow: zone-b r1 in zone-a zone-a the device beats a zone without override; the step’s ACQUIRE job, with no device, runs in zone-b
step: { name: zone-b, override: true } r1 in zone-a zone-b override
workflow: { name: zone-a, override: true }, step: zone-b sw9 in default default the nearest declaration (zone-b) has no override, so the device wins
step: "{{ parameters.zone }}", run with zone: zone-b global zone-b step
none global default default
none a group default default; a group job names its members by id only

A declared zone places jobs; it does not select devices. A selector by IP or hostname matches every zone’s device with that address unless it also filters on network_zone.name. Because every function-block step gets an ACQUIRE job when the run starts, a device step that inherits zone-b needs a zone-b worker with its function block even when all its devices are elsewhere.

Retries and rollback jobs run in the zone of the job they belong to.

Override reaches whatever answers there

With override: true a worker in the declared zone connects to the device’s address in its own network, with the device’s credentials, and writes what it finds onto the device’s record. Where addresses overlap, that may be a different device. Check the device’s identity before moving it, as in the onboarding example below.

Zone expressions

A zone expression, as a string or as the object form’s name, reads only parameters. Every step’s ACQUIRE job takes its zone when the run starts, before any step has run, so a zone cannot read a step’s result, its meta, or the context.

  • A workflow’s own networkZone is evaluated where its other keys are: in the parent’s scope for an embedded workflow, in the run’s parameters for the root.
  • Inside an embedded workflow, parameters are what the parent passes. A parameter the parent fills from a step result or the context is only known after a step runs, so a zone that reads it fails the run. A rawParameters value is known from the start.
  • Inside the root workflow, parameters are its own parameters and rawParameters with the run’s parameters laid over them.
  • An embedded workflow’s parameters get no defaults; a default in the root workflow’s parameterSchema does fill a missing run parameter.

An expression must resolve to a zone

When a run starts, the engine resolves every networkZone in the tree, including one that a nearer declaration shadows and one on a step whose condition may skip it. The run fails with invalid_parameters, before anything is locked, when a declaration:

  • does not resolve to a zone name: null, a missing parameter, an empty or a blank string, or a value that is not a string, such as a number;
  • reads a value only known after a step runs.

The failure names the step or workflow and its expression, as in The networkZone of 'discover' ({{ parameters.zone }}) does not resolve to a zone name. Put the fallback into the expression; JMESPath’s || covers a missing, null or empty value, but not a blank one:

networkZone: "{{ parameters.zone || 'default' }}"

The fallback replaces the parent’s zone, so a sub-workflow that should follow its parent takes the zone as a parameter.

What publishing checks

  • A networkZone expression that reads anything but parameters, or does not compile, is refused with 400 InvalidDocument.
  • A plain zone name the CMS does not hold is reported as the advisory finding NETWORK_ZONE_UNKNOWN: the zone may be created before the first run. When the engine could not read the CMS, the finding says that its last read lacks the zone. See Publishing.

Workers and their zones

A worker names the zones it serves when it registers, from NEOPS_WORKER_NETWORK_ZONES (comma-separated) in the Worker SDK. The engine sends it networkZones on POST /workers/register and echoes the list, default first:

{ "name": "worker-b", "version": "0.5.0", "networkZones": ["zone-b", "default"] }
  • A worker that lists no zones serves default, and is stored and echoed as ["default"], like one that lists it. Its zonesListed is false in the worker responses, so the Monitor App can name it. Once the CMS holds a zone besides default, a worker must list its zones, even if only default: registration without a list (or with an empty one) is refused with 400 This installation has network zones. Set NEOPS_WORKER_NETWORK_ZONES, for example to default.
  • A zone the CMS does not hold is refused with 400 Unknown network zone: <name>. Create it in the CMS first, on the web client's Network zones page, in Django admin, or with networkZoneUpsert. When the engine could not read the CMS for this registration, the refusal says so instead: 400 Unknown network zone <name>: the CMS could not be read; its last read lacks the zone. GET /health says whether it answers. The Worker SDK takes that 400 as final and exits: restart the worker once the CMS answers.
  • A worker that lists several zones registers, with a warning in the engine log: the addresses of those zones must not overlap as seen from the worker’s host.
  • Every registration reads the CMS’s zones before it is answered, so a zone created a moment ago is found, and a zone the CMS deleted is refused.
  • Registration answers 503 only while the engine has never read the zones from the CMS (see below).

A worker claims only jobs of the zones it serves. The zone is part of the claim query, so a job in a zone no worker serves waits, while later jobs of other zones are claimed around it. GET /version answers "networkZones": {"supported": true}, so a worker can tell that the engine routes by zone.

Each job in a poll response carries meta with where it runs and why:

{
  "meta": {
    "networkZone": "zone-b",
    "networkZoneSource": "override",
    "step": { "networkZone": "zone-b", "override": true }
  }
}

networkZoneSource is device, step, override or default, as in Where a job runs; step is the step’s nearest declaration (networkZone is null when none encloses the step).

GET /network-zones (worker:read) lists the zones, default first, each with its online workers and its waiting jobs:

[
  { "name": "default", "description": "", "workers": { "online": 2 }, "jobs": { "pending": 0 } },
  { "name": "zone-b", "description": "Branch office B", "workers": { "online": 0 }, "jobs": { "pending": 3 } }
]

The engine does not check whether a zone has an online worker before it creates a job there: a job in a zone nobody serves waits until a worker of that zone comes online or BLACKBOARD_PENDING_JOB_TIMEOUT (one hour by default) fails it with No worker serving the job’s network zone polled it; it waited … (pending timeout: …). Only a worker that is online in GET /workers counts; an unreachable worker, one that stopped pinging, does not. When the zone has online workers but none of them registers the job’s function block version, for example a stored workflow that pins a version the upgraded workers no longer serve, the failure names the zone and the block: No online worker of network zone <zone> registers function block <package>/<name>:<version>, though the zone has … online workers; it waited …. In both cases the engine does not retry the failure, so it comes after one timeout. When an online worker of the zone has the block registered, that worker is busy with other jobs: the failure says so and is retried like any other failure. After an engine start, the pending timeout fails no job until the engine has served requests for one WORKER_OFFLINE_THRESHOLD_MS (6 minutes by default), so the zones’ workers can reconnect and poll first; a job whose timeout ran out while the engine was down fails only then. The job and its log records name the zone. While an EXECUTE job waits, its run is not finished. New runs in every zone start beside it until the engine’s drain phase begins, which happens once a run is about to write back to the CMS or the epoch has locked about EPOCH_MAX_PARALLEL_RUNS runs. From then on, new runs wait until the waiting job’s run, and every other run the epoch has locked, has finished. The Monitor App’s Workers page flags such zones.

  • A never-polled EXECUTE job fails its run like any failed step.
  • A never-polled ACQUIRE job is retried like an EXECUTE job. When it is not retried, the run ends FAILED_SAFE_ACK with acquire_failed, and the reason names the step, the zone and the failure: Acquire job of step ‘.
  • A never-polled ROLLBACK job halts the rollback, and the run ends FAILED_UNSAFE. Until the pending timeout fails it, the waiting job holds a drain phase like a waiting EXECUTE job. Its ledger entry stays open: resolve it in remediation, which needs no worker, or roll it back once a worker of the zone is back; a rollback started while the zone has no worker waits out another pending timeout.

Run at least two workers for every zone, default included, so a zone’s jobs keep moving while one of its workers restarts. The developer-preview engine admits at most 2 workers per installation, so two workers in each of several zones need the licensed (enterprise) engine.

A zone’s workers usually reach the engine over the site’s link. When that link fails, they keep running the jobs they hold, so a job still changes its device, but their heartbeats and results do not arrive. Jobs are delivered at least once: a job held across an outage that outlasts the engine’s patience is failed, and may run again.

The engine fails a job a worker holds at the earlier of two deadlines, checked every BLACKBOARD_JOB_CHECK_INTERVAL (1 minute by default):

Setting Counted from Default reasonCode
WORKER_OFFLINE_THRESHOLD_MS the worker’s last heartbeat 6 minutes worker_lost
BLACKBOARD_STUCK_JOB_TIMEOUT when the worker took the job 12 minutes job_timed_out

With the defaults, an outage longer than about 6 minutes fails every job the zone’s workers hold; a job that had run for more than 6 minutes when the outage began reaches the stuck timeout first. See the threshold cascade.

A worker re-sends a finished job’s result for up to the Worker SDK’s RESULT_PUSH_TIMEOUT (300 seconds by default, see its configuration). A result that lands before the engine fails the job counts: the job ran once and is not retried. Once the engine has failed the job, the late push is refused and the change it made stays done (A push after the engine gave up).

What a failed job costs depends on its function block:

  • Pure or idempotent: the job is retried in the same zone, by whichever of the zone’s workers polls it first, so the block may have run twice: on the cut-off worker and on the retry. While no worker of the zone reaches the engine, the retry waits, up to BLACKBOARD_PENDING_JOB_TIMEOUT.
  • Any other block: the step fails on its first attempt and the run goes to the rollback, or ends FAILED_UNSAFE when an executed block is not reversible. The engine wrote the failure, so the rollback gets outcomeKnown: false and no snapshot unless a late push left one. Its ROLLBACK job runs in the zone too and waits for a worker of the zone, and it may run while the cut-off worker is still changing the device. The device then holds a change the engine recorded as failed.

While the held job, its retry or its rollback waits, the run is not finished; if the engine enters its drain phase meanwhile, new runs in every zone wait for it too.

Sizing the timeouts

To ride out an outage of length D on a site whose longest job takes L, with a margin M of the worker’s API_REQUEST_TIMEOUT plus 30 seconds (about 1 minute by default: on a link that drops packets, a request can hang for the request timeout before the worker backs off for up to 30 seconds):

  • WORKER_OFFLINE_THRESHOLD_MS above D + M + HEARTBEAT_INTERVAL (20 seconds by default), so the heartbeat before the outage and the first one after it land in time;
  • BLACKBOARD_STUCK_JOB_TIMEOUT above L + D + M;
  • RESULT_PUSH_TIMEOUT at least WORKER_OFFLINE_THRESHOLD_MS + BLACKBOARD_JOB_CHECK_INTERVAL, and below the stuck timeout as the Worker SDK asks;
  • HEALTH_STALL_TIMEOUT, set on the worker, at least L + RESULT_PUSH_TIMEOUT.

The engine fails a job as worker_lost only if its worker still counts as offline when a check runs, so a worker that comes back between the offline threshold and the next check keeps its job. If its push gave up before then, the result is lost and the engine fails the job at the stuck timeout. With the engine’s defaults that is 6 + 1 minutes, so a RESULT_PUSH_TIMEOUT of 420 seconds closes the gap; the SDK’s 300-second default leaves an outage of about 5 to 7 minutes that begins as a job finishes able to lose a successful result.

The worker pushes the result from its poll loop, and stops refreshing its health file once that loop has not advanced for HEALTH_STALL_TIMEOUT (720 seconds by default). The worker chart’s liveness probe then restarts the worker in the middle of the push. With a 420-second push timeout, the default covers jobs of up to 5 minutes; raise it with the stuck timeout for longer jobs.

Higher thresholds cost time when a worker really dies: its jobs, their retries and rollbacks, and any drain waiting on them, wait that much longer, and a dead worker keeps its place in the license’s worker quota until it counts as offline. Setting WORKER_OFFLINE_THRESHOLD_MS alone also raises the stuck timeout (2× it) and the pending timeout (5× the stuck timeout) unless those are set; see Configuration.

Function blocks that change devices at remote sites should be idempotent, so a second run is harmless (Pure and idempotent), or reversible with a snapshot taken before their first change.

Where the engine reads zones

The engine keeps its own table of zones: the CMS’s zones plus default. A zone the CMS deletes is marked deleted in the table and comes back if the CMS creates it again. Once read, the table serves while the CMS is down. A read the CMS does not answer within NEOPS_CMS_REQUEST_TIMEOUT_MS (30 seconds by default) counts as the CMS being down.

The engine reads the CMS’s zones at fixed moments only, never on a timer:

  • At start. It reads them once, retrying with backoff (1 second, doubling up to 1 minute) until the CMS answers.
  • When a worker registers. It waits for that read at most 10 seconds, then answers from the table.
  • When a definition is published, or a run’s resource discovery starts, naming a zone the table lacks. It reads them once more before it reports the zone or fails the run, so a zone created a moment ago is found. Resource discovery waits for that read at most 2 seconds; a publish waits until the read gives up, after NEOPS_CMS_REQUEST_TIMEOUT_MS when the CMS does not answer, and then answers from the table.
  • In every run’s lock phase, right before it asks the CMS to lock the run’s entities.

A run talks to the CMS only in its lock phase and at its write-back (the unlock). Between the two it makes no CMS call: it checks zones against the zones it read when it locked, its snapshot, and leaves every lookup to the CMS at the unlock.

sequenceDiagram
  participant W as Worker
  participant E as Engine
  participant T as Engine zone table
  participant C as neops-core (CMS)
  Note over E,C: Boot
  E->>C: networkZones (retry with backoff until it answers)
  C-->>T: zones stored
  Note over W,C: Worker registration
  W->>E: register(networkZones)
  E->>C: networkZones (waits at most 10 s)
  C-->>T: refreshed
  E-->>W: 503 before the first read / 400 unknown zone / registered
  Note over E,C: Run, lock phase
  E->>C: networkZones
  C-->>T: refreshed, the run keeps its snapshot
  E->>C: getAndLockResources
  Note over E: Execution: no CMS call, zone checks use the snapshot
  Note over E,C: Run, write-back
  E->>C: unlockResources(dbUpdates)
  C-->>E: applied, or refused (the CMS judges zones and lookups)
  opt refused: WRITE_REFUSED, nothing applied
    alt the run has no side effects
      E->>C: unlockResources(no writes)
      C-->>E: locks released, the run ends FAILED_SAFE
    else the run has side effects
      Note over E: the run ends FAILED_UNSAFE, keeps its locks and its writes for an operator's retry
    end
  end

A declared zone the CMS does not hold fails the run FAILED_SAFE with reason unknown_network_zone, before anything is locked:

  • When resource discovery starts, the engine checks every step’s ACQUIRE job against its table, reading the CMS once more when the table lacks a declared zone. A zone the CMS does not hold either fails the run before any job is created. When that read fails or has not arrived within 2 seconds, resource discovery refuses nothing, and the run sits in RESOURCE_DISCOVERY while the step’s ACQUIRE job waits for a worker of its zone. A zone the CMS lacks then fails the run only after BLACKBOARD_PENDING_JOB_TIMEOUT (60 minutes by default), as acquire_failed, not unknown_network_zone. See A CMS that stops answering.
  • In the lock phase, the engine reads the CMS’s zones. A declaration naming a zone the CMS does not hold fails the run; the reason names each declaration and its zone. When the CMS cannot be read, the read fails like the lock would: a refusal the CMS will repeat, such as a rejected NEOPS_CMS_TOKEN or a query its schema lacks, ends the run FAILED_SAFE with lock_refused; any other failure retries the lock attempt with backoff, the cause in the run’s retryNote, not its reason, and the run stays in LOCKING. So does a failure of the engine’s own database to store the zones the CMS answered, which the retryNote and the log name as such, not as a CMS failure. The engine logs every failed read at warn with the run’s id.

A device’s zone in the context

Every device a run locks carries its zone under networkZone, and so does the device of every locked interface:

{ "id": 1, "hostname": "r1", "ip": "10.0.0.1", "networkZone": { "id": 2, "name": "zone-b" } }
{ "id": 7, "hostname": "sw9", "ip": "10.0.0.9", "networkZone": { "name": "default" } }

A device with no zone stored reads as { "name": "default" }, without an id, in the job’s context and in the engine’s copy of the run’s entities.

Writing a device’s zone

A step writes a device’s zone through dbUpdates, under the snake_case key network_zone, as {"name": ...}. The engine places the device’s jobs by that name, so a zone named only by its id is refused, and it sends the zone to the CMS by its name alone: an id beside the name is dropped, so the name always decides the zone. The same holds for the zone an interface’s write names its device in. An id decides only which device a write names:

{ "entity": "device", "operation": "patch", "id": 1, "path": "network_zone", "value": { "name": "zone-b" } }

The engine applies the write to its copy of the device, under networkZone, so later steps of the run and the job placement of later jobs follow the move, the jobs of the device’s interfaces included. The CMS stores it when the run unlocks. Only the path network_zone moves a device: a path below it, such as network_zone.name, would change the zone record in the CMS rather than the device, and is refused.

Creates and lookups

A device create should name its zone, normally the zone its job runs in, from meta.networkZone. A create without one is passed to the CMS as sent, and the CMS stores the device in default; the engine does not fill the zone in. Naming default from a job in another zone records a device of that network in default, whose workers then receive its credentials.

Its identifierFields are a list of groups: core tries them in order, a group matches when all its fields match, and a group is skipped when the data lacks one of its fields. To find a device by address, pair the address with the zone:

{
  "entity": "device", "operation": "create", "id": 48213907,
  "data": { "id": 48213907, "hostname": "r1", "ip": "10.0.0.1", "network_zone": { "name": "zone-b" } },
  "identifierFields": [["ip", "network_zone"], ["hostname", "network_zone"]],
  "skipIfIdentifierExists": true
}

A create carries a temporary id, which data.id repeats. It must be a positive integer that no entity in the run already has: the engine refuses a zero or negative id when the result is pushed, and refuses a create whose data.id differs or whose id the run already holds. The CMS assigns the real id when the run unlocks, and a later write in the same run may name the temporary one. The Worker SDK draws temporary ids at random from 10,000,000 to 2,147,483,647, a range chosen to stay clear of the ids the CMS assigns; a hand-built result should do the same.

Entity Fields a group may name
device hostname, ip, network_zone (never alone)
interface name, looked up on its device
group name

An interface names its device by id, or by hostname or ip; a bare number is an id and a bare string a hostname. Without a network_zone beside them the CMS matches devices in every zone, so where addresses overlap, add the zone:

{ "device": { "ip": "10.0.0.1", "network_zone": { "name": "zone-b" } } }

What the engine refuses

The CMS checks a run’s writes when the run unlocks, after every step has run: it runs each create’s identifier lookup, resolves each device reference and checks each zone. The engine checks what it can without a lookup in the CMS, when the result arrives, so the run fails at the step that wrote it, before its later steps run.

A refused result fails the run with reasonCode invalid_result, the refusal in its reason, and the job’s row says why in resultRejected:

resultRejected The result
network_zone names a zone in a shape other than {"name": ...}, an id alone included; patches a path below network_zone, or at networkZone, the context’s spelling; or creates or moves a device into a zone missing from the zones the run read when it locked
cms_lookup names a field a group may not name, an empty group or a group of network_zone alone; or names an interface’s device by none of id, hostname and ip
patch_path patches an entity’s id or pk, or a path below either, which the run and the CMS address the entity by; or patches a path that names __proto__, constructor or prototype

Whether a create’s lookup finds one record, two or none, whether a group name is taken, and whether a reference finds its device are for the CMS to decide at the unlock. A zone the CMS deletes while the run holds its locks is caught there too.

A write-back the CMS refuses is applied in none of its parts. The run fails with reasonCode write_refused and the CMS’s message in its reason. Once the refusal is recorded, the engine never sends the refused writes again on its own, not on a retry and not after a restart. When the run has no side effects, it ends FAILED_SAFE, its writes are discarded, and the engine releases the locks with an unlock that carries no writes. When it has side effects, the devices may hold what the CMS refused: the run ends FAILED_UNSAFE with unsafeCause write_refused, keeps its writes and its locks, and an operator either retries the write-back once the cause is fixed, or remediates the run.

Reading where a step ran

<step_label>.meta holds the zone a step’s job ran in and why, the step’s own declaration, the worker that ran it and the job’s identity. See Where a step ran: meta.

- type: functionBlock
  label: notify
  functionBlock: "fb.examples.neops.io/post_message:1.0.0"
  runOn: global
  networkZone: default                    # the chat bridge is only reachable from the central site
  parameters:
    text: "Discovery finished in {{ discover.meta.networkZone }}"

Examples

Discover one zone, then report from the central site:

label: zone_discovery
name: zone_discovery
package: wf.examples.neops.io
majorVersion: 1
minorVersion: 0
patchVersion: 0
seedEntity: global
type: workflow
networkZone: "{{ parameters.zone }}"        # every step below runs here unless it says otherwise
parameterSchema:
  type: object
  properties:
    zone: { type: string, description: "Network zone to discover" }
    subnets: { type: array, items: { type: object } }
  required: [zone]
steps:
  - type: functionBlock
    label: discover
    functionBlock: "fb.base.neops.io/global_discover_network:0.2.0"
    runOn: global
    parameters:
      subnets: "{{ parameters.subnets }}"
  - type: functionBlock
    label: notify
    functionBlock: "fb.examples.neops.io/post_message:1.0.0"
    runOn: global
    networkZone: default
    parameters:
      text: "Discovery finished in {{ discover.meta.networkZone }}"

Onboard devices that were imported into default but live in network B. Find the ones still in default with the CMS’s devices filter, where networkZone_Name: "default" matches the devices that have no zone stored, and run the workflow on their ids ("executeOnParameters": { "ids": [...] }):

query { devices(networkZone_Name: "default") { results { id hostname ip } } }

fb.examples.neops.io/get_facts and fb.examples.neops.io/check_identity are illustrative names; no repository ships them.

label: zone_onboarding
name: zone_onboarding
package: wf.examples.neops.io
majorVersion: 1
minorVersion: 0
patchVersion: 0
seedEntity: device
type: workflow
steps:
  - type: functionBlock
    label: first_contact
    functionBlock: "fb.examples.neops.io/get_facts:1.0.0"
    runOn: device
    networkZone: { name: zone-b, override: true }   # reach the device from zone-b, wherever it is recorded
  - type: functionBlock
    label: same_device
    functionBlock: "fb.examples.neops.io/check_identity:1.0.0"
    runOn: device
    parameters:                                     # fails unless the device that answered matches the CMS record
      hostname: "{{ first_contact.result.data.hostname }}"
      serial: "{{ first_contact.result.data.serial }}"
  - type: functionBlock
    label: rehome
    functionBlock: "fb.base.neops.io/device_update_device:0.2.0"
    runOn: device
    parameters:
      network_zone: zone-b                          # record the move; later steps and runs follow it

Only first_contact runs in network B. same_device and rehome declare no zone, so they run in the device’s zone, and the device is recorded in default until rehome writes: both run on a central worker. check_identity needs no connection there, since it compares what first_contact found with the CMS record in its context. A step that connects to the device before rehome, such as one that reads it again to check its identity, needs networkZone: { name: zone-b, override: true } too; without it, a central worker connects to the address in the central network, which with overlapping addresses is a different device. Every step’s ACQUIRE job runs in the declared zone, else in default, so a zone-b worker serves get_facts and a central worker serves check_identity and device_update_device.

The first step sends the record’s credentials to whatever answers at that address in network B before any identity check runs, so onboard with credentials meant for that network.