Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

TwIP - An IP Stack In a Tweet

timothy posted more than 4 years ago | from the small-is-good dept.

Networking 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."

cancel ×

81 comments

Sorry! There are no comments related to the filter you selected.

Article mod: -1 Overrated (5, Insightful)

Looce (1062620) | more than 4 years ago | (#29254979)

The underlying system must provide a way for user programs to receive and send IP packets.

This is where I stopped reading. Just... no. This is just a program that echoes every single thing back to the originator.

Re:Article mod: -1 Overrated (4, Insightful)

something_wicked_thi (918168) | more than 4 years ago | (#29255133)

Yeah, I've got a program for the author that fits in a tweet:

#include
int main() {
    puts("You're a moron and a braggart.");
}

Re:Article mod: -1 Overrated (2, Insightful)

Anonymous Coward | more than 4 years ago | (#29256213)

Apparently, slashdot could use a -1, Don't be a dick moderation.

Just give the story a - and move on.

Re:Article mod: -1 Overrated (0)

Anonymous Coward | more than 4 years ago | (#29259175)

Apparently you don't do embedded stuff, otherwise you would have recognized the name Adam Dunkel. I suggest you look up his previous work...

Re:Article mod: -1 Overrated (1)

cecom (698048) | more than 4 years ago | (#29263271)

I am with you! Thank god I am not the only sane person here.
When garbage like this is on the front page of Slashdot, perhaps it is time to stop reading it.

Re:Article mod: -1 Overrated (0)

Anonymous Coward | more than 4 years ago | (#29265349)

<Eric Cartmenez>Ok goodbye! have fun! we will miss you!</Eric Cartmenez>

(not really)

Addendum (4, Interesting)

Looce (1062620) | more than 4 years ago | (#29255157)

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:Addendum (1)

Mr_Toph (843301) | more than 4 years ago | (#29255565)

Haha! This article is rated purple (2 levels above the lowest -- black) already. Wow.

And now it's black :P

Re:Addendum (1)

Looce (1062620) | more than 4 years ago | (#29255603)

I haven't seen a story get pwned into the ground this fast before. ... I must be new here.

Re:Addendum (1)

D'Sphitz (699604) | more than 4 years ago | (#29256001)

where are you seeing these "rating colors"?

Re:Addendum (4, Informative)

cyberstealth1024 (860459) | more than 4 years ago | (#29256133)

where are you seeing these "rating colors"?

i didn't know either, so i looked it up -- it's the /. firehose quality filter [slashdot.org] . When you're logged in, you can see the popularity color on the left side of the summary heading. You can also increase/decrease this rating. See screen cap [tinypic.com] . Also, when browsing the front page of /., you can filter based on the color...see top-right of screenshot. The rating colors are ROYGBIV + Black. Red is the highest (most popular), black is the lowest. submitted articles initially have the color rating of blue.

I had seen the color filtering before on the front page, but never looked into enough to find out. I learned something new. Hope you did too!

Re:Addendum (1)

Mozk (844858) | more than 4 years ago | (#29256997)

You put up with all that shit on the page? My front page looks like this [imageshack.us] .

How did you get it to use the full width? (1)

nedlohs (1335013) | more than 4 years ago | (#29257231)

Mine looks like: http://img340.imageshack.us/img340/8872/slashdot.png [imageshack.us]

Which is damn annoying since my browser window is already set to use half the screen horizontally (the other half is two xterms one above the other) so it's already not very wide...

Re:How did you get it to use the full width? (1)

Mozk (844858) | more than 4 years ago | (#29263343)

You could probably write a custom stylesheet to get rid of the #slashboxes column or whatever is creating the whitespace and maybe make the font smaller.

Just out of curiosity, what WM and browser are you using?

Re:How did you get it to use the full width? (1)

nedlohs (1335013) | more than 4 years ago | (#29265755)

ion and firefox 3.0.11. I trimmed the top at the tabs though, too much info in them to put in here :)

Re:Addendum (0)

Anonymous Coward | more than 4 years ago | (#29263041)

using ICMP and IP interchangeably..?

No, they are different headers and different checksums. He is updating the ICMP checksum which is needed since the ICMP type changed. He is leaving the IP checksum as is which is ok because the only change to the IP header was the swapping of source and destination IP address and this doesn't alter the checksum.

It's pretty useless, but at least he knows what he is talking about.

Looce, take this down. Now. It's your only chance to save face with this comment.

Re:Addendum (1)

fatphil (181876) | more than 4 years ago | (#29270955)

"The fact that the TwIP program requires an IP stack to work is ..." ... false.

You're confused that he uses a raw network interface to test it, but he could just have easily have done something like ./twip &lt; /dev/ttyS0 &gt; /dev/ttyS0 instead. All he requires is a link layer that trasnmits a stream of bytes in tact.

And your pedantry regarding calling the Header Checksum both the IP checksum and the ICMP checksum is misplaced too. Look at the two relevant RFCs - both of them define the header to have a Header Checksum, and therefore this field *is* the header checksum for both of the protocols. 'IP checksum' and 'ICMP checksum' isn't the formal name of either of them, but both are unambiguous ways of refering to the same thing.

Re:Article mod: -1 Overrated (2, Insightful)

BitZtream (692029) | more than 4 years ago | (#29255471)

. This is just a program that echoes every single thing back to the originator.

using the IP stack that already exists on the OS.

Responding to IP requests using someone elses IP stack does not mean you actually created your own stack.

Re:Article mod: -1 Overrated (1, Interesting)

Anonymous Coward | more than 4 years ago | (#29259117)

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?

Re:Article mod: -1 Overrated (1, Interesting)

Anonymous Coward | more than 4 years ago | (#29255497)

It's also wrong. char b[140]; unsigned short *s=b; *l=b; t; main(){ while(1) { read(0,b,140); b[20]=0; s[11]+=8; t=l[4]; l[4]=l[3]; l[3]=t; write(1,b,140); } } l is undefined. t is a syntax error. main() is incorrectly declared.

Re:Article mod: -1 Overrated (1)

bjourne (1034822) | more than 4 years ago | (#29257735)

No it's not. RTFA or try compiling the program.

Re:Article mod: -1 Overrated (0)

Anonymous Coward | more than 4 years ago | (#29259035)

*l & t are correct, but main() still does not return an integer.

Re:Article mod: -1 Overrated (0)

Anonymous Coward | more than 4 years ago | (#29256259)

pfft, I'll be impressed when he can write it in BrainFuck. Also why is twitter the standard for size again. This wouldn't have made it to the front page if it was "Guy writes very small ip stack".

Think befre you release this (-1)

Anonymous Coward | more than 4 years ago | (#29254995)

Italians could use this hacker code to take down the internet and penetrate our national security, releasing sticky trojans all over the place.

Pretty Cool (0)

Bruha (412869) | more than 4 years ago | (#29255027)

Now if you could figure out a way to encode a full 1500 byte packet into 160 characters you'd make some big money.

Re:Pretty Cool (3, Interesting)

Plug (14127) | more than 4 years ago | (#29255173)

Sounds kind-of like this [stackoverflow.com] .

Re:Pretty Cool (2, Informative)

buchner.johannes (1139593) | more than 4 years ago | (#29255971)

Awesome, I love the difference between the first two approaches!

If you're not sure whether to click the link: It is a competition to compress images into 140 chars.

Re:Pretty Cool (1)

dgatwood (11270) | more than 4 years ago | (#29257331)

Oh, TCP/IP is actually pretty easy. You don't need to handle the entire payload of an ethernet frames (1500 bytes). Just set the MTU to something tiny and let the TCP stack segment it for you. I was thinking pretty much the same thought as you. I hereby dub the concept IPoT (IP over Twitter). The minimum MTU allowed for TCP/IP is 88 bytes. Assuming you have to encode them in something 7-bit-clean (say base64), this means that you would need 118 bytes. 160 is a piece of cake. You'd get an MTU of 120 bytes, which while absurdly small, is a perfectly legal MTU.

I could probably write a daemon that uses tuntap [slashdot.org] and hack together something in under a day. :-D Hmm. I just got an evil idea. Do you suppose that violates the terms of service?

Relevance check please (4, Insightful)

flowerp (512865) | more than 4 years ago | (#29255037)

Shit doesn't smell like roses when it is made to fits into a tweet or is in any other way related to Twitter.

Novel, but pointless (0)

girlintraining (1395911) | more than 4 years ago | (#29255045)

That's no stack. A stack has a queue, and a set of operations that can be done on items entering and leaving that queue. Description fail!

Re:Novel, but pointless (3, Insightful)

parallel_prankster (1455313) | more than 4 years ago | (#29255097)

He is talking about the IP Stack, not the computer science stack structure. Calling it an IP stack is an over-exaggeration. This is a cleverly written (no doubt) program using ICMP knowledge to ping back a response packet. Please dont call that a stack!!

Re:Novel, but pointless (1)

Nigel Stepp (446) | more than 4 years ago | (#29255915)

I don't think anyone is talking about "the computer science stack structure".

comment.c: In function âmainâ(TM): (1)

edalytical (671270) | more than 4 years ago | (#29257795)

comment.c:1: error: âover-exaggerationâ(TM) undeclared (first use in this function)

Stop hiring temps for your editors, Slashdot (-1, Offtopic)

Anonymous Coward | more than 4 years ago | (#29255051)

Slow news day? Why don't we start posting articles from Johnny Coders who just figured out their first Hello World programs?

Geek alert (1, Informative)

Anonymous Coward | more than 4 years ago | (#29255081)

I knew I picked the right man when I cited this guy's PhD thesis in my dissertation. Folk who write things like this know their shit, and are probably safe citations, despite the use of Twitter.

I'd have thought that someone that spent his time studying and implementing minimal-waste embedded network stacks and coming up with something like Contiki would be annoyed by the huge waste of bytes that is Twitter.

For those who are interested ... (1, Informative)

Anonymous Coward | more than 4 years ago | (#29255083)

... in low level system programming, I recommend reading a good book, like this [amazon.com] , and not spending any more time reading this.

Seriously.

At least 3 ways to make it smaller: (2, Insightful)

QuantumG (50515) | more than 4 years ago | (#29255089)

Here comes the lameness filter:

unsigned short s[70];*l=s+6;t;main(){for(;;){read(0,s,140);s[10]&=65280;s[11]+=8;t=l[1];l[1]=*l;*l=t;write(1,s,140);}}

And with those 9 chars perhaps you could make it better.

Re:At least 3 ways to make it smaller: (1)

mrbobjoe (830606) | more than 4 years ago | (#29255831)

I assume the first two ;s are supposed to be ,

Re:At least 3 ways to make it smaller: (1)

mrbobjoe (830606) | more than 4 years ago | (#29255867)

I assume that I should have read the article first, bah.

Re:At least 3 ways to make it smaller: (1)

superdana (1211758) | more than 4 years ago | (#29256637)

As another poster noted below, you can make it even shorter by omitting "unsigned." The only operations performed on the members of s are & and +, which operate identically on signed and unsigned integers.

Re:At least 3 ways to make it smaller: (4, Funny)

Mozk (844858) | more than 4 years ago | (#29257027)

Yeah, but for(;;) loops forever, whereas while(1) only loops while 1 is true. It's completely different! What if 1 becomes false?!

Re:At least 3 ways to make it smaller: (0)

Anonymous Coward | more than 4 years ago | (#29258083)

I used to do:
#define EVER ;;
in my c programs..
for(EVER) makes much more sense!

Re:At least 3 ways to make it smaller: (1)

fatphil (181876) | more than 4 years ago | (#29268117)

Visual inspection (i.e. not touched a compiler) says to me:

Comma-up the loop into 1 expression and bin the {}?
Replace 65280 with -256?
for(;read(0,s,140);) or while(read(0,s,140)) to save a ;
That's 4 more, after that it's a bit tricky.

(Of course, unsigned's aleady been spotted as toast too, which can be taken as read.)

A message to C haters (0, Troll)

moon3 (1530265) | more than 4 years ago | (#29255121)

Just today on /. one "C" tweet that can crash a Mac, now the second one that creates an IP stack out of one liner. Can your prefered language be so badass?

Re:A message to C haters (1)

BitZtream (692029) | more than 4 years ago | (#29255453)

Yes, I can do the same thing with Mono on OSX in less bytes.

I prefer C myself, but don't act like this is somehow special, its just a matter of having a set of supporting libraries that happen to make this particular task require very little visible code.

And you, like the 'author' are ignoring all the code that goes into the libraries to make this happen, namely the fact that its riding on top an existing IP stack, not actually creating its own.

If you are using the BSD sockets API to 'create your own IP stack', then you aren't actually creating your own stack.

You could do both the exploit posted and this crap in less bytes of perl, python, or ruby I'm sure, as long as you ignore all the other supporting libraries and code like he did and you are too.

Re:A message to C haters (3, Insightful)

Idiomatick (976696) | more than 4 years ago | (#29255587)

I wrote my own compiler/language just now. What it does is it disregards your entire source code and then outputs that mac crashing bug. I fail to see your point...

I'm a c/c++ fan but just because you can do something in less lines doesn't mean it is better. Maybe if you said that in your language the mac crash ap compiles to 80bytes and requires only 10 operations then i'd be impressed. Buuuut in that case then asm is the greatest language ever.

Re:A message to C haters (1)

berwiki (989827) | more than 4 years ago | (#29255675)

I don't hate C because it has limitations or speed issues, I hate C because of pointers and no garbage collection.
C code should be reserved to a limited few because most applications written in it are plagued with bugs and vulnerabilities.
My hair stopped falling out after switching to a newer technology. Maybe I am not a pure-bred developer, but who cares, my life is better!

Re:A message to C haters (0)

Anonymous Coward | more than 4 years ago | (#29255773)

Yeah well you need some sort of low level language with direct metal memory control to develop said garbage collection, C is it.

Re:A message to C haters (1)

infinityxi (266865) | more than 4 years ago | (#29256309)

Best tools for the job work best. There are situations when you don't want the overhead of a garbage collector and you want to keep track of all your allocations. Embedded programming comes to mind here as well as other low level uses. Sure you may not want to use it for high level stuff but C/C++ can be used for that. I am a java developer by trade myself and I know all the shit Java gets on this site but it works best for what I do. Oh and yes I agree the higher level languages that "hide" all the pointer stuff and does the allocation for you does take away a lot of headaches usually at the tradeoff of a performance hit. If that performance hit is negligible, roll with it.

Re:A message to C haters (1)

scienceprogrammer (654311) | more than 4 years ago | (#29255733)

Here it is shorter in python so there...

import termios, fcntl
fcntl.fcntl(0, termios.TIOCGWINSZ)

Re:A message to C haters (2, Insightful)

FlyingBishop (1293238) | more than 4 years ago | (#29256387)

Please. Emacs can crash a Mac and create an IP stack in one command.

Re:A message to C haters (0)

Anonymous Coward | more than 4 years ago | (#29257751)

emacs can crash anything with one command and does it not have an IP stack... I mean, just about every other OS has one.... what? emacs is not an OS? you could have fooled me.

not very complicated ... and that's the good part (2, Interesting)

Gopal.V (532678) | more than 4 years ago | (#29255147)

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 ;)

Re:not very complicated ... and that's the good pa (1)

WongsHongKongTailor (1616347) | more than 4 years ago | (#29268471)

"Unix is simple. It just takes a genius to understand its simplicity." â" Dennis Ritchie

I hope this isn't a new trend. (3, Insightful)

jellomizer (103300) | more than 4 years ago | (#29255197)

I hope this isn't a new trend of 7337 |-|@(|0%$ to try to brag of their mad skill by seeing what code can fit in a Tweet.

The less the code doesn't mean better performance.
The less code can mean less functionality and error checking.
The less code does mean less documentation
The less code could mean harder readability.

We need less people taking their time and effort making unreadable small code and more effort in making good and useful applications and libraries. Granted such exercises may be useful to allow you to think of problems differently but you can get the same effect by changing languages say from C to LISP. Also these examples seem to take in include headers which accounts for thousands of lines of code, which are often limited to either the OS or even just the Programming language.

It is like me saying I can make a Web Browser using a shell script with 2 lines.

#!/bin/bash
apachectl start

Re:I hope this isn't a new trend. (1)

jaymz2k4 (790806) | more than 4 years ago | (#29255305)

I just forgot this isn't reddit, so I can't upmod your post arbitrarily. But the thought is there.Your comment regarding the header includes hits the nail on the metaphorical head.

Re:I hope this isn't a new trend. (4, Insightful)

pathological liar (659969) | more than 4 years ago | (#29255335)

If you converted Apache into a web browser that might actually be worthy of a story...

Re:I hope this isn't a new trend. (2, Funny)

maharius (1235912) | more than 4 years ago | (#29255349)

It is like me saying I can make a Web Browser using a shell script with 2 lines.
#!/bin/bash
apachectl start

If that's what you're using as a web browser, you're doing it wrong.

Re:I hope this isn't a new trend. (1)

MavEtJu (241979) | more than 4 years ago | (#29255441)

> It is like me saying I can make a Web Browser using a shell script with 2 lines.

Besides your server / browser confusion:

Your implementation needs an external program to function, his does not.

Did you mean a web server in a tweet? Here ya go! (1)

sam_vilain (33533) | more than 4 years ago | (#29255737)

http://twitter.com/samv/status/3654963074 [twitter.com]

Well, straight from the IO::All man page but still. It supports CGI! (easily ownable of course)

Re:I hope this isn't a new trend. (2, Informative)

loconet (415875) | more than 4 years ago | (#29256145)

I hope this isn't a new trend of 7337 |-|@(|0%$ to try to brag of their mad skill by seeing what code can fit in a Tweet.

Oh it is. [twitter.com]

Re:I hope this isn't a new trend. (1)

noidentity (188756) | more than 4 years ago | (#29258291)

I hope this isn't a new trend of 7337 |-|@(|0%$ to try to brag of their mad skill by seeing what code can fit in a Tweet.

Check this out, hello world in a tweet! I really had to work hard shortening it to under 140 characters.

extern int puts( const char* ); int main( int argc, char* argv [] ) { puts( "Hello, world!\n" ); /* prints string */ return 0; /* OK */ }

Re:I hope this isn't a new trend. (1)

epee1221 (873140) | more than 4 years ago | (#29262041)

I hope this isn't a new trend of 7337 |-|@(|0%$ to try to brag of their mad skill by seeing what code can fit in a Tweet.

Nah, it's really nothing new. We've been playing perl golf for how long now?

Very cool (3, Insightful)

bjourne (1034822) | more than 4 years ago | (#29255273)

Very cool program! Taught me some things about IP. The program could be made one byte shorter by using for(;;) instead of while(1) and it is not strictly necessary to use "unsigned short" instead of "short" afaict. I wonder what other interesting programs that can be written in only 140 bytes.

Re:Very cool (1)

BitZtream (692029) | more than 4 years ago | (#29255423)

I can do it in 1 byte, hell 1 bit.

Since he's completely ignore the fact that he's actually using the stack already built into the OS and not writing his own.

Just write everything into the compiler and supporting libraries, which is what is being done here.

This isn't a IP stack in a tweet, its a twit who is sensationalising and ignoring all the things that make his statement an outright lie.

I can create a human life from a few chemicals and in a matter of minutes have a living breathing baby or a full grown adult.

All you have to do is the same thing this moron did, ignore all the other things involved in the process (like having sex and the two parents contributing sperm and an egg, or the 9 months of gestation, or the 14-21 years of growing up to get to being an adult.

The only thing you could have learned about IP from this twit/tweet is wrong I'm sure as the whole thing is based on ignorance and perception, not reality.

RFC 5514 (1)

tagno25 (1518033) | more than 4 years ago | (#29255397)

Is this a implementation of RFC5514? I know that it needs to be IPoSN ( IPv6 over Social Networks) and is probably not, but I wonder how hard it would be to have this do IPv6.

Do I need an emacs OS browser VM to use it? (1)

Hurricane78 (562437) | more than 4 years ago | (#29255451)

Or is it enough, to boot a normal JavaScript based virtual machine on a normal browser, to use this?

Bullshit! (1)

AlgorithMan (937244) | more than 4 years ago | (#29255505)

that program just echoes stdin to stdout (maybe some char manipulations) and YOU have to connect this crap to some prog, which provides the network abilities (netcat might be suitable, i guess)

It's not an IP stack (4, Insightful)

k2dbk (724898) | more than 4 years ago | (#29255507)

It's not an IP stack at all (and requires one to function). It replies to a packet that is assumed to be a ping without any error checking. In other words, it's a very short, clever, but minimally functional ping function. The fact that it's short is nice, but that's about it.

Re:It's not an IP stack (1)

beelsebob (529313) | more than 4 years ago | (#29255581)

It doesn't even function as a ping function, some pings will cause it to generate the wrong checksum in the reply.

similarly big accomplishment (4, Funny)

AlgorithMan (937244) | more than 4 years ago | (#29255545)

hey, I wrote a webbrowser in 8 bytes of BATCH: here's the source code:

IEXPLORE

impressive, huh?

Re:similarly big accomplishment (2, Funny)

AlgorithMan (937244) | more than 4 years ago | (#29255567)

oh and don't forget my downloading prog in BASH:

wget $@

man, I'm so f*cking 1337!

Re:similarly big accomplishment (1)

rdnetto (955205) | more than 4 years ago | (#29258205)

That's not a web browser! *This* is a web browser:

lynx

(And yes, it runs on Linux...)

Re:similarly big accomplishment (1)

sorak (246725) | more than 4 years ago | (#29260315)

That's not a web browser! *This* is a web browser:

lynx

(And yes, it runs on Linux...)

Too simple. Try this:

browser="lynx";begin_comment="Now starting ";echo $begin_comment $browser; `$browser`;end_comment="terminated";echo $browser $terminated;

All in one line of code. Now, that is some l33t coding skills, yo!

Re:similarly big accomplishment (1)

sorak (246725) | more than 4 years ago | (#29260363)

browser="lynx";begin_comment="Now starting ";echo $begin_comment $browser; `$browser`;end_comment="terminated";echo $browser $terminated;

Crap! That should have read:

browser="lynx";begin_comment="Now starting ";echo $begin_comment $browser; `$browser`;end_comment="terminated";echo $browser $end_comment;

Maybe this twitter guy is better at this than I am.

Cool yet small... (2, Informative)

Spatial (1235392) | more than 4 years ago | (#29256121)

...is big in the demoscene.

Check out this 4KB realtime demo called 'Receptor'. (Download [daimi.au.dk] / Video [capped.tv] )

Great! (1)

thePowerOfGrayskull (905905) | more than 4 years ago | (#29256429)

Except for the part where the "stack" requires an underlying sockets implementation.

well (1)

GetTragic (21640) | more than 4 years ago | (#29256633)

/* At this point, we should do a lot of sanity checking of the
              incoming packet. We *should* check its length (to see that it
              is at least longer than a packet header), we should check that
              it is a valid IPv4 packet header, we should check that it is an
              ICMP packet, and we should check that the ICMP type is ECHO,
              which is the type used for ping packets.

              But we don't do any of that, because doing so would make the
              code not fit inside a Twitter message. */

That seems like a pretty good excuse to me.

This is Spiffy (1)

FatherDale (1535743) | more than 4 years ago | (#29257819)

I admire you for this -- not a NOOP sled, not a trojan, not a game, you built a freaking IP stack in 128 chars. I officially declare you my hero, at least until lunch.

Re:This is Spiffy (0)

Anonymous Coward | more than 4 years ago | (#29262995)

Too bad it's not an IP stack then. But hey, keep your spirits high!

TwERP (1)

sydbarrett74 (74307) | more than 4 years ago | (#29259849)

I propose TwERP -- an Enterprise Resource Planning app coded in a tweet.
Check for New Comments
Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>