cooja final
cooja final
cooja final
networks but has inherent vulnerabilities such as plaintext communication, replay attacks, and resource
exhaustion. Using Cooja to simulate an IoT network with CoAP devices, traffic can be captured via its
packet sniffer and analyzed in Wireshark to identify vulnerabilities like unencrypted payloads,
unauthorized access, or flooding patterns. To secure CoAP-based networks, it is essential to enable
DTLS for encryption, implement tokens or nonces to prevent replay attacks, apply rate limiting to
mitigate DoS risks, and secure routing protocols like RPL. These measures enhance security in both
simulated environments and real-world deployments.
In our course of study we decided to use Cooja coniki network IOT simulation to implement our
poject;
Cooja, a network simulator for IoT, is widely used to emulate wireless sensor networks (WSNs). It
allows you to simulate CoAP-based IoT networks using devices running Contiki OS.
Here is a step by step instruction on how to install contiki on Ubuntu 22 or Debian 12
On recent Ubuntu releases, you may get an error ifconfig: not found and netstat: not
found when trying to run tunslip6. If this is the case, use apt to install net-tools.
While installing Wireshark, select enable the feature that lets non-superuser capture packets (select
“yes”). Now add yourself to the wireshark group:
$ sudo usermod -a -G wireshark <user>
Then you will - if you intend to develop or re-configure examples - also need to install an code/text
editor. There are many alternatives so we leave that up to you!
If desired, a script to compile MSP430 GCC 4.7.2 from source can be found here.
After configuration
Reboot the system after all configurations have been made.
Clone Contiki-NG
$ git clone https://github.com/contiki-ng/contiki-ng.git
$ cd contiki-ng
$ git submodule update --init --recursive
Note: we recommend cloning and then initializing the submodules rather than using git clone --
recursive. The latter results in submodules that use absolute paths to the top-level git, rather than
relative paths, which are more flexible for a number of reasons.
This guide makes extensive usage of homebrew. If you don’t already have it, install it:
$ /usr/bin/ruby -e "$(curl -fsSL
https://raw.githubusercontent.com/Homebrew/install/master/install)"
Using homebrew, install a bunch of helper tools, such as git, srecord, doxygen (to build the API
documentation), mosquitto (to test Contiki-NG’s MQTT functionality), tuntap (for tunslip and to run
native examples with networking), rlwrap (for shell history), python (python 3 for running scripts and
pip).
$ brew install git git-lfs srecord doxygen uncrustify ant mosquitto wget libmagic
rlwrap python make gawk
$ brew tap caskroom/cask
$ brew cask install tuntap
You may also need to update your PATH environment variable to use GNU Make 4 when running the
“make” command. This can be set in your shell initialization file (e.g., ~/.zshrc) as follows.
$ echo 'PATH="/opt/homebrew/opt/make/libexec/gnubin:$PATH"' >> ~/.zshrc
Note that if Homebrew is installed in a different path, you have to modify the command accordingly.
This will automatically install the same version as the one currently installed in the docker image and
used by the CI tests.
The formula itself is hosted under contiki-ng/homebrew-contiki-ng-arm
Manual Installation
You should download the toolchain from https://developer.arm.com/open-source/gnu-toolchain/gnu-
rm/downloads or you can grab an older version from launchpad.net.
$ wget https://launchpad.net/gcc-arm-embedded/5.0/5-2015-q4-major/+download/gcc-
arm-none-eabi-5_2-2015q4-20151219-mac.tar.bz2
$ tar jxf gcc-arm-none-eabi-5_2-2015q4-20151219-mac.tar.bz2
You can also try using the latest version, but be prepared to get compilation warnings and/or errors.
usage: coap-client [-A type...] [-t type] [-b [num,]size] [-B seconds] [-e text]
[-m method] [-N] [-o file] [-P addr[:port]] [-p port]
[-s duration] [-O num,text] [-T string] [-v num] [-a addr] [-U]
Clone Contiki-NG
$ git clone https://github.com/contiki-ng/contiki-ng.git
$ cd contiki-ng
$ git submodule update --init --recursive
Note: we recommend cloning and then initializing the submodules rather “git submodule upgate –init
–recursive”. The latter results in submodules that use absolute paths to the top-level git, rather than
relative paths, which are more flexible for a number of reasons.