Learning about Cooja¶
Main features of Cooja:
GUI
Multiple mote types (can be mixed in a single simulation!):
- Java mote
Motes are Java classes implementing proper interfaces. Can be easily integrated with Cooja, but do not simulate mote hardware precisely and are not very fast. There is a special type – Disturber mote – to introduce disturbance/noise into a simulation.
- Cooja mote
Apps are compiled for your PC architecture and are run as native processes. Fast but do not simulate mote hardware precisely. (Work only on 32-bit Linux.)
- Emulated mote (e.g. Sky mote)
Apps are compiled for the targeted mote, Cooja emulates the hardware in a cycle-accurate way (using MSPSim – Java-based instruction level simulator for the MSP430 microcontroller – under the hood). Precise simulations of motes, but not so fast.
Multiple radio medium models:
- DGRM (Directed Graph Radio Medium)
The most similar to TOSSIM. You specify RSSI and RX success ratios for each link between motes.
- UDGM (Unit Disk Graph Medium): Distance Loss
Draws 2 disks around each mote – how far its message can be received and how far its message can interfere other transmissions. You specify TX and RX success ratios. RX success probabilities are calculated from those ratios and distances between motes.
- UDGM (Unit Disk Graph Medium): Constant Loss
Like UDGM Distance Loss but disregards distances between motes.
- MRM (Multi-path Ray-tracer Medium)
The most advanced one. Implements 2D ray-tracing, reflections and refractions through obstacles, capture effect, etc.
Multiple build-in tools: Network diagram, Mote output, Timeline, Radio messages, Power tracker, Serial port access, LEDs status, … Some views are synchronized – e.g. press Space on a message in Mote output to wind Timeline to that moment.
Preparing environment¶
In our case you should be able to run Cooja without any need to install additional packages.
Try:
$ cd tools/cooja
$ ant run
Cooja should start in a while.
In case of any problems, consult An Introduction to Cooja.
Node IDs and RIME addresses¶
Each mote in Cooja has its Node ID (1, 2, …). A mote’s RIME address corresponds its Node ID: <ID mod 256>.<ID div 256>, i.e.: 1.0, 2.0, …, 255.0, 0.1, 1.1, …