Short: Hardware-free SANA-II loopback device Author: simond@irrelevant.org (Simon Dick) Uploader: simond irrelevant org (Simon Dick) Type: comm/net Version: 1.0 Architecture: m68k-amigaos Distribution: Aminet sana2loop builds loopback.device, a hardware-free SANA-II network device for AmigaOS: echo, crossover, and pcap replay/capture modes, plus companion Shell tools (SanaInfo, SanaDump, SanaSend, SanaConform). No null/dummy SANA-II device has ever existed before this, despite being the obvious first tool for testing any network stack, shim, or driver-consuming software - deterministically, with zero hardware and zero emulator network support required. Features -------- - Echo mode: a CMD_WRITE is delivered straight back to a matching queued CMD_READ (typed, orphan, or a bounded rxqueue), with real SANA-II src/dst address semantics. - Crossover mode: pair two units so traffic written to one is delivered to the other, with real unswapped addressing and unicast/broadcast/multicast/promiscuous receive filtering. - Real SANA-II buffer-management hooks (S2_CopyToBuff/CopyFromBuff/ PacketFilter), broadcast/multicast writes and group membership, S2_ONEVENT, global/type/special stats, and per-unit config files (ENV:/S: sana2loop/unitN.config). - Fault injection pipeline, all off by default: packet drop, duplicate, truncate, reorder, forced online/offline flapping, and an "oversilent" PMTUD black hole - an overlong crossover write vanishes silently instead of erroring, so a stack's actual PMTUD black-hole detection/recovery can be tested, not just assumed - all seeded and reproducible. - pcap replay (on-demand or real-time VBlank-scheduled) and pcap recording, both driven off a hand-rolled classic pcap reader/writer with no host dependency. - SANA-II Rev 2/3/4/7 conformance: wider buffer-management hooks (S2_CopyToBuff16/32, genuinely invoked, not just accepted), S2_GETPEERADDRESS/S2_GETDNSADDRESS, Sana2DeviceQuery.RawMTU, and Rev 7 DMA hook negotiation (accepted and counted, gracefully never invoked). - Companion Shell tools: SanaInfo (open/query/online-offline a unit), SanaDump (capture a unit's traffic to a pcap file), SanaSend (replay a pcap file's frames onto a unit), SanaConform (probes a unit's SANA-II Rev 2/3/4/7 conformance and reports what it finds). - Targets plain 68000 and Kickstart 1.3 for the device itself - a test tool's value is universality, and nothing here needs more. Requirements ------------ - loopback.device: any Amiga, from a stock 68000 upwards, Kickstart 1.3 (V34) or later, 2 MB RAM minimum. No utility.library, no dos.library calls from the unit's own I/O path. - SanaInfo/SanaDump/SanaSend/SanaConform: AmigaOS 2.04 (V37) or later (CreateMsgPort()/CreateIORequest() are V36+ Exec calls, but V36 itself never shipped outside early pre-release hardware, so 2.04 is the realistic floor). No additional libraries or archives to install. Installation ------------ Copy "loopback.device" to DEVS:. Copy "SanaInfo", "SanaDump", "SanaSend", and "SanaConform" to a directory on your PATH (e.g. C:). No reboot is required - a device is picked up the next time something opens it by name. If you also want a real network stack (AmiTCP, AmiTCP_NG, Roadshow) to find and use it, additionally copy "loopback.device" to DEVS:Networks/ - the conventional location a stack's own network configuration expects a SANA-II driver in. This is a SEPARATE step, not a replacement: OpenDevice() only ever searches plain DEVS: for a bare device name; a stack's own config instead opens the full path (DEVS:Networks/loopback.device) itself once you point it there. Optional per-unit configuration lives in ENV:sana2loop/unit.config (falling back to S:sana2loop/unit.config) - see the included sana2loop.guide for the full key reference (mode, peer, mtu, rxqueue, fault-injection knobs, replay/record). Quick start ----------- SanaInfo 0 open unit 0, print DEVICEQUERY info SanaDump UNIT=0 FILE=capture.pcap capture unit 0's traffic to a file SanaSend UNIT=0 FILE=capture.pcap replay a pcap file's frames onto unit 0 SanaConform 0 probe unit 0's SANA-II Rev 2/3/4/7 conformance AI disclosure ------------- Be aware: sana2loop was written largely by an AI coding agent (Anthropic's Claude, via Claude Code), working under human direction, review, and on-hardware/on-emulator testing. The entire source is BSD-licensed and open for review. Documentation ------------- The full protocol reference, per-mode configuration guide, fault injection cookbook, and troubleshooting notes are online at https://sidick.github.io/sana2loop/ and included as sana2loop.guide in this archive (AmigaGuide/MultiView, OS 2.x+) for offline/on-Amiga reading -- same source, both forms. Source and licence ------------------- Free and open source, BSD 2-Clause. Full source, documentation and issue tracker: https://github.com/sidick/sana2loop