[Mini-NDN] Beginners question: Mini-NDN applications & Python-NDN

Peter Kietzmann peter.kietzmann at haw-hamburg.de
Fri Aug 13 00:50:13 PDT 2021


Hi Lan, Xinyu, all,

thanks for your responses. I got that running now, after going through a
bunch of beginners mistakes I made / had to deal with. Maybe it helps
someone:

- Calling python-ndn applications from mini-ndn led to some unresolved
dependencies. I worked around it by compiling executables from
producer/consumer examples (pyinstaller --onefile *.py) .
- From the new producer/consumer class in mini-ndn, execute the app
like: Application.start(self, <python executable>, self.logFile).
- I do not add FIB entries manually but utilize NLSR. To do so, I had to
change name prefixes of producer/consumer applications, e.g.,
/ndn/<node-site>/<node> .
- From mini-ndn, start producer first, to register prefix. Then, run
NLSR and give it a good amount of time (tens of seconds) before
requesting content on the consumer.

Cheers
Peter

On 13.08.21 04:58, Xinyu Ma wrote:
> Hello, Peter,
> 
> Unfortunately, I have never used mini-NDN.
> There are some python-ndn example applications under the examples
> <https://github.com/named-data/python-ndn/tree/master/examples> folder,
> but I don’t know how to run them on mini-NDN.
> If you know how to execute python programs on mini-NDN, you can try to
> run consumer.py and producer.py on two nodes, where the consumer’s node
> has a FIB entry `/example` pointing to the producer’s node.
> 
> Best regards,
> Xinyu Ma.
> 
>> On Aug 12, 3 Reiwa, at 15:17, Lan Wang (lanwang) <lanwang at memphis.edu
>> <mailto:lanwang at memphis.edu>> wrote:
>>
>> I doubt people on the Mini-NDN mailing list know the answer.  It’s
>> best for Xinyu to help you.
>>
>> Lan
>>
>>> On Jul 30, 2021, at 10:43 AM, Peter Kietzmann
>>> <Peter.Kietzmann at haw-hamburg.de
>>> <mailto:Peter.Kietzmann at haw-hamburg.de>> wrote:
>>>
>>> Dear list, Lan, Xinyu Ma,
>>>
>>> TL;DR:
>>> does anyone have an example of how to run the python-NDN
>>> producer/consumer example applications on multiple hosts started from
>>> mini-NDN?
>>>
>>> --
>>>
>>> Many thanks for your guidance. I was able to move a bit forward (with
>>> Philipps help), however, two questions remain open. Not sure which is
>>> mini-NDN or python-NDN related.
>>>
>>> Basically, I implement consumer/producer classes in
>>> mini-NDN/examples/mnndn.py and start them separately (using AppManager)
>>> on two different hosts in a three-node line topology. Internally, these
>>> classes should call python-NDN/examples/consumer.py (and producer.py
>>> respectively).
>>>
>>> 1. Calling the python script from the consumer class alike "python3
>>> <path>/consumer.py" leads to:
>>>
>>> "python3 /home/vagrant/python-ndn/examples/consumer.py" == Traceback
>>> (most recent call last):
>>> File "/home/vagrant/python-ndn/examples/consumer.py", line 19, in
>>> <module>
>>>   import ndn.utils
>>> ModuleNotFoundError: No module named 'ndn'
>>>
>>> This can be "fixed", creating a standalone executable from the
>>> respective python script beforehand, but is very un-handy. What is a
>>> better solution?
>>>
>>> 2. The current python-NDN producer is blocking. Where would be the right
>>> place to make it asynchronous, within the python-NDN application, or
>>> within mini-NDN that runs the application on a host?
>>>
>>> Thanks again and cheers
>>> Peter
>>>
>>> On 29.07.21 18:30, Lan Wang (lanwang) wrote:
>>>> Hi Peter,
>>>>
>>>> Welcome to Mini-NDN.  I think developing a Python-NDN application in
>>>> Mini-NDN is the same as developing it outside Mini-NDN.  The purpose of
>>>> using Mini-NDN is to avoid having to change any applications.  For
>>>> specific questions about Python NDN, it’s best to read the documentation
>>>> https://python-ndn.readthedocs.io/en/latest/src/examples/examples.html
>>>> and
>>>> ask the developers, e.g., Xinyu Ma (xinyu.ma at cs.ucla.edu
>>>> <mailto:xinyu.ma at cs.ucla.edu>
>>>> <mailto:xinyu.ma at cs.ucla.edu>).
>>>>
>>>> Lan
>>>>
>>>>> On Jul 28, 2021, at 10:12 AM, Peter Kietzmann
>>>>> <peter.kietzmann at haw-hamburg.de <mailto:peter.kietzmann at haw-hamburg.de>
>>>>> <mailto:peter.kietzmann at haw-hamburg.de>> wrote:
>>>>>
>>>>> CAUTION: This email originated from outside of the organization. Do
>>>>> not click links or open attachments unless you recognize the sender
>>>>> and trust the content is safe.
>>>>>
>>>>>
>>>>> Dear Community,
>>>>>
>>>>> first of all: I am an absolute newbie to Mini-NDN (/the whole NDN code
>>>>> base), so apologies for asking basic or duplicate questions :).
>>>>>
>>>>> I've successfully installed your VM and played with built-in examples
>>>>> (ndnping etc.) and my own topologies -> that worked well! Now I would
>>>>> like to implement consumer/producer application logic. Python-NDN [1]
>>>>> seems like a promising candidate, however, I cannot find starter
>>>>> material. How to run Python-NDN applications on top of Mini-NDN?
>>>>>
>>>>> Can anyone navigate me to a tutorial, a similar topic on this list, or
>>>>> share first steps that might help to get started?
>>>>>
>>>>> Many thanks in advance!
>>>>>
>>>>> Cheers
>>>>> Peter
>>>>>
>>>>> [1] https://github.com/named-data/python-ndn
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Peter Kietzmann
>>>>>
>>>>> Hamburg University of Applied Sciences
>>>>> Dept. Informatik, Internet Technologies Group
>>>>> Berliner Tor 7, 20099 Hamburg, Germany
>>>>> Fon: +49-40-42875-8426
>>>>> Web: http://www.haw-hamburg.de/inet
>>>>>
>>>>> _______________________________________________
>>>>> Mini-NDN mailing list
>>>>> Mini-NDN at lists.cs.ucla.edu <mailto:Mini-NDN at lists.cs.ucla.edu>
>>>>> <mailto:Mini-NDN at lists.cs.ucla.edu>
>>>>> http://www.lists.cs.ucla.edu/mailman/listinfo/mini-ndn
>>>>
>>>
>>> -- 
>>> Peter Kietzmann
>>>
>>> Hamburg University of Applied Sciences
>>> Dept. Informatik, Internet Technologies Group
>>> Berliner Tor 7, 20099 Hamburg, Germany
>>> Fon: +49-40-42875-8426
>>> Web: http://www.haw-hamburg.de/inet
>>>
>>> _______________________________________________
>>> Mini-NDN mailing list
>>> Mini-NDN at lists.cs.ucla.edu <mailto:Mini-NDN at lists.cs.ucla.edu>
>>> http://www.lists.cs.ucla.edu/mailman/listinfo/mini-ndn
>>
> 

-- 
Peter Kietzmann

Hamburg University of Applied Sciences
Dept. Informatik, Internet Technologies Group
Berliner Tor 7, 20099 Hamburg, Germany
Fon: +49-40-42875-8426
Web: http://www.haw-hamburg.de/inet

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://www.lists.cs.ucla.edu/pipermail/mini-ndn/attachments/20210813/6c877ce4/attachment.sig>


More information about the Mini-NDN mailing list