UMNET: user mode virtual multi stack support

From Virtualsquare
Revision as of 18:39, 27 December 2012 by Renzo (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

umnet is the View-OS module for multi-networking. In fact it supports the multi stack extension to the Berkeley Socket API named msockets.

From the user's point of view, umnet can be loaded in this way

 um_add_service umnet

Like many other View-OS modules umnet enables the mount operation for sub-modules prefixed by umnet

 mount -t umnetnull none /dev/net/null
 mount -t umnetnative none /dev/net/native

The former example define /dev/net/null to be a null network (socket/msocket calls fail, no networking is possible using /dev/net/null). The latter is a gateway to the native stack of the hosting operating system. All the (m)sockets opened on /dev/net/native will use the networking stack provided by the hosting OS.

umnet provides also the msocket backward compatibility tool named mstack.

 mstack /dev/net/native ip link

gives the same output of ip link (there is a subtle but important difference: the mstack command causes the View-OS hypervisor -- i.e. umview or kmview -- to give the answer, using ip addr the answer comes directly from the kernel to the process bypassing View-OS).

Protection

mstack is a backward compatibility tool, not a protection tool. When several stacks are available it is possible to use mstack to switch from one stack to another.

If a stack gets mounted on /dev/net/default, View-OS uses this stack as default.

 mount -t umnetnative none /dev/net/default

defines the native network as the default network. The effect of this command is subtle: all the programs seem to access the network in the same way after this command as they did before it.

  • Before the command the processes use the kernel stack directly: default networking has not been virtualized.
  • After the command the networking calls get virtualized and View-OS (umview or kmview) uses the kernel stack to execute the calls.

This call

 mount -t umnetnull -o perm none /dev/net/default

disables networking. The perm option denies the umount operation (the mountpoint will always be busy), thus the operation is not undoable.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox