JHT ==> Still getting ready for 1.9.17 release.
[samba.git] / docs / textdocs / NetBIOS.txt
1 Contributor:    Unknown
2 Date:           Unknown
3 Status:         Current
4
5 Subject:        Definition of NetBIOS Protocol and Name Resolution Modes
6 =============================================================================
7
8 =======
9 NETBIOS
10 =======
11
12 NetBIOS runs over the following tranports: TCP/IP; NetBEUI and IPX/SPX.
13 Samba only uses NetBIOS over TCP/IP.  For details on the TCP/IP NetBIOS 
14 Session Service NetBIOS Datagram Service, and NetBIOS Names, see
15 rfc1001.txt and rfc1002.txt.
16
17 NetBEUI is a raw NetBIOS frame protocol implementation that allows NetBIOS
18 datagrams to be sent out over the 'wire' embedded within LLC frames.
19 NetBEUI is not required when using NetBIOS over TCP/IP protocols and it
20 is preferrable NOT to install NetBEUI if it can be avoided.
21
22 NetBIOS applications (such as samba) offer their services (for example,
23 SMB file and print sharing) on a NetBIOS name.  They must claim this name
24 on the network before doing so.  The NetBIOS session service will then
25 accept connections on the application's behalf (on the NetBIOS name
26 claimed by the application).  A NetBIOS session between the application
27 and the client can then commence.
28
29 NetBIOS names consist of 15 characters plus a 'type' character.  This is
30 similar, in concept, to an IP address and a TCP port number, respectively.
31 A NetBIOS-aware application on a host will offer different services under
32 different NetBIOS name types, just as a host will offer different TCP/IP
33 services on different port numbers.
34
35 NetBIOS names must be claimed on a network, and must be defended.  The use
36 of NetBIOS names is most suitable on a single subnet; a Local Area Network
37 or a Wide Area Network.
38
39 NetBIOS names are either UNIQUE or GROUP.  Only one application can claim a
40 UNIQUE NetBIOS name on a network.
41
42 There are two kinds of NetBIOS Name resolution: Broadcast and Point-to-Point.
43
44 =================
45 BROADCAST NetBIOS
46 =================
47
48 Clients can claim names, and therefore offer services on successfully claimed
49 names, on their broadcast-isolated subnet.  One way to get NetBIOS services
50 (such as browsing: see ftp.microsoft.com/drg/developr/CIFS/browdiff.txt; and
51 SMB file/print sharing: see cifs4.txt) working on a LAN or WAN is to make
52 your routers forward all broadcast packets from TCP/IP ports 137, 138 and 139.
53
54 This, however, is not recommended.  If you have a large LAN or WAN, you will
55 find that some of your hosts spend 95 percent of their time dealing with
56 broadcast traffic.  [If you have IPX/SPX on your LAN or WAN, you will find
57 that this is already happening: a packet analyzer will show, roughly
58 every twelve minutes, great swathes of broadcast traffic!].
59
60
61 ============
62 NBNS NetBIOS
63 ============
64
65 rfc1001.txt describes, amongst other things, the implementation and use
66 of, a 'NetBIOS Name Service'.  NT/AS offers 'Windows Internet Name Service'
67 which is fully rfc1001/2 compliant, but has had to take specific action
68 with certain NetBIOS names in order to make it useful.  (for example, it
69 deals with the registration of <1c> <1d> <1e> names all in different ways.
70 I recommend the reading of the Microsoft WINS Server Help files for full
71 details).
72
73 Samba also offers WINS server capabilities.  Samba does not interact
74 with NT/AS (WINS replication), so if you have a mixed NT server and
75 Samba server environment, it is recommended that you use the NT server's
76 WINS capabilities, instead of samba's WINS server capabilities.
77
78 The use of a WINS server cuts down on broadcast network traffic for
79 NetBIOS name resolution.  It has the effect of pulling all the broadcast
80 isolated subnets together into a single NetBIOS scope, across your LAN
81 or WAN, while avoiding the use of TCP/IP broadcast packets.
82
83 When you have a WINS server on your LAN, WINS clients will be able to
84 contact the WINS server to resolve NetBIOS names.  Note that only those
85 WINS clients that have registered with the same WINS server will be
86 visible.  The WINS server _can_ have static NetBIOS entries added to its
87 database (usually for security reasons you might want to consider putting
88 your domain controllers or other important servers as static entries,
89 but you should not rely on this as your sole means of security), but for
90 the most part, NetBIOS names are registered dynamically.
91
92 [It is important to mention that samba's browsing capabilities (as a WINS
93 client) must have access to a WINS server.  if you are using samba also
94 as a WINS server, then it will have a direct short-cut into the WINS
95 database.
96
97 This provides some confusion for lots of people, and is worth mentioning
98 here:  a Browse Server is NOT a WINS Server, even if these services are
99 implemented in the same application.  A Browse Server _needs_ a WINS server
100 because a Browse Server is a WINS client, which is _not_ the same thing].
101
102 Clients can claim names, and therefore offer services on successfully claimed
103 names, on their broadcast-isolated subnet.  One way to get NetBIOS services
104 (such as browsing: see ftp.microsoft.com/drg/developr/CIFS/browdiff.txt; and
105 SMB file/print sharing: see cifs4.txt) working on a LAN or WAN is to make
106 your routers forward all broadcast packets from TCP/IP ports 137, 138 and 139.
107
108 WINS Clients therefore claim names from the WINS server.  If the WINS
109 server allows them to register a name, the client's NetBIOS session service
110 can then offer services on this name.  Other WINS clients will then
111 contact the WINS server to resolve a NetBIOS name.
112
113 To configure samba as a WINS server, you must add "wins support = yes" to
114 the [global] section of your smb.conf file.  This will enable WINS server
115 capabilities in nmbd.
116
117 To configure samba as a WINS client, you must add "wins server = x.x.x.x"
118 to the [global] section of your smb.conf file, where x.x.x.x is the TCP/IP
119 address of your WINS server.  The browsing capabilities in nmbd will then
120 register (and resolve) WAN-wide NetBIOS names with this WINS server.
121
122 Note that if samba has "wins support = yes", then the browsing capabilities
123 will _not_ use the "wins server" option to resolve NetBIOS names: it will
124 go directly to the internal WINS database for NetBIOS name resolution.  It
125 is therefore invalid to have both "wins support = yes" and
126 "wins server = x.x.x.x".  Note, in particular, that if you configure the
127 "wins server" parameter to be the ip address of your samba server itself
128 (as might one intuitively think), that you will run into difficulties.
129 Do not use both parameters!
130
131