Skip to content
Permalink
main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time

Cooja

Learning outcomes

  • Familiarity with Cooja basics
  • Know how to run and save a simple simulation

What is Cooja?

  • Java-based Contiki network simulation
  • Allows simulation of small and large networks
  • Two types of motes can be simulated:
    • cooja motes run native code
    • sky motes emulate the hardware but simulation may be slower as a result
  • You shouldn’t need to adjust your code to run in simulation

Getting started with Cooja

Prerequisites

$ ./contiki-ng/tools/vagrant/bootstrap-vbox-with-x.sh
  • Reboot after the install
  • I found that this added some virtualbox-guest packages which were then removed by vagrant’s vbguest plugin
  • If you don’t end up with a graphical login prompt, don’t worry—you can just run startx on the command line after logging in on the gui window.
  • You may need to download the cooja submodules if you haven’t already
    $ cd ~/contiki-ng
    $ git submodule update --init --recursive
        

Create a new simulation

Follow the tutorial listed here: https://github.com/contiki-ng/contiki-ng/wiki/Tutorial:-Running-Contiki%E2%80%90NG-in-Cooja

If you encounter errors, try the fix suggested here: https://github.com/contiki-os/contiki/issues/2324

figures/cooja-new-sim.png

Simple UDP RPL simulation

RPL is the Routing Protocol for Low power and Lossy Networks

https://github.com/contiki-ng/contiki-ng/wiki/Tutorial:-running-a-RPL-network-in-Cooja

figures/cooja-rpl-udp.png

Next steps

  • Try the other simulation tutorials out until you feel you have a good understanding about what’s going on.
  • Review the code for the client and server and identify where messages are being sent and received.

Summary

  • We’ve covered getting the simulation gui up and running and running a basic simulation
  • This tool should come in handy when you write your own code