Inspiration
We were going to do something legit with our time here, but then we thought, Hack&Roll is all about having fun. The 100th React app isn't going to change the world, but you know what will? A completely functional (??), lightweight (we took shortcuts) implementation of a TCP/IP stack, 17th century style. We didn't have access to pigeons however, so we went with the next best thing - paper aeroplanes.
What it does
This is a nearly functional TCP stack and a lightweight HTTP client/server, all built from scratch. However, instead of packets traveling over wires, they instead get converted to QR codes and printed on our printer (best hardware hack incoming?), folded into paper airplanes, and thrown across to the receiver, who scans them. Back and forth communication works, and we can actually make a GET request to our HTTP server and retrieve a HTML file across the two endpoints. In other words, we can actually run a very simple version of the internet on our stack!
Our implementation of reliable data transfer (RDT) also actually works - if any of the paper planes get lost on the journey, delayed and reordered, or simply corrupted by foreign actors, our system can theoretically detect and recover from such an adversity without any intervention. This isn't just a QR scanning project (in fact, that's the least important part in this project). The majority of the complexity lies in the protocols that we've painstakingly chosen to write from scratch to enable reliable data transfer.
We also technically have a pipelined version of RDT 3.0 implemented - Go Back N. So we can theoretically send N packets (airplanes) at once, but our printer wouldn't be able to keep up :D
How we built it
Python and lots of staring at state machine diagrams.
Challenges we ran into
Implementing a RDT is not as easy as it seems - the state diagrams to code translation can be fairly tricky and quite prone to errors. We also spent a lot of time trying to get printer drivers working in linux, but gave up and moved to windows as our dev environment for the first time in years.
We also had challenges choosing how deep to go into the project. Should we implement actual network interfaces or just work around? What protocols should we implement? Why is our QR code outputting Japanese characters?
Accomplishments that we're proud of
Implementing a somewhat functional network stack, albeit simplified, was pretty cool. Passing data down the application layer to the transport layer and back up ourselves was very enlightening.
What we learned
- Ins and outs of transport layer protocols
- How different protocols communicate with each other
What's next for IPOverPaperAircraftCarriers
Although this was somewhat a joke, there is some incredible pedagogical value if this is fully fleshed out. The immediate next step could be to implement mechanisms to properly pass information between the different protocols, working with actual network interfaces, implementing other protocols like (pipelined) HTTP, DNS, ICMP, IP, NAT etc. You can really go as deep as you want with this.
Log in or sign up for Devpost to join the conversation.