Inspiration

QNX 7 had Qnet. Every machine's /dev showed up under /net/<node>/, so an unmodified program could open a device on another board by its path. QNX 8.0 discontinued Qnet, and its discontinuation notice lists the alternative as "N/A". People noticed: on the OpenQNX forum, when the QNX 7.1 notes said Qnet would go, a QNX serial-driver maintainer who has "exploited it since 1987" described reaching serial ports on remote machines through Qnet instead of running serial cables around buildings and factories, named wind farms and even cars and motorbikes as places where linking remote CPUs matters, and wrote "Arguably QNX ain't QNX without Qnet". I wanted to see if the path part could come back on QNX 8.0 as two plain user-space programs, and keep what makes QNX QNX: priority.

What it does

crossnode-agent shares the paths a machine lists. crossnode-net is a resource manager that mounts a peer at /net/<name>. After that, stock tools like cat, ls -l and stty open, read, write and devctl the other machine's devices with no code changes, and so does an ordinary program written the Qnet way: examples/serialwatch.c (open, tcsetattr, select, read) sets another machine's serial port to 115200 baud through /net and prints the lines typed on it. In the demo, stty baud=115200 on one machine changes the serial port of another, and that machine's own driver reports the new speed.

  • Priority travels. The caller's priority goes in each request, and the other machine does the work at it, never above a cap its operator sets. With priority 12 work filling every CPU on either machine, a priority 30 caller is still answered; a build that drops the priority fails that test. (Requests still share one TCP stream, in the order they were sent.)
  • select works. A program on one machine waits with select on another machine's serial port and wakes when a line is typed there; if the link fails while it waits, it wakes and its read says why.
  • Failure is bounded. I kill a zone's QEMU machine (its power cut) while central reads it. After about 2 s of silence the read ends with "Host is down" instead of hanging, the other zone keeps answering, and when the zone boots again it works with nothing restarted. Ctrl-C on a waiting read returns within the test's bound.
  • You can see the link. cat /net/rear/.status says whether the link is up and authenticated, how many calls wait, and how often it dropped or refused a frame, with the last reason. When the zone is back it reads: connected twice, dropped once for silence, nothing refused.
  • One file for every peer, supervised. Central starts once from /data/etc/crossnode.conf. A supervisor (which holds no key) runs one process per peer, each reading only its own key, so one hung peer cannot hold up another; a peer process that dies is started again, and kill -HUP adds or removes peers without touching the others. scripts/new-link.sh makes a link's key and prints both ends' lines.

