SIMH TCP/IP networking on Raspberry Pi with Proxy ARP

1,344 views
Skip to first unread message

Upi Tamminen

unread,
Jan 20, 2019, 12:05:24 PM1/20/19
to [PiDP-11]

Hello,

I've spent the last few days experimenting with Johnny Billquist's TCP/IP stack for RSX-11M, and with various ways of networking SIMH on the Raspberry Pi. I think I've found the optimal setup for myself using Proxy ARP, so I thought I'd share it here. Networking can be a bit challenging to get right, and I'm not the best at explaining things, but I hope this will use useful to someone.

Rationale

First of all, I like to use TAP interfaces for networking, since they are full featured interfaces and can be used as non-root. The absolutely best way to configure networking for SIMH would be a bridge between WLAN0 and a TAP interface, and this is how I've done it on my normal SIMH setups. However, bridging is not possible with Raspberry Pi's WLAN interface.

Other options would be the builtin NAT functionality in SIMH, or a normal NAT setup between wlan0 and a tap interface (which I initially settled on).

With Proxy ARP, we can achieve pretty closely the same result as with a network bridge, where the IP address of the SIMH instance will appear in the same network as your Raspberry Pi. Some caveasts, though:
  • Since proxy arp relies on IP routing, DECnet won't work. DECnet over TCP/IP might work.
  • DHCP doesn't work without some extra relaying utilities.
  • It can be a bit mysterious to setup, if you're not experienced with linux or networking
Prerequisities

Install the required ubuntu packages:

$ sudo apt-get install parprouted uml-utilities

Decide an IP address for your simh instance, that's not conflicting with the DHCP pool or any other IP in your network. In my examples I will be using 192.168.0.17. Raspberry Pi can still obtain it's IP address via DHCP.

This setup assumes you're running simh manually as non-root user. The default install scripts for PiDP-11 currently run simh as root.

Setting up

Proxy ARP can be setup using standard procedures in Linux. An useful page to understand the basics is here:


If you do the setup manually, the static route needed for the Proxy ARP will disappear each time the link goes down (ie. you stop the SIMH process). For this reason, using parprouted is preferred.

On a standard Raspbian installation the setup can be done with the steps described below.

1) sysctl

Enable IP forwarding and proxy arp by uncommenting or adding the following settings in /etc/sysctl.conf:

net.ipv4.conf.all.proxy_arp=1
net.ipv4.ip_forward=1

Reboot to make the above changes active, or add them manually using sysctl from command line.

2) Configure TAP interfaces

Create a new file that defines your tap interface(s) (one per each networked simh instance you plan to run). For "simhuser", specify the username you will be running simh as.

Upon bringing up the tap interface, this configuration will:
  • create a tap interface, and assign it to a specific user
  • bring the link up
  • start parprouted
  • enable promiscous mode on wlan0, which is needed on Raspberry Pi for some reason
And upon bringing down the tap interface:
  • bring the link down
  • remove the tap interface
  • and due these steps, the parprouted process will automatically close
Create file: /etc/network/interfaces.d/tap:

auto tap-simh0
iface tap-simh0 inet manual
    pre-up tunctl -t tap-simh0 -u simhuser
    up ip link set tap-simh0 up
    up /usr/sbin/parprouted wlan0 tap-simh0
    up /sbin/ip link set wlan0 promisc on
    post-down ip link set tap-simh0 down
    post-down tunctl -d tap-simh0

auto tap-simh1
iface tap-simh1 inet manual
    pre-up tunctl -t tap-simh1 -u simhuser
    up ip link set tap-simh1 up
    up /usr/sbin/parprouted wlan0 tap-simh1
    up /sbin/ip link set wlan0 promisc on
    post-down ip link set tap-simh1 down
    post-down tunctl -d tap-simh1

Reboot to bring up the interfaces, or bring them up manually using ifup from command line.

3) Verify that everything is ok

$ ip addr show dev tap-simh0
4: tap-simh0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000

$ ps ax|grep parprouted
  412 ?        Ssl    0:03 /usr/sbin/parprouted wlan0 tap-simh0
 3480 ?        Ssl    0:00 /usr/sbin/parprouted wlan0 tap-simh1

$ sysctl net.ipv4.conf.all.proxy_arp; sysctl net.ipv4.ip_forward
net.ipv4.conf.all.proxy_arp = 1
net.ipv4.ip_forward = 1

$ ip link show wlan0 | grep --color PROMISC
3: wlan0: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DORMANT group default qlen 1000

4) Configure SIMH

I like to specify MAC address, especially when dealing with proxy ARP to make possible troubleshooting easier:

; Ethernet
set xu enable
set xu type=deuna
set xu mac=aa:00:04:00:0c:34
attach xu tap:tap-simh0
sho xu

5) Configure your SIMH instance

Use a static IP address. If things go okay, experiment with DHCP relays later. Details of installing RSX-11M+ or 2.11BSD are beyond the scope of this guide, but my install logs can be found here:


Enjoy! (or start troubleshooting)

Proxy ARP can be a challenge to figure out, if you're not familiar with routing or ethernet in general. Here's a checklist of things to check when facing issues:

Do you have any any iptables rules that might be causing issues?

$ sudo iptables -n -L; sudo iptables -n -t nat -L

Is parprouted running?

$ ps ax|grep parprouted
  412 ?        Ssl    0:03 /usr/sbin/parprouted wlan0 tap-simh0

When your simh instance has an IP address, has parprouted created the appropriate route?

