Skip to content

L2 network namespace (v3)

Dmitry Mishin netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest12 patches 11 repliesIn review

Changes from the cover letter

- updated to 2.6.20-rc4-mm1-lxc2
- current network context is per-CPU now
- fixed compilation without CONFIG_NET_NS

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12L2 network namespace (v3): current network namespace operationsinclude/linux/net_namespace.h kernel/fork.c kernel/sched.c +1 more+56 -24 replies
2/12L2 network namespace (v3): network devices virtualizationinclude/linux/net_namespace.h include/linux/netdevice.h net/core/dev.c +2 more+114 -130 replies
3/12L2 network namespace (v3): loopback device virtualizationdrivers/net/loopback.c include/linux/net_namespace.h include/linux/netdevice.h +5 more+108 -410 replies
4/12L2 network namespace (v3): devinet sysctl's checksnet/ipv4/devinet.c+16 -100 replies
5/12L2 network namespace (v3): IPv4 routinginclude/linux/net_namespace.h include/net/flow.h include/net/ip_fib.h +8 more+396 -990 replies
6/12L2 network namespace (v3): socket hashesinclude/linux/ipv6.h include/net/inet6_hashtables.h include/net/inet_hashtables.h +16 more+172 -490 replies
7/12allow proc_dir_entries to have destructorfs/proc/generic.c fs/proc/root.c include/linux/proc_fs.h+13 -20 replies
8/12net_device seq_fileinclude/linux/netdevice.h net/core/dev.c+103 -02 replies
9/12L2 network namespace (v3): device to pass packets between namespacesdrivers/net/Makefile drivers/net/veth.c net/core/net_namespace.c+325 -00 replies
10/12L2 network namespace (v3): playing with pass-through devicedrivers/net/veth.c fs/proc/array.c kernel/fork.c +2 more+134 -00 replies
11/12L2 network namespace (v3): sockets proc view virtualizationinclude/net/af_unix.h net/ipv4/tcp_ipv4.c net/ipv4/udp.c+37 -60 replies
12/12L2 network namespace (v3): L3 network namespace introinclude/linux/net_namespace.h net/core/net_namespace.c+31 -120 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/12] L2 network namespace (v3)

This is an update of L2 network namespaces patches. They are applicable to Cedric's 2.6.20-rc4-mm1-lxc2 tree.

Changes:
- updated to 2.6.20-rc4-mm1-lxc2
- current network context is per-CPU now
- fixed compilation without CONFIG_NET_NS

Changed current context definition should fix all mentioned by Cedric issues:
- the nsproxy backpointer is unnecessary now - thus removed;
- the push_net_ns() and pop_net_ns() use per-CPU variable now;
- there is no race on ->nsproxy between push_net_ns() and exit_task_namespaces() because they deals with differrent pointers.

===================================
L2 network namespaces

The most straightforward concept of network virtualization is complete separation of namespaces, covering device list, routing tables, netfilter tables, socket hashes, and everything else.

On input path, each packet is tagged with namespace right from the place where it appears from a device, and is processed by each layer in the context of this namespace.
Non-root namespaces communicate with the outside world in two ways: by owning hardware devices, or receiving packets forwarded them by their parent namespace via pass-through device.

This complete separation of namespaces is very useful for at least two purposes:
- allowing users to create and manage by their own various tunnels and VPNs, and
- enabling easier and more straightforward live migration of groups of processes with their environment.

Signature · 2 lines
Thanks,
Dmitry.