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