<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif">Hi Jeff, </div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">Yes, I had gotten it working by removing the shutdown command. </div><div class="gmail_default" style="font-family:tahoma,sans-serif">Also, this is how I extract the version:</div><div class="gmail_default" style="font-family:tahoma,sans-serif">From the first face expressInterest, I get the version from the _onData method I defined as follows:</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">







<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-m_-4860798478954399733gmail-s1"> </span><span class="gmail-m_-4860798478954399733gmail-s2">def</span><span class="gmail-m_-4860798478954399733gmail-s1"> </span><span class="gmail-m_-4860798478954399733gmail-s3">onData</span><span class="gmail-m_-4860798478954399733gmail-s1">(self, interest, data):<br></span><span class="gmail-m_-4860798478954399733gmail-s1">        self._callbackCount += </span><span class="gmail-m_-4860798478954399733gmail-s4">1<br></span><span class="gmail-m_-4860798478954399733gmail-s1">        dump(</span><span class="gmail-m_-4860798478954399733gmail-s4">"Got data packet with name"</span><span class="gmail-m_-4860798478954399733gmail-s1">, data.getName().toUri())<br></span><span class="gmail-m_-4860798478954399733gmail-s1">        </span><span class="gmail-m_-4860798478954399733gmail-s2">global</span><span class="gmail-m_-4860798478954399733gmail-s1"> version<br></span><span class="gmail-m_-4860798478954399733gmail-s1">        version = </span><span class="gmail-m_-4860798478954399733gmail-s4">'/'</span><span class="gmail-m_-4860798478954399733gmail-s1">+</span><span class="gmail-m_-4860798478954399733gmail-s3">str</span><span class="gmail-m_-4860798478954399733gmail-s1">(data.getName().get(-</span><span class="gmail-m_-4860798478954399733gmail-s4">1</span><span class="gmail-m_-4860798478954399733gmail-s1">)<wbr>)<br></span><span class="gmail-m_-4860798478954399733gmail-s1">        dump(</span><span class="gmail-m_-4860798478954399733gmail-s4">"Version extracted"</span><span class="gmail-m_-4860798478954399733gmail-s1">,version)</span></blockquote>




</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_default" style="font-family:tahoma,sans-serif">which gives me the output:</div><div class="gmail_default" style="font-family:tahoma,sans-serif">







<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-s1">Got data packet with name /ndn/broadcast/ndnfs/BigBuckBunny_4s_simple_2014_05_09.mpd/%C1.FS.file/%FDY.%DA%3D <br></span><span class="gmail-s1"></span></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-s1">Version extracted /%FDY.%DA%3D </span></blockquote>
</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><span style="font-size:12.8px"><br></span></div><div class="gmail_default" style="font-family:tahoma,sans-serif"><span style="font-size:12.8px">Regards,</span></div><div><div class="gmail-m_-4860798478954399733gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><font face="tahoma, sans-serif"><span style="font-size:12.8px">Ishita Dasgupta</span><br style="font-size:12.8px"><i style="font-size:12.8px">Graduate Student<br></i><i><font size="2"><span>College</span> of <span>Information</span> and <span>Com<wbr>puter</span> <span>Sciences</span></font></i><i style="font-size:12.8px">,<br>UMass Amherst</i><br style="font-size:12.8px"><i style="font-size:12.8px">Email</i><span style="font-size:12.8px">: <a href="mailto:ishitadg@cs.umass.edu" target="_blank">ishitadg@cs.umass.edu</a></span></font><br></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Wed, May 31, 2017 at 1:32 PM, Thompson, Jeff <span dir="ltr"><<a href="mailto:jefft0@remap.ucla.edu" target="_blank">jefft0@remap.ucla.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">



