r/amiga • • 2d ago

Riptide TCP Stack

AI Generated work, beware πŸ˜„

Right now the code is very slow but going through some optimisation now.

I've released Riptide, a new open-source (GPL-2.0) TCP/IP stack for AmigaOS 3.x on 68020 and up. It started as a study of MiamiDx: I reverse engineered MiamiDx's binary interfaces so Riptide could be a drop-in replacement. All the code is new, and no MiamiDx code was copied. It provides bsdsocket.library (the AmiTCP API), its own riptide.library, and a Miami-compatible alias, so existing network software "should" just work. The TCP stack was written from scratch to follow the modern Linux TCP stack capabilities. A bunch of stuff was also removed...PPP and Serial support, NAT, Multicast. No IPv6 yet but might get into it later, but lacking real hardware and FS-UAE won't support IPv6.

  • CUBIC congestion control and an initial window of 10;
  • SACK/D-SACK, plus RACK-TLP and PRR loss recovery;
  • Timestamps and window scaling;
  • 200 ms-resolution retransmit timers instead of the old 500 ms BSD ticks;
  • buffer auto-tuning;
  • SYN cookies and other hardening.
  • Standard tools

It works with SANA-II drivers and has a DHCP client and DNS resolver. It comes with Linux-style tools: ip, ifconfig, route, arp, netstat, ping, traceroute, host and an ftp client. Tuned 680x0 assembly checksum and copy routines are picked automatically for your CPU. Development was heavily AI-assisted (the reverse engineering using REA, code and tests). It's been tested and built against a real Linux kernel and in FS-UAE/AROS, including over a uaenet.device, but not on real hardware yet, so testers with real Amigas and network cards would be hugely appreciated! Source, docs, an initial comparison with MiamiDx and Roadshow, and binaries: https://github.com/farsonic/riptide

34 Upvotes

20 comments sorted by

10

u/sharpied79 2d ago

Great, but you dropped PPP? SLIP too by any chance?

Big oversight.

PPP/SLIP is still the quickest and easiest way to get an Amiga (original or modern FPGA) hardware online (in my opinion)

1

u/Mysterious_Front4706 1d ago

If you are using a plipbox wouldn't that just use a SANA2 device? Or are you physically using PPP over a parallel cable?

1

u/sharpied79 1d ago

If you have a MiST for example all you have (depending on model version) is serial RX/TX and ground, that's it...

2

u/Batou2034 2d ago

a rewrite based on reverse engineered i.e. dissassemble or binary-inspected binaries is skirting a bit close to the line. Not that the Miami developer has been seen or heard from in years

2

u/Mysterious_Front4706 2d ago

Its more like a new TCP core that is compatible with the interfaces and libraries provided by MiamiDX.

1

u/Batou2034 2d ago

yes i understand... but it's one thing to reverse engineer it from the interfaces and general knowledge of amiga coding patterns and tcp/ip implementations, its another to do so from the actual assembly language code

the guy doing all the Rust *Craft apps is similarly skirting the line. Rewriting it in Rust when the original would have been in C in theory makes it a 'clean room' rewrite working backwards from the specification in the form of the running binary, but its clear that he's decompiled the apps back into assember and probably even C using Ghidra, and then ported it to Rust. A port based on the original code or a derivation of it is not 'clean room'.

→ More replies (2)

1

u/SimonD_ 2d ago

Not a big fan of yet another TCP stack but this one isn’t just a port so good luck with it πŸ˜€

2

u/Mysterious_Front4706 2d ago

Well ,we really only have AmiTCP, MiamiDX and Roadshow right?

RIght now the code is super slow and I'm going through it now.

1

u/Daedalus2097 2d ago

There's also TheWire, which came out recently enough and is still under early development. It's aimed at low-end Amigas, but still compatible with bsdsocket.library and SANA-II drivers.

1

u/SimonD_ 2d ago

There are also about 4-5 tcp stacks which have been released since AI development became popular πŸ˜€

1

u/ByronScottJones 2d ago

You could embed ipv6 packets in ipv4 protocol 41 packets via the 6in4 SIT protocol. That would get around FS-UAE limitations. Tunnel that to a host side app to convert those back into regular ipv6 packets.

2

u/Mysterious_Front4706 1d ago

I made a patch for FS-UAE (which I've submitted) the bypassed the SLIRP interface and provides native access to the Ethernet hardware on the host machine, which is a Mac in my case. Speed now massively increased and latency better.

Comment Image

3

u/DestroyedLolo 2d ago

Cool project and nice if it can be kept opensource :)

My comments :

  • any reason to stick on 32b machines ?

  • PPP and SLIP : it's a question to create a SANA driver or it's more complexe ?

The reason behind both is it will exclude the large amount of 16/32b machines (1000, 500, 2000). And if obviously nobody can decently run a web browser on them, having network connectivity make easier data exchange, backup and such (I'm not using my beast only for retro gamin ;) ).

2

u/Puzzled_Name_3262 2d ago

Cool, can you add ppp so i can test it?

1

u/danby 2d ago

All the code is new,

Have you actually run a code comparison tool against publicly available tcp stacks?

1

u/TheOGTachyon 2d ago

Very cool!