Network block device

From Wikipedia, the free encyclopedia
Jump to: navigation, search

On some operating systems a network block device is a device node whose content is provided by a remote machine. Typically, network block devices are used to access a storage device that does not physically reside in the local machine but on a remote one. As an example, the local machine can access a fixed disk that is attached to another computer.

Design[edit]

Technically, a network block device is realized by two components - server part and client part.

In the client machine - NBD client - where the device node is to work, a kernel driver/module controls the device. Whenever a program tries to access the device, the kernel driver forwards the request (if the client part is not fully implemented in the kernel it can be done with help of a user-space program) to the server machine, where the data physically resides.

On the server machine - NBD server - requests from the client are handled by a user-space program. The server part is just regular user-space application because all it has to do is to serve network requests, which in turn just requires regular access to the server filesystem.

Example on Linux operating system[edit]

If the file /tmp/xxx on ComputerA has to be made accessible on ComputerB, one performs the following steps:

On ComputerA acting as NBD server:

nbd-server 2000 /tmp/xxx

On ComputerB acting as NBD client:

modprobe nbd
nbd-client ComputerA 2000 /dev/nbd0


The file is now accessible on ComputerB as device /dev/nbd0. If the original file was for example a disk image, it could be mounted for example via mount /dev/nbd0 /mnt/whatever.

The command modprobe nbd is not necessary if module loading is done automatically. Once the module is in the kernel, nbd-client is used to send commands to it, such as associating a given remote file to a given local nb device. To finish using /dev/nbd0, that is, to destroy its association with the file on other computer, one can run nbd-client -d /dev/nbd0 on ComputerB.

In this example, 2000 is the number of the server port through which the file is made accessible. Any available port could be used.

Availability[edit]

The network block device client module is available on some UNIX-like operating systems like Linux, recently ported to Bitrig.[1] It is also available in GNU Hurd.

Since the server is a userspace program, it can potentially run on every Unix-like platform. It was ported to to various operating systems like Solaris.[2]

See also[edit]

  • iSCSI: The "target-utils" iscsi package on many GNU/Linux distributions. The tgtd can configure the backing storage of a LUN to be any block device (disk, partition, etc.). This has widest adoption amongst IP-based block device presentation protocols.[3]
  • Loop device: a similar mechanism, but uses a local file instead of a remote one
  • DRBD: Distributed Replicated Block Device is a distributed storage system for the Linux platform
  • ATA over Ethernet: send ATA commands over Ethernet

References[edit]

  1. ^ "git.bitrig.org: NBD: Implement Network Block Device support.". May 20, 2015. 
  2. ^ Miroslav Kripac and Masaryk University Brno (December 10, 2002). "Implementing Oracle Real Application Clusters Using Network Block Device Technology". Retrieved May 22, 2013. 
  3. ^ "iSCSI Adoption Continues its Upward Path". 

External links[edit]