What are kernel namespaces?

Namespaces are one of the main features of the Linux kernel – they carry out the distinction between kernel resources. It makes sure that a process can only see the specified set of resources. Examples of resources are process IDs, hostnames, files, usernames, network access names, and inter-process communications. Namespace refers to the type of namespace and also the specified space of names.

Linux Kernel Illustration
Linux Kernel Illustration

There are eight different kinds of namespaces with kernel version 5.6. Any individual process can only view or use the namespace associated with that particular process. This kind of functionality among processes and namespaces can be seen across all eight namespaces. The type of resources associated with that process is dependent on the kind of namespace provided for it. Let’s look at the features of a few of them:

  1. Mount (MNT): Controls mount points. When new namespaces are created the current mounts are copied to a new namespace.

  2. Process ID (PID): Provides processes with process IDs from other namespaces.

  3. Interprocess Communication (IPC): Prevents processes in different IPC namespaces from forming SHM functions.

  4. Network (NET): Virtualizes network stack.

  5. UNIX Time Sharing (UTS): This allows a system to have different host and domain names for various processes.

Copyright ©2024 Educative, Inc. All rights reserved