Security, in layers. QNX's own documentation describes Qnet as "deployed as a network of tightly coupled trusted machines". Crossnode does not trust the network:

  • Each link has its own key, and both ends prove they hold it when they connect.
  • Every frame after that carries an HMAC-SHA256 tag with a frame counter, checked at both ends. The tests flip a bit in a reply, replay a reply, and flip a bit in a request: all are refused, and the device keeps its value. The traffic is not encrypted.
  • A machine shares only the paths it lists.
  • In the confined build (the zonal demo's), every Crossnode program and sensor runs as a non-root user under its own QNX security type, from a policy compiled into the boot image, enforced and immutable.

How I built it

  • C against QNX SDP 8.0, x86_64, tested on QEMU guests built with mkqnximage.
  • crossnode-net never lets its dispatch thread wait on the network. Each request is parked with _RESMGR_NOREPLY; a network thread sends a pulse when the answer arrives, and the dispatch thread replies. A signal to a waiting client arrives as an unblock pulse, so Ctrl-C gives EINTR within the test bound; a leftover pulse is told apart with MsgInfo.
  • Priority: QNX already runs the receiving thread at the client's priority. crossnode-net reads that priority from the message info and writes it into the request; the agent starts the request's worker at it, capped by -P.
  • crossnode-agent runs each device call on a worker, so a slow device never looks like a dead machine. Every open is resolved with realpath and must land inside a share; files are checked again on the opened descriptor (iofdinfo), directories by device and inode, devices by a second resolve.
  • select, poll and ionotify: crossnode-net arms the caller with iofunc_notify and asks the other machine, whose worker waits with poll on the real descriptor; the answer wakes the caller with iofunc_notify_trigger.
  • The security policy was recorded with secpolgenerate from the demo and compiled into the boot image.
  • Every claim is a numbered check in a transcript that names its commit: one machine 81 of 81, two machines 25 of 25, priority 4 of 4 (timed inside the caller's machine against a 1000 ms bound, with the load on the other machine counted before each call; at an earlier commit one priority check failed once in a release run, and that transcript is kept), the confined boot-image pair 13 of 13, the enforced three-machine set 17 of 17, plus SHA-256 and HMAC test vectors. One script, scripts/zonal-from-scratch.sh, goes from source to the 17 zonal checks and the demo (17 of 17 when run from an empty folder).
  • Every important check has a deliberately broken build or run that fails it: no frame check (the program gets 43 instead of 42), no priority carried, no I/O thread priority, no liveness limit, no select forwarding, the wrong zone cut, no policy.

Where QNX is used (for the judges)

The README section "Where QNX is used" maps each capability to its file, function and test:

  • Resource managers: /net/<name> as a directory prefix, answering open, read, write, devctl, stat and directory reads for the peer, plus a status file answered locally.
  • Native message passing: deferred replies, a pulse doorbell, unblock pulses, select/ionotify forwarding, and the client's priority from the message info carried to the other machine.
  • Real-time services: the other machine's worker starts at the caller's priority, the way a QNX server thread takes its client's priority (set once at the start; later boosts are not carried).
  • Boot image configuration: mkqnximage images that boot already connected, from one config file.
  • Security policies: one type per program, recorded, compiled in, enforced and immutable.

Why QNX

On QNX, every open, read and devctl is already a message to whichever server owns the path, and the server's thread runs at the client's priority. That is why one user-space server can stand in for a whole machine, why unmodified programs work through it, and why the priority can go along. Systems built from several QNX boards that used Qnet's paths (distributed control, test rigs and lab instruments, multi-board controllers) find no listed alternative on QNX 8.0, so each such program would otherwise move to sockets or to middleware such as SOME/IP or DDS.

In a vehicle program, the concrete fit is the hardware-in-the-loop bench: a QNX test host configures and reads the devices of several QNX ECUs by path (serial lines, test devices, configuration), at its own priority, and gets a clean error when one ECU loses power, the way the demo cuts a zone. The same holds for end-of-line and service diagnostics. The demo's zonal machines show the pattern with simulated sensors.

It is not a hard real-time transport: requests go over TCP in the order they were sent, and QNX's network stack runs at priority 21 in these images. What it bounds is failure; what it carries is the caller's priority for the work. The demo's sensors are labelled stand-ins; the fit is supervision, diagnostics and configuration across boards.

Build and run

  • QNX version: QNX SDP 8.0 (the guests report QNX 8.0.0).
  • Target: x86_64 QEMU guests built with mkqnximage; three machines on direct links for the zonal demo.
  • Toolchain: SDP 8.0's qcc (qcc -Vgcc_ntox86_64).
  • Steps: the README's "Reproduce" section builds, boots, records the policy, rebuilds the enforced set, runs the zonal checks and the demo.

Challenges I ran into

  • Keeping the dispatch thread off the network, and turning a signal into EINTR without waiting on the peer, including for a stat inside a combined message.
  • Priority on both machines. Carrying it to the other side was not enough: on the caller's own machine, busy lower-priority work starved the link's I/O thread until the peer looked dead. That needed its own option and its own test, and a broken build that fails it.
  • Telling a slow device from a dead machine: only silence counts as failure.
  • Making confinement real rather than claimed: anything the recording did not see is denied.

Accomplishments that I'm proud of

  • Stock QNX tools reach another machine's devices by path, unchanged, on QNX 8.0, at the caller's priority.
  • A dead peer gives a clean error within a stated bound, and the status file says why.
  • Every important check is proven able to fail.

What I learned

On QNX, an open is just a message to whoever owns the path, and the server works at the caller's priority. Once that clicked, the project became one idea: own a path that stands for another machine, and carry the priority with it. I also learned to prove a check can fail before trusting it.

What's next for Crossnode

  • Encryption (frames are authenticated today, not encrypted).
  • pread and pwrite; output readiness for select (input is forwarded today); a pool of worker threads.
  • Finding peers on their own instead of listing them.
  • An aarch64 pair on real boards.

Limits

  • The traffic is not encrypted.
  • Priority sets how the work runs on the other machine, not the order on the wire: one TCP stream, and a network stack at priority 21.
  • One process per peer; peers are listed, not discovered.
  • Not forwarded: chmod, chown, utime, unlink, rename, mkdir and private messages; /net/<peer> is for using devices and files, not managing them.
  • No mmap or shared memory; select covers input only; name_open is not covered.
  • The policy is recorded from the demo, so a use the recording did not see is denied until it is recorded too.
  • Built and tested for x86_64 under QEMU, with simulated sensors.
  • Times are pass or fail against the bound each test states, for this code on QEMU guests, not performance figures for QNX.

Built With

  • bash
  • c
  • mkqnximage
  • qemu
  • qnx
  • qnx-sdp-8.0
  • secpol
Share this project:

Updates

Submission history