netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/16] core network namespace support
@ 2007-09-08 21:07 Eric W. Biederman
  2007-09-08 21:09 ` [PATCH 01/16] appletalk: In notifier handlers convert the void pointer to a netdevice Eric W. Biederman
  0 siblings, 1 reply; 56+ messages in thread
From: Eric W. Biederman @ 2007-09-08 21:07 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Linux Containers


The following patchset was built against the latest net-2.6.24
tree, and should be safe to apply assume not issues are found during
the review.  In the interest of keeping the patcheset to a reviewable
size, just the core of the network stack has been covered.


The 10,000 foot overview.  We want to make it look to user space 
like the kernel implements multiple network stacks.

To implement this some of the currently global variables in the
network stack need to have one instance per network namespace,
or the global data structure needs to have a network namespace
field.

Currently control enters the network stack in one of 4 major ways.
Through operations on a socket, through a packet coming in
from a network device, through miscellaneous syscalls from
a process, and through operations on a virtual filesystem.
So the current design calls for placing a pointer to 
struct net (the network namespace structure) on network
devices, sockets, processes, and on filesystems so we
have a clear understanding of which network namespace
operations should be done in the context of.

Packets do not contain a pointer to a network device structure.
Instead their network device is derived from which network
device or which socket they are passing through.

On the input path we only need to look at the network namespace
to determine which routing tables to use, and which sockets the
packet can be destined for.

Similarly on the output path we only need to consult the network
namespace for the output routing tables which point to which
network devices we can use.

So while there are accesses to the network namespace as
we process each packet they are in well contained spots that occur
rarely.

Where the network namespace appears most is on the control,
setup, and clean up code paths, in the network stack that we
change rarely.  There we currently don't have anything except
a global context so modifications are necessary, but since
the network parameter is not implicit it should not require
much thought to use.

The implementation strategy follows the classic global
lock reduction pattern.  First all of the interfaces
at a given level in the network stack are made to filter
out traffic from anything except the initial network namespace,
and then those interfaces are allowed to see packets from
any network namespace.  Then some subset of those interfaces
are taught to handle packets from all namespaces, after the
more specific protocol layers below them have been made to
filter those packets.

What this means is that we start out with large intrusive
stupid patches and end up with small patches that enable
small bits of functionality in the secondary network
namespaces.

Eric

^ permalink raw reply	[flat|nested] 56+ messages in thread

end of thread, other threads:[~2007-09-12 12:20 UTC | newest]

Thread overview: 56+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-08 21:07 [PATCH 00/16] core network namespace support Eric W. Biederman
2007-09-08 21:09 ` [PATCH 01/16] appletalk: In notifier handlers convert the void pointer to a netdevice Eric W. Biederman
2007-09-08 21:13   ` [PATCH 02/16] net: Don't implement dev_ifname32 inline Eric W. Biederman
2007-09-08 21:15     ` [PATCH 03/16] net: Basic network namespace infrastructure Eric W. Biederman
2007-09-08 21:17       ` [PATCH 04/16] net: Add a network namespace parameter to tasks Eric W. Biederman
2007-09-08 21:18         ` [PATCH 05/16] net: Add a network namespace tag to struct net_device Eric W. Biederman
2007-09-08 21:20           ` [PATCH 07/16] net: Make /proc/net per network namespace Eric W. Biederman
2007-09-08 21:23             ` [PATCH 08/16] net: Make socket creation namespace safe Eric W. Biederman
2007-09-08 21:24               ` [PATCH 09/16] net: Initialize the network namespace of network devices Eric W. Biederman
2007-09-08 21:25                 ` [PATCH 10/16] net: Make packet reception network namespace safe Eric W. Biederman
2007-09-08 21:27                   ` [PATCH 11/16] net: Make device event notification " Eric W. Biederman
2007-09-08 21:28                     ` [PATCH 12/16] net: Support multiple network namespaces with netlink Eric W. Biederman
2007-09-08 21:35                       ` [PATCH 13/16] net: Make the device list and device lookups per namespace Eric W. Biederman
2007-09-08 21:36                         ` [PATCH 14/16] net: Factor out __dev_alloc_name from dev_alloc_name Eric W. Biederman
2007-09-08 21:38                           ` [PATCH 15/16] net: Implement network device movement between namespaces Eric W. Biederman
2007-09-08 21:43                             ` [PATCH 16/16] net: netlink support for moving devices between network namespaces Eric W. Biederman
2007-09-08 21:47                               ` [PATCH 17/16] net: Disable netfilter sockopts when not in the initial network namespace Eric W. Biederman
2007-09-10 13:50                                 ` Pavel Emelyanov
     [not found]                                   ` <46E54B96.8060105-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2007-09-10 15:27                                     ` Eric W. Biederman
