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