All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas B Aaen <andreas.aaen-546VmZ+UeKYX2WXlbB3fKg@public.gmane.org>
To: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Subject: Re: [PATCH 0/6] netns: add linux-vrf features via network namespaces
Date: Thu, 30 Oct 2008 15:38:07 +0100	[thread overview]
Message-ID: <200810301538.08032.andreas.aaen@tietoenator.com> (raw)
In-Reply-To: <4909B10A.8090403-L+G57L1VLRbR7s880joybQ@public.gmane.org>

Hi,

On Thursday 30 October 2008 14:05, Vivien Chappelier wrote:
>     The recently introduced network namespaces allow separate standalone
> network stacks to coexist on the same machine. This is a very useful
> functionality that we have been needing and using in our products for
> some time, through the VRF ptchset (http://linux-vrf.sourceforge.net/).
> The goal of the VRF patchset and network namespaces are very similar,
> yet some features of the VRF are missing that these patches intend to
> provide.

I have worked with a similar patchset. the goal was to be able to terminate 
traffic from different IPv4 nets with possible overlapping IP addresses. You 
should be able to communicate with all IPv4 nets from the same process.

>     The network namespaces are currently tied to a process, and
> referenced by its pid. However, a networking stack has no particular
> reason to be associated with any process and it should be possible to
> use and setup additional networking stacks without the need to clone()

Right.

> or unshare(). The initial version of the "Coexist with the sysfs
> limitations" patches by Benjamin Thery introduced the notion of a unique
> network namespace identifier (nsid)  that is perfectly fit for the
> purpose of referencing networking stacks independently of any process.
> The first two patches of his set are therefore reused here to identify
> networking stacks.

I have proposed such a global namespace before on this list, but no one seemed 
interested.

>     These patches additionally introduce the following features that
> were initially provided by the VRF patchset:
> - the ability to move a socket to a different network namespace, through
> the new SO_NSID setsockopt(), given the nsid

This was exactly our solution although the name of the option was different.
Very elegant solution for scaleability. A huge number of networks can be 
reached from within the same process through different sockets.

> - the ability to move a process to an existing network namespace,
> through the new SO_NETNS setsockopt(), given the nsid

I don't see the need for this. The current network namespace implementation 
handles this just fine without giving the network namespaces numbers.
I see the usecase for this as isolation. Standard applications without any 
setsockopt() use of SO_NSID 

> - the ability to move an interface to a different namespace by nsid
> instead of pid

Here use can use the SO_NSID option through the netlink socket.

> - the ability to create additional network namespaces on startup

Why do it at startup?

> (dynamic addition/deletion is not supported but should be easy to add)

I have only one problem left here on this. When I call copy_net_ns() through 
the netlink socket the rtnl_lock() is already taken.

>    Also attached is a patch to iproute2 to add the ability to move an
> interface to a different namespace by nsid, used this way:
>
> $ ip link set eth0 nsid 1    # This will move eth0 to network namespace 1

ip netns add 1    # create network namespace with index 1
ip link set eth1 nsid 1    # move eth1 to network namespace with index 1
ip -nsid 1 addr add 192.168.50.1/24 dev eth1
ip -nsid 1 addr add 127.0.0.1/8 dev lo
ip -nsid 1 link set eth1 up
ip -nsid 1 link set lo up

The nsid option uses SO_NSID on the socket. This makes sure that the device 
name to index conversion inside iproute2 and the kernel works as it should.

Regards,
-- 
Andreas Bach Aaen              System Developer, M. Sc. 
Tieto Enator A/S               tel: +45 89 38 51 00
Skanderborgvej 232             fax: +45 89 38 51 01
8260 Viby J      Denmark       andreas.aaen-546VmZ+UeKYX2WXlbB3fKg@public.gmane.org

  parent reply	other threads:[~2008-10-30 14:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-30 13:05 [PATCH 0/6] netns: add linux-vrf features via network namespaces Vivien Chappelier
     [not found] ` <4909B10A.8090403-L+G57L1VLRbR7s880joybQ@public.gmane.org>
2008-10-30 14:38   ` Andreas B Aaen [this message]
     [not found]     ` <200810301538.08032.andreas.aaen-546VmZ+UeKYX2WXlbB3fKg@public.gmane.org>
2008-10-30 15:03       ` Serge E. Hallyn
2008-10-30 16:20       ` Vivien Chappelier
     [not found]         ` <4909DEC8.9090102-L+G57L1VLRbR7s880joybQ@public.gmane.org>
2008-10-30 23:07           ` Eric W. Biederman
     [not found]             ` <m14p2tznoz.fsf-B27657KtZYmhTnVgQlOflh2eb7JE58TQ@public.gmane.org>
2008-10-31  9:46               ` Andreas B Aaen
     [not found]                 ` <200810311046.17506.andreas.aaen-546VmZ+UeKYX2WXlbB3fKg@public.gmane.org>
2008-10-31 14:17                   ` Daniel Lezcano
     [not found]                     ` <490B1384.7030001-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
2008-10-31 18:59                       ` Eric W. Biederman
     [not found]                         ` <m1zlkksi91.fsf-B27657KtZYmhTnVgQlOflh2eb7JE58TQ@public.gmane.org>
2008-10-31 19:32                           ` Eric W. Biederman
     [not found]                             ` <m13aicsgr2.fsf-B27657KtZYmhTnVgQlOflh2eb7JE58TQ@public.gmane.org>
2008-10-31 20:48                               ` Daniel Lezcano
     [not found]                                 ` <490B6F19.4060206-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
2008-10-31 23:10                                   ` Eric W. Biederman
2008-10-31 18:43                   ` Eric W. Biederman
2009-03-25 18:21   ` Bruce Jones
  -- strict thread matches above, loose matches on Subject: below --
2009-04-15  3:14 Krishna Vamsi-B22174

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=200810301538.08032.andreas.aaen@tietoenator.com \
    --to=andreas.aaen-546vmz+uekyx2wxlbb3fkg@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.