Reply
Posts: 25
Registered: ‎05-13-2015

how to implement packet drop rate (PER) or Tx retries in ember application

Hi!

I have spent months trying to determine packet drop rate (PER) or Tx retries in my application. I know how to determine it from the nodetest application but I dont know how to implement it in my application. Is there any function and callback that does that in ember NCP stack.  Your response is paramount to me.

Thanks

 

Posts: 202
Registered: ‎02-05-2014

Re: how to implement packet drop rate (PER) or Tx retries in ember application

Best place to do this sort of analysis is the emberCounterHandler() that is triggered by the stack for every TX and RX at the MAC and APS layers.  Check out API documentation for the EmberCounterType enumeration in stack/include/ember-types.h.  This handler is usually consumed by the Counters plugin in the AppBuilder-driven framework, so you can either disable that and write your own Counter Handler callback code or just make use of the "counters" CLI command from the plugin to see what's occurred since your last counters dump.

--------
The views represented in this post are the independent views of the author and don't necessarily represent the official views of Silicon Labs.
Posts: 25
Registered: ‎05-13-2015

Re: how to implement packet drop rate (PER) or Tx retries in ember application

Thanks for your quick respond. I have implemented it according to what I understood from your message.  I added the emberCounterHandler callback in my application..callbacks.c file as follows 

emberCounterHandler(EMBER_COUNTER_MAC_TX_UNICAST_SUCCESS,data);
emberAfAppPrintln("The no of retries is :%d \n", data);

where EMBER_COUNTER_MAC_TX_UNICAST_SUCCESS is the EmberCounterType event I want.

and data is define and initialized as zero in my code. I believed the emberCounterHandler should change the value of data whenever MAC_TX_UNICAST_SUCCESS is achieved. But whenever I run the code and transmit packets between two nodes, the value of data does not change even when I change the type. I have defined EMBER_APPLICATION_HAS_COUNTER_HANDLER in my application .h file

Is there anything I'm doing wrong or need to understand. Please, I need an urgent response because I'm stuck here in my project work. Thanks

Posts: 202
Registered: ‎02-05-2014

Re: how to implement packet drop rate (PER) or Tx retries in ember application

Are you sure there are actually MAC retries happening in your test?

 

Also, check out the existing code around this in the Counters plugin:

 

  if (EMBER_COUNTER_MAC_TX_UNICAST_SUCCESS == type
      || EMBER_COUNTER_MAC_TX_UNICAST_FAILED == type){
    if((emberCounters[EMBER_COUNTER_MAC_TX_UNICAST_RETRY] + data)
      < emberCountersThresholds[EMBER_COUNTER_MAC_TX_UNICAST_RETRY])
      emberCounters[EMBER_COUNTER_MAC_TX_UNICAST_RETRY] += data;
    else
      emberCounters[EMBER_COUNTER_MAC_TX_UNICAST_RETRY] =
        emberCountersThresholds[EMBER_COUNTER_MAC_TX_UNICAST_RETRY];
  }

 

 

--------
The views represented in this post are the independent views of the author and don't necessarily represent the official views of Silicon Labs.
Posts: 202
Registered: ‎02-05-2014

Re: how to implement packet drop rate (PER) or Tx retries in ember application

Erik, what ever happened with this?

--------
The views represented in this post are the independent views of the author and don't necessarily represent the official views of Silicon Labs.