Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Wireless Networking Technology Hardware

Adam Dunkels on Embedded Sensor Networks 31

tl writes "netzstaub has posted an extensive interview with Adam Dunkels, a computer scientist working in the field of wireless sensor networks and author of the open source lwIP and uIP embedded TCP/IP stacks, the Contiki OS, and the Protothreads library. The interview touches on protothreads, sensor networks, TCP/IP, Contiki, and embedded software development. Many Slashdot readers probably remember the tiny Contiki OS from previous articles where, not surprisingly, clustering has been discussed. From reading the interview, it seems Contiki clusters now have come true."
This discussion has been archived. No new comments can be posted.

Adam Dunkels on Embedded Sensor Networks

Comments Filter:
  • by cmburns69 ( 169686 ) on Saturday March 05, 2005 @12:36PM (#11852781) Homepage Journal
    "...Contiki clusters have come true"

    A cluster of contiki boats [thefeed.no]? Wouldn't that be called a navy?
  • Article tesxt (Score:3, Informative)

    by Sadiq ( 103621 ) on Saturday March 05, 2005 @12:37PM (#11852791) Homepage
    Interview with Adam Dunkels

    I discovered Protothreads through a link in Chris Double's weblog on Saturday. This is a fascinating tiny library, written by Adam Dunkels, a researcher at the Swedish Insitute of Computer Science. The Protothreads library implements user-level in threads in portable ANSI C in a mere 20 lines of code, and each thread uses only 2 bytes of RAM! While having a few important limitations, this comes in handy for a lot of problems, especially when writing single-threaded network servers (using Protothreads, you don't have to use state machines to do protocol handling). While checking out Protothreads, I stumbled across the very interesting link list that Adam Dunkels compiled while writing his library. From there, I got hooked and browsed the rest of Adam's website.

    He has written two incredible TCP/IP stacks aimed at embedded systems. The first one, uIP, is targeted at 8bit microcontrollers, and has a very low RAM usage (it runs with as few as 128 bytes RAM for full TCP/IP support). The development version of uIP uses Protothreads to offer a BSD-style socket interface while maintaining its low RAM usage. The second stack, lwIP, is targeted at bigger embedded systems, and offers a BSD-style API.

    Adam is a computer scientist working in the field of sensor networks, which are a part of the research field of ubiquitous computing. Sensor networks consist of a myriad of little embedded systems gathering environmental data through a set of sensors. However, the real value of sensor networks stems from the communication between all these systems. As Adam put it, "the nodes are interchangeable: it is the data generated by the sensors that are the primary interest". Besides uIP, which he uses as a mean to communicate between the sensor nodes, Adam works on Contiki, an embedded operating system. Contiki allows the dynamic loading of code on sensor nodes, which proves to be very useful when deploying sensor networks.

    I emailed Adam a few questions about his software, embedded programming and sensor networks. He was very kind to provide exhaustive and very interesting answers. Enjoy the interview :)

    Protothreads

    These first three questions are about Protothreads, the minimal threading library Adam has written for his embedded platforms. Protothreads are inspired by coroutines, which can be sort of implemented in C using a neat little trick.

    Question: Adam, what was your motivation to write protothreads?
    Answer: The driver behind the development of protothreads was many years of writing event-driven code. After a while, one sees the need to have a nicer abstraction than finite state machines. Ordinary threads have many of the good properties of such an abstraction, but they have two problems: the RAM overhead is prohibitive on systems with very small memory resources ---the typical target system for uIP---, and they require a fair amount of platform specific code. As I wanted to keep both uIP and Contiki as portable as possible, this was definitely a problem.

    After thinking long and hard about this, as well as reading lot of papers on the subject of concurrency, the protothreads concept dawned on me. Very simple, yet powerful. Very little RAM overhead and possible to
    implement in pure C. Perhaps the nicest thing is the extremely small size of the implementation. With all comments removed, the entire library can be reduced to 20 lines of code (that goes into a header file, no less!).

    Question: What kind of software uses Protothreads currently?
    Answer: Currently, the Contiki OS and the development version of the uIP TCP/IP stack are using protothreads. Among other things, they are used to implement a network API called "protosockets", which are similar to the BSD socket API but based on protothreads. This means that they can be used without underlying full multithreading, which subsequently means less RAM overhead.

    Question: What kind of software do you think will use Protothreads in the future?
    Answer: I
    • From my point of view, the most interesting thing with uIP in theCubeSat kit is the extremely small packet buffer that is used. The RAM footprint for the entire uIP stack is as small as 128 bytes, where something like 96 bytes was used for the packet buffer. I never thought that such a small RAM configuration would ever be used in my pants. In their system, however, the space-to-earth communications link is not fast enough to warrant a larger buffer anyway.

      Strange enough as it is that someone would post t
  • Cool... (Score:4, Funny)

    by Alwin Henseler ( 640539 ) on Saturday March 05, 2005 @12:49PM (#11852882)
    Now with these tiny embedded sensor networks embracing TCP/IP support, you can hack up worms that don't only infect those numerous Windows boxes, or your cellphone, fridge, toaster or coffee-maker, but also your toilet, smoke detector or temperature sensors embedded in the walls of your home?

    Damn! Isn't there anything in this world safe from TCP/IP packets? Back in the old days, people would respect them, and only allow full-featured computers & OS'es to exchange them. What's becoming of this world, I ask you?

    • Ever since I've seen the LG fridge (with built in computer) that's pretty much what I've been thinking too (and not in a funny way).

      It may be far off still (I've seen more appliances coming out with computers like that - a LG microwave recently), but eventually, we may have to visit some "toaster update" site every once in a while, update your AV and firewall for it...

      And that's hoping it doesn't get beyond that, which wouldn't surprise me seeing the ridiculous convergence we see lately in phones and what
  • Slashdotted already (Score:2, Informative)

    by adeydas ( 837049 )
    Mirror [mirrordot.org] to Adam Dunkel's homepage.
  • I'm very interested in the Protothreads library sourcecode mentioned in the article - the whole 20 lines of it! Yet, the site is slashdotted and Google doesn't seem able to find it...

    Does anyone know where i could check it out?
  • by renoX ( 11677 ) on Saturday March 05, 2005 @12:54PM (#11852916)
    The article give a link to an article describing a trick to implement coroutines in C, I found it quite enjoyable to read:
    http://www.chiark.greenend.org.uk/~sgtatham /corout ines.html

    It is nice for a change to read about an "ugly trick" which is used to increase readability!
  • Imagine... (Score:1, Funny)

    by NuclearDog ( 775495 )
    Imagine a beowulf^H^H^H^H^H^H^Hcontiki cluster of those things!

    Oh... wait...
  • by Anonymous Coward
    I would like to see a local weather collaboration system.
    If we could have cheap weather stations and webcams staring at the sky, linked together with users multiple users per town then MythTV could not only say if today will have some rain, but could verify if I can bike to the train station without getting wet.

    The sensor network of webcams could track and predict individual clouds and rainfall as a the wind pushes a raining cloud across the sensor network of multiple webcam equipped homes.
    • I've long thought this would be a great idea, get the local TV (or other) broadcasters to push it, and distribute cheap sensors that you plug into your computer, and then use the network to process the data, thus giving you very high resolution forcasting for any urban area.
  • The article and references are, of course, Slashdotted. Are sensor networks subject to hallucinations? That is, are they secure enough to prevent false input (intentional or otherwise)?
  • I actually met Adam while he was in high-school. One of my childhood friends was in the same high-school class as he was.

    We arranged what we called a "hack" (essentially a more fun LAN, long before the LAN-scene came to be) where we assembled a shitload of computers at someones house and did all kinds of goofy stuff (programming, graphics, music, pranks, etc) and had a blast for 2-3 days at a time.

    This guy is probably a bona-fide genius. I remember him lugging his C64 there, and he decided to show us one

It is easier to write an incorrect program than understand a correct one.

Working...