<div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif">
<div>Yes. This is called “name discovery”. </div>
<div><br>
</div>
<div>A question: You have "Name(url+version)”. I don’t see where you get “version”.</div>
<div><br>
</div>
<div>A hint: Maybe you shouldn’t call face.shutdown() the first time. Only call it at the end of your program.</div>
<div><br>
</div>
<div>- Jeff T</div>
<div><br>
</div>
<span id="gmail-m_-4860798478954399733m_-6299356388320936411OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri;font-size:11pt;text-align:left;color:black;border-width:1pt medium medium;border-style:solid none none;border-bottom-color:initial;border-left-color:initial;padding:3pt 0in 0in;border-top-color:rgb(181,196,223);border-right-color:initial">
<span style="font-weight:bold">From: </span>Ishita Dasgupta <<a href="mailto:ishita.dasgupta@gmail.com" target="_blank">ishita.dasgupta@gmail.com</a>><br>
<span style="font-weight:bold">Date: </span>Wednesday, May 31, 2017 at 8:14:00<div><div class="gmail-m_-4860798478954399733h5"><br>
<span style="font-weight:bold">To: </span>Jeff Thompson <<a href="mailto:jefft0@remap.ucla.edu" target="_blank">jefft0@remap.ucla.edu</a>><br>
<span style="font-weight:bold">Cc: </span>"<a href="mailto:ndn-interest@lists.cs.ucla.edu" target="_blank">ndn-interest@lists.cs.ucla.ed<wbr>u</a>" <<a href="mailto:ndn-interest@lists.cs.ucla.edu" target="_blank">ndn-interest@lists.cs.ucla.ed<wbr>u</a>><br>
<span style="font-weight:bold">Subject: </span>Re: [Ndn-interest] download a file using PyNDN<br>
</div></div></div><div><div class="gmail-m_-4860798478954399733h5">
<div><br>
</div>
<div>
<div>
<div dir="ltr">
<div class="gmail_default" style="font-family:tahoma,sans-serif">Hi Jeff, </div>
<div class="gmail_default" style="font-family:tahoma,sans-serif"><br>
</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif">I have got it working! Let me know if my procedure to extract the version number by sending a sample interest packet and receiving a sample data packet is correct or is there a simpler method
 to do it?</div>
