[ndnSIM] Send interest packet per segment of some content

Amir Ibrahim a.ibrahim at fci-cu.edu.eg
Wed Apr 12 19:08:02 PDT 2017

Hi All,
 I'm trying to create a new ndn application that sends interest packet for
a content as follow:
- Each content consists of more than one segment.
- When a node wants to retrieve a content, it sends interest packets for
each segment of that content (ex: if content /prefix/file01 has 2 segments
the app should send 2 interest packets
/prefix/file01/01 and /prefix/file01/02)

My trials to do so are:
1. I tried to modify the ConsumerZipfMandelbrot.cpp application by adding
the below lines of code to the SendPacket() method:

*for (uint64_t j = 0; j <m_ChunksPerContent[seq-1]; j++) {*

 // prepare the name of content/file
 shared_ptr<Name> nameWithSequence = make_shared<Name>(m_interestName);

 std::cout<<"name befor segment: "<<nameWithSequence->toUri()<<"\n";

 *nameWithSequence->appendSegment(j+1); *// adding chunk number

 std::cout<<"name After segment: "<<nameWithSequence->toUri()<<"\n";
 //std::cout<<"requesting file.chunk"<<seq<<"."<<j+1<<"\n";

 //Amir: Create the interest packet
 shared_ptr<Interest> interest = make_shared<Interest>();

 // NS_LOG_INFO ("Requesting Interest: \n" << *interest);
 NS_LOG_INFO("> Interest for " << seq << ", Total: " << m_seq << ", face: "
<< m_face->getId());
 NS_LOG_DEBUG("Trying to add " << seq << " with " << Simulator::Now() << ".
already "
 << m_seqTimeouts.size() << " items");

 m_seqTimeouts.insert(SeqTimeout(seq, Simulator::Now()));
 m_seqFullDelay.insert(SeqTimeout(seq, Simulator::Now()));

 m_seqLastDelay.insert(SeqTimeout(seq, Simulator::Now()));


 m_rtt->SentSeq(SequenceNumber32(seq), 1);

 m_transmittedInterests(interest, this, m_face);

*  }*

But every time I run I get an error .

My question is: how do I add a segment number to the interest name
(highlighted line )?

Also, is there any problem to create a for loop to repeat the creation of
interests per segments of a content as above?



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20170412/9fae141b/attachment.html>

More information about the ndnSIM mailing list