Congestion control is a network layer issue, when there is more data in the network than can be sent with reasonable packet delays, no lost packets, etc.The CoAP designed by the (IETF) for (IoT) devices. Due to the limited radio channel capacities and hardware resources of such devices, congestion can be a serious problem..
Open the necessary files at
following location: Home/ contiki/
examples/ er-rest-example
1.er-example-client.c
2.er-example-client.c
Home/ contiki/ apps/ er-coap
1)er-coap-transactions.c
2)er-coap-transactions.h
Open a file to modification
er-coap-transactions.c file
above mentioned location.
Here inside the file coap_
send_transaction function handling
the basic CoAP congestion control.
Just use these following
codes inside the function.
t->retrans_timer.timer.interval =
COAP_RESPONSE_TIMEOUT_TICKS
+ (random_rand()
%(clock_time_t)
COAP_RESPONSE_TIMEOUT_BACKOFF
_MASK);
Create new simulation in cooja
network simulator.
Connect the server with router.now
start the simulation and observe the
outputs in motes output terminal.
After compilation enter to plot the graph and save it.