<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">the class you tried to modify derives from the Consumer class.</div><div class=""><br class=""></div><div class="">I would suggest you modify the Consumer class directly.</div><div class=""><br class=""></div><div class="">Thanks,</div><div class=""><br class=""></div><div class=""><div class="">
<div class=""><div class=""><div class=""><span class="" style="float: none; display: inline !important;">Spyridon (Spyros) Mastorakis</span><br class=""><span class="" style="float: none; display: inline !important;">Personal Website: </span><a href="http://cs.ucla.edu/~mastorakis/" class="">http://cs.ucla.edu/~mastorakis/</a><br class=""><span class="" style="float: none; display: inline !important;">Internet Research Laboratory</span><br class=""><span class="" style="float: none; display: inline !important;">Computer Science Department</span><br class=""><span class="" style="float: none; display: inline !important;">UCLA</span></div></div></div>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On Apr 12, 2017, at 7:08 PM, Amir Ibrahim <<a href="mailto:a.ibrahim@fci-cu.edu.eg" class="">a.ibrahim@fci-cu.edu.eg</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi All,<div class=""> I'm trying to create a new ndn application that sends interest packet for a content as follow:</div><div class="">- Each content consists of more than one segment.</div><div class="">- 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 class="">/prefix/file01/01 and /prefix/file01/02)</div><div class=""><br class=""></div><div class="">My trials to do so are:</div><div class="">1. I tried to modify the ConsumerZipfMandelbrot.cpp application by adding the below lines of code to the SendPacket() method:</div><div class=""><br class=""></div><div class=""><div class=""><b class="">for (uint64_t j = 0; j <m_ChunksPerContent[seq-1]; j++) {</b></div><div class=""><br class=""></div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre">  </span>  // prepare the name of content/file</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre">  </span>  shared_ptr<Name> nameWithSequence = make_shared<Name>(m_interestName);</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre">   </span>  nameWithSequence->appendSequenceNumber(seq);</div><div class=""><br class=""></div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre">       </span>  std::cout<<"name befor segment: "<<nameWithSequence->toUri()<<"\n";</div><div class=""><br class=""></div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre">  </span>  <b class="">nameWithSequence->appendSegment(j+1); </b>// adding chunk number</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"><br class=""></span></div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre">       </span>  std::cout<<"name After segment: "<<nameWithSequence->toUri()<<"\n";</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>  //std::cout<<"requesting file.chunk"<<seq<<"."<<j+1<<"\n";</div><div class=""><br class=""></div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>  //Amir: Create the interest packet</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre">   </span>  shared_ptr<Interest> interest = make_shared<Interest>();</div><div class=""><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 class=""><span class="gmail-Apple-tab-span" style="white-space:pre">   </span>  interest->setName(*nameWithSequence);</div><div class=""><br class=""></div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre">      </span>  // NS_LOG_INFO ("Requesting Interest: \n" << *interest);</div><div class=""><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 class=""><span class="gmail-Apple-tab-span" style="white-space:pre">    </span>  NS_LOG_DEBUG("Trying to add " << seq << " with " << Simulator::Now() << ". already "</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre">                   </span>  << m_seqTimeouts.size() << " items");</div><div class=""><br class=""></div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre">   </span>  m_seqTimeouts.insert(SeqTimeout(seq, Simulator::Now()));</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre">     </span>  m_seqFullDelay.insert(SeqTimeout(seq, Simulator::Now()));</div><div class=""><br class=""></div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre">     </span>  m_seqLastDelay.erase(seq);</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre">   </span>  m_seqLastDelay.insert(SeqTimeout(seq, Simulator::Now()));</div><div class=""><br class=""></div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre">     </span>  m_seqRetxCounts[seq]++;</div><div class=""><br class=""></div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre">       </span>  m_rtt->SentSeq(SequenceNumber32(seq), 1);</div><div class=""><br class=""></div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre">  </span>  m_transmittedInterests(interest, this, m_face);</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre">      </span>  m_appLink->onReceiveInterest(*interest);</div><div class=""><br class=""></div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre">   </span>  MyConsumerZipfMandelbrot::ScheduleNextPacket();</div><div class=""><b class="">  }</b></div></div><div class=""><div class=""><br class=""></div><div class="">But every time I run I get an error .</div><div class=""><br class=""></div><div class="">My question is: how do I add a segment number to the interest name (highlighted line )?</div><div class=""><br class=""></div><div class="">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 class=""><br class=""></div>-- <br class=""><div class="gmail_signature"><div dir="ltr" class="">   Regards<br class="">Prince</div></div>
</div></div>

<br class=""><br class=""></div></blockquote></div><br class=""></div></body></html>