[Ndn-interest] download a file using PyNDN
ishita.dasgupta at gmail.com
Fri May 26 09:38:31 PDT 2017
I have a file test.txt being served on my ndnfs server. Prefix:
I implement SegmentFetcher in the following way and print content and error
name3 = Name(url)
> dump("Express name ", name3.toUri())
> interest = Interest(name3)
> SegmentFetcher.fetch(face, interest, None, counter.onComplete,
This is what i get:
> Got an unexpected packet without a segment number:
When I do an ndndump on the consumer, I see:
> 1495816236.074843 From: 126.96.36.199, To: 188.8.131.52, Tunnel Type:
> TCP, INTEREST:
1495816236.085709 From: 184.108.40.206, To: 220.127.116.11, Tunnel Type: TCP,
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?
*Graduate Student**College of Information and Computer Sciences*
*Email*: ishitadg at cs.umass.edu
On Thu, May 25, 2017 at 2:15 PM, Thompson, Jeff <jefft0 at remap.ucla.edu>
> Hi Ishita,
> We have NDNFS producing sample data at memoria.ndn.ucla.edu. The PyNDN
> code below uses the SegmentFetcher to fetch the segments of a file (a
> SegmentFetcher retrieves to supply the content to the callback.
> SegmentFetcher documentation is here:
> - Jeff T
> import time, sys
> from pyndn import Name, Interest, Face
> from pyndn.util import SegmentFetcher
> face = Face("memoria.ndn.ucla.edu")
> SegmentFetcher.fetch(face, Interest(Name(
> None, lambda content: sys.stdout.write(content.toRawStr()),
> lambda errorCode, message: sys.stdout.write("Got error " + message))
> while True:
> From: Ishita Dasgupta <ishita.dasgupta at gmail.com>
> Date: Thursday, May 25, 2017 at 6:00:00
> To: Jeff Thompson <jefft0 at remap.ucla.edu>, "ndn-interest at lists.cs.ucla.edu"
> <ndn-interest at lists.cs.ucla.edu>
> Subject: Re: [Ndn-interest] download a file using PyNDN
> Hi Jeff,
> , the producer is responding to Interests with Data packets representing
> the file. I run NDNFS on the producer.
> On Wed, May 24, 2017 at 4:35 PM Thompson, Jeff <jefft0 at remap.ucla.edu>
>> Hi Ishta,
>> 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?
>> - Jeff T
>> From: Ndn-interest <ndn-interest-bounces at lists.cs.ucla.edu> on behalf of
>> Ishita Dasgupta <ishita.dasgupta at gmail.com>
>> Date: Wednesday, May 24, 2017 at 8:29:00
>> To: "ndn-interest at lists.cs.ucla.edu" <ndn-interest at lists.cs.ucla.edu>
>> Subject: [Ndn-interest] download a file using PyNDN
>> Hi All,
>> Has anybody used PyNDN to download an entire file from an ndn server?
>> 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).
>> Any guidance with this would be helpful.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Ndn-interest