2007-09-12 11:59                                 ` David Miller
2007-09-12 12:03                                   ` David Miller
2007-09-12 12:16                                     ` Eric W. Biederman
     [not found]                               ` <m1tzq4u92n.fsf_-_-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-09-10 19:07                                 ` [PATCH 16/16] net: netlink support for moving devices between network namespaces Serge E. Hallyn
2007-09-10 19:30                                   ` Eric W. Biederman
2007-09-11  0:54                                     ` Serge E. Hallyn
2007-09-12 11:57                               ` David Miller
2007-09-12 11:54                             ` [PATCH 15/16] net: Implement network device movement between namespaces David Miller
2007-09-12 11:49                           ` [PATCH 14/16] net: Factor out __dev_alloc_name from dev_alloc_name David Miller
2007-09-12 11:39                         ` [PATCH 13/16] net: Make the device list and device lookups per namespace David Miller
     [not found]                       ` <m1bqccvock.fsf_-_-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-09-10 13:46                         ` [PATCH 12/16] net: Support multiple network namespaces with netlink Pavel Emelyanov
2007-09-10 15:24                           ` Eric W. Biederman
2007-09-12 11:06                       ` David Miller
2007-09-12 11:02                     ` [PATCH 11/16] net: Make device event notification network namespace safe David Miller
2007-09-12 11:00                   ` [PATCH 10/16] net: Make packet reception " David Miller
2007-09-12 10:58                 ` [PATCH 09/16] net: Initialize the network namespace of network devices David Miller
2007-09-12 10:04               ` [PATCH 08/16] net: Make socket creation namespace safe David Miller
2007-09-12 10:02             ` [PATCH 07/16] net: Make /proc/net per network namespace David Miller
2007-09-12 12:12               ` Daniel Lezcano
2007-09-12 12:19                 ` David Miller
2007-09-08 21:21           ` [PATCH 06/16] net: Add a network namespace parameter to struct sock Eric W. Biederman
2007-09-12  9:58             ` David Miller
2007-09-12  9:57           ` [PATCH 05/16] net: Add a network namespace tag to struct net_device David Miller
2007-09-12  9:55         ` [PATCH 04/16] net: Add a network namespace parameter to tasks David Miller
2007-09-09  8:44       ` [PATCH 03/16] net: Basic network namespace infrastructure Eric Dumazet
     [not found]         ` <46E3B281.4030105-fPLkHRcR87vqlBn2x/YWAg@public.gmane.org>
2007-09-09 10:18           ` Eric W. Biederman
2007-09-10  5:46       ` Krishna Kumar2
     [not found]         ` <OF55551EA4.A3E6920C-ON65257352.001D6A3E-65257352.001FBEA7-xthvdsQ13ZrQT0dZR+AlfA@public.gmane.org>
2007-09-10  6:40           ` Eric W. Biederman
     [not found]       ` <m1ejh8x3ih.fsf_-_-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-09-09  0:33         ` Paul E. McKenney
2007-09-09 10:04           ` Eric W. Biederman
     [not found]             ` <m1fy1otarm.fsf-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-09-09 16:45               ` Paul E. McKenney
2007-09-10  6:32                 ` Eric W. Biederman
2007-09-10 13:16         ` Pavel Emelyanov
     [not found]           ` <46E543A0.7010104-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2007-09-10 15:53             ` Eric W. Biederman
2007-09-12  9:52       ` David Miller
2007-09-12  9:39     ` [PATCH 02/16] net: Don't implement dev_ifname32 inline David Miller
2007-09-12  9:27   ` [PATCH 01/16] appletalk: In notifier handlers convert the void pointer to a netdevice David Miller

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).