Lightweight Ipv6 Stacks For Smart Objects: The Experience of Three Independent and Interoperable Implementations
Lightweight Ipv6 Stacks For Smart Objects: The Experience of Three Independent and Interoperable Implementations
Lightweight Ipv6 Stacks For Smart Objects: The Experience of Three Independent and Interoperable Implementations
November 2008
Introduction
Historically, smart objects have used a plethora of communication technologies, both at
the physical and medium access control layers, and at upper layers. The upper layers of
the communication stack remain either proprietary or specified by exclusive alliances.
This plethora of solutions renders interoperability between different sensor networks
difficult. It also makes the seamless integration of sensor networks with existing IP
networks impossible.
Interoperability is Essential
Interoperability is essential and the Internet Protocol (IP) is by far the most common
language of computer networks today. IP allows smart objects to communicate end-to-
end with other smart objects as well as existing IP-based devices. But IP devices must
adhere to a number of specifications that define the Internet architecture in order for them
to successfully join and participate in an IP network. IP protocols are defined by the
Internet Engineering Task Force (IETF)2 in the form of open standard protocols called
RFCs.
RFC4294 summarizes requirements for IPv6 hosts and routers. In particular, it states that
an IPv6 node MUST comply with the following standards: IPv6 Specification (RFC2460),
IPv6 Addressing Architecture (RFC4291), IPv6 Neighbor Discovery (RFC4861), Internet
Control Message Protocol for IPv6 (RFC4443), Stateless Address Autoconfiguration
(RFC4862), Default Address Selection (RFC3484), and Multicast Listener Discovery
(RFC2710, RFC3810).
The IPv6 Ready Logo program3 was developed to ensure compliance with the standards
required by RFC4294. IPv6 Ready delivers Phase-1, Phase-2 and Phase-3 logos that
correspond to three levels of certification. Phase-1 requirements include most of the
major building blocks of RFC4294. Phase-2 add support for ICMPv6 redirect messages
and Path MTU discovery (RFC1981), the latter of which is not required by RFC4294.
Phase-3 adds support for Internet Protocol Security (IPsec).
The KAME4 project is to IPv6 what the original BSD was to IPv4. The result of KAME
is a high-quality open-source implementation that is used today in all BSD distributions
(e.g. FreeBSD, NetBSD, OpenBSD, as well as Mac OS X). By leveraging the efforts
from KAME we now have a much better understanding of how to develop fully-
compliant IPv6 stacks that are efficient while providing high performance.
Today, there are a number of similar efforts that will help to drive the Internet and IP-
based protocols forward. Examples include IPSec (KAME, USAGI), SNMP
(openSNMP), Mobile IP (Helsinki University of Technology). In addition, the WIDE5
project offers implementations of tens of IPv6 related protocols in many areas such as
routing, management, real time applications, security, transport, etc.
Buffering
The IPv6 specification requires the link to support a 1280-byte MTU, imposing
significant challenges in supporting IPv6 on memory-constrained devices. A minimal
implementation can utilize a single 1280-byte buffer for the basic data plane. However,
the current Neighbor Discovery (ND) specification (RFC4861) requires a packet buffer
for each neighbor on the link and is prohibitively expensive for smart objects. The IETF
is currently discussing the relaxation of this buffering requirement as it is also viewed as
a security issue (i.e. DoS attacks).
The single packet buffer works well for host devices that do not forward datagrams.
Wireless mesh networks (e.g. IEEE 802.15.4) often span multiple hops and require some
4
http://www.kame.net/
5
http://www.wide.ad.jp/
or all devices to forward datagrams (and thus act as routers) to provide reachability
throughout the network. As a result, the store-and-forward technique requires nodes to
buffer additional packets that are being forwarded. One way to implement the forwarding
queue is to allocate full packet buffers for each entry in the queue. More sophisticated
approaches support variable-sized buffers that allow more effective use of the memory
especially when datagrams do not consume the full 1280-byte MTU.
Layer 2 Dependencies
The layered IP protocol architecture allows the network layer to remain agnostic to the
specifics of the link-layer below. IPv6 stacks implemented for smart objects do not have
to give up the layered protocol architecture in order to fit within the severe resource
constraints typical to smart objects.
In wired networks, the network layer only expects the link layer to provide services
necessary for delivering packets. Networks operating on constrained (e.g. low
throughput) links, however, can benefit from visibility between layers. On wireless links,
for example, knowledge of when packets are acknowledged and some indication of signal
strength can provide invaluable information to link estimators that are used by IP-based
routing protocols. Similarly, routing protocols could indicate which neighbors are most
important to optimize link-layer transmissions by providing visibility into the routing
table. Furthermore, the link-layer could deliver packets more efficiently if it had visibility
into the forwarding queue. For example, the link could optimize transmission of multiple
frames to the same destination and the link could appropriately schedule transmissions to
minimize average queuing delay. By providing this extra visibility in a link-independent
manner, we can significantly enhance the performance of an IP-based communication
architecture for smart objects while maintaining the layering.
Memory Requirements
An IPv6 Ready protocol stack can be implemented in approximately 11.5 kilobytes of
ROM and 1.8 kilobytes of RAM. To support the 1280-byte minimum MTU, a single
packet buffer requires 1280 bytes of RAM. Of the remaining data structures, the neighbor
cache requires 35 bytes per neighbor, the prefix list requires 23 bytes per prefix, the
router list requires 7 bytes per router, and the interface address list requires approximately
100 bytes. Table 2 provides a breakdown of the typical memory requirements for
individual components. (Fragmentation and per-neighbor buffering are not included).
Neighbor Discovery consumes the largest portion of the complexity.
ND Input/Output 4800 20
ND structures 2128 238
Network interface management 1348 118
Stateless address autoconfiguration 372 16
IPv6 (headers processing, etc) 1434 44
Packet buffer (Ethernet case) 0 1296
ICMPv6 1406 16
Total 11488 1748
Table 2: Typical code and memory requirements for a complete IPv6 protocol stack.
Energy Requirements
Battery-powered smart objects are constrained not only in memory, but in energy as well.
With appropriate link-layer mechanisms and experimental modifications to IPv6 (e.g.
compression and ND optimizations), it is possible to implement an IPv6 network stack
that consumes very little energy. In production deployments, an IPv6/802.15.4 network
can operate at sub-1% duty-cycles (including forwarding nodes), with very low per-hop
latency and high reliability under realistic work-loads.
Conclusion
This work demonstrates that even the most memory constrained devices can be IPv6
Ready. We have shown that it is also possible to implement an IPv6-based network on
energy constrained devices and are currently specifying optimizations (e.g. IPv6 header
compression and IPv6 ND modifications) to reduce the energy requirements of
supporting a complete IPv6 network stack. These efforts provide a framework that will
enable further advancement of IPv6 support for smart objects. For example, the IETF is
currently working on routing algorithms for low-power wireless devices (ROLL Working
Group). In addition to routing, support for end-to-end IPv6-based security mechanisms
(e.g. IPsec, SSL, or TLS) still require some evaluation.
RFC References
[1] Conta, S. Deering, and M. Gupta. Internet Control Message Protocol (ICMPv6) for
the Internet Protocol Version 6 (IPv6) Specification. RFC 4443, IETF, Mar. 2006.
[2] S. Deering, W. Fenner, and B. Haberman. Multicast Listener Discovery (MLD) for
IPv6. RFC 2710, IETF, Oct. 1999.
[3] S. Deering and R. Hinden. Internet Protocol, Version 6 (IPv6) Specification. RFC
2460, IETF, Dec. 1998.
[4] R. Draves. Default Address Selection for Internet Protocol version 6 (IPv6). RFC
3484, IETF, Feb. 2003.
[5] R. Hinden and S. Deering. IP Version 6 Addressing Architecture. RFC 4291, IETF,
Feb. 2006.
[6] J. Loughney. IPv6 Node Requirements. RFC 4294, IETF, Apr. 2006.
[7] G. Montenegro, N. Kushalnagar, J. Hui, and D. Culler. Transmission of IPv6 Packets
over IEEE 802.15.4 Networks. RFC 4944, IETF, Sept. 2007.
[8] T. Narten, E. Nordmark, W. Simpson, and H. Soliman. Neighbor Discovery for IP
version 6 (IPv6). RFC 4861, IETF, Sept. 2007
[9] S. Thomson, T. Narten, and T. Jinmei. IPv6 Stateless Address Autoconfiguration.
RFC 4862, IETF, Sept. 2007.
[10] R. Vida and L. Costa. Multicast Listener Discovery Version 2 (MLDv2) for IPv6.
RFC 3810, IETF, June 2004.