Saturday, September 18, 2010

NetBIOS Name Service

The NetBIOS LAN architecture is a simple and non-routable network. Just a bunch of nodes connect to a virtual segement. There is no hardware address, network address or port number. Instead, each node is identified by a 16-byte string known as NetBIOS name.

Application can add and remove NetBIOS name dynamically. Each node will also have a default name (called Machine name or workstation service name), which is added when NetBIOS starts. The process of adding name is called registration.

Two kinds of names can be registered - unique and group. Group name can be shared by multiple nodes and used for multicast operation. Name service keeps track of all NetBIOS names used in the virtual LAN and directed to the correct underlying OP address.

If all nodes on the same IP segment, each node keeps a list of names it has registered (i.e. owned). When sending a message, the first step is to send an IP broadcast query to located the target node, which will response with the IP address. This is known as B (Broadcast) mode name resolution. The participants are referred to as B nodes. In B mode, each node keeps track of its own name and so the name service database is a distributed database.

If nodes presents on different IP segments, a machine is chosen to be the NetBIOS Name Server (NBNS) or WINS (Windows Internet Name Service) Server. In order to use WINS, all nodes participating in the virtual NetBIOS LAN must be given the WINS server IP address. NBT client nodes send name registration and queries directly to WINS. This is known as P mode (Point to Point) name resolution and the participants are called P nodes.

M mode (Mixed) combines the characteristics of P an dB modes. H mode (Hybrid) which was introduced later was similar to M mode except the order in which the B andP mode behaviour is applied.

Name service is implemented on UDP port 137. TCP 137 is not defined in NetBIOS.

No comments: