Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

257 lines
11 KiB

  1. NT OS/2 Bowser design note
  2. There are several failings of the current Lan Manager browser that the NT
  3. browser will attempt to correct. Among these are:
  4. 1) The browsing mechanism currently generates a significant amount of
  5. broadcast traffic on a network with a large number of servers on it.
  6. 2) The browsing mechanism can use up to 10% of the CPU bandwidth on
  7. an 386/20e simply in processing the reception of datagrams.
  8. 3) In the long term, the browsing mechanism for OS/2 is self
  9. correcting (in other words, after 5 minutes or so, a correct list of servers
  10. is displayed). However, during the initial 5 minutes after the workstation
  11. has been booted, the information returned by the NetServerEnum API can be
  12. significantly incorrect.
  13. 4) It causes extreme difficulty if there are more than 850 or so
  14. servers in a single domain.
  15. It is beyond the scope of NT product 1 to address issue one (even though it
  16. is the most significant issue to network managers). We can, however address
  17. both issues 2 and 3 in NT.
  18. Currently in Lan Manager, the if the NetServerEnum API is called within the
  19. first N seconds (where N is the "default announcement period"), the API will
  20. remote the NetServerEnum API, first to the domain controller for this machine,
  21. and if none can be found to any servers that have been collected at that point.
  22. By default, the NT workstation will ALWAYS remote the NetServerEnum API
  23. to either the primary domain controller for the machines domain, or to a
  24. backup controller on that domain. Given the Domain-centric security model
  25. of NT, most machines that are members of a domain will have a domain
  26. controller that is accessable that they can remote the API to.
  27. There are certain classes of machines that will always have browsing enabled.
  28. These are
  29. (1) Domain controllers (primary and backup). Since the NetServerEnum
  30. API will be remoted to the DC, they have to be browsing servers over the
  31. network.
  32. (2) Standalone machines. In NT, there is no concept of a "standalone
  33. machine" in the traditional Lan Manager sense of a non validated logon, however
  34. any machine that is not a member of a domain (in other words, a machine that
  35. is a member of a domain with only one server) will have to have browsing
  36. enabled
  37. (3) Machines that are connected to networks that are inaccessable by
  38. the domain controller. If the domain controller cannot access the network,
  39. obviously it cannot receive server announcements for that network.
  40. This approach will solve problem 2. Since receiving server announcements
  41. will not be enabled on the workstation, the NT browser (which will be present
  42. to enable mailslot reception) will be able to quickly discard server
  43. announcments, thus reducing the load on the workstation.
  44. This will work fine on a single net machine, but on a multi-net
  45. configuration, this could cause significant problems. For example, consider
  46. a workstation that is only on a small private network. There are 10 servers
  47. on that network, one of which is the domain controller for that workstation.
  48. If that server is also on a larger corporate network, it will possibly have
  49. several hundred servers that are inaccessible to the workstation. This
  50. means that the workstation will get a list of several hundred servers that
  51. it cannot access (similarly, a machine on the corporate net will see
  52. machines on the private net that cannot be accessed).
  53. In order to solve this problem, the NetServerEnum API will be enhanced
  54. to add a "NetworkName" LPSTR parameter. The new prototype will be as follows:
  55. NET_API_STATUS NET_API_FUNCTION
  56. NetServerEnum (
  57. IN LPTSTR servername OPTIONAL,
  58. IN DWORD level,
  59. OUT LPBYTE *bufptr,
  60. IN DWORD prefmaxlen,
  61. OUT LPDWORD entriesread,
  62. OUT LPDWORD totalentries,
  63. IN DWORD servertype,
  64. IN LPTSTR domain OPTIONAL,
  65. IN LPTSTR network OPTIONAL,
  66. IN OUT LPDWORD resume_handle OPTIONAL
  67. );
  68. When the workstation service receives a NetServerEnum API, depending on the
  69. value of the network parameter, it will do one of the following:
  70. 1) If local browsing is enabled, it will
  71. issue the ENUMERATE_SERVERS IoControl with the specified network name
  72. to the browser.
  73. 2) If the network name is non null, it will remote the API to the
  74. domain controller which will return the list of servers for that network
  75. name.
  76. 3) If the network name is null, it will enumerate the list of
  77. transports locally bound into the system and remote the API for each of them.
  78. It should be quickly apparent that this approach is unusable unless there
  79. is some mechanism of consistantly "naming" a network that is unique for
  80. each domain.
  81. In order to solve this, a new service will be implemented called
  82. the "Network Locator", or NETLOCATOR. The locator service is responsible
  83. for taking an OS specific network name ("NET1" on OS/2, "0" on DOS,
  84. or "\Device\Nbf\ElnkII" on NT) and converting that name into a human readable
  85. form ("Rhino-Net").
  86. OS specific device names will only be presented at OS specific interfaces,
  87. all the LANMAN APIs will only present the human readable names.
  88. The NETLOCATOR service will not export any public lanman APIs. It exists
  89. only to field network query requests, and will run on all domain controllers
  90. in a LANMAN domain.
  91. On NT, the network location functionality will be implemented as follows:
  92. The following API's will have to be added to the NT redirector and browser:
  93. 1) The redirector will export a new FsControl API that will write a
  94. mailslot message on a specific NT specific transport name.
  95. 2) The NT browser will implement a new IoControl API that will wait
  96. for a transport name query on a specified transport name. This IoControl API
  97. will function much as the current GetRelogonRequest IoControl API does and
  98. will return a buffer containing the mailslot message contained in the
  99. name query.
  100. As a part of the setup of the primary domain controller, the setup program
  101. will ask the user for a human readable name for each of the transports
  102. being installed on the computer. This information will be placed in the
  103. config registry for that machine.
  104. This information will be propogated to all of the workstations on the net
  105. when the workstation software is installed on the machines (more on this
  106. process later).
  107. In addition, the following OS specific API will be defined to handle the
  108. mapping between the human readable name and the OS native transport name.
  109. NTSTATUS
  110. RtlConvertDeviceNameToTransportName (
  111. IN PSTRING TransportName,
  112. IN OUT PSTRING OsNativeDeviceName
  113. );
  114. /*++
  115. Routine Description:
  116. This routine will take an OS specific transport name and convert
  117. into a human readable transport name. For example, it will convert
  118. "\Device\Nbf" into "Rhino-Net" on an NT machine.
  119. Arguments:
  120. IN PSTRING TransportName - Specifies the transport name to resolve
  121. IN OUT PSTRING OsNativeDeviceName - Specifies the OS specific name.
  122. Return Value:
  123. The function value is the final status of the name lookup operation.
  124. If there are no domain controllers present to resolve the name, this
  125. routine will return STATUS_OBJECT_NAME_NOT_FOUND.
  126. --*/
  127. The RtlConvertDeviceNameToTransportName will call the
  128. WriteMailslotOnTransport API to send a broadcast mailslot message to the
  129. primary domain on the specified transport. This mailslot message will
  130. contain the name of a remote mailslot to use to receive the response to
  131. this query (for example, \\Workstation\Mailslot\TransporNameQueryResponse).
  132. For every transport that the server is serving (returned by
  133. NetServerTransportEnum), the NetLocator service will post a
  134. WaitForTransportQuery IoControl API into the browser. This API will complete
  135. when the workstations query arrives at the server. The NetLocator service
  136. will then query the local config registry to determine the human readable name
  137. of the network on the local machine. It will then write the resulting
  138. human readable name back to the mailslot specified in the query request.
  139. Unlike the NetLogon service, any machine running the NetLocator service
  140. may respond to the transport query. This means that the workstation may
  141. receive many responses to a single query.
  142. At workstation startup time, it will query the config database for the list
  143. of transports that the workstation is supposed to be bound to. It will
  144. then bind each of these transports into the redirector and browser and issue
  145. an RtlConvertDeviceNameToTransportName API for that transport. If the name
  146. that is returned by the API is different from the existing name in the
  147. registry, it will update the name in the registry. This guarantees that the
  148. names in the registry are up to date. If the workstation gets back an
  149. error of STATUS_OBJECT_NAME_NOT_FOUND from the
  150. RtlConvertDeviceNameToTransportName API, it must assume that the transport
  151. in question is unknown on this network. In that situation, the workstation
  152. must inform the browser that it has to start receiving datagrams on the
  153. specified transport.
  154. When an adminstrator wishes to alter the name of a network, all they have
  155. to do is to modify the name in the config registry. The NetLocator service
  156. will register with the config registry that it is interested in changes to
  157. the transport names portion of the registry, and when the NetLocator
  158. service realizes that the name has changed, it will remote a new private
  159. NetLocator specific API to the NetLocator service running on each of the
  160. backup domain controllers.
  161. \ NOTE: This depends on the Notification functionality still being
  162. in the NT config registry. If this functionality has been
  163. removed, a new API will have to be defined to modify the
  164. transport name. \
  165. This API will simply indicate to the NetLocator service on the specified
  166. machine that some change has occurred to the transport names on the
  167. machine, and the NetLocator API will re-resolve the transport names at this
  168. time.
  169. When the workstation remotes the NetServerEnum API to the server, if the
  170. server ever returns the new error NERR_UnknownNetwork, the workstation will
  171. assume that some change has been made to the human readable transport names
  172. on the server, and it will re-validate the transport name. If the
  173. revalidation fails, it will enable the browser for that transport and
  174. perform the API locally.
  175. When the workstation software is initially installed on a machine, the
  176. installer will load the redirector, browser, and transport drivers specified
  177. by the user. The setup program will then issue the
  178. RtlConvertDeviceNameToTransportName API to determine the human readable
  179. version of the transport name and will enter that in the config registry.
  180. Down level issues
  181. When the NetServerEnum is remoted to a down level server, if the Network
  182. parameter is non-null, it will have to return ERROR_NOT_SUPPORTED to the
  183. caller.
  184. XactSrv will specify NULL as the network name when it executes a local
  185. version of NetServerEnum.
  186. Future Issues
  187. It should be noted that the locator name replication can be implemented
  188. within a directory service once one becomes available.