Christoph Borchert, Daniel Lohmann, and Olaf Spinczyk
Internet protocols are constantly gaining relevance for the domain of mobile and embedded systems. However, building complex network protocol stacks for small resource-constrained devices is more than just porting a reference implementation. Due to the cost pressure in this area especially the memory footprint has to be minimized. Therefore, embedded TCP/IP implementations tend to be statically configurable with respect to the concrete application scenario. This paper describes our software engineering approach for building CiAO/IP - a tailorable TCP/IP stack for small embedded systems, which pushes the limits of static configurability while retaining source code maintainability. Our evaluation results show that CiAO/IP thereby outperforms both lwIP and uIP in terms of code size (up to 90% less than uIP), throughput (up to 20% higher than lwIP), energy consumption (at least 40% lower than uIP) and, most importantly, tailorability.
Camera ready: http://www.danceos.org/publications/MobiSys-Draft-2012-Borchert.pdf
Project page (view source code): http://ess.cs.tu-dortmund.de/Software/CiAO-IP
Public Review uploaded by PrabalDutta:
Public Review for Paper #181 by Prabal Dutta
Many embedded devices are memory-constrained. Yet, the desire to
network them using standards-based Internet protocols is growing.
Since the network stack is often the single largest codebase in an
embedded system (e.g. sensor node), supporting standards-based
protocols can put significant pressure on a scarce (and costly)
resource. System designers have responded by cautiously eliding
optional functions from networking codebases on a per-application
basis. However, most network stacks are structured such that the
implementation of a particular function occurs across many files or
modules. Such scattering and tangling of features means that code
modifications are often tedious and error prone.
This paper presents CiAO/IP, an aspect-oriented programming- (AOP)
based IP stack. The paper argues that AOP techniques can address the
tension between configurability and maintainabilty without sacrificing
code size or efficiency. Unlike prior network stacks, in CiAO/IP,
every feature is optional, so the design provides feature-footprint
proportionality. The paper works through an example of how to apply
AOP to (iteratively) identify configurable networking features, map
them to hierarchical dependencies, and these in turn into code that
prepends, appends, replaces, or eliminates methods (and their
This methodology results in a nearly linear increase in (and more
compact) code size from ~2 KB to ~20 KB as the number of features
increase from zero to 20 or more (with one significant jump in code
size for a particular monolithic feature). A side effect of exposing
(and modifying) functionality in this manner is that conservative
timeouts and other baked-in constants can be more easily optimized,
which can sometimes lead to lower energy consumption.
The program committee discussed this paper at length and accepted it
only after several rounds of vigorous debate. The main issue was that
some reviewers were unable clearly identify the novel contributions of
the work. AOP is not new, some argued, and the authors' own prior
work that appeared at a recent Usenix ATC bore similarities. Others
argued that a proper evaluation would require a user study, and still
others argued that the paper was about programming languages rather
than network software design and implementation. And still others
argued that the energy efficiencies were accidental rather than
In the final analysis, this paper was accepted on the grounds that its
key contribution was to show that applying AOP techniques to a new
domain -- networking stacks -- is promising from a code maintenance
perspective without incurring an obvious size or performance hit.
Some remarked that other recent efforts at fine-grained modularity and
reuse, like TinyOS, had mixed results -- great efficiency was achieved
but at the high cost of making code maintenance by nearly all but the
original authors quite difficult.
Only time will tell whether this new design point -- an case study of
how to apply an AOP-based approach to building a network stack for a
IP-enabled device -- will be useful, can be adopted more broadly, and
will result in small, maintainable, and efficient code. The network
stacks of a trillion IP endpoints over the next decade or two hang in
This public review was prepared by Prabal Dutta.