Feature #3663
openNotificationSubscriber: Validator
0%
Description
Invoke Validator
from NotificationSubscriber
.
When Validator
is not specified, use ValidatorNull
.
Updated by Junxiao Shi over 8 years ago
- Related to Feature #3662: NotificationSubscriber: Nack added
Updated by Junxiao Shi almost 8 years ago
- Status changed from New to In Progress
- Assignee set to Junxiao Shi
- Target version changed from v0.5 to v0.6
Updated by Junxiao Shi almost 8 years ago
- % Done changed from 0 to 50
https://gerrit.named-data.net/3353 moves type-agnostic code to NotificationSubscriberBase
class. This design is adopted from ns3::CallbackBase
.
A benefit is to reduce compiled object size (see #1694-6).
Updated by Junxiao Shi almost 8 years ago
https://gerrit.named-data.net/3354 is a partial implementation of adding data validation to NotificationSubscriber
.
Before I can continue working on this, a design question must be resolved.
What's the proper procedure after data validation fails?
If we send an initial Interest right away, most likely the Interest would bring back the same Data.
Assuming the data failing validation is in reply to an Interest with sequence number (rather than an initial Interest), if we send the next Interest with incremented sequence number, we would lose one notification.
Waiting out the FreshnessPeriod before sending an initial Interest also would not work, because the bad Data may have extremely long FreshnessPeriod.
We could probably use Exclude selector to exclude the implicit digest of the bad Data, in hope of bringing back a different Data that could pass validation. The implementation would be more complicated, because if there are many bad Data, the Interest with many Exclude entries would eventually exceed the practical limit on packet size and need to be split into multiple Interests.
In fact, similar problem already exists in the current implementation regarding decode error.
When a Data cannot be decoded as a notification, the NotificationSubscriber
reacts by sending an initial Interest right away. In reality, this Interest would bring back the same malformed Data. If no new Data is generated, the system would enter a loop until the malformed Data is evicted from ContentStore.
Note that leaving this mess to the calling application is not an option, because NotificationSubsciber
is designed to reliably retrieve notifications.
Even if we are allowed to stop fetching and inform the application, the application would still face the same problem: whenever it invokes start()
again, the initial Interest brings back the same Data and the subscriber stops again.
Updated by Junxiao Shi almost 8 years ago
- Status changed from In Progress to New
- Assignee deleted (
Junxiao Shi) - % Done changed from 50 to 0
20161201 call suggests that the proper reaction to validation failure is to resend the Interest excluding bad Data. However, Exclude selector might be deprecated soon, so I'm not going to implement this solution.
Presently, NotificationSubscriber is primarily used in localhost, so it would work just fine without a Validator.