CoAP is a constrained application protocol. CoAP uses UDP as the underlying network protocol. CoAP is basically a client-server IOT protocol, where the client makes a request and the server sends a response to it.
To know about how to run CoAP application in Contiki-NG Cooja network simulator tool.
Open Vmware workstation player and provide login password:user.
Now click contiki-NG in desktop winndow.
Then open file at location contiki-ng/examples/coap
Then Go for contiki-ng/examples/coap/coap-examples-server. Copy the path and paste into terminal window
Next provide These two commands->make clean->make coap-example-server.cooja TARGET=cooja
Now the simulation window will open
Add server,client and border-router mote types.
Connect border-router to server.copy the path at file location:contiki-ng/examples/rpl-border-router.
Then open another terminal window for connecting to server.Provide command->make TARGET=sky connect-router-cooja
Now border router will connect to coap-server.
Run the simulation.