TwIP - An IP Stack In a Tweet 81
Adam Dunkels writes "Inspired by the Twitter-sized program that crashes Mac OS X, I just wrote a really, really rudimentary IP stack called twIP, small enough to fit in a Twitter tweet. Although
twIP is very far away from a real IP stack,
it can do the first task of any IP stack: respond to
pings. The entire source code can be found in this 128-character-long tweet. For those who are interested in low-level network programming, a code walkthrough with instructions on how to run the code under FreeBSD is available here. The FAQ: Q: why? A: for fun."
not very complicated ... and that's the good part (Score:3, Interesting)
I tried this particular piece of code out and it works! Of course, the ping buffer and the IP swap is just so obviously simple ... WOW!
The "everything is a file" unix philosophy really does kick in and pull its weight in this example. Sockets, network devices, hardware block devices ... You can write an app to do pretty much anything with any of these, with just file streams. Oh, yeah ... dd'ing entire flash drives, netcating sockets, rsync'ing root partitions over. I often am completely amazed by the complexity that simple pieces can produce.
Now everyone - stop talking bad about twitter ... it's awesome, it's simple and it's given random people the idea that I'm interesting & intelligent ;)
Addendum (Score:5, Interesting)
Haha! This article is rated purple (2 levels above the lowest -- black) already. Wow.
Anyhow. The fact that the TwIP program requires an IP stack to work is the prime indication that it doesn't really do all that much. Since it can work with raw socket access, and switches the addresses around, well, props, but TFA's "header" code comment says this:
updating the ICMP checksum
which is then contradicted by the code comment before the address swap:
Since we only swap bytes in the IP header, we do not need to update the IP header checksum.
using ICMP and IP interchangeably..?
timothy, take this down. Now. It's your only chance to save face with this article.
Re:Pretty Cool (Score:4, Interesting)
Sounds kind-of like this [stackoverflow.com].
Re:Article mod: -1 Overrated (Score:1, Interesting)
Re:Article mod: -1 Overrated (Score:1, Interesting)
Adam Dunkel has created his fair share of IP stacks including the original uIP and uIPv6. And some other insignificant things like protothreads and the Contiki embedded operating system.
What's your contribution?