<div dir="ltr">Hi All,<div> I'm trying to create a new ndn application that sends interest packet for a content as follow:</div><div>- Each content consists of more than one segment.</div><div>- 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</div><div>/prefix/file01/01 and /prefix/file01/02)</div><div><br></div><div>My trials to do so are:</div><div>1. I tried to modify the ConsumerZipfMandelbrot.cpp application by adding the below lines of code to the SendPacket() method:</div><div><br></div><div><div><b>for (uint64_t j = 0; j <m_ChunksPerContent[seq-1]; j++) {</b></div><div><br></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>  // prepare the name of content/file</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>  shared_ptr<Name> nameWithSequence = make_shared<Name>(m_interestName);</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">  </span>  nameWithSequence->appendSequenceNumber(seq);</div><div><br></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">    </span>  std::cout<<"name befor segment: "<<nameWithSequence->toUri()<<"\n";</div><div><br></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">       </span>  <b>nameWithSequence->appendSegment(j+1); </b>// adding chunk number</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"><br></span></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">       </span>  std::cout<<"name After segment: "<<nameWithSequence->toUri()<<"\n";</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>  //std::cout<<"requesting file.chunk"<<seq<<"."<<j+1<<"\n";</div><div><br></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">     </span>  //Amir: Create the interest packet</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">  </span>  shared_ptr<Interest> interest = make_shared<Interest>();</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>  interest->setNonce(m_rand->GetValue(0, std::numeric_limits<uint32_t>::max()));</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">  </span>  interest->setName(*nameWithSequence);</div><div><br></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">   </span>  // NS_LOG_INFO ("Requesting Interest: \n" << *interest);</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">    </span>  NS_LOG_INFO("> Interest for " << seq << ", Total: " << m_seq << ", face: " << m_face->getId());</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">   </span>  NS_LOG_DEBUG("Trying to add " << seq << " with " << Simulator::Now() << ". already "</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                  </span>  << m_seqTimeouts.size() << " items");</div><div><br></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>  m_seqTimeouts.insert(SeqTimeout(seq, Simulator::Now()));</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">    </span>  m_seqFullDelay.insert(SeqTimeout(seq, Simulator::Now()));</div><div><br></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">  </span>  m_seqLastDelay.erase(seq);</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">  </span>  m_seqLastDelay.insert(SeqTimeout(seq, Simulator::Now()));</div><div><br></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">  </span>  m_seqRetxCounts[seq]++;</div><div><br></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">    </span>  m_rtt->SentSeq(SequenceNumber32(seq), 1);</div><div><br></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">       </span>  m_transmittedInterests(interest, this, m_face);</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">     </span>  m_appLink->onReceiveInterest(*interest);</div><div><br></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>  MyConsumerZipfMandelbrot::ScheduleNextPacket();</div><div><b>  }</b></div></div><div><div><br></div><div>But every time I run I get an error .</div><div><br></div><div>My question is: how do I add a segment number to the interest name (highlighted line )?</div><div><br></div><div>Also, is there any problem to create a for loop to repeat the creation of interests per segments of a content as above?</div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">   Regards<br>Prince</div></div>
</div></div>

<br>
<br>