[Nfd-dev] Question about ndn-cxx pending interest on face

Junxiao Shi shijunxiao at email.arizona.edu
Fri Nov 9 22:34:03 PST 2018


Hi Ashlesh

Observation in consumer application using ndn-cxx (0.6.3) segment fetcher
> to send an interest:
>
> 1541784024.347425 DEBUG: [ndn.Face] <I
> /example/testApp?ndn.MustBeFresh=true&ndn.Nonce=2593228152
> 1541784025.347404 DEBUG: [ndn.Face] <I
> /example/testApp?ndn.MustBeFresh=true&ndn.Nonce=1097587936 [This is sent by
> segment fetcher before timeout]
> 1541784025.350393 DEBUG: [ndn.Face] >D /example/testApp/%00%00
> 1541784025.350405 DEBUG: [ndn.Face]    satisfying
> /example/testApp?ndn.MustBeFresh=true&ndn.Nonce=2593228152 from app
> 1541784025.350436 DEBUG: [ndn.security.v2.Validator] > Start validating
> data /example/testApp/%00%00
> 1541784025.350441 TRACE: [ndn.security.v2.ValidationState] > Signature
> verification bypassed for data `/example/testApp/%00%00`
> Got data
> 1541784025.350508 TRACE: [ndn.security.v2.ValidationState] ~ValidationState
> 1541784025.350520 DEBUG: [ndn.Face]    satisfying
> /example/testApp?ndn.MustBeFresh=true&ndn.Nonce=1097587936 from app
> 1541784025.350530 DEBUG: [ndn.security.v2.Validator] > Start validating
> data /example/testApp/%00%00
> 1541784025.350533 TRACE: [ndn.security.v2.ValidationState] > Signature
> verification bypassed for data `/example/testApp/%00%00
>
> Why does ndn-cxx face consider two interests with same name and origin but
> different nonce as separate? An application will receive the same data
> packet twice.
>

I’m answering from ndn::Face point of view.
Your application invokes Face::expressInterest twice. When the Data comes
back, both callback functions are invoked. Face cannot know whether it’s
the same part of the application expressing these two Interests
(std::function objects are not comparable), so that the reasonable behavior
is invoking both callbacks.
If you don’t want the first callback to be invoked, cancel the first
pending Interest when you express the second Interest. You may assign the
return value of Face::expressInterest to a ScopedPendingInterest (to be
implemented in https://redmine.named-data.net/issues/4316 ), so that only
one pending Interest is alive.


> (Came up due to: https://redmine.named-data.net/issues/4770)
>

Yours, Junxiao

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/nfd-dev/attachments/20181110/876f7242/attachment.html>


More information about the Nfd-dev mailing list