home *** CD-ROM | disk | FTP | other *** search
/ Hackers Toolkit 2.0 / Hackers_Toolkit_v2.0.iso / HTML / archive / Texts / Rfc / RFC1001.TXT < prev    next >
Encoding:
Text File  |  1999-11-04  |  150.8 KB  |  4,081 lines

  1. Network Working Group
  2. Request for Comments: 1001                                March, 1987
  3.  
  4.  
  5.  
  6.  
  7.              PROTOCOL STANDARD FOR A NetBIOS SERVICE
  8.                      ON A TCP/UDP TRANSPORT:
  9.                       CONCEPTS AND METHODS
  10.  
  11.  
  12.  
  13.  
  14.                             ABSTRACT
  15.  
  16. This RFC defines a proposed standard protocol to support NetBIOS
  17. services in a TCP/IP environment.  Both local network and internet
  18. operation are supported.  Various node types are defined to accommodate
  19. local and internet topologies and to allow operation with or without the
  20. use of IP broadcast.
  21.  
  22. This RFC describes the NetBIOS-over-TCP protocols in a general manner,
  23. emphasizing the underlying ideas and techniques.  Detailed
  24. specifications are found in a companion RFC, "Protocol Standard For a
  25. NetBIOS Service on a TCP/UDP Transport: Detailed Specifications".
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55. NetBIOS Working Group                                           [Page 1]
  56.  
  57.  
  58. RFC 1001                                                      March 1987
  59.  
  60.  
  61.                        SUMMARY OF CONTENTS
  62.  
  63.  
  64. 1.  STATUS OF THIS MEMO                                             6
  65. 2.  ACKNOWLEDGEMENTS                                                6
  66. 3.  INTRODUCTION                                                    7
  67. 4.  DESIGN PRINCIPLES                                               7
  68. 5.  OVERVIEW OF NetBIOS                                            10
  69. 6.  NetBIOS FACILITIES SUPPORTED BY THIS STANDARD                  15
  70. 7.  REQUIRED SUPPORTING SERVICE INTERFACES AND DEFINITIONS         15
  71. 8.  RELATED PROTOCOLS AND SERVICES                                 16
  72. 9.  NetBIOS SCOPE                                                  16
  73. 10.  NetBIOS END-NODES                                             16
  74. 11.  NetBIOS SUPPORT SERVERS                                       18
  75. 12.  TOPOLOGIES                                                    20
  76. 13.  GENERAL METHODS                                               23
  77. 14.  REPRESENTATION OF NETBIOS NAMES                               25
  78. 15.  NetBIOS NAME SERVICE                                          27
  79. 16.  NetBIOS SESSION SERVICE                                       48
  80. 17.  NETBIOS DATAGRAM SERVICE                                      55
  81. 18.  NODE CONFIGURATION PARAMETERS                                 58
  82. 19.  MINIMAL CONFORMANCE                                           59
  83. REFERENCES                                                         60
  84. APPENDIX A - INTEGRATION WITH INTERNET GROUP MULTICASTING          61
  85. APPENDIX B - IMPLEMENTATION CONSIDERATIONS                         62
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115. NetBIOS Working Group                                           [Page 2]
  116.  
  117.  
  118. RFC 1001                                                      March 1987
  119.  
  120.  
  121.                         TABLE OF CONTENTS
  122.  
  123.  
  124. 1.  STATUS OF THIS MEMO                                             6
  125.  
  126. 2.  ACKNOWLEDGEMENTS                                                6
  127.  
  128. 3.  INTRODUCTION                                                    7
  129.  
  130. 4.  DESIGN PRINCIPLES                                               8
  131.   4.1  PRESERVE NetBIOS SERVICES                                    8
  132.   4.2  USE EXISTING STANDARDS                                       8
  133.   4.3  MINIMIZE OPTIONS                                             8
  134.   4.4  TOLERATE ERRORS AND DISRUPTIONS                              8
  135.   4.5  DO NOT REQUIRE CENTRAL MANAGEMENT                            9
  136.   4.6  ALLOW INTERNET OPERATION                                     9
  137.   4.7  MINIMIZE BROADCAST ACTIVITY                                  9
  138.   4.8  PERMIT IMPLEMENTATION ON EXISTING SYSTEMS                    9
  139.   4.9  REQUIRE ONLY THE MINIMUM NECESSARY TO OPERATE                9
  140.   4.10  MAXIMIZE EFFICIENCY                                        10
  141.   4.11  MINIMIZE NEW INVENTIONS                                    10
  142.  
  143. 5.  OVERVIEW OF NetBIOS                                            10
  144.   5.1  INTERFACE TO APPLICATION PROGRAMS                           10
  145.   5.2  NAME SERVICE                                                11
  146.   5.3  SESSION SERVICE                                             12
  147.   5.4  DATAGRAM SERVICE                                            13
  148.   5.5  MISCELLANEOUS FUNCTIONS                                     14
  149.   5.6  NON-STANDARD EXTENSIONS                                     15
  150.  
  151. 6.  NetBIOS FACILITIES SUPPORTED BY THIS STANDARD                  15
  152.  
  153. 7.  REQUIRED SUPPORTING SERVICE INTERFACES AND DEFINITIONS         15
  154.  
  155. 8.  RELATED PROTOCOLS AND SERVICES                                 16
  156.  
  157. 9.  NetBIOS SCOPE                                                  16
  158.  
  159. 10.  NetBIOS END-NODES                                             16
  160.   10.1  BROADCAST (B) NODES                                        16
  161.   10.2  POINT-TO-POINT (P) NODES                                   16
  162.   10.3  MIXED MODE (M) NODES                                       16
  163.  
  164. 11.  NetBIOS SUPPORT SERVERS                                       18
  165.   11.1  NetBIOS NAME SERVER (NBNS) NODES                           18
  166.      11.1.1  RELATIONSHIP OF THE NBNS TO THE DOMAIN NAME SYSTEM    19
  167.   11.2  NetBIOS DATAGRAM DISTRIBUTION SERVER (NBDD) NODES          19
  168.   11.3  RELATIONSHIP OF NBNS AND NBDD NODES                        20
  169.   11.4  RELATIONSHIP OF NetBIOS SUPPORT SERVERS AND B NODES        20
  170. 12.  TOPOLOGIES                                                    20
  171.   12.1  LOCAL                                                      20
  172.  
  173.  
  174.  
  175. NetBIOS Working Group                                           [Page 3]
  176.  
  177.  
  178. RFC 1001                                                      March 1987
  179.  
  180.  
  181.      12.1.1  B NODES ONLY                                          21
  182.      12.1.2  P NODES ONLY                                          21
  183.      12.1.3  MIXED B AND P NODES                                   21
  184.   12.2  INTERNET                                                   22
  185.      12.2.1  P NODES ONLY                                          22
  186.      12.2.2  MIXED M AND P NODES                                   23
  187.  
  188. 13.  GENERAL METHODS                                               23
  189.   13.1  REQUEST/RESPONSE INTERACTION STYLE                         23
  190.      13.1.1  RETRANSMISSION OF REQUESTS                            24
  191.      13.1.2  REQUESTS WITHOUT RESPONSES: DEMANDS                   24
  192.   13.2  TRANSACTIONS                                               25
  193.      13.2.1  TRANSACTION ID                                        25
  194.   13.3  TCP AND UDP FOUNDATIONS                                    25
  195.  
  196. 14.  REPRESENTATION OF NETBIOS NAMES                               25
  197.   14.1  FIRST LEVEL ENCODING                                       26
  198.   14.2  SECOND LEVEL ENCODING                                      27
  199.  
  200. 15.  NetBIOS NAME SERVICE                                          27
  201.   15.1  OVERVIEW OF NetBIOS NAME SERVICE                           27
  202.      15.1.1  NAME REGISTRATION (CLAIM)                             27
  203.      15.1.2  NAME QUERY (DISCOVERY)                                28
  204.      15.1.3  NAME RELEASE                                          28
  205.        15.1.3.1  EXPLICIT RELEASE                                  28
  206.        15.1.3.2  NAME LIFETIME AND REFRESH                         29
  207.        15.1.3.3  NAME CHALLENGE                                    29
  208.        15.1.3.4  GROUP NAME FADE-OUT                               29
  209.      15.1.3.5  NAME CONFLICT                                       30
  210.      15.1.4  ADAPTER STATUS                                        31
  211.      15.1.5  END-NODE NBNS INTERACTION                             31
  212.        15.1.5.1  UDP, TCP, AND TRUNCATION                          31
  213.        15.1.5.2  NBNS WACK                                         32
  214.        15.1.5.3  NBNS REDIRECTION                                  32
  215.      15.1.6  SECURED VERSUS NON-SECURED NBNS                       32
  216.      15.1.7  CONSISTENCY OF THE NBNS DATA BASE                     32
  217.      15.1.8  NAME CACHING                                          34
  218.   15.2  NAME REGISTRATION TRANSACTIONS                             34
  219.      15.2.1  NAME REGISTRATION BY B NODES                          34
  220.      15.2.2  NAME REGISTRATION BY P NODES                          35
  221.        15.2.2.1  NEW NAME, OR NEW GROUP MEMBER                     35
  222.        15.2.2.2  EXISTING NAME AND OWNER IS STILL ACTIVE           36
  223.        15.2.2.3  EXISTING NAME AND OWNER IS INACTIVE               37
  224.      15.2.3  NAME REGISTRATION BY M NODES                          38
  225.   15.3  NAME QUERY TRANSACTIONS                                    39
  226.      15.3.1  QUERY BY B NODES                                      39
  227.      15.3.2  QUERY BY P NODES                                      40
  228.      15.3.3  QUERY BY M NODES                                      43
  229.      15.3.4  ACQUIRE GROUP MEMBERSHIP LIST                         43
  230.   15.4  NAME RELEASE TRANSACTIONS                                  44
  231.      15.4.1  RELEASE BY B NODES                                    44
  232.  
  233.  
  234.  
  235. NetBIOS Working Group                                           [Page 4]
  236.  
  237.  
  238. RFC 1001                                                      March 1987
  239.  
  240.  
  241.      15.4.2  RELEASE BY P NODES                                    44
  242.      15.4.3  RELEASE BY M NODES                                    44
  243.   15.5  NAME MAINTENANCE TRANSACTIONS                              45
  244.      15.5.1  NAME REFRESH                                          45
  245.      15.5.2  NAME CHALLENGE                                        46
  246.      15.5.3  CLEAR NAME CONFLICT                                   47
  247.   15.6  ADAPTER STATUS TRANSACTIONS                                47
  248.  
  249. 16.  NetBIOS SESSION SERVICE                                       48
  250.   16.1  OVERVIEW OF NetBIOS SESSION SERVICE                        49
  251.      16.1.1  SESSION ESTABLISHMENT PHASE OVERVIEW                  49
  252.        16.1.1.1  RETRYING AFTER BEING RETARGETTED                  50
  253.        16.1.1.2  SESSION ESTABLISHMENT TO A GROUP NAME             51
  254.      16.1.2  STEADY STATE PHASE OVERVIEW                           51
  255.      16.1.3  SESSION TERMINATION PHASE OVERVIEW                    51
  256.   16.2  SESSION ESTABLISHMENT PHASE                                52
  257.   16.3  SESSION DATA TRANSFER PHASE                                54
  258.      16.3.1  DATA ENCAPSULATION                                    54
  259.      16.3.2  SESSION KEEP-ALIVES                                   54
  260.  
  261. 17.  NETBIOS DATAGRAM SERVICE                                      55
  262.   17.1  OVERVIEW OF NetBIOS DATAGRAM SERVICE                       55
  263.      17.1.1  UNICAST, MULTICAST, AND BROADCAST                     55
  264.      17.1.2  FRAGMENTATION OF NetBIOS DATAGRAMS                    55
  265.   17.2  NetBIOS DATAGRAMS BY B NODES                               57
  266.   17.3  NetBIOS DATAGRAMS BY P AND M NODES                         58
  267.  
  268. 18.  NODE CONFIGURATION PARAMETERS                                 58
  269.  
  270. 19.  MINIMAL CONFORMANCE                                           59
  271.  
  272. REFERENCES                                                         60
  273.  
  274. APPENDIX A                                                         61
  275.  
  276. INTEGRATION WITH INTERNET GROUP MULTICASTING                       61
  277.   A-1.  ADDITIONAL PROTOCOL REQUIRED IN B AND M NODES              61
  278.   A-2.  CONSTRAINTS                                                61
  279.  
  280. APPENDIX B                                                         62
  281.  
  282. IMPLEMENTATION CONSIDERATIONS                                      62
  283.   B-1.  IMPLEMENTATION MODELS                                      62
  284.      B-1.1  MODEL INDEPENDENT CONSIDERATIONS                       63
  285.      B-1.2  SERVICE OPERATION FOR EACH MODEL                       63
  286.   B-2.  CASUAL AND RESTRICTED NetBIOS APPLICATIONS                 64
  287.   B-3.  TCP VERSUS SESSION KEEP-ALIVES                             66
  288.   B-4.  RETARGET ALGORITHMS                                        67
  289.   B-5.  NBDD SERVICE                                               68
  290.   B-6.  APPLICATION CONSIDERATIONS                                 68
  291.      B-6.1  USE OF NetBIOS DATAGRAMS                               68
  292.  
  293.  
  294.  
  295. NetBIOS Working Group                                           [Page 5]
  296.  
  297.  
  298. RFC 1001                                                      March 1987
  299.  
  300.  
  301.              PROTOCOL STANDARD FOR A NetBIOS SERVICE
  302.                      ON A TCP/UDP TRANSPORT:
  303.                       CONCEPTS AND METHODS
  304.  
  305.  
  306. 1.  STATUS OF THIS MEMO
  307.  
  308.    This RFC specifies a proposed standard for the Internet
  309.    community.  Since this topic is new to the Internet community,
  310.    discussions and suggestions are specifically requested.
  311.  
  312.    Please send written comments to:
  313.  
  314.            Karl Auerbach
  315.            Epilogue Technology Corporation
  316.            P.O. Box 5432
  317.            Redwood City, CA   94063
  318.  
  319.    Please send online comments to:
  320.  
  321.            Avnish Aggarwal
  322.                    Internet: mtxinu!excelan!avnish@ucbvax.berkeley.edu
  323.                    Usenet:   ucbvax!mtxinu!excelan!avnish
  324.  
  325.    Distribution of this document is unlimited.
  326.  
  327. 2.  ACKNOWLEDGEMENTS
  328.  
  329.    This RFC has been developed under the auspices of the Internet
  330.    Activities Board, especially the End-to-End Services Task Force.
  331.  
  332.    The following individuals have contributed to the development of
  333.    this RFC:
  334.  
  335.    Avnish Aggarwal       Arvind Agrawal        Lorenzo Aguilar
  336.    Geoffrey Arnold       Karl Auerbach         K. Ramesh Babu
  337.    Keith Ball            Amatzia Ben-Artzi     Vint Cerf
  338.    Richard Cherry        David Crocker         Steve Deering
  339.    Greg Ennis            Steve Holmgren        Jay Israel
  340.    David Kaufman         Lee LaBarre           James Lau
  341.    Dan Lynch             Gaylord Miyata        David Stevens
  342.    Steve Thomas          Ishan Wu
  343.  
  344.    The system proposed by this RFC does not reflect any existing
  345.    Netbios-over-TCP implementation.  However, the design
  346.    incorporates considerable knowledge obtained from prior
  347.    implementations.  Special thanks goes to the following
  348.    organizations which have provided this invaluable information:
  349.  
  350.    CMC/Syros      Excelan        Sytek          Ungermann-Bass
  351.  
  352.  
  353.  
  354.  
  355. NetBIOS Working Group                                           [Page 6]
  356.  
  357.  
  358. RFC 1001                                                      March 1987
  359.  
  360.  
  361. 3.  INTRODUCTION
  362.  
  363.    This RFC describes the ideas and general methods used to provide
  364.    NetBIOS on a TCP and UDP foundation.  A companion RFC, "Protocol
  365.    Standard For a NetBIOS Service on a TCP/UDP Transport: Detailed
  366.    Specifications"[1] contains detailed descriptions of packet
  367.    formats, protocols, and defined constants and variables.
  368.  
  369.    The NetBIOS service has become the dominant mechanism for
  370.    personal computer networking.  NetBIOS provides a vendor
  371.    independent interface for the IBM Personal Computer (PC) and
  372.    compatible systems.
  373.  
  374.    NetBIOS defines a software interface not a protocol.  There is no
  375.    "official" NetBIOS service standard.  In practice, however, the
  376.    IBM PC-Network version is used as a reference.  That version is
  377.    described in the IBM document 6322916, "Technical Reference PC
  378.    Network"[2].
  379.  
  380.    Protocols supporting NetBIOS services have been constructed on
  381.    diverse protocol and hardware foundations.  Even when the same
  382.    foundation is used, different implementations may not be able to
  383.    interoperate unless they use a common protocol.  To allow NetBIOS
  384.    interoperation in the Internet, this RFC defines a standard
  385.    protocol to support NetBIOS services using TCP and UDP.
  386.  
  387.    NetBIOS has generally been confined to personal computers to
  388.    date.  However, since larger computers are often well suited to
  389.    run certain NetBIOS applications, such as file servers, this
  390.    specification has been designed to allow an implementation to be
  391.    built on virtually any type of system where the TCP/IP protocol
  392.    suite is available.
  393.  
  394.    This standard defines a set of protocols to support NetBIOS
  395.    services.
  396.  
  397.    These protocols are more than a simple communications service
  398.    involving two entities.  Rather, this note describes a
  399.    distributed system in which many entities play a part even if
  400.    they are not involved as an end-point of a particular NetBIOS
  401.    connection.
  402.  
  403.    This standard neither constrains nor determines how those
  404.    services are presented to application programs.
  405.  
  406.    Nevertheless, it is expected that on computers operating under
  407.    the PC-DOS and MS-DOS operating systems that the existing NetBIOS
  408.    interface will be preserved by implementors.
  409.  
  410.    NOTE: Various symbolic values are used in this document.  For
  411.          their definitions, refer to the Detailed Specifications[1].
  412.  
  413.  
  414.  
  415. NetBIOS Working Group                                           [Page 7]
  416.  
  417.  
  418. RFC 1001                                                      March 1987
  419.  
  420.  
  421. 4.  DESIGN PRINCIPLES
  422.  
  423.    In order to develop the specification the following design principles
  424.    were adopted to guide the effort.  Most are typical to any protocol
  425.    standardization effort; however, some have been assigned priorities
  426.    that may be considered unusual.
  427.  
  428. 4.1.  PRESERVE NetBIOS SERVICES
  429.  
  430.    In the absence of an "official" standard for NetBIOS services, the
  431.    version found in the IBM PC Network Technical Reference[2] is used.
  432.  
  433.    NetBIOS is the foundation of a large body of existing applications.
  434.    It is desirable to operate these applications on TCP networks and to
  435.    extend them beyond personal computers into larger hosts.  To support
  436.    these applications, NetBIOS on TCP must closely conform to the
  437.    services offered by existing NetBIOS systems.
  438.  
  439.    IBM PC-Network NetBIOS contains some implementation specific
  440.    characteristics.  This standard does not attempt to completely
  441.    preserve these.  It is certain that some existing software requires
  442.    these characteristics and will fail to operate correctly on a NetBIOS
  443.    service based on this RFC.
  444.  
  445. 4.2.  USE EXISTING STANDARDS
  446.  
  447.    Protocol development, especially with standardization, is a demanding
  448.    process.  The development of new protocols must be minimized.
  449.  
  450.    It is considered essential that an existing standard which provides
  451.    the necessary functionality with reasonable performance always be
  452.    chosen in preference to developing a new protocol.
  453.  
  454.    When a standard protocol is used, it must be unmodified.
  455.  
  456. 4.3.  MINIMIZE OPTIONS
  457.  
  458.    The standard for NetBIOS on TCP should contain few, if any, options.
  459.  
  460.    Where options are included, the options should be designed so that
  461.    devices with different option selections should interoperate.
  462.  
  463. 4.4.  TOLERATE ERRORS AND DISRUPTIONS
  464.  
  465.    NetBIOS networks typically operate in an uncontrolled environment.
  466.    Computers come on-line at arbitrary times.  Computers usually go
  467.    off-line without any notice to their peers.  The software is often
  468.    operated by users who are unfamiliar with networks and who may
  469.    randomly perturb configuration settings.
  470.  
  471.    Despite this chaos, NetBIOS networks work.  NetBIOS on TCP must also
  472.  
  473.  
  474.  
  475. NetBIOS Working Group                                           [Page 8]
  476.  
  477.  
  478. RFC 1001                                                      March 1987
  479.  
  480.  
  481.    be able to operate well in this environment.
  482.  
  483.    Robust operation does not necessarily mean that the network is proof
  484.    against all disruptions.  A typical NetBIOS network may be disrupted
  485.    by certain types of behavior, whether inadvertent or malicious.
  486.  
  487. 4.5.  DO NOT REQUIRE CENTRAL MANAGEMENT
  488.  
  489.    NetBIOS on TCP should be able to operate, if desired, without
  490.    centralized management beyond that typically required by a TCP based
  491.    network.
  492.  
  493. 4.6.  ALLOW INTERNET OPERATION
  494.  
  495.    The proposed standard recognizes the need for NetBIOS operation
  496.    across a set of networks interconnected by network (IP) level relays
  497.    (gateways.)
  498.  
  499.    However, the standard assumes that this form of operation will be
  500.    less frequent than on the local MAC bridged-LAN.
  501.  
  502. 4.7.  MINIMIZE BROADCAST ACTIVITY
  503.  
  504.    The standard pre-supposes that the only broadcast services are those
  505.    supported by UDP.  Multicast capabilities are not assumed to be
  506.    available in any form.
  507.  
  508.    Despite the availability of broadcast capabilities, the standard
  509.    recognizes that some administrations may wish to avoid heavy
  510.    broadcast activity.  For example, an administration may wish to avoid
  511.    isolated non-participating hosts from the burden of receiving and
  512.    discarding NetBIOS broadcasts.
  513.  
  514. 4.8.  PERMIT IMPLEMENTATION ON EXISTING SYSTEMS
  515.  
  516.    The NetBIOS on TCP protocol should be implementable on common
  517.    operating systems, such as Unix(tm) and VAX/VMS(tm), without massive
  518.    effort.
  519.  
  520.    The NetBIOS protocols should not require services typically
  521.    unavailable on presently existing TCP/UDP/IP implementations.
  522.  
  523. 4.9.  REQUIRE ONLY THE MINIMUM NECESSARY TO OPERATE
  524.  
  525.    The protocol definition should specify only the minimal set of
  526.    protocols required for interoperation.  However, additional protocol
  527.    elements may be defined to enhance efficiency.  These latter elements
  528.    may be generated at the option of the sender, although they must be
  529.    accepted by all receivers.
  530.  
  531.  
  532.  
  533.  
  534.  
  535. NetBIOS Working Group                                           [Page 9]
  536.  
  537.  
  538. RFC 1001                                                      March 1987
  539.  
  540.  
  541. 4.10.  MAXIMIZE EFFICIENCY
  542.  
  543.    To be useful, a protocol must conduct its business quickly.
  544.  
  545. 4.11.  MINIMIZE NEW INVENTIONS
  546.  
  547.    When an existing protocol is not quite able to support a necessary
  548.    function, but with a small amount of change, it could, that protocol
  549.    should be used.  This is felt to be easier to achieve than
  550.    development of new protocols; further, it is likely to have more
  551.    general utility for the Internet.
  552.  
  553. 5.  OVERVIEW OF NetBIOS
  554.  
  555.    This section describes the NetBIOS services.  It is for background
  556.    information only.  The reader may chose to skip to the next section.
  557.  
  558.    NetBIOS was designed for use by groups of PCs, sharing a broadcast
  559.    medium.  Both connection (Session) and connectionless (Datagram)
  560.    services are provided, and broadcast and multicast are supported.
  561.    Participants are identified by name.  Assignment of names is
  562.    distributed and highly dynamic.
  563.  
  564.    NetBIOS applications employ NetBIOS mechanisms to locate resources,
  565.    establish connections, send and receive data with an application
  566.    peer, and terminate connections.  For purposes of discussion, these
  567.    mechanisms will collectively be called the NetBIOS Service.
  568.  
  569.    This service can be implemented in many different ways.  One of the
  570.    first implementations was for personal computers running the PC-DOS
  571.    and MS-DOS operating systems.  It is possible to implement NetBIOS
  572.    within other operating systems, or as processes which are,
  573.    themselves, simply application programs as far as the host operating
  574.    system is concerned.
  575.  
  576.    The NetBIOS specification, published by IBM as "Technical Reference
  577.    PC Network"[2] defines the interface and services available to the
  578.    NetBIOS user.  The protocols outlined by that document pertain only
  579.    to the IBM PC Network and are not generally applicable to other
  580.    networks.
  581.  
  582. 5.1.  INTERFACE TO APPLICATION PROGRAMS
  583.  
  584.    NetBIOS on personal computers includes both a set of services and an
  585.    exact program interface to those services.  NetBIOS on other computer
  586.    systems may present the NetBIOS services to programs using other
  587.    interfaces.  Except on personal computers, no clear standard for a
  588.    NetBIOS software interface has emerged.
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595. NetBIOS Working Group                                          [Page 10]
  596.  
  597.  
  598. RFC 1001                                                      March 1987
  599.  
  600.  
  601. 5.2.  NAME SERVICE
  602.  
  603.    NetBIOS resources are referenced by name.  Lower-level address
  604.    information is not available to NetBIOS applications.  An
  605.    application, representing a resource, registers one or more names
  606.    that it wishes to use.
  607.  
  608.    The name space is flat and uses sixteen alphanumeric characters.
  609.    Names may not start with an asterisk (*).
  610.  
  611.    Registration is a bid for use of a name.  The bid may be for
  612.    exclusive (unique) or shared (group) ownership.  Each application
  613.    contends with the other applications in real time.  Implicit
  614.    permission is granted to a station when it receives no objections.
  615.    That is, a bid is made and the application waits for a period of
  616.    time.  If no objections are received, the station assumes that it has
  617.    permission.
  618.  
  619.    A unique name should be held by only one station at a time.  However,
  620.    duplicates ("name conflicts") may arise due to errors.
  621.  
  622.    All instances of a group name are equivalent.
  623.  
  624.    An application referencing a name generally does not know (or care)
  625.    whether the name is registered as a unique or a group name.
  626.  
  627.    An explicit name deletion function is specified, so that applications
  628.    may remove a name.  Implicit name deletion occurs when a station
  629.    ceases operation.  In the case of personal computers, implicit name
  630.    deletion is a frequent occurrence.
  631.  
  632.    The Name Service primitives are:
  633.  
  634.       1)   Add Name
  635.  
  636.            The requesting application wants exclusive use of the name.
  637.  
  638.       2)   Add Group Name
  639.  
  640.            The requesting application is willing to share use of the
  641.            name with other applications.
  642.  
  643.       3)   Delete Name
  644.  
  645.            The application no longer requires use of the name.  It is
  646.            important to note that typical use of NetBIOS is among
  647.            independently-operated personal computers.  A common way to
  648.            stop using a PC is to turn it off; in this case, the
  649.            graceful give-back mechanism, provided by the Delete Name
  650.            function, is not used.  Because this occurs frequently, the
  651.            network service must support this behavior.
  652.  
  653.  
  654.  
  655. NetBIOS Working Group                                          [Page 11]
  656.  
  657.  
  658. RFC 1001                                                      March 1987
  659.  
  660.  
  661. 5.3.  SESSION SERVICE
  662.  
  663.    A session is a reliable message exchange, conducted between a pair of
  664.    NetBIOS applications.  Sessions are full-duplex, sequenced, and
  665.    reliable.  Data is organized into messages.  Each message may range
  666.    in size from 0 to 131,071 bytes.  No expedited or urgent data
  667.    capabilities are present.
  668.  
  669.    Multiple sessions may exist between any pair of calling and called
  670.    names.
  671.  
  672.    The parties to a connection have access to the calling and called
  673.    names.
  674.  
  675.    The NetBIOS specification does not define how a connection request to
  676.    a shared (group) name resolves into a session.  The usual assumption
  677.    is that a session may be established with any one owner of the called
  678.    group name.
  679.  
  680.    An important service provided to NetBIOS applications is the
  681.    detection of sessions failure.  The loss of a session is reported to
  682.    an application via all of the outstanding service requests for that
  683.    session.  For example, if the application has only a NetBIOS receive
  684.    primitive pending and the session terminates, the pending receive
  685.    will abort with a termination indication.
  686.  
  687.    Session Service primitives are:
  688.  
  689.       1)   Call
  690.  
  691.            Initiate a session with a process that is listening under
  692.            the specified name.  The calling entity must indicate both a
  693.            calling name (properly registered to the caller) and a
  694.            called name.
  695.  
  696.       2)   Listen
  697.  
  698.            Accept a session from a caller.  The listen primitive may be
  699.            constrained to accept an incoming call from a named caller.
  700.            Alternatively, a call may be accepted from any caller.
  701.  
  702.       3)   Hang Up
  703.  
  704.            Gracefully terminate a session.  All pending data is
  705.            transferred before the session is terminated.
  706.  
  707.       4)   Send
  708.  
  709.            Transmit one message.  A time-out can occur.  A time-out of
  710.            any session send forces the non-graceful termination of the
  711.            session.
  712.  
  713.  
  714.  
  715. NetBIOS Working Group                                          [Page 12]
  716.  
  717.  
  718. RFC 1001                                                      March 1987
  719.  
  720.  
  721.            A "chain send" primitive is required by the PC NetBIOS
  722.            software interface to allow a single message to be gathered
  723.            from pieces in various buffers.  Chain Send is an interface
  724.            detail and does not effect the protocol.
  725.  
  726.       5)   Receive
  727.  
  728.            Receive data.  A time-out can occur.  A time-out on a
  729.            session receive only terminates the receive, not the
  730.            session, although the data is lost.
  731.  
  732.            The receive primitive may be implemented with variants, such
  733.            as "Receive Any", which is required by the PC NetBIOS
  734.            software interface.  Receive Any is an interface detail and
  735.            does not effect the protocol.
  736.  
  737.       6)   Session Status
  738.  
  739.            Obtain information about all of the requestor's sessions,
  740.            under the specified name.  No network activity is involved.
  741.  
  742. 5.4.  DATAGRAM SERVICE
  743.  
  744.    The Datagram service is an unreliable, non-sequenced, connectionless
  745.    service.  Datagrams are sent under cover of a name properly
  746.    registered to the sender.
  747.  
  748.    Datagrams may be sent to a specific name or may be explicitly
  749.    broadcast.
  750.  
  751.    Datagrams sent to an exclusive name are received, if at all, by the
  752.    holder of that name.  Datagrams sent to a group name are multicast to
  753.    all holders of that name.  The sending application program cannot
  754.    distinguish between group and unique names and thus must act as if
  755.    all non-broadcast datagrams are multicast.
  756.  
  757.    As with the Session Service, the receiver of the datagram is told the
  758.    sending and receiving names.
  759.  
  760.    Datagram Service primitives are:
  761.  
  762.       1)   Send Datagram
  763.  
  764.            Send an unreliable datagram to an application that is
  765.            associated with the specified name.  The name may be unique
  766.            or group; the sender is not aware of the difference.  If the
  767.            name belongs to a group, then each member is to receive the
  768.            datagram.
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775. NetBIOS Working Group                                          [Page 13]
  776.  
  777.  
  778. RFC 1001                                                      March 1987
  779.  
  780.  
  781.       2)   Send Broadcast Datagram
  782.  
  783.            Send an unreliable datagram to any application with a
  784.            Receive Broadcast Datagram posted.
  785.  
  786.       3)   Receive Datagram
  787.  
  788.            Receive a datagram sent by a specified originating name to
  789.            the specified name.  If the originating name is an asterisk,
  790.            then the datagram may have been originated under any name.
  791.  
  792.            Note: An arriving datagram will be delivered to all pending
  793.            Receiving Datagrams that have source and destination
  794.            specifications matching those of the datagram.  In other
  795.            words, if a program (or group of programs) issue a series of
  796.            identical Receive Datagrams, one datagram will cause the
  797.            entire series to complete.
  798.  
  799.       4)   Receive Broadcast Datagram
  800.  
  801.            Receive a datagram sent as a broadcast.
  802.  
  803.            If there are multiple pending Receive Broadcast Datagram
  804.            operations pending, all will be satisfied by the same
  805.            received datagram.
  806.  
  807. 5.5.  MISCELLANEOUS FUNCTIONS
  808.  
  809.    The following functions are present to control the operation of the
  810.    hardware interface to the network.  These functions are generally
  811.    implementation dependent.
  812.  
  813.       1)   Reset
  814.  
  815.            Initialize the local network adapter.
  816.  
  817.       2)   Cancel
  818.  
  819.            Abort a pending NetBIOS request.  The successful cancel of a
  820.            Send (or Chain Send) operation will terminate the associated
  821.            session.
  822.  
  823.       3)   Adapter Status
  824.  
  825.            Obtain information about the local network adapter or of a
  826.            remote adapter.
  827.  
  828.       4)   Unlink
  829.  
  830.            For use with Remote Program Load (RPL).  Unlink redirects
  831.            the PC boot disk device back to the local disk.  See the
  832.  
  833.  
  834.  
  835. NetBIOS Working Group                                          [Page 14]
  836.  
  837.  
  838. RFC 1001                                                      March 1987
  839.  
  840.  
  841.            NetBIOS specification for further details concerning RPL and
  842.            the Unlink operation (see page 2-35 in [2]).
  843.  
  844.       5)   Remote Program Load
  845.  
  846.            Remote Program Load (RPL) is not a NetBIOS function.  It is
  847.            a NetBIOS application defined by IBM in their NetBIOS
  848.            specification (see pages 2-80 through 2-82 in [2]).
  849.  
  850. 5.6.  NON-STANDARD EXTENSIONS
  851.  
  852.    The IBM Token Ring implementation of NetBIOS has added at least one
  853.    new user capability:
  854.  
  855.       1)    Find Name
  856.  
  857.            This function determines whether a given name has been
  858.            registered on the network.
  859.  
  860. 6.  NetBIOS FACILITIES SUPPORTED BY THIS STANDARD
  861.  
  862.    The protocol specified by this standard permits an implementer to
  863.    provide all of the NetBIOS services as described in the IBM
  864.    "Technical Reference PC Network"[2].
  865.  
  866.    The following NetBIOS facilities are outside the scope of this
  867.    specification.  These are local implementation matters and do not
  868.    impact interoperability:
  869.  
  870.      -  RESET
  871.      -  SESSION STATUS
  872.      -  UNLINK
  873.      -  RPL (Remote Program Load)
  874.  
  875. 7.  REQUIRED SUPPORTING SERVICE INTERFACES AND DEFINITIONS
  876.  
  877.    The protocols described in this RFC require service interfaces to the
  878.    following:
  879.  
  880.      -  TCP[3,4]
  881.      -  UDP[5]
  882.  
  883.    Byte ordering, addressing conventions (including addresses to be
  884.    used for broadcasts and multicasts) are defined by the most
  885.    recent version of:
  886.  
  887.      -  Assigned Numbers[6]
  888.  
  889.  
  890.    Additional definitions and constraints are in:
  891.  
  892.  
  893.  
  894.  
  895. NetBIOS Working Group                                          [Page 15]
  896.  
  897.  
  898. RFC 1001                                                      March 1987
  899.  
  900.  
  901.      -  IP[7]
  902.      -  Internet Subnets[8,9,10]
  903.  
  904.  
  905. 8.  RELATED PROTOCOLS AND SERVICES
  906.  
  907.    The design of the protocols described in this RFC allow for the
  908.    future incorporation of the following protocols and services.
  909.    However, before this may occur, certain extensions may be required to
  910.    the protocols defined in this RFC or to those listed below.
  911.  
  912.      -  Domain Name Service[11,12,13,14]
  913.      -  Internet Group Multicast[15,16]
  914.  
  915. 9.  NetBIOS SCOPE
  916.  
  917.    A "NetBIOS Scope" is the population of computers across which a
  918.    registered NetBIOS name is known.  NetBIOS broadcast and multicast
  919.    datagram operations must reach the entire extent of the NetBIOS
  920.    scope.
  921.  
  922.    An internet may support multiple, non-intersecting NetBIOS Scopes.
  923.  
  924.    Each NetBIOS scope has a "scope identifier".  This identifier is a
  925.    character string meeting the requirements of the domain name system
  926.    for domain names.
  927.  
  928.    NOTE: Each implementation of NetBIOS-over-TCP must provide
  929.          mechanisms to manage the scope identifier(s) to be used.
  930.  
  931.    Control of scope identifiers implies a requirement for additional
  932.    NetBIOS interface capabilities.  These may be provided through
  933.    extensions of the user service interface or other means (such as node
  934.    configuration parameters.)  The nature of these extensions is not
  935.    part of this specification.
  936.  
  937. 10.  NetBIOS END-NODES
  938.  
  939.    End-nodes support NetBIOS service interfaces and contain
  940.    applications.
  941.  
  942.    Three types of end-nodes are part of this standard:
  943.  
  944.      -  Broadcast ("B") nodes
  945.      -  Point-to-point ("P") nodes
  946.      -  Mixed mode ("M") nodes
  947.  
  948.    An IP address may be associated with only one instance of one of the
  949.    above types.
  950.  
  951.    Without having preloaded name-to-address tables, NetBIOS participants
  952.  
  953.  
  954.  
  955. NetBIOS Working Group                                          [Page 16]
  956.  
  957.  
  958. RFC 1001                                                      March 1987
  959.  
  960.  
  961.    are faced with the task of dynamically resolving references to one
  962.    another.  This can be accomplished with broadcast or mediated point-
  963.    to-point communications.
  964.  
  965.    B nodes use local network broadcasting to effect a rendezvous with
  966.    one or more recipients.  P and M nodes use the NetBIOS Name Server
  967.    (NBNS) and the NetBIOS Datagram Distribution Server (NBDD) for this
  968.    same purpose.
  969.  
  970.    End-nodes may be combined in various topologies.  No matter how
  971.    combined, the operation of the B, P, and M nodes is not altered.
  972.  
  973.    NOTE: It is recommended that the administration of a NetBIOS
  974.          scope avoid using both M and B nodes within the same scope.
  975.          A NetBIOS scope should contain only B nodes or only P and M
  976.          nodes.
  977.  
  978. 10.1.  BROADCAST (B) NODES
  979.  
  980.    Broadcast (or "B") nodes communicate using a mix of UDP datagrams
  981.    (both broadcast and directed) and TCP connections.  B nodes may
  982.    freely interoperate with one another within a broadcast area.  A
  983.    broadcast area is a single MAC-bridged "B-LAN".  (See Appendix A for
  984.    a discussion of using Internet Group Multicasting as a means to
  985.    extend a broadcast area beyond a single B-LAN.)
  986.  
  987. 10.2.  POINT-TO-POINT (P) NODES
  988.  
  989.    Point-to-point (or "P") nodes communicate using only directed UDP
  990.    datagrams and TCP sessions.  P nodes neither generate nor listen for
  991.    broadcast UDP packets.  P nodes do, however, offer NetBIOS level
  992.    broadcast and multicast services using capabilities provided by the
  993.    NBNS and NBDD.
  994.  
  995.    P nodes rely on NetBIOS name and datagram distribution servers.
  996.    These servers may be local or remote; P nodes operate the same in
  997.    either case.
  998.  
  999. 10.3.  MIXED MODE (M) NODES
  1000.  
  1001.    Mixed mode nodes (or "M") nodes are P nodes which have been given
  1002.    certain B node characteristics.  M nodes use both broadcast and
  1003.    unicast.  Broadcast is used to improve response time using the
  1004.    assumption that most resources reside on the local broadcast medium
  1005.    rather than somewhere in an internet.
  1006.  
  1007.    M nodes rely upon NBNS and NBDD servers.  However, M nodes may
  1008.    continue limited operation should these servers be temporarily
  1009.    unavailable.
  1010.  
  1011.  
  1012.  
  1013.  
  1014.  
  1015. NetBIOS Working Group                                          [Page 17]
  1016.  
  1017.  
  1018. RFC 1001                                                      March 1987
  1019.  
  1020.  
  1021. 11.  NetBIOS SUPPORT SERVERS
  1022.  
  1023.    Two types of support servers are part of this standard:
  1024.  
  1025.      -  NetBIOS name server ("NBNS") nodes
  1026.      -  Netbios datagram distribution ("NBDD") nodes
  1027.  
  1028.    NBNS and NBDD nodes are invisible to NetBIOS applications and are
  1029.    part of the underlying NetBIOS mechanism.
  1030.  
  1031.    NetBIOS name and datagram distribution servers are the focus of name
  1032.    and datagram activity for P and M nodes.
  1033.  
  1034.    Both the name (NBNS) and datagram distribution (NBDD) servers are
  1035.    permitted to shift part of their operation to the P or M end-node
  1036.    which is requesting a service.
  1037.  
  1038.    Since the assignment of responsibility is dynamic, and since P and M
  1039.    nodes must be prepared to operate should the NetBIOS server delegate
  1040.    control to the maximum extent, the system naturally accommodates
  1041.    improvements in NetBIOS server function.  For example, as Internet
  1042.    Group Multicasting becomes more widespread, new NBDD implementations
  1043.    may elect to assume full responsibility for NetBIOS datagram
  1044.    distribution.
  1045.  
  1046.    Interoperability between different implementations is assured by
  1047.    imposing requirements on end-node implementations that they be able
  1048.    to accept the full range of legal responses from the NBNS or NBDD.
  1049.  
  1050. 11.1.  NetBIOS NAME SERVER (NBNS) NODES
  1051.  
  1052.    The NBNS is designed to allow considerable flexibility with its
  1053.    degree of responsibility for the accuracy and management of NetBIOS
  1054.    names.  On one hand, the NBNS may elect not to accept full
  1055.    responsibility, leaving the NBNS essentially a "bulletin board" on
  1056.    which name/address information is freely posted (and removed) by P
  1057.    and M nodes without validation by the NBNS.  Alternatively, the NBNS
  1058.    may elect to completely manage and validate names.  The degree of
  1059.    responsibility that the NBNS assumes is asserted by the NBNS each
  1060.    time a name is claimed through a simple mechanism.  Should the NBNS
  1061.    not assert full control, the NBNS returns enough information to the
  1062.    requesting node so that the node may challenge any putative holder of
  1063.    the name.
  1064.  
  1065.    This ability to shift responsibility for NetBIOS name management
  1066.    between the NBNS and the P and M nodes allows a network administrator
  1067.    (or vendor) to make a tradeoff between NBNS simplicity, security, and
  1068.    delay characteristics.
  1069.  
  1070.    A single NBNS may be implemented as a distributed entity, such as the
  1071.    Domain Name Service.  However, this RFC does not attempt to define
  1072.  
  1073.  
  1074.  
  1075. NetBIOS Working Group                                          [Page 18]
  1076.  
  1077.  
  1078. RFC 1001                                                      March 1987
  1079.  
  1080.  
  1081.    the internal communications which would be used.
  1082.  
  1083. 11.1.1.  RELATIONSHIP OF THE NBNS TO THE DOMAIN NAME SYSTEM
  1084.  
  1085.    The NBNS design attempts to align itself with the Domain Name System
  1086.    in a number of ways.
  1087.  
  1088.    First, the NetBIOS names are encoded in a form acceptable to the
  1089.    domain name system.
  1090.  
  1091.    Second, a scope identifier is appended to each NetBIOS name.  This
  1092.    identifier meets the restricted character set of the domain system
  1093.    and has a leading period.  This makes the NetBIOS name, in
  1094.    conjunction with its scope identifier, a valid domain system name.
  1095.  
  1096.    Third, the negotiated responsibility mechanisms permit the NBNS to be
  1097.    used as a simple bulletin board on which are posted (name,address)
  1098.    pairs.  This parallels the existing domain sytem query service.
  1099.  
  1100.    This RFC, however, requires the NBNS to provide services beyond those
  1101.    provided by the current domain name system.  An attempt has been made
  1102.    to coalesce all the additional services which are required into a set
  1103.    of transactions which follow domain name system styles of interaction
  1104.    and packet formats.
  1105.  
  1106.    Among the areas in which the domain name service must be extended
  1107.    before it may be used as an NBNS are:
  1108.  
  1109.      -  Dynamic addition of entries
  1110.      -  Dynamic update of entry data
  1111.      -  Support for multiple instance (group) entries
  1112.      -  Support for entry time-to-live values and ability to accept
  1113.         refresh messages to restart the time-to-live period
  1114.      -  New entry attributes
  1115.  
  1116. 11.2.  NetBIOS DATAGRAM DISTRIBUTION SERVER (NBDD) NODES
  1117.  
  1118.    The internet does not yet support broadcasting or multicasting.  The
  1119.    NBDD extends NetBIOS datagram distribution service to this
  1120.    environment.
  1121.  
  1122.    The NBDD may elect to complete, partially complete, or totally refuse
  1123.    to service a node's request to distribute a NetBIOS datagram.  An
  1124.    end-node may query an NBDD to determine whether the NBDD will deliver
  1125.    a datagram to a specific NetBIOS name.
  1126.  
  1127.    The design of NetBIOS-over-TCP lends itself to the use of Internet
  1128.    Group Multicast.  For details see Appendix A.
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135. NetBIOS Working Group                                          [Page 19]
  1136.  
  1137.  
  1138. RFC 1001                                                      March 1987
  1139.  
  1140.  
  1141. 11.3.  RELATIONSHIP OF NBNS AND NBDD NODES
  1142.  
  1143.    This RFC defines the NBNS and NBDD as distinct, separate entities.
  1144.  
  1145.    In the absence of NetBIOS name information, a NetBIOS datagram
  1146.    distribution server must send a copy to each end-node within a
  1147.    NetBIOS scope.
  1148.  
  1149.    An implementer may elect to construct NBNS and NBDD nodes which have
  1150.    a private protocol for the exchange of NetBIOS name information.
  1151.    Alternatively, an NBNS and NBDD may be implemented within the same
  1152.    device.
  1153.  
  1154.    NOTE: Implementations containing private NBNS-NBDD protocols or
  1155.          combined NBNS-NBDD functions must be clearly identified.
  1156.  
  1157. 11.4.  RELATIONSHIP OF NetBIOS SUPPORT SERVERS AND B NODES
  1158.  
  1159.    As defined in this RFC, neither NBNS nor NBDD nodes interact with B
  1160.    nodes.  NetBIOS servers do not listen to broadcast traffic on any
  1161.    broadcast area to which they may be attached.  Nor are the NetBIOS
  1162.    support servers even aware of B node activities or names claimed or
  1163.    used by B nodes.
  1164.  
  1165.    It may be possible to extend both the NBNS and NBDD so that they
  1166.    participate in B node activities and act as a bridge to P and M
  1167.    nodes.  However, such extensions are beyond the scope of this
  1168.    specification.
  1169.  
  1170. 12.  TOPOLOGIES
  1171.  
  1172.    B, P, M, NBNS, and NBDD nodes may be combined in various ways to form
  1173.    useful NetBIOS environments.  This section describes some of these
  1174.    combinations.
  1175.  
  1176.    There are three classes of operation:
  1177.  
  1178.      -  Class 0:  B nodes only.
  1179.      -  Class 1:  P nodes only.
  1180.      -  Class 2:  P and M nodes together.
  1181.  
  1182.    In the drawings which follow, any P node may be replaced by an M
  1183.    node.  The effects of such replacement will be mentioned in
  1184.    conjunction with each example below.
  1185.  
  1186. 12.1.  LOCAL
  1187.  
  1188.    A NetBIOS scope is operating locally when all entities are within the
  1189.    same broadcast area.
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195. NetBIOS Working Group                                          [Page 20]
  1196.  
  1197.  
  1198. RFC 1001                                                      March 1987
  1199.  
  1200.  
  1201. 12.1.1.  B NODES ONLY
  1202.  
  1203.    Local operation with only B nodes is the most basic mode of
  1204.    operation.  Name registration and discovery procedures use broadcast
  1205.    mechanisms.  The NetBIOS scope is limited by the extent of the
  1206.    broadcast area.  This configuration does not require NetBIOS support
  1207.    servers.
  1208.  
  1209.    ====+=========+=====BROADCAST AREA=====+==========+=========+====
  1210.        |         |                        |          |         |
  1211.        |         |                        |          |         |
  1212.     +--+--+   +--+--+                  +--+--+    +--+--+   +--+--+
  1213.     |  B  |   |  B  |                  |  B  |    |  B  |   |  B  |
  1214.     +-----+   +-----+                  +-----+    +-----+   +-----+
  1215.  
  1216. 12.1.2.  P NODES ONLY
  1217.  
  1218.    This configuration would typically be used when the network
  1219.    administrator desires to eliminate NetBIOS as a source of broadcast
  1220.    activity.
  1221.  
  1222.  
  1223.    ====+=========+==========+=B'CAST AREA=+==========+=========+====
  1224.        |         |          |             |          |         |
  1225.        |         |          |             |          |         |
  1226.     +--+--+   +--+--+    +--+--+       +--+--+    +--+--+   +--+--+
  1227.     |  P  |   |  P  |    |NBNS |       |  P  |    |NBDD |   |  P  |
  1228.     +-----+   +-----+    +-----+       +-----+    +-----+   +-----+
  1229.  
  1230.  
  1231.    This configuration operates the same as if it were in an internet and
  1232.    is cited here only due to its convenience as a means to reduce the
  1233.    use of broadcast.
  1234.  
  1235.    Replacement of one or more of the P nodes with M nodes will not
  1236.    affect the operation of the other P and M nodes.  P and M nodes will
  1237.    be able to interact with one another.  Because M nodes use broadcast,
  1238.    overall broadcast activity will increase.
  1239.  
  1240. 12.1.3.  MIXED B AND P NODES
  1241.  
  1242.    B and P nodes do not interact with one another.  Replacement of P
  1243.    nodes with M nodes will allow B's and M's to interact.
  1244.  
  1245.    NOTE: B nodes and M nodes may be intermixed only on a local
  1246.          broadcast area.  B and M nodes should not be intermixed in
  1247.          an internet environment.
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255. NetBIOS Working Group                                          [Page 21]
  1256.  
  1257.  
  1258. RFC 1001                                                      March 1987
  1259.  
  1260.  
  1261. 12.2.  INTERNET
  1262.  
  1263. 12.2.1.  P NODES ONLY
  1264.  
  1265.    P nodes may be scattered at various locations in an internetwork.
  1266.    They require both an NBNS and an NBDD for NetBIOS name and datagram
  1267.    support, respectively.
  1268.  
  1269.    The NetBIOS scope is determined by the NetBIOS scope identifier
  1270.    (domain name) used by the various P (and M) nodes.  An internet may
  1271.    contain numerous NetBIOS scopes.
  1272.  
  1273.                    +-----+
  1274.                    |  P  |
  1275.                    +--+--+              |    +-----+
  1276.                       |                 |----+  P  |
  1277.                       |                 |    +-----+
  1278.                 /-----+-----\           |
  1279.    +-----+      |           |  +------+ |    +-----+
  1280.    |  P  +------+  INTERNET +--+G'WAY |-+----+  P  |
  1281.    +-----+      |           |  +------+ |    +-----+
  1282.                 /-----+-----/           |
  1283.               /       |                 |    +-----+
  1284.             /         |                 |----+  P  |
  1285.      +-----+       +--+--+              |    +-----+
  1286.      |NBNS +       |NBDD |
  1287.      +-----+       +--+--+
  1288.  
  1289.    Any P node may be replaced by an M node with no loss of function to
  1290.    any node.  However, broadcast activity will be increased in the
  1291.    broadcast area to which the M node is attached.
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315. NetBIOS Working Group                                          [Page 22]
  1316.  
  1317.  
  1318. RFC 1001                                                      March 1987
  1319.  
  1320.  
  1321. 12.2.2.  MIXED M AND P NODES
  1322.  
  1323.    M and P nodes may be mixed.  When locating NetBIOS names, M nodes
  1324.    will tend to find names held by other M nodes on the same common
  1325.    broadcast area in preference to names held by P nodes or M nodes
  1326.    elsewhere in the network.
  1327.  
  1328.                          +-----+
  1329.                          |  P  |
  1330.                          +--+--+
  1331.                             |
  1332.                             |
  1333.                       /-----+-----\
  1334.          +-----+      |           |      +-----+
  1335.          |  P  +------+  INTERNET +------+NBDD |
  1336.          +-----+      |           |      +-----+
  1337.                       /-----+-----/
  1338.                     /       |
  1339.                   /         |
  1340.            +-----+       +--+--+
  1341.            |NBNS +       |G'WAY|
  1342.            +-----+       +--+--+
  1343.                             |
  1344.                             |
  1345.    ====+=========+==========+=B'CAST AREA=+==========+=========+====
  1346.        |         |          |             |          |         |
  1347.        |         |          |             |          |         |
  1348.     +--+--+   +--+--+    +--+--+       +--+--+    +--+--+   +--+--+
  1349.     |  M  |   |  P  |    |  M  |       |  P  |    |  M  |   |  P  |
  1350.     +-----+   +-----+    +--+--+       +-----+    +-----+   +-----+
  1351.  
  1352.  
  1353.    NOTE: B and M nodes should not be intermixed in an internet
  1354.          environment.  Doing so would allow undetected NetBIOS name
  1355.          conflicts to arise and cause unpredictable behavior.
  1356.  
  1357. 13.  GENERAL METHODS
  1358.  
  1359.    Overlying the specific protocols, described later, are a few general
  1360.    methods of interaction between entities.
  1361.  
  1362. 13.1.  REQUEST/RESPONSE INTERACTION STYLE
  1363.  
  1364.    Most interactions between entities consist of a request flowing in
  1365.    one direction and a subsequent response flowing in the opposite
  1366.    direction.
  1367.  
  1368.    In those situations where interactions occur on unreliable transports
  1369.    (i.e. UDP) or when a request is broadcast, there may not be a strict
  1370.    interlocking or one-to-one relationship between requests and
  1371.    responses.
  1372.  
  1373.  
  1374.  
  1375. NetBIOS Working Group                                          [Page 23]
  1376.  
  1377.  
  1378. RFC 1001                                                      March 1987
  1379.  
  1380.  
  1381.    In no case, however, is more than one response generated for a
  1382.    received request.  While a response is pending the responding entity
  1383.    may send one or more wait acknowledgements.
  1384.  
  1385. 13.1.1.  RETRANSMISSION OF REQUESTS
  1386.  
  1387.    UDP is an unreliable delivery mechanism where packets can be lost,
  1388.    received out of transmit sequence, duplicated and delivery can be
  1389.    significantly delayed.  Since the NetBIOS protocols make heavy use of
  1390.    UDP, they have compensated for its unreliability with extra
  1391.    mechanisms.
  1392.  
  1393.    Each NetBIOS packet contains all the necessary information to process
  1394.    it.  None of the protocols use multiple UDP packets to convey a
  1395.    single request or response.  If more information is required than
  1396.    will fit in a single UDP packet, for example, when a P-type node
  1397.    wants all the owners of a group name from a NetBIOS server, a TCP
  1398.    connection is used.  Consequently, the NetBIOS protocols will not
  1399.    fail because of out of sequence delivery of UDP packets.
  1400.  
  1401.    To overcome the loss of a request or response packet, each request
  1402.    operation will retransmit the request if a response is not received
  1403.    within a specified time limit.
  1404.  
  1405.    Protocol operations sensitive to successive response packets, such as
  1406.    name conflict detection, are protected from duplicated packets
  1407.    because they ignore successive packets with the same NetBIOS
  1408.    information.  Since no state on the responder's node is associated
  1409.    with a request, the responder just sends the appropriate response
  1410.    whenever a request packet arrives.  Consequently, duplicate or
  1411.    delayed request packets have no impact.
  1412.  
  1413.    For all requests, if a response packet is delayed too long another
  1414.    request packet will be transmitted.  A second response packet being
  1415.    sent in response to the second request packet is equivalent to a
  1416.    duplicate packet.  Therefore, the protocols will ignore the second
  1417.    packet received.  If the delivery of a response is delayed until
  1418.    after the request operation has been completed, successfully or not,
  1419.    the response packet is ignored.
  1420.  
  1421. 13.1.2.  REQUESTS WITHOUT RESPONSES: DEMANDS
  1422.  
  1423.    Some request types do not have matching responses.  These requests
  1424.    are known as "demands".  In general a "demand" is an imperative
  1425.    request; the receiving node is expected to obey.  However, because
  1426.    demands are unconfirmed, they are used only in situations where, at
  1427.    most, limited damage would occur if the demand packet should be lost.
  1428.  
  1429.    Demand packets are not retransmitted.
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435. NetBIOS Working Group                                          [Page 24]
  1436.  
  1437.  
  1438. RFC 1001                                                      March 1987
  1439.  
  1440.  
  1441. 13.2.  TRANSACTIONS
  1442.  
  1443.    Interactions between a pair of entities are grouped into
  1444.    "transactions".  These transactions comprise one or more
  1445.    request/response pairs.
  1446.  
  1447. 13.2.1.  TRANSACTION ID
  1448.  
  1449.    Since multiple simultaneous transactions may be in progress between a
  1450.    pair of entities a "transaction id" is used.
  1451.  
  1452.    The originator of a transaction selects an ID unique to the
  1453.    originator.  The transaction id is reflected back and forth in each
  1454.    interaction within the transaction.  The transaction partners must
  1455.    match responses and requests by comparison of the transaction ID and
  1456.    the IP address of the transaction partner.  If no matching request
  1457.    can be found the response must be discarded.
  1458.  
  1459.    A new transaction ID should be used for each transaction.  A simple
  1460.    16 bit transaction counter ought to be an adequate id generator.  It
  1461.    is probably not necessary to search the space of outstanding
  1462.    transaction ID to filter duplicates: it is extremely unlikely that
  1463.    any transaction will have a lifetime that is more than a small
  1464.    fraction of the typical counter cycle period.  Use of the IP
  1465.    addresses in conjunction with the transaction ID further reduces the
  1466.    possibility of damage should transaction IDs be prematurely re-used.
  1467.  
  1468. 13.3.  TCP AND UDP FOUNDATIONS
  1469.  
  1470.    This version of the NetBIOS-over-TCP protocols uses UDP for many
  1471.    interactions.  In the future this RFC may be extended to permit such
  1472.    interactions to occur over TCP connections (perhaps to increase
  1473.    efficiency when multiple interactions occur within a short time or
  1474.    when NetBIOS datagram traffic reveals that an application is using
  1475.    NetBIOS datagrams to support connection- oriented service.)
  1476.  
  1477. 14.  REPRESENTATION OF NETBIOS NAMES
  1478.  
  1479.    NetBIOS names as seen across the client interface to NetBIOS are
  1480.    exactly 16 bytes long.  Within the NetBIOS-over-TCP protocols, a
  1481.    longer representation is used.
  1482.  
  1483.    There are two levels of encoding.  The first level maps a NetBIOS
  1484.    name into a domain system name.  The second level maps the domain
  1485.    system name into the "compressed" representation required for
  1486.    interaction with the domain name system.
  1487.  
  1488.    Except in one packet, the second level representation is the only
  1489.    NetBIOS name representation used in NetBIOS-over-TCP packet formats.
  1490.    The exception is the RDATA field of a NODE STATUS RESPONSE packet.
  1491.  
  1492.  
  1493.  
  1494.  
  1495. NetBIOS Working Group                                          [Page 25]
  1496.  
  1497.  
  1498. RFC 1001                                                      March 1987
  1499.  
  1500.  
  1501. 14.1.  FIRST LEVEL ENCODING
  1502.  
  1503.    The first level representation consists of two parts:
  1504.  
  1505.      -  NetBIOS name
  1506.      -  NetBIOS scope identifier
  1507.  
  1508.    The 16 byte NetBIOS name is mapped into a 32 byte wide field using a
  1509.    reversible, half-ASCII, biased encoding.  Each half-octet of the
  1510.    NetBIOS name is encoded into one byte of the 32 byte field.  The
  1511.    first half octet is encoded into the first byte, the second half-
  1512.    octet into the second byte, etc.
  1513.  
  1514.    Each 4-bit, half-octet of the NetBIOS name is treated as an 8-bit,
  1515.    right-adjusted, zero-filled binary number.  This number is added to
  1516.    value of the ASCII character 'A' (hexidecimal 41).  The resulting 8-
  1517.    bit number is stored in the appropriate byte.  The following diagram
  1518.    demonstrates this procedure:
  1519.  
  1520.  
  1521.                          0 1 2 3 4 5 6 7
  1522.                         +-+-+-+-+-+-+-+-+
  1523.                         |a b c d|w x y z|          ORIGINAL BYTE
  1524.                         +-+-+-+-+-+-+-+-+
  1525.                             |       |
  1526.                    +--------+       +--------+
  1527.                    |                         |     SPLIT THE NIBBLES
  1528.                    v                         v
  1529.             0 1 2 3 4 5 6 7           0 1 2 3 4 5 6 7
  1530.            +-+-+-+-+-+-+-+-+         +-+-+-+-+-+-+-+-+
  1531.            |0 0 0 0 a b c d|         |0 0 0 0 w x y z|
  1532.            +-+-+-+-+-+-+-+-+         +-+-+-+-+-+-+-+-+
  1533.                    |                         |
  1534.                    +                         +     ADD 'A'
  1535.                    |                         |
  1536.             0 1 2 3 4 5 6 7           0 1 2 3 4 5 6 7
  1537.            +-+-+-+-+-+-+-+-+         +-+-+-+-+-+-+-+-+
  1538.            |0 1 0 0 0 0 0 1|         |0 1 0 0 0 0 0 1|
  1539.            +-+-+-+-+-+-+-+-+         +-+-+-+-+-+-+-+-+
  1540.  
  1541.    This encoding results in a NetBIOS name being represented as a
  1542.    sequence of 32 ASCII, upper-case characters from the set
  1543.    {A,B,C...N,O,P}.
  1544.  
  1545.    The NetBIOS scope identifier is a valid domain name (without a
  1546.    leading dot).
  1547.  
  1548.    An ASCII dot (2E hexidecimal) and the scope identifier are appended
  1549.    to the encoded form of the NetBIOS name, the result forming a valid
  1550.    domain name.
  1551.  
  1552.  
  1553.  
  1554.  
  1555. NetBIOS Working Group                                          [Page 26]
  1556.  
  1557.  
  1558. RFC 1001                                                      March 1987
  1559.  
  1560.  
  1561.    For example, the NetBIOS name "The NetBIOS name" in the NetBIOS scope
  1562.    "SCOPE.ID.COM" would be represented at level one by the ASCII
  1563.    character string:
  1564.  
  1565.         FEGHGFCAEOGFHEECEJEPFDCAHEGBGNGF.SCOPE.ID.COM
  1566.  
  1567. 14.2.  SECOND LEVEL ENCODING
  1568.  
  1569.    The first level encoding must be reduced to second level encoding.
  1570.    This is performed according to the rules defined in on page 31 of RFC
  1571.    883[12] in the section on "Domain name representation and
  1572.    compression".  Also see the section titled "Name Formats" in the
  1573.    Detailed Specifications[1].
  1574.  
  1575. 15.  NetBIOS NAME SERVICE
  1576.  
  1577.    Before a name may be used, the name must be registered by a node.
  1578.    Once acquired, the name must be defended against inconsistent
  1579.    registration by other nodes.  Before building a NetBIOS session or
  1580.    sending a NetBIOS datagram, the one or more holders of the name must
  1581.    be located.
  1582.  
  1583.    The NetBIOS name service is the collection of procedures through
  1584.    which nodes acquire, defend, and locate the holders of NetBIOS names.
  1585.  
  1586.    The name service procedures are different depending whether the end-
  1587.    node is of type B, P, or M.
  1588.  
  1589. 15.1.  OVERVIEW OF NetBIOS NAME SERVICE
  1590.  
  1591. 15.1.1.  NAME REGISTRATION (CLAIM)
  1592.  
  1593.    Each NetBIOS node can own more than one name.  Names are acquired
  1594.    dynamically through the registration (name claim) procedures.
  1595.  
  1596.    Every node has a permanent unique name.  This name, like any other
  1597.    name, must be explicitly registered by all end-node types.
  1598.  
  1599.    A name can be unique (exclusive) or group (non-exclusive).  A unique
  1600.    name may be owned by a single node; a group name may be owned by any
  1601.    number of nodes.  A name ceases to exist when it is not owned by at
  1602.    least one node.  There is no intrinsic quality of a name which
  1603.    determines its characteristics: these are established at the time of
  1604.    registration.
  1605.  
  1606.    Each node maintains state information for each name it has
  1607.    registered.  This information includes:
  1608.  
  1609.      -  Whether the name is a group or unique name
  1610.      -  Whether the name is "in conflict"
  1611.      -  Whether the name is in the process of being deleted
  1612.  
  1613.  
  1614.  
  1615. NetBIOS Working Group                                          [Page 27]
  1616.  
  1617.  
  1618. RFC 1001                                                      March 1987
  1619.  
  1620.  
  1621.    B nodes perform name registration by broadcasting claim requests,
  1622.    soliciting a defense from any node already holding the name.
  1623.  
  1624.    P nodes perform name registration through the agency of the NBNS.
  1625.  
  1626.    M nodes register names through an initial broadcast, like B nodes,
  1627.    then, in the absence of an objection, by following the same
  1628.    procedures as a P node.  In other words, the broadcast action may
  1629.    terminate the attempt, but is not sufficient to confirm the
  1630.    registration.
  1631.  
  1632. 15.1.2.  NAME QUERY (DISCOVERY)
  1633.  
  1634.    Name query (also known as "resolution" or "discovery") is the
  1635.    procedure by which the IP address(es) associated with a NetBIOS name
  1636.    are discovered.  Name query is required during the following
  1637.    operations:
  1638.  
  1639.    During session establishment, calling and called names must be
  1640.    specified.  The calling name must exist on the node that posts the
  1641.    CALL.  The called name must exist on a node that has previously
  1642.    posted a LISTEN.  Either name may be a unique or group name.
  1643.  
  1644.    When a directed datagram is sent, a source and destination name must
  1645.    be specified.  If the destination name is a group name, a datagram is
  1646.    sent to all the members of that group.
  1647.  
  1648.    Different end-node types perform name resolution using different
  1649.    techniques, but using the same packet formats:
  1650.  
  1651.      -  B nodes solicit name information by broadcasting a request.
  1652.  
  1653.      -  P nodes ask the NBNS.
  1654.  
  1655.      -  M nodes broadcast a request.  If that does not provide the
  1656.         desired information, an inquiry is sent to the NBNS.
  1657.  
  1658. 15.1.3.  NAME RELEASE
  1659.  
  1660.    NetBIOS names may be released explicitly or silently by an end- node.
  1661.    Silent release typically occurs when an end-node fails or is turned-
  1662.    off.  Most of the mechanisms described below are present to detect
  1663.    silent name release.
  1664.  
  1665. 15.1.3.1.  EXPLICIT RELEASE
  1666.  
  1667.    B nodes explicitly release a name by broadcasting a notice.
  1668.  
  1669.    P nodes send a notification to their NBNS.
  1670.  
  1671.    M nodes both broadcast a notice and inform their supporting NBNS.
  1672.  
  1673.  
  1674.  
  1675. NetBIOS Working Group                                          [Page 28]
  1676.  
  1677.  
  1678. RFC 1001                                                      March 1987
  1679.  
  1680.  
  1681. 15.1.3.2.  NAME LIFETIME AND REFRESH
  1682.  
  1683.    Names held by an NBNS are given a lifetime during name registration.
  1684.    The NBNS will consider a name to have been silently released if the
  1685.    end-node fails to send a name refresh message to the NBNS before the
  1686.    lifetime expires.  A refresh restarts the lifetime clock.
  1687.  
  1688.    NOTE: The implementor should be aware of the tradeoff between
  1689.          accuracy of the database and the internet overhead that the
  1690.          refresh mechanism introduces.  The lifetime period should
  1691.          be tuned accordingly.
  1692.  
  1693.  
  1694.    For group names, each end-node must send refresh messages.  A node
  1695.    that fails to do so will be considered to have silently released the
  1696.    name and dropped from the group.
  1697.  
  1698.    The lifetime period is established through a simple negotiation
  1699.    mechanism during name registration:  In the name registration
  1700.    request, the end-node proposes a lifetime value or requests an
  1701.    infinite lifetime.  The NBNS places an actual lifetime value into the
  1702.    name registration response.  The NBNS is always allowed to respond
  1703.    with an infinite actual period.  If the end node proposed an infinite
  1704.    lifetime, the NBNS may respond with any definite period.  If the end
  1705.    node proposed a definite period, the NBNS may respond with any
  1706.    definite period greater than or equal to that proposed.
  1707.  
  1708.    This negotiation of refresh times gives the NBNS means to disable or
  1709.    enable refresh activity.  The end-nodes may set a minimum refresh
  1710.    cycle period.
  1711.  
  1712.    NBNS implementations which are completely reliable may disable
  1713.    refresh.
  1714.  
  1715. 15.1.3.3.  NAME CHALLENGE
  1716.  
  1717.    To detect whether a node has silently released its claim to a name,
  1718.    it is necessary on occasion to challenge that node's current
  1719.    ownership.  If the node defends the name then the node is allowed to
  1720.    continue possession.  Otherwise it is assumed that the node has
  1721.    released the name.
  1722.  
  1723.    A name challenge may be issued by an NBNS or by a P or M node.  A
  1724.    challenge may be directed towards any end-node type: B, P, or M.
  1725.  
  1726. 15.1.3.4.  GROUP NAME FADE-OUT
  1727.  
  1728.    NetBIOS groups may contain an arbitrarily large number of members.
  1729.    The time to challenge all members could be quite large.
  1730.  
  1731.    To avoid long delays when names are claimed through an NBNS, an
  1732.  
  1733.  
  1734.  
  1735. NetBIOS Working Group                                          [Page 29]
  1736.  
  1737.  
  1738. RFC 1001                                                      March 1987
  1739.  
  1740.  
  1741.    optimistic heuristic has been adopted.  It is assumed that there will
  1742.    always be some node which will defend a group name.  Consequently, it
  1743.    is recommended that the NBNS will immediately reject a claim request
  1744.    for a unique name when there already exists a group with the same
  1745.    name.  The NBNS will never return an IP address (in response to a
  1746.    NAME REGISTRATION REQUEST) when a group name exists.
  1747.  
  1748.    An NBNS will consider a group to have faded out of existence when the
  1749.    last remaining member fails to send a timely refresh message or
  1750.    explicitly releases the name.
  1751.  
  1752. 15.1.3.5.  NAME CONFLICT
  1753.  
  1754.    Name conflict exists when a unique name has been claimed by more than
  1755.    one node on a NetBIOS network.  B, M, and NBNS nodes may detect a
  1756.    name conflict.  The detection mechanism used by B and M nodes is
  1757.    active only during name discovery.  The NBNS may detect conflict at
  1758.    any time it verifies the consistency of its name database.
  1759.  
  1760.    B and M nodes detect conflict by examining the responses received in
  1761.    answer to a broadcast name query request.  The first response is
  1762.    taken as authoritative.  Any subsequent, inconsistent responses
  1763.    represent conflicts.
  1764.  
  1765.    Subsequent responses are inconsistent with the authoritative response
  1766.    when:
  1767.  
  1768.         The subsequent response has the same transaction ID as the
  1769.         NAME QUERY REQUEST.
  1770.      AND
  1771.         The subsequent response is not a duplicate of the
  1772.         authoritative response.
  1773.      AND EITHER:
  1774.              The group/unique characteristic of the authoritative
  1775.              response is "unique".
  1776.           OR
  1777.              The group/unique characteristic of the subsequent
  1778.              response is "unique".
  1779.  
  1780.    The period in which B and M nodes examine responses is limited by a
  1781.    conflict timer, CONFLICT_TIMER.  The accuracy or duration of this
  1782.    timer is not crucial: the NetBIOS system will continue to operate
  1783.    even with persistent name conflicts.
  1784.  
  1785.    Conflict conditions are signaled by sending a NAME CONFLICT DEMAND to
  1786.    the node owning the offending name.  Nothing is sent to the node
  1787.    which originated the authoritative response.
  1788.  
  1789.    Any end-node that receives NAME CONFLICT DEMAND is required to update
  1790.    its "local name table" to reflect that the name is in conflict.  (The
  1791.    "local name table" on each node contains names that have been
  1792.  
  1793.  
  1794.  
  1795. NetBIOS Working Group                                          [Page 30]
  1796.  
  1797.  
  1798. RFC 1001                                                      March 1987
  1799.  
  1800.  
  1801.    successfully registered by that node.)
  1802.  
  1803.    Notice that only those nodes that receive the name conflict message
  1804.    place a conflict mark next to a name.
  1805.  
  1806.    Logically, a marked name does not exist on that node.  This means
  1807.    that the node should not defend the name (for name claim purposes),
  1808.    should not respond to a name discovery requests for that name, nor
  1809.    should the node send name refresh messages for that name.
  1810.    Furthermore, it can no longer be used by that node for any session
  1811.    establishment or sending or receiving datagrams.  Existing sessions
  1812.    are not affected at the time a name is marked as being in conflict.
  1813.  
  1814.    The only valid user function against a marked name is DELETE NAME.
  1815.    Any other user NetBIOS function returns immediately with an error
  1816.    code of "NAME CONFLICT".
  1817.  
  1818. 15.1.4.  ADAPTER STATUS
  1819.  
  1820.    An end-node or the NBNS may ask any other end-node for a collection
  1821.    of information about the NetBIOS status of that node.  This status
  1822.    consists of, among other things, a list of the names which the node
  1823.    believes it owns.  The returned status is filtered to contain only
  1824.    those names which have the same NetBIOS scope identifier as the
  1825.    requestor's name.
  1826.  
  1827.    When requesting node status, the requestor identifies the target node
  1828.    by NetBIOS name  A name query transaction may be necessary to acquire
  1829.    the IP address for the name.  Locally cached name information may be
  1830.    used in lieu of a query transaction.  The requesting node sends a
  1831.    NODE STATUS REQUEST.  In response, the receiving node sends a NODE
  1832.    STATUS RESPONSE containing its local name table and various
  1833.    statistics.
  1834.  
  1835.    The amount of status which may be returned is limited by the size of
  1836.    a UDP packet.  However, this is sufficient for the typical NODE
  1837.    STATUS RESPONSE packet.
  1838.  
  1839. 15.1.5.  END-NODE NBNS INTERACTION
  1840.  
  1841.    There are certain characteristics of end-node to NBNS interactions
  1842.    which are in common and are independent of any particular transaction
  1843.    type.
  1844.  
  1845. 15.1.5.1.  UDP, TCP, AND TRUNCATION
  1846.  
  1847.    For all transactions between an end-node and an NBNS, either UDP or
  1848.    TCP may be used as a transport.  If the NBNS receives a UDP based
  1849.    request, it will respond using UDP.  If the amount of information
  1850.    exceeds what fits into a UDP packet, the response will contain a
  1851.    "truncation flag".  In this situation, the end- node may open a TCP
  1852.  
  1853.  
  1854.  
  1855. NetBIOS Working Group                                          [Page 31]
  1856.  
  1857.  
  1858. RFC 1001                                                      March 1987
  1859.  
  1860.  
  1861.    connection to the NBNS, repeat the request, and receive a complete,
  1862.    untruncated response.
  1863.  
  1864. 15.1.5.2.  NBNS WACK
  1865.  
  1866.    While a name service request is in progress, the NBNS may issue a
  1867.    WAIT FOR ACKNOWLEDGEMENT RESPONSE (WACK) to assure the client end-
  1868.    node that the NBNS is still operational and is working on the
  1869.    request.
  1870.  
  1871. 15.1.5.3.  NBNS REDIRECTION
  1872.  
  1873.    The NBNS, because it follows Domain Name system styles of
  1874.    interaction, is permitted to redirect a client to another NBNS.
  1875.  
  1876. 15.1.6.  SECURED VERSUS NON-SECURED NBNS
  1877.  
  1878.    An NBNS may be implemented in either of two general ways:  The NBNS
  1879.    may monitor, and participate in, name activity to ensure consistency.
  1880.    This would be a "secured" style NBNS.  Alternatively, an NBNS may be
  1881.    implemented to be essentially a "bulletin board" on which name
  1882.    information is posted and responsibility for consistency is delegated
  1883.    to the end-nodes.  This would be a "non-secured" style NBNS.
  1884.  
  1885. 15.1.7.  CONSISTENCY OF THE NBNS DATA BASE
  1886.  
  1887.    Even in a properly running NetBIOS scope the NBNS and its community
  1888.    of end-nodes may occasionally lose synchronization with respect to
  1889.    the true state of name registrations.
  1890.  
  1891.    This may occur should the NBNS fail and lose all or part of its
  1892.    database.
  1893.  
  1894.    More commonly, a P or M node may be turned-off (thus forgetting the
  1895.    names it has registered) and then be subsequently turned back on.
  1896.  
  1897.    Finally, errors may occur or an implementation may be incorrect.
  1898.  
  1899.    Various approaches have been incorporated into the NetBIOS-over- TCP
  1900.    protocols to minimize the impact of these problems.
  1901.  
  1902.       1.   The NBNS (or any other node) may "challenge" (using a NAME
  1903.            QUERY REQUEST) an end-node to verify that it actually owns a
  1904.            name.
  1905.  
  1906.            Such a challenge may occur at any time.  Every end-node must
  1907.            be prepared to make a timely response.
  1908.  
  1909.            Failure to respond causes the NBNS to consider that the
  1910.            end-node has released the name in question.
  1911.  
  1912.  
  1913.  
  1914.  
  1915. NetBIOS Working Group                                          [Page 32]
  1916.  
  1917.  
  1918. RFC 1001                                                      March 1987
  1919.  
  1920.  
  1921.            (If UDP is being used as the underlying transport, the
  1922.            challenge, like all other requests, must be retransmitted
  1923.            some number of times in the absence of a response.)
  1924.  
  1925.       2.   The NBNS (or any other node) may request (using the NODE
  1926.            STATUS REQUEST) that an end-node deliver its entire name
  1927.            table.
  1928.  
  1929.            This may occur at any time.  Every end-node must be prepared
  1930.            to make a timely response.
  1931.  
  1932.            Failure to respond permits (but does not require) the NBNS
  1933.            to consider that the end-node has failed and released all
  1934.            names to which it had claims.  (Like the challenge, on a UDP
  1935.            transport, the request must be retransmitted in the absence
  1936.            of a response.)
  1937.  
  1938.       3.   The NBNS may revoke a P or M node's use of a name by sending
  1939.            either a NAME CONFLICT DEMAND or a NAME RELEASE REQUEST to
  1940.            the node.
  1941.  
  1942.            The receiving end-node may continue existing sessions which
  1943.            use that name, but must otherwise cease using that name.  If
  1944.            the NBNS placed the name in conflict, the name may be re-
  1945.            acquired only by deletion and subsequent reclamation.  If
  1946.            the NBNS requested that the name be released, the node may
  1947.            attempt to re-acquire the name without first performing a
  1948.            name release transaction.
  1949.  
  1950.       4.   The NBNS may impose a "time-to-live" on each name it
  1951.            registers.  The registering node is made aware of this time
  1952.            value during the name registration procedure.
  1953.  
  1954.            Simple or reliable NBNS's may impose an infinite time-to-
  1955.            live.
  1956.  
  1957.       5.   If an end-node holds any names that have finite time-to-
  1958.            live values, then that node must periodically send a status
  1959.            report to the NBNS.  Each name is reported using the NAME
  1960.            REFRESH REQUEST packet.
  1961.  
  1962.            These status reports restart the timers of both the NBNS and
  1963.            the reporting node.  However, the only timers which are
  1964.            restarted are those associated with the name found in the
  1965.            status report.  Timers on other names are not affected.
  1966.  
  1967.            The NBNS may consider that a node has released any name
  1968.            which has not been refreshed within some multiple of name's
  1969.            time-to-live.
  1970.  
  1971.            A well-behaved NBNS, would, however, issue a challenge to-,
  1972.  
  1973.  
  1974.  
  1975. NetBIOS Working Group                                          [Page 33]
  1976.  
  1977.  
  1978. RFC 1001                                                      March 1987
  1979.  
  1980.  
  1981.            or request a list of names from-, the non-reporting end-
  1982.            node before deleting its name(s).  The absence of a
  1983.            response, or of the name in a response, will confirm the
  1984.            NBNS decision to delete a name.
  1985.  
  1986.       6.   The absence of reports may cause the NBNS to infer that the
  1987.            end-node has failed.  Similarly, receipt of information
  1988.            widely divergent from what the NBNS believes about the node,
  1989.            may cause the NBNS to consider that the end-node has been
  1990.            restarted.
  1991.  
  1992.            The NBNS may analyze the situation through challenges or
  1993.            requests for a list of names.
  1994.  
  1995.       7.   A very cautious NBNS is free to poll nodes (by sending NAME
  1996.            QUERY REQUEST or NODE STATUS REQUEST packets) to verify that
  1997.            their name status is the same as that registered in the
  1998.            NBNS.
  1999.  
  2000.            NOTE:  Such polling activity, if used at all by an
  2001.            implementation, should be kept at a very low level or
  2002.            enabled only during periods when the NBNS has some reason to
  2003.            suspect that its information base is inaccurate.
  2004.  
  2005.       8.   P and M nodes can detect incorrect name information at
  2006.            session establishment.
  2007.  
  2008.            If incorrect information is found, NBNS is informed via a
  2009.            NAME RELEASE REQUEST originated by the end-node which
  2010.            detects the error.
  2011.  
  2012. 15.1.8.  NAME CACHING
  2013.  
  2014.    An end-node may keep a local cache of NetBIOS name-to-IP address
  2015.    translation entries.
  2016.  
  2017.    All cache entries should be flushed on a periodic basis.
  2018.  
  2019.    In addition, a node ought to flush any cache information associated
  2020.    with an IP address if the node receives any information indicating
  2021.    that there may be any possibility of trouble with the node at that IP
  2022.    address.  For example, if a NAME CONFLICT DEMAND is sent to a node,
  2023.    all cached information about that node should be cleared within the
  2024.    sending node.
  2025.  
  2026. 15.2.  NAME REGISTRATION TRANSACTIONS
  2027.  
  2028. 15.2.1.  NAME REGISTRATION BY B NODES
  2029.  
  2030.    A name claim transaction initiated by a B node is broadcast
  2031.    throughout the broadcast area.  The NAME REGISTRATION REQUEST will be
  2032.  
  2033.  
  2034.  
  2035. NetBIOS Working Group                                          [Page 34]
  2036.  
  2037.  
  2038. RFC 1001                                                      March 1987
  2039.  
  2040.  
  2041.    heard by all B and M nodes in the area.  Each node examines the claim
  2042.    to see whether it it is consistent with the names it owns.  If an
  2043.    inconsistency exists, a NEGATIVE NAME REGISTRATION RESPONSE is
  2044.    unicast to the requestor.  The requesting node obtains ownership of
  2045.    the name (or membership in the group) if, and only if, no NEGATIVE
  2046.    NAME REGISTRATION RESPONSEs are received within the name claim
  2047.    timeout, CONFLICT_TIMER.  (See "Defined Constants and Variables" in
  2048.    the Detailed Specification for the value of this timer.)
  2049.  
  2050.    A B node proclaims its new ownership by broadcasting a NAME OVERWRITE
  2051.    DEMAND.
  2052.  
  2053.                        B-NODE REGISTRATION PROCESS
  2054.    <-----NAME NOT ON NETWORK------>   <----NAME ALREADY EXISTS---->
  2055.  
  2056.    REQ. NODE                      NODE                     REQ.NODE
  2057.                                  HOLDING
  2058.                                   NAME
  2059.  
  2060.    (BROADCAST) REGISTER                        (BROADCAST) REGISTER
  2061.    ------------------->                        <-------------------
  2062.  
  2063.         REGISTER                                     REGISTER
  2064.    ------------------->                        <-------------------
  2065.  
  2066.         REGISTER                         NEGATIVE RESPONSE
  2067.    ------------------->             ------------------------------>
  2068.  
  2069.           OVERWRITE
  2070.    ------------------->               (NODE DOES NOT HAVE THE NAME)
  2071.  
  2072.    (NODE HAS THE NAME)
  2073.  
  2074.    The NAME REGISTRATION REQUEST, like any request, must be repeated if
  2075.    no response is received within BCAST_REQ_RETRY_TIMEOUT.  Transmission
  2076.    of the request is attempted BCAST_REQ_RETRY_COUNT times.
  2077.  
  2078. 15.2.2.  NAME REGISTRATION BY P NODES
  2079.  
  2080.    A name registration may proceed in various  ways depending whether
  2081.    the name being registered is new to the NBNS.  If the name is known
  2082.    to the NBNS, then challenges may be sent to the prior holder(s).
  2083.  
  2084. 15.2.2.1.  NEW NAME, OR NEW GROUP MEMBER
  2085.  
  2086.    The diagram, below, shows the sequence of events when an end-node
  2087.    registers a name which is new to the NBNS.  (The diagram omits WACKs,
  2088.    NBNS redirections, and retransmission of requests.)
  2089.  
  2090.    This same interaction will occur if the name being registered is a
  2091.    group name and the group already exists.  The NBNS will add the
  2092.  
  2093.  
  2094.  
  2095. NetBIOS Working Group                                          [Page 35]
  2096.  
  2097.  
  2098. RFC 1001                                                      March 1987
  2099.  
  2100.  
  2101.    registrant to the set of group members.
  2102.  
  2103.                        P-NODE REGISTRATION PROCESS
  2104.             (server has no previous information about the name)
  2105.  
  2106.               P-NODE                            NBNS
  2107.                           REGISTER
  2108.                 --------------------------------->
  2109.  
  2110.                         POSITIVE RESPONSE
  2111.                 <---------------------------------
  2112.  
  2113.    The interaction is rather simple: the end-node sends a NAME
  2114.    REGISTRATION REQUEST, the NBNS responds with a POSITIVE NAME
  2115.    REGISTRATION RESPONSE.
  2116.  
  2117. 15.2.2.2.  EXISTING NAME AND OWNER IS STILL ACTIVE
  2118.  
  2119.    The following diagram shows interactions when an attempt is made to
  2120.    register a unique name, the NBNS is aware of an existing owner, and
  2121.    that existing owner is still active.
  2122.  
  2123.    There are two sides to the diagram.  The left side shows how a non-
  2124.    secured NBNS would handle the matter.  Secured NBNS activity is shown
  2125.    on the right.
  2126.  
  2127.                        P-NODE REGISTRATION PROCESS
  2128.                (server HAS a previous owner that IS active)
  2129.  
  2130.  
  2131.    <------NON-SECURED STYLE------->  <---------SECURED STYLE------->
  2132.  
  2133.    REQ. NODE           NBNS       NODE         NBNS         REQ.NODE
  2134.                                  HOLDING
  2135.                                   NAME
  2136.  
  2137.          REGISTER                                      REGISTER
  2138.    ------------------->                         <-------------------
  2139.                                        QUERY
  2140.     END-NODE CHALLENGE              <------------
  2141.    <-------------------                QUERY
  2142.                                     <------------
  2143.              QUERY
  2144.    ----------------------------->
  2145.                                      POSITIVE RESP
  2146.              QUERY                   ------------>
  2147.    ----------------------------->                 NEGATIVE RESPONSE
  2148.                                                   ----------------->
  2149.  
  2150.          POSITIVE RESPONSE
  2151.    <----------------------------
  2152.  
  2153.  
  2154.  
  2155. NetBIOS Working Group                                          [Page 36]
  2156.  
  2157.  
  2158. RFC 1001                                                      March 1987
  2159.  
  2160.  
  2161.    A non-secured NBNS will answer the NAME REGISTRATION REQUEST with a
  2162.    END-NODE CHALLENGE REGISTRATION RESPONSE.  This response asks the
  2163.    end-node to issue a challenge transaction against the node indicated
  2164.    in the response.  In this case, the prior node will defend against
  2165.    the challenge and the registering end-node will simply drop the
  2166.    registration attempt without further interaction with the NBNS.
  2167.  
  2168.    A secured NBNS will refrain from answering the NAME REGISTRATION
  2169.    REQUEST until the NBNS has itself challenged the prior holder(s) of
  2170.    the name.  In this case, the NBNS finds that that the name is still
  2171.    being defended and consequently returns a NEGATIVE NAME REGISTRATION
  2172.    RESPONSE to the registrant.
  2173.  
  2174.    Due to the potential time for the secured NBNS to make the
  2175.    challenge(s), it is likely that a WACK will be sent by the NBNS to
  2176.    the registrant.
  2177.  
  2178.    Although not shown in the diagram, a non-secured NBNS will send a
  2179.    NEGATIVE NAME REGISTRATION RESPONSE to a request to register a unique
  2180.    name when there already exists a group of the same name.  A secured
  2181.    NBNS may elect to poll (or challenge) the group members to determine
  2182.    whether any active members remain.  This may impose a heavy load on
  2183.    the network.  It is recommended that group names be allowed to fade-
  2184.    out through the name refresh mechanism.
  2185.  
  2186. 15.2.2.3.  EXISTING NAME AND OWNER IS INACTIVE
  2187.  
  2188.    The following diagram shows interactions when an attempt is made to
  2189.    register a unique name, the NBNS is aware of an existing owner, and
  2190.    that existing owner is no longer active.
  2191.  
  2192.    A non-secured NBNS will answer the NAME REGISTRATION REQUEST with a
  2193.    END-NODE CHALLENGE REGISTRATION RESPONSE.  This response asks the
  2194.    end-node to issue a challenge transaction against the node indicated
  2195.    in the response.  In this case, the prior node will not defend
  2196.    against the challenge.  The registrant will inform the NBNS through a
  2197.    NAME OVERWRITE REQUEST.  The NBNS will replace the prior name
  2198.    information in its database with the information in the overwrite
  2199.    request.
  2200.  
  2201.    A secured NBNS will refrain from answering the NAME REGISTRATION
  2202.    REQUEST until the NBNS has itself challenged the prior holder(s) of
  2203.    the name.  In this case, the NBNS finds that that the name is not
  2204.    being defended and consequently returns a POSITIVE NAME REGISTRATION
  2205.    RESPONSE to the registrant.
  2206.  
  2207.  
  2208.  
  2209.  
  2210.  
  2211.  
  2212.  
  2213.  
  2214.  
  2215. NetBIOS Working Group                                          [Page 37]
  2216.  
  2217.  
  2218. RFC 1001                                                      March 1987
  2219.  
  2220.  
  2221.                        P-NODE REGISTRATION PROCESS
  2222.              (server HAS a previous owner that is NOT active)
  2223.  
  2224.  
  2225.    <------NON-SECURED STYLE----->  <----------SECURED STYLE-------->
  2226.  
  2227.    REQ. NODE           NBNS     NODE           NBNS         REQ.NODE
  2228.                                HOLDING
  2229.                                 NAME
  2230.  
  2231.          REGISTER                                    REGISTER
  2232.    ------------------->                         <-------------------
  2233.                                        QUERY
  2234.     END-NODE CHALLENGE             <------------
  2235.    <-------------------                QUERY
  2236.                                    <------------
  2237.          NAME QUERY REQUEST                        POSITIVE RESPONSE
  2238.    ---------------------------->                 ------------------>
  2239.               QUERY
  2240.    ---------------------------->
  2241.  
  2242.        OVERWRITE
  2243.    ------------------->
  2244.  
  2245.     POSITIVE RESPONSE
  2246.    <------------------
  2247.  
  2248.    Due to the potential time for the secured NBNS to make the
  2249.    challenge(s), it is likely that a WACK will be sent by the NBNS to
  2250.    the registrant.
  2251.  
  2252.    A secured NBNS will immediately send a NEGATIVE NAME REGISTRATION
  2253.    RESPONSE in answer to any NAME OVERWRITE REQUESTS it may receive.
  2254.  
  2255. 15.2.3.  NAME REGISTRATION BY M NODES
  2256.  
  2257.    An M node begin a name claim operation as if the node were a B node:
  2258.    it broadcasts a NAME REGISTRATION REQUEST and listens for NEGATIVE
  2259.    NAME REGISTRATION RESPONSEs.  Any NEGATIVE NAME REGISTRATION RESPONSE
  2260.    prevents the M node from obtaining the name and terminates the claim
  2261.    operation.
  2262.  
  2263.    If, however, the M node does not receive any NEGATIVE NAME
  2264.    REGISTRATION RESPONSE, the M node must continue the claim procedure
  2265.    as if the M node were a P node.
  2266.  
  2267.    Only if both name claims were successful does the M node acquire the
  2268.    name.
  2269.  
  2270.    The following diagram illustrates M node name registration:
  2271.  
  2272.  
  2273.  
  2274.  
  2275. NetBIOS Working Group                                          [Page 38]
  2276.  
  2277.  
  2278. RFC 1001                                                      March 1987
  2279.  
  2280.  
  2281.                        M-NODE REGISTRATION PROCESS
  2282.  
  2283.    <---NAME NOT IN BROADCAST AREA--> <--NAME IS IN BROADCAST AREA-->
  2284.  
  2285.    REQ. NODE                       NODE                     REQ.NODE
  2286.                                   HOLDING
  2287.                                    NAME
  2288.  
  2289.    (BROADCAST) REGISTER                         (BROADCAST) REGISTER
  2290.    ------------------->                         <-------------------
  2291.  
  2292.         REGISTER                                     REGISTER
  2293.    ------------------->                         <-------------------
  2294.  
  2295.         REGISTER                        NEGATIVE RESPONSE
  2296.    ------------------->             ------------------------------->
  2297.  
  2298.  
  2299.                  !                     (NODE DOES NOT HAVE THE NAME)
  2300.     INITIATE     !
  2301.     A P-NODE     !
  2302.     REGISTRATION !
  2303.                  V
  2304.  
  2305. 15.3.  NAME QUERY TRANSACTIONS
  2306.  
  2307.    Name query transactions are initiated by end-nodes to obtain the IP
  2308.    address(es) and other attributes associated with a NetBIOS name.
  2309.  
  2310. 15.3.1.  QUERY BY B NODES
  2311.  
  2312.    The following diagram shows how B nodes go about discovering who owns
  2313.    a name.
  2314.  
  2315.    The left half of the diagram illustrates what happens if there are no
  2316.    holders of the name.  In that case no responses are received in
  2317.    answer to the broadcast NAME QUERY REQUEST(s).
  2318.  
  2319.    The right half shows a POSITIVE NAME QUERY RESPONSE unicast by a name
  2320.    holder in answer to the broadcast request.  A name holder will make
  2321.    this response to every NAME QUERY REQUEST that it hears.  And each
  2322.    holder acts this way.  Thus, the node sending the request may receive
  2323.    many responses, some duplicates, and from many nodes.
  2324.  
  2325.  
  2326.  
  2327.  
  2328.  
  2329.  
  2330.  
  2331.  
  2332.  
  2333.  
  2334.  
  2335. NetBIOS Working Group                                          [Page 39]
  2336.  
  2337.  
  2338. RFC 1001                                                      March 1987
  2339.  
  2340.  
  2341.                          B-NODE DISCOVERY PROCESS
  2342.  
  2343.  
  2344.    <------NAME NOT ON NETWORK------>  <---NAME PRESENT ON NETWORK-->
  2345.  
  2346.       REQ. NODE                    NODE                     REQ.NODE
  2347.                                   HOLDING
  2348.                                    NAME
  2349.  
  2350.        (BROADCAST) QUERY                           (BROADCAST) QUERY
  2351.    ---------------------->                    <---------------------
  2352.  
  2353.       NAME QUERY REQUEST                          NAME QUERY REQUEST
  2354.    ---------------------->                    <---------------------
  2355.  
  2356.            QUERY                        POSITIVE RESPONSE
  2357.    ---------------------->           ------------------------------>
  2358.  
  2359.    Name query is generally, but not necessarily, a prelude to NetBIOS
  2360.    session establishment or NetBIOS datagram transmission.  However,
  2361.    name query may be used for other purposes.
  2362.  
  2363.    A B node may elect to build a group membership list for subsequent
  2364.    use (e.g. for session establishment) by collecting and saving the
  2365.    responses.
  2366.  
  2367. 15.3.2.  QUERY BY P NODES
  2368.  
  2369.    An NBNS answers queries from a P node with a list of IP address and
  2370.    other information for each owner of the name.  If there are multiple
  2371.    owners (i.e. if the name is a group name), the NBNS loads as many
  2372.    answers into the response as will fit into a UDP packet.  A
  2373.    truncation flag indicates whether any additional owner information
  2374.    remains.  All the information may be obtained by repeating the query
  2375.    over a TCP connection.
  2376.  
  2377.    The NBNS is not required to impose any order on its answer list.
  2378.  
  2379.    The following diagram shows what happens if the NBNS has no
  2380.    information about the name:
  2381.  
  2382.                       P-NODE DISCOVERY PROCESS
  2383.             (server has no information about the name)
  2384.  
  2385.               P-NODE                            NBNS
  2386.                         NAME QUERY REQUEST
  2387.                 --------------------------------->
  2388.  
  2389.                         NEGATIVE RESPONSE
  2390.                 <---------------------------------
  2391.  
  2392.  
  2393.  
  2394.  
  2395. NetBIOS Working Group                                          [Page 40]
  2396.  
  2397.  
  2398. RFC 1001                                                      March 1987
  2399.  
  2400.  
  2401.    The next diagram illustrates interaction between the end-node and the
  2402.    NBNS when the NBNS does have information about the name.  This
  2403.    diagram shows, in addition, the retransmission of the request by the
  2404.    end-node in the absence of a timely response.  Also shown are WACKs
  2405.    (or temporary, intermediate responses) sent by the NBNS to the end-
  2406.    node:
  2407.  
  2408.                      P-NODE QUERY PROCESS
  2409.            (server HAS information about the name)
  2410.  
  2411.         P-NODE                                 NBNS
  2412.                        NAME QUERY REQUEST
  2413.         /---------------------------------------->
  2414.        /
  2415.        !          (OPTIONAL)   WACK
  2416.        !  <- - - - - - - - - - - - - - - - - - - -
  2417.        !         !
  2418.        !timer    !
  2419.        !         ! (optional timer restart)
  2420.        !         !
  2421.         \        V           QUERY
  2422.          \--------------------------------------->
  2423.                               .
  2424.                               .
  2425.                               .
  2426.                             QUERY
  2427.         /---------------------------------------->
  2428.        /
  2429.        !          (OPTIONAL)   WACK
  2430.        !  <- - - - - - - - - - - - - - - - - - - -
  2431.        !         !
  2432.        !timer    !
  2433.        !         ! (optional timer restart)
  2434.        !         !
  2435.         \        V           QUERY
  2436.          \--------------------------------------->
  2437.                               .
  2438.                               .
  2439.  
  2440.                     POSITIVE RESPONSE
  2441.          <-----------------------------------------
  2442.  
  2443.  
  2444.    The following diagram illustrates NBNS redirection.  Upon receipt of
  2445.    a NAME QUERY REQUEST, the NBNS redirects the client to another NBNS.
  2446.    The client repeats the request to the new NBNS and obtains a
  2447.    response.  The diagram shows that response as a POSITIVE NAME QUERY
  2448.    RESPONSE.  However any legal NBNS response may occur in actual
  2449.    operation.
  2450.  
  2451.  
  2452.  
  2453.  
  2454.  
  2455. NetBIOS Working Group                                          [Page 41]
  2456.  
  2457.  
  2458. RFC 1001                                                      March 1987
  2459.  
  2460.  
  2461.                            NBNS REDIRECTION
  2462.  
  2463.               P-NODE                            NBNS
  2464.                          NAME QUERY REQUEST
  2465.                 --------------------------------->
  2466.  
  2467.                     REDIRECT NAME QUERY RESPONSE
  2468.                 <---------------------------------
  2469.  
  2470.        (START FROM THE
  2471.         VERY BEGINNING
  2472.         USING THE ADDRESS
  2473.         OF THE NEWLY
  2474.         SUPPLIED NBNS.)
  2475.                                                 NEW
  2476.               P-NODE                            NBNS
  2477.                          NAME QUERY REQUEST
  2478.                 --------------------------------->
  2479.  
  2480.                    POSITIVE NAME QUERY RESPONSE
  2481.                 <---------------------------------
  2482.  
  2483.    The next diagram shows how a P or M node tells the NBNS that the NBNS
  2484.    has provided incorrect information.  This procedure may begin after a
  2485.    DATAGRAM ERROR packet has been received or a session set-up attempt
  2486.    has discovered that the NetBIOS name does not exist at the
  2487.    destination, the IP address of which was obtained from the NBNS
  2488.    during a prior name query transaction.  The NBNS, in this case a
  2489.    secure NBNS, issues queries to verify whether the information is, in
  2490.    fact, incorrect.  The NBNS closes the transaction by sending either a
  2491.    POSITIVE or NEGATIVE NAME RELEASE RESPONSE, depending on the results
  2492.    of the verification.
  2493.  
  2494.                  CORRECTING NBNS INFORMATION BASE
  2495.  
  2496.               P-NODE                            NBNS
  2497.                        NAME RELEASE REQUEST
  2498.                 --------------------------------->
  2499.                                                         QUERY
  2500.                                                   ---------------->
  2501.  
  2502.                                                         QUERY
  2503.                                                   ---------------->
  2504.  
  2505.                                       (NAME TAKEN OFF THE DATABASE
  2506.                                        IF NBNS FINDS IT TO BE
  2507.                                        INCORRECT)
  2508.  
  2509.                     POSITIVE/NEGATIVE RESPONSE
  2510.                 <---------------------------------
  2511.  
  2512.  
  2513.  
  2514.  
  2515. NetBIOS Working Group                                          [Page 42]
  2516.  
  2517.  
  2518. RFC 1001                                                      March 1987
  2519.  
  2520.  
  2521. 15.3.3.  QUERY BY M NODES
  2522.  
  2523.    M node name query follows the B node pattern.  In the absence of
  2524.    adequate results, the M node then continues by performing a P node
  2525.    type query.  This is shown in the following diagram:
  2526.  
  2527.                        M-NODE DISCOVERY PROCESS
  2528.  
  2529.  
  2530.    <---NAME NOT ON BROADCAST AREA-->  <--NAME IS ON BROADCAST AREA->
  2531.  
  2532.    REQ. NODE                       NODE                     REQ.NODE
  2533.                                   HOLDING
  2534.                                    NAME
  2535.  
  2536.        (BROADCAST) QUERY                           (BROADCAST) QUERY
  2537.    --------------------->                    <----------------------
  2538.  
  2539.      NAME QUERY REQUEST                           NAME QUERY REQUEST
  2540.    --------------------->                    <----------------------
  2541.  
  2542.            QUERY                           POSITIVE RESPONSE
  2543.    --------------------->           ------------------------------->
  2544.  
  2545.                    !
  2546.        INITIATE    !
  2547.        A P-NODE    !
  2548.        DISCOVERY   !
  2549.        PROCESS     !
  2550.                    V
  2551.  
  2552.  
  2553.  
  2554. 15.3.4.  ACQUIRE GROUP MEMBERSHIP LIST
  2555.  
  2556.    The entire membership of a group may be acquired by sending a NAME
  2557.    QUERY REQUEST to the NBNS.  The NBNS will respond with a POSITIVE
  2558.    NAME QUERY RESPONSE or a NEGATIVE NAME QUERY RESPONSE.  A negative
  2559.    response completes the procedure and indicates that there are no
  2560.    members in the group.
  2561.  
  2562.    If the positive response has the truncation bit clear, then the
  2563.    response contains the entire list of group members.  If the
  2564.    truncation bit is set, then this entire procedure must be repeated,
  2565.    but using TCP as a foundation rather than UDP.
  2566.  
  2567.  
  2568.  
  2569.  
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575. NetBIOS Working Group                                          [Page 43]
  2576.  
  2577.  
  2578. RFC 1001                                                      March 1987
  2579.  
  2580.  
  2581. 15.4.  NAME RELEASE TRANSACTIONS
  2582.  
  2583. 15.4.1.  RELEASE BY B NODES
  2584.  
  2585.    A NAME RELEASE DEMAND contains the following information:
  2586.  
  2587.      -  NetBIOS name
  2588.      -  The scope of the NetBIOS name
  2589.      -  Name type: unique or group
  2590.      -  IP address of the releasing node
  2591.      -  Transaction ID
  2592.  
  2593.    REQUESTING                                     OTHER
  2594.    B-NODE                                         B-NODES
  2595.                      NAME RELEASE DEMAND
  2596.               ---------------------------------->
  2597.  
  2598. 15.4.2.  RELEASE BY P NODES
  2599.  
  2600.    A NAME RELEASE REQUEST contains the following information:
  2601.  
  2602.      -  NetBIOS name
  2603.      -  The scope of the NetBIOS name
  2604.      -  Name type: unique or group
  2605.      -  IP address of the releasing node
  2606.      -  Transaction ID
  2607.  
  2608.  
  2609.    A NAME RELEASE RESPONSE contains the following information:
  2610.  
  2611.      -  NetBIOS name
  2612.      -  The scope of the NetBIOS name
  2613.      -  Name type: unique or group
  2614.      -  IP address of the releasing node
  2615.      -  Transaction ID
  2616.      -  Result:
  2617.           -  Yes: name was released
  2618.           -  No: name was not released, a reason code is provided
  2619.  
  2620.    REQUESTING
  2621.    P-NODE                                         NBNS
  2622.                      NAME RELEASE REQUEST
  2623.               ---------------------------------->
  2624.  
  2625.                      NAME RELEASE RESPONSE
  2626.               <---------------------------------
  2627.  
  2628. 15.4.3.  RELEASE BY M NODES
  2629.  
  2630.    The name release procedure of the M node is a combination of the P
  2631.    and B node name release procedures.  The M node first performs the P
  2632.  
  2633.  
  2634.  
  2635. NetBIOS Working Group                                          [Page 44]
  2636.  
  2637.  
  2638. RFC 1001                                                      March 1987
  2639.  
  2640.  
  2641.    release procedure.  If the P procedure fails then the release
  2642.    procedure does not continue, it fails.  If and only if the P
  2643.    procedure succeeds then the M node broadcasts the NAME RELEASE DEMAND
  2644.    to the broadcast area, the B procedure.
  2645.  
  2646.    NOTE: An M node typically performs a B-style operation and then a
  2647.          P-style operation.  In this case, however, the P-style
  2648.          operation comes first.
  2649.  
  2650.    The following diagram illustrates the M node name release procedure:
  2651.  
  2652.    <-----P procedure fails-------> <-------P procedure succeeds--->
  2653.  
  2654.    REQUESTING               NBNS    REQUESTING             NBNS
  2655.    M-NODE                           M-NODE
  2656.  
  2657.        NAME RELEASE REQUEST               NAME RELEASE REQUEST
  2658.      -------------------------->       ------------------------>
  2659.  
  2660.        NEGATIVE RELEASE RESPONSE        POSITIVE RELEASE RESPONSE
  2661.      <--------------------------       <-------------------------
  2662.  
  2663.                                                            OTHER
  2664.                                                            M-NODES
  2665.  
  2666.                                            NAME RELEASE DEMAND
  2667.                                         ------------------------>
  2668.  
  2669. 15.5.  NAME MAINTENANCE TRANSACTIONS
  2670.  
  2671. 15.5.1.  NAME REFRESH
  2672.  
  2673.    Name refresh transactions are used to handle the following
  2674.    situations:
  2675.  
  2676.       a)   An NBNS node needs to detect if a P or M node has "silently"
  2677.            gone down, so that names held by that node can be purged
  2678.            from the data base.
  2679.  
  2680.  
  2681.       b)   If the NBNS goes down, it needs to be able to reconstruct
  2682.            the data base when it comes back up.
  2683.  
  2684.  
  2685.       c)   If the network should be partitioned, the NBNS needs to be
  2686.            able to able to update its data base when the network
  2687.            reconnects.
  2688.  
  2689.    Each P or M node is responsible for sending periodic NAME REFRESH
  2690.    REQUESTs for each name that it has registered.  Each refresh packet
  2691.    contains a single name that has been successfully registered by that
  2692.  
  2693.  
  2694.  
  2695. NetBIOS Working Group                                          [Page 45]
  2696.  
  2697.  
  2698. RFC 1001                                                      March 1987
  2699.  
  2700.  
  2701.    node.  The interval between such packets is negotiated between the
  2702.    end node and the NBNS server at the time that the name is initially
  2703.    claimed.  At name claim time, an end node will suggest a refresh
  2704.    timeout value.  The NBNS node can modify this value in the reply
  2705.    packet.  A NBNS node can also choose to tell the end node to not send
  2706.    any refresh packet by using the "infinite" timeout value in the
  2707.    response packet.  The timeout value returned by the NBNS is the
  2708.    actual refresh timeout that the end node must use.
  2709.  
  2710.    When a node sends a NAME REFRESH REQUEST, it must be prepared to
  2711.    receive a negative response.  This would happen, for example, if the
  2712.    the NBNS discovers that the the name had already been assigned to
  2713.    some other node.  If such a response is received, the end node should
  2714.    mark the name as being in conflict.  Such an entry should be treated
  2715.    in the same way as if name conflict had been detected against the
  2716.    name.  The following diagram illustrates name refresh:
  2717.  
  2718.    <-----Successful Refresh-----> <-----Unsuccessful Refresh---->
  2719.  
  2720.    REFRESHING               NBNS   REFRESHING               NBNS
  2721.    NODE                            NODE
  2722.  
  2723.        NAME REFRESH REQUEST             NAME REFRESH REQUEST
  2724.      ------------------------>        ----------------------->
  2725.  
  2726.          POSITIVE RESPONSE                NEGATIVE RESPONSE
  2727.      <------------------------        <-----------------------
  2728.                                     !
  2729.                                     !
  2730.                                     V
  2731.                               MARK NAME IN
  2732.                                 CONFLICT
  2733.  
  2734. 15.5.2.  NAME CHALLENGE
  2735.  
  2736.    Name challenge is done by sending a NAME QUERY REQUEST to an end node
  2737.    of any type.  If a POSITIVE NAME QUERY RESPONSE is returned, then
  2738.    that node still owns the name.  If a NEGATIVE NAME QUERY RESPONSE is
  2739.    received or if no response is received, it can be assumed that the
  2740.    end node no longer owns the name.
  2741.  
  2742.    Name challenge can be performed either by the NBNS node, or by an end
  2743.    node.  When an end-node sends a name claim packet, the NBNS node may
  2744.    do the challenge operation.  The NBNS node can choose, however, to
  2745.    require the end node do the challenge.  In that case, the NBNS will
  2746.    send an END-NODE CHALLENGE RESPONSE packet to the end node, which
  2747.    should then proceed to challenge the putative owner.
  2748.  
  2749.    Note that the name challenge procedure sends a normal NAME QUERY
  2750.    REQUEST packet to the end node.  It does not require a special
  2751.    packet.  The only new packet introduced is the END-NODE CHALLENGE
  2752.  
  2753.  
  2754.  
  2755. NetBIOS Working Group                                          [Page 46]
  2756.  
  2757.  
  2758. RFC 1001                                                      March 1987
  2759.  
  2760.  
  2761.    RESPONSE which is sent by an NBNS node when the NBNS wants the end-
  2762.    node to perform the challenge operation.
  2763.  
  2764. 15.5.3.  CLEAR NAME CONFLICT
  2765.  
  2766.    It is possible during a refresh request from a M or P node for a NBNS
  2767.    to detects a name in conflict.  The response to the NAME REFRESH
  2768.    REQUEST must be a NEGATIVE NAME REGISTRATION RESPONSE.  Optionally,
  2769.    in addition, the NBNS may send a NAME CONFLICT DEMAND or a NAME
  2770.    RELEASE REQUEST to the refreshing node.  The NAME CONFLICT DEMAND
  2771.    forces the node to place the name in the conflict state.  The node
  2772.    will eventually inform it's user of the conflict.  The NAME RELEASE
  2773.    REQUEST will force the node to flush the name from its local name
  2774.    table completely.  This forces the node to flush the name in
  2775.    conflict.  This does not cause termination of existing sessions using
  2776.    this name.
  2777.  
  2778.    The following diagram shows an NBNS detecting and correcting a
  2779.    conflict:
  2780.  
  2781.    REFRESHING NODE                                 NBNS
  2782.  
  2783.                      NAME REFRESH REQUEST
  2784.            ----------------------------------------->
  2785.  
  2786.                NEGATIVE NAME REGISTRATION RESPONSE
  2787.            <-----------------------------------------
  2788.  
  2789.                      NAME CONFLICT DEMAND
  2790.            <-----------------------------------------
  2791.  
  2792.                              OR
  2793.  
  2794.                      NAME RELEASE REQUEST
  2795.            <-----------------------------------------
  2796.  
  2797.                POSITIVE/NEGATIVE RELEASE REQUEST
  2798.            ----------------------------------------->
  2799.  
  2800. 15.6.  ADAPTER STATUS TRANSACTIONS
  2801.  
  2802.    Adapter status is obtained from a node as follows:
  2803.  
  2804.       1.   Perform a name discovery operation to obtain the IP
  2805.            addresses of a set of end-nodes.
  2806.  
  2807.       2.   Repeat until all end-nodes from the set have been used:
  2808.  
  2809.            a.   Select one end-node from the set.
  2810.  
  2811.            b.   Send a NODE STATUS REQUEST to that end-node using UDP.
  2812.  
  2813.  
  2814.  
  2815. NetBIOS Working Group                                          [Page 47]
  2816.  
  2817.  
  2818. RFC 1001                                                      March 1987
  2819.  
  2820.  
  2821.            c.   Await a NODE STATUS RESPONSE.  (If a timely response is
  2822.                 not forthcoming, repeat step "b" UCAST_REQ_RETRY_COUNT
  2823.                 times.  After the last retry, go to step "a".)
  2824.  
  2825.            d.   If the truncation bit is not set in the response, the
  2826.                 response contains the entire node status.  Return the
  2827.                 status to the user and terminate this procedure.
  2828.  
  2829.            e.   If the truncation bit is set in the response, then not
  2830.                 all status was returned because it would not fit into
  2831.                 the response packet.  The responder will set the
  2832.                 truncation bit if the IP datagram length would exceed
  2833.                 MAX_DATAGRAM_LENGTH.  Return the status to the user and
  2834.                 terminate this procedure.
  2835.  
  2836.  
  2837. 3.   Return error to user, no status obtained.
  2838.  
  2839.    The repetition of step 2, above, through all nodes of the set, is
  2840.    optional.
  2841.  
  2842.    Following is an example transaction of a successful Adapter Status
  2843.    operation:
  2844.  
  2845.    REQUESTING NODE                                 NAME OWNER
  2846.  
  2847.                        NAME QUERY REQUEST
  2848.            ----------------------------------------->
  2849.  
  2850.                    POSITIVE NAME QUERY RESPONSE
  2851.            <-----------------------------------------
  2852.  
  2853.                        NODE STATUS REQUEST
  2854.            ----------------------------------------->
  2855.  
  2856.                       NODE STATUS RESPONSE
  2857.            <-----------------------------------------
  2858.  
  2859. 16.  NetBIOS SESSION SERVICE
  2860.  
  2861.    The NetBIOS session service begins after one or more IP addresses
  2862.    have been found for the target name.  These addresses may have been
  2863.    acquired using the NetBIOS name query transactions or by other means,
  2864.    such as a local name table or cache.
  2865.  
  2866.    NetBIOS session service transactions, packets, and protocols are
  2867.    identical for all end-node types.  They involve only directed
  2868.    (point-to-point) communications.
  2869.  
  2870.  
  2871.  
  2872.  
  2873.  
  2874.  
  2875. NetBIOS Working Group                                          [Page 48]
  2876.  
  2877.  
  2878. RFC 1001                                                      March 1987
  2879.  
  2880.  
  2881. 16.1.  OVERVIEW OF NetBIOS SESSION SERVICE
  2882.  
  2883.    Session service has three phases:
  2884.  
  2885.      Session establishment - it is during this phase that the IP
  2886.         address and TCP port of the called name is determined, and a
  2887.         TCP connection is established with the remote party.
  2888.  
  2889.      Steady state - it is during this phase that NetBIOS data
  2890.         messages are exchanged over the session.  Keep-alive packets
  2891.         may also be exchanged if the participating nodes are so
  2892.         configured.
  2893.  
  2894.      Session close - a session is closed whenever either a party (in
  2895.         the session) closes the session or it is determined that one
  2896.         of the parties has gone down.
  2897.  
  2898. 16.1.1.  SESSION ESTABLISHMENT PHASE OVERVIEW
  2899.  
  2900.    An end-node begins establishment of a session to another node by
  2901.    somehow acquiring (perhaps using the name query transactions or a
  2902.    local cache) the IP address of the node or nodes purported to own the
  2903.    destination name.
  2904.  
  2905.    Every end-node awaits incoming NetBIOS session requests by listening
  2906.    for TCP calls to a well-known service port, SSN_SRVC_TCP_PORT.  Each
  2907.    incoming TCP connection represents the start of a separate NetBIOS
  2908.    session initiation attempt.  The NetBIOS session server, not the
  2909.    ultimate application, accepts the incoming TCP connection(s).
  2910.  
  2911.    Once the TCP connection is open, the calling node sends session
  2912.    service request packet.  This packet contains the following
  2913.    information:
  2914.  
  2915.      -  Calling IP address (see note)
  2916.      -  Calling NetBIOS name
  2917.      -  Called IP address (see note)
  2918.      -  Called NetBIOS name
  2919.  
  2920.    NOTE: The IP addresses are obtained from the TCP service
  2921.          interface.
  2922.  
  2923.    When the session service request packet arrives at the NetBIOS
  2924.    server, one of the the following situations will exist:
  2925.  
  2926.    -    There exists a NetBIOS LISTEN compatible with the incoming
  2927.         call and there are adequate resources to permit session
  2928.         establishment to proceed.
  2929.  
  2930.    -    There exists a NetBIOS LISTEN compatible with the incoming
  2931.         call, but there are inadequate resources to permit
  2932.  
  2933.  
  2934.  
  2935. NetBIOS Working Group                                          [Page 49]
  2936.  
  2937.  
  2938. RFC 1001                                                      March 1987
  2939.  
  2940.  
  2941.         establishment of a session.
  2942.  
  2943.    -    The called name does, in fact, exist on the called node, but
  2944.         there is no pending NetBIOS LISTEN compatible with the
  2945.         incoming call.
  2946.  
  2947.    -    The called name does not exist on the called node.
  2948.  
  2949.    In all but the first case, a rejection response is sent back over the
  2950.    TCP connection to the caller.  The TCP connection is then closed and
  2951.    the session phase terminates.  Any retry is the responsibility of the
  2952.    caller.  For retries in the case of a group name, the caller may use
  2953.    the next member of the group rather than immediately retrying the
  2954.    instant address.  In the case of a unique name, the caller may
  2955.    attempt an immediate retry using the same target IP address unless
  2956.    the called name did not exist on the called node.  In that one case,
  2957.    the NetBIOS name should be re-resolved.
  2958.  
  2959.    If a compatible LISTEN exists, and there are adequate resources, then
  2960.    the session server may transform the existing TCP connection into the
  2961.    NetBIOS data session.  Alternatively, the session server may
  2962.    redirect, or "retarget" the caller to another TCP port (and IP
  2963.    address).
  2964.  
  2965.    If the caller is redirected, the caller begins the session
  2966.    establishment anew, but using the new IP address and TCP port given
  2967.    in the retarget response.  Again a TCP connection is created, and
  2968.    again the calling and called node exchange credentials.  The called
  2969.    party may accept the call, reject the call, or make a further
  2970.    redirection.
  2971.  
  2972.    This mechanism is based on the presumption that, on hosts where it is
  2973.    not possible to transfer open TCP connections between processes, the
  2974.    host will have a central session server.  Applications willing to
  2975.    receive NetBIOS calls will obtain an ephemeral TCP port number, post
  2976.    a TCP unspecified passive open on that port, and then pass that port
  2977.    number and NetBIOS name information to the NetBIOS session server
  2978.    using a NetBIOS LISTEN operation.  When the call is placed, the
  2979.    session server will "retarget" the caller to the application's TCP
  2980.    socket.  The caller will then place a new call, directly to the
  2981.    application.  The application has the responsibility to mimic the
  2982.    session server at least to the extent of receiving the calling
  2983.    credentials and then accepting or rejecting the call.
  2984.  
  2985. 16.1.1.1.  RETRYING AFTER BEING RETARGETTED
  2986.  
  2987.    A calling node may find that it can not establish a session with a
  2988.    node to which it was directed by the retargetting procedure.  Since
  2989.    retargetting may be nested, there is an issue whether the caller
  2990.    should begin a retry at the initial starting point or back-up to an
  2991.    intermediate retargetting point.  The caller may use any method.  A
  2992.  
  2993.  
  2994.  
  2995. NetBIOS Working Group                                          [Page 50]
  2996.  
  2997.  
  2998. RFC 1001                                                      March 1987
  2999.  
  3000.  
  3001.    discussion of two such methods is in Appendix B, "Retarget
  3002.    Algorithms".
  3003.  
  3004. 16.1.1.2.  SESSION ESTABLISHMENT TO A GROUP NAME
  3005.  
  3006.    Session establishment with a group name requires special
  3007.    consideration.  When a NetBIOS CALL attempt is made to a group name,
  3008.    name discovery will result in a list (possibly incomplete) of the
  3009.    members of that group.  The calling node selects one member from the
  3010.    list and attempts to build a session.  If that fails, the calling
  3011.    node may select another member and make another attempt.
  3012.  
  3013.    When the session service attempts to make a connection with one of
  3014.    the members of the group, there is no guarantee that that member has
  3015.    a LISTEN pending against that group name, that the called node even
  3016.    owns, or even that the called node is operating.
  3017.  
  3018. 16.1.2.  STEADY STATE PHASE OVERVIEW
  3019.  
  3020.    NetBIOS data messages are exchanged in the steady state.  NetBIOS
  3021.    messages are sent by prepending the user data with a message header
  3022.    and sending the header and the user data over the TCP connection.
  3023.    The receiver removes the header and passes the data to the NetBIOS
  3024.    user.
  3025.  
  3026.    In order to detect failure of one of the nodes or of the intervening
  3027.    network, "session keep alive" packets may be periodically sent in the
  3028.    steady state.
  3029.  
  3030.    Any failure of the underlying TCP connection, whether a reset, a
  3031.    timeout, or other failure, implies failure of the NetBIOS session.
  3032.  
  3033. 16.1.3.  SESSION TERMINATION PHASE OVERVIEW
  3034.  
  3035.    A NetBIOS session is terminated normally when the user requests the
  3036.    session to be closed or when the session service detects the remote
  3037.    partner of the session has gracefully terminated the TCP connection.
  3038.    A NetBIOS session is abnormally terminated when the session service
  3039.    detects a loss of the connection.  Connection loss can be detected
  3040.    with the keep-alive function of the session service or TCP, or on the
  3041.    failure of a SESSION MESSAGE send operation.
  3042.  
  3043.    When a user requests to close a session, the service first attempts a
  3044.    graceful in-band close of the TCP connection.  If the connection does
  3045.    not close within the SSN_CLOSE_TIMEOUT the TCP connection is aborted.
  3046.    No matter how the TCP connection is terminated, the NetBIOS session
  3047.    service always closes the NetBIOS session.
  3048.  
  3049.    When the session service receives an indication from TCP that a
  3050.    connection close request has been received, the TCP connection and
  3051.    the NetBIOS session are immediately closed and the user is informed
  3052.  
  3053.  
  3054.  
  3055. NetBIOS Working Group                                          [Page 51]
  3056.  
  3057.  
  3058. RFC 1001                                                      March 1987
  3059.  
  3060.  
  3061.    of the loss of the session.  All data received up to the close
  3062.    indication should be delivered, if possible, to the session's user.
  3063.  
  3064. 16.2.  SESSION ESTABLISHMENT PHASE
  3065.  
  3066.    All the following diagrams assume a name query operation was
  3067.    successfully completed by the caller node for the listener's name.
  3068.  
  3069.    This first diagram shows the sequence of network events used to
  3070.    successfully establish a session without retargetting by the
  3071.    listener.  The TCP connection is first established with the well-
  3072.    known NetBIOS session service TCP port, SSN_SRVC_TCP_PORT.  The
  3073.    caller then sends a SESSION REQUEST packet over the TCP connection
  3074.    requesting a session with the listener.  The SESSION REQUEST contains
  3075.    the caller's name and the listener's name.  The listener responds
  3076.    with a POSITIVE SESSION RESPONSE informing the caller this TCP
  3077.    connection is accepted as the connection for the data transfer phase
  3078.    of the session.
  3079.  
  3080.            CALLER                          LISTENER
  3081.  
  3082.                        TCP CONNECT
  3083.            ====================================>
  3084.                         TCP ACCEPT
  3085.            <===================================
  3086.                      SESSION REQUEST
  3087.            ------------------------------------>
  3088.                     POSITIVE RESPONSE
  3089.            <-----------------------------------
  3090.  
  3091.    The second diagram shows the sequence of network events used to
  3092.    successfully establish a session when the listener does retargetting.
  3093.    The session establishment procedure is the same as with the first
  3094.    diagram up to the listener's response to the SESSION REQUEST.  The
  3095.    listener, divided into two sections, the listen processor and the
  3096.    actual listener, sends a SESSION RETARGET RESPONSE to the caller.
  3097.    This response states the call is acceptable, but the data transfer
  3098.    TCP connection must be at the new IP address and TCP port.  The
  3099.    caller then re-iterates the session establishment process anew with
  3100.    the new IP address and TCP port after the initial TCP connection is
  3101.    closed.  The new listener then accepts this connection for the data
  3102.    transfer phase with a POSITIVE SESSION RESPONSE.
  3103.  
  3104.            CALLER                  LISTEN PROCESSOR        LISTENER
  3105.  
  3106.                    TCP CONNECT
  3107.            =============================>
  3108.                    TCP ACCEPT
  3109.            <=============================
  3110.                    SESSION REQUEST
  3111.            ----------------------------->
  3112.  
  3113.  
  3114.  
  3115. NetBIOS Working Group                                          [Page 52]
  3116.  
  3117.  
  3118. RFC 1001                                                      March 1987
  3119.  
  3120.  
  3121.               SESSION RETARGET RESPONSE
  3122.            <-----------------------------
  3123.                    TCP CLOSE
  3124.            <=============================
  3125.                    TCP CLOSE
  3126.            =============================>
  3127.  
  3128.                        TCP CONNECT
  3129.            ====================================================>
  3130.                         TCP ACCEPT
  3131.            <====================================================
  3132.                      SESSION REQUEST
  3133.            ---------------------------------------------------->
  3134.                     POSITIVE RESPONSE
  3135.            <----------------------------------------------------
  3136.  
  3137.    The third diagram is the sequence of network events for a rejected
  3138.    session request with the listener.  This type of rejection could
  3139.    occur with either a non-retargetting listener or a retargetting
  3140.    listener.  After the TCP connection is established at
  3141.    SSN_SRVC_TCP_PORT, the caller sends the SESSION REQUEST over the TCP
  3142.    connection.  The listener does not have either a listen pending for
  3143.    the listener's name or the pending NetBIOS listen is specific to
  3144.    another caller's name.  Consequently, the listener sends a NEGATIVE
  3145.    SESSION RESPONSE and closes the TCP connection.
  3146.  
  3147.            CALLER                          LISTENER
  3148.  
  3149.                         TCP CONNECT
  3150.            ====================================>
  3151.                         TCP ACCEPT
  3152.            <===================================
  3153.                      SESSION REQUEST
  3154.            ------------------------------------>
  3155.                     NEGATIVE RESPONSE
  3156.            <-----------------------------------
  3157.                         TCP CLOSE
  3158.            <===================================
  3159.                         TCP CLOSE
  3160.            ====================================>
  3161.  
  3162.    The fourth diagram is the sequence of network events when session
  3163.    establishment fails with a retargetting listener.  After being
  3164.    redirected, and after the initial TCP connection is closed the caller
  3165.    tries to establish a TCP connection with the new IP address and TCP
  3166.    port.  The connection fails because either the port is unavailable or
  3167.    the target node is not active.  The port unavailable race condition
  3168.    occurs if another caller has already acquired the TCP connection with
  3169.    the listener.  For additional implementation suggestions, see
  3170.    Appendix B, "Retarget Algorithms".
  3171.  
  3172.  
  3173.  
  3174.  
  3175. NetBIOS Working Group                                          [Page 53]
  3176.  
  3177.  
  3178. RFC 1001                                                      March 1987
  3179.  
  3180.  
  3181.            CALLER                  LISTEN PROCESSOR        LISTENER
  3182.  
  3183.                    TCP CONNECT
  3184.            =============================>
  3185.                    TCP ACCEPT
  3186.            <=============================
  3187.                    SESSION REQUEST
  3188.            ----------------------------->
  3189.                    REDIRECT RESPONSE
  3190.            <-----------------------------
  3191.                    TCP CLOSE
  3192.            <=============================
  3193.                    TCP CLOSE
  3194.            =============================>
  3195.  
  3196.                        TCP CONNECT
  3197.            ====================================================>
  3198.  
  3199.                      CONNECTION REFUSED OR TIMED OUT
  3200.            <===================================================
  3201.  
  3202.  
  3203. 16.3.  SESSION DATA TRANSFER PHASE
  3204.  
  3205. 16.3.1.  DATA ENCAPSULATION
  3206.  
  3207.    NetBIOS messages are exchanged in the steady state.  Messages are
  3208.    sent by prepending user data with message header and sending the
  3209.    header and the user data over the TCP connection.  The receiver
  3210.    removes the header and delivers the NetBIOS data to the user.
  3211.  
  3212. 16.3.2.  SESSION KEEP-ALIVES
  3213.  
  3214.    In order to detect node failure or network partitioning, "session
  3215.    keep alive" packets are periodically sent in the steady state.  A
  3216.    session keep alive packet is discarded by a peer node.
  3217.  
  3218.    A session keep alive timer is maintained for each session.  This
  3219.    timer is reset whenever any data is sent to, or received from, the
  3220.    session peer.  When the timer expires, a NetBIOS session keep-alive
  3221.    packet is sent on the TCP connection.  Sending the keep-alive packet
  3222.    forces data to flow on the TCP connection, thus indirectly causing
  3223.    TCP to detect whether the connection is still active.
  3224.  
  3225.    Since many TCP implementations provide a parallel TCP "keep- alive"
  3226.    mechanism, the NetBIOS session keep-alive is made a configurable
  3227.    option.  It is recommended that the NetBIOS keep- alive mechanism be
  3228.    used only in the absence of TCP keep-alive.
  3229.  
  3230.    Note that unlike TCP keep alives, NetBIOS session keep alives do not
  3231.    require a response from the NetBIOS peer -- the fact that it was
  3232.  
  3233.  
  3234.  
  3235. NetBIOS Working Group                                          [Page 54]
  3236.  
  3237.  
  3238. RFC 1001                                                      March 1987
  3239.  
  3240.  
  3241.    possible to send the NetBIOS session keep alive is sufficient
  3242.    indication that the peer, and the connection to it, are still active.
  3243.  
  3244.    The only requirement for interoperability is that when a session keep
  3245.    alive packet is received, it should be discarded.
  3246.  
  3247. 17.  NETBIOS DATAGRAM SERVICE
  3248.  
  3249. 17.1.  OVERVIEW OF NetBIOS DATAGRAM SERVICE
  3250.  
  3251.    Every NetBIOS datagram has a named destination and source.  To
  3252.    transmit a NetBIOS datagram, the datagram service must perform a name
  3253.    query operation to learn the IP address and the attributes of the
  3254.    destination NetBIOS name.  (This information may be cached to avoid
  3255.    the overhead of name query on subsequent NetBIOS datagrams.)
  3256.  
  3257.    NetBIOS datagrams are carried within UDP packets.  If a NetBIOS
  3258.    datagram is larger than a single UDP packet, it may be fragmented
  3259.    into several UDP packets.
  3260.  
  3261.    End-nodes may receive NetBIOS datagrams addressed to names not held
  3262.    by the receiving node.  Such datagrams should be discarded.  If the
  3263.    name is unique then a DATAGRAM ERROR packet is sent to the source of
  3264.    that NetBIOS datagram.
  3265.  
  3266. 17.1.1.  UNICAST, MULTICAST, AND BROADCAST
  3267.  
  3268.    NetBIOS datagrams may be unicast, multicast, or broadcast.  A NetBIOS
  3269.    datagram addressed to a unique NetBIOS name is unicast.  A NetBIOS
  3270.    datatgram addressed to a group NetBIOS name, whether there are zero,
  3271.    one, or more actual members, is multicast.  A NetBIOS datagram sent
  3272.    using the NetBIOS "Send Broadcast Datagram" primitive is broadcast.
  3273.  
  3274. 17.1.2.  FRAGMENTATION OF NetBIOS DATAGRAMS
  3275.  
  3276.    When the header and data of a NetBIOS datagram exceeds the maximum
  3277.    amount of data allowed in a UDP packet, the NetBIOS datagram must be
  3278.    fragmented before transmission and reassembled upon receipt.
  3279.  
  3280.    A NetBIOS Datagram is composed of the following protocol elements:
  3281.  
  3282.      -  IP header of 20 bytes (minimum)
  3283.      -  UDP header of 8 bytes
  3284.      -  NetBIOS Datagram Header of 14 bytes
  3285.      -  The NetBIOS Datagram data.
  3286.  
  3287.    The NetBIOS Datagram data section is composed of 3 parts:
  3288.  
  3289.      -  Source NetBIOS name (255 bytes maximum)
  3290.      -  Destination NetBIOS name (255 bytes maximum)
  3291.      -  The NetBIOS user's data (maximum of 512 bytes)
  3292.  
  3293.  
  3294.  
  3295. NetBIOS Working Group                                          [Page 55]
  3296.  
  3297.  
  3298. RFC 1001                                                      March 1987
  3299.  
  3300.  
  3301.    The two name fields are in second level encoded format (see section
  3302.    14.)
  3303.  
  3304.    A maximum size NetBIOS datagram is 1064 bytes.  The minimal maximum
  3305.    IP datagram size is 576 bytes.  Consequently, a NetBIOS Datagram may
  3306.    not fit into a single IP datagram.  This makes it necessary to permit
  3307.    the fragmentation of NetBIOS Datagrams.
  3308.  
  3309.    On networks meeting or exceeding the minimum IP datagram length
  3310.    requirement of 576 octets, at most two NetBIOS datagram fragments
  3311.    will be generated.  The protocols and packet formats accommodate
  3312.    fragmentation into three or more parts.
  3313.  
  3314.    When a NetBIOS datagram is fragmented, the IP, UDP and NetBIOS
  3315.    Datagram headers are present in each fragment.  The NetBIOS Datagram
  3316.    data section is split among resulting UDP datagrams.  The data
  3317.    sections of NetBIOS datagram fragments do not overlap. The only
  3318.    fields of the NetBIOS Datagram header that would vary are the FLAGS
  3319.    and OFFSET fields.
  3320.  
  3321.    The FIRST bit in the FLAGS field indicate whether the fragment is the
  3322.    first in a sequence of fragments.  The MORE bit in the FLAGS field
  3323.    indicates whether other fragments follow.
  3324.  
  3325.    The OFFSET field is the byte offset from the beginning of the NetBIOS
  3326.    datagram data section to the first byte of the data section in a
  3327.    fragment.  It is 0 for the first fragment.  For each subsequent
  3328.    fragment, OFFSET is the sum of the bytes in the NetBIOS data sections
  3329.    of all preceding fragments.
  3330.  
  3331.    If the NetBIOS datagram was not fragmented:
  3332.  
  3333.      -  FIRST = TRUE
  3334.      -  MORE = FALSE
  3335.      -  OFFSET = 0
  3336.  
  3337.    If the NetBIOS datagram was fragmented:
  3338.  
  3339.      -  First fragment:
  3340.           -  FIRST = TRUE
  3341.           -  MORE = TRUE
  3342.           -  OFFSET = 0
  3343.  
  3344.      -  Intermediate fragments:
  3345.           -  FIRST = FALSE
  3346.           -  MORE = TRUE
  3347.           -  OFFSET = sum(NetBIOS data in prior fragments)
  3348.  
  3349.      -  Last fragment:
  3350.           -  FIRST = FALSE
  3351.           -  MORE = FALSE
  3352.  
  3353.  
  3354.  
  3355. NetBIOS Working Group                                          [Page 56]
  3356.  
  3357.  
  3358. RFC 1001                                                      March 1987
  3359.  
  3360.  
  3361.           -  OFFSET = sum(NetBIOS data in prior fragments)
  3362.  
  3363.    The relative position of intermediate fragments may be ascertained
  3364.    from OFFSET.
  3365.  
  3366.    An NBDD must remember the destination name of the first fragment in
  3367.    order to relay the subsequent fragments of a single NetBIOS datagram.
  3368.    The name information can be associated with the subsequent fragments
  3369.    through the transaction ID, DGM_ID, and the SOURCE_IP, fields of the
  3370.    packet.  This information can be purged by the NBDD after the last
  3371.    fragment has been processed or FRAGMENT_TO time has expired since the
  3372.    first fragment was received.
  3373.  
  3374. 17.2.  NetBIOS DATAGRAMS BY B NODES
  3375.  
  3376.    For NetBIOS datagrams with a named destination (i.e. non- broadcast),
  3377.    a B node performs a name discovery for the destination name before
  3378.    sending the datagram.  (Name discovery may be bypassed if information
  3379.    from a previous discovery is held in a cache.)  If the name type
  3380.    returned by name discovery is UNIQUE, the datagram is unicast to the
  3381.    sole owner of the name.  If the name type is GROUP, the datagram is
  3382.    broadcast to the entire broadcast area using the destination IP
  3383.    address BROADCAST_ADDRESS.
  3384.  
  3385.    A receiving node always filters datagrams based on the destination
  3386.    name.  If the destination name is not owned by the node or if no
  3387.    RECEIVE DATAGRAM user operations are pending for the name, then the
  3388.    datagram is discarded.  For datagrams with a UNIQUE name destination,
  3389.    if the name is not owned by the node then the receiving node sends a
  3390.    DATAGRAM ERROR packet.  The error packet originates from the
  3391.    DGM_SRVC_UDP_PORT and is addressed to the SOURCE_IP and SOURCE_PORT
  3392.    from the bad datagram.  The receiving node quietly discards datagrams
  3393.    with a GROUP name destination if the name is not owned by the node.
  3394.  
  3395.    Since broadcast NetBIOS datagrams do not have a named destination,
  3396.    the B node sends the DATAGRAM SERVICE packet(s) to the entire
  3397.    broadcast area using the destination IP address BROADCAST_ADDRESS.
  3398.    In order for the receiving nodes to distinguish this datagram as a
  3399.    broadcast NetBIOS datagram, the NetBIOS name used as the destination
  3400.    name is '*' (hexadecimal 2A) followed by 15 bytes of hexidecimal 00.
  3401.    The NetBIOS scope identifier is appended to the name before it is
  3402.    converted into second-level encoding.  For example, if the scope
  3403.    identifier is "NETBIOS.SCOPE" then the first-level encoded name would
  3404.    be:
  3405.  
  3406.         CKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.NETBIOS.SCOPE
  3407.  
  3408.    According to [2], a user may not provide a NetBIOS name beginning
  3409.    with "*".
  3410.  
  3411.    For each node in the broadcast area that receives the NetBIOS
  3412.  
  3413.  
  3414.  
  3415. NetBIOS Working Group                                          [Page 57]
  3416.  
  3417.  
  3418. RFC 1001                                                      March 1987
  3419.  
  3420.  
  3421.    broadcast datagram, if any RECEIVE BROADCAST DATAGRAM user operations
  3422.    are pending then the data from the NetBIOS datagram is replicated and
  3423.    delivered to each.  If no such operations are pending then the node
  3424.    silently discards the datagram.
  3425.  
  3426. 17.3.  NetBIOS DATAGRAMS BY P AND M NODES
  3427.  
  3428.    P and M nodes do not use IP broadcast to distribute NetBIOS
  3429.    datagrams.
  3430.  
  3431.    Like B nodes, P and M nodes must perform a name discovery or use
  3432.    cached information to learn whether a destination name is a group or
  3433.    a unique name.
  3434.  
  3435.    Datagrams to unique names are unicast directly to the destination by
  3436.    P and M nodes, exactly as they are by B nodes.
  3437.  
  3438.    Datagrams to group names and NetBIOS broadcast datagrams are unicast
  3439.    to the NBDD.  The NBDD then relays the datagrams to each of the nodes
  3440.    specified by the destination name.
  3441.  
  3442.    An NBDD may not be capable of sending a NetBIOS datagram to a
  3443.    particular NetBIOS name, including the broadcast NetBIOS name ("*")
  3444.    defined above.  A query mechanism is available to the end- node to
  3445.    determine if a NBDD will be able to relay a datagram to a given name.
  3446.    Before a datagram, or its fragments, are sent to the NBDD the P or M
  3447.    node may send a DATAGRAM QUERY REQUEST packet to the NBDD with the
  3448.    DESTINATION_NAME from the DATAGRAM SERVICE packet(s).  The NBDD will
  3449.    respond with a DATAGRAM POSITIVE QUERY RESPONSE if it will relay
  3450.    datagrams to the specified destination name.  After a positive
  3451.    response the end-node unicasts the datagram to the NBDD.  If the NBDD
  3452.    will not be able to relay a datagram to the destination name
  3453.    specified in the query, a DATAGRAM NEGATIVE QUERY RESPONSE packet is
  3454.    returned.  If the NBDD can not distribute a datagram, the end-node
  3455.    then has the option of getting the name's owner list from the NBNS
  3456.    and sending the datagram directly to each of the owners.
  3457.  
  3458.    An NBDD must be able to respond to DATAGRAM QUERY REQUEST packets.
  3459.    The response may always be positive.  However, the usage or
  3460.    implementation of the query mechanism by a P or M node is optional.
  3461.    An implementation may always unicast the NetBIOS datagram to the NBDD
  3462.    without asking if it will be relayed.  Except for the datagram query
  3463.    facility described above, an NBDD provides no feedback to indicate
  3464.    whether it forwarded a datagram.
  3465.  
  3466. 18.  NODE CONFIGURATION PARAMETERS
  3467.  
  3468.      -  B NODES:
  3469.           -  Node's permanent unique name
  3470.           -  Whether IGMP is in use
  3471.           -  Broadcast IP address to use
  3472.  
  3473.  
  3474.  
  3475. NetBIOS Working Group                                          [Page 58]
  3476.  
  3477.  
  3478. RFC 1001                                                      March 1987
  3479.  
  3480.  
  3481.           -  Whether NetBIOS session keep-alives are needed
  3482.           -  Usable UDP data field length (to control fragmentation)
  3483.      -  P NODES:
  3484.           -  Node's permanent unique name
  3485.           -  IP address of NBNS
  3486.           -  IP address of NBDD
  3487.           -  Whether NetBIOS session keep-alives are needed
  3488.           -  Usable UDP data field length (to control fragmentation)
  3489.      -  M NODES:
  3490.           -  Node's permanent unique name
  3491.           -  Whether IGMP is in use
  3492.           -  Broadcast IP address to use
  3493.           -  IP address of NBNS
  3494.           -  IP address of NBDD
  3495.           -  Whether NetBIOS session keep-alives are needed
  3496.           -  Usable UDP data field length (to control fragmentation)
  3497.  
  3498.  
  3499. 19.  MINIMAL CONFORMANCE
  3500.  
  3501.    To ensure multi-vendor interoperability, a minimally conforming
  3502.    implementation based on this specification must observe the following
  3503.    rules:
  3504.  
  3505.    a)   A node designed to work only in a broadcast area must
  3506.         conform to the B node specification.
  3507.  
  3508.    b)   A node designed to work only in an internet must conform to
  3509.         the P node specification.
  3510.  
  3511.  
  3512.  
  3513.  
  3514.  
  3515.  
  3516.  
  3517.  
  3518.  
  3519.  
  3520.  
  3521.  
  3522.  
  3523.  
  3524.  
  3525.  
  3526.  
  3527.  
  3528.  
  3529.  
  3530.  
  3531.  
  3532.  
  3533.  
  3534.  
  3535. NetBIOS Working Group                                          [Page 59]
  3536.  
  3537.  
  3538. RFC 1001                                                      March 1987
  3539.  
  3540.  
  3541.  
  3542. REFERENCES
  3543.  
  3544.  
  3545.       [1]  "Protocol Standard For a NetBIOS Service on a TCP/UDP
  3546.            Transport: Detailed Specifications", RFC 1002, March 1987.
  3547.  
  3548.       [2]  IBM Corp., "IBM PC Network Technical Reference Manual", No.
  3549.            6322916, First Edition, September 1984.
  3550.  
  3551.       [3]  J. Postel (Ed.), "Transmission Control Protocol", RFC 793,
  3552.            September 1981.
  3553.  
  3554.       [4]  MIL-STD-1778
  3555.  
  3556.       [5]  J. Postel, "User Datagram Protocol", RFC 768, 28 August
  3557.            1980.
  3558.  
  3559.       [6]  J. Reynolds, J. Postel, "Assigned Numbers", RFC 990,
  3560.            November 1986.
  3561.  
  3562.       [7]  J.  Postel, "Internet Protocol", RFC 791, September 1981.
  3563.  
  3564.       [8]  J. Mogul, "Internet Subnets", RFC 950, October 1984
  3565.  
  3566.       [9]  J.  Mogul, "Broadcasting Internet Datagrams in the Presence
  3567.            of Subnets", RFC 922, October 1984.
  3568.  
  3569.       [10] J.  Mogul, "Broadcasting Internet Datagrams", RFC 919,
  3570.            October 1984.
  3571.  
  3572.       [11] P. Mockapetris, "Domain Names - Concepts and Facilities",
  3573.            RFC 882, November 1983.
  3574.  
  3575.       [12] P. Mockapetris, "Domain Names - Implementation and
  3576.            Specification", RFC 883, November 1983.
  3577.  
  3578.       [13] P. Mockapetris, "Domain System Changes and Observations",
  3579.            RFC 973, January 1986.
  3580.  
  3581.       [14] C. Partridge, "Mail Routing and the Domain System", RFC 974,
  3582.            January 1986.
  3583.  
  3584.       [15] S. Deering, D. Cheriton, "Host Groups: A Multicast Extension
  3585.            to the Internet Protocol", RFC 966, December 1985.
  3586.  
  3587.       [16] S. Deering, "Host Extensions for IP Multicasting", RFC 988,
  3588.            July 1986.
  3589.  
  3590.  
  3591.  
  3592.  
  3593.  
  3594.  
  3595. NetBIOS Working Group                                          [Page 60]
  3596.  
  3597.  
  3598. RFC 1001                                                      March 1987
  3599.  
  3600.  
  3601. APPENDIX A
  3602.  
  3603.  
  3604.    This appendix contains supporting technical discussions.  It is not
  3605.    an integral part of the NetBIOS-over-TCP specification.
  3606.  
  3607.    INTEGRATION WITH INTERNET GROUP MULTICASTING
  3608.  
  3609.    The Netbios-over-TCP system described in this RFC may be easily
  3610.    integrated with the Internet Group Multicast system now being
  3611.    developed for the internet.
  3612.  
  3613.    In the main body of the RFC, the notion of a broadcast area was
  3614.    considered to be a single MAC-bridged "B-LAN".  However, the
  3615.    protocols defined will operate over an extended broadcast area
  3616.    resulting from the creation of a permanent Internet Multicast Group.
  3617.  
  3618.    Each separate broadcast area would be based on a separate permanent
  3619.    Internet Multicast Group.  This multicast group address would be used
  3620.    by B and M nodes as their BROADCAST_ADDRESS.
  3621.  
  3622.    In order to base the broadcast area on a multicast group certain
  3623.    additional procedures are required and certain constraints must be
  3624.    met.
  3625.  
  3626. A-1.  ADDITIONAL PROTOCOL REQUIRED IN B AND M NODES
  3627.  
  3628.    All B or M nodes operating on an IGMP based broadcast area must have
  3629.    IGMP support in their IP layer software.  These nodes must perform an
  3630.    IGMP join operation to enter the IGMP group before engaging in
  3631.    NetBIOS activity.
  3632.  
  3633. A-2.  CONSTRAINTS
  3634.  
  3635.    Broadcast Areas may overlap.  For this reason, end-nodes must be
  3636.    careful to examine the NetBIOS scope identifiers in all received
  3637.    broadcast packets.
  3638.  
  3639.    The NetBIOS broadcast protocols were designed for a network that
  3640.    exhibits a low average transit time and low rate of packet loss.  An
  3641.    IGMP based broadcast area must exhibit these characteristics.  In
  3642.    practice this will tend to constrain IGMP broadcast areas to a campus
  3643.    of networks interconnected by high-speed routers and inter-router
  3644.    links.  It is unlikely that transcontinental broadcast areas would
  3645.    exhibit the required characteristics.
  3646.  
  3647.  
  3648.  
  3649.  
  3650.  
  3651.  
  3652.  
  3653.  
  3654.  
  3655. NetBIOS Working Group                                          [Page 61]
  3656.  
  3657.  
  3658. RFC 1001                                                      March 1987
  3659.  
  3660.  
  3661. APPENDIX B
  3662.  
  3663.  
  3664.    This appendix contains supporting technical discussions.  It is not
  3665.    an integral part of the NetBIOS-over-TCP specification.
  3666.  
  3667. IMPLEMENTATION CONSIDERATIONS
  3668.  
  3669. B-1.  IMPLEMENTATION MODELS
  3670.  
  3671.    On any participating system, there must be some sort of NetBIOS
  3672.    Service to coordinate access by NetBIOS applications on that system.
  3673.  
  3674.    To analyze the impact of the NetBIOS-over-TCP architecture, we use
  3675.    the following three models of how a NetBIOS service might be
  3676.    implemented:
  3677.  
  3678.    1.   Combined Service and Application Model
  3679.  
  3680.         The NetBIOS service and application are both contained
  3681.         within a single process.  No interprocess communication is
  3682.         assumed within the system; all communication is over the
  3683.         network.  If multiple applications require concurrent access
  3684.         to the NetBIOS service, they must be folded into this
  3685.         monolithic process.
  3686.  
  3687.  
  3688.    2.   Common Kernel Element Model
  3689.  
  3690.         The NetBIOS Service is part of the operating system (perhaps
  3691.         as a device driver or a front-end processor).  The NetBIOS
  3692.         applications are normal operating system application
  3693.         processes.  The common element NetBIOS service contains all
  3694.         the information, such as the name and listen tables,
  3695.         required to co-ordinate the activities of the applications.
  3696.  
  3697.  
  3698.    3.   Non-Kernel Common Element Model
  3699.  
  3700.         The NetBIOS Service is implemented as an operating system
  3701.         application process.  The NetBIOS applications are other
  3702.         operating system application processes.  The service and the
  3703.         applications exchange data via operating system interprocess
  3704.         communication.  In a multi-processor (e.g.  network)
  3705.         operating system, each module may reside on a different cpu.
  3706.         The NetBIOS service process contains all the shared
  3707.         information required to coordinate the activities of the
  3708.         NetBIOS applications.  The applications may still require a
  3709.         subroutine library to facilitate access to the NetBIOS
  3710.         service.
  3711.  
  3712.  
  3713.  
  3714.  
  3715. NetBIOS Working Group                                          [Page 62]
  3716.  
  3717.  
  3718. RFC 1001                                                      March 1987
  3719.  
  3720.  
  3721.    For any of the implementation models, the TCP/IP service can be
  3722.    located in the operating system or split among the NetBIOS
  3723.    applications and the NetBIOS service processes.
  3724.  
  3725. B-1.1  MODEL INDEPENDENT CONSIDERATIONS
  3726.  
  3727.    The NetBIOS name service associates a NetBIOS name with a host.  The
  3728.    NetBIOS session service further binds the name to a specific TCP port
  3729.    for the duration of the session.
  3730.  
  3731.    The name service does not need to be informed of every Listen
  3732.    initiation and completion.  Since the names are not bound to any TCP
  3733.    port in the name service, the session service may use a different tcp
  3734.    port for each session established with the same local name.
  3735.  
  3736.    The TCP port used for the data transfer phase of a NetBIOS session
  3737.    can be globally well-known, locally well-known, or ephemeral.  The
  3738.    choice is a local implementation issue.  The RETARGET mechanism
  3739.    allows the binding of the NetBIOS session to a TCP connection to any
  3740.    TCP port, even to another IP node.
  3741.  
  3742.    An implementation may use the session service's globally well- known
  3743.    TCP port for the data transfer phase of the session by not using the
  3744.    RETARGET mechanism and, rather, accepting the session on the initial
  3745.    TCP connection.  This is permissible because the caller always uses
  3746.    an ephemeral TCP port.
  3747.  
  3748.    The complexity of the called end RETARGET mechanism is only required
  3749.    if a particular implementation needs it.  For many real system
  3750.    environments, such as an in-kernel NetBIOS service implementation, it
  3751.    will not be necessary to retarget incoming calls.  Rather, all
  3752.    NetBIOS sessions may be multiplexed through the single, well-known,
  3753.    NetBIOS session service port.  These implementations will not be
  3754.    burdened by the complexity of the RETARGET mechanism, nor will their
  3755.    callers be required to jump through the retargetting hoops.
  3756.  
  3757.    Nevertheless, all callers must be ready to process all possible
  3758.    SESSION RETARGET RESPONSEs.
  3759.  
  3760. B-1.2  SERVICE OPERATION FOR EACH MODEL
  3761.  
  3762.    It is possible to construct a NetBIOS service based on this
  3763.    specification for each of the above defined implementation models.
  3764.  
  3765.    For the common kernel element model, all the NetBIOS services, name,
  3766.    datagram, and session, are simple.  All the information is contained
  3767.    within a single entity and can therefore be accessed or modified
  3768.    easily.  A single port or multiple ports for the NetBIOS sessions can
  3769.    be used without adding any significant complexity to the session
  3770.    establishment procedure.  The only penalty is the amount of overhead
  3771.    incurred to get the NetBIOS messages and operation requests/responses
  3772.  
  3773.  
  3774.  
  3775. NetBIOS Working Group                                          [Page 63]
  3776.  
  3777.  
  3778. RFC 1001                                                      March 1987
  3779.  
  3780.  
  3781.    through the user and operating system boundary.
  3782.  
  3783.    The combined service and application model is very similar to the
  3784.    common kernel element model in terms of its requirements on the
  3785.    NetBIOS service.  The major difficulty is the internal coordination
  3786.    of the multiple NetBIOS service and application processes existing in
  3787.    a system of this type.
  3788.  
  3789.    The NetBIOS name, datagram and session protocols assume that the
  3790.    entities at the end-points have full control of the various well-
  3791.    known TCP and UDP ports.  If an implementation has multiple NetBIOS
  3792.    service entities, as would be the case with, for example, multiple
  3793.    applications each linked into a NetBIOS library, then that
  3794.    implementation must impose some internal coordination.
  3795.    Alternatively, use of the NetBIOS ports could be periodically
  3796.    assigned to one application or another.
  3797.  
  3798.    For the typical non-kernel common element mode implementation, three
  3799.    permanent system-wide NetBIOS service processes would exist:
  3800.  
  3801.      -  The name server
  3802.      -  the datagram server
  3803.      -  and session server
  3804.  
  3805.    Each server would listen for requests from the network on a UDP or
  3806.    TCP well-known port.  Each application would have a small piece of
  3807.    the NetBIOS service built-in, possibly a library.  Each application's
  3808.    NetBIOS support library would need to send a message to the
  3809.    particular server to request an operation, such as add name or send a
  3810.    datagram or set-up a listen.
  3811.  
  3812.    The non-kernel common element model does not require a TCP connection
  3813.    be passed between the two processes, session server and application.
  3814.    The RETARGET operation for an active NetBIOS Listen could be used by
  3815.    the session server to redirect the session to another TCP connection
  3816.    on a port allocated and owned by the application's NetBIOS support
  3817.    library.  The application with either a built-in or a kernel-based
  3818.    TCP/IP service could then accept the RETARGETed connection request
  3819.    and process it independently of the session server.
  3820.  
  3821.    On Unix(tm) or POSIX(tm), the NetBIOS session server could create
  3822.    sub-processes for incoming connections.  The open sessions would be
  3823.    passed through "fork" and "exec" to the child as an open file
  3824.    descriptor.  This approach is very limited, however.  A pre- existing
  3825.    process could not receive an incoming call.  And all call-ed
  3826.    processes would have to be sub-processes of the session server.
  3827.  
  3828. B-2.  CASUAL AND RESTRICTED NetBIOS APPLICATIONS
  3829.  
  3830.    Because NetBIOS was designed to operate in the open system
  3831.    environment of the typical personal computer, it does not have the
  3832.  
  3833.  
  3834.  
  3835. NetBIOS Working Group                                          [Page 64]
  3836.  
  3837.  
  3838. RFC 1001                                                      March 1987
  3839.  
  3840.  
  3841.    concept of privileged or unprivileged applications.  In many multi-
  3842.    user or multi-tasking operating systems applications are assigned
  3843.    privilege capabilities.  These capabilities limit the applications
  3844.    ability to acquire and use system resources.  For these systems it is
  3845.    important to allow casual applications, those with limited system
  3846.    privileges, and privileged applications, those with 'super-user'
  3847.    capabilities but access to them and their required resources is
  3848.    restricted, to access NetBIOS services.  It is also important to
  3849.    allow a systems administrator to restrict certain NetBIOS resources
  3850.    to a particular NetBIOS application.  For example, a file server
  3851.    based on the NetBIOS services should be able to have names and TCP
  3852.    ports for sessions only it can use.
  3853.  
  3854.    A NetBIOS application needs at least two local resources to
  3855.    communicate with another NetBIOS application, a NetBIOS name for
  3856.    itself and, typically, a session.  A NetBIOS service cannot require
  3857.    that NetBIOS applications directly use privileged system resources.
  3858.    For example, many systems require privilege to use TCP and UDP ports
  3859.    with numbers less than 1024.  This RFC requires reserved ports for
  3860.    the name and session servers of a NetBIOS service implementation.  It
  3861.    does not require the application to have direct access these reserved
  3862.    ports.
  3863.  
  3864.    For the name service, the manager of the local name table must have
  3865.    access to the NetBIOS name service's reserved UDP port.  It needs to
  3866.    listen for name service UDP packets to defend and define its local
  3867.    names to the network.  However, this manager need not be a part of a
  3868.    user application in a system environment which has privilege
  3869.    restrictions on reserved ports.
  3870.  
  3871.    The internal name server can require certain privileges to add,
  3872.    delete, or use a certain name, if an implementer wants the
  3873.    restriction.  This restriction is independent of the operation of the
  3874.    NetBIOS service protocols and would not necessarily prevent the
  3875.    interoperation of that implementation with another implementation.
  3876.  
  3877.    The session server is required to own a reserved TCP port for session
  3878.    establishment.  However, the ultimate TCP connection used to transmit
  3879.    and receive data does not have to be through that reserved port.  The
  3880.    RETARGET procedure the NetBIOS session to be shifted to another TCP
  3881.    connection, possibly through a different port at the called end.
  3882.    This port can be an unprivileged resource, with a value greater than
  3883.    1023.  This facilitates casual applications.
  3884.  
  3885.    Alternately, the RETARGET mechanism allows the TCP port used for data
  3886.    transmission and reception to be a reserved port.  Consequently, an
  3887.    application wishing to have access to its ports maintained by the
  3888.    system administrator can use these restricted TCP ports.  This
  3889.    facilitates privileged applications.
  3890.  
  3891.    A particular implementation may wish to require further special
  3892.  
  3893.  
  3894.  
  3895. NetBIOS Working Group                                          [Page 65]
  3896.  
  3897.  
  3898. RFC 1001                                                      March 1987
  3899.  
  3900.  
  3901.    privileges for session establishment, these could be associated with
  3902.    internal information.  It does not have to be based solely on TCP
  3903.    port allocation.  For example, a given NetBIOS name may only be used
  3904.    for sessions by applications with a certain system privilege level.
  3905.  
  3906.    The decision to use reserved or unreserved ports or add any
  3907.    additional name registration and usage authorization is a purely
  3908.    local implementation decision.  It is not required by the NetBIOS
  3909.    protocols specified in the RFC.
  3910.  
  3911. B-3.  TCP VERSUS SESSION KEEP-ALIVES
  3912.  
  3913.    The KEEP-ALIVE is a protocol element used to validate the existence
  3914.    of a connection.  A packet is sent to the remote connection partner
  3915.    to solicit a response which shows the connection is still
  3916.    functioning.  TCP KEEP-ALIVES are used at the TCP level on TCP
  3917.    connections while session KEEP-ALIVES are used on NetBIOS sessions.
  3918.    These protocol operations are always transparent to the connection
  3919.    user.  The user will only find out about a KEEP-ALIVE operation if it
  3920.    fails, therefore, if the connection is lost.
  3921.  
  3922.    The NetBIOS specification[2] requires the NetBIOS service to inform
  3923.    the session user if a session is lost when it is in a passive or
  3924.    active state.  Therefore,if the session user is only waiting for a
  3925.    receive operation and the session is dropped the NetBIOS service must
  3926.    inform the session user.  It cannot wait for a session send operation
  3927.    before it informs the user of the loss of the connection.
  3928.  
  3929.    This requirement stems from the management of scarce or volatile
  3930.    resources by a NetBIOS application.  If a particular user terminates
  3931.    a session with a server application by destroying the client
  3932.    application or the NetBIOS service without a NetBIOS Hang Up, the
  3933.    server application will want to clean-up or free allocated resources.
  3934.    This server application if it only receives and then sends a response
  3935.    requires the notification of the session abort in the passive state.
  3936.  
  3937.    The standard definition of a TCP service cannot detect loss of a
  3938.    connection when it is in a passive state, waiting for a packet to
  3939.    arrive.  Some TCP implementations have added a KEEP-ALIVE operation
  3940.    which is interoperable with implementations without this feature.
  3941.    These implementations send a packet with an invalid sequence number
  3942.    to the connection partner.  The partner, by specification, must
  3943.    respond with a packet showing the correct sequence number of the
  3944.    connection.  If no response is received from the remote partner
  3945.    within a certain time interval then the TCP service assumes the
  3946.    connection is lost.
  3947.  
  3948.    Since many TCP implementations do not have this KEEP-ALIVE function
  3949.    an optional NetBIOS KEEP-ALIVE operation has been added to the
  3950.    NetBIOS session protocols.  The NetBIOS KEEP-ALIVE uses the
  3951.    properties of TCP to solicit a response from the remote connection
  3952.  
  3953.  
  3954.  
  3955. NetBIOS Working Group                                          [Page 66]
  3956.  
  3957.  
  3958. RFC 1001                                                      March 1987
  3959.  
  3960.  
  3961.    partner.  A NetBIOS session message called KEEP-ALIVE is sent to the
  3962.    remote partner.  Since this results in TCP sending an IP packet to
  3963.    the remote partner, the TCP connection is active.  TCP will discover
  3964.    if the TCP connection is lost if the remote TCP partner does not
  3965.    acknowledge the IP packet.  Therefore, the NetBIOS session service
  3966.    does not send a response to a session KEEP ALIVE message.  It just
  3967.    throws it away.  The NetBIOS session service that transmits the KEEP
  3968.    ALIVE is informed only of the failure of the TCP connection.  It does
  3969.    not wait for a specific response message.
  3970.  
  3971.    A particular NetBIOS implementation should use KEEP-ALIVES if it is
  3972.    concerned with maintaining compatibility with the NetBIOS interface
  3973.    specification[2].  Compatibility is especially important if the
  3974.    implementation wishes to support existing NetBIOS applications, which
  3975.    typically require the session loss detection on their servers, or
  3976.    future applications which were developed for implementations with
  3977.    session loss detection.
  3978.  
  3979. B-4.  RETARGET ALGORITHMS
  3980.  
  3981.    This section contains 2 suggestions for RETARGET algorithms.  They
  3982.    are called the "straight" and "stack" methods.  The algorithm in the
  3983.    body of the RFC uses the straight method.  Implementation of either
  3984.    algorithm must take into account the Session establishment maximum
  3985.    retry count.  The retry count is the maximum number of TCP connect
  3986.    operations allowed before a failure is reported.
  3987.  
  3988.    The straight method forces the session establishment procedure to
  3989.    begin a retry after a retargetting failure with the initial node
  3990.    returned from the name discovery procedure.  A retargetting failure
  3991.    is when a TCP connection attempt fails because of a time- out or a
  3992.    NEGATIVE SESSION RESPONSE is received with an error code specifying
  3993.    NOT LISTENING ON CALLED NAME.  If any other failure occurs the
  3994.    session establishment procedure should retry from the call to the
  3995.    name discovery procedure.
  3996.  
  3997.    A minimum of 2 retries, either from a retargetting or a name
  3998.    discovery failure.  This will give the session service a chance to
  3999.    re-establish a NetBIOS Listen or, more importantly, allow the NetBIOS
  4000.    scope, local name service or the NBNS, to re-learn the correct IP
  4001.    address of a NetBIOS name.
  4002.  
  4003.    The stack method operates similarly to the straight method.  However,
  4004.    instead of retrying at the initial node returned by the name
  4005.    discovery procedure, it restarts with the IP address of the last node
  4006.    which sent a SESSION RETARGET RESPONSE prior to the retargetting
  4007.    failure.  To limit the stack method, any one host can only be tried a
  4008.    maximum of 2 times.
  4009.  
  4010.  
  4011.  
  4012.  
  4013.  
  4014.  
  4015. NetBIOS Working Group                                          [Page 67]
  4016.  
  4017.  
  4018. RFC 1001                                                      March 1987
  4019.  
  4020.  
  4021. B-5.  NBDD SERVICE
  4022.  
  4023.    If the NBDD does not forward datagrams then don't provide Group and
  4024.    Broadcast NetBIOS datagram services to the NetBIOS user.  Therefore,
  4025.    ignore the implementation of the query request and, when get a
  4026.    negative response, acquiring the membership list of IP addresses and
  4027.    sending the datagram as a unicast to each member.
  4028.  
  4029. B-6.  APPLICATION CONSIDERATIONS
  4030.  
  4031. B-6.1  USE OF NetBIOS DATAGRAMS
  4032.  
  4033.    Certain existing NetBIOS applications use NetBIOS datagrams as a
  4034.    foundation for their own connection-oriented protocols.  This can
  4035.    cause excessive NetBIOS name query activity and place a substantial
  4036.    burden on the network, server nodes, and other end- nodes.  It is
  4037.    recommended that this practice be avoided in new applications.
  4038.  
  4039.  
  4040.  
  4041.  
  4042.  
  4043.  
  4044.  
  4045.  
  4046.  
  4047.  
  4048.  
  4049.  
  4050.  
  4051.  
  4052.  
  4053.  
  4054.  
  4055.  
  4056.  
  4057.  
  4058.  
  4059.  
  4060.  
  4061.  
  4062.  
  4063.  
  4064.  
  4065.  
  4066.  
  4067.  
  4068.  
  4069.  
  4070.  
  4071.  
  4072.  
  4073.  
  4074.  
  4075. NetBIOS Working Group                                          [Page 68]
  4076.  
  4077.  
  4078.  
  4079.  
  4080.  
  4081.