DECnet-VAX Phase V WAN connectivity with simh

Installing VMS and DECnet-Plus

HP's VMS Hobbyist program used to make the VMS 7.3 distribution CD available as an ISO image file. While there is no longer an official hobbyist program, I would imagine that the CD image is findable if you look hard enough.

Once in possession of an image of the VAXVMS073 CD, you can install it using your simh configuration of choice, which must have a Qbus or Unibus. 

There are plenty of examples out there to help with VMS installation, but if starting from scratch, you boot from the CD; use standalone backup to expand saveset B onto your normal boot medium, then boot as normal and go through the installation dialogue.  During the installation you should choose to install DECnet-Plus (aka Phase V).

Here's an example: https://raymii.org/s/blog/OpenVMS_7.3_install_log_with_simh_vax_on_Ubuntu_16.04.html

To make the system fully useful, you'll need a valid license loaded for at least VAX-VMS and DVNETEND (endnode) or DVNETRTG (router).  Once again, HP no longer provide these, but you can either use an old license and set the system date in the past, or try googling for pakgen.c...

Once you have got the installation up and running, log in to the SYSTEM account, and use 

$ @SYS$MANAGER:NET$CONFIGURE

to configure DECnet-Plus. An example dialog follows. This was done on an already-configured system, so it comes up with some useful defaults, but it should be reasonably clear what to do in a fresh installation.  I found that the configuration failed if I booted the system without an Ethernet device, so you will probably end up with an Ethernet routing circuit configured. You'll need to turn this off, or just boot without an Ethernet device, when you want to try out the WAN device (unless you configure the system as a router).

$ @net$configure
Copyright Compaq Computer Corporation 2000. All rights reserved.

        DECnet-Plus for OpenVMS network configuration procedure

    This procedure will help you create or modify the management scripts
    needed to operate DECnet on this machine. You may receive help about
    most questions by answering with a question mark '?'.

     Configuration last run by TREVOR on 29-MAR-2022 12:31:28.13

%NET$CONFIGURE-I-USECOMMON, using cluster common APPLICATION script
%NET$CONFIGURE-I-USECOMMON, using cluster common EVENT script
%NET$CONFIGURE-I-USECOMMON, using cluster common MOP_CLIENT script

        The following NCL script files have been modified since being
        created by this procedure:

                SYS$SPECIFIC:[SYSMGR]NET$ROUTING_STARTUP.NCL;
                SYS$SPECIFIC:[SYSMGR]NET$DDCMP_STARTUP.NCL;
                SYS$SPECIFIC:[SYSMGR]NET$MODEM_STARTUP.NCL;
                SYS$SPECIFIC:[SYSMGR]NET$MOP_CIRCUIT_STARTUP.NCL;
                SYS$COMMON:[SYSMGR]NET$MOP_CLIENT_STARTUP.NCL;

        This procedure may create a new version of these scripts or modify
        information contained within them. In all cases, any previously
        created NCL scripts are renamed to "file.NCL-OLD", so that you
        may review any of your previous changes.



        Configuration Options for Node TOGATH

        [0]     Exit this procedure

        [1]     Perform an entire configuration
        [2]     Change naming information
        [3]     Configure Devices on this machine
        [4]     Configure Transports
        [5]     Configure Timezone Differential Factor
        [6]     Configure Event Dispatcher
        [7]     Configure Application database
        [8]     Configure MOP Client database
        [9]     Configure Cluster Alias
        [10]    Replace MOP Client configuration

* Which configuration option to perform?                 [1] : 1
* Enter the directory services to use on the system  [LOCAL] :
* Enter the full name for directory service LOCAL [local:.togath] :
* What is the synonym name for this node?           [TOGATH] :
* What type of node (Endnode or Router)?           [ENDNODE] :
* Enter PhaseIV Address                             [29.452] :
* Do you want to configure Wide Area devices?          [YES] :

          This is the Configuration Procedure for the
          ===========================================

         VAX Wan Device Drivers for DECnet/OSI for VMS
         =============================================

  The Wide Area Network Datalinks and Drivers are  a  prerequisite
  for  DECnet/OSI.  They  also  provide  synchronous  datalinks in
  systems that do not use DECnet/OSI for networking.


  Access to DECnet/OSI datalinks (created by NCL) is  possible via
  the QIO interface to the WAN pseudo-driver, WANDRIVER.   Layered
  products  that use synchronous devices  do not  normally require
  programming  access to WANDRIVER.  For  further information, see
  the "DECnet/OSI for VMS WANDD Programming" guide.