</div>
<div class="gmail_extra"><br clear="all">
<div>
<div class="gmail-m_-4860798478954399733m_-6299356388320936411gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr"><font face="tahoma,sans-serif"><span style="font-size:12.8px">Regards,</span><br style="font-size:12.8px">
<span style="font-size:12.8px">Ishita Dasgupta</span><br style="font-size:12.8px">
<i style="font-size:12.8px">Graduate Student<br>
</i><i><font size="2"><span>College</span> of <span>Information</span> and <span>Com<wbr>puter</span> <span>Sciences</span></font></i><i style="font-size:12.8px">,<br>
UMass Amherst</i><br style="font-size:12.8px">
<i style="font-size:12.8px">Email</i><span style="font-size:12.8px">:
<a href="mailto:ishitadg@cs.umass.edu" target="_blank">ishitadg@cs.umass.edu</a></span></font><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<div class="gmail_quote">On Wed, May 31, 2017 at 10:46 AM, Ishita Dasgupta <span dir="ltr">
<<a href="mailto:ishita.dasgupta@gmail.com" target="_blank">ishita.dasgupta@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div class="gmail_default" style="font-family:tahoma,sans-serif">Hi Jeff, </div>
<div class="gmail_default" style="font-family:tahoma,sans-serif"><br>
</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif">To extract the current version, I express an interest on the face and extract the version from the data packet received. Then use this version to extract our data in segments using segment fetcher. </div>
<div class="gmail_default" style="font-family:tahoma,sans-serif">The main code lines look something like this</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif"><br>
</div>
<blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">
<span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385gmail-s1">
<div class="gmail_default" style="font-family:tahoma,sans-serif;display:inline">​       ​</div>
name = Name(url)</span><span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385gmail-s1"><br>
</span><span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385gmail-s1">        face.expressInterest(name, counter.onData, counter.onTimeout)
<div class="gmail_default" style="font-family:tahoma,sans-serif;display:inline">​ ​</div>
<br>
</span><span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385gmail-s1">        </span><span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385gmail-s3">while</span><span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385gmail-s1"> counter._callbackCount <
</span><span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385gmail-s2">1</span><span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385gmail-s1">:<br>
</span><span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385gmail-s1">                face.processEvents()<br>
</span><span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385gmail-s1">        face.shutdown()<br>
</span><span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385gmail-s1">        name = Name(url+version)<br>
</span><span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385gmail-s1">        dump(</span><span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385gmail-s2">"Express name "</span><span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385gmail-s1">, name.toUri())<br>
</span><span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385gmail-s1">        interest = Interest(name)<br>
</span><span><span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385gmail-s1">        interest.setInterestLifetimeMi<wbr>lliseconds(</span><span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385gmail-s2">1000</span><span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385gmail-s1">)<br>
</span><span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385gmail-s1">        SegmentFetcher.fetch(face, interest,
</span><span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385gmail-s4">None</span><span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385gmail-s1">, counter.onComplete, counter.onError)<br>
</span></span><span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385gmail-s1">        </span><span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385gmail-s3">while</span><span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385gmail-s1"> counter._callbackCount <
</span><span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385gmail-s2">2</span><span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385gmail-s1">:<br>
</span><span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385gmail-s1">                face.processEvents()<br>
</span>
<div class="gmail_default" style="font-family:tahoma,sans-serif;display:inline">​       ​</div>
face.shutdown()</blockquote>
<div> </div>
<div><span style="font-family:tahoma,sans-serif">But for the first interest, </span>i<span style="font-family:tahoma,sans-serif"> receive a "broken" vers</span>ion number
<div class="gmail_default" style="font-family:tahoma,sans-serif;display:inline">(</div>
<span style="font-family:tahoma,sans-serif">%FDY.%CF-</span>
<div class="gmail_default" style="font-family:tahoma,sans-serif;display:inline">)</div>
? which is why the segment fetcher doesn't work (?)</div>
<div><br>
</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385gmail-s1">1496241583.724584 From: 192.1.242.150, To: 192.1.242.151, Tunnel Type: TCP, INTEREST: /ndn/broadcast/ndnfs/BigBuckBu<wbr>nny_4s_simple_2014_05_09.mpd?n<wbr>dn.MustBeFresh=1&ndn.Nonce=150<wbr>0003601<br>
</span><span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385gmail-s1">1496241583.734759 From: 192.1.242.151, To: 192.1.242.150, Tunnel Type: TCP, DATA: /ndn/broadcast/ndnfs/BigBuckBu<wbr>nny_4s_simple_2014_05_09.mpd/%<wbr>C1.FS.file/%FDY.%CF-</span></blockquote>
<div><br>
</div>
<div>Is this how I should go about to fetch the version number before expressing the interest or is there a simpler method? </div>
</div>
</div>
<div class="gmail_extra"><span><br clear="all">
<div>
<div class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr"><font face="tahoma,sans-serif"><span style="font-size:12.8px">Regards,</span><br style="font-size:12.8px">
<span style="font-size:12.8px">Ishita Dasgupta</span><br style="font-size:12.8px">
<i style="font-size:12.8px">Graduate Student<br>
</i><i><font size="2"><span>College</span> of <span>Information</span> and <span>Com<wbr>puter</span> <span>Sciences</span></font></i><i style="font-size:12.8px">,<br>
UMass Amherst</i><br style="font-size:12.8px">
<i style="font-size:12.8px">Email</i><span style="font-size:12.8px">:
<a href="mailto:ishitadg@cs.umass.edu" target="_blank">ishitadg@cs.umass.edu</a></span></font><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
</span>
<div>
<div class="gmail-m_-4860798478954399733m_-6299356388320936411h5">
<div class="gmail_quote">On Fri, May 26, 2017 at 2:39 PM, Thompson, Jeff <span dir="ltr">
<<a href="mailto:jefft0@remap.ucla.edu" target="_blank">jefft0@remap.ucla.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif">
<div>That’s right. The names of the actual segment Data packets should be</div>
<div><br>
</div>
<div>
<div><span style="font-family:Calibri">/ndn/broadcast/ndnfs/</span><span style="font-family:Calibri">BigBuckBu<wbr>nny_4s_simple_2014_</span><span style="font-family:Calibri">05_09.mpd/%<wbr>FDY%</span><span style="font-family:Calibri;font-size:medium">28Q8/%00%00</span></div>
</div>
<div>
<div>
<div><span style="font-family:Calibri">/ndn/broadcast/ndnfs/</span><span style="font-family:Calibri">BigBuckBu<wbr>nny_4s_simple_2014_</span><span style="font-family:Calibri">05_09.mpd/%<wbr>FDY%</span><span style="font-family:Calibri;font-size:medium">28Q8/%00%01</span></div>
</div>
</div>
<div>
<div><span style="font-family:Calibri">/ndn/broadcast/ndnfs/</span><span style="font-family:Calibri">BigBuckBu<wbr>nny_4s_simple_2014_</span><span style="font-family:Calibri">05_09.mpd/%<wbr>FDY%</span><span style="font-family:Calibri;font-size:medium">28Q8/%00%02</span></div>
</div>
<div><span style="font-family:Calibri;font-size:medium"><br>
</span></div>
<div><span style="font-family:Calibri;font-size:medium">etc., up to the maximum segment number. You give SegmentFetcher the name without the final segment number component, and it adds the segment number component as it fetches each one.</span></div>
<div><span style="font-family:Calibri;font-size:medium"><br>
</span></div>
<div><span style="font-family:Calibri;font-size:medium">- Jeff T</span></div>
<div><span style="font-family:Calibri;font-size:medium"><br>
</span></div>
<span id="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385m_-9078321456016176751OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri;font-size:11pt;text-align:left;color:black;border-width:1pt medium medium;border-style:solid none none;border-bottom-color:initial;border-left-color:initial;padding:3pt 0in 0in;border-top-color:rgb(181,196,223);border-right-color:initial">
<span style="font-weight:bold">From: </span>Ishita Dasgupta <<a href="mailto:ishita.dasgupta@gmail.com" target="_blank">ishita.dasgupta@gmail.com</a>><br>
<span style="font-weight:bold">Date: </span>Friday, May 26, 2017 at 11:35:00
<div>
<div class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385h5"><br>
<span style="font-weight:bold">To: </span>Jeff Thompson <<a href="mailto:jefft0@remap.ucla.edu" target="_blank">jefft0@remap.ucla.edu</a>><br>
<span style="font-weight:bold">Cc: </span>"<a href="mailto:ndn-interest@lists.cs.ucla.edu" target="_blank">ndn-interest@lists.cs.ucla.ed<wbr>u</a>" <<a href="mailto:ndn-interest@lists.cs.ucla.edu" target="_blank">ndn-interest@lists.cs.ucla.ed<wbr>u</a>><br>
<span style="font-weight:bold">Subject: </span>Re: [Ndn-interest] download a file using PyNDN<br>
</div>
</div>
</div>
<div>
<div class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385h5">
<div><br>
</div>
<div>
<div>
<div dir="ltr">
<div class="gmail_default"><font face="tahoma,sans-serif">So, just so that I understand this correctly: " </font><span style="font-family:Calibri;color:rgb(0,0,0);font-size:14px">%FDY%</span><span style="font-family:Calibri;font-size:12.8px">28Q8 "
</span><span style="font-size:12.8px"><font face="arial,helvetica,sans-serif">is the version component of the all data packet segments representing the file. And then the Segment Fetcher program sequentially downloads the segments individually (and I don't
 need to worry about the segment numbers?)</font></span></div>
