Win98 connection - MS quality/compability

Christopher R. Hertel crh at nts.umn.edu
Fri Jan 4 10:31:22 GMT 2002


> Samba is both nmbd and smbd. It isn't just one daemon.
> 
> The service provided by nmbd is not just an equivalent to WINS, or DNS. It
> does not just implement name-to-IP conversions.
> 
> The nmbd daemon implements NetBIOS and LanManager naming and browsing. It
> performs the same function as the Network Neighborhood in Windows. Without
> it, clients can't get enough information to access other services. The Unix
> equivalent is a combination of DNS, NIS, LDAP(?), and probably a few other
> user/host/network information services.

Mostly, yes.

Nmbd really does two jobs.  First, it defines the virtual NetBIOS LAN.  
("NetBIOS LAN" is really the wrong name, since NetBIOS is an API, but the 
term applies.  The original name was "IBM PC-Network".)  Addressing in 
NetBIOS is based on 16-byte names.  The NBT layer (as implemented in 
nmbd) is responsible for mapping between NetBIOS addresses and the 
addresses of the underlying IP layer.  This is managed via a distributed 
database.  The WINS server is simply one node that participates in that 
database (and is not necessary on a single subnet).

The other job nmbd does is handling the browsing service.  Browsing is a 
separate service that *uses* the NetBIOS virtual LAN.  Unfortunately, the 
browsing was badly designed and *is broken*, causing all sorts of trouble 
in the WINS server.  Most notably, the Local Master Browser will attempt 
to register its unique name (<workgroup>#1D) with the WINS server.  Each 
subnet needs its own LMB, so each subnet needs a machine with the name 
<workgroup>#1D registered.  Since this name is unique, it can't happen.  
Microsoft got around this by having the WINS server make a special 
exception.  WINS will accept LMB registrations, and then quietly drop the 
registration into the trash.

> The smbd daemon is equivalent to the File and Printer Sharing service on
> Windows. The Unix equivalent is NFS and lpd.
> 
> The reason your test isn't working even though you are using the IP address
> is, Windows uses the IP address to do a NetBIOS query to the host. It is
> trying to resolve the NetBIOS name of the host, and gather other
> information. Without the host name, most of the request packets which need
> to be sent later can't be constructed.

Right, but the only thing that W/9x actually needs is a recognized 
service name to satisfy the requirements of the NBT Session Service.  
That is a very, very small piece.

Microsoft actually built a kludge to work around this requirement.  They 
introduced the "*SMBSERVER" name.

According the RFC1001/1002, NetBIOS names in an NBT namespace may *not*
begin with an asterisk.  So, what Microsoft did in W/NT4 was to tell the
Session Service that it could always respond positively to a session setup
using the name "*SMBSERVER".  That name is never registered, and does not
appear in the name list when you send an Adapter Status query.  It is an
obvious kludge... but it is why the connection from W2K and W/NT works
even though nmbd is not running.  Samba, in our ever-frightening efforts
to be compatible, also accepts the "*SMBSERVER" name in session setups.

One the session is established, NBT really isn't needed any more.  There 
are a few bytes worth of NBT Session header in the session packets.
When Microsoft finally realized this, they came up with SMB over TCP 
using port 445.  It's almost exactly the same.

Chris -)-----

-- 
Christopher R. Hertel -)-----                   University of Minnesota
crh at nts.umn.edu              Networking and Telecommunications Services

    Ideals are like stars; you will not succeed in touching them
    with your hands...you choose them as your guides, and following
    them you will reach your destiny.  --Carl Schultz




More information about the samba-technical mailing list