#5, First Floor, 4th Street , Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 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 implement CoAP communication for Burst Traffic Scenario in contiki cooja simulator?
Description

A burst traffic is a continuous transfer of data without interruption from one device to another.IP traffic headed in the same general direction is gathered and routed as a burst through the network in certain period.We need to create the burst traffic scenario in existing client file along with regular time interval.

Step-1

   Open a client file in a location :

   contiki/examples/
er-rest-examples.

   Includes the library for
ctimer function make available.

   #include "sys/ctimer.h"

   Define process for burst
traffic by adding highlighted
parts.

   PROCESS(burst_traffic,
"burst traffic"); and declare function
body

Step-2

Code to set burst traffic :

if(node_id = 4 || node_id = 6 || node_id = 8)

{

ctimer_set(&ct, 1536, callback, NULL);

ctimer_set(&ct1, 4480, callback, NULL);

ctimer_set(&ct2, 5888, callback, NULL);

}

static void callback(void *ptr)

{

counter++;

printf(“Callback function called at time %lu

(counter=%i)\n”, clock_seconds(), counter);

process_start(&burst_traffic, NULL);

ctimer_set(&ct, 128, callback, NULL);

if(counter==10)

{

counter=0;

ctimer_stop(&ct);

}

}

 

Note: Above code function is designed

to call upto 10 times for every

1 seconds.After count increases

callback stopped.

Step-3
Output

   Start the network simulator

   Open the Contiki cooja network
simulator and create new
simulation.

   Create nodes with sky motes
for border router, server,
and client and enable required option
for simulation as we
discussed.

   Now connect the server
to router.