<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="">You will have to modify the SegmentFetcher if you would like to use it in ndnSIM. Not clear to me what modifications exactly might be needed.<div class=""><br class=""></div><div class="">Thanks,</div><div class=""><br 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 class=""><br class=""></div></div></div></div><div><blockquote type="cite" class=""><div class="">On Apr 13, 2017, at 8:26 AM, 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="">Thanks for your reply.<div class=""><br class=""></div><div class="">Can I use SegmentFetcher::fetch? </div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, Apr 12, 2017 at 10:16 PM, Spyridon (Spyros) Mastorakis <span dir="ltr" class=""><<a href="mailto:mastorakis@cs.ucla.edu" target="_blank" class="">mastorakis@cs.ucla.edu</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" 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 style="float:none;display:inline!important" class="">Spyridon (Spyros) Mastorakis</span><br class=""><span style="float:none;display:inline!important" class="">Personal Website: </span><a href="http://cs.ucla.edu/~mastorakis/" target="_blank" class="">http://cs.ucla.edu/~<wbr class="">mastorakis/</a><br class=""><span style="float:none;display:inline!important" class="">Internet Research Laboratory</span><br class=""><span style="float:none;display:inline!important" class="">Computer Science Department</span><br class=""><span style="float:none;display:inline!important" class="">UCLA</span></div></div></div>
</div><div class=""><div class="h5">
<br class=""><div class=""><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" target="_blank" class="">a.ibrahim@fci-cu.edu.eg</a>> wrote:</div><br class="m_-90843617345056225Apple-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="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>  // prepare the name of content/file</div><div class=""><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>  shared_ptr<Name> nameWithSequence = make_shared<Name>(m_<wbr class="">interestName);</div><div class=""><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">    </span>  nameWithSequence-><wbr class="">appendSequenceNumber(seq);</div><div class=""><br class=""></div><div class=""><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>  std::cout<<"name befor segment: "<<nameWithSequence->toUri()<<<wbr class="">"\n";</div><div class=""><br class=""></div><div class=""><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">   </span>  <b class="">nameWithSequence-><wbr class="">appendSegment(j+1); </b>// adding chunk number</div><div class=""><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap"><br class=""></span></div><div class=""><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">       </span>  std::cout<<"name After segment: "<<nameWithSequence->toUri()<<<wbr class="">"\n";</div><div class=""><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">  </span>  //std::cout<<"requesting file.chunk"<<seq<<"."<<j+1<<"\<wbr class="">n";</div><div class=""><br class=""></div><div class=""><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>  //Amir: Create the interest packet</div><div class=""><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">  </span>  shared_ptr<Interest> interest = make_shared<Interest>();</div><div class=""><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>  interest->setNonce(m_rand-><wbr class="">GetValue(0, std::numeric_limits<uint32_t>:<wbr class="">:max()));</div><div class=""><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">      </span>  interest->setName(*<wbr class="">nameWithSequence);</div><div class=""><br class=""></div><div class=""><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">       </span>  // NS_LOG_INFO ("Requesting Interest: \n" << *interest);</div><div class=""><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">    </span>  NS_LOG_INFO("> Interest for " << seq << ", Total: " << m_seq << ", face: " << m_face->getId());</div><div class=""><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">   </span>  NS_LOG_DEBUG("Trying to add " << seq << " with " << Simulator::Now() << ". already "</div><div class=""><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">                  </span>  << m_seqTimeouts.size() << " items");</div><div class=""><br class=""></div><div class=""><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">  </span>  m_seqTimeouts.insert(<wbr class="">SeqTimeout(seq, Simulator::Now()));</div><div class=""><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">      </span>  m_seqFullDelay.insert(<wbr class="">SeqTimeout(seq, Simulator::Now()));</div><div class=""><br class=""></div><div class=""><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">      </span>  m_seqLastDelay.erase(seq);</div><div class=""><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">  </span>  m_seqLastDelay.insert(<wbr class="">SeqTimeout(seq, Simulator::Now()));</div><div class=""><br class=""></div><div class=""><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">      </span>  m_seqRetxCounts[seq]++;</div><div class=""><br class=""></div><div class=""><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">      </span>  m_rtt->SentSeq(<wbr class="">SequenceNumber32(seq), 1);</div><div class=""><br class=""></div><div class=""><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">   </span>  m_transmittedInterests(<wbr class="">interest, this, m_face);</div><div class=""><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">       </span>  m_appLink->onReceiveInterest(<wbr class="">*interest);</div><div class=""><br class=""></div><div class=""><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">    </span>  MyConsumerZipfMandelbrot::<wbr class="">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="m_-90843617345056225gmail_signature"><div dir="ltr" class="">   Regards<br class="">Prince</div></div>
</div></div>

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