netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Daniel Lezcano <dlezcano@fr.ibm.com>
Cc: Pavel Emelyanov <xemul@openvz.org>,
	David Miller <davem@davemloft.net>,
	netdev@vger.kernel.org, den@openvz.org,
	Linux Containers <containers@lists.osdl.org>,
	Serge Hallyn <serue@us.ibm.com>
Subject: Global namespace naming, and monitoring.
Date: Mon, 07 Jul 2008 04:54:26 -0700	[thread overview]
Message-ID: <m1tzf1yknh.fsf_-_@frodo.ebiederm.org> (raw)
In-Reply-To: <4871ED97.70806@fr.ibm.com> (Daniel Lezcano's message of "Mon, 07 Jul 2008 12:19:03 +0200")

Daniel Lezcano <dlezcano@fr.ibm.com> writes:

>> Well, if we want to get the stats for each namespace separately, then
>> this ability is already present. Since this statistics is shown via the
>> /proc/net files and the /proc/net itself is seen via the /proc/<pid>/net,
>> then we can walk the init-s of all the containers in the system and dump
>> this info.
>>
>> The problem that is to be solved with this approach is how to get these
>> init-s :) But since finding any namespace by some task living in it is a
>> common practice now (netdev moving, sys_hijack) this one will be solved.

Yes.  Finding the which the a single process in each namespace to look
at (the init-s) is something we have yet to refine.

The model for multiple namespace monitoring is definitely having
filesystems mounted that we can look at to get all of the information
we care about.  /proc does a lot of this today, and with some cleanups
it should be able to display per namespace sysctls and a few other
goodies. 

...

There is one class of user that we have yet to find a good solution for.
The people who want to use isolated network stacks within a single application.
Usually because there are duplicate routes between the stacks.  In that case
indirect through processes falls down, as does being able to create a socket in
one namespace.

My latest brainstorm comes from asking how the problem would have been
solved in plan9.  The idea is to create a filesystem we can mount that
holds a reference to a netns (netnsfs).  Using a mounted filesystem
like that is a bit heavy weight, but just referring to it's the root
directory is enough to give us a name in the mount namespace.  The
auto unmount and consequent release of the network namespace when the
mount namespace goes away is attractive.

> Shouldn't be interesting to handle the network namespaces directly with the
> iproute command ?
> 
>  * ip netns add <name>
>  * ip netns del <name>
>  * ip netns <oldname> set name <newname>
>  * ip netns show

Ugh.  You have to be really careful with proposal like this to ensure that
they wind up in some namespace.  Otherwise you have created a new global
namespace, and have made nesting of containers much harder to implement.

> So having the netns binded, we can plug the known subcommand (link, ip, ...)
> with the netns features. For examples:
>
>  * ip addr add 1.2.3.4/24 dev eth0 netns foo

The only thing limiting that today is that we need someway to get a netlink
socket on the namespace in question.  Get me in a perverse mood and I will
grab the netlink socket from one of the init-s with ptrace.

Eric


      reply	other threads:[~2008-07-07 12:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-04 11:58 [PATCH 0/4] MIB: add struct net to UDP accounting macros Pavel Emelyanov
2008-07-04 12:00 ` [PATCH net-next-2.6 1/4] MIB: add struct net to UDP_INC_STATS_USER Pavel Emelyanov
2008-07-04 12:02 ` [PATCH 2/4] MIB: add struct net to UDP_INC_STATS_BH Pavel Emelyanov
2008-07-04 12:03 ` [PATCH net-next 3/4] MIB: add struct net to UDP6_INC_STATS_USER Pavel Emelyanov
2008-07-04 12:04 ` [PATCH 4/4] MIB: add struct net to UDP6_INC_STATS_BH Pavel Emelyanov
2008-07-06  4:21 ` [PATCH 0/4] MIB: add struct net to UDP accounting macros David Miller
2008-07-07  8:13   ` Pavel Emelyanov
2008-07-07  8:47     ` David Miller
2008-07-10 11:04       ` Thomas Graf
2008-07-07 10:19     ` Daniel Lezcano
2008-07-07 11:54       ` Eric W. Biederman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1tzf1yknh.fsf_-_@frodo.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=containers@lists.osdl.org \
    --cc=davem@davemloft.net \
    --cc=den@openvz.org \
    --cc=dlezcano@fr.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=serue@us.ibm.com \
    --cc=xemul@openvz.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).