• Updated 2023-07-12: Hello, Guest! Welcome back, and be sure to check out this follow-up post about our outage a week or so ago.

TashRouter: An AppleTalk Router

shirsch

Well-known member
Interesting. I have a tap/tun setup here and in mine eth0 does not get an IP address:
Code:
root@tashtalk:~/tashrouter# ifconfig
br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.245.48  netmask 255.255.255.0  broadcast 192.168.245.255
        inet6 fe80::8eae:4cff:fed2:c66f  prefixlen 64  scopeid 0x20<link>
        ether 8c:ae:4c:d2:c6:6f  txqueuelen 1000  (Ethernet)
        RX packets 303087  bytes 93720400 (89.3 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 48346  bytes 8779890 (8.3 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 8c:ae:4c:d2:c6:6f  txqueuelen 1000  (Ethernet)
        RX packets 324604  bytes 102247624 (97.5 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 52658  bytes 9256121 (8.8 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 12  bytes 1698 (1.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 12  bytes 1698 (1.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

tap2: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether e6:9c:d9:28:31:fd  txqueuelen 1000  (Ethernet)
        RX packets 3720  bytes 226527 (221.2 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 4503  bytes 484339 (472.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 8e:f3:39:f7:9c:58  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
I don't think multiple devices are supposed to have the same IP address, but I'm not a networking expert.
 

shirsch

Well-known member
Just for completeness' sake, here is the configuration for my Gatorbox (which has NOT been running during the captures I posted above). I'm getting ready to capture localtalk traffic between the Apple IIe and the server.
Code:
Configuration Information for GatorBox "Gator_Hirsch"...
Tue, Mar 12, 1996  2:03 PM


 TCP/IP Configuration:
  
   IP Network connection
          Ethernet:
          Address 192.168.245.89, network mask 255.255.255.0, broadcast 255.255.255.255
          
   RIP:
          Disabled
          
   Syslog:
          Logging with syslogd enabled
          Syslog host at 192.168.245.30
          Syslog facility set to 'Local0'
          
   No default gateway information
          
          
 AppleTalk Routing Configuration:
  
   Phase 2 LocalTalk
          Configured as a softseed port
          Network number 256
          Zone name 'LocalTalk2ZoneA'
          
   Phase 2 EtherTalk
          Configured as a softseed port
          Network range 1 to 255 (router on net 1)
          Zone name 'LocalTalk2ZoneA' (default)
          
          
 DECNet Routing: disabled.
  
 IPX Routing: no configuration.
  
 SNMP Configuration:
  
   System contact:
   System location:
   Authentication Traps: disabled
   Community Names:
          public
                    read-only
          
          
 GatorPrint: no configuration.
 Server Access: no configuration.
 

RolandJuno

Active member
Interesting! Thanks for pointing that out. I'm making a guess here that it's because of dhcpd still running. I disabled it on the MacIPRpi image with

sudo systemctl stop dhcpcd.service sudo systemctl disable dhcpcd.service

Now eth0 doesn't get an IP address assigned. Unfortunately, this didn't change the beavhior. In Mini VMac Chooser in the EtherTalk Zone, I still only either see the HP LaserJet 4000 or the MacIPRpi netatalk suite of services-- not both. Puzzling!

Some good news: I figured out that the MacIPRpi can in fact see the Mini VMac on the LToUDP Network. When I use nbplkup it only scans one zone. So I used the following one liner to lookup devices in all zones. Hope it's useful for someone.

getzones | while read line ; do echo "$line zone:" ; nbplkup "@$line" ;done

EtherTalk Network zone: UTC:TimeLord 4.171:133 LocalTime:TimeLord 4.171:131 MacIPpi:AFPServer 4.171:129 172.16.2.1:IPGATEWAY 4.171:72 MacIPiRpi:netatalk 4.171:4 MacIPiRpi:Workstation 4.171:4 HP LaserJet 4000 Series:SNMP Agent 3.128:8 HP LaserJet 4000 Series:LaserWriter 3.128:157 HP LaserJet 4000 Series:HP LaserJet 3.128:158 HP LaserJet 4000 Series:HP Zoner Responder 3.128:154 LToUDP Network zone: mini vmac:AFPServer 1.8:251 mini vmac:SNMP Agent 1.8:8 mini vmac:PPCToolBox 1.8:252 mini vmac: Macintosh 1.8:253 mini vmac:Workstation 1.8:4 TashTalk Network zone:
 

shirsch

Well-known member
@tashtari - Here is a localtalk trace of the IIe connecting to the netatalk server over the Gatorbox (no TashTalk active). In this situation it stays connected as long as one would wish.

There are numerous filter options and other tools that can be used for this, so let me know if it's decipherable?
 

Attachments

  • lt_trace1.zip
    19.8 KB · Views: 1

NJRoadfan

Well-known member
@RolandJuno If TashRouter and netatalk's atalkd are both running on the machine and seeding the same interface, there may be conflicts between the two.

@tashtari Inside AppleTalk page 4-17 implies that DDP checksums are optional. Given that LLAP already has a packet checksum, it might be safe to ignore the invalid DDP checksums. Its kind of maddening that Apple themselves doesn't follow their own specifications and just send all zeros for the field. Best I can tell with the IWLT card is that if it receives "short" packets, it sends back to the sender in the header since a programmer saw a code optimization and took that route, since why would a router be sending "short" packets? I really need to pull out my Fastpath 5 and see what type of DDP packets it serves LocalTalk clients.

I'll get the TAP configuration up later tonight.
 

RolandJuno

Active member
@RolandJuno If TashRouter and netatalk's atalkd are both running on the machine and seeding the same interface, there may be conflicts between the two.
I thought of that too, but I don't think atalkd is set to be a router/seed. From what I can see, it's just a node. This is from the atalkd.conf file:

br0 -phase 2 -net 3-5 -addr 4.171 -zone "EtherTalk Network"
 

NJRoadfan

Well-known member
I suspect there is still an issue with running both on the same machine. I run into similar problems when I run a VM with netatalk with bridged networking, and an emulator that uses pcap style injection on the same machine. Your switch isn't doing "hairpin" routing of packets.
 

NJRoadfan

Well-known member
OK, here is my TashRouter/netatalk on the same machine setup. This configuration assumes an Ethernet adapter is present at "eth0". This REQUIRES Netatalk 2.3.1, or atalkd compiled with the split horizon patch! Otherwise packets won't be routed correctly over atalkd between networks.

First off, you need to create a tap interface, for this example, it will be called "tap0"

Code:
# sudo ip tuntap add mode tap tap0
# sudo ip link set dev tap0 up

Insert instructions to make this tap interface persistent in /etc/network/interfaces here.

Stop atalkd!

Next, your atalkd.conf should look kinda like this:
Code:
eth0 -seed -phase 2 -net 2 -zone "A2SERVER"
tap0 -seed -phase 2 -net 3 -zone "A2SERVER"

Restart atalkd!

Finally, your TashRouter configuration. I have this saved as route.py:
Python:
import logging
import time

import tashrouter.netlog
from tashrouter.port.ethertalk.tap import TapPort
from tashrouter.port.localtalk.ltoudp import LtoudpPort
from tashrouter.port.localtalk.tashtalk import TashTalkPort
from tashrouter.router.router import Router


logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(levelname)s: %(message)s')
#tashrouter.netlog.set_log_str_func(logging.debug)  # comment this line for speed and reduced spam

router = Router('router', ports=(
  LtoudpPort(seed_network=5, seed_zone_name=b'LToUDP Network'),
  TashTalkPort(serial_port='/dev/ttyAMA0', seed_network=6, seed_zone_name=b'A2SERVER'),
  TapPort(tap_name='tap0', hw_addr=b'\xAA\xBB\xCC\xDD\x11\x22'),
))
print('router away!')
router.start()

try:
  while True: time.sleep(1)
except KeyboardInterrupt:
  router.stop()

After running TashRouter, your AppleTalk Network should look like the following:

Network number 2-2 on Ethernet (eth0) with zone name "A2SERVER" seeded by atalkd.
Network number 3-3 on a Tap interface (tap0) with zone name "A2SERVER" seeded by atalkd.
Network number 5 on LToUDP with zone name "LToUDP Network" seeded by TashRouter.
Network number 6 on a TashTalk hat connected to /dev/ttyAMA0 with zone name "A2SERVER" seeded by TashRouter.

All packets between your netatalk server and TashRouter are transported via tap0. All packets to from your Ethernet network to TashRouter are routed thru netatalk's atalkd to tap0.
 
Last edited:

finkmac

NORTHERN TELECOM
ahh I see. Yeah, it looks like @RolandJuno has set up the interfaces in such a way that eth0 is being assigned an IP address as well.
I also see a stray tun there.
 

slipperygrey

Well-known member
Strange, I've noticed that when I reboot the RPi, it's a 50/50 chance in the Mini VMac Chooser EtherTalk Zone that either the HP LaserJet 4000 showing up or the MacIPRpi netatalk suite of tools showing up, but not both.

I wonder if it has something too with the zone ranges? Also, shouldn't the MacIPRpi see the Mini VMac in the LToUDP Zone?
This seems indicative of afpd or papd (or timelord) launching before atalkd has fully initialized. A common fail state / race condition of the netatalk daemon suite, which leads to the aforementioned daemons failing to register with NBP. I bet you can still access the AFP TCP service (check with the "asip-status localhost" command) in this state, for instance.

MacIPRPi comes with a patched version of netatalk 2.2.6 which is starting to show its age. I would recommend removing it and installing 2.3.1 instead. The newer version has many improvements and bugfixes. Not least: systemd for managing the daemons, including a clearer dependency tree and startup sequencing. And, a proper workaround for the split horizon bug that @NJRoadfan mentioned.
 

RolandJuno

Active member
OK, here is my TashRouter/netatalk on the same machine setup. This configuration assumes an Ethernet adapter is present at "eth0". This REQUIRES Netatalk 2.3.1, or atalkd compiled with the split horizon patch! Otherwise packets won't be routed correctly over atalkd between networks.

First off, you need to create a tap interface, for this example, it will be called "tap0"

Code:
# sudo ip tuntap add mode tap tap0
# sudo ip link set dev tap0 up

Insert instructions to make this tap interface persistent in /etc/network/interfaces here.

Stop atalkd!

Next, your atalkd.conf should look kinda like this:
Code:
eth0 -seed -phase 2 -net 2 -zone "A2SERVER"
tap0 -seed -phase 2 -net 3 -zone "A2SERVER"

Restart atalkd!

Finally, your TashRouter configuration. I have this saved as route.py:
Python:
import logging
import time

import tashrouter.netlog
from tashrouter.port.ethertalk.tap import TapPort
from tashrouter.port.localtalk.ltoudp import LtoudpPort
from tashrouter.port.localtalk.tashtalk import TashTalkPort
from tashrouter.router.router import Router


logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(levelname)s: %(message)s')
#tashrouter.netlog.set_log_str_func(logging.debug)  # comment this line for speed and reduced spam

router = Router('router', ports=(
  LtoudpPort(seed_network=5, seed_zone_name=b'LToUDP Network'),
  TashTalkPort(serial_port='/dev/ttyAMA0', seed_network=6, seed_zone_name=b'A2SERVER'),
  TapPort(tap_name='tap0', hw_addr=b'\xAA\xBB\xCC\xDD\x11\x22'),
))
print('router away!')
router.start()

try:
  while True: time.sleep(1)
except KeyboardInterrupt:
  router.stop()

After running TashRouter, your AppleTalk Network should look like the following:

Network number 2-2 on Ethernet (eth0) with zone name "A2SERVER" seeded by atalkd.
Network number 3-3 on a Tap interface (tap0) with zone name "A2SERVER" seeded by atalkd.
Network number 5 on LToUDP with zone name "LToUDP Network" seeded by TashRouter.
Network number 6 on a TashTalk hat connected to /dev/ttyAMA0 with zone name "A2SERVER" seeded by TashRouter.

All packets between your netatalk server and TashRouter are transported via tap0. All packets to from your Ethernet network to TashRouter are routed thru netatalk's atalkd to tap0.
Thanks for this detail! I decided to abandon the MacIPRPi installation and start with a clean Raspbian Bookworm install and build Netatalk 2.3.1 from source. I followed this guide and it worked without issue. I also saw a previous post that Bookworm already had the appletalk kernel module built in so that was another plus.

It seems to work! Both the Netatalk services and the HP LaserJet 4000 are now showing up consistently.

How do I make the tap device persist after reboots?
 

NJRoadfan

Well-known member
To create a persistent tap interface under Debian, do the following:

-Install the uml-utilities package

-Create a file /etc/network/interfaces.d/tap0
-Insert the following.
Code:
auto tap0
iface tap0 inet manual
   pre-up tunctl -t tap0 -u root
   up ip link set dev tap0 up
   down ip link set dev tap0 down

Note that TashRouter can't access tap0 unless you run it as root, so you'll need a sudo in front of your python line (or run it as a systemd service).
 
Last edited:

shirsch

Well-known member
@tashtari - Is the localtalk traffic capture of a stable session between IIe and netatalk server over the Gatorbox of any use? Do you need a different format? Please let me know how I can help - thanks.
 

ppuskari

Well-known member
This is a great thread and I'm about 85% understanding the sequence and all. I'm attempting to get my GatorBox CS and the like units (I have all the variants except he MMAC version GatorMMIM) working to participate in the Globaltalk without using AIR. If that is even possible. I do have a very custom built by me version of A2SERVER running on a PiSCSI base that used the 2.2.11???? last set before it was deprecated that now properly does all my IIe workstation card booting and IIgs netbooting and GSPlus netbooting and IIE card netboots.
Would doing the previous stuff be a way with the bridges/tap/tun methods here be a way to add tashrouter and our ltoudp to get my zone to broadcast to Globaltalk just using my Gatorbox CS and netatalk/A2server??? Would not like to have to build up another old mac to do AIR only...

Petar Puskarich
 

shirsch

Well-known member
@tashtari - Here's perhaps a more useful localtalk trace taken with a different utility. This is an Apple IIe with workstation card talking to a netatalk server over a Gatorbox router. Node 133 is the Gatorbox itself, 68 is the Apple 2e, 2.238.128 is the AFP server. I'm not 100% sure I'm interpreting it correctly, but it appears that all the "keep alive" traffic is between the Gatorbox and the Apple IIe. If that's the case, then the Gatorbox is holding state and rewriting the packets in both directions.

If more detail on the payloads is needed I have the trace file and can change the reporting format.
 

Attachments

  • 2eGatorbox.zip
    1.4 KB · Views: 4
Last edited:

tashtari

PIC Whisperer
@shirsch - Sorry I haven't responded yet, I promise I'm not ignoring you, just need to get into the right headspace to dig into this stuff.

Would doing the previous stuff be a way with the bridges/tap/tun methods here be a way to add tashrouter and our ltoudp to get my zone to broadcast to Globaltalk just using my Gatorbox CS and netatalk/A2server??? Would not like to have to build up another old mac to do AIR only...
Unfortunately, TashRouter does not (at least not yet) support AURP so it isn't compatible with the IP tunneling method that GlobalTalk is using. It should be possible, and I'd like to put some manner of tunneling support in TashRouter, but I don't have any immediate plans to implement AURP as of right now.
 

shirsch

Well-known member
@shirsch - Sorry I haven't responded yet, I promise I'm not ignoring you, just need to get into the right headspace to dig into this stuff.
I understand completely, not a problem. Just want to be sure I give you something that's useful and easy to decipher! Having spent 25 years in software development I have a good understanding of the "right headspace".
 
Top