named-data-iot/ndn-lite

Use pub/sub for user-defined policy delivery

Opened this issue · 1 comments

In the current (6d433ac) ndn-lite, user-defined policies are distributed through signed Interest sent by the controller directly to a device.
We may want to change this direct Interest notification to pub/sub mode. That is, each device subscribe to the topics that are:

  1. related to itself, e.g., /home/POLICY/TEMP/bedroom/sensor1
  2. related to the service and the room, e.g. /home/POLICY/TEMP/bedroom
  3. related to the service it serves, e.g., /home/POLICY/TEMP

When the IoT controller generates a new policy, it will send out a notification containing the policy name.
A device, say /home/TEMP/bedroom/sensor1, receives this notification, will check whether the policy affects itself.
If yes, the device will fetch the new content from the topic, verify the signature, and install the policy.

Given you are talking about "notification", I suppose these are considered command topics.

A major limitation is that, ps_subscribe_to_command can accommodate up to five topics.

for (int i = 0; i < 5; i++) {
if (m_pub_sub_state.sub_topics[i].service == NDN_SD_NONE) {
topic = &m_pub_sub_state.sub_topics[i];
}
}
if (topic == NULL) {
NDN_LOG_ERROR("[PUB/SUB] No more space for new subscription topics. Abort");
return;
}

This proposal would occupy 60% of available topics.

While it's possible to change this limitation, it would increase memory usage and take NDN-Lite further from being able to run on memory-constrained devices.

P.S. Is NDN-Lite still usable on constrained devices such as the nRF52840?