</div>
<div class="gmail_extra"><br clear="all">
<div>
<div class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385m_-9078321456016176751gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr"><font face="tahoma,sans-serif"><span style="font-size:12.8px">Regards,</span><br style="font-size:12.8px">
<span style="font-size:12.8px">Ishita Dasgupta</span><br style="font-size:12.8px">
<i style="font-size:12.8px">Graduate Student<br>
</i><i><font size="2"><span>College</span> of <span>Information</span> and <span>Com<wbr>puter</span> <span>Sciences</span></font></i><i style="font-size:12.8px">,<br>
UMass Amherst</i><br style="font-size:12.8px">
<i style="font-size:12.8px">Email</i><span style="font-size:12.8px">:
<a href="mailto:ishitadg@cs.umass.edu" target="_blank">ishitadg@cs.umass.edu</a></span></font><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<div class="gmail_quote">On Fri, May 26, 2017 at 2:31 PM, Thompson, Jeff <span dir="ltr">
<<a href="mailto:jefft0@remap.ucla.edu" target="_blank">jefft0@remap.ucla.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div style="word-wrap:break-word">
<div style="color:rgb(0,0,0);font-size:14px"><font face="Calibri">Please try the following: Don’t add the line to set the exclude filter, and change the name to include the version number (without “%C1.FS.file”):</font></div>
<div style="color:rgb(0,0,0);font-size:14px"><font face="Calibri"><br>
</font></div>
<div><font face="Calibri">name3 = Name("<span style="color:rgb(0,0,0);font-size:14px">/ndn/broadcast/ndnfs/</span><span style="color:rgb(0,0,0);font-size:14px">Big<wbr>BuckBunny_4s_simple_2014_</span><span style="color:rgb(0,0,0);font-size:14px">05_09<wbr>.mpd/%FDY%</span>28Q8”)</font></div>
<div><font face="Calibri"><br>
</font></div>
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">The reason is that the segment component comes after the version component “<span style="font-family:Calibri">/%FDY%</span><span style="font-family:Calibri">28Q8</span>”.</div>
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px"><br>
</div>
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">- Jeff T</div>
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px"><br>
</div>
<span id="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385m_-9078321456016176751m_-2077943756557895016OLK_SRC_BODY_SECTION" style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">
<div style="font-family:Calibri;font-size:11pt;text-align:left;color:black;border-width:1pt medium medium;border-style:solid none none;border-bottom-color:initial;border-left-color:initial;padding:3pt 0in 0in;border-top-color:rgb(181,196,223);border-right-color:initial">
<span style="font-weight:bold">From: </span>Ishita Dasgupta <<a href="mailto:ishita.dasgupta@gmail.com" target="_blank">ishita.dasgupta@gmail.com</a>><br>
<span style="font-weight:bold">Date: </span>Friday, May 26, 2017 at 11:22:00
<div>
<div class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385m_-9078321456016176751h5"><br>
<span style="font-weight:bold">To: </span>Jeff Thompson <<a href="mailto:jefft0@remap.ucla.edu" target="_blank">jefft0@remap.ucla.edu</a>><br>
<span style="font-weight:bold">Cc: </span>"<a href="mailto:ndn-interest@lists.cs.ucla.edu" target="_blank">ndn-interest@lists.cs.ucla.ed<wbr>u</a>" <<a href="mailto:ndn-interest@lists.cs.ucla.edu" target="_blank">ndn-interest@lists.cs.ucla.ed<wbr>u</a>><br>
<span style="font-weight:bold">Subject: </span>Re: [Ndn-interest] download a file using PyNDN<br>
</div>
</div>
</div>
<div>
<div class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385m_-9078321456016176751h5">
<div><br>
</div>
<div>
<div>
<div dir="ltr">
<div class="gmail_default" style="font-family:tahoma,sans-serif">Hi Jeff, </div>
<div class="gmail_default" style="font-family:tahoma,sans-serif"><br>
</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif">Now it would not return any Data packet at all.</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif">At consumer(ndndump):</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385m_-9078321456016176751m_-2077943756557895016gmail-s1">1495818158.862071 From: 192.1.242.150, To: 192.1.242.151, Tunnel Type: TCP, INTEREST: /ndn/broadcast/ndnfs/BigBuckBu<wbr>nny_4s_simple_2014_05_09.mpd?n<wbr>dn.ChildSelector=1&ndn.MustBeF<wbr>resh=1&ndn.InterestLifetime=10<wbr>00&ndn.Nonce=1259570516&ndn.Ex<wbr>clude=%C1.FS.file</span> </blockquote>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<NO DATA PACKET IN RESPONSE> </blockquote>
</div>
</div>
<div class="gmail_extra"><br clear="all">
<div>
<div class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385m_-9078321456016176751m_-2077943756557895016gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr"><font face="tahoma,sans-serif"><span style="font-size:12.8px">Regards,</span><br style="font-size:12.8px">
<span style="font-size:12.8px">Ishita Dasgupta</span><br style="font-size:12.8px">
<i style="font-size:12.8px">Graduate Student<br>
</i><i><font size="2"><span>College</span> of <span>Information</span> and <span>Com<wbr>puter</span> <span>Sciences</span></font></i><i style="font-size:12.8px">,<br>
UMass Amherst</i><br style="font-size:12.8px">
<i style="font-size:12.8px">Email</i><span style="font-size:12.8px">:
<a href="mailto:ishitadg@cs.umass.edu" target="_blank">ishitadg@cs.umass.edu</a></span></font><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<div class="gmail_quote">On Fri, May 26, 2017 at 12:54 PM, Thompson, Jeff <span dir="ltr">
<<a href="mailto:jefft0@remap.ucla.edu" target="_blank">jefft0@remap.ucla.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif">
<div>After</div>
<div><br>
</div>
<div>interest = Interest(name3)</div>
<div><br>
</div>
<div>try adding </div>
<div><br>
</div>
<div>interest.getExclude().appendCo<wbr>mponent(Name("%C1.FS.file")[0]<wbr>)</div>
<div><br>
</div>
<div>This is because NDNFS not only serves the Data packet segments of the file, but a “meta info” packet where the name has the component “"%C1.FS.file”. The code above should exclude it.</div>
<div><br>
</div>
<div>Let us know,</div>
<div>- Jeff T</div>
<div><br>
</div>
<span id="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385m_-9078321456016176751m_-2077943756557895016m_-1835740769646663119OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri;font-size:11pt;text-align:left;color:black;border-width:1pt medium medium;border-style:solid none none;border-bottom-color:initial;border-left-color:initial;padding:3pt 0in 0in;border-top-color:rgb(181,196,223);border-right-color:initial">
<span style="font-weight:bold">From: </span>Ishita Dasgupta <<a href="mailto:ishita.dasgupta@gmail.com" target="_blank">ishita.dasgupta@gmail.com</a>><br>
<span style="font-weight:bold">Date: </span>Friday, May 26, 2017 at 9:38:00<br>
<span style="font-weight:bold">To: </span>Jeff Thompson <<a href="mailto:jefft0@remap.ucla.edu" target="_blank">jefft0@remap.ucla.edu</a>><br>
<span style="font-weight:bold">Cc: </span>"<a href="mailto:ndn-interest@lists.cs.ucla.edu" target="_blank">ndn-interest@lists.cs.ucla.ed<wbr>u</a>" <<a href="mailto:ndn-interest@lists.cs.ucla.edu" target="_blank">ndn-interest@lists.cs.ucla.ed<wbr>u</a>>
<div>
<div class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385m_-9078321456016176751m_-2077943756557895016h5">
<br>
<span style="font-weight:bold">Subject: </span>Re: [Ndn-interest] download a file using PyNDN<br>
</div>
</div>
</div>
<div>
<div class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385m_-9078321456016176751m_-2077943756557895016h5">
<div><br>
</div>
<div>
<div>
<div dir="ltr">
<div class="gmail_default" style="font-family:tahoma,sans-serif">Hi Jeff, </div>
<div class="gmail_default" style="font-family:tahoma,sans-serif"><br>
</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif">I have a file test.txt being served on my ndnfs server. Prefix: /ndn/broadcast/ndnfs</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif">I implement SegmentFetcher in the following way and print content and error message <br>
<br>
</div>
<blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">
 name3 = Name(url)<br>
<span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385m_-9078321456016176751m_-2077943756557895016m_-1835740769646663119gmail-s1"> dump(</span><span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385m_-9078321456016176751m_-2077943756557895016m_-1835740769646663119gmail-s2">"Express name "</span><span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385m_-9078321456016176751m_-2077943756557895016m_-1835740769646663119gmail-s1">,
 name3.toUri())<br>