$ ip route | grep '192.168.0.17.*tap'
192.168.0.17 dev tap-simh0 scope link metric 50

If you can't access the simh from your local network, can you still access it locally on the Raspberry Pi?

$ ping -c 1 192.168.0.17
PING 192.168.0.17 (192.168.0.17) 56(84) bytes of data.
64 bytes from 192.168.0.17: icmp_seq=1 ttl=255 time=27.8 ms

Did simh throw an error when trying to attach to the tap interface?

sim> attach xu tap:tap-simh0
Eth: open error - Device or resource busy

Rene Richarz

unread,
Sep 14, 2019, 9:10:18 AM9/14/19
to [PiDP-11]
I know this is an old post, but I'm just unable to get PROXY ARP to work with eth0 with my Raspberry Pi 4 based PiDP-11 using Raspbian Buster. It had worked before with a Raspberry Pi 3 and Raspbian Stretch.

Bottom of my /etc/sysctl.conf:
# proxy arp for PiDP-11
net.ipv4.conf.all.proxy_arp=1
net.ipv4.ip_forward=1

/etc/network/interfaces.d/tap:
auto tap-simh0
iface tap-simh0 inet manual
    pre-up tunctl -t tap-simh0 -u root
    up ip link set tap-simh0 up
    up /usr/sbin/parprouted eth0 tap-simh0
    up /sbin/ip link set eth0 promisc on
    post-down ip link set tap-simh0 down
    post-down tunctl -d tap-simh0

auto tap-simh1
iface tap-simh1 inet manual
    pre-up tunctl -t tap-simh1 -u root
    up ip link set tap-simh1 up
    up /usr/sbin/parprouted eth0 tap-simh1
    up /sbin/ip link set eth0 promisc on
    post-down ip link set tap-simh1 down
    post-down tunctl -d tap-simh1

Simh gives the following error:
sim>attach xu tap:tap-simh0
Non-existant device

tests on Raspbian:
$ip addr show dev tap-simh0
4: tap-simh0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether e2:b5:1d:01:2c:27 brd ff:ff:ff:ff:ff:ff
$ps ax|grep parprouted
  374 ?        Ssl    0:00 /usr/sbin/parprouted eth0 tap-simh0
  474 ?        Ssl    0:00 /usr/sbin/parprouted eth0 tap-simh1
 5668 pts/0    S+     0:00 grep --color=auto parprouted
$ip link show eth0 | grep --color PROMISC
2: eth0: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000

Any idea what the problem could be?

Adam Hall

unread,
Sep 20, 2019, 7:10:15 PM9/20/19
to [PiDP-11]

Am I right to assume that simhuser in  /etc/network/interfaces.d/tap should be the name of an actual user on your system?

Chase Covello

unread,
Sep 20, 2019, 7:40:41 PM9/20/19
to [PiDP-11]
Hi Adam,

Yes, that should be root to get it to work with the default pidp11 setup.

--Chase

Adam Hall

unread,
Sep 21, 2019, 11:43:14 AM9/21/19
to [PiDP-11]
Sorry, I am not that familiar with raspbian, but when you say root do you mean root or do you mean pi username?

Chase Covello

unread,
Sep 21, 2019, 12:04:23 PM9/21/19
to [PiDP-11]
Yes, literally 'root'. The PiDP-11 SIMH and console driver run as root. I'm guessing it's so they have direct access to the network interfaces and the Pi's GPIO pins. For the same reason, I think you need to set up the tap interfaces and parprouted as root so it can do the low-level promiscuous mode and ARP stuff.

It may be possible to run some of this stuff as a less-privileged user, but this is the easy way to do it. :)

--Chase

Johnny Billquist

unread,
Sep 21, 2019, 5:35:35 PM9/21/19
to Adam Hall, [PiDP-11]
root *is* a user.

Johnny


Adam Hall <jugdishm...@gmail.com> skrev: (21 september 2019 17:43:13 CEST)

--
Sent from my Android device with K-9 Mail. Please excuse my brevity.

Upi Tamminen

unread,
Sep 21, 2019, 5:48:44 PM9/21/19
to [PiDP-11]
The simh process can be run as normal user, only the console driver has to be run as root. The tap interfaces are nice because they can be assigned to a normal user.

It's perhaps a bit confusing that I wrote my guide for running simh as a normal user, because the default PiDP11 setup will be running simh as root. But I believe it should still work fine as root.

Another thing is that the Proxy ARP not really the easiest thing to troubleshoot, and it's only really necessary when using the WLAN interface. If you're using the ethernet interface, creating a normal network bridge (tap<->eth0) would be a much better choice.

Adam Hall

unread,
Sep 22, 2019, 11:37:36 AM9/22/19
to [PiDP-11]


On Saturday, 21 September 2019 14:35:35 UTC-7, Johnny Billquist wrote:
root *is* a user.

Johnny


I was saying pi which is a username. 

Johnny Billquist

unread,
Sep 22, 2019, 4:48:02 PM9/22/19
to pid...@googlegroups.com
And I'm saying that "root" is also a username. It is commonly associated
with a uid of 0, which is the thing that actually have the privileges,
and which is what the OS actually checks for. :-)

Johnny

--
Johnny Billquist || "I'm on a bus
|| on a psychedelic trip
email: b...@softjar.se || Reading murder books
pdp is alive! || tryin' to stay hip" - B. Idol
Reply all
Reply to author
Forward
0 new messages