Académique Documents
Professionnel Documents
Culture Documents
for Contiki
Yang Deng
Background
Validate algorithm
Observe communication
Cooja Overview
COOJA ensures that each simulated node only handles one event
Cooja Overview
Node 1
Node 2
Node 3
Set memory
Node X
Tick
Node Type
Get memory
Node N
re
Di
JNI
AP
I
Java Function
Application Level
Pure-Java Nodes
Call process_run()
MSPSim Emulator
In native nodes node type acts as a link between a node and loaded
Contiki
COOJA makes JNI calls from Java Runtime to C Runtime
JNI calls contain a few functions: initialize stack, copy and replace
memory, tick the node and get address of variables
Every node stores a copy of data memory (BSS and DATA segment)
but all nodes of the same type share the same program code (TEXT
segment)
Data memory is copied to C Runtime before Contiki code executes
and after that it is fetched back to Java Runtime
Map-file is used to parse the address of variable and function in order
to communicate with C Runtime; also used for debugging
Stack is not copied as correct Contiki code should not use stack as a
storage point between events (due to protothread)
Loaded Contiki
JNI
Memory
Stack
BSS
DATA
TEXT
C Runtime
initialize
Simulated Node B1
Simulated Node A1
Memory Copy
Memory Copy
BSS
BSS
DATA
DATA
Interfaces
Interfaces
get/set memory
get/set memory
Simulated Node BN
tick
Node
Type
B
Node
Type
A
Loaded Contiki
Memory
initialize
get/set memory
Memory Copy
BSS
BSS
DATA
DATA
Interfaces
Interfaces
Stack
BSS
get/set memory
DATA
tick
TEXT
Simulated Node AN
Memory Copy
Java Runtime
JNI
C Runtime
USART
CC2420
I/O Ports
LEDs
MSP430
Emulator
USB
Button
Working Together
Project
Source Code
make target=
Firmware/Bin
Native
Hardware
COOJA
Simulation
Results
Z1
Sky
MicaZ
Corresponding Testbeds
Experimental
Results
ESB
Evaluation
On average, Pure-Java runs 1.7 times faster than native nodes
and 50 times faster than emulated nodes
Pure-Java Nodes
Native Nodes
Emulated Nodes
Level
Application
OS
Instruction
Contiki
No
Yes
Yes
Deployable
No
No
Yes
Speed
Fastest
Fast
Slowest
Memory
Smallest
Small
Largest
Usage
Normal cases
Cycle-accurate emulation
Scalability
>10
>3x10
<100
References
A. Dunkels. Full TCP/IP for 8-bit architectures. In Proceedings of The First International Conference on Mobile
Systems, Applications, and Services (MOBISYS 03), May 2003.
A. Dunkels, B. Gronvall, and T. Voigt. Contiki a lightweight and flexible operating system for tiny networked
sensors. In Workshop on Embedded Networked Sensors, Tampa, Florida, USA, November 2004.
A. Dunkels, F. Osterlind, and Z. He. An adaptive communication architecture for wireless sensor networks. In
Proceedings of the Fifth ACM Conference on Networked Embedded Sensor Systems (SenSys 2007), Sydney,
Australia, November 2007.
J. Eriksson, A. Dunkels, N. Finne, F. Osterlind, and T. Voigt. MSPSim an extensible simulator for MSP430equipped sensor boards. In Proceedings of the European Conference on Wireless Sensor Networks (EWSN),
Poster/Demo session, Delft, The Netherlands, January 2007.
F. Osterlind, A. Dunkels, J. Eriksson, N. Finne, and T. Voigt. Cross-level sensor network simulation with COOJA.
In Proceedings of the First IEEE International Workshop on Practical Issues in Building Sensor Network
Applications (SenseApp 2006), Tampa, Florida, USA, November 2006.
Joakim Eriksson, Fredrik sterlind, Niclas Finne, Nicolas Tsiftes, Adam Dunkels, Thiemo Voigt, Robert Sauter,
and Pedro Jos Marrn. 2009. COOJA/MSPSim: interoperability testing for wireless sensor networks. In
Proceedings of the 2nd International Conference on Simulation Tools and Techniques (Simutools '09).
Nicolas Tsiftes, Joakim Eriksson, Niclas Finne, Fredrik sterlind, Joel Hglund, and Adam Dunkels. 2010. A
framework for low-power IPv6 routing simulation, experimentation, and evaluation. SIGCOMM Comput. Commun.
Rev. 41, 4 (August 2010)
Fredrik sterlind. A sensor Network Simulator for the Contiki OS. SICS Technical Report. February 2006.