设置Cooja Simulation的参数

时间:2019-05-08 16:23:33

标签: contiki cooja

我正在尝试使用Contiki 3.0和Cooja Simulator对RPL协议进行一些仿真。我正在使用天空尘埃,我想看看DODAG是如何形成的,并使用“收集视图”监视网络的参数。我有一些问题:

1)我可以在哪里以及如何更改Objective函数?

2)我的传感器的能耗为1mW,我认为对于实际应用来说,这是太多了,因为传感器需要工作数年

3)在哪里可以更改模拟的其他参数?像Tx / Rx数据包一样?

4)如何解释在收集视图中给出的路由度量?

5)我注意到,当我更改节点的位置时,网络检测运动的速度太慢,RPL并不是很快,但是在Cooja中花费的时间太多了,这可能吗?您对模拟运动传感器有什么建议吗?

1 个答案:

答案 0 :(得分:0)

1)您可以从contiki / core / net / rpl / rpl-conf.h设置更改目标功能

根据您的要求进行编辑:

/*
 * 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为节点的长期运行提供了无线电占空比(RDC)机制。 默认值为nullrdc,其中节点始终保持打开状态,因此寿命会缩短。设置ContikiMAC以最小化节点的功能。 转到contiki / core / contiki-default-conf.h并根据您的要求进行编辑。

例如

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

3)可以从Network visualizer本身设置Tx / Rx。您可以右键单击任何节点并编辑tx / rx范围以及成功率。 您还可以在.csc(模拟)文件中对其进行编辑。

    <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)您必须计算各种性能指标。为此,您自己拥有代码脚本文件(困难的部分)。 或使用这些链接 https://github.com/iloveyii/contiki_rpl/tree/master/perl

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

5)使用移动性插件来模拟各种移动性模型。

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

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