Slashdot Mirror


World's Smallest Web Server (We Have a Winner)

sysadmn writes "This web server is the latest contender for "World's Smallest". Two chips and a diode - so they had to leave out Linux :-). It's based on the world's smallest implementation of a TCP/IP stack -- which is implmented on a small 8-pin low-power microcontroller using 512 words of program ROM. Where would you put a $1 web server? " If its real, its amazing.

10 of 189 comments (clear)

  1. iPic by drwiii · · Score: 2
    This was on Slashdot a month or so ago, but the article was pulled. There was quite a nice discussion thread going on too.

    If I recall, it doesn't interpret HTTP requests, but serves you a document based on whichever port number you connect to it via.

  2. Old news by TallGuy · · Score: 2

    I'm pretty sure I've seen this a month or two back on slashdot. Same link, same pics, and still no connection to the thing. (Oh, and according to most of the linux hackers, it's a scam, since you can't write a TCP/IP stack in 512 words)

    1. Re:Old news by Josh+Turpen · · Score: 2

      (Oh, and according to most of the linux hackers, it's a scam, since you can't write a TCP/IP stack in 512 words)

      You've never read the story of mel have you? You should try stepping through something like, oh, NES Zelda with an emulator and see how they fit that game into 32k. (Hint: Parts of the executable code are also used as sound samples!)

      I could definitely see a TCP/IP stack being implimented in 512 clever bytes. I would hate to debug it though.



      --
      --- A Jesus Fish eating a Darwin Fish only proves Darwin's point.
  3. Here's how it works by edwdig · · Score: 4

    Ok, this was on Slashdot about a month or two ago. Back then, I took some guess as to how it worked and emailed the author. He confirmed my suspictions. Here's the details.

    First things first: it does NOT use a FULL tcp or http implementation. The system has its network configuration hard coded into it. And it is designed to only work in a very specific environment - when wired directly to the serial port of a router running a SLIP connection.

    This means that data to or from the server only has one possible path. That simplifies the protocol tremendously. This setup also guarentees their are no transmission errors. (direct wiring from the serial port on the pc to the pins on the microprocessor. it either works or it doesn't, no errors.)

    Next, as for HTTP. It's not parsing your request at all. Send garbage and it'll work. It just looks at the port the connection is coming in on, then looks up the port number in a table, which tells it what file to send.

    Under those circumstances, it's not that hard to make a server that small if you know how to code in asm, especially not on a PIC chip.

    Ed

  4. It just MIGHT be possible! See below... by Jason-IPS · · Score: 2

    Here's a page for a class project at UBC that might lend a little credibility to this:

    http://casas.ee.ubc.ca/475.tinystk.html

    It's short, so I'll quote it here:

    Tiny TCP/IP Stack

    TCP/IP has become the most widely used protocol for data communications. Although several free versions of software to send and receive data using TCP/IP are available, this code is too large to embed in small microcontroller-based products.

    The purpose of this project is to write the smallest possible TCP/UDP/IP stack that is interoperable with most existing software (even if not necessarily standards-conformant).

    You will be supplied with the relevant standards (RFCs) and a sample implementation (BSD 4.2) as a starting point. The success of the project will be measured by the size of your implementation (the target is approximately 2k of code and less than 1k of data). The code will be written in C. You will demonstrate your implementation by writing a very simple HTTP server operating over a SLIP link.

    Project Status

    We succeeded in getting a very small (about 1kB RAM, 2kB ROM) HTTP server. However, it ignored all IP options and only implemented the TCP protocol. The server could only serve two very simple HTML pages which were stored in ROM. It took two students a total of about 120 hours. We used only SLIP over a 6850 serial port to keep the physical interface as simple as possible. Due to the space constraints, the code "squashes" all layers of the protocol stack (SLIP/IP/TCP/HTTP) into one. It cannot be used as a general purpose stack. The code is not available.

  5. Re:Me too! Yup, slashdotted. Bet its fast tho! ;) by Sun+Tzu · · Score: 2

    ...or, maybe a bug ate it. They got bugs in that part of the world big enough to eat a whole web server!

  6. Smallest WHAT? by Anonymous Coward · · Score: 2

    They should have a competition for the world's smallest webmaster. That'd be cool too :o)

  7. You know what would rock? by DonkPunch · · Score: 3

    Beowulf cluster! Just wire up a bunch of them! A complete cluster that fits in your pocket!

    Although the phrase "pocket cluster" makes me a little uneasy....

    (No, I'm not serious.)

    --

    Save the whales. Feed the hungry. Free the mallocs.
  8. What, again? by anticypher · · Score: 3

    This webserver was on /. about 2 months ago. It was generally agreed the "compliant TCP/IP stack in 256x12 bit words" was bogus.

    Although the web page has been updated to include more info, I'm still a bit skeptical. Now it has a ROM and the iPIC, so they might be able to allow single connections and serve up a simple page.

    Lets see the source code (granted, its going to be hand crafted binary)

    the AC

    --
    Hemos is like...sci-fi fans;he thinks technology is cool, but he hasn't bothered to understand the science it's based on
  9. Maybe not. by John+Campbell · · Score: 2

    Near as we were able to determine the last time this article popped up, eternity is not the bitty machine, it's a regular old Digital Unix box that's acting as a SLIP router for the bitty machine. If you examine the HTTP response from eternity, you'll notice that it's actually a redirect to another IP and port. If you follow the redirect, you get the page. That's what I found last time, anyway... I can't seem to get through just now to paste the actual HTTP response up...