Amazing technological breakthrough possible @S-Logix pro@slogix.in

Office Address

  • #5, First Floor, 4th Street Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 Landmark : Samiyar Madam
  • pro@slogix.in
  • +91- 81240 01111

Social List

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

Description

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.

Step-1

   Files to be modified, File
location:

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

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

Code:

if(t->retrans_counter <= COAP_MAX_RETRANSMIT){

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

if(COAP_TYPE_CON==
((COAP_HEADER_TYPE_MASK & t->packet
[0])>>COAP_HEADER_TYPE_POSITION)){

//AUGUST: before clearing
transaction store RTT info

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

printf("CoAP ACK packet
received-RTT--%lu\n",rtt);

Step-2
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-
cooja

Output