Do you wish to use WANDRIVER [N] ? y
Will you use DEC HDLC [Y] ?
Will you use LAPB/E (VAX P.S.I. requires LAPB/E) [Y] ?

  The DSV11 (Q-bus), DIV32 (Q-bus), DSB32 (BI-bus), DSF32 (MI-bus) and
  DSW devices are soft-loadable. The WANDD startup procedure will load
  the microcode for these devices if required.

Do you have any soft-loadable microcode devices on this system [N] ?
Will you use the VAXft DSF32 device driver [N] ?
Are you satisfied with the answers you have given [Y] ?

  If you have already started up the  WAN  Drivers  and  Datalinks
  (that    is,    if    you    have   already   successfully   run
  SYS$STARTUP:WANDD$STARTUP.COM  since  your   system   was   last
  booted),  then  you will need to reboot your system for your new
  configuration to take effect.

%NET$CONFIGURE-I-SCANCONFIG, scanning device configuration - please wait

Determining DTSS timezone rules from OpenVMS information...


           Answer YES to the next question if you wish to
           change the current NSP transport configuration:

           Maximum number of logical links:     200
           Maximum Transmit and Receive Window: 20
           Maximum Receive Buffers:             4000
           Flow Control Policy:                 Segment Flow Control

* Do you want to replace the existing NSP transport script? [NO] :

           Answer YES to the next question if you wish to
           change the current OSI transport configuration:

           Maximum number of logical links:     200
           Maximum Transmit and Receive Window: 20
           Maximum Receive Buffers:             4000
           OSI applications over TCP/IP:        Enabled
           DECnet applications over TCP/IP:     Enabled

* Do you want to replace the existing OSI transport script? [NO] :
%NET$CONFIGURE-I-EVDFND, Event Dispatcher NCL script already exists
* Replace Event Dispatcher NCL script file?             [NO] :
%NET$CONFIGURE-I-APPLICATIONFND, application NCL script already exists
* Replace application script file?                      [NO] :

        Summary of Configuration

 Node Information:

        Node Type:              ENDNODE
        Directory Services Chosen:      LOCAL
        Primary Directory Service:      LOCAL
        Local Full name:        local:.togath
        Node Synonym:           TOGATH
        Phase IV Address:       29.452
        Phase IV Prefix:        49::
        Autoconfiguration of Network Addresses: Enabled
        Session Control Address Update Interval:        10
        Routing ESHello Timer:  600
        Routing ES Cache Size:  512

 Device Information:

        Device: XEA0 (DEUNA/DELUA):
                Data Link name: CSMACD-0
                Routing Circuit Name:   CSMACD-0

 Transport Information:

        NSP Transport:                    Configured
           Maximum number of logical links:     200
           Maximum Transmit and Receive Window: 20
           Maximum Receive Buffers:             4000
           Flow Control Policy:                 Segment Flow Control

        OSI Transport:                    Configured
           Maximum number of logical links:     200
           Maximum Transmit and Receive Window: 20
           Maximum Receive Buffers:             4000
           OSI applications over TCP/IP:        Enabled
           DECnet applications over TCP/IP:     Enabled

        Congestion Avoidance Disabled

 Event Dispatcher Configuration:

        Sinks:            local_sink
        Outbound Streams: local_stream
        Phase IV Relay:   Enabled

* Do you want to generate NCL configuration scripts?   [YES] :
%NET$CONFIGURE-I-MODCHECKSUM, checksumming NCL management scripts modified by NET$CONFIGURE
%NET$CONFIGURE-I-NOTREPLACED, SYS$COMMON:[SYSMGR]NET$APPLICATION_STARTUP.NCL; was not replaced
%NET$CONFIGURE-I-NOTREPLACED, SYS$COMMON:[SYSMGR]NET$EVENT_STARTUP.NCL; was not replaced
%NET$CONFIGURE-I-FLUSHCACHE, flushing selected cache entries