</span> interest = Interest(name3)<br>
 dump(interest.toUri())<br>
<span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385m_-9078321456016176751m_-2077943756557895016m_-1835740769646663119gmail-s1"> interest.setInterestLifetimeM<wbr>illiseconds(</span><span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385m_-9078321456016176751m_-2077943756557895016m_-1835740769646663119gmail-s2">1000</span><span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385m_-9078321456016176751m_-2077943756557895016m_-1835740769646663119gmail-s1">)<br>
</span><span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385m_-9078321456016176751m_-2077943756557895016m_-1835740769646663119gmail-s1" style="color:rgb(77,47,45);font-family:Courier;font-size:12px">SegmentFetcher.fetch(face, interest,
</span><span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385m_-9078321456016176751m_-2077943756557895016m_-1835740769646663119gmail-s3" style="font-family:Courier;font-size:12px">None</span><span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385m_-9078321456016176751m_-2077943756557895016m_-1835740769646663119gmail-s1" style="color:rgb(77,47,45);font-family:Courier;font-size:12px">,
 counter.onComplete, counter.onError)</span> </blockquote>
<div class="gmail_default" style="font-family:tahoma,sans-serif"><br>
</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif">This is what i get: </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span style="font-family:tahoma,sans-serif">/ndn/broadcast/ndnfs/BigBuckBu<wbr>nny_4s_simple_2014_05_09.mpd?n<wbr>dn.MustBeFresh=true <br>
</span><span style="font-family:tahoma,sans-serif">onError<br>
</span><span style="font-family:tahoma,sans-serif">2<br>
</span><span style="font-family:tahoma,sans-serif">Got an unexpected packet without a segment number: /ndn/broadcast/ndnfs/BigBuckBu<wbr>nny_4s_simple_2014_05_09.mpd/%<wbr>C1.FS.file/%FDY%28Q8</span></blockquote>
<div><br>
</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif">When I do an ndndump on the consumer, I see: </div>
<div class="gmail_default" style="font-family:tahoma,sans-serif">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385m_-9078321456016176751m_-2077943756557895016m_-1835740769646663119gmail-s1">1495816236.074843 From: 192.1.242.150, To: 192.1.242.151, Tunnel Type: TCP, INTEREST: /ndn/broadcast/ndnfs/BigBuckBu<wbr>nny_4s_simple_2014_05_09.mpd?n<wbr>dn.ChildSelector=1&ndn.MustBeF<wbr>resh=1&ndn.InterestLifetime=10<wbr>00&ndn.Nonce=3797640908</span> </blockquote>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
 </blockquote>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385m_-9078321456016176751m_-2077943756557895016m_-1835740769646663119gmail-s1"></span><span class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385m_-9078321456016176751m_-2077943756557895016m_-1835740769646663119gmail-s1">1495816236.085709 From: 192.1.242.151,
 To: 192.1.242.150, Tunnel Type: TCP, DATA: /ndn/broadcast/ndnfs/BigBuckBu<wbr>nny_4s_simple_2014_05_09.mpd/%<wbr>C1.FS.file/%FDY%28Q8</span></blockquote>
