SMB and samba internals

Daniel Stenberg Daniel.Stenberg at haxx.nu
Fri Jan 28 14:58:14 GMT 2000


Hi

I have some questions regarding how SMB clients interact with a domain
login server.

The domain is here called 'ASTEST' the netbios name of the client is
'NUNA', the server is running on IP x.x.x.69 and the client connects with
PPP and uses x.x.x.86 (the IPs are hidden to protect the innocent).

In a detailed log when I manage to login to the domain my samba is
serving, using a windows 98 host, I can see the following happen:

[2000/01/28 13:16:11, 5] libsmb/nmblib.c:read_packet(727)
  Received a packet of len 218 from (x.x.x.86) port 138
[2000/01/28 13:16:11, 7] nmbd/nmbd_packets.c:listen_for_packets(1885)
  receiving packet from x.x.x.86:138
[2000/01/28 13:16:11, 10] nmbd/nmbd_subnetdb.c:namelist_entry_compare(77)
nmbd_subnetdb:namelist_entry_compare()
-1 == memcmp( "ASTEST<00>", "ASTEST<1e>", 88 )
[2000/01/28 13:16:11, 10] nmbd/nmbd_subnetdb.c:namelist_entry_compare(77)
nmbd_subnetdb:namelist_entry_compare()
-1 == memcmp( "ASTEST<00>", "ASTEST<1d>", 88 )
[2000/01/28 13:16:11, 10] nmbd/nmbd_subnetdb.c:namelist_entry_compare(77)
nmbd_subnetdb:namelist_entry_compare()
0 == memcmp( "ASTEST<00>", "ASTEST<00>", 88 )
[2000/01/28 13:16:11, 9] nmbd/nmbd_namelistdb.c:find_name_on_subnet(132)
  find_name_on_subnet: on subnet x.x.x.69 - found name ASTEST<00> source=2
[2000/01/28 13:16:11, 4] nmbd/nmbd_packets.c:process_dgram(1246)
  process_dgram: datagram from NUNA<00> to ASTEST<00> IP x.x.x.86 for
\MAILSLOT\NET\NETLOGON of type 0 len=44
[2000/01/28 13:16:11, 1] nmbd/nmbd_processlogon.c:process_logon_packet(69)
  process_logon_packet: Logon from x.x.x.86: code = 0
[2000/01/28 13:16:11, 3] nmbd/nmbd_processlogon.c:process_logon_packet(86)
  process_logon_packet: Domain login request from NUNA at IP x.x.x.86
user=DANIELS token=ffff
[2000/01/28 13:16:11, 4] lib/util.c:dump_data(2980)
  [000] 06 00 5C 5C 41 53 00 FF  FF                       ..\\AS.. .
[2000/01/28 13:16:11, 4] nmbd/nmbd_packets.c:send_mailslot(1965)
  send_mailslot: Sending to mailslot \MAILSLOT\TEMP\NETLOGON from
ASTEST<00> IP x.x.x.69 to NUNA<00> IP x.x.x.86
[2000/01/28 13:16:11, 4] nmbd/nmbd_packets.c:debug_browse_data(104)
  debug_browse_data():
    0 char ..\\AS...        hex 06 00 5c 5c 41 53 00 ff ff
[2000/01/28 13:16:11, 5] libsmb/nmblib.c:send_udp(780)


I think I can understand this. It flies a whole sequence of netbios-ns
packages first and then there's a netbios-dgm one. A single dgm one that
is a login request and the first package that the server actually replies
to.

Now, if there is no server on the network for the domain that the client
wants to login to, how do the client get that knowledge? As far as I've
come to understand there are no reply packages from anyone, it just times
out after having broadcasted a lot of netbios-ns packages.

How does the client get the information that there is no server for its
domain if it never receives any replies from the server and vice versa?

--
   Daniel Stenberg - http://www.contactor.se/~dast - +46-705-44 31 77
   ech`echo xiun|tr nu oc|sed 'sx\([sx]\)\([xoi]\)xo un\2\1 is xg'`ol


More information about the samba-technical mailing list