Hosting a website on an 8-bit AVR microcontroller over SLIP
A hobbyist project gets an AVR64DD32 microcontroller serving a webpage over the open internet. Ethernet was ruled out because even 10BASE-T’s 20 Mbit/s Manchester-encoded line rate exceeds what the chip’s 12 MHz peripherals can produce, and ordering a dedicated Ethernet controller would have meant weeks of waiting. The workaround is SLIP (RFC 1055), the ancient dial-up era framing protocol that Linux still supports via slattach, letting a USB-to-serial adapter become a network interface to the MCU with no extra hardware beyond an indicator LED and a reverse-polarity diode.
The networking stack was written from scratch. IP is trivial when fragmentation is ignored — every modern OS disables it anyway — so responses are built by swapping source and destination and resetting TTL. TCP was the hard part, taking several days to get connection state tracking and retransmission working acceptably, and bugs remain. HTTP was skipped entirely: the server returns one hardcoded response regardless of request, which works fine for a single-URL site.
To expose it publicly without a routable IP or decent home internet, the author runs WireGuard from the local Linux box to a VPS in Helsinki and reverse-proxies the /mcu path on the existing site to the microcontroller’s TCP stack. That indirection also blunts trivial SYN-flood attacks, though as the author notes, DDoSing something effectively running at dial-up speeds is not a high bar.
Read the full article
Continue reading at Hacker News →This is an AI-generated summary. Read the original for the full story.