<div><br>
</div>
<div>I thought fetching segment number was internally done in your Segment Fetcher util. Do I need to implement it some way on my end as well? </div>
</div>
</div>
<div class="gmail_extra"><br clear="all">
<div>
<div class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385m_-9078321456016176751m_-2077943756557895016m_-1835740769646663119gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr"><font face="tahoma,sans-serif"><span style="font-size:12.8px">Regards,</span><br style="font-size:12.8px">
<span style="font-size:12.8px">Ishita Dasgupta</span><br style="font-size:12.8px">
<i style="font-size:12.8px">Graduate Student<br>
</i><i><font size="2"><span>College</span> of <span>Information</span> and <span>Com<wbr>puter</span> <span>Sciences</span></font></i><i style="font-size:12.8px">,<br>
UMass Amherst</i><br style="font-size:12.8px">
<i style="font-size:12.8px">Email</i><span style="font-size:12.8px">:
<a href="mailto:ishitadg@cs.umass.edu" target="_blank">ishitadg@cs.umass.edu</a></span></font><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<div class="gmail_quote">On Thu, May 25, 2017 at 2:15 PM, Thompson, Jeff <span dir="ltr">
<<a href="mailto:jefft0@remap.ucla.edu" target="_blank">jefft0@remap.ucla.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif">
<div>Hi Ishita,</div>
<div><br>
</div>
<div>We have NDNFS producing sample data at <a href="http://memoria.ndn.ucla.edu" target="_blank">
memoria.ndn.ucla.edu</a>. The PyNDN code below uses the SegmentFetcher to fetch the segments of a file (a JavaScript file). NDNFS has split the file into 12 segments, which SegmentFetcher retrieves to supply the content to the callback. SegmentFetcher documentation
 is here:</div>
