Skip to content

net namespace : L3 namespace - introduction

[email protected] netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest12 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12net namespace : initialize init process to level 2net/core/net_namespace.c+1 -00 replies
2/12net namespace : store L2 parent namespaceinclude/linux/net_namespace.h net/core/net_namespace.c+12 -00 replies
3/12net namespace : share network ressources L2 with L3include/linux/net_namespace.h net/core/dev.c net/core/net_namespace.c+34 -170 replies
4/12net namespace : isolate the inet device.include/linux/inetdevice.h net/ipv4/devinet.c+22 -10 replies
5/12net namespace : ioctl to push ifa to net namespace l3include/linux/net_namespace.h include/linux/sockios.h net/core/net_namespace.c +1 more+132 -12 replies
6/12net namespace : check bind addressinclude/linux/net_namespace.h net/core/net_namespace.c net/ipv4/af_inet.c +1 more+66 -00 replies
7/12net namespace: set source addresseinclude/linux/net_namespace.h net/core/net_namespace.c net/ipv4/route.c+100 -100 replies
8/12net namespace : find namespace by addrinclude/linux/net_namespace.h net/core/net_namespace.c net/ipv4/ip_input.c+57 -11 reply
9/12net namespace : make loopback address always visibleinclude/linux/net_namespace.h net/core/net_namespace.c net/ipv4/devinet.c+36 -70 replies
10/12net namespace : add the loopback isolationinclude/linux/net_namespace.h include/linux/skbuff.h net/core/net_namespace.c +2 more+44 -90 replies
11/12net namespace : debugfs - add net_ns debugfsfs/debugfs/Makefile fs/debugfs/net_ns.c net/Kconfig+340 -10 replies
12/12net namespace : Add broadcastinginclude/linux/net_namespace.h net/core/net_namespace.c net/ipv4/udp.c+40 -12 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [patch 00/12] net namespace : L3 namespace - introduction

This patchset provide a network isolation similar at what Linux-Vserver provides. It is based on the L2 namespaces and relies on the mechanisms provided by the namespace. This L3 namespaces does not aim to bring full virtualization for the network, it provides an IP isolation which can be reused for Linux-Vserver, jailed application or application containers.

A L3 namespace are always L2 s' childs and they can not create more network namespaces, furthermore, they lose their NET_ADMIN capability. They share their parent's network ressources. From the parent namespace, IP addresses are created and assigned to the different L3 childs. From this point, L3 namespaces can use their assigned IP address and all computed broadcast addresses.

Because the L3 namespace relies on the L2 virtualization mechanisms, it is possible to have several L3 namespaces listening on INADDR_ANY:port without conflict, that's allow to run several server without modifying the network configuration.

The loopback is a shared device between all L3 namespaces. To ensure the 127.0.0.1 address isolation, the sender store its namespace into the packet, so when the packet arrives, the destination namespace is already set, because "source" == "destination". By this way, it is easy to disable the loopback isolation and let the application to talk with application outside of the namespace via the 127.0.0.1 because we consider them trusted (like portmap).

The ifconfig / ip commands will only show IP addresses assigned to the L3 namespace. When a L3 namespace dies, the assigned IP address is released to its parent.

At the IP level, when a packet arrives, the L3 network namespace destination is retrieved from the destination address.

At the bind time, the address is checked against the assigned IP address.