Hi Nicolas — good questions, not dumb at all.
What the name server does. Your picture (3+ processes) is right. The name
server is a small bootstrap/rendezvous service.
Partitions register with it at elaboration (“I host RCI units X and Y, at
these endpoints”), and callers ask it once per unit “who hosts X?” — after
that, all RPC traffic flows directly between the partitions; the name
server isn’t in the data path. Besides the RCI registry, it hands out partition
ids, stores each unit’s RM E.3 version hash (more below) and coordinates orderly
shutdown.
Launching after a discovery phase — yes. Nothing about addresses is baked
in at build time. The only thing every process must be told at launch is where
the name server is (DSA_NAME_SERVER=tcp://<host>:<port>, environment or
per-partition aDSA.config file); serving partitions additionally get
DSA_HOST=<their own routable address> so remote callers can reach them.
Partitions bind ephemeral ports and register whatever they bound — so
dynamically-discovered IPs are fine. Declare pragma Starter (None); in the
.cfg and launch the partition executables from your own orchestration once
mDNS discovery + user selection has happened. (The generated start-*.sh is
just a convenience for the static case.)
Several PCs, each controlling its own equipment — yes. Each PC + its
equipment is simply an independent deployment with its own name server
(naturally running on that PC). Deployments don’t know about each other. One
caution: within a deployment, re-registration of an RCI unit is “latest wins”
(that’s the restart-recovery feature), so an equipment process mistakenly
pointed at the wrong PC’s name server could hijack a unit registration
there. To prevent this, give each deployment its own CurveZMQ key pair
(pcs_keygen) … a process with the wrong keys can’t complete a handshake with
the wrong deployment at all, so “no overlap” is enforced cryptographically,
not just by discipline.
Two equipments under one PC (here’s the real constraint). Annex E programs
are statically partitioned: the .cfg fixes, at build time, which
partitions exist and which RCI unit each one hosts, and an RCI unit is a
singleton in the program. You can’t run two copies of the same RCI-hosting
partition inside one program. Two clean ways to handle N identical devices:
- One deployment per device (my recommendation for truly dynamic N):
same binaries, one name server per deployment on its own port on the PC,
launched per device after discovery. Cheap and simple; the PC runs one
client + one NS per attached device.
- One program with the device count bounded in the
.cfg: distinct
partitions (Equipment_1, Equipment_2, …) hosting distinct unit names,
or a design where the PC hosts a factory/registry RCI and devices are
represented as RACW objects … the objects are then dynamic, but the
partition set is still fixed.
And no, neither the “server” nor the name server has to live on the PC. Any
partition can host RCI units (the .cfg decides), and the name server can run
on any host every partition can reach; the PC is just the natural place since
it’s your stable node.
Version compatibility is enforced automatically (RM E.3). GNAT computes a
hash of each RCI unit’s spec source; the hosting partition registers it, and
every caller compares its own compiled-in hash on first resolution of that
unit. A mismatch raises Program_Error before any call is made, rather than
silently exchanging incompatible data. So client and server must be built from
the same version of the shared spec (bodies can differ freely). This works
across different GNAT versions and OSes. We’ve verified identical hashes
GNAT 14↔16 on x86_64↔ARM and Linux↔FreeBSD↔Windows.
The User’s Guide covers all of this in more depth … §5 (configuration language),
§9 (running without a Starter), §10 (cross-host), §11 (env-var reference).
One honest caveat since your instruments are mDNS-discovered: aDSA is
IPv4-only today. The transport underneath (ZeroMQ) fully supports IPv6, but
it’s off by default per socket and we don’t yet enable it, and the endpoint
plumbing hasn’t been audited for bracketed v6 literals. It’s a small, planned
enhancement but it hasn’t been done or verified as yet, so perhaps
plan on IPv4 addresses from your discovery phase for now. Also worth knowing
if it lands: mDNS on instrument LANs often yields link-local v6 addresses
(fe80::…), which need a zone index and are generally a sharp edge — global
or ULA addresses (or just IPv4) are the comfortable path on a bench network.
I’ll take a look at IPv6 now,
Regards.