<div><a href="https://github.com/named-data/PyNDN2/blob/master/python/pyndn/util/segment_fetcher.py#L142" target="_blank">https://github.com/named-data/<wbr>PyNDN2/blob/master/python/pynd<wbr>n/util/segment_fetcher.py#L142</a><wbr> </div>
<div><br>
</div>
<div>- Jeff T</div>
<div><br>
</div>
<div>
<div>import time, sys</div>
<div>from pyndn import Name, Interest, Face</div>
<div>from pyndn.util import SegmentFetcher</div>
<div><br>
</div>
<div>face = Face("<a href="http://memoria.ndn.ucla.edu" target="_blank">memoria.ndn.ucla.edu</a>")</div>
<div>SegmentFetcher.fetch(face, Interest(Name(</div>
<div>  "/ndn/edu/ucla/remap/demo/ndn-<wbr>js-test/<a href="http://named-data.net/wp-includes/js/jquery/jquery.js/%FDX%DC5B" target="_blank">named-data.net/wp-incl<wbr>udes/js/jquery/jquery.js/%FDX%<wbr>DC5B</a>")),</div>
<div>  None, lambda content: sys.stdout.write(content.toRaw<wbr>Str()),</div>
<div>  lambda errorCode, message: sys.stdout.write("Got error " + message))</div>
<div><br>
</div>
<div>while True:</div>
<div>    face.processEvents()</div>
<div>    time.sleep(0.01)</div>
</div>
<div><br>
</div>
<div><br>
</div>
<span id="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385m_-9078321456016176751m_-2077943756557895016m_-1835740769646663119m_-584098919483880819OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri;font-size:11pt;text-align:left;color:black;border-width:1pt medium medium;border-style:solid none none;border-bottom-color:initial;border-left-color:initial;padding:3pt 0in 0in;border-top-color:rgb(181,196,223);border-right-color:initial">
<span style="font-weight:bold">From: </span>Ishita Dasgupta <<a href="mailto:ishita.dasgupta@gmail.com" target="_blank">ishita.dasgupta@gmail.com</a>><br>
<span style="font-weight:bold">Date: </span>Thursday, May 25, 2017 at 6:00:00<br>
<span style="font-weight:bold">To: </span>Jeff Thompson <<a href="mailto:jefft0@remap.ucla.edu" target="_blank">jefft0@remap.ucla.edu</a>>, "<a href="mailto:ndn-interest@lists.cs.ucla.edu" target="_blank">ndn-interest@lists.cs.ucla.ed<wbr>u</a>" <<a href="mailto:ndn-interest@lists.cs.ucla.edu" target="_blank">ndn-interest@lists.cs.ucla.ed<wbr>u</a>><br>
<span style="font-weight:bold">Subject: </span>Re: [Ndn-interest] download a file using PyNDN<br>
</div>
<div>
<div class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385m_-9078321456016176751m_-2077943756557895016m_-1835740769646663119h5">
<div><br>
</div>
<div>
<div>
<div dir="ltr">
<div>Hi Jeff, </div>
<div><br>
</div>
<div>Yes
<div class="gmail_default" style="font-family:tahoma,sans-serif;display:inline">​, the producer is responding to Interests with Data packets representing the file. I run NDNFS on the producer.</div>
</div>
<div>
<div class="gmail_default" style="font-family:tahoma,sans-serif;display:inline">​</div>
<br>
<div class="gmail_quote">
<div>On Wed, May 24, 2017 at 4:35 PM Thompson, Jeff <<a href="mailto:jefft0@remap.ucla.edu" target="_blank">jefft0@remap.ucla.edu</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif">
<div>Hi Ishta,</div>
<div><br>
</div>
<div>In NDN, there is a producer and consumer. The consumer sends an Interest and the producer (or a cache in the network) responds with a Data packet. When you say “an entire file from an NDN server” I assume you mean a producer that is responding to Interests
 with Data packets representing the file. What producer software is running on the server?</div>
<div><br>
</div>
<div>- Jeff T</div>
<div><br>
</div>
<span id="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385m_-9078321456016176751m_-2077943756557895016m_-1835740769646663119m_-584098919483880819m_-8976340295034124263m_7103723139979724157OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri;font-size:11pt;text-align:left;color:black;border-width:1pt medium medium;border-style:solid none none;border-bottom-color:initial;border-left-color:initial;padding:3pt 0in 0in;border-top-color:rgb(181,196,223);border-right-color:initial">
<span style="font-weight:bold">From: </span>Ndn-interest <<a href="mailto:ndn-interest-bounces@lists.cs.ucla.edu" target="_blank">ndn-interest-bounces@lists.cs<wbr>.ucla.edu</a>> on behalf of Ishita Dasgupta <<a href="mailto:ishita.dasgupta@gmail.com" target="_blank">ishita.dasgupta@gmail.com</a>><br>
<span style="font-weight:bold">Date: </span>Wednesday, May 24, 2017 at 8:29:00<br>
<span style="font-weight:bold">To: </span>"<a href="mailto:ndn-interest@lists.cs.ucla.edu" target="_blank">ndn-interest@lists.cs.ucla.ed<wbr>u</a>" <<a href="mailto:ndn-interest@lists.cs.ucla.edu" target="_blank">ndn-interest@lists.cs.ucla.ed<wbr>u</a>><br>
<span style="font-weight:bold">Subject: </span>[Ndn-interest] download a file using PyNDN<br>
</div>
</span></div>
<div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif">
<span id="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385m_-9078321456016176751m_-2077943756557895016m_-1835740769646663119m_-584098919483880819m_-8976340295034124263m_7103723139979724157OLK_SRC_BODY_SECTION">
<div><br>
</div>
<div>
<div>
<div>
<div class="gmail_default" style="font-family:tahoma,sans-serif">Hi All, </div>
<div class="gmail_default" style="font-family:tahoma,sans-serif"><br>
</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif">Has anybody used PyNDN to download an entire file from an ndn server?</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif">I see or receive jibberish data in form of one data packet but don't seem to copying the exact content of the file(no matter the size, i.e irrespective of the fact that the file gets divided to
 multiple segments or just one segment).</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif">Any guidance with this would be helpful.</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif"><br>
</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif">Thanks,</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif">Ishita</div>
<div>
<div class="gmail-m_-4860798478954399733m_-6299356388320936411m_7220698003351639385m_-9078321456016176751m_-2077943756557895016m_-1835740769646663119m_-584098919483880819m_-8976340295034124263m_7103723139979724157gmail_signature">
<div>
<div>
<div></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</span></div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</span></div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
</span></div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
</span></div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
</span></div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div></div></span>
</div>

</blockquote></div><br></div></div>