[Mini-NDN] Mini-NDN/mnndn Popen?

Junxiao Shi shijunxiao at email.arizona.edu
Wed Jun 6 14:55:12 PDT 2018


Hi Alexander

Mininet uses a shared filesystem among all containers. As a consequence,
writing to /var/log/ndn/nfd.log on container1 would conflict with writing
to the same file on container2.
Mininet's private directory feature
<https://github.com/mininet/mininet/wiki/Introduction-to-Mininet#important-shared-filesystem>
creates mountpoints inside each container so that some paths are private in
each host. By declaring /var/log/ndn as a private directory, /var/log/ndn
on container1 and container2 will map to different physical directories,
and therefore writing to /var/log/ndn/nfd.log on container1 does not
conflict with writing to the same file on container2.

mnndn chooses to use private directories, so that NFD process inside each
container can access its configuration, sockets, and logs with the default
path (/usr/local/etc/ndn, /var/run, and /var/log/ndn).
mnndn also declares /root as a private directory. It has an overridden popen
function
<https://github.com/yoursunny/mnndn/blob/f490a83dfbfb8ee557bb3134484572f51f2da3d7/mnndn/ndn/NdnHost.py#L58>
that
sets HOME=/root, as well as "export HOME=/root
<https://github.com/yoursunny/mnndn/blob/f490a83dfbfb8ee557bb3134484572f51f2da3d7/mnndn/ndn/NdnHost.py#L18>"
command.
Generating a configuration file requires the Python experiment script to
access the "real path", where mnndn declares as
<https://github.com/yoursunny/mnndn/blob/f490a83dfbfb8ee557bb3134484572f51f2da3d7/mnndn/ndn/NdnHost.py#L14>,
for example, /tmp/mnndn/container1/etc/ndn, and provides an openFile helper
function
<https://github.com/yoursunny/mnndn/blob/f490a83dfbfb8ee557bb3134484572f51f2da3d7/mnndn/ndn/NdnHost.py#L29>
.

Mini-NDN did not adopt private directories, because Mini-NDN started as a
patch of Mininet 2.1, while private directories were introduced since
Mininet 2.2. If Mini-NDN don't need to support Mininet 2.1, I encourage
Mini-NDN to upgrade to the better method.

I do not know how "cluster" works. If you are try to run containers across
multiple hosts machines, you might run into problem with porting openFile
helper function, but popen should work.

Yours, Junxiao


> *From: *Alexander Lane <awlane at memphis.edu>
> *Subject: **Mini-NDN/mnndn Popen?*
> *Date: *June 6, 2018 at 9:17:16 AM CDT
> *To: *mini-ndn at lists.cs.ucla.edu
>
>
> Sorry to bother you all, but I've encountered somewhat of a roadblock and
> was hoping to get some help.
>
> I recently stumbled across the popen issue
> <https://redmine.named-data.net/issues/4078> and found both that the
> environment fix seemed to work as well as that mnndn
> <https://github.com/yoursunny/mnndn/blob/f490a83dfbfb8ee557bb3134484572f51f2da3d7/mnndn/ndn/NdnHost.py#L10-L15>
> has a more robust solution that can execute on clusters.
>
> While the environment fix that Ashlesh shows makes sense, I'm currently
> unclear on the thought process behind some of the directories Dr. Shi marks
> for being made private, especially /etc/ndn. As it is blocking my current
> work from being satisfactory completed, would it be possible for someone
> with an understanding of the code base to briefly run down what it is doing
> with it such that I can bring it over to Mini-NDN? I apologize if this is
> an overly broad request, however I want to avoid reinventing the wheel to
> fix this as it seems to be a solved problem.
>
> -Alex
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/mini-ndn/attachments/20180606/97e390d9/attachment.html>


More information about the Mini-NDN mailing list