contikicooja

Set paramaters of Cooja Simulation


I'm trying to do some simulation of the RPL protocol using Contiki 3.0 and the Cooja Simulator. I'm using the sky motes and i'd like to see how the DODAG is formed and monitor the parameters of the network using the Collect View. I have some questions:

1) Where and how i can change the Objective function?

2) My sensors have 1mW energy consumption, i think that for real application is too much, since sensors needs to work for several years

3) Where i can change the other parameters of the simulation? Like Tx/Rx packets?

4) How I interpret the routing metric given in the collect view?

5) I noticed that when I change the position of a node the network is too much slow detecting the movement, RPL is not very fast, but in Cooja it takes too much time, is it possible? Do you have any suggestion for simulating moving sensors?


Solution

  • 1) Your can set change objective function from contiki/core/net/rpl/rpl-conf.h

    edit as per your requirement:

    /*
     * The objective function (OF) used by a RPL root is configurable through
     * the RPL_CONF_OF_OCP parameter. This is defined as the objective code
     * point (OCP) of the OF, RPL_OCP_OF0 or RPL_OCP_MRHOF. This flag is of
     * no relevance to non-root nodes, which run the OF advertised in the
     * instance they join.
     * Make sure the selected of is inRPL_SUPPORTED_OFS.
     */
    #ifdef RPL_CONF_OF_OCP
    #define RPL_OF_OCP RPL_CONF_OF_OCP
    #else /* RPL_CONF_OF_OCP */
    #define RPL_OF_OCP RPL_OCP_MRHOF
    #endif /* RPL_CONF_OF_OCP */
    
    /*
     * The set of objective functions supported at runtime. Nodes are only
     * able to join instances that advertise an OF in this set. To include
     * both OF0 and MRHOF, use {&rpl_of0, &rpl_mrhof}.
     */
    #ifdef RPL_CONF_SUPPORTED_OFS
    #define RPL_SUPPORTED_OFS RPL_CONF_SUPPORTED_OFS
    #else /* RPL_CONF_SUPPORTED_OFS */
    #define RPL_SUPPORTED_OFS {&rpl_mrhof}
    #endif /* RPL_CONF_SUPPORTED_OFS */
    
    /*
     * Enable/disable RPL Metric Containers (MC). The actual MC in use
     * for a given DODAG is decided at runtime, when joining. Note that
     * OF0 (RFC6552) operates without MC, and so does MRHOF (RFC6719) when
     * used with ETX as a metric (the rank is the metric). We disable MC
     * by default, but note it must be enabled to support joining a DODAG
     * that requires MC (e.g., MRHOF with a metric other than ETX).
     */
    #ifdef RPL_CONF_WITH_MC
    #define RPL_WITH_MC RPL_CONF_WITH_MC
    #else /* RPL_CONF_WITH_MC */
    #define RPL_WITH_MC 0
    #endif /* RPL_CONF_WITH_MC */
    
    

    2) Contiki provides radio duty cycle (RDC) mechanisms for long term operation of nodes. Default is nullrdc in which node always remains on hence life is less. Set ContikiMAC for minimizing power of nodes. goto contiki/core/contiki-default-conf.h and edit as per your requirement.

    e.g.

    #ifndef NETSTACK_CONF_RDC
    /* #define NETSTACK_CONF_RDC   nullrdc_driver */
    #define NETSTACK_CONF_RDC   contikimac_driver 
    #endif /* NETSTACK_CONF_RDC */
    

    3) Tx/Rx can be set from Network visualizer itself. You can right click any node and edit tx/rx range as well as success ratio. You can also edit the same in .csc (simulation) file.

        <radiomedium>
          org.contikios.cooja.radiomediums.UDGM
          <transmitting_range>100.0</transmitting_range>
          <interference_range>120.0</interference_range>
          <success_ratio_tx>0.9</success_ratio_tx>
          <success_ratio_rx>0.9</success_ratio_rx>
        </radiomedium>
    

    4) You have to calculate various performance metrics. For that you have code script file yourself (tough part). Or use these links https://github.com/iloveyii/contiki_rpl/tree/master/perl

    https://pdfs.semanticscholar.org/d319/4d5f43f1cd3995ba7c9e99776ac8f150d445.pdf

    5) Use mobility plugin to simulate various mobility models.

    https://anrg.usc.edu/contiki/index.php/Mobility_of_Nodes_in_Cooja

    http://vrajesh2188.blogspot.com/2016/04/mobility-in-contiki-2.html