NetBIOS Specification

1. Overview


For communication between stations of a network, each station is given one or more names. These names are alphanumeric names, 16 characters in length, and should be ASCIIZ form - that is the last byte should be 00h. There are two types of names:


Each station has a number of names, through which it communicates with other stations on the network. There are two types of communication within NetBIOS - connectionless and connection-orientated. The two types will now be described:


A station requests that some data is sent in the form of a datagram. All other stations are continually checking the network for datagrams, to see if they apply to themselves. If they do, the message is received. However, there is no form of handshaking, or acknowledgement, so it is not guaranteed that all stations on the network will receive the message as intended. However, in my experience, the message is received all but a few times in many thousands - this may be different on other networks.

Datagrams can be addressed to other stations in two ways:

Note that the message will only be received, if you have programmed the station to receive a datagram. Otherwise it will be ignored. The specification (below) allows you to request that a datagram be received on a particular name. The network software can then, in the background, examine every datagram passing, and receive it if required.


A connection is established between two names. The connection is known a as session, and may not be between two stations. It can in fact be between any two names, including two names on the same station. Data is transferred through this session, rather like dialling up an Internet service provider via a PPP line. This method is the reliable method to use, although possibly harder to program. The message is either delivered successfully, or an error is returned to the application, so it is aware of the transmission, or receive, failure.


The interface is accessed through interrupt 5Ch - this interrupt is called, like any other interrupt, with ES:BX pointing to a 64-byte data structure, which is known as the Network Control Block (NCB). This contains the required data, such as names, command codes, pointers to buffers etc. The NCB must be unaltered until the command is completed, so it cannot be used for other commands, whilst a command is still executed. However, once a command has completed, the NCB can be altered, and reused for another command.

There are two different methods a NetBIOS command can be used - asynchronous or synchronous.

Synchronous commands

The command is initiated by setting up the NCB, and calling interrupt 5Ch, with ES:BX pointing the the NCB. Control will only be returned to your program, when the command has completed (or timed out). Bit 7 of the command byte is set to 0 to indicate a synchronous command. When control is returned, the return_code field of the NCB indicates the initiation or completion status. The value of this field is also returned in AL. An example of the use of this type of command, is adding a name for communication. The program cannot continue until this has been successful or failed.

Asynchronous commands

The command is initiated in the same way as synchronous commands, however bit 7 of the command byte is set to 1, to indicate that you require an asynchronous command. Control is immediately returned to your program, with the return code field, and AL, containing the initiation status. You must therefore check to see when the command has been completed. There are two ways of doing this:

This type of command can be used, for example, in a talk program. An NCB is set up to receive a message (datagram) on a specific name. The POST points to the routine to process the received message and display it on the screen. The software must not wait until a message is received, as the user cannot enter any messages him/herself.

Asynchronous commands can also be used for multitasking. An asynchronous command can be initiated within the POST routine of a command, for example once a message has been received in a talk, the NCB must be reinitialized to receive the next message. However, synchronous commands cannot, and should not, be called in a POST routine, or the machine will also definitely crash.

All text © 1998-2012 Gavin Winston