Hello,
What is the difference between the following ways of subscribing to receive a UDP Packet.
/* initialize and register pktdump to print received packets */
gnrc_netreg_entry_t server = GNRC_NETREG_ENTRY_INIT_PID(8888, sched_active_pid);
gnrc_netreg_register(GNRC_NETTYPE_UDP, &server);
vs
/* initialize and register pktdump to print received packets */
gnrc_netreg_entry_t server = GNRC_NETREG_ENTRY_INIT_PID(GNRC_NETREG_DEMUX_CTX_ALL,
sched_active_pid);
gnrc_netreg_register(GNRC_NETTYPE_UDP, &server);
I was curious because, the value of ‘Round Trip Time’ triples If I use the 2nd way (bottom one).
Thank you
Regards,
Navneet Pandey
Hi,
gnrc_netreg_register() registers a thread in the registry "netreg"
indicating (i) the packet type (protocol) and (ii) an additional
de-multiplex context [1] (for example a UDP port) it wants to receive.
An additional RTT by the factor three seems extremely huge to me. Did
you measure this between boards under the same conditions, multiple
times? However, I guess a certain overhead is introduced by the dispatch
mechanism. Please have a more detailed look at the implementation of
gnrc_netapi_dispatch() [2].
Best
Peter
[1]
https://riot-os.org/api/group__net__gnrc__netreg.html#ga1a6359efa13b3bfed70af55deacde7ae
[2]
https://github.com/RIOT-OS/RIOT/blob/master/sys/net/gnrc/netapi/gnrc_netapi.c#L94
Hello Peter,
Yes, the increment was huge for sure. It turns out there was some glitch in that particular experiment. That experiment was full of glitches in terms of results. I was not able to replicate that.
But, thank you. I will have a look at the mentioned links.