How to get the Round Trip Time of CoAP message during transmission in cooja simulator?


The round-trip time (RTT) in CoAP is the length of time taken to a signal to be sent plus the length of taken to be an acknowledgment received. This time delay paths between the two communication endpoints.

   Files to be modified, File

   Contiki/ apps/er
- coap er-coap-transactions.c

   Open above highlighted
file in a location: Do following
modification to calculate RTT


if(t->retrans_counter <= COAP_MAX_RETRANSMIT){

//August: Check if this was a CONFIRMABLE
that actually provides
RTT measurements


//AUGUST: before clearing
transaction store RTT info

clock_time_t rtt = clock_time()
- t->timestamp;

printf("CoAP ACK packet

Open Cooja:

   Cmd: cd contiki/ tools/
cooja --> press enter

ant run --> enter

   File -new simulation (or)
(ctrl+ n).

   Open motes menu >> add motes >>
create new motes type In
order to create the motes,

   i. border- router.c

   ii. er-example-server.c

   iii. er-example-client.c

   Now connect the server to
border router.

   make connect-router-

Leave Comment

Your email address will not be published. Required fields are marked *

clear formSubmit