Tuesday, March 22, 2011

NetBIOS 名稱解析

轉:http://technet.microsoft.com/zh-tw/library/cc738412%28WS.10%29.aspx


NetBIOS name resolution
Updated: January 21, 2005
Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2

NetBIOS name resolution

NetBIOS name resolution means successfully mapping a NetBIOS name to an IP address. A NetBIOS name is a 16-byte address that is used to identify a NetBIOS resource on the network. A NetBIOS name is either a unique (exclusive) or group (nonexclusive) name. When a NetBIOS process is communicating with a specific process on a specific computer, a unique name is used. When a NetBIOS process is communicating with multiple processes on multiple computers, a group name is used.
An example of a process that uses a NetBIOS name is the File and Printer Sharing for Microsoft Networks service on a computer running Windows XP Professional. When your computer starts up, this service registers a unique NetBIOS name based on the name of your computer. The exact name used by the service is the 15-character computer name plus a 16th character of 0x20. If the computer name is not 15 characters long, it is padded with spaces up to 15 characters.
When you attempt to make a file-sharing connection to a computer by using its computer name, the File and Printer Sharing for Microsoft Networks service on the file server you specify corresponds to a specific NetBIOS name. For example, when you attempt to connect to a computer called CORPSERVER, the NetBIOS name corresponding to the File and Printer Sharing for Microsoft Networks service on that computer is:
CORPSERVER     [20]
Note the use of spaces to pad the computer name. Before you can establish a file and print sharing connection, a TCP connection must be created. In order for a TCP connection to be established, the NetBIOS name "CORPSERVER     [20]" must be resolved to an IP address.
The exact mechanism by which NetBIOS names are resolved to IP addresses depends on the NetBIOS node type that is configured for the node. RFC 1001, "protocol Standard for a NetBIOS Service on a TCP/UDP Transport: Concepts and Methods," defines the NetBIOS node types, as listed in the following table.

 

Node type Description
B-node(broadcast)
B-node uses broadcast NetBIOS name queries for name registration and resolution. B-node has two major problems: (1) Broadcasts disturb every node on the network, and (2) Routers typically do not forward broadcasts, so only NetBIOS names on the local network can be resolved.
P-node (peer-peer)
P-node uses a NetBIOS name server (NBNS), such as a WINS server, to resolve NetBIOS names. P-node does not use broadcasts; instead, it queries the name server directly.
M-node (mixed)
M-node is a combination of B-node and P-node. By default, an M-node functions as a B-node. If an M-node is unable to resolve a name by broadcast, it queries a NBNS using P-node.
H-node(hybrid)
H-node is a combination of P-node and B-node. By default, an H-node functions as a P-node. If an H-node is unable to resolve a name through the NBNS, it uses a broadcast to resolve the name.
Computers running Windows Server 2003 operating systems are B-node by default and become H-node when they are configured with a WINS server. Those computers can also use a local database file called Lmhosts to resolve remote NetBIOS names. The Lmhosts file is stored in the systemroot\System32\Drivers\Etc folder. For more information, see TCP/IP database files.
It is highly recommended that you configure Windows-based computers with the IP address of your WINS server in order for remote NetBIOS names to be resolved. You must configure Active Directory-based computers, such as Windows XP Professionaland Windows Server 2003 operating systems, with the IP address of a WINS server if they are to communicate with computers running Windows NT, Windows 95, Windows 98, Windows 2000, or Windows Millennium Edition that are not Active Directory-based.


NetBIOS 名稱解析

NetBIOS name resolution

NetBIOS 名稱解析表示將 NetBIOS 名稱成功地對應到 IP 位址。NetBIOS 名稱是用來識別網路上 NetBIOS 資源的 16 位元組位址。NetBIOS 名稱可以是唯一 (獨佔) 的名稱,也可以是群組 (非獨佔) 名稱。NetBIOS 處理程序與指定電腦上的指定處理程序通訊時,使用唯一的名稱。NetBIOS 處理序與多重電腦上的多重處理程序通訊時,使用群組名稱。
使 用 NetBIOS 名稱的範例處理程序為,執行 Windows XP Professional 的電腦上的 File and Printer Sharing for Microsoft Networks 服務。電腦啟動時,此服務依據您的電腦名稱登錄唯一的 NetBIOS 名稱。此服務使用的完整名稱是 15 位字元電腦名稱加上一個 0x20 的第 16 位字元。如果電腦名稱的長度不是 15 位字元,會由空格來補齊 15 位字元。
當您嘗試依電腦名稱,產生連接到電腦的檔案共用連線案時,在您指定的檔案伺服器上的 File and Printer Sharing for Microsoft Networks 服務,對應特定的 NetBIOS 名稱。例如,當您嘗試連線到稱為 CORPSERVER 的電腦時,電腦上與 File and Printer Sharing for Microsoft Networks 服務對應的 NetBIOS 名稱為:
CORPSERVER     [20]
請注意它使用空格以補齊電腦名稱。在您可以建立檔案及列印共用連線之前,必須建立 TCP 連線。為了建立 TCP 連線,必須將 NetBIOS 名稱「CORPSERVER [20]」解析成 IP 位址。
將 NetBIOS 名稱解析成 IP 位址的完整機制依存於為 NetBIOS 節點設定的節點類型。RFC 1001「Protocol Standard for a NetBIOS Service on a TCP/UDP Transport:Concepts and Methods」定義 NetBIOS 節點類型,如下表所列。

 

節點類型 描述
B-Node (廣播)B-Node 使用廣播 NetBIOS 名稱查詢,以進行名稱登錄及解析。B-Node 有二個主要問題:(1) 廣播打擾了網路上的每個節點,及 (2) 路由器基本上不轉送廣播,所以只可以解析區域網路上的 NetBIOS名稱。
P-Node (對等)P-Node 使用 NetBIOS 名稱伺服器 (NBNS),如 WINS 伺服器,來解析 NetBIOS 名稱。P-Node 不使用廣播;它改為直接查詢名稱伺服器。
M-node (混合式)M-Node 是 B-Node 與 P-Node 的結合。M-Node 預設會具有 B-Node 的功能。如果 M-Node 無法藉由廣播解析名稱,則它使用 P-Node 查詢 NBNS。
H-node (合成式)H-Node 是 P-Node 及 B-Node 的結合。H-Node 預設會具有 P-Node 的功能。如果 H-Node 無法透過 NBNS 解析名稱,那麼它會使用廣播來解析名稱。
執 行 Windows Server 2003 作業系統的電腦預設會是 B-Node;而運用 WINS 伺服器設定它們時,它們就變成 H-Node。這些電腦也可以使用稱為 Lmhosts 的本機資料庫檔案,來解析遠端 NetBIOS 名稱。Lmhosts 檔案存放在 systemroot\System32\Drivers\Etc 資料夾。如需相關資訊,請參閱 TCP/IP 資料庫檔案
極 力建議您運用 WINS 伺服器的 IP 位址來設定 Windows 電腦,以便解析遠端 NetBIOS 名稱。如果這類電腦要與執行 Windows NT、Windows 95、Windows 98、Windows 2000 或 Windows Millennium Edition 這些不是 Active Directory 型的電腦進行通訊,您必須以 WINS 伺服器的 IP 位址設定 Active Directory 型的電腦,例如Windows XP Professional 及 Windows Server 2003 作業系統。
如需 WINS 的相關資訊,請參閱 WINS 定義

No comments:

Post a Comment