Node 0
at 2022-06-16-18:27:10.930+01:00Iinf

%NET$CONFIGURE-I-NODERENAMED, node successfully renamed to local:.togath

Node 0 Session Control
at 2022-06-16-18:27:13.130+01:00Iinf


Node 0 Session Control
at 2022-06-16-18:27:13.170+01:00Iinf


Node 0 Session Control
at 2022-06-16-18:27:13.260+01:00Iinf


Node 0 Session Control
at 2022-06-16-18:27:13.340+01:00Iinf


Node 0 Session Control
at 2022-06-16-18:27:14.370+01:00Iinf

Characteristics

    Maintain Backward Soft Links      = True


Directory Service: Local name file

Node name:         LOCAL:.TOGATH
Phase IV synonym:  TOGATH

Address tower protocol and selector values:
  Session:   DNA_SessionControlV2 (SC2)
             00 13
  Transport: DNA_OSItransportV1 (TP4)
             DE C0
  Routing:   DNA_OSInetwork (CLNS)
             49::00-1D:AA-00-04-00-C4-75:21 (29.452)

  Session:   DNA_SessionControlV2 (SC2)
             00 13
  Transport: DNA_NSP (NSP)
             (no selector value)
  Routing:   DNA_OSInetwork (CLNS)
             49::00-1D:AA-00-04-00-C4-75:20 (29.452)


Number of nodes reported on:  1

%NET$CONFIGURE-I-NODEISREG, node is already registered in the LOCAL directory service

Node 0
at 2022-06-16-18:27:16.180+01:00Iinf

%NET$CONFIGURE-I-NODERENAMED, node successfully renamed to local:.togath
%NET$CONFIGURE-I-CONFIGCOMPLETED, DECnet-Plus for OpenVMS configuration completed
%NET$CONFIGURE-I-USECOMMON, using cluster common APPLICATION script
%NET$CONFIGURE-I-USECOMMON, using cluster common EVENT script
%NET$CONFIGURE-I-USECOMMON, using cluster common MOP_CLIENT script


        Configuration Options for Node TOGATH

        [0]     Exit this procedure

        [1]     Perform an entire configuration
        [2]     Change naming information
        [3]     Configure Devices on this machine
        [4]     Configure Transports
        [5]     Configure Timezone Differential Factor
        [6]     Configure Event Dispatcher
        [7]     Configure Application database
        [8]     Configure MOP Client database
        [9]     Configure Cluster Alias
        [10]    Replace MOP Client configuration

* Which configuration option to perform?                 [0] : 0

Configuring simh and VMS

Simh only supports two synchronous interfaces that are also supported by DECnet-Plus, which are the DUP11 and DPV11. Neither of these are auto-enabled in simh, and nor do they auto-configure in VMS.  You will need lines such as the following in your simh configuration file, to enable one or other device, and tell simh to connect to a particular IP address with UDP, and a specific port on both ends.  At the other end of the link you could have a PyDecnet router, or another simh node.

I prefer using UDP for these simulated connections as it's easier to use tcpdump to debug issues, and arguably UDP's non-guaranteed-delivery semantics are more analagous to a real WAN link than using TCP.

set dup ena
attach dup connect=192.168.0.12:12346,12346,udp

OR

set dpv ena
attach dpv connect=192.168.0.12:12348,12348,udp

In order to enable the device in VMS, the relevant device driver, SEDRIVER has to be loaded. To work out the correct SYSGEN CONNECT command, look at the DUP /DPV in simh, and match this up to what VMS sees. You're looking for a device with four 16 bit registers, with the last virtual address byte matching the last byte shown by simh. 

From the below, you can see that on this system, the DUP11 is mapped to Unibus address 760050 on the Unibus adapter numbered 3.

