NetBIOS LANA Numbers

[Netbios is not supported on Windows Vista, Windows Server 2008, and subsequent versions of the operating system]

The NetBIOS LANA number identifies the transport driver, network interface card (NIC) driver, and adapter that will be used to send and receive NetBIOS packets. This is known as the network route. The following example shows the network route that will be used when you specify a LANA value of 1:

001 NetBT -> IEEPRO -> IEEPRO1

Specify the LANA number in the ncb_lana_num member of the NCB structure when you issue a NetBIOS command.

The IBM NetBIOS 3.0 specification supports only two LANA numbers, because NetBEUI was originally the only protocol that supported NetBIOS, and a computer could contain only two network adapters at that time. Specifying LANA 0 directed a command to the first adapter, and specifying LANA 1 directed a command to the second adapter. Because many computers had only one network adapter, many MS-DOS – based applications sent all their requests to LANA 0. If a second network adapter was installed, some applications allowed the user to specify the use of LANA 1 instead. As a result, LANA 0 became the default setting, though it was never intended as such.

**Windows XP and later:  **NetBEUI is no longer be supported on Windows XP and later versions of Windows.

Windows Server 2003, Windows XP, Windows 2000, and Windows NT enable NetBIOS to use transport protocols other than NetBEUI. Therefore, Microsoft has extended the meaning of a LANA number to indicate a specific transport protocol on a specific adapter. For example, if you have two network adapters, and have three transport protocols installed, you have six LANA numbers. The LANA numbers are not necessarily sequential.

In addition to extending the meaning of a LANA number, Microsoft also added the NCBENUM command to enumerate the available LANA numbers. As an example, the LANA_ENUM structure filled by NCBENUM might hold an array with values 0, 3, 5, and 6. Zero might map to IPX/SPX on the first adapter, three might map to a different protocol on a second adapter, and so on.

**Windows Server 2003, Windows XP, and Windows 2000:  **LANA numbers cannot be configured.

**Windows NT:  **Specific LANA numbers can be associated with specific network routes using the following steps.

Bb870907.wedge(en-us,VS.85).gifTo associate a LANA number with a network route

  1. Start the Network Control Panel application.
  2. Click the Services tab.
  3. Double-click NetBIOS Interface.
  4. Click the LANA number you want to change.
  5. Enter the new LANA number to be associated with the network route.

**Windows Me/98/95:  **You cannot configure LANA numbers because of the way plug and play was designed. LANA numbers can change as users install plug and play devices. You may set only LANA 0, which is the default protocol. The next protocol is LANA 7, then LANA 6, and so on. If no protocol is set as the default, there may not be a LANA 0.

You can set the default protocol in the control panel using the following steps:

Bb870907.wedge(en-us,VS.85).gifTo set LANA 0 onWindows Me/98/95

  1. Start the Network Control Panel application.
  2. Choose the protocol you want as the default.
  3. Click Properties.
  4. Click the Advanced tab.
  5. Click Set this protocol to be the default protocol.

The best way to write a NetBIOS application is to support all LANA numbers, and establish connections over any LANA number. This allows your application to transparently support any transport protocol that supports NetBIOS, as well as dynamic LANA numbers associated with dial-up adapters or plug-and-play hardware. A good approach is outlined in the following steps.

Bb870907.wedge(en-us,VS.85).gifTo support connections over any LANA

  1. Enumerate the LANA numbers by issuing an NCBENUM command.
  2. Reset each LANA by issuing one NCBRESET command per LANA number.
  3. Add your local NetBIOS name to each LANA. The name may be the same on each LANA.
  4. Connect using any LANA number:
    • For servers, issue an NCBLISTEN command on each LANA. If necessary, cancel any outstanding listen operation after the first listen operation has been completed.
    • For clients, issue an NCBFINDNAME (Windows Server 2003, Windows XP, Windows 2000, and Windows NT only) or an NCBCALL (Windows Server 2003, Windows XP, Windows 2000, Windows NT, or Windows Me/98/95) command on each LANA. The first successful NCBFINDNAME or NCBCALL operation will indicate which LANA to use. When using NCBCALL instead of NCBFINDNAME, you must cancel any pending NCBCALL commands and hang up any extra completed calls.

Though this is the best technique for writing a NetBIOS application, it generates several datagrams, making the NetBIOS interface less desirable than other networking interfaces.



Send comments about this topic to Microsoft

Build date: 7/2/2010