0

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

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

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

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

4) 我如何解释收集视图中给出的路由指标?

5)我注意到当我改变一个节点的位置时,网络检测运动太慢了,RPL不是很快,但是在Cooja中它需要太多时间,有可能吗?您对模拟移动传感器有什么建议吗?

4

1 回答 1

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) 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

于 2019-05-18T16:54:49.653 回答