sim> show dup
DUP     address=2013E028-2013E02F*, vector=C0-C4*, BR5, lines=1
        attached to Line=0,12346,Connect=192.168.0.12:12346, speed=0 (unrestricted), No Corruption
        W3 Jumper Installed, W5 Jumper Removed, W6 Jumper Installed

$ mcr sysgen
SYSGEN>  SHOW /UNIBUS

 ** UNIBUS map for nexus #3 on 16-JUN-2022 17:45:30.54 **

 Address 760050 (83488E28) responds with value 0200 (hex)
 Address 760052 (83488E2A) responds with value 0000 (hex)
 Address 760054 (83488E2C) responds with value 0080 (hex)
 Address 760056 (83488E2E) responds with value 0000 (hex)

 Address 760354 (83488EEC) responds with value 0000 (hex)
 Address 760356 (83488EEE) responds with value 0000 (hex)

 Address 760500 (83488F40) responds with value 404F (hex)
...

The following SYSGEN command will be needed to load the driver in VMS. These commands can be put into SYS$MANAGER:SYCONFIG.COM so that it loads at boot time 

$ mcr sysgen
CONN SEA0 /ADA=3 /VEC=%XC0 /CSR=%O760050 /numvec=2

After all that, we are nearly there... The WAN device needs to be configured using NCL. If you're not used to the NCL syntax, it is horribly verbose compared to NCP. I've included the full syntax below, but terms can usually be shorted to four unique characters to reduce keyboard wear.

If you already have an Ethernet circuit, you can turn it off as follows:

$ mcr ncl disable csma-cd station *

We need to create a Modem Connect Line to represent the PHY layer, and a DDCMP Link and Logical Station to represent the Datalink layer, and then a Routing Circuit to run over all that.  


$ mcr ncl
create modem connect line ddcmp-0 communication port sea0
set modem connect line ddcmp-0 modem control none
create ddcmp link ddcmp-0 protocol point
create ddcmp link ddcmp-0 logical station ddcmp-0
set ddcmp link ddcmp-0 phys line modem connect line ddcmp-0
enable ddcmp link ddcmp-0
enable ddcmp link ddcmp-0 logical station ddcmp-0
create routing circuit ddcmp-0 type ddcmp
set routing circuit ddcmp-0 data link entity ddcmp link ddcmp-0 logical station ddcmp-0
enable routing circuit ddcmp-0
enable modem connect line ddcmp-0

If it worked, you should see some Event Logger output on the system console showing circuit and adjacency state changes.  

If not, there are some tools you can use to debug it.

Status information can be displayed:

NCL>show ddcmp link ddcmp-0 logi stat * all

Node 0 DDCMP Link ddcmp-0 Logical Station ddcmp-0
at 2022-06-17-11:21:04.890+01:00Iinf

Identifiers

    Name                              = ddcmp-0

Status

    UID                               = 20995E20-EE27-11EC-8005-AA000400C475
    State                             = On
    Protocol State                    = Running

Characteristics

    Address                           = 1
    Babble Timer                      = 6000
    Maximum Transmit                  = 4
    Holdback Timer                    = 0
    Transmit Window                   = 1

Counters

    Creation Time                     = 2022-06-17-11:20:35.970+01:00Iinf
    NAKs Received Indicating Header Block Check Error = 0
    NAKs Received Indicating Data Field Block Check Error = 0
    NAKs Received Indicating REP Response = 0
    PDUs Received with Header Block Check Errors = 0
    PDUs Received With Data Field Block Check Error = 0
    NAKs Sent With REP Response       = 0
    Local Reply Timeouts              = 0
    Remote Reply Timeouts             = 0
    Buffers Temporarily Unavailable   = 0
    Buffers Too Small                 = 0
    NAKs Received Indicating Buffers Temporarily Unavailable = 0
    NAKs Received Indicating Buffer Too Small = 0
    No Replies To Select              = 0
    Incomplete Replies To Select      = 0
    SDUs Sent                         = 14
    SDUs Received                     = 16
    Selection Intervals               = 0
    SDU Octets Sent                   = 337
    SDU Octets Received               = 535
    Send Error Thresholds Reached     = 0
    Receive Error Thresholds Reached  = 0
    Selection Error Thresholds Reached = 0
    Locally Initiated State Changes   = 0
    Remotely Initiated State Changes  = 0
    STRTs Received While In Maintenance = 0

NCL>
NCL>show routing circuit * all

Node 0 Routing Circuit ddcmp-0
at 2022-06-17-11:22:11.890+01:00Iinf

Identifiers

    Name                              = ddcmp-0

Status

    UID                               = 20D66720-EE27-11EC-8005-AA000400C475
    State                             = On
    Data Link SDU Size                = 576
    Data Link Port                    = DDCMP Port $0

Characteristics

    Type                              = DDCMP
    Template                          = ""
    Data Link Entity                  = DDCMP Link ddcmp-0 Logical Station ddcmp
-0
    Manual Data Link SDU Size         = 1492
    Explicit Receive Verification     = True
    Recall Timer                      = 60
    write only attribute: Transmit Verifier = <Default value>
    write only attribute: Receive Verifier = <Default value>

Counters

    Verification Rejects              = 0
    Data PDUs Received                = 15
    Data PDUs Fragmented              = 0
    Data PDUs Transmitted             = 12
    Segmentation Failure Discards     = 0
    Circuit Changes                   = 1
    Changes in Adjacency State        = 1
    ID Reachability Changes           = 0
    Initialization Failures           = 0
    Rejected Adjacencies              = 0
    Control PDUs Sent                 = 2
    Control PDUs Received             = 2
    Corrupted Hello PDUs Received     = 0
    Creation Time                     = 2022-06-17-11:20:36.370+01:00Iinf

NCL>
NCL>show routing circuit  ddcmp-0 adjacency * all

Node 0 Routing Circuit ddcmp-0 Adjacency RTG$0001
at 2022-06-17-11:22:45.090+01:00Iinf

Identifiers

    Name                              = RTG$0001

Status

    Type                              = Autoconfigured
    State                             = Up
    Neighbor Node Type                = Phase IV Router
    Router NETs                       =
       {
          49::00-1D:AA-00-04-00-D5-75:00 (LOCAL:.TWPD)
       }

DECnet-Plus has its own equivalent of tcpdump/Wireshark, called CTF.  "TRACE HELP" will tell you all about it.  

$ trace start "modem_connect line *"
$ ! do something to generate traffic
$ trace stop
$ trace analyze

OR to look at it live:

$ trace start/live "ddcmp link ddcmp-0"

DPV11 Postscript

Unfortunately, the DPV11 support in SEDRIVER is slightly buggy. In a few places, it performs byte write accesses to the device CSRs when it ought to use word access. Without the patch below, you will see occasional header or data CRC errors whenever a received frame is processed by the simulator while in the middle of a transmitting a frame. 

I'm not sure why this issue wasn't spotted during original development or testing, because someone did take the trouble to change the DUP11 part of the driver to fix the same problem ! Perhaps on DPV11 hardware, the timing worked out so that either the issue didn't happen, or was very rare. 

Create a DCL command file with the following contents, run it once only, reboot, and you will have a DPV11 driver that works better.  Note that this patch only works on the VMS 7.3 version of the driver.

$ patch sys$loadable_images:sedriver.exe /absolute
repl/inst 3f25
'MOVB    (R7),B^07(R0)'
exit
'NOP'
exit
repl/inst 3f30
'MOVB    (R10),B^06(R0)'
exit
'MOVW    (R10),B^06(R0)'
exit
repl/inst 3ec8
'MOVB    (R10),B^06(R0)'
exit
'NOP'
exit
repl/inst 3ed8
'MOVB    (R7),B^07(R0)'
exit
'MOVW    (R10), B^06(R0)'
exit
repl/inst 3ef9
'MOVB    (R10),B^06(R0)'
exit
'NOP'
exit
repl/inst 3f0b
'MOVB    (R7),B^07(R0)'
exit
'MOVW    (R10), B^06(R0)'
exit
update

Comments

Popular posts from this blog

Time Electronics 9814 Programmable Voltage Calibrator

DECnet-VAX Phase V P.S.I. configuration in open_simh