named-data-iot / ndn-lite

A lightweight NDN protocol stack with high-level application support including security bootstrapping, access control, trust management, etc.
https://ndn-lite.named-data.net
GNU Lesser General Public License v3.0
44 stars 16 forks source link

Use pub/sub for user-defined policy delivery #69

Open Zhiyi-Zhang opened 4 years ago

Zhiyi-Zhang commented 4 years ago

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.

yoursunny commented 4 years ago

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. https://github.com/named-data-iot/ndn-lite/blob/d60a114a4c4e8422577ab8ae3817f79eed948254/app-support/pub-sub.c#L486-L494 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?