Skip to content

vms-c23: DECnet Phase IV NSP logical-link connection service (rung-2) - #1007

Merged
baron-3dl merged 1 commit into
mainfrom
work/vms-c23-nsp-connection
Aug 31, 2026
Merged

baron-3dl merged 1 commit into
mainfrom
work/vms-c23-nsp-connection

Conversation

@baron-3dl

Copy link
Copy Markdown
Contributor

What

Engine rung 2 of the DECnet lane (epic vms-30e): the NSP logical-link connection service on top of the rung-2 NSP codec (vms-6986), wired into the rung-1 routing engine (vms-449d) so DECNETD.EXE can OPEN a logical link over an adjacency it already forms.

The FSM — what a logical link can now do

src/vmsdecnet/nsp/dnet_link.{c,h} — a pure, clock-injected NSP connection state machine, same discipline as the adjacency SM (no socket / thread / wall-clock / sleep):

CLOSED --connect()--> CI_SENT --rx CC--> RUN --disconnect()--> DI_SENT
   ^                     |                |                        |
   | rx CI               |                | rx DI (-> send DC)     | rx DC
   +-- CR_RCVD --accept()/CC--> RUN     CLOSED <------------------+
  • Establish — Connect Initiate / Connect Confirm exchange, logical-link addresses learned both ways.
  • Run — a data segment carried with its explicit acknowledgement (QUAL bit) and simple in-order sequencing; piggyback ack supported.
  • Tear down — Disconnect Initiate / Disconnect Confirm handshake, clean close both ends.
  • CI retransmit + give-up — an unanswered CI retransmits on the injected clock and, after the budget, abandons the link as UNREACHABLE (never a fabricated connect). Both values are oracle-informed: ~5.5 s interval (register §4.6 specimens ci: wire QEMU kernel-executive job into CI (vms-e4d) #3dcl: SHOW DEVICE row byte-exact + create_dir leak fix (vms-b9f round 5) #4 are 5.504 s apart) and 8 retransmits (§4.6 records VAX1 giving up after 8).

Wiring + proof (open / data / ack / close)

  • dnet_nsp: added Disconnect Confirm (DC, MSGFLG 0x48), classified distinct from DI. The oracle Connect-Initiate round-trip is unchanged and still byte-identical.
  • dnet_engine: a minimal Phase IV long-data-packet routing header carrier (build/parse, grounded on §4.6 specimen ci: wire QEMU kernel-executive job into CI (vms-e4d) #3's header bytes) + one embedded link + link_open / accept / send / close / rx wrappers.
  • DECNETD.EXE --nsp-selftest (no CAP_NET_RAW): two engines OPEN a link, move a data segment + ack, and DISCONNECT as full on-wire data frames over a real socketpair(2) — the exact build_data_frame -> wire -> link_rx path a live datalink uses.

Proven two ways (tests/vmsdecnet/test_dnet_link.c): two dnet_link FSMs drive the full choreography deterministically, and two engines exchange a logical link end-to-end over a socketpair with the payload round-tripping byte-identical.

Tests

6/6 vmsdecnet + 26/26 vmsscs ctests green, -Werror clean. Both DECNETD.EXE --self-test and --nsp-selftest PASS.

Clean-room (Rule 8) — honest scope

Only the Connect Initiate bytes are oracle-verified (the codec, §4.6). The CC / data / ack / DI / DC choreography is SPEC-DERIVED from the public DNA Phase IV NSP spec and proven only by the two-endpoint round-trip — the §4.6 capture never completed a handshake, so no completed-link bytes exist to ground it and none are fabricated. DC and the long-data header (built without the specimen's optional 0x81 padding field) are labelled spec-derived / OVMX choices. Register §6.0 records rung 2.

Scope honesty — deferred children of vms-30e (filed, not dropped)

  • SET HOST / CTERM — vms-4d2
  • file transfer / FAL·DAP (COPY NODE::) — vms-8c2
  • live-VAX oracle bracket — vms-aac0

Different lane from CHF/libvms; no /dev/vms ioctl / kif / scsd / ovmx_init surface touched — DECnet engine is userspace over scs_datalink.

🤖 Generated with Claude Code

…rung 2)

Build the NSP CONNECTION STATE MACHINE on top of the rung-2 NSP codec
(vms-6986) and wire it into the routing engine (rung-1, vms-449d) so
DECNETD can OPEN a logical link over an adjacency it already forms.

- src/vmsdecnet/nsp/dnet_link.{c,h}: a pure, clock-injected NSP connection
  FSM (CLOSED -> CI_SENT/CR_RCVD -> RUN -> DI_SENT -> CLOSED). Establish
  (Connect Initiate/Confirm), run (a data segment carried with its explicit
  acknowledgement + in-order sequencing), tear down (Disconnect
  Initiate/Confirm). No socket/thread/wall-clock, same discipline as the
  adjacency SM. CI retransmit + give-up-as-UNREACHABLE (oracle-informed:
  ~5.5s interval, 8 retransmits, register sec 4.6).
- dnet_nsp: add Disconnect Confirm (DC, MSGFLG 0x48), classified distinct
  from DI; CI oracle round-trip unchanged and still byte-identical.
- dnet_engine: a minimal Phase IV long-data-packet routing header
  carrier (build/parse, grounded on specimen #3's header bytes) + one
  embedded link + link_open/accept/send/close/rx wrappers.
- decnetd: DECNETD.EXE --nsp-selftest (no CAP_NET_RAW): two engines OPEN a
  link, move a data segment+ack, and DISCONNECT over a real socketpair.
- tests/vmsdecnet/test_dnet_link.c: FSM unit + CI-retransmit + two-engine
  end-to-end over a socketpair (payload byte-identical). DC codec coverage
  added to test_dnet_nsp.c. 6/6 vmsdecnet + 26/26 vmsscs green, -Werror.

Clean-room (Rule 8): only the Connect Initiate is oracle-verified; the
CC/data/ack/DI/DC choreography is spec-derived from the public DNA Phase IV
NSP spec, proven by the two-endpoint round-trip, no fabricated bytes.
Register sec 6.0 records rung 2. SET HOST/CTERM (vms-4d2), FAL/DAP
(vms-8c2) and the live-VAX bracket (vms-aac0) are filed as children of
vms-30e; not this rung.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@baron-3dl
baron-3dl merged commit bc76445 into main Aug 31, 2026
122 checks passed
@baron-3dl
baron-3dl deleted the work/vms-c23-nsp-connection branch August 31, 2026 21:22
baron-3dl added a commit that referenced this pull request Aug 31, 2026
Feature patch over V0.6-9. Bumps the identity SSOT in step (vms-8328 gate):
OVMX_PRODUCT_VERSION V0.6-9 -> V0.6-10 and os-release VERSION_ID 0.6-9 -> 0.6-10.
Adds the V0.6-10 RELEASE_NOTES entry.

Ships three increments already merged to main (GCC-self-host + networking; NO
cluster-participation claim):
  - DECnet Phase IV NSP logical-link connection service (#1007, vms-c23): the
    connection FSM (CI/CC/data+ack/DI/DC) over the live datalink, proven on-wire.
  - VMS condition-handling CHF rung-3 (#1008, vms-1fa): real Alpha
    invocation-context primitives (LIB$GET_INVO_*), PDSC/RSA walk wired into
    unwind for anchorless-frame transfer.
  - CRTL->RMS veneer (#1010, vms-47e): C-RTL stdio routes to real RMS/ACP,
    proven by independent ODS-2 visibility (a genuine File ID + version a POSIX
    bootstrap cannot forge). Alpha port-image wiring = tracked follow-on vms-b4f.


Claude-Session: https://claude.ai/code/session_01V2jrHU9fdTTfKhB5HBQNQH

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant