Introduction
This page explains how to set up and use the Network Interface (NI) card and the Wollongong WIN/3B TCP/IP utilities under the 3B2 simulator.
Preparation
Prerequisites
To enable networking support, you must have development versions of
libpcap
installed.
macOS
$ brew install libpcap
Debian / Ubuntu Linux
# apt install libpcap-dev
CentOS / RedHat / Fedora Linux
# yum install libpcap-devel
Windows
The tools are included in the official SIMH windows-build
project, here:
https://github.com/simh/windows-build
Enabling the NI Board
Before you begin installing software, you should enable the NI board in your 3B2 SIMH configuration file.
Networking Options
For detailed information about all of these options, please see the Ethernet README file distributed with SIMH.
Direct Connection with LibPCAP (All Platforms)
This method provides a direct connection to your host’s physical Ethernet device. It allows you to link the simulated NI card to your actual Ethernet LAN.
Please note, this does not work with WiFi devices, because 802.11 is not quite Ethernet. It pretends to be, but it’s different.
NAT (SLiRP) Networking (All Platforms)
This method creates a private LAN that cannot be accessed directly by the outside world, but which does allow port-forwarding access.
tup/tap Networking (Linux / BSD only)
This method creates a virtual LAN that can be bridged to your host’s physical LAN.
Configuration File Changes
Background and Explanation
The 3B2/400 simulator currently supports three expansion boards:
CTC
: The Cartridge Tape Controller board.PORTS
: A board with four terminal serial lines.NI
: The 10Base5 Ethernet board.
The 3B2/400 has 12 expansion board slots, numbered 1 through 12. When you configure the 3B2 Simulator, it will fill these slots in order, starting with slot #1. The order specified in your configuration file determines the order that they are installed in the expansion slots!
Furthermore, the number of lines specified for the PORTS
device
determines how many pysical cards there are (they must be specified in
multiples of 4, since there are 4 per board).
So, for example, if your confuration file enables the boards in this order:
CTC
PORTS
with 8 lines (8 ÷ 4 = two cards)NI
The 3B2/400 will have the following slots populated:
Slot | Board |
---|---|
1 | CTC |
2 | PORTS |
3 | PORTS |
4 | NI |
Configuration
With all of the above in mind, you should add the following lines to your file, preferrably after the other cards (if any) have been enabled.
SET NI ENABLED
ATTACH NI <eth-device>
Change <eth-device>
to the the appropriate name, e.g. nat:
or eth0
or tap:tap0
, etc.
Expected Warnings
Please note that until drivers are installed, you will see the following alarming (but totally harmless) warning messages every time you boot your simulated 3B2.
UNKNOWN ID CODE 0x2 FOR DEVICE IN SLOT 4
EQUIPPED DEVICE TABLE COMPLETION WILL CONTINUE.
CHECK EDT.
Driver not found for *VOID* device (board slot 4)
Both of these will go away once the NI drivers are installed.
Setting Up TCP/IP
Setting up TCP/IP under System V Release 3 is a multistep process. A set of support drivers and libraries needs to be installed first, followed by the NI Ethernet drivers, and finally the TCP/IP drivers and utilities.
Install the Network Support Utilities
Before anything else, you’ll need to install the Networking Support Utilities. This package provides the STREAMS libraries and utilities necessary to support the NI and TCP/IP drivers.
Break into the simulator with the Ctrl-E
key, and at the sim>
prompt,
type:
sim> attach ifloppy Networking_Support_Utilities_3-2-2.img⏎
sim> c⏎
Back in UNIX, type:
# sysadm installpkg⏎
Install from diskette1
. This will install eight new kernel drivers
(CLONE, LOG, TIMOD, TIRDWR, PTM, PTS, PTEM,
and LDTERM), so you will need to reboot afterward with
shutdown -i6 -g0 -y⏎
Install the Network Interface Drivers
Next, it’s time to install the actual Network Interface Ethernet driver. This provides the low level driver (NI).
Break into the simulator with the Ctrl-E
key, and at the sim>
prompt, type:
sim> attach ifloppy Network_Interface_Drivers_1-1.img⏎
sim> c⏎
Back in UNIX, type:
# sysadm installpkg⏎
Install from diskette1
.
Configuration
During installation, you’ll be asked to assign a physical Ethernet (MAC) address to your card.
A network physical address must be assigned to each NI board in the system.
If no address is assigned, access to that board's network will not be possible.
As many as 10 NI boards may be installed, and a network physical address may
be assigned to a board number whether or not that board is currently installed,
to reserve network physical addresses for boards to be installed in the future.
Each assigned address must be unique both on this system and with respect to
all other hosts on the same local area network. You will be permitted to
assign the last 4 hexadecimal digits of the address (the first 8 are assigned
by this utility).
Currently there is 1 NI board installed in this system.
Enter RETURN to continue, or q to quit:
...
Current NI Network Physical Address Assignments:
Board Major Device State Network Physical Address
----- ------------ ----- ------------------------
0 4 -- Not assigned
1 NONE -- Not assigned
2 NONE -- Not assigned
...
Press 0
to assign a MAC address to the first card (Note: The Major
Device corresponds to the slot number where the board is installed).
ALL addresses begin with the prefix 80:00:10:03
. You only need to
provide the last four digits (without the colon separators). For example,
0123 or abcd.
In my installation, I (randomly) chose 1158, so the address for my card is
80:00:10:03:11:58
.
After configuration, you’ll get a confirmation:
Board Major Device State Network Physical Address
----- ------------ ----- ------------------------
0 4 -- 800010031158
1 NONE -- Not assigned
2 NONE -- Not assigned
...
Just type q
to quit.
Reboot
After your card is configured, you can reboot to enable the new NI kernel driver.
# shutdown -i6 -g0 -y⏎
Install the Enhanced TCP/IP WIN/3B Interface
This step installs all of the Wollongong WIN/3B TCP/IP drivers and utilities.
- Wollongong Integrated Networking WIN/3B: Release 3.2, Disk 1
- Wollongong Integrated Networking WIN/3B: Release 3.2, Disk 2
- Wollongong Integrated Networking WIN/3B: Release 3.2, Disk 3
- Wollongong Integrated Networking WIN/3B: Release 3.2, Disk 4
- Wollongong Integrated Networking WIN/3B: Release 3.2, Disk 5
- Wollongong Integrated Networking WIN/3B: Release 3.2, Disk 6
Break into the simulator with the Ctrl-E
key, and at the sim>
prompt, type:
sim> attach ifloppy Wollongong_TCP-IP_3-2_1.img⏎
sim> c⏎
Back in UNIX, type:
# sysadm installpkg⏎
Install from diskette1
.
This is a six-disk install, so you’ll need to repeatedly break into
the simulator with Ctrl-E
and attach subsequent disks until all 6
disks have been installed.
Drivers Installed
The following drivers are installed.
ARP, CIRC, IP, LOOP, RAW, TCP, TTY_PTC, TTY_PTS, UDP, W_
Configuration
When the sixth disk is installed, you’ll be prompted to configure your network.
Some notes:
- You probably don’t want to run a nameserver on the host.
- If you want to use DNS as a client, answer yes to do you wish to run this host as a resolver?
- When asked for the host’s network number, enter the network portion of
the IPv4 address only. For example, if your LAN is
192.168.10.0/24
, enter192.168.10
. - When asked for the host’s network address, enter the full IPv4 address,
e.g.
192.168.10.100
- You really don’t want the ROUTE daemon running unless you’re doing something very special.
- You’ll be asked how many pseudo tty’s you want enabled. This will determine the number of users that can be connected at the same time. Each pseudo TTY takes some memory, so keep that in mind.
Example Configuration Session
do you wish to run the nameserver on this host? [y, n]: n
do you wish to run this host as a resolver? [y, n]: y
enter the name of your domain> example.com
your domain is: (example.com) is this what you want? (default n) [y, n]: y
enter the addresses of nameservers you wish to resolve to: (type q when done)
> 192.168.0.1
the address of the nameserver is: (192.168.0.1) is this what you want? (default n) [y, n]: y
entering 192.168.0.1 into /etc/resolv.conf
> q
enter host's network number> 192.168.0
your host's net number is: (192.168.0) is this what you want? (default n) [y, n]: y
enter name of network host is on> somenet
your host's net name is: (somenet) is this what you want? (default n) [y, n]: y
enter aliases your network is known by>
enter host's internet address> 192.168.0.123
your host's address is: (192.168.0.123) is this what you want? (default n) [y, n]: y
Host's official name is unix
enter alias names host will be known by>
do you want to enter other hosts into your /etc/hosts file? [y, n]: y
enter internet address, official host name, and aliases (type q when done)
> 192.168.0.100 example1
(192.168.0.200 example1 ) is this what you want? (default n) [y, n]: y
> 192.168.0.101 example2
(192.168.0.201 example2 ) is this what you want? (default n) [y, n]: y
> q
do you wish to have TFTP daemon enabled? [y, n]: n
do you wish to have ROUTE daemon enabled? [y, n]: n
do you wish to have FTP daemon logging enabled? [y, n]: y
how many pseudo ttys do you wish to have? (default 8) [1-64]: 8
creating 8 pseudo ttys, is this what you want? (default n) [y, n]: y
Setting up the WIN/3B network. Please wait.......
The default broadcast address for WIN/3B release 3.0.1 is 1's as per RFC919
See ifconfig(1M) to change the broadcast value
The WIN/3B network has been installed.
Reboot the system with the 'reboot' option of
the sysadm 'machinemgmt' menu.
You may now remove the medium from the diskette1 drive.
After all of this is done, reboot again
# shutdown -i6 -g0 -y⏎
Testing
Be aware that with LibPCAP networking, you WILL NOT be able to talk to the SIMH host’s IP address! The simulator and the Ethernet device of the SIMH host cannot see each other.
If all goes well, once you’ve rebooted, you should be able to ping
something else on your LAN. If you’re using NAT, you should be able to
ping the gateway at 10.0.2.2
. If you’re using LibPCAP, you should be
able to ping your LAN’s gateway.
# /usr/etc/ping 192.168.0.1
PING 192.168.0.1: 56 data bytes
64 bytes from 192.168.0.1: icmp_seq=0. time=43 100th of sec
64 bytes from 192.168.0.1: icmp_seq=1. time=3 100th of sec
64 bytes from 192.168.0.1: icmp_seq=2. time=3 100th of sec
64 bytes from 192.168.0.1: icmp_seq=3. time=1 100th of sec
64 bytes from 192.168.0.1: icmp_seq=4. time=2 100th of sec
64 bytes from 192.168.0.1: icmp_seq=5. time=4 100th of sec
64 bytes from 192.168.0.1: icmp_seq=6. time=1 100th of sec
64 bytes from 192.168.0.1: icmp_seq=7. time=1 100th of sec
64 bytes from 192.168.0.1: icmp_seq=8. time=2 100th of sec
64 bytes from 192.168.0.1: icmp_seq=9. time=1 100th of sec
64 bytes from 192.168.0.1: icmp_seq=10. time=1 100th of sec
----192.168.0.1 PING Statistics----
11 packets transmitted, 11 packets received, 0% packet loss
round-trip (100th of sec) min/avg/max = 1/5/43
#
Updating your PATH
You may have noticed that ping
is installed in /usr/etc
. You may want
to add this directory to your PATH environment variable.
Setting a Default Gateway
If you want to talk to hosts outside your LAN, you’ll need to set a default gateway.
Edit the file /etc/init.d/win3b
. Find the section that says:
#
# Put ifconfig commands here
#
Immediately after that, add the following line:
/usr/etc/route add default <your-gateway-ip> 1
Replace <your-gateway-ip>
with the correct gateway or router address
for your LAN.
Tuning the WIN/3B TCP/IP Stack
Increase TTL
The default TTL for IP packets in WIN/3B is 15 (0x0f
), which is very
small. It will usually work fine on a LAN, but as soon as you need
to send packets across a WAN, it’s very likely to fail. Modern
practice suggests setting this to 64 (0x40) and start tuning from
there, as needed.
To change the TTL, edit the file /etc/master.d/ip
, and change
the following lines from:
IP_TTL = 0x0f
to:
IP_TTL = 0x40
To make the change take effect, you will need to run a few commands:
# cd /boot
# mkboot IP
# cd /
# touch /etc/system
# shutdown -i6 -g0 -y
Increasing TCP Window Size
The TCP window size in WIN/3B is also very small by today’s standards. It’s worthwhile to increase the TCP window for better performance and for fewer bugs.
To change the TCP window, edit the file /etc/master.d/tcp
, and change
the following lines from:
MAXQLEN = 12
WINDOW = 4096
MAXTCPWIN = 8192
MINTCPWIN = 512
To:
MAXQLEN = 24
WINDOW = 32768
MAXTCPWIN = 65535
MINTCPWIN = 32768
To make the change take effect, you will need to run a few commands:
# cd /boot
# mkboot TCP
# cd /
# touch /etc/system
# shutdown -i6 -g0 -y
Note that on a small 3B2 system, one with 1MB or 2MB of ram, for example, this change can eat some serious memory. It’s best to only make this change with a system running a full 4MB.
Known Problems with WIN/3B TCP/IP
The TCP/IP software for the 3B2 is notoriously flaky. You may encounter serious issues when using it. These issues are not bugs in the 3B2 simulator, but rather, bugs in the TCP/IP stack itself. They occur on a real 3B2 in exactly the same way.
Some of them, for example Duplicate ACKs, you won’t normally notice, but
become evident when monitoring the network with a utility such as
tcpdump
or Wireshark
.
- Duplicate ACKs
- Extremely Slow
telnetd
- FTP Server Often Hangs
- Zero Window ACKs