World's Smallest Web Server (We Have a Winner) 189
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.
If it's hacked... (Score:1)
Re:it's not the bytes; it's the words... (Score:1)
Who cares if you can't fit a friggin' header in, compute everything you need on the fly and shuttle it out the port as you do it!
Re:it's not the bytes; it's the words... (Score:1)
--
I'm skeptical too, (Score:1)
http://www.umass.edu/newsoffice/press/99/0810sh
Usefulness? (Score:1)
--just my two cents.
Re:Poor thing! (Score:1)
Re:It can be done (Score:1)
stateless TCP/IP protocols:
These protocols, particularly HTTP, don't maintain a persistent connection between browser and server. Each request from the browser is an independent contact, as is each response from the server. Problems : Developers can no longer rely on a network connection that remains active for the duration of a session.
now why did your boss prevent you from explaining this ?
Claims eternity just does a redirect (Score:1)
I'm still skeptical, but this sure would be neat.
Uh, obvious question (Score:1)
What would really impress me... (Score:1)
Re:Old news [here's the link] (Score:1)
Less or more complicated? (Score:1)
I would think that adding a web interface to our household appliances would make them more complicated and difficult to operate. I mean, how hard is it to press "play" on your DVD player?
Joe Rabinoff
Re:DOS your toaster (Score:1)
All these tiny servers are pretty useless, because they're basically single function devices. There's a massive difference between serving a page and enabling web-based control over an appliance.
I'm betting that a device to allow dynamic content/CGI/whatever you need to control an appliance would be exponentially more expensive and bigger than anything we've seen here. At least PalmPilot sized.
---
I switched to NT when Linux crashed five times in one day. Funny, I used to tell people Linux was superior due to its stability.
iPic (Score:2)
If I recall, it doesn't interpret HTTP requests, but serves you a document based on whichever port number you connect to it via.
Webserver Matches? (Score:1)
If they can make an entire PC this small, does that mean they can make a beowulf cluster the size of a softball? How fast is this thing? I couldn't find any real stats on it on the website... It would be nice to know just how powerful this little thing is, and how much it costs. From the picture it looks like that if those 2 chips aren't phenomenally expensive it's a 5$ radio shack system.
Kintanon
Old news (Score:2)
How many /.ers can dance on the head of a match? (Score:1)
/. strikes again.
Re:Old news (Score:1)
(SLIP?) so there's another machine at the IP, acting as a gateway...
I don't know about TCP/IP in 512b, but I suppose
at least a limited stack could fit.
--Kevin
=-=-=-=-=-=
Me too! (Score:1)
Poor thing! (Score:1)
Re:Webserver Matches? (Score:1)
Won't it be interesting when some script kiddie starts hacking peoples houses? Poltergeist! Poltergeist!!
Kintanon
Re:Webserver Matches? (Score:1)
Kintanon
Demo link works, but this is OLD NEWS. (Score:1)
However, this is
- NOT NEWS
. This identical item was on Slashdot a few weeks ago, and then the article suddenly disappeared.To re-post this as a new item is misleading and a disservice to the Slashdot community.
IPv6 (Score:1)
Re:Scam? (Score:1)
(you can get in, but it proves nothing..
Re:Hey!!! (Score:1)
I GOT IN!!! (Score:1)
Slashdotted demo. (Score:1)
But seriously, imagine a webserver embedded in your answering machine (with IPv6 this is possible) so that you can check your messages from your web browser at work. I didn't read the whole thing, but this baby can't draw much power. I think that a 9volt would run this thing for several months.
LK
Re:It can be done (Score:1)
Hmm, if that's the truth... (Score:1)
Hmm, (Score:1)
melt down! (Score:1)
"Looking around to find the melted remains of the teensy server, the team of intensely trained, tweezer-armed sweepers were saddened to find that it had been swept up."
Re:You know what would rock? (Score:1)
oh just forget it.
-Chris
Re:Scam? (Score:1)
Re:Less or more complicated? (Score:1)
Get serious! It's just a hack on a router. (Score:1)
And it looks [hpie.com] smaller than a credit card.
Re:Hey!!! (Score:1)
Bill Gates: "look at those geeks.. they'll believe anything. Hmm my next lie will be that I will open source windows and do a code merge with linux.. that'll turn some heads"
Ugh... vaporware smells worse than my underwear...
Here's how it works (Score:4)
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
Re:wow, that's small (Score:1)
They should put them in cereal. Then you could say "I eat webservers for breakfast!".
Added bonus - once you'd digested it you could still say you had one up your butt.
+++++
Re:Here's how it works (Score:1)
Re:Why web? (Score:1)
Re:It's for virtual consoles. VERY useful. (Score:1)
It's a Kitchen Aid, model Ultra Power Plus. Single slot, wide enough for a split bagel or two slices of ultra-thick french toast bread. Plastic outside to prevent burns if you bump it. Picked it up at Fry's.
Controls:
Shade control: Button: lighter, Button: darker. 7-segment LED showing current setting. (This stuff simulates a slider.)
Options: Button/light: reheat. Button/light: frozen. Button/light: bagel. Button: stop/reset.
Miscelaneous indicator: Light: toasting.
In other words, a computer controls the timing of the cycle. (I haven't seen any indication that it modulates the power level or only lights one side for bagels.) It provides a convenient interface in terms of type and state of bread and desired doneness, computing the required cycle time.
Unlike a mechanical thermostat, it can compensate for the toaster being preheated, so if you do a second set of slices right after the first they come out the same. And you don't have to burn up a couple loaves or bags of bagels or waffles figuring out the right slider setting.
It is a hoax. (Score:1)
They claim to have a PIC 12C509 microcontroller
running at 4 MHz, and a serial link running
at 115.2 kbps. Let's look at that closely.
The first thing that I notice is that there
isn't any RS-232/422/485 line drivers on
their PCB, so that brings up some credibility
problems. But, I'll give them the benefit
of a doubt on this one.
That particular PIC doesn't have a UART on
it. So, they must "bit-bang" the UART function
in software. This CPU executes an instruction
every 4 clock cycles, or at 1 MIPS at the
specified 4 MHz. That works out to be 8.68
instructions per bit. Anyone who has bit-banged
a UART knows that it's damn near impossible to
do a UART in that many instructions, and even
if they managed to pull it off they have NO
time for anything else, like serving up a web
page.
Next is the claim of using the internal
RC oscilator for this CPU. Now, RC oscilators
are not particularly accurate things. In
fact, at a supply voltage of 2.5 volts that
CPU has an oscilator frequency range of 3.5
to 4.26 MHz. Since this clock is also
used as the alleged baud rate generator,
any inaccuracy in this clock translates
to an inaccuracy in the baud clock. Thus,
there is 12% error in their baud rate.
Now, in many situations an error of more
than 5% is a bad thing and would cause
severe communication errors.
So their claim of a serial connection
at 115 kbps is doubtful at best. Never
mind the difficulty of putting a TCP/IP
stack and web server into that thing.
-David Kessner, davidk@free-ip.com
Re:What, again? (Score:1)
Good old Dr. Nather (Score:1)
God, was that man cool.
I had previously read The Story of Mel, but it wasn't until just now that I put the two together.
He got his Bacherlors in 1947, and his Doctorate in 1972 (I had a bad habit of checking out my prof's credentials). I always meant to ask him what he did for those 25 years; now I guess I know.
Check out Ed's work with the Whole Earth Telescope [utexas.edu] sometime. It's pretty cool.
Don Negro
Will wonders never cease? (Score:1)
Re:Umm... people... (Score:1)
Who says that the gadget has to implement a complete TCP/IP stack? There are all sorts of ways to do this with a minimal subset of TCP/IP and HTTP. I've seen very small TCP/IP stacks used in systems that boot over a network. It wouldn't be difficult to write software for a micro-controller that would receive IP packets over a serial SLIP link, extract the sender's IP address and port number, and send a canned web page back over the SLIP link. I'm sure it could be done in 512 words of memory.
Re:see what you can do in a small amount of code (Score:1)
it's not the bytes; it's the words... (Score:1)
So it's not 512 bytes, it's 512 cleverly crafted words...
jeff
there are 3 kinds of people:
* those who can count
Re:Not with an 8-pin PIC! (Score:1)
Re:Webserver Matches? (Score:1)
Re:What, again? (Score:1)
I am a self-proclaimed expert on PIC devices, having worked with them since 1995 and writing over 50000 lines of assembly language on these things.
the 12C509 runs on an internal RC oscillator at 4MHz unless otherwise tickled, which these guys aren't doing. That means it does 1MIPS.
doing 115200bps at 1 instruction per us means that you have 8.6 instructions to get that bit out, not including tickling the SDA/SCL lines to do sync. serial to the I2C EEPROM, nor the filesystem overhead, nor the TCP/IP overhead. There is no room for a FIFO, no room for a TCP/IP stack, no room for a filesystem.
The I2C interface to the EEPROM takes up a fair amount of code in itself, as does the async. communications.
The chip has 512 bytes of PROGRAM memory, not data memory, of which this has (I think) 48 bytes.
In short. No. Not unless the host computer is doing a LOT of work for it, in which case this isn't a "complete web server" now, is it?
Ya know what these MIGHT be good for though... (Score:1)
Now you have an army of quick little PICs to do your bidding around the house. Now you have your toaster, light bulb, microwave, catfood-dispensers all controlled from the web. Anything that requires some power (relays, etc.) will either be AC relays driven with a triac or will use a heftier power supply, since the base unit would only need about a milliAmp or so of current to talk and sense.
And... AND.. it's not fraud this time!
... Every device doesn't need to be TCP/IP. Just one. the rest need to be able to talk to this proxy. Why put all the power in each device like that?
I thought reruns were only on TV (Score:1)
--
Dave Brooks (db@amorphous.org)
http://www.amorphous.org
Re:Ya know what these MIGHT be good for though... (Score:1)
the IDs/capability bits will let you run an DHCP/BOOTP-style program on the server so you don't have to allocate addresses. Just look at the MAC and go.
one control module per phase in the house and any number of minions..
Re:Not with an 8-pin PIC! (Score:1)
Re:Here's how it works (Score:1)
Re:Old news [here's the link] (Score:1)
Besides, I didn't see UMass on that list.
Re:How about smart card web servers? (Score:1)
factoid server? (Score:1)
-Lx?
More believable PIC based smallest Web server (Score:1)
http://www.mycal.net/wsweb/ [mycal.net]
Re:What, again? (Score:1)
"I want to use software that doesn't suck." - ESR
"All software that isn't free sucks." - RMS
Missing the point (Score:1)
Re:What would really impress me... (Score:1)
From the info on his web page, it looks like he's working on that.
Re:What, again? (Score:1)
Re:What, again? (Score:1)
eh? why's that? Assembly is just as optimized as machine code, but you can read it.
Andrew
Applications for the TCP/IP stack (Score:1)
But there are a whole lot of applications for a TCP/IP stack so small. I don't want to administer my toaster using the web. I hate the web. Its bloated. But if I'm to administer my toaster at all, it has to be done so using a protocol implementable for less than a dollar on a cheap PIC. I don't want Jini with Sun bloat, or the web and its bloat. Whomever was able to implement that TCP/IP stack (if its real) should be working on a lightweight toaster administration protocol rather than running a damn webserver.
Re:IPv6 (Score:1)
There is a common misconception that I see people spreading that implies the wiring of one's home would require a real IP addy for your toaster, espresso machine etc... With IP masquerading and other tricknologies a house hold might only need one real internet reachable IP. Much like the people use a 486 linux box to connect their basement network to their dsl line
not that any of this has anything to do with the worlds smallest webserver...
It just MIGHT be possible! See below... (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 [ee.ubc.ca]
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.
I want one! (Score:1)
--
Re:Uh, obvious question (Score:1)
(Score:1)
Woohoo! There's a webserver caught up my nose! And it's cabled to a PC! Everybody dance!
Re:You know what would rock? (Score:1)
Re:Hey!!! (Score:1)
Re:Webserver Matches? (Score:1)
It says it's running at 4mhz and that the storage/RAM avalible is such that they couldn't even fit a complete OS kernel on it.
Re:Webserver Matches? (Score:1)
But I like your theory anyway... I'd be dying to get my hands on a beowulf softball!
Re:Poor thing! (Score:1)
I think we've just found a low-end machine that actually can't run Linux.
--
QDMerge [rmci.net] -- data + templates = documents.
Re: self-proclaimed expert on PIC devices (Score:1)
Anyway the whole excercise was proven NOT to be a "complete TCP/IP stack" as claimed, which was what I was originally pointing out. Yes a little chip with I2C can work with preformatted headers and when spoon-fed this data, spit out something in E2. That's not too impressive, and *is* doable.
Re:Me too! (Score:1)
A program of 512 words of ROM shouldn't be too hard to get rock solid.
Re:Poor thing! (Score:1)
I tried. Pity. There was only room for the first two characters.
sigh!
--
QDMerge [rmci.net] -- data + templates = documents.
Re:Me too! Yup, slashdotted. Bet its fast tho! ;) (Score:2)
Smallest WHAT? (Score:2)
Re:Webserver Matches? (Score:1)
They would just need a processor (Preferably better than 4mhz, but when you can put a million of them in a small cardboard box...) How many I/O cards would you need for something that isn't much more than another processor? In fact... I was wondering what the difference between a Beowulf cluster and a multiple proccesor server is. Maybe I'm just misunderstanding the function of a beowulf, but it seems to me that it's just a bunch of procerssors linked together. If I'm wrong someone let me know...
Kintanon
Not with an 8-pin PIC! (Score:1)
I also have never heard of ANY pic being able to do 115Kbps!
Re:it's not the bytes; it's the words... (Score:1)
it's 512 INSTRUCTIONS. each instruction is 12 bits wide, which allows you to embed a 7 or 8 bit byte into that program instruction.
The thing STILL only has (IIRC) 48 BYTES of data memory. Fit a TCP/IP stack into that. It won't be able to fit the goddamn header of a TCP packet in!
You know what would rock? (Score:3)
Although the phrase "pocket cluster" makes me a little uneasy....
(No, I'm not serious.)
Small? Bah. I want BIG! (Score:1)
Batter Power (Score:1)
Re:You know what would rock? (Score:1)
"It's not a tumor!"
It's for virtual consoles. VERY useful. (Score:1)
Back in the early days, control panels were built of discrete components. Every signal you watched needed a lamp, meter, drop flag, noisemaker, or the like. Everything you controlled needed its own switch, knob, slider, or whatever. Every gadget chewed up panel space, required its own expensive wiring back to the thing it monitored or controlled, and created another single point of failure.
Computers were no exception (and you need to control the computer in any system a computer controls.) But their guts were riding Moore's law, while control-panel tech improves more like manufactured products: Economy of scale and occasional inventions. These days a control panel is a bit more work and cost than a printed circuit board. But even if controls DID improve by Moore's law, eyes and fingers only improve at evolutionary rates - which is effectively not-at-all. So the amount of stuff to be controlled outran the panel space to control it.
By the '60s mainframes had more than one entire box dedicated just to the switches and blinky-lights, and it still wasn't enough. IBM was already multiplexing each row of blinky-lights across 16 functions with an associated rotary switch (that also changed the labels). Minicomputers were RISK and had less to display, but they were starting to do the same thing, or to skip displaying stuff of interest.
DEC broke through with the LSI-11. Configuration was still jumpers, but the panel was replaced with a debugger-like interface on the primary serial port. When Amdahl left IBM he saved a lot of work on his first mainframe by building his control panel from a DGC Nova controlling a couple projection displays. Cray did the same BEFORE he left CDC, using a couple big monitors controlled by the 6x00's peripheral processors.
Virtual control panels worked well for other things than computers, too. Factories began to be controlled from displays on screens. NASA scientists were amazed by a private rocket company who rented one of their engine test stands, but ignored the roomfull of control consoles and ran their test through a display hacked up on an early Mac.
At first virtual control panels still required special-purpose hardware and software for each application. Later they were done with software on a general-purpose small computer. But they still required a lot of custom software and were limited to one operating system.
HTML and CGI changed that. They provide a compact representation of arbitrary control panels and a means for switching between them, along with a convenient way to fill in variable display fields and to pass control-setting changes to the processor doing the controlling. And they allow one display to control a multplicity of devices over a network.
These days my toaster has a custom control panel, with six buttons, four LEDs, and a seven-segment display. My ADSL modem, on the other hand, gets away with one failure-prone moving part - the power switch - by using a web server for its panel.
Using web-based consoles the graphic interface is done for you, and the software is available (for FREE!) from multiple vendors for all popular platforms. Powerful graphic design tools are available off-the-shelf as well. The last missing link is the web server for the little embedded systems.
With a rudimentary comm stack and an even more stripped-down web server, filling in the blanks in canned pages and forwarding responses to a cgi-based command handler, you've got all the control and display you need. You can even flip from machine, so you only need one window to run the whole show.
The smaller the web server, the more of your tiny processor is available for useful work (or the smaller a processor you can get away with).
So that's why you suddenly see a flood of little web servers for embedded micros, and why it's very important.
It is a fraud (Score:1)
Trying 128.119.41.46...
Connected to 128.119.41.46.
Escape character is '^]'.
Digital UNIX (eternity.cs.umass.edu) (ttyp3)
login:
--------------
unless this guy implemented Digital Unix in 256 words too.....
Re:Applications for the TCP/IP stack (Score:1)
Appliance MAC (This is really the address)
Type (References a table in the client side that has applicable commands)
Exceptions (extra or omitted controls and returns specific to the device)
State (On/Off/Busy)
Commands
Returns
so you:
throw a MAC query onto your AN (Appliance Network) and it returns the appliances addresses, type, and exceptions. The client goes and gets the command structure from a table and adds/omits the exceptions. Client comes up with a nift menu of commands (however graphical or simple you want it). You throw a query packet to a MAC asking it's state, it says On, Not busy. You throw a series of command packets to program your VCR to record a rerun of the final episode of MST3K on channel 60 at 0300 on 11081999. VCR returns a 'program set' - checks for a tape - if no tape vcr sends a ATC (appliance to Client) packet saying 'load tape before program time of 0300 on 11081999'
oops forgot to load a tape - better do that.
:-)
fun fun fun. this is what I would love to do
-Onyx
Re:Applications for the TCP/IP stack (Score:1)
Appliance MAC (This is really the address)
Type (References a table in the client side that has applicable commands)
Exceptions (extra or omitted controls and returns specific to the device)
State (On/Off/Busy)
Commands
Returns
so you:
throw a MAC query onto your AN (Appliance Network) and it returns the appliances addresses, type, and exceptions. The client goes and gets the command structure from a table and adds/omits the exceptions. Client comes up with a nift menu of commands (however graphical or simple you want it). You throw a query packet to a MAC asking it's state, it says On, Not busy. You throw a series of command packets to program your VCR to record a rerun of the final episode of MST3K on channel 60 at 0300 on 11081999. VCR returns a 'program set' - checks for a tape - if no tape vcr sends a ATC (appliance to Client) packet saying 'load tape before program time of 0300 on 11081999'
oops forgot to load a tape - better do that.
:-)
fun fun fun. this is what I would love to do
Re:Webserver Matches? (Score:1)
Re:?? (Score:1)
http://amazon.imdb.com/Title/ASIN=630402925X?00
7200 hits an hour? (Score:1)
A really cool idea though.
Andrew (thinking a web controlled microwave is a really cool idea for some reason, except for when some cracker breaks in and overheats my lasagna)
DOS your toaster (Score:1)
Hey, anyone remember Segfault's preview page? iToast? =)
Re:Old news (Score:2)
You've never read the story of mel [tuxedo.org] 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.
What, again? (Score:3)
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
Maybe not. (Score:2)