[Contiki-developers] RPL metric

912 views
Skip to first unread message

Emanuele Lomartire

unread,
Sep 28, 2011, 10:24:37 AM9/28/11
to contiki-d...@lists.sourceforge.net
Hi,  
I'm trying to insert energy metric in RPL. I would like to know if there are
some guidelines in order to do it, in particular which files I should modify.

Best Regards.
Emanuele

Nicolas Tsiftes

unread,
Sep 28, 2011, 10:36:40 AM9/28/11
to Contiki developer mailing list
You can modify rpl-of-etx.c in the function calculcate_path_metric. Energy metric containers can be used by defining RPL_DAG_MC to RPL_DAG_MC_ENERGY.

You also have to replace the parent link metric (p->link_metric) to use energy values instead of ETX. This variable is primarily set in rpl.c.

Nicolas

Emanuele Lomartire

unread,
Sep 29, 2011, 9:09:41 AM9/29/11
to contiki-d...@lists.sourceforge.net
Thanks for the answer.
I would know if I should also modify neighbor-info.c creating a new attribute for the neighbor, in this case the residual energy's attribute.
Best Regards.
Emanuele 

Nicolas Tsiftes

unread,
Sep 29, 2011, 9:20:48 AM9/29/11
to Contiki developer mailing list

No, it is sufficient to calculate the additive path energy metric by
extracting the information from the energy metric container in RPL, and
adding the local energy cost. The outgoing energy metric container from
a node will thus contain an energy value that is the sum of incoming
energy value from the best parent and the local energy value.
Calculating the local energy value is probably easiest to do by using
energest information (sys/energest.h).

Nicolas

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Contiki-developers mailing list
Contiki-d...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/contiki-developers

Rocky

unread,
Mar 24, 2014, 6:57:44 AM3/24/14
to osdeve_mirror_rtos...@googlegroups.com, Contiki developer mailing list, n...@sics.se
Hi,

My question is regarding the below possible combination.
contiki-conf.c
-------------------
#define RPL_CONF_DAG_MC 2 /******* Configured for NODE ENERGY *********/

rpl-conf.h
-------------
#define RPL_OF rpl_mrhof

Environment:
Contiki RPL configured for MRHOF with metric container as node energy.


[Problem]
In this case, when I wanted network to be set based on NODE energy, I can see the parent link metric is linked to ETX callback RATHER than energy residual.
And there by I am getting wrong value in the energy estimation each time my DIO is fired.

This is also causing recalculation of DAG rank each time when I sent a packet,
due to neighbor_link_callback() updating the parents link metric.

Also I cross verified with the RFC 6719, and the NODE Energy object doesn't seems to follow the protocol,
since the ENERGY EST is calculated on parents link metric.

In other words, Node metric value is getting mixed up with ETC link metric.

A Wireshark dump of metric container is as follows:
------------------------------------------------------------------------------
(DAG Metric information)
------------------------------------------------------------------------------
Type                  : 0x02
Length                : 6
Metric type           : 0x02 (Metric Energy)
Flags                 : 0x04
P-flag : 0x01
C-flag : 0x00
O-flag : 0x00
R-flag : 0x00
Aggregator type       : 0x00 (Metric is additive) 
Precedence type       : 0x00
Object body length    : 0x02
Metric energy
Energy flags      : 0x00
Energy estimation : 0x80

The point is that the below code is running even if the metric container is set to NODE ENERGY

static void neighbor_link_callback(rpl_parent_t *p, int status, int numtx)
{
  uint16_t recorded_etx = p->link_metric;
  uint16_t packet_etx = numtx * RPL_DAG_MC_ETX_DIVISOR;
  uint16_t new_etx;

  /* Do not penalize the ETX when collisions or transmission errors occur. */
  if(status == MAC_TX_OK || status == MAC_TX_NOACK) {
    if(status == MAC_TX_NOACK) {
      packet_etx = MAX_LINK_METRIC * RPL_DAG_MC_ETX_DIVISOR;
    }

    new_etx = ((uint32_t)recorded_etx * ETX_ALPHA +
               (uint32_t)packet_etx * (ETX_SCALE - ETX_ALPHA)) / ETX_SCALE;

    PRINTF("RPL: ETX changed from %u to %u (packet ETX = %u)\n",
        (unsigned)(recorded_etx / RPL_DAG_MC_ETX_DIVISOR),
        (unsigned)(new_etx / RPL_DAG_MC_ETX_DIVISOR),
        (unsigned)(packet_etx / RPL_DAG_MC_ETX_DIVISOR));
    p->link_metric = new_etx;
  }
}

Kindly let me know your views on the same.

Thanks and regards,
Libin Jose.

rehmat...@gmail.com

unread,
Nov 27, 2015, 2:29:34 PM11/27/15
to osdeve.mirror.rtos.Contiki-developers, contiki-d...@lists.sourceforge.net, manu...@gmail.com
Dear Libin Jose?
 I need your help in energy based routing in RPL . Could you please help me in this regards??
Regards
Rehmat
 
Message has been deleted

anam....@gmail.com

unread,
Dec 14, 2016, 8:53:21 PM12/14/16
to osdeve.mirror.rtos.Contiki-developers, contiki-d...@lists.sourceforge.net, n...@sics.se
If I want to use rssi as metric, what changes I need to make.

Anam

addepalli...@gmail.com

unread,
Sep 27, 2017, 6:51:00 AM9/27/17
to osdeve.mirror.rtos.Contiki-developers
Hello,

How can I add/enable the Dag metric's on DIO sending on contiki/6lbr

I have tried using flags resided on rpl-con.h and rpl-private.h file but I could not make it.please help me out on this issue.

With regards
A.Ganesh

Reply all
Reply to author
Forward
0 new messages