[Mini-NDN] [EXT] Timeouts in MiniNDN
Andre
adcarneiro at inf.ufrgs.br
Mon Apr 26 17:45:43 PDT 2021
Hi Junxiao
I implemented those changes and reduced the topology to 4 hosts to rule
the possibility of this being a hardware issue. Now the consumers
schedule the interest following what is specified in an input file, the
core expressInterest mechanism looks like this:
m_scheduler.schedule(boost::chrono::milliseconds(dataBuff.nTimeMs),
[this, dataBuff] { delayedInterest(dataBuff); });
And, after all events are scheduled.
m_ioService.run();
Inside delayedInterest, the variable nPackets is determined according to
the 8000 byte payload limit.
// Express interest for all packets
for(i =0; i <nPackets; i++){
if((bHasLeftover) &&(i+1==nPackets)){
// Last packet
nPacketPayload =dataBuff.nPayload %N_MAX_PACKET_BYTES;
}
else{
// Any other packet
nPacketPayload =N_MAX_PACKET_BYTES;
}
snprintf(strBuf, sizeof(strBuf), "%s-%db-%dof%d", strPrefix,
nPacketPayload, i+1, nPackets);
fprintf(stdout, "[Consumer::delayedInterest] Expressing
interest=%s(%d/%d)\n", strBuf, i+1, nPackets);
dtBegin =std::chrono::steady_clock::now();
interestName =Name(strBuf);
interest =Interest(interestName);
interest.setCanBePrefix(false);
interest.setMustBeFresh(true);
interest.setInterestLifetime(6_s);
m_face.expressInterest(interest,
bind(&Consumer::onData, this, _1, _2, dtBegin),
bind(&Consumer::onNack, this, _1, _2, dtBegin),
bind(&Consumer::onTimeout, this, _1, dtBegin));
}
This runs fine for small requests, but when more interests are expressed
in a row, making requests of about 60 to 100 8KB packages, the producers
work for a while but then start becoming unresponsive. Once I get a
timeout from a specific producer, it does not answer to any more
requests, even if I kill the producer/consumer process and start them
back up.
Looking into the producer's NFD debug logs I found this:
When the data is received by the consumer:
1619483660.357769 DEBUG: [nfd.Forwarder] onIncomingInterest in=(271,0)
interest=/ndn/d0-site/d0/C2Data-21-Type5-8000b-5of26
1619483660.357807 DEBUG: [nfd.ContentStore] find
/ndn/d0-site/d0/C2Data-21-Type5-8000b-5of26 no-match
1619483660.357833 DEBUG: [nfd.Forwarder] onContentStoreMiss
interest=/ndn/d0-site/d0/C2Data-21-Type5-8000b-5of26
1619483660.357840 DEBUG: [nfd.BestRouteStrategy]
/ndn/d0-site/d0/C2Data-21-Type5-8000b-5of26?MustBeFresh&Nonce=89b7b04a&Lifetime=6000
from=(271,0) newPitEntry-to=279
1619483660.357866 DEBUG: [nfd.Forwarder] onOutgoingInterest out=279
interest=/ndn/d0-site/d0/C2Data-21-Type5-8000b-5of26
1619483660.359613 DEBUG: [nfd.Forwarder] onIncomingData in=(279,0)
data=/ndn/d0-site/d0/C2Data-21-Type5-8000b-5of26
1619483660.359631 DEBUG: [nfd.ContentStore] insert
/ndn/d0-site/d0/C2Data-21-Type5-8000b-5of26
1619483660.359641 DEBUG: [nfd.Forwarder] onIncomingData
matching=/ndn/d0-site/d0/C2Data-21-Type5-8000b-5of26
1619483660.359654 DEBUG: [nfd.Strategy] afterReceiveData
pitEntry=/ndn/d0-site/d0/C2Data-21-Type5-8000b-5of26 in=(279,0)
data=/ndn/d0-site/d0/C2Data-21-Type5-8000b-5of26
1619483660.359675 DEBUG: [nfd.Strategy] beforeSatisfyInterest
pitEntry=/ndn/d0-site/d0/C2Data-21-Type5-8000b-5of26 in=(279,0)
data=/ndn/d0-site/d0/C2Data-21-Type5-8000b-5of26
1619483660.359686 DEBUG: [nfd.Forwarder] onOutgoingData out=271
data=/ndn/d0-site/d0/C2Data-21-Type5-8000b-5of26
1619483660.359722 DEBUG: [nfd.Forwarder] onInterestFinalize
interest=/ndn/d0-site/d0/C2Data-21-Type5-8000b-5of26 satisfied
When the data times out on the consumer:
1619483660.357885 DEBUG: [nfd.Forwarder] onIncomingInterest in=(271,0)
interest=/ndn/d0-site/d0/C2Data-21-Type5-8000b-6of26
1619483660.357923 DEBUG: [nfd.ContentStore] find
/ndn/d0-site/d0/C2Data-21-Type5-8000b-6of26 no-match
1619483660.357929 DEBUG: [nfd.Forwarder] onContentStoreMiss
interest=/ndn/d0-site/d0/C2Data-21-Type5-8000b-6of26
1619483660.357935 DEBUG: [nfd.BestRouteStrategy]
/ndn/d0-site/d0/C2Data-21-Type5-8000b-6of26?MustBeFresh&Nonce=b423a0c7&Lifetime=6000
from=(271,0) newPitEntry-to=279
1619483660.357942 DEBUG: [nfd.Forwarder] onOutgoingInterest out=279
interest=/ndn/d0-site/d0/C2Data-21-Type5-8000b-6of26
1619483666.357128 DEBUG: [nfd.Forwarder] onInterestFinalize
interest=/ndn/d0-site/d0/C2Data-21-Type5-8000b-6of26 unsatisfied
The core Producer::onInterest is pretty simple and looks like this,
where nPayloadSize and nTTLMs are extracted from the interest string:
// Create payload
autob =make_shared<Buffer>();
b->assign(nPayloadSize, 'a');
blockPayload =Block(tlv::Content, std::move(b));
// Create packet for interest
autodata =make_shared<Data>(interest.getName());
data->setFreshnessPeriod(boost::chrono::milliseconds(nTTLMs));
data->setContent(blockPayload);
m_keyChain.sign(*data);
// Return Data packet to the requester
std::cout <<"[Producer::onInterest] << D: "<<*data <<std::endl;
m_face.put(*data);
std::cout <<"[Producer::onInterest] End"<<std::endl;
I also encountered another issue when testing this. I tried starting the
consumer processes from the python script that creates the experiment
(as stated below), but I found that the Scheduler does not run for some
reason. All the calls to m_scheduler.schedule() are made, but after
calling m_ioService.run(), the delayedInterest() function is not called
at all. However, the exact same program works when called with the same
parameters from the host's xterm window. This a pretty by problem,
because I cannot manually start all the consumers for the experiment.
getPopen(pHost, 'consumer-with-queue
%s/home/vagrant/icnsimulations/topologies/queue_wired-topo4.txt'%(str(pHost)))
Best regards and thanks for all the help so far,
André Dexheimer Carneiro
On 21/04/2021 17:32, Junxiao Shi wrote:
> Hi Andre
>
> You can express multiple Interests one after another, and then wait
> for responses.
> In ndnping, expressInterest is called at a fixed interval, independent
> from whether previous Interests were satisfied.
>
> To retrieve files, or more generally, segmented objects, most
> libraries have a helper for that.
> In ndn-cxx it's called SegmentFetcher.
>
> See also https://yoursunny.com/t/2021/NDN-face/ , "Face in Libraries"
> section, for a deep explanation on how the library Face works.
>
> Yours, Junxiao
>
> On Wed, Apr 21, 2021 at 16:24 Andre <adcarneiro at inf.ufrgs.br
> <mailto:adcarneiro at inf.ufrgs.br>> wrote:
>
> *External Email*
>
> Hi Junxiao,
>
>
> that makes sense, thanks for the help so far.
>
>
> I looked into the ndnping example but one doubt remains. What if I
> want to consume large chunks of data, say 10MB or more. In this
> case, I will need to divide that into chunks of 8800 bytes at
> most, since that is the maximum NDN package size allowed. However,
> using the same mechanism as ndnping or
> consumer/consumer-with-timer, the program would have to wait until
> one 8800 B package is received before requesting the next one
> (using face.expressInterest). How can I do that so that I don`t
> have to wait a full round-trip-time before consuming the next part?
>
>
> Best regards,
>
> André
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/mini-ndn/attachments/20210426/90b30890/attachment-0001.html>
More information about the Mini-NDN
mailing list