[Mini-NDN] Issues with producer and consumer in Python experiment

Saurab Dulal (sdulal) sdulal at memphis.edu
Wed Sep 30 11:24:27 PDT 2020


Hi André,

The experiment setup seems fine. Can you add 20 - 30s sleep after starting the NLSR and see if the problem goes away?


info('Starting NLSR on nodes\n')
    nlsrs = AppManager(ndn, ndn.net.hosts, Nlsr)

    time.sleep(30) # 30s to be on safe side.

    # Run producer
    producer = ndn.net.hosts[0]

NLSR takes some time to compute the whole routing table. So, if the routes are not set up by the time the consumer requests for the data, it will get the NoRoute nacks.

Regards,
Saurab Dulal

________________________________
From: Mini-NDN <mini-ndn-bounces at lists.cs.ucla.edu> on behalf of Alexander Wilhelm Lane (awlane) <awlane at memphis.edu>
Sent: Tuesday, September 29, 2020 6:03 PM
To: adcarneiro at inf.ufrgs.br <adcarneiro at inf.ufrgs.br>
Cc: mini-ndn at lists.cs.ucla.edu <mini-ndn at lists.cs.ucla.edu>
Subject: Re: [Mini-NDN] Issues with producer and consumer in Python experiment

Apologies if these are unhelpful suggestions but could you post the output from the producer program when called from the script? You should just be able to capture that in Bash. You also could try using something like ndnping to see if it’s an issue with NFD or routing in the script or something occurring when you run the producer.

I’d recommend using the getPopen method from minindn.util in the future as it uses the more robust Python popen API.
-Alex

On Sep 29, 2020, at 3:28 PM, Lan Wang (lanwang) <lanwang at memphis.edu<mailto:lanwang at memphis.edu>> wrote:



Begin forwarded message:

From: "André D. Carneiro" <adcarneiro at inf.ufrgs.br<mailto:adcarneiro at inf.ufrgs.br>>
Date: September 28, 2020 at 8:56:41 PM CDT
To: "Lan Wang (lanwang)" <lanwang at memphis.edu<mailto:lanwang at memphis.edu>>
Subject: Re:  [Mini-NDN] Issues with producer and consumer in Python experiment



Hi,


the consumers are getting NACKs when the commands are issued within python, when running the same commands in the hosts' xterm windows, the consumers get the data. Here is the simplest code I used to test it, it was based on the mnndn.py script and the imports were kept the same.

The only exception to that is the consumer ran by the same host that also ran the producer program, which received the data.

if __name__ == '__main__':
    setLogLevel('info')

    Minindn.cleanUp()
    Minindn.verifyDependencies()

    ndn = Minindn()

    ndn.start()

    info('Starting NFD on nodes\n')
    nfds = AppManager(ndn, ndn.net.hosts, Nfd)
    info('Starting NLSR on nodes\n')
    nlsrs = AppManager(ndn, ndn.net.hosts, Nlsr)

    # Run producer
    producer = ndn.net.hosts[0]
    strInterestFilter = '/myApp/' + producer.name
    strCmdAdvertise = 'nlsrc advertise ' + strInterestFilter
    strCmdProducer  = 'producer ' + strInterestFilter + ' &'
    producer.cmd(strCmdAdvertise)
    producer.cmd(strCmdProducer)
    time.sleep(1)

    # Run consumers
    for host in ndn.net.hosts:
        strCmdConsumer = 'consumer ' + strInterestFilter
        host.cmd(strCmdConsumer)

    MiniNDNCLI(ndn.net<http://ndn.net>)

    ndn.stop()


Printing the commands above issued to the hosts, I get the following:

CmdProducer: nlsrc advertise /myApp/a
CmdProducer: producer /myApp/a &
CmdConsumer: consumer /myApp/a
CmdConsumer: consumer /myApp/a
CmdConsumer: consumer /myApp/a
CmdConsumer: consumer /myApp/a


Running these same commands in the hosts' xterm windows, in the same default topology, all the consumers get the data as expected. I believe there must be some command missing from the python script, I just don't know what it is.

The producer and consumer programs used here are only slightly modified versions of the ones in the examples folder so that they log times and accept some parameters from the command line. They were compiled and have a symbolic link so they can be called without their full path.


best regards,

André Dexheimer Carneiro


On 28/09/2020 13:29, Lan Wang (lanwang) wrote:
Can you explain what specific problems you have right now?  Are the consumers getting the data?

Lan

On Sep 27, 2020, at 7:33 PM, Lan Wang (lanwang) <lanwang at memphis.edu<mailto:lanwang at memphis.edu>> wrote:



Begin forwarded message:

From: André D. Carneiro <adcarneiro at inf.ufrgs.br<mailto:adcarneiro at inf.ufrgs.br>>
Subject: Issues with producer and consumer in Python experiment
Date: September 27, 2020 at 5:42:24 PM CDT
To: mini-ndn at lists.cs.ucla.edu<mailto:mini-ndn at lists.cs.ucla.edu>


Hi everyone and thanks very much for the help so far,


I have the basics covered now and the install seems to be working fine. Running producers/consumers on the MiniNDN CLI responds as I expected so I got back to my python experiment. Only when instantiating producers/consumers via the 'host.cmd' directive I am getting NACKs, though I'm not sure why. These producer and consumer programs are copies from the ones in the examples directory, only with minimal changes to log the elapsed time and accept interest filters from the command line.

To give you a broad view of the script, all the producers are instantiated during setup, being assigned their interest filter, after running their respective 'nlsrc advertise'  command (thanks for that again) and running in the background (ex. 'producer /a &').

The consumers are instantiated by demand, the main difference being that they don't run in the background (without the '&') and they are responsible for logging the elapsed time when onData, onNack or onTimeout is called.

When the experiment is done and the CLI is shown, I ran 'nlsrc lsdb' and noticed that the advertise commands had worked because the interest filters show up in their respective hosts. I also tried adding the 'export HOME' command for each host before calling the producer or consumer programs, but it did not seem to make any difference.


Also note that a consumer can run while a producer for that same host is running in the background, which I don't think is a problem.


Best regards,

André Dexheimer Carneiro



_______________________________________________
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




_______________________________________________
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


_______________________________________________
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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/mini-ndn/attachments/20200930/64c575a4/attachment-0001.html>


More information about the Mini-NDN mailing list