summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdoc/CIFS-TR-1p00_FINAL.pdfbin0 -> 611400 bytes
-rwxr-xr-xdoc/rfc1002.html4098
2 files changed, 4098 insertions, 0 deletions
diff --git a/doc/CIFS-TR-1p00_FINAL.pdf b/doc/CIFS-TR-1p00_FINAL.pdf
new file mode 100755
index 0000000..64b4fa6
--- /dev/null
+++ b/doc/CIFS-TR-1p00_FINAL.pdf
Binary files differ
diff --git a/doc/rfc1002.html b/doc/rfc1002.html
new file mode 100755
index 0000000..31bd4df
--- /dev/null
+++ b/doc/rfc1002.html
@@ -0,0 +1,4098 @@
1<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2<HTML>
3<HEAD>
4<TITLE>RFC 1002 (rfc1002) - Protocol standard for a NetBIOS service on a TCP/UDP</TITLE>
5<META name="description" content="RFC 1002 - Protocol standard for a NetBIOS service on a TCP/UDP transport: Detailed specifications">
6<META name="also" content="STD0019">
7<script language="JavaScript1.2">
8function erfc(s)
9{document.write("<A href=\"/rfccomment.php?rfcnum="+s+"\" target=\"_blank\" onclick=\"window.open('/rfccomment.php?rfcnum="+s+"','Popup','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=680,height=530,left=30,top=43'); return false;\")>Comment on RFC "+s+"</A>\n");}
10//-->
11</script>
12</HEAD>
13<BODY BGCOLOR="#ffffff" TEXT="#000000">
14<P ALIGN=CENTER><IMG SRC="/images/library.jpg" HEIGHT=62 WIDTH=150 BORDER="0" ALIGN="MIDDLE" ALT=""></P>
15<H1 ALIGN=CENTER>RFC 1002 (RFC1002)</H1>
16<P ALIGN=CENTER>Internet RFC/STD/FYI/BCP Archives</P>
17
18<DIV ALIGN=CENTER>[ <a href="/rfcs/">RFC Index</a> | <A HREF="/rfcs/rfcsearch.html">RFC Search</A> | <a href="/faqs/">Usenet FAQs</a> | <a href="/contrib/">Web FAQs</a> | <a href="/docs/">Documents</a> | <a href="http://www.city-data.com/">Cities</a> ]
19<P>
20<STRONG>Alternate Formats:</STRONG>
21 <A HREF="/ftp/rfc/rfc1002.txt">rfc1002.txt</A> |
22 <A HREF="/ftp/rfc/pdf/rfc1002.txt.pdf">rfc1002.txt.pdf</A></DIV>
23<p align=center><script language="JavaScript"><!--
24erfc("1002");
25// --></script></p>
26<h3 align=center>RFC 1002 - Protocol standard for a NetBIOS service on a TCP/UDP transport: Detailed specifications</h3>
27<HR SIZE=2 NOSHADE>
28<PRE>
29
30Network Working Group
31Request for Comments: 1002 March, 1987
32
33 PROTOCOL STANDARD FOR A NetBIOS SERVICE
34 ON A TCP/UDP TRANSPORT:
35 DETAILED SPECIFICATIONS
36
37 ABSTRACT
38
39This RFC defines a proposed standard protocol to support NetBIOS
40services in a TCP/IP environment. Both local network and internet
41operation are supported. Various node types are defined to accommodate
42local and internet topologies and to allow operation with or without the
43use of IP broadcast.
44
45This RFC gives the detailed specifications of the NetBIOS-over-TCP
46packets, protocols, and defined constants and variables. A more general
47overview is found in a companion RFC, "Protocol Standard For a NetBIOS
48Service on a TCP/UDP Transport: Concepts and Methods".
49
50 TABLE OF CONTENTS
51
521. STATUS OF THIS MEMO 4
53
542. ACKNOWLEDGEMENTS 4
55
563. INTRODUCTION 5
57
584. PACKET DESCRIPTIONS 5
59 4.1 NAME FORMAT 5
60 4.2 NAME SERVICE PACKETS 7
61 4.2.1 GENERAL FORMAT OF NAME SERVICE PACKETS 7
62 4.2.1.1 HEADER 8
63 4.2.1.2 QUESTION SECTION 10
64 4.2.1.3 RESOURCE RECORD 11
65 4.2.2 NAME REGISTRATION REQUEST 13
66 4.2.3 NAME OVERWRITE REQUEST &amp; DEMAND 14
67 4.2.4 NAME REFRESH REQUEST 15
68 4.2.5 POSITIVE NAME REGISTRATION RESPONSE 16
69 4.2.6 NEGATIVE NAME REGISTRATION RESPONSE 16
70 4.2.7 END-NODE CHALLENGE REGISTRATION RESPONSE 17
71 4.2.8 NAME CONFLICT DEMAND 18
72 4.2.9 NAME RELEASE REQUEST &amp; DEMAND 19
73 4.2.10 POSITIVE NAME RELEASE RESPONSE 20
74 4.2.11 NEGATIVE NAME RELEASE RESPONSE 20
75 4.2.12 NAME QUERY REQUEST 21
76 4.2.13 POSITIVE NAME QUERY RESPONSE 22
77 4.2.14 NEGATIVE NAME QUERY RESPONSE 23
78 4.2.15 REDIRECT NAME QUERY RESPONSE 24
79 4.2.16 WAIT FOR ACKNOWLEDGEMENT (WACK) RESPONSE 25
80 4.2.17 NODE STATUS REQUEST 26
81 4.2.18 NODE STATUS RESPONSE 27
82 4.3 SESSION SERVICE PACKETS 29
83 4.3.1 GENERAL FORMAT OF SESSION PACKETS 29
84 4.3.2 SESSION REQUEST PACKET 30
85 4.3.3 POSITIVE SESSION RESPONSE PACKET 31
86 4.3.4 NEGATIVE SESSION RESPONSE PACKET 31
87 4.3.5 SESSION RETARGET RESPONSE PACKET 31
88 4.3.6 SESSION MESSAGE PACKET 32
89 4.3.7 SESSION KEEP ALIVE PACKET 32
90 4.4 DATAGRAM SERVICE PACKETS 32
91 4.4.1 NetBIOS DATAGRAM HEADER 32
92 4.4.2 DIRECT_UNIQUE, DIRECT_GROUP, &amp; BROADCAST DATAGRAM 33
93 4.4.3 DATAGRAM ERROR PACKET 34
94 4.4.4 DATAGRAM QUERY REQUEST 34
95 4.4.5 DATAGRAM POSITIVE AND NEGATIVE QUERY RESPONSE 34
96
975. PROTOCOL DESCRIPTIONS 35
98 5.1 NAME SERVICE PROTOCOLS 35
99 5.1.1 B-NODE ACTIVITY 35
100
101 5.1.1.1 B-NODE ADD NAME 35
102 5.1.1.2 B-NODE ADD_GROUP NAME 37
103 5.1.1.3 B-NODE FIND_NAME 37
104 5.1.1.4 B NODE NAME RELEASE 38
105 5.1.1.5 B-NODE INCOMING PACKET PROCESSING 39
106 5.1.2 P-NODE ACTIVITY 42
107 5.1.2.1 P-NODE ADD_NAME 42
108 5.1.2.2 P-NODE ADD GROUP NAME 45
109 5.1.2.3 P-NODE FIND NAME 45
110 5.1.2.4 P-NODE DELETE_NAME 46
111 5.1.2.5 P-NODE INCOMING PACKET PROCESSING 47
112 5.1.2.6 P-NODE TIMER INITIATED PROCESSING 49
113 5.1.3 M-NODE ACTIVITY 50
114 5.1.3.1 M-NODE ADD NAME 50
115 5.1.3.2 M-NODE ADD GROUP NAME 54
116 5.1.3.3 M-NODE FIND NAME 55
117 5.1.3.4 M-NODE DELETE NAME 56
118 5.1.3.5 M-NODE INCOMING PACKET PROCESSING 58
119 5.1.3.6 M-NODE TIMER INITIATED PROCESSING 60
120 5.1.4 NBNS ACTIVITY 60
121 5.1.4.1 NBNS INCOMING PACKET PROCESSING 61
122 5.1.4.2 NBNS TIMER INITIATED PROCESSING 66
123 5.2 SESSION SERVICE PROTOCOLS 67
124 5.2.1 SESSION ESTABLISHMENT PROTOCOLS 67
125 5.2.1.1 USER REQUEST PROCESSING 67
126 5.2.1.2 RECEIVED PACKET PROCESSING 71
127 5.2.2 SESSION DATA TRANSFER PROTOCOLS 72
128 5.2.2.1 USER REQUEST PROCESSING 72
129 5.2.2.2 RECEIVED PACKET PROCESSING 72
130 5.2.2.3 PROCESSING INITIATED BY TIMER 73
131 5.2.3 SESSION TERMINATION PROTOCOLS 73
132 5.2.3.1 USER REQUEST PROCESSING 73
133 5.2.3.2 RECEPTION INDICATION PROCESSING 73
134 5.3 NetBIOS DATAGRAM SERVICE PROTOCOLS 74
135 5.3.1 B NODE TRANSMISSION OF NetBIOS DATAGRAMS 74
136 5.3.2 P AND M NODE TRANSMISSION OF NetBIOS DATAGRAMS 76
137 5.3.3 RECEPTION OF NetBIOS DATAGRAMS BY ALL NODES 78
138 5.3.4 PROTOCOLS FOR THE NBDD 80
139
1406. DEFINED CONSTANTS AND VARIABLES 83
141
142REFERENCES 85
143
144 PROTOCOL STANDARD FOR A NetBIOS SERVICE
145 ON A TCP/UDP TRANSPORT:
146 DETAILED SPECIFICATIONS
147
1481. STATUS OF THIS MEMO
149
150 This RFC specifies a proposed standard for the DARPA Internet
151 community. Since this topic is new to the Internet community,
152 discussions and suggestions are specifically requested.
153
154 Please send written comments to:
155
156 Karl Auerbach
157 Epilogue Technology Corporation
158 P.O. Box 5432
159 Redwood City, CA 94063
160
161 Please send online comments to:
162
163 Avnish Aggarwal
164 Internet: <A HREF="mailto:mtxinu!excelan!avnish@ucbvax.berkeley.edu">mtxinu!excelan!avnish@ucbvax.berkeley.edu</A>
165 Usenet: ucbvax!mtxinu!excelan!avnish
166
167 Distribution of this memorandum is unlimited.
168
1692. ACKNOWLEDGEMENTS
170
171 This RFC has been developed under the auspices of the Internet
172 Activities Board.
173
174 The following individuals have contributed to the development of
175 this RFC:
176
177 Avnish Aggarwal Arvind Agrawal Lorenzo Aguilar
178 Geoffrey Arnold Karl Auerbach K. Ramesh Babu
179 Keith Ball Amatzia Ben-Artzi Vint Cerf
180 Richard Cherry David Crocker Steve Deering
181 Greg Ennis Steve Holmgren Jay Israel
182 David Kaufman Lee LaBarre James Lau
183 Dan Lynch Gaylord Miyata David Stevens
184 Steve Thomas Ishan Wu
185
186 The system proposed by this RFC does not reflect any existing
187 Netbios-over-TCP implementation. However, the design
188 incorporates considerable knowledge obtained from prior
189 implementations. Special thanks goes to the following
190 organizations which have provided this invaluable information:
191
192 CMC/Syros Excelan Sytek Ungermann-Bass
193
1943. INTRODUCTION
195
196 This RFC contains the detailed packet formats and protocol
197 specifications for NetBIOS-over-TCP. This RFC is a companion to
198 <A HREF="/rfcs/rfc1001.html">RFC 1001</A>, "Protocol Standard For a NetBIOS Service on a TCP/UDP
199 Transport: Concepts and Methods" [1].
200
2014. PACKET DESCRIPTIONS
202
203 Bit and byte ordering are defined by the most recent version of
204 "Assigned Numbers" [2].
205
2064.1. NAME FORMAT
207
208 The NetBIOS name representation in all NetBIOS packets (for NAME,
209 SESSION, and DATAGRAM services) is defined in the Domain Name
210 Service <A HREF="/rfcs/rfc883.html">RFC 883</A>[3] as "compressed" name messages. This format is
211 called "second-level encoding" in the section entitled
212 "Representation of NetBIOS Names" in the Concepts and Methods
213 document.
214
215 For ease of description, the first two paragraphs from page 31,
216 the section titled "Domain name representation and compression",
217 of <A HREF="/rfcs/rfc883.html">RFC 883</A> are replicated here:
218
219 Domain names messages are expressed in terms of a sequence
220 of labels. Each label is represented as a one octet length
221 field followed by that number of octets. Since every domain
222 name ends with the null label of the root, a compressed
223 domain name is terminated by a length byte of zero. The
224 high order two bits of the length field must be zero, and
225 the remaining six bits of the length field limit the label
226 to 63 octets or less.
227
228 To simplify implementations, the total length of label
229 octets and label length octets that make up a domain name is
230 restricted to 255 octets or less.
231
232 The following is the uncompressed representation of the NetBIOS name
233 "FRED ", which is the 4 ASCII characters, F, R, E, D, followed by 12
234 space characters (0x20). This name has the SCOPE_ID: "NETBIOS.COM"
235
236 EGFCEFEECACACACACACACACACACACACA.NETBIOS.COM
237
238 This uncompressed representation of names is called "first-level
239 encoding" in the section entitled "Representation of NetBIOS Names"
240 in the Concepts and Methods document.
241
242 The following is a pictographic representation of the compressed
243 representation of the previous uncompressed Domain Name
244 representation.
245
246 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
247 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
248 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
249 | 0x20 | E (0x45) | G (0x47) | F (0x46) |
250 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
251 | C (0x43) | E (0x45) | F (0x46) | E (0x45) |
252 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
253 | E (0x45) | C (0x43) | A (0x41) | C (0x43) |
254 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
255 | A (0x41) | C (0x43) | A (0x41) | C (0x43) |
256 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
257 | A (0x41) | C (0x43) | A (0x41) | C (0x43) |
258 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
259 | A (0x41) | C (0x43) | A (0x41) | C (0x43) |
260 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
261 | A (0x41) | C (0x43) | A (0x41) | C (0x43) |
262 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
263 | A (0x41) | C (0x43) | A (0x41) | C (0x43) |
264 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
265 | A (0X41) | 0x07 | N (0x4E) | E (0x45) |
266 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
267 | T (0x54) | B (0x42) | I (0x49) | O (0x4F) |
268 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
269 | S (0x53) | 0x03 | C (0x43) | O (0x4F) |
270 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
271 | M (0x4D) | 0x00 |
272 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
273
274 Each section of a domain name is called a label [7 (page 31)]. A
275 label can be a maximum of 63 bytes. The first byte of a label in
276 compressed representation is the number of bytes in the label. For
277 the above example, the first 0x20 is the number of bytes in the
278 left-most label, EGFCEFEECACACACACACACACACACACACA, of the domain
279 name. The bytes following the label length count are the characters
280 of the label. The following labels are in sequence after the first
281 label, which is the encoded NetBIOS name, until a zero (0x00) length
282 count. The zero length count represents the root label, which is
283 always null.
284
285 A label length count is actually a 6-bit field in the label length
286 field. The most significant 2 bits of the field, bits 7 and 6, are
287 flags allowing an escape from the above compressed representation.
288 If bits 7 and 6 are both set (11), the following 14 bits are an
289 offset pointer into the full message to the actual label string from
290 another domain name that belongs in this name. This label pointer
291 allows for a further compression of a domain name in a packet.
292
293 NetBIOS implementations can only use label string pointers in Name
294 Service packets. They cannot be used in Session or Datagram Service
295 packets.
296
297 The other two possible values for bits 7 and 6 (01 and 10) of a label
298 length field are reserved for future use by <A HREF="/rfcs/rfc883.html">RFC 883</A>[2 (page 32)].
299
300 Note that the first octet of a compressed name must contain one of
301 the following bit patterns. (An "x" indicates a bit whose value may
302 be either 0 or 1.):
303
304 00100000 - Netbios name, length must be 32 (decimal)
305 11xxxxxx - Label string pointer
306 10xxxxxx - Reserved
307 01xxxxxx - Reserved
308
3094.2. NAME SERVICE PACKETS
310
3114.2.1. GENERAL FORMAT OF NAME SERVICE PACKETS
312
313 The NetBIOS Name Service packets follow the packet structure defined
314 in the Domain Name Service (DNS) <A HREF="/rfcs/rfc883.html">RFC 883</A> [7 (pg 26-31)]. The
315 structures are compatible with the existing DNS packet formats,
316 however, additional types and codes have been added to work with
317 NetBIOS.
318
319 If Name Service packets are sent over a TCP connection they are
320 preceded by a 16 bit unsigned integer representing the length of the
321 Name Service packet.
322
323 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
324 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
325 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
326 | |
327 + ------ ------- +
328 | HEADER |
329 + ------ ------- +
330 | |
331 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
332 | |
333 / QUESTION ENTRIES /
334 | |
335 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
336 | |
337 / ANSWER RESOURCE RECORDS /
338 | |
339 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
340 | |
341 / AUTHORITY RESOURCE RECORDS /
342 | |
343 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
344 | |
345 / ADDITIONAL RESOURCE RECORDS /
346 | |
347 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
348
3494.2.1.1. HEADER
350
351 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
352 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
353 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
354 | NAME_TRN_ID | OPCODE | NM_FLAGS | RCODE |
355 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
356 | QDCOUNT | ANCOUNT |
357 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
358 | NSCOUNT | ARCOUNT |
359 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
360
361 Field Description
362
363 NAME_TRN_ID Transaction ID for Name Service Transaction.
364 Requestor places a unique value for each active
365 transaction. Responder puts NAME_TRN_ID value
366 from request packet in response packet.
367
368 OPCODE Packet type code, see table below.
369
370 NM_FLAGS Flags for operation, see table below.
371
372 RCODE Result codes of request. Table of RCODE values
373 for each response packet below.
374
375 QDCOUNT Unsigned 16 bit integer specifying the number of
376 entries in the question section of a Name
377
378 Service packet. Always zero (0) for responses.
379 Must be non-zero for all NetBIOS Name requests.
380
381 ANCOUNT Unsigned 16 bit integer specifying the number of
382 resource records in the answer section of a Name
383 Service packet.
384
385 NSCOUNT Unsigned 16 bit integer specifying the number of
386 resource records in the authority section of a
387 Name Service packet.
388
389 ARCOUNT Unsigned 16 bit integer specifying the number of
390 resource records in the additional records
391 section of a Name Service packet.
392
393 The OPCODE field is defined as:
394
395 0 1 2 3 4
396 +---+---+---+---+---+
397 | R | OPCODE |
398 +---+---+---+---+---+
399
400 Symbol Bit(s) Description
401
402 OPCODE 1-4 Operation specifier:
403 0 = query
404 5 = registration
405 6 = release
406 7 = WACK
407 8 = refresh
408
409 R 0 RESPONSE flag:
410 if bit == 0 then request packet
411 if bit == 1 then response packet.
412
413 The NM_FLAGS field is defined as:
414
415 0 1 2 3 4 5 6
416 +---+---+---+---+---+---+---+
417 |AA |TC |RD |RA | 0 | 0 | B |
418 +---+---+---+---+---+---+---+
419
420 Symbol Bit(s) Description
421
422 B 6 Broadcast Flag.
423 = 1: packet was broadcast or multicast
424 = 0: unicast
425
426 RA 3 Recursion Available Flag.
427
428 Only valid in responses from a NetBIOS Name
429 Server -- must be zero in all other
430 responses.
431
432 If one (1) then the NBNS supports recursive
433 query, registration, and release.
434
435 If zero (0) then the end-node must iterate
436 for query and challenge for registration.
437
438 RD 2 Recursion Desired Flag.
439
440 May only be set on a request to a NetBIOS
441 Name Server.
442
443 The NBNS will copy its state into the
444 response packet.
445
446 If one (1) the NBNS will iterate on the
447 query, registration, or release.
448
449 TC 1 Truncation Flag.
450
451 Set if this message was truncated because the
452 datagram carrying it would be greater than
453 576 bytes in length. Use TCP to get the
454 information from the NetBIOS Name Server.
455
456 AA 0 Authoritative Answer flag.
457
458 Must be zero (0) if R flag of OPCODE is zero
459 (0).
460
461 If R flag is one (1) then if AA is one (1)
462 then the node responding is an authority for
463 the domain name.
464
465 End nodes responding to queries always set
466 this bit in responses.
467
4684.2.1.2. QUESTION SECTION
469
470 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
471 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
472 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
473 | |
474 / QUESTION_NAME /
475 / /
476 | |
477 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
478 | QUESTION_TYPE | QUESTION_CLASS |
479 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
480
481 Field Description
482
483 QUESTION_NAME The compressed name representation of the
484 NetBIOS name for the request.
485
486 QUESTION_TYPE The type of request. The values for this field
487 are specified for each request.
488
489 QUESTION_CLASS The class of the request. The values for this
490 field are specified for each request.
491
492 QUESTION_TYPE is defined as:
493
494 Symbol Value Description:
495
496 NB 0x0020 NetBIOS general Name Service Resource Record
497 NBSTAT 0x0021 NetBIOS NODE STATUS Resource Record (See NODE
498 STATUS REQUEST)
499
500 QUESTION_CLASS is defined as:
501
502 Symbol Value Description:
503
504 IN 0x0001 Internet class
505
5064.2.1.3. RESOURCE RECORD
507
508 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
509 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
510 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
511 | |
512 / RR_NAME /
513 / /
514 | |
515 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
516 | RR_TYPE | RR_CLASS |
517 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
518 | TTL |
519 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
520 | RDLENGTH | |
521 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
522 / /
523 / RDATA /
524 | |
525 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
526
527 Field Description
528
529 RR_NAME The compressed name representation of the
530 NetBIOS name corresponding to this resource
531 record.
532
533 RR_TYPE Resource record type code
534
535 RR_CLASS Resource record class code
536
537 TTL The Time To Live of a the resource record's
538 name.
539
540 RDLENGTH Unsigned 16 bit integer that specifies the
541 number of bytes in the RDATA field.
542
543 RDATA RR_CLASS and RR_TYPE dependent field. Contains
544 the resource information for the NetBIOS name.
545
546 RESOURCE RECORD RR_TYPE field definitions:
547
548 Symbol Value Description:
549
550 A 0x0001 IP address Resource Record (See REDIRECT NAME
551 QUERY RESPONSE)
552 NS 0x0002 Name Server Resource Record (See REDIRECT
553
554 NAME QUERY RESPONSE)
555 NULL 0x000A NULL Resource Record (See WAIT FOR
556 ACKNOWLEDGEMENT RESPONSE)
557 NB 0x0020 NetBIOS general Name Service Resource Record
558 (See NB_FLAGS and NB_ADDRESS, below)
559 NBSTAT 0x0021 NetBIOS NODE STATUS Resource Record (See NODE
560 STATUS RESPONSE)
561
562 RESOURCE RECORD RR_CLASS field definitions:
563
564 Symbol Value Description:
565
566 IN 0x0001 Internet class
567
568 NB_FLAGS field of the RESOURCE RECORD RDATA field for RR_TYPE of
569 "NB":
570
571 1 1 1 1 1 1
572 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
573 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
574 | G | ONT | RESERVED |
575 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
576
577 Symbol Bit(s) Description:
578
579 RESERVED 3-15 Reserved for future use. Must be zero (0).
580 ONT 1,2 Owner Node Type:
581 00 = B node
582 01 = P node
583 10 = M node
584 11 = Reserved for future use
585 For registration requests this is the
586 claimant's type.
587 For responses this is the actual owner's
588 type.
589
590 G 0 Group Name Flag.
591 If one (1) then the RR_NAME is a GROUP
592 NetBIOS name.
593 If zero (0) then the RR_NAME is a UNIQUE
594 NetBIOS name.
595
596 The NB_ADDRESS field of the RESOURCE RECORD RDATA field for
597 RR_TYPE of "NB" is the IP address of the name's owner.
598
5994.2.2. NAME REGISTRATION REQUEST
600
601 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
602 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
603 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
604 | NAME_TRN_ID |0| 0x5 |0|0|1|0|0 0|B| 0x0 |
605 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
606 | 0x0001 | 0x0000 |
607 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
608 | 0x0000 | 0x0001 |
609 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
610 | |
611 / QUESTION_NAME /
612 / /
613 | |
614 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
615 | NB (0x0020) | IN (0x0001) |
616 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
617 | |
618 / RR_NAME /
619 / /
620 | |
621 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
622 | NB (0x0020) | IN (0x0001) |
623 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
624 | TTL |
625 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
626 | 0x0006 | NB_FLAGS |
627 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
628 | NB_ADDRESS |
629 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
630
631 Since the RR_NAME is the same name as the QUESTION_NAME, the
632 RR_NAME representation must use pointers to the QUESTION_NAME
633 name's labels to guarantee the length of the datagram is less
634 than the maximum 576 bytes. See section above on name formats
635 and also page 31 and 32 of <A HREF="/rfcs/rfc883.html">RFC 883</A>, Domain Names - Implementation
636 and Specification, for a complete description of compressed name
637 label pointers.
638
6394.2.3. NAME OVERWRITE REQUEST &amp; DEMAND
640
641 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
642 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
643 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
644 | NAME_TRN_ID |0| 0x5 |0|0|0|0|0 0|B| 0x0 |
645 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
646 | 0x0001 | 0x0000 |
647 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
648 | 0x0000 | 0x0001 |
649 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
650 | |
651 / QUESTION_NAME /
652 / /
653 | |
654 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
655 | NB (0x0020) | IN (0x0001) |
656 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
657 | |
658 / RR_NAME /
659 / /
660 | |
661 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
662 | NB (0x0020) | IN (0x0001) |
663 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
664 | TTL |
665 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
666 | 0x0006 | NB_FLAGS |
667 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
668 | NB_ADDRESS |
669 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
670
6714.2.4. NAME REFRESH REQUEST
672
673 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
674 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
675 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
676 | NAME_TRN_ID |0| 0x9 |0|0|0|0|0 0|B| 0x0 |
677 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
678 | 0x0001 | 0x0000 |
679 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
680 | 0x0000 | 0x0001 |
681 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
682 | |
683 / QUESTION_NAME /
684 / /
685 | |
686 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
687 | NB (0x0020) | IN (0x0001) |
688 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
689 | |
690 / RR_NAME /
691 / /
692 | |
693 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
694 | NB (0x0020) | IN (0x0001) |
695 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
696 | TTL |
697 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
698 | 0x0006 | NB_FLAGS |
699 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
700 | NB_ADDRESS |
701 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
702
7034.2.5. POSITIVE NAME REGISTRATION RESPONSE
704
705 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
706 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
707 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
708 | NAME_TRN_ID |1| 0x5 |1|0|1|1|0 0|0| 0x0 |
709 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
710 | 0x0000 | 0x0001 |
711 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
712 | 0x0000 | 0x0000 |
713 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
714 | |
715 / RR_NAME /
716 / /
717 | |
718 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
719 | NB (0x0020) | IN (0x0001) |
720 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
721 | TTL |
722 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
723 | 0x0006 | NB_FLAGS |
724 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
725 | NB_ADDRESS |
726 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
727
7284.2.6. NEGATIVE NAME REGISTRATION RESPONSE
729
730 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
731 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
732 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
733 | NAME_TRN_ID |1| 0x5 |1|0|1|1|0 0|0| RCODE |
734 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
735 | 0x0000 | 0x0001 |
736 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
737 | 0x0000 | 0x0000 |
738 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
739 | |
740 / RR_NAME /
741 / /
742 | |
743 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
744 | NB (0x0020) | IN (0x0001) |
745 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
746 | TTL |
747 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
748 | 0x0006 | NB_FLAGS |
749 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
750 | NB_ADDRESS |
751 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
752
753 RCODE field values:
754
755 Symbol Value Description:
756
757 FMT_ERR 0x1 Format Error. Request was invalidly
758 formatted.
759 SRV_ERR 0x2 Server failure. Problem with NBNS, cannot
760 process name.
761 IMP_ERR 0x4 Unsupported request error. Allowable only
762 for challenging NBNS when gets an Update type
763 registration request.
764 RFS_ERR 0x5 Refused error. For policy reasons server
765 will not register this name from this host.
766 ACT_ERR 0x6 Active error. Name is owned by another node.
767 CFT_ERR 0x7 Name in conflict error. A UNIQUE name is
768 owned by more than one node.
769
7704.2.7. END-NODE CHALLENGE REGISTRATION RESPONSE
771
772 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
773 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
774 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
775 | NAME_TRN_ID |1| 0x5 |1|0|1|0|0 0|0| 0x0 |
776 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
777 | 0x0000 | 0x0001 |
778 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
779 | 0x0000 | 0x0000 |
780 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
781 | |
782 / RR_NAME /
783 / /
784 | |
785 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
786 | NB (0x0020) | IN (0x0001) |
787 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
788 | TTL |
789 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
790 | 0x0006 | NB_FLAGS |
791 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
792 | NB_ADDRESS |
793 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
794
7954.2.8. NAME CONFLICT DEMAND
796
797 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
798 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
799 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
800 | NAME_TRN_ID |1| 0x5 |1|0|1|1|0 0|0| 0x7 |
801 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
802 | 0x0000 | 0x0001 |
803 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
804 | 0x0000 | 0x0000 |
805 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
806 | |
807 / RR_NAME /
808 / /
809 | |
810 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
811 | NB (0x0020) | IN (0x0001) |
812 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
813 | 0x00000000 |
814 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
815 | 0x0006 |0|ONT|0| 0x000 |
816 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
817 | 0x00000000 |
818 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
819
820 This packet is identical to a NEGATIVE NAME REGISTRATION RESPONSE
821 with RCODE = CFT_ERR.
822
8234.2.9. NAME RELEASE REQUEST &amp; DEMAND
824
825 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
826 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
827 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
828 | NAME_TRN_ID |0| 0x6 |0|0|0|0|0 0|B| 0x0 |
829 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
830 | 0x0001 | 0x0000 |
831 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
832 | 0x0000 | 0x0001 |
833 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
834 | |
835 / QUESTION_NAME /
836 / /
837 | |
838 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
839 | NB (0x0020) | IN (0x0001) |
840 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
841 | |
842 / RR_NAME /
843 / /
844 | |
845 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
846 | NB (0x0020) | IN (0x0001) |
847 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
848 | 0x00000000 |
849 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
850 | 0x0006 | NB_FLAGS |
851 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
852 | NB_ADDRESS |
853 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
854
855 Since the RR_NAME is the same name as the QUESTION_NAME, the
856 RR_NAME representation must use label string pointers to the
857 QUESTION_NAME labels to guarantee the length of the datagram is
858 less than the maximum 576 bytes. This is the same condition as
859 with the NAME REGISTRATION REQUEST.
860
8614.2.10. POSITIVE NAME RELEASE RESPONSE
862
863 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
864 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
865 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
866 | NAME_TRN_ID |1| 0x6 |1|0|0|0|0 0|0| 0x0 |
867 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
868 | 0x0000 | 0x0001 |
869 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
870 | 0x0000 | 0x0000 |
871 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
872 | |
873 / RR_NAME /
874 / /
875 | |
876 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
877 | NB (0x0020) | IN (0x0001) |
878 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
879 | TTL |
880 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
881 | 0x0006 | NB_FLAGS |
882 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
883 | NB_ADDRESS |
884 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
885
8864.2.11. NEGATIVE NAME RELEASE RESPONSE
887
888 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
889 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
890 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
891 | NAME_TRN_ID |1| 0x6 |1|0|0|0|0 0|0| RCODE |
892 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
893 | 0x0000 | 0x0001 |
894 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
895 | 0x0000 | 0x0000 |
896 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
897 | |
898 / RR_NAME /
899 / /
900 | |
901 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
902 | NB (0x0020) | IN (0x0001) |
903 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
904 | TTL |
905 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
906 | 0x0006 | NB_FLAGS |
907 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
908 | NB_ADDRESS |
909 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
910
911 RCODE field values:
912
913 Symbol Value Description:
914
915 FMT_ERR 0x1 Format Error. Request was invalidly
916 formatted.
917
918 SRV_ERR 0x2 Server failure. Problem with NBNS, cannot
919 process name.
920
921 RFS_ERR 0x5 Refused error. For policy reasons server
922 will not release this name from this host.
923
924 ACT_ERR 0x6 Active error. Name is owned by another node.
925 Only that node may release it. A NetBIOS
926 Name Server can optionally allow a node to
927 release a name it does not own. This would
928 facilitate detection of inactive names for
929 nodes that went down silently.
930
9314.2.12. NAME QUERY REQUEST
932
933 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
934 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
935 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
936 | NAME_TRN_ID |0| 0x0 |0|0|1|0|0 0|B| 0x0 |
937 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
938 | 0x0001 | 0x0000 |
939 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
940 | 0x0000 | 0x0000 |
941 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
942 | |
943 / QUESTION_NAME /
944 / /
945 | |
946 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
947 | NB (0x0020) | IN (0x0001) |
948 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
949
9504.2.13. POSITIVE NAME QUERY RESPONSE
951
952 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
953 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
954 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
955 | NAME_TRN_ID |1| 0x0 |1|T|1|?|0 0|0| 0x0 |
956 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
957 | 0x0000 | 0x0001 |
958 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
959 | 0x0000 | 0x0000 |
960 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
961 | |
962 / RR_NAME /
963 / /
964 | |
965 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
966 | NB (0x0020) | IN (0x0001) |
967 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
968 | TTL |
969 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
970 | RDLENGTH | |
971 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
972 | |
973 / ADDR_ENTRY ARRAY /
974 / /
975 | |
976 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
977
978 The ADDR_ENTRY ARRAY a sequence of zero or more ADDR_ENTRY
979 records. Each ADDR_ENTRY record represents an owner of a name.
980 For group names there may be multiple entries. However, the list
981 may be incomplete due to packet size limitations. Bit 22, "T",
982 will be set to indicate truncated data.
983
984 Each ADDR_ENTRY has the following format:
985
986 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
987 | NB_FLAGS | NB_ADDRESS |
988 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
989 | NB_ADDRESS (continued) |
990 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
991
9924.2.14. NEGATIVE NAME QUERY RESPONSE
993
994 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
995 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
996 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
997 | NAME_TRN_ID |1| 0x0 |1|0|1|?|0 0|0| RCODE |
998 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
999 | 0x0000 | 0x0000 |
1000 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1001 | 0x0000 | 0x0000 |
1002 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1003 | |
1004 / RR_NAME /
1005 / /
1006 | |
1007 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1008 | NULL (0x000A) | IN (0x0001) |
1009 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1010 | 0x00000000 |
1011 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1012 | 0x0000 |
1013 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1014
1015 RCODE field values:
1016
1017 Symbol Value Description
1018
1019 FMT_ERR 0x1 Format Error. Request was invalidly
1020 formatted.
1021 SRV_ERR 0x2 Server failure. Problem with NBNS, cannot
1022 process name.
1023 NAM_ERR 0x3 Name Error. The name requested does not
1024 exist.
1025 IMP_ERR 0x4 Unsupported request error. Allowable only
1026 for challenging NBNS when gets an Update type
1027 registration request.
1028 RFS_ERR 0x5 Refused error. For policy reasons server
1029 will not register this name from this host.
1030
10314.2.15. REDIRECT NAME QUERY RESPONSE
1032
1033 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
1034 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1035 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1036 | NAME_TRN_ID |1| 0x0 |0|0|1|0|0 0|0| 0x0 |
1037 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1038 | 0x0000 | 0x0000 |
1039 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1040 | 0x0001 | 0x0001 |
1041 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1042 | |
1043 / RR_NAME /
1044 / /
1045 | |
1046 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1047 | NS (0x0002) | IN (0x0001) |
1048 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1049 | TTL |
1050 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1051 | RDLENGTH | |
1052 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
1053 | |
1054 / NSD_NAME /
1055 / /
1056 | |
1057 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1058 | |
1059 / RR_NAME /
1060 / /
1061 | |
1062 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1063 | A (0x0001) | IN (0x0001) |
1064 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1065 | TTL |
1066 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1067 | 0x0004 | NSD_IP_ADDR |
1068 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1069 | NSD_IP_ADDR, continued |
1070 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1071
1072 An end node responding to a NAME QUERY REQUEST always responds
1073 with the AA and RA bits set for both the NEGATIVE and POSITIVE
1074 NAME QUERY RESPONSE packets. An end node never sends a REDIRECT
1075 NAME QUERY RESPONSE packet.
1076
1077 When the requestor receives the REDIRECT NAME QUERY RESPONSE it
1078 must reiterate the NAME QUERY REQUEST to the NBNS specified by
1079 the NSD_IP_ADDR field of the A type RESOURCE RECORD in the
1080 ADDITIONAL section of the response packet. This is an optional
1081 packet for the NBNS.
1082
1083 The NSD_NAME and the RR_NAME in the ADDITIONAL section of the
1084 response packet are the same name. Space can be optimized if
1085 label string pointers are used in the RR_NAME which point to the
1086 labels in the NSD_NAME.
1087
1088 The RR_NAME in the AUTHORITY section is the name of the domain
1089 the NBNS called by NSD_NAME has authority over.
1090
10914.2.16. WAIT FOR ACKNOWLEDGEMENT (WACK) RESPONSE
1092
1093 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
1094 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1095 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1096 | NAME_TRN_ID |1| 0x7 |1|0|0|0|0 0|0| 0x0 |
1097 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1098 | 0x0000 | 0x0001 |
1099 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1100 | 0x0000 | 0x0000 |
1101 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1102 | |
1103 / RR_NAME /
1104 / /
1105 | |
1106 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1107 | NULL (0x0020) | IN (0x0001) |
1108 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1109 | TTL |
1110 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1111 | 0x0002 | OPCODE | NM_FLAGS | 0x0 |
1112 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1113
1114 The NAME_TRN_ID of the WACK RESPONSE packet is the same
1115 NAME_TRN_ID of the request that the NBNS is telling the requestor
1116 to wait longer to complete. The RR_NAME is the name from the
1117 request, if any. If no name is available from the request then
1118 it is a null name, single byte of zero.
1119
1120 The TTL field of the ResourceRecord is the new time to wait, in
1121 seconds, for the request to complete. The RDATA field contains
1122 the OPCODE and NM_FLAGS of the request.
1123
1124 A TTL value of 0 means that the NBNS can not estimate the time it
1125 may take to complete a response.
1126
11274.2.17. NODE STATUS REQUEST
1128
1129 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
1130 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1131 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1132 | NAME_TRN_ID |0| 0x0 |0|0|0|0|0 0|B| 0x0 |
1133 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1134 | 0x0001 | 0x0000 |
1135 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1136 | 0x0000 | 0x0000 |
1137 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1138 | |
1139 / QUESTION_NAME /
1140 | |
1141 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1142 | NBSTAT (0x0021) | IN (0x0001) |
1143 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1144
11454.2.18. NODE STATUS RESPONSE
1146
1147 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
1148 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1149 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1150 | NAME_TRN_ID |1| 0x0 |1|0|0|0|0 0|0| 0x0 |
1151 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1152 | 0x0000 | 0x0001 |
1153 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1154 | 0x0000 | 0x0000 |
1155 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1156 | |
1157 / RR_NAME /
1158 | |
1159 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1160 | NBSTAT (0x0021) | IN (0x0001) |
1161 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1162 | 0x00000000 |
1163 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1164 | RDLENGTH | NUM_NAMES | |
1165 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
1166 | |
1167 + +
1168 / NODE_NAME ARRAY /
1169 + +
1170 | |
1171 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1172 | |
1173 + +
1174 / STATISTICS /
1175 + +
1176 | |
1177 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1178
1179 The NODE_NAME ARRAY is an array of zero or more NUM_NAMES entries
1180 of NODE_NAME records. Each NODE_NAME entry represents an active
1181 name in the same NetBIOS scope as the requesting name in the
1182 local name table of the responder. RR_NAME is the requesting
1183 name.
1184
1185 NODE_NAME Entry:
1186
1187 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
1188 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1189 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1190 | |
1191 +--- ---+
1192 | |
1193 +--- NETBIOS FORMAT NAME ---+
1194 | |
1195 +--- ---+
1196 | |
1197 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1198 | NAME_FLAGS |
1199 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1200
1201 The NAME_FLAGS field:
1202
1203 1 1 1 1 1 1
1204 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
1205 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
1206 | G | ONT |DRG|CNF|ACT|PRM| RESERVED |
1207 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
1208
1209 The NAME_FLAGS field is defined as:
1210
1211 Symbol Bit(s) Description:
1212
1213 RESERVED 7-15 Reserved for future use. Must be zero (0).
1214 PRM 6 Permanent Name Flag. If one (1) then entry
1215 is for the permanent node name. Flag is zero
1216 (0) for all other names.
1217 ACT 5 Active Name Flag. All entries have this flag
1218 set to one (1).
1219 CNF 4 Conflict Flag. If one (1) then name on this
1220 node is in conflict.
1221 DRG 3 Deregister Flag. If one (1) then this name
1222 is in the process of being deleted.
1223 ONT 1,2 Owner Node Type:
1224 00 = B node
1225 01 = P node
1226 10 = M node
1227 11 = Reserved for future use
1228 G 0 Group Name Flag.
1229 If one (1) then the name is a GROUP NetBIOS
1230 name.
1231 If zero (0) then it is a UNIQUE NetBIOS name.
1232
1233 STATISTICS Field of the NODE STATUS RESPONSE:
1234
1235 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
1236 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1237 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1238 | UNIT_ID (Unique unit ID) |
1239 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1240 | UNIT_ID,continued | JUMPERS | TEST_RESULT |
1241 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1242 | VERSION_NUMBER | PERIOD_OF_STATISTICS |
1243 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1244 | NUMBER_OF_CRCs | NUMBER_ALIGNMENT_ERRORS |
1245 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1246 | NUMBER_OF_COLLISIONS | NUMBER_SEND_ABORTS |
1247 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1248 | NUMBER_GOOD_SENDS |
1249 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1250 | NUMBER_GOOD_RECEIVES |
1251 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1252 | NUMBER_RETRANSMITS | NUMBER_NO_RESOURCE_CONDITIONS |
1253 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1254 | NUMBER_FREE_COMMAND_BLOCKS | TOTAL_NUMBER_COMMAND_BLOCKS |
1255 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1256 |MAX_TOTAL_NUMBER_COMMAND_BLOCKS| NUMBER_PENDING_SESSIONS |
1257 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1258 | MAX_NUMBER_PENDING_SESSIONS | MAX_TOTAL_SESSIONS_POSSIBLE |
1259 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1260 | SESSION_DATA_PACKET_SIZE |
1261 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1262
12634.3. SESSION SERVICE PACKETS
1264
12654.3.1. GENERAL FORMAT OF SESSION PACKETS
1266
1267 All session service messages are sent over a TCP connection.
1268
1269 All session packets are of the following general structure:
1270
1271 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
1272 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1273 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1274 | TYPE | FLAGS | LENGTH |
1275 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1276 | |
1277 / TRAILER (Packet Type Dependent) /
1278 | |
1279 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1280
1281 The TYPE, FLAGS, and LENGTH fields are present in every session
1282 packet.
1283
1284 The LENGTH field is the number of bytes following the LENGTH
1285 field. In other words, LENGTH is the combined size of the
1286 TRAILER field(s). For example, the POSITIVE SESSION RESPONSE
1287 packet always has a LENGTH field value of zero (0000) while the
1288 RETARGET SESSION RESPONSE always has a LENGTH field value of six
1289 (0006).
1290
1291 One of the bits of the FLAGS field acts as an additional, high-
1292 order bit for the LENGTH field. Thus the cumulative size of the
1293 trailer field(s) may range from 0 to 128K bytes.
1294
1295 Session Packet Types (in hexidecimal):
1296
1297 00 - SESSION MESSAGE
1298 81 - SESSION REQUEST
1299 82 - POSITIVE SESSION RESPONSE
1300 83 - NEGATIVE SESSION RESPONSE
1301 84 - RETARGET SESSION RESPONSE
1302 85 - SESSION KEEP ALIVE
1303
1304 Bit definitions of the FLAGS field:
1305
1306 0 1 2 3 4 5 6 7
1307 +---+---+---+---+---+---+---+---+
1308 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | E |
1309 +---+---+---+---+---+---+---+---+
1310
1311 Symbol Bit(s) Description
1312
1313 E 7 Length extension, used as an additional,
1314 high-order bit on the LENGTH field.
1315
1316 RESERVED 0-6 Reserved, must be zero (0)
1317
13184.3.2. SESSION REQUEST PACKET
1319
1320 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
1321 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1322 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1323 | TYPE | FLAGS | LENGTH |
1324 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1325 | |
1326 / CALLED NAME /
1327 | |
1328 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1329 | |
1330 / CALLING NAME /
1331 | |
1332 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1333
13344.3.3. POSITIVE SESSION RESPONSE PACKET
1335
1336 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
1337 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1338 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1339 | TYPE | FLAGS | LENGTH |
1340 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1341
13424.3.4. NEGATIVE SESSION RESPONSE PACKET
1343
1344 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
1345 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1346 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1347 | TYPE | FLAGS | LENGTH |
1348 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1349 | ERROR_CODE |
1350 +-+-+-+-+-+-+-+-+
1351
1352 NEGATIVE SESSION RESPONSE packet error code values (in
1353 hexidecimal):
1354
1355 80 - Not listening on called name
1356 81 - Not listening for calling name
1357 82 - Called name not present
1358 83 - Called name present, but insufficient resources
1359 8F - Unspecified error
1360
13614.3.5. SESSION RETARGET RESPONSE PACKET
1362
1363 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
1364 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1365 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1366 | TYPE | FLAGS | LENGTH |
1367 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1368 | RETARGET_IP_ADDRESS |
1369 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1370 | PORT |
1371 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1372
13734.3.6. SESSION MESSAGE PACKET
1374
1375 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
1376 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1377 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1378 | TYPE | FLAGS | LENGTH |
1379 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1380 | |
1381 / /
1382 / USER_DATA /
1383 / /
1384 | |
1385 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1386
13874.3.7. SESSION KEEP ALIVE PACKET
1388
1389 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
1390 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1391 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1392 | TYPE | FLAGS | LENGTH |
1393 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1394
13954.4. DATAGRAM SERVICE PACKETS
1396
13974.4.1. NetBIOS DATAGRAM HEADER
1398
1399 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
1400 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1401 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1402 | MSG_TYPE | FLAGS | DGM_ID |
1403 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1404 | SOURCE_IP |
1405 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1406 | SOURCE_PORT | DGM_LENGTH |
1407 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1408 | PACKET_OFFSET |
1409 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1410
1411 MSG_TYPE values (in hexidecimal):
1412
1413 10 - DIRECT_UNIQUE DATAGRAM
1414 11 - DIRECT_GROUP DATAGRAM
1415 12 - BROADCAST DATAGRAM
1416 13 - DATAGRAM ERROR
1417 14 - DATAGRAM QUERY REQUEST
1418 15 - DATAGRAM POSITIVE QUERY RESPONSE
1419 16 - DATAGRAM NEGATIVE QUERY RESPONSE
1420
1421 Bit definitions of the FLAGS field:
1422
1423 0 1 2 3 4 5 6 7
1424 +---+---+---+---+---+---+---+---+
1425 | 0 | 0 | 0 | 0 | SNT | F | M |
1426 +---+---+---+---+---+---+---+---+
1427
1428 Symbol Bit(s) Description
1429
1430 M 7 MORE flag, If set then more NetBIOS datagram
1431 fragments follow.
1432
1433 F 6 FIRST packet flag, If set then this is first
1434 (and possibly only) fragment of NetBIOS
1435 datagram
1436
1437 SNT 4,5 Source End-Node type:
1438 00 = B node
1439 01 = P node
1440 10 = M node
1441 11 = NBDD
1442 RESERVED 0-3 Reserved, must be zero (0)
1443
14444.4.2. DIRECT_UNIQUE, DIRECT_GROUP, &amp; BROADCAST DATAGRAM
1445
1446 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
1447 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1448 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1449 | MSG_TYPE | FLAGS | DGM_ID |
1450 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1451 | SOURCE_IP |
1452 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1453 | SOURCE_PORT | DGM_LENGTH |
1454 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1455 | PACKET_OFFSET | |
1456 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
1457 | |
1458 / SOURCE_NAME /
1459 / /
1460 | |
1461 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1462 | |
1463 / DESTINATION_NAME /
1464 / /
1465 | |
1466 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1467 | |
1468 / USER_DATA /
1469 / /
1470 | |
1471 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1472
1473 4.4.3. DATAGRAM ERROR PACKET
1474
1475 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
1476 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1477 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1478 | MSG_TYPE | FLAGS | DGM_ID |
1479 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1480 | SOURCE_IP |
1481 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1482 | SOURCE_PORT | ERROR_CODE |
1483 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1484
1485 ERROR_CODE values (in hexidecimal):
1486
1487 82 - DESTINATION NAME NOT PRESENT
1488 83 - INVALID SOURCE NAME FORMAT
1489 84 - INVALID DESTINATION NAME FORMAT
1490
14914.4.4. DATAGRAM QUERY REQUEST
1492
1493 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
1494 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1495 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1496 | MSG_TYPE | FLAGS | DGM_ID |
1497 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1498 | SOURCE_IP |
1499 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1500 | SOURCE_PORT | |
1501 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
1502 | |
1503 / DESTINATION_NAME /
1504 / /
1505 | |
1506 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1507
15084.4.5. DATAGRAM POSITIVE AND NEGATIVE QUERY RESPONSE
1509
1510 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
1511 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1512 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1513 | MSG_TYPE | FLAGS | DGM_ID |
1514 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1515 | SOURCE_IP |
1516 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1517 | SOURCE_PORT | |
1518 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
1519 | |
1520 / DESTINATION_NAME /
1521 / /
1522 | |
1523 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1524
15255. PROTOCOL DESCRIPTIONS
1526
15275.1. NAME SERVICE PROTOCOLS
1528
1529 A REQUEST packet is always sent to the well known UDP port -
1530 NAME_SERVICE_UDP_PORT. The destination address is normally
1531 either the IP broadcast address or the address of the NBNS - the
1532 address of the NBNS server it set up at initialization time. In
1533 rare cases, a request packet will be sent to an end node, e.g. a
1534 NAME QUERY REQUEST sent to "challenge" a node.
1535
1536 A RESPONSE packet is always sent to the source UDP port and
1537 source IP address of the request packet.
1538
1539 A DEMAND packet must always be sent to the well known UDP port -
1540 NAME_SERVICE_UDP_PORT. There is no restriction on the target IP
1541 address.
1542
1543 Terms used in this section:
1544
1545 tid - Transaction ID. This is a value composed from
1546 the requestor's IP address and a unique 16 bit
1547 value generated by the originator of the
1548 transaction.
1549
15505.1.1. B-NODE ACTIVITY
1551
15525.1.1.1. B-NODE ADD NAME
1553
1554 PROCEDURE add_name(newname)
1555
1556 /*
1557 * Host initiated processing for a B node
1558 */
1559 BEGIN
1560
1561 REPEAT
1562
1563 /* build name service packet */
1564
1565 ONT = B_NODE; /* broadcast node */
1566 G = UNIQUE; /* unique name */
1567 TTL = 0;
1568
1569 broadcast NAME REGISTRATION REQUEST packet;
1570
1571 /*
1572 * remote node(s) will send response packet
1573 * if applicable
1574 */
1575
1576 pause(BCAST_REQ_RETRY_TIMEOUT);
1577
1578 UNTIL response packet is received or
1579 retransmit count has been exceeded
1580
1581 IF no response packet was received THEN
1582 BEGIN /* no response */
1583 /*
1584 * build packet
1585 */
1586
1587 ONT = B_NODE; /* broadcast node */
1588 G = UNIQUE; /* unique name */
1589 TTL = 0;
1590
1591 /*
1592 * Let other nodes known you have the name
1593 */
1594
1595 broadcast NAME UPDATE REQUEST packet;
1596 /* name can be added to local name table */
1597 return success;
1598 END /* no response */
1599 ELSE
1600 BEGIN /* got response */
1601
1602 /*
1603 * Match return transaction id
1604 * against tid sent in request
1605 */
1606
1607 IF NOT response tid = request tid THEN
1608 BEGIN
1609 ignore response packet;
1610 END
1611 ELSE
1612 CASE packet type OF
1613
1614 NEGATIVE NAME REGISTRATION RESPONSE:
1615
1616 return failure; /* name cannot be added */
1617
1618 POSITIVE NAME REGISTRATION RESPONSE:
1619 END-NODE CHALLENGE NAME REGISTRATION RESPONSE:
1620
1621 /*
1622 * B nodes should normally not get this
1623 * response.
1624 */
1625
1626 ignore packet;
1627
1628 END /* case */;
1629 END /* got response */
1630 END /* procedure */
1631
16325.1.1.2. B-NODE ADD_GROUP NAME
1633
1634 PROCEDURE add_group_name(newname)
1635
1636 /*
1637 * Host initiated processing for a B node
1638 */
1639
1640 BEGIN
1641 /*
1642 * same as for a unique name with the
1643 * exception that the group bit (G) must
1644 * be set in the request packets.
1645 */
1646
1647 ...
1648 G = GROUP;
1649 ...
1650 ...
1651
1652 /*
1653 * broadcast request ...
1654 */
1655
1656 END
1657
16585.1.1.3. B-NODE FIND_NAME
1659
1660 PROCEDURE find_name(name)
1661
1662 /*
1663 * Host initiated processing for a B node
1664 */
1665
1666 BEGIN
1667
1668 REPEAT
1669 /*
1670 * build packet
1671 */
1672 ONT = B;
1673 TTL = 0;
1674 G = DONT CARE;
1675
1676 broadcast NAME QUERY REQUEST packet;
1677
1678 /*
1679 * a node might send response packet
1680 */
1681
1682 pause(BCAST_REQ_RETRY_TIMEOUT);
1683 UNTIL response packet received OR
1684 max transmit threshold exceeded
1685
1686 IF no response packet received THEN
1687 return failure;
1688 ELSE
1689 IF NOT response tid = request tid THEN
1690 ignore packet;
1691 ELSE
1692 CASE packet type OF
1693 POSITIVE NAME QUERY RESPONSE:
1694 /*
1695 * Start a timer to detect conflict.
1696 *
1697 * Be prepared to detect conflict if
1698 * any more response packets are received.
1699 *
1700 */
1701
1702 save response as authoritative response;
1703 start_timer(CONFLICT_TIMER);
1704 return success;
1705
1706 NEGATIVE NAME QUERY RESPONSE:
1707 REDIRECT NAME QUERY RESPONSE:
1708
1709 /*
1710 * B Node should normally not get either
1711 * response.
1712 */
1713
1714 ignore response packet;
1715
1716 END /* case */
1717 END /* procedure */
1718
17195.1.1.4. B NODE NAME RELEASE
1720
1721 PROCEDURE delete_name (name)
1722 BEGIN
1723
1724 REPEAT
1725
1726 /*
1727 * build packet
1728 */
1729
1730 ...
1731
1732 /*
1733 * send request
1734 */
1735
1736 broadcast NAME RELEASE REQUEST packet;
1737
1738 /*
1739 * no response packet expected
1740 */
1741
1742 pause(BCAST_REQ_RETRY_TIMEOUT);
1743
1744 UNTIL retransmit count has been exceeded
1745 END /* procedure */
1746
17475.1.1.5. B-NODE INCOMING PACKET PROCESSING
1748
1749 Following processing is done when broadcast or unicast packets
1750 are received at the NAME_SERVICE_UDP_PORT.
1751
1752 PROCEDURE process_incoming_packet(packet)
1753
1754 /*
1755 * Processing initiated by incoming packets for a B node
1756 */
1757
1758 BEGIN
1759 /*
1760 * Note: response packets are always sent
1761 * to:
1762 * source IP address of request packet
1763 * source UDP port of request packet
1764 */
1765
1766 CASE packet type OF
1767
1768 NAME REGISTRATION REQUEST (UNIQUE):
1769 IF name exists in local name table THEN
1770 send NEGATIVE NAME REGISTRATION RESPONSE ;
1771 NAME REGISTRATION REQUEST (GROUP):
1772 IF name exists in local name table THEN
1773 BEGIN
1774 IF local entry is a unique name THEN
1775 send NEGATIVE NAME REGISTRATION RESPONSE ;
1776 END
1777 NAME QUERY REQUEST:
1778 IF name exists in local name table THEN
1779 BEGIN
1780 build response packet;
1781
1782 send POSITIVE NAME QUERY RESPONSE;
1783 POSITIVE NAME QUERY RESPONSE:
1784 IF name conflict timer is not active THEN
1785 BEGIN
1786 /*
1787 * timer has expired already... ignore this
1788 * packet
1789 */
1790
1791 return;
1792 END
1793 ELSE /* timer is active */
1794 IF a response for this name has previously been
1795 received THEN
1796 BEGIN /* existing entry */
1797
1798 /*
1799 * we sent out a request packet, and
1800 * have already received (at least)
1801 * one response
1802 *
1803 * Check if conflict exists.
1804 * If so, send out a conflict packet.
1805 *
1806 * Note: detecting conflict does NOT
1807 * affect any existing sessions.
1808 *
1809 */
1810
1811 /*
1812 * Check for name conflict.
1813 * See "Name Conflict" in Concepts and Methods
1814 */
1815 check saved authoritative response against
1816 information in this response packet;
1817 IF conflict detected THEN
1818 BEGIN
1819 unicast NAME CONFLICT DEMAND packet;
1820 IF entry exists in cache THEN
1821 BEGIN
1822 remove entry from cache;
1823 END
1824 END
1825 END /* existing entry */
1826 ELSE
1827 BEGIN
1828 /*
1829 * Note: If this was the first response
1830 * to a name query, it would have been
1831 * handled in the
1832 * find_name() procedure.
1833
1834 */
1835
1836 ignore packet;
1837 END
1838 NAME CONFLICT DEMAND:
1839 IF name exists in local name table THEN
1840 BEGIN
1841 mark name as conflict detected;
1842
1843 /*
1844 * a name in the state "conflict detected"
1845 * does not "logically" exist on that node.
1846 * No further session will be accepted on
1847 * that name.
1848 * No datagrams can be sent against that name.
1849 * Such an entry will not be used for
1850 * purposes of processing incoming request
1851 * packets.
1852 * The only valid user NetBIOS operation
1853 * against such a name is DELETE NAME.
1854 */
1855 END
1856 NAME RELEASE REQUEST:
1857 IF caching is being done THEN
1858 BEGIN
1859 remove entry from cache;
1860 END
1861 NAME UPDATE REQUEST:
1862 IF caching is being done THEN
1863 BEGIN
1864 IF entry exists in cache already,
1865 update cache;
1866 ELSE IF name is "interesting" THEN
1867 BEGIN
1868 add entry to cache;
1869 END
1870 END
1871
1872 NODE STATUS REQUEST:
1873 IF name exists in local name table THEN
1874 BEGIN
1875 /*
1876 * send only those names that are
1877 * in the same scope as the scope
1878 * field in the request packet
1879 */
1880
1881 send NODE STATUS RESPONSE;
1882 END
1883 END
1884
18855.1.2. P-NODE ACTIVITY
1886
1887 All packets sent or received by P nodes are unicast UDP packets.
1888 A P node sends name service requests to the NBNS node that is
1889 specified in the P-node configuration.
1890
18915.1.2.1. P-NODE ADD_NAME
1892
1893 PROCEDURE add_name(newname)
1894
1895 /*
1896 * Host initiated processing for a P node
1897 */
1898
1899 BEGIN
1900
1901 REPEAT
1902 /*
1903 * build packet
1904 */
1905
1906 ONT = P;
1907 G = UNIQUE;
1908 ...
1909
1910 /*
1911 * send request
1912 */
1913
1914 unicast NAME REGISTRATION REQUEST packet;
1915
1916 /*
1917 * NBNS will send response packet
1918 */
1919
1920 IF receive a WACK RESPONSE THEN
1921 pause(time from TTL field of response);
1922 ELSE
1923 pause(UCAST_REQ_RETRY_TIMEOUT);
1924 UNTIL response packet is received OR
1925 retransmit count has been exceeded
1926
1927 IF no response packet was received THEN
1928 BEGIN /* no response */
1929 /*
1930 * NBNS is down. Cannot claim name.
1931 */
1932
1933 return failure; /* name cannot be claimed */
1934 END /* no response */
1935 ELSE
1936
1937 BEGIN /* response */
1938 IF NOT response tid = request tid THEN
1939 BEGIN
1940 /* Packet may belong to another transaction */
1941 ignore response packet;
1942 END
1943 ELSE
1944 CASE packet type OF
1945
1946 POSITIVE NAME REGISTRATION RESPONSE:
1947
1948 /*
1949 * name can be added
1950 */
1951
1952 adjust refresh timeout value, TTL, for this name;
1953 return success; /* name can be added */
1954
1955 NEGATIVE NAME REGISTRATION RESPONSE:
1956 return failure; /* name cannot be added */
1957
1958 END-NODE CHALLENGE REGISTRATION REQUEST:
1959 BEGIN /* end node challenge */
1960
1961 /*
1962 * The response packet has in it the
1963 * address of the presumed owner of the
1964 * name. Challenge that owner.
1965 * If owner either does not
1966 * respond or indicates that he no longer
1967 * owns the name, claim the name.
1968 * Otherwise, the name cannot be claimed.
1969 *
1970 */
1971
1972 REPEAT
1973 /*
1974 * build packet
1975 */
1976 ...
1977
1978 unicast NAME QUERY REQUEST packet to the
1979 address contained in the END NODE
1980 CHALLENGE RESPONSE packet;
1981
1982 /*
1983 * remote node may send response packet
1984 */
1985
1986 pause(UCAST_REQ_RETRY_TIMEOUT);
1987
1988 UNTIL response packet is received or
1989 retransmit count has been exceeded
1990 IF no response packet is received OR
1991 NEGATIVE NAME QUERY RESPONSE packet
1992 received THEN
1993 BEGIN /* update */
1994
1995 /*
1996 * name can be claimed
1997 */
1998
1999 REPEAT
2000
2001 /*
2002 * build packet
2003 */
2004 ...
2005
2006 unicast NAME UPDATE REQUEST to NBNS;
2007
2008 /*
2009 * NBNS node will send response packet
2010 */
2011
2012 IF receive a WACK RESPONSE THEN
2013 pause(time from TTL field of response);
2014 ELSE
2015 pause(UCAST_REQ_RETRY_TIMEOUT);
2016 UNTIL response packet is received or
2017 retransmit count has been exceeded
2018 IF no response packet received THEN
2019 BEGIN /* no response */
2020
2021 /*
2022 * name could not be claimed
2023 */
2024
2025 return failure;
2026 END /* no response */
2027 ELSE
2028 CASE packet type OF
2029 POSITIVE NAME REGISTRATION RESPONSE:
2030 /*
2031 * add name
2032 */
2033 return success;
2034 NEGATIVE NAME REGISTRATION RESPONSE:
2035
2036 /*
2037 * you lose ...
2038 */
2039
2040 return failure;
2041 END /* case */
2042 END /* update */
2043 ELSE
2044
2045 /*
2046 * received a positive response to the "challenge"
2047 * Remote node still has name
2048 */
2049
2050 return failure;
2051 END /* end node challenge */
2052 END /* response */
2053 END /* procedure */
2054
20555.1.2.2. P-NODE ADD GROUP NAME
2056
2057 PROCEDURE add_group_name(newname)
2058
2059 /*
2060 * Host initiated processing for a P node
2061 */
2062
2063 BEGIN
2064 /*
2065 * same as for a unique name, except that the
2066 * request packet must indicate that a
2067 * group name claim is being made.
2068 */
2069
2070 ...
2071 G = GROUP;
2072 ...
2073
2074 /*
2075 * send packet
2076 */
2077 ...
2078
2079 END
2080
2081 5.1.2.3. P-NODE FIND NAME
2082
2083 PROCEDURE find_name(name)
2084
2085 /*
2086 * Host initiated processing for a P node
2087 */
2088
2089 BEGIN
2090
2091 REPEAT
2092 /*
2093 * build packet
2094 */
2095
2096 ONT = P;
2097 G = DONT CARE;
2098
2099 unicast NAME QUERY REQUEST packet;
2100
2101 /*
2102 * a NBNS node might send response packet
2103 */
2104
2105 IF receive a WACK RESPONSE THEN
2106 pause(time from TTL field of response);
2107 ELSE
2108 pause(UCAST_REQ_RETRY_TIMEOUT);
2109 UNTIL response packet received OR
2110 max transmit threshold exceeded
2111
2112 IF no response packet received THEN
2113 return failure;
2114 ELSE
2115 IF NOT response tid = request tid THEN
2116 ignore packet;
2117 ELSE
2118 CASE packet type OF
2119 POSITIVE NAME QUERY RESPONSE:
2120 return success;
2121
2122 REDIRECT NAME QUERY RESPONSE:
2123
2124 /*
2125 * NBNS node wants this end node
2126 * to use some other NBNS node
2127 * to resolve the query.
2128 */
2129
2130 repeat query with NBNS address
2131 in the response packet;
2132 NEGATIVE NAME QUERY RESPONSE:
2133 return failure;
2134
2135 END /* case */
2136 END /* procedure */
2137
21385.1.2.4. P-NODE DELETE_NAME
2139
2140 PROCEDURE delete_name (name)
2141
2142 /*
2143 * Host initiated processing for a P node
2144 */
2145
2146 BEGIN
2147
2148 REPEAT
2149
2150 /*
2151 * build packet
2152 */
2153 ...
2154
2155 /*
2156 * send request
2157 */
2158
2159 unicast NAME RELEASE REQUEST packet;
2160 IF receive a WACK RESPONSE THEN
2161 pause(time from TTL field of response);
2162 ELSE
2163 pause(UCAST_REQ_RETRY_TIMEOUT);
2164 UNTIL retransmit count has been exceeded
2165 or response been received
2166
2167 IF response has been received THEN
2168 CASE packet type OF
2169 POSITIVE NAME RELEASE RESPONSE:
2170 return success;
2171 NEGATIVE NAME RELEASE RESPONSE:
2172
2173 /*
2174 * NBNS does want node to delete this
2175 * name !!!
2176 */
2177
2178 return failure;
2179 END /* case */
2180 END /* procedure */
2181
21825.1.2.5. P-NODE INCOMING PACKET PROCESSING
2183
2184 Processing initiated by reception of packets at a P node
2185
2186 PROCEDURE process_incoming_packet(packet)
2187
2188 /*
2189 * Processing initiated by incoming packets at a P node
2190 */
2191
2192 BEGIN
2193
2194 /*
2195 * always ignore UDP broadcast packets
2196 */
2197
2198 IF packet was sent as a broadcast THEN
2199 BEGIN
2200 ignore packet;
2201 return;
2202 END
2203 CASE packet type of
2204
2205 NAME CONFLICT DEMAND:
2206 IF name exists in local name table THEN
2207 mark name as in conflict;
2208 return;
2209
2210 NAME QUERY REQUEST:
2211 IF name exists in local name table THEN
2212 BEGIN /* name exists */
2213
2214 /*
2215 * build packet
2216 */
2217 ...
2218
2219 /*
2220 * send response to the IP address and port
2221 * number from which the request was received.
2222 */
2223
2224 send POSITIVE NAME QUERY RESPONSE ;
2225 return;
2226 END /* exists */
2227 ELSE
2228 BEGIN /* does not exist */
2229
2230 /*
2231 * send response to the requestor
2232 */
2233
2234 send NEGATIVE NAME QUERY RESPONSE ;
2235 return;
2236 END /* does not exist */
2237 NODE STATUS REQUEST:
2238 /*
2239 * Name of "*" may be used for force node to
2240 * divulge status for administrative purposes
2241 */
2242 IF name in local name table OR name = "*" THEN
2243 BEGIN
2244 /*
2245
2246 * Build response packet and
2247 * send to requestor node
2248 * Send only those names that are
2249 * in the same scope as the scope
2250 * in the request packet.
2251 */
2252
2253 send NODE STATUS RESPONSE;
2254 END
2255
2256 NAME RELEASE REQUEST:
2257 /*
2258 * This will be received if the NBNS wants to flush the
2259 * name from the local name table, or from the local
2260 * cache.
2261 */
2262
2263 IF name exists in the local name table THEN
2264 BEGIN
2265 delete name from local name table;
2266 inform user that name has been deleted;
2267 END
2268 ELSE
2269 IF name has been cached locally THEN
2270 BEGIN
2271 remove entry from cache:
2272 END
2273
2274 END /* case */
2275 END /* procedure */
2276
22775.1.2.6. P-NODE TIMER INITIATED PROCESSING
2278
2279 Processing initiated by timer expiration.
2280
2281 PROCEDURE timer_expired()
2282 /*
2283 * Processing initiated by the expiration of a timer on a P node
2284 */
2285 BEGIN
2286 /*
2287 * Send a NAME REFRESH REQUEST for each name which the
2288 * TTL which has expired.
2289 */
2290 REPEAT
2291 build NAME REFRESH REQUEST packet;
2292 REPEAT
2293 send packet to NBNS;
2294
2295 IF receive a WACK RESPONSE THEN
2296 pause(time from TTL field of response);
2297
2298 ELSE
2299 pause(UCAST_REQ_RETRY_TIMEOUT);
2300 UNTIL response packet is received or
2301 retransmit count has been exceeded
2302
2303 CASE packet type OF
2304 POSITIVE NAME REGISTRATION RESPONSE:
2305 /* successfully refreshed */
2306 reset TTL timer for this name;
2307
2308 NEGATIVE NAME REGISTRATION RESPONSE:
2309 /*
2310 * refused, can't keep name
2311 * assume in conflict
2312 */
2313 mark name as in conflict;
2314 END /* case */
2315
2316 UNTIL request sent for all names for which TTL
2317 has expired
2318 END /* procedure */
2319
23205.1.3. M-NODE ACTIVITY
2321
2322 M nodes behavior is similar to that of P nodes with the addition
2323 of some B node-like broadcast actions. M node name service
2324 proceeds in two steps:
2325
2326 1.Use broadcast UDP based name service. Depending on the
2327 operation, goto step 2.
2328
2329 2.Use directed UDP name service.
2330
2331 The following code for M nodes is exactly the same as for a P
2332 node, with the exception that broadcast operations are done
2333 before P type operation is attempted.
2334
2335 5.1.3.1. M-NODE ADD NAME
2336
2337 PROCEDURE add_name(newname)
2338
2339 /*
2340 * Host initiated processing for a M node
2341 */
2342
2343 BEGIN
2344
2345 /*
2346 * check if name exists on the
2347 * broadcast area
2348 */
2349
2350 REPEAT
2351 /* build packet */
2352
2353 ....
2354 broadcast NAME REGISTRATION REQUEST packet;
2355 pause(BCAST_REQ_RETRY_TIMEOUT);
2356
2357 UNTIL response packet is received or
2358 retransmit count has been exceeded
2359
2360 IF valid response received THEN
2361 BEGIN
2362 /* cannot claim name */
2363
2364 return failure;
2365 END
2366
2367 /*
2368 * No objections received within the
2369 * broadcast area.
2370 * Send request to name server.
2371 */
2372
2373 REPEAT
2374 /*
2375 * build packet
2376 */
2377
2378 ONT = M;
2379 ...
2380
2381 unicast NAME REGISTRATION REQUEST packet;
2382
2383 /*
2384 * remote NBNS will send response packet
2385 */
2386
2387 IF receive a WACK RESPONSE THEN
2388 pause(time from TTL field of response);
2389 ELSE
2390 pause(UCAST_REQ_RETRY_TIMEOUT);
2391
2392 UNTIL response packet is received or
2393 retransmit count has been exceeded
2394
2395 IF no response packet was received THEN
2396 BEGIN /* no response */
2397 /*
2398 * NBNS is down. Cannot claim name.
2399 */
2400
2401 return failure; /* name cannot be claimed */
2402 END /* no response */
2403 ELSE
2404 BEGIN /* response */
2405 IF NOT response tid = request tid THEN
2406 BEGIN
2407 ignore response packet;
2408 END
2409 ELSE
2410 CASE packet type OF
2411 POSITIVE NAME REGISTRATION RESPONSE:
2412
2413 /*
2414 * name can be added
2415 */
2416
2417 adjust refresh timeout value, TTL;
2418 return success; /* name can be added */
2419
2420 NEGATIVE NAME REGISTRATION RESPONSE:
2421 return failure; /* name cannot be added */
2422
2423 END-NODE CHALLENGE REGISTRATION REQUEST:
2424 BEGIN /* end node challenge */
2425
2426 /*
2427 * The response packet has in it the
2428 * address of the presumed owner of the
2429 * name. Challenge that owner.
2430 * If owner either does not
2431 * respond or indicates that he no longer
2432 * owns the name, claim the name.
2433 * Otherwise, the name cannot be claimed.
2434 *
2435 */
2436
2437 REPEAT
2438 /*
2439 * build packet
2440 */
2441 ...
2442
2443 /*
2444 * send packet to address contained in the
2445 * response packet
2446 */
2447
2448 unicast NAME QUERY REQUEST packet;
2449
2450 /*
2451 * remote node may send response packet
2452
2453 */
2454
2455 pause(UCAST_REQ_RETRY_TIMEOUT);
2456
2457 UNTIL response packet is received or
2458 retransmit count has been exceeded
2459 IF no response packet is received THEN
2460 BEGIN /* no response */
2461
2462 /*
2463 * name can be claimed
2464 */
2465 REPEAT
2466
2467 /*
2468 * build packet
2469 */
2470 ...
2471
2472 unicast NAME UPDATE REQUEST to NBNS;
2473
2474 /*
2475 * NBNS node will send response packet
2476 */
2477
2478 IF receive a WACK RESPONSE THEN
2479 pause(time from TTL field of response);
2480 ELSE
2481 pause(UCAST_REQ_RETRY_TIMEOUT);
2482
2483 UNTIL response packet is received or
2484 retransmit count has been exceeded
2485 IF no response packet received THEN
2486 BEGIN /* no response */
2487
2488 /*
2489 * name could not be claimed
2490 */
2491
2492 return failure;
2493 END /* no response */
2494 ELSE
2495 CASE packet type OF
2496 POSITIVE NAME REGISTRATION RESPONSE:
2497 /*
2498 * add name
2499 */
2500
2501 return success;
2502 NEGATIVE NAME REGISTRATION RESPONSE:
2503
2504 /*
2505 * you lose ...
2506 */
2507
2508 return failure;
2509 END /* case */
2510 END /* no response */
2511 ELSE
2512 IF NOT response tid = request tid THEN
2513 BEGIN
2514 ignore response packet;
2515 END
2516
2517 /*
2518 * received a response to the "challenge"
2519 * packet
2520 */
2521
2522 CASE packet type OF
2523 POSITIVE NAME QUERY:
2524
2525 /*
2526 * remote node still has name.
2527 */
2528
2529 return failure;
2530 NEGATIVE NAME QUERY:
2531
2532 /*
2533 * remote node no longer has name
2534 */
2535
2536 return success;
2537 END /* case */
2538 END /* end node challenge */
2539 END /* case */
2540 END /* response */
2541 END /* procedure */
2542
25435.1.3.2. M-NODE ADD GROUP NAME
2544
2545 PROCEDURE add_group_name(newname)
2546
2547 /*
2548 * Host initiated processing for a P node
2549 */
2550
2551 BEGIN
2552 /*
2553 * same as for a unique name, except that the
2554 * request packet must indicate that a
2555
2556 * group name claim is being made.
2557 */
2558
2559 ...
2560 G = GROUP;
2561 ...
2562
2563 /*
2564 * send packet
2565 */
2566 ...
2567
2568 END
2569
25705.1.3.3. M-NODE FIND NAME
2571
2572 PROCEDURE find_name(name)
2573
2574 /*
2575 * Host initiated processing for a M node
2576 */
2577
2578 BEGIN
2579 /*
2580 * check if any node on the broadcast
2581 * area has the name
2582 */
2583
2584 REPEAT
2585 /* build packet */
2586 ...
2587
2588 broadcast NAME QUERY REQUEST packet;
2589 pause(BCAST_REQ_RETRY_TIMEOUT);
2590 UNTIL response packet received OR
2591 max transmit threshold exceeded
2592
2593 IF valid response received THEN
2594 BEGIN
2595 save response as authoritative response;
2596 start_timer(CONFLICT_TIMER);
2597 return success;
2598 END
2599
2600 /*
2601 * no valid response on the b'cast segment.
2602 * Try the name server.
2603 */
2604
2605 REPEAT
2606
2607 /*
2608 * build packet
2609 */
2610
2611 ONT = M;
2612 G = DONT CARE;
2613
2614 unicast NAME QUERY REQUEST packet to NBNS;
2615
2616 /*
2617 * a NBNS node might send response packet
2618 */
2619
2620 IF receive a WACK RESPONSE THEN
2621 pause(time from TTL field of response);
2622 ELSE
2623 pause(UCAST_REQ_RETRY_TIMEOUT);
2624 UNTIL response packet received OR
2625 max transmit threshold exceeded
2626
2627 IF no response packet received THEN
2628 return failure;
2629 ELSE
2630 IF NOT response tid = request tid THEN
2631 ignore packet;
2632 ELSE
2633 CASE packet type OF
2634 POSITIVE NAME QUERY RESPONSE:
2635 return success;
2636
2637 REDIRECT NAME QUERY RESPONSE:
2638
2639 /*
2640 * NBNS node wants this end node
2641 * to use some other NBNS node
2642 * to resolve the query.
2643 */
2644
2645 repeat query with NBNS address
2646 in the response packet;
2647 NEGATIVE NAME QUERY RESPONSE:
2648 return failure;
2649
2650 END /* case */
2651 END /* procedure */
2652
26535.1.3.4. M-NODE DELETE NAME
2654
2655 PROCEDURE delete_name (name)
2656
2657 /*
2658
2659 * Host initiated processing for a P node
2660 */
2661
2662 BEGIN
2663 /*
2664 * First, delete name on NBNS
2665 */
2666
2667 REPEAT
2668
2669 /*
2670 * build packet
2671 */
2672 ...
2673
2674 /*
2675 * send request
2676 */
2677
2678 unicast NAME RELEASE REQUEST packet to NBNS;
2679
2680 IF receive a WACK RESPONSE THEN
2681 pause(time from TTL field of response);
2682 ELSE
2683 pause(UCAST_REQ_RETRY_TIMEOUT);
2684 UNTIL retransmit count has been exceeded
2685 or response been received
2686
2687 IF response has been received THEN
2688 CASE packet type OF
2689 POSITIVE NAME RELEASE RESPONSE:
2690 /*
2691 * Deletion of name on b'cast segment is deferred
2692 * until after NBNS has deleted the name
2693 */
2694
2695 REPEAT
2696 /* build packet */
2697
2698 ...
2699 broadcast NAME RELEASE REQUEST;
2700 pause(BCAST_REQ_RETRY_TIMEOUT);
2701 UNTIL rexmt threshold exceeded
2702
2703 return success;
2704 NEGATIVE NAME RELEASE RESPONSE:
2705
2706 /*
2707 * NBNS does want node to delete this
2708 * name
2709 */
2710
2711 return failure;
2712 END /* case */
2713 END /* procedure */
2714
27155.1.3.5. M-NODE INCOMING PACKET PROCESSING
2716
2717 Processing initiated by reception of packets at a M node
2718
2719 PROCEDURE process_incoming_packet(packet)
2720
2721 /*
2722 * Processing initiated by incoming packets at a M node
2723 */
2724
2725 BEGIN
2726 CASE packet type of
2727
2728 NAME CONFLICT DEMAND:
2729 IF name exists in local name table THEN
2730 mark name as in conflict;
2731 return;
2732
2733 NAME QUERY REQUEST:
2734 IF name exists in local name table THEN
2735 BEGIN /* name exists */
2736
2737 /*
2738 * build packet
2739 */
2740 ...
2741
2742 /*
2743 * send response to the IP address and port
2744 * number from which the request was received.
2745 */
2746
2747 send POSITIVE NAME QUERY RESPONSE ;
2748 return;
2749 END /* exists */
2750 ELSE
2751 BEGIN /* does not exist */
2752
2753 /*
2754 * send response to the requestor
2755 */
2756
2757 IF request NOT broadcast THEN
2758 /*
2759 * Don't send negative responses to
2760 * queries sent by B nodes
2761 */
2762
2763 send NEGATIVE NAME QUERY RESPONSE ;
2764 return;
2765 END /* does not exist */
2766 NODE STATUS REQUEST:
2767 BEGIN
2768 /*
2769 * Name of "*" may be used for force node to
2770 * divulge status for administrative purposes
2771 */
2772 IF name in local name table OR name = "*" THEN
2773 /*
2774 * Build response packet and
2775 * send to requestor node
2776 * Send only those names that are
2777 * in the same scope as the scope
2778 * in the request packet.
2779 */
2780
2781 send NODE STATUS RESPONSE;
2782 END
2783
2784 NAME RELEASE REQUEST:
2785 /*
2786 * This will be received if the NBNS wants to flush the
2787 * name from the local name table, or from the local
2788 * cache.
2789 */
2790
2791 IF name exists in the local name table THEN
2792 BEGIN
2793 delete name from local name table;
2794 inform user that name has been deleted;
2795 END
2796 ELSE
2797 IF name has been cached locally THEN
2798 BEGIN
2799 remove entry from cache:
2800 END
2801
2802 NAME REGISTRATION REQUEST (UNIQUE):
2803 IF name exists in local name table THEN
2804 send NEGATIVE NAME REGISTRATION RESPONSE ;
2805 NAME REGISTRATION REQUEST (GROUP):
2806 IF name exists in local name table THEN
2807 BEGIN
2808 IF local entry is a unique name THEN
2809 send NEGATIVE NAME REGISTRATION RESPONSE ;
2810 END
2811 END /* case */
2812 END /* procedure */
2813
28145.1.3.6. M-NODE TIMER INITIATED PROCESSING
2815
2816 Processing initiated by timer expiration:
2817
2818 PROCEDURE timer_expired()
2819 /*
2820 * Processing initiated by the expiration of a timer on a M node
2821 */
2822 BEGIN
2823 /*
2824 * Send a NAME REFRESH REQUEST for each name which the
2825 * TTL which has expired.
2826 */
2827 REPEAT
2828 build NAME REFRESH REQUEST packet;
2829 REPEAT
2830 send packet to NBNS;
2831
2832 IF receive a WACK RESPONSE THEN
2833 pause(time from TTL field of response);
2834 ELSE
2835 pause(UCAST_REQ_RETRY_TIMEOUT);
2836 UNTIL response packet is received or
2837 retransmit count has been exceeded
2838
2839 CASE packet type OF
2840 POSITIVE NAME REGISTRATION RESPONSE:
2841 /* successfully refreshed */
2842 reset TTL timer for this name;
2843
2844 NEGATIVE NAME REGISTRATION RESPONSE:
2845 /*
2846 * refused, can't keep name
2847 * assume in conflict
2848 */
2849 mark name as in conflict;
2850 END /* case */
2851
2852 UNTIL request sent for all names for which TTL
2853 has expired
2854 END /* procedure */
2855
28565.1.4. NBNS ACTIVITY
2857
2858 A NBNS node will receive directed packets from P and M nodes.
2859 Reply packets are always sent as directed packets to the source
2860 IP address and UDP port number. Received broadcast packets must
2861 be ignored.
2862
28635.1.4.1. NBNS INCOMING PACKET PROCESSING
2864
2865 PROCEDURE process_incoming_packet(packet)
2866
2867 /*
2868 * Incoming packet processing on a NS node
2869 */
2870
2871 BEGIN
2872 IF packet was sent as a broadcast THEN
2873 BEGIN
2874 discard packet;
2875 return;
2876 END
2877 CASE packet type of
2878
2879 NAME REGISTRATION REQUEST (UNIQUE):
2880 IF unique name exists in data base THEN
2881 BEGIN /* unique name exists */
2882 /*
2883 * NBNS node may be a "passive"
2884 * server in that it expects the
2885 * end node to do the challenge
2886 * server. Such a NBNS node is
2887 * called a "non-secure" server.
2888 * A "secure" server will do the
2889 * challenging before it sends
2890 * back a response packet.
2891 */
2892
2893 IF non-secure THEN
2894 BEGIN
2895 /*
2896 * build response packet
2897 */
2898 ...
2899
2900 /*
2901 * let end node do the challenge
2902 */
2903
2904 send END-NODE CHALLENGE NAME REGISTRATION
2905 RESPONSE;
2906 return;
2907 END
2908 ELSE
2909 /*
2910 * secure server - do the name
2911 * challenge operation
2912 */
2913
2914 REPEAT
2915 send NAME QUERY REQUEST;
2916 pause(UCAST_REQ_RETRY_TIMEOUT);
2917 UNTIL response has been received or
2918 retransmit count has been exceeded
2919 IF no response was received THEN
2920 BEGIN
2921
2922 /* node down */
2923
2924 update data base - remove entry;
2925 update data base - add new entry;
2926 send POSITIVE NAME REGISTRATION RESPONSE;
2927 return;
2928 END
2929 ELSE
2930 BEGIN /* challenged node replied */
2931 /*
2932 * challenged node replied with
2933 * a response packet
2934 */
2935
2936 CASE packet type
2937
2938 POSITIVE NAME QUERY RESPONSE:
2939
2940 /*
2941 * name still owned by the
2942 * challenged node
2943 *
2944 * build packet and send response
2945 */
2946 ...
2947
2948 /*
2949 * Note: The NBNS will need to
2950 * keep track (based on transaction id) of
2951 * the IP address and port number
2952 * of the original requestor.
2953 */
2954
2955 send NEGATIVE NAME REGISTRATION RESPONSE;
2956 return;
2957 NEGATIVE NAME QUERY RESPONSE:
2958
2959 update data base - remove entry;
2960 update data base - add new entry;
2961
2962 /*
2963 * build response packet and send
2964
2965 * response
2966 */
2967 send POSITIVE NAME REGISTRATION RESPONSE;
2968 return;
2969 END /* case */
2970 END /* challenged node replied */
2971 END /* unique name exists in data base */
2972 ELSE
2973 IF group name exists in data base THEN
2974 BEGIN /* group names exists */
2975
2976 /*
2977 * Members of a group name are NOT
2978 * challenged.
2979 * Make the assumption that
2980 * at least some of the group members
2981 * are still alive.
2982 * Refresh mechanism will
2983 * allow the NBNS to detect when all
2984 * members of a group no longer use that
2985 * name
2986 */
2987
2988 send NEGATIVE NAME REGISTRATION RESPONSE;
2989 END /* group name exists */
2990 ELSE
2991 BEGIN /* name does not exist */
2992
2993 /*
2994 * Name does not exist in data base
2995 *
2996 * This code applies to both non-secure
2997 * and secure server.
2998 */
2999
3000 update data base - add new entry;
3001 send POSITIVE NAME REGISTRATION RESPONSE;
3002 return;
3003 END
3004
3005 NAME QUERY REQUEST:
3006 IF name exists in data base THEN
3007 BEGIN
3008 /*
3009 * build response packet and send to
3010 * requestor
3011 */
3012 ...
3013
3014 send POSITIVE NAME QUERY RESPONSE;
3015 return;
3016
3017 ELSE
3018 BEGIN
3019 /*
3020 * build response packet and send to
3021 * requestor
3022 */
3023 ...
3024
3025 send NEGATIVE NAME QUERY RESPONSE;
3026 return;
3027 END
3028
3029 NAME REGISTRATION REQUEST (GROUP):
3030 IF name exists in data base THEN
3031 BEGIN
3032 IF local entry is a unique name THEN
3033 BEGIN /* local is unique */
3034
3035 IF non-secure THEN
3036 BEGIN
3037 send END-NODE CHALLENGE NAME
3038 REGISTRATION RESPONSE;
3039 return;
3040 END
3041
3042 REPEAT
3043 send NAME QUERY REQUEST;
3044 pause(UCAST_REQ_RETRY_TIMEOUT);
3045 UNTIL response received or
3046 retransmit count exceeded
3047 IF no response received or
3048 NEGATIVE NAME QUERY RESPONSE
3049 received THEN
3050 BEGIN
3051 update data base - remove entry;
3052 update data base - add new entry;
3053 send POSITIVE NAME REGISTRATION RESPONSE;
3054 return;
3055 END
3056 ELSE
3057 BEGIN
3058 /*
3059 * name still being held
3060 * by challenged node
3061 */
3062
3063 send NEGATIVE NAME REGISTRATION RESPONSE;
3064 END
3065 END /* local is unique */
3066 ELSE
3067 BEGIN /* local is group */
3068
3069 /*
3070 * existing entry is a group name
3071 */
3072
3073 update data base - remove entry;
3074 update data base - add new entry;
3075 send POSITIVE NAME REGISTRATION RESPONSE;
3076 return;
3077 END /* local is group */
3078 END /* names exists */
3079 ELSE
3080 BEGIN /* does not exist */
3081
3082 /* name does not exist in data base */
3083
3084 update data base - add new entry;
3085 send POSITIVE NAME REGISTRATION RESPONSE;
3086 return;
3087 END /* does not exist */
3088
3089 NAME RELEASE REQUEST:
3090
3091 /*
3092 * secure server may choose to disallow
3093 * a node from deleting a name
3094 */
3095
3096 update data base - remove entry;
3097 send POSITIVE NAME RELEASE RESPONSE;
3098 return;
3099
3100 NAME UPDATE REQUEST:
3101
3102 /*
3103 * End-node completed a successful challenge,
3104 * no update database
3105 */
3106
3107 IF secure server THEN
3108 send NEGATIVE NAME REGISTRATION RESPONSE;
3109 ELSE
3110 BEGIN /* new entry */
3111 IF entry already exists THEN
3112 update data base - remove entry;
3113 update data base - add new entry;
3114 send POSITIVE NAME REGISTRATION RESPONSE;
3115 start_timer(TTL);
3116 END
3117
3118 NAME REFRESH REQUEST:
3119 check for consistency;
3120
3121 IF node not allowed to have name THEN
3122 BEGIN
3123
3124 /*
3125 * tell end node that it can't have name
3126 */
3127 send NEGATIVE NAME REGISTRATION RESPONSE;
3128 END
3129 ELSE
3130 BEGIN
3131
3132 /*
3133 * send confirmation response to the
3134 * end node.
3135 */
3136 send POSITIVE NAME REGISTRATION;
3137 start_timer(TTL);
3138 END
3139 return;
3140 END /* case */
3141 END /* procedure */
3142
31435.1.4.2. NBNS TIMER INITIATED PROCESSING
3144
3145 A NS node uses timers to flush out entries from the data base.
3146 Each entry in the data base is removed when its timer expires.
3147 This time value is a multiple of the refresh TTL established when
3148 the name was registered.
3149
3150 PROCEDURE timer_expired()
3151
3152 /*
3153 * processing initiated by expiration of TTL for a given name
3154 */
3155
3156 BEGIN
3157 /*
3158 * NBNS can (optionally) ensure
3159 * that the node is actually down
3160 * by sending a NODE STATUS REQUEST.
3161 * If such a request is sent, and
3162 * no response is received, it can
3163 * be assumed that the node is down.
3164 */
3165 remove entry from data base;
3166 END
3167
31685.2. SESSION SERVICE PROTOCOLS
3169
3170 The following are variables and should be configurable by the
3171 NetBIOS user. The default values of these variables is found in
3172 "Defined Constants and Variables" in the Detailed
3173 Specification.):
3174
3175 - SSN_RETRY_COUNT - The maximum number TCP connection attempts
3176 allowable per a single NetBIOS call request.
3177
3178 - SSN_CLOSE_TIMEOUT is the time period to wait when closing the
3179 NetBIOS session before killing the TCP connection if session
3180 sends are outstanding.
3181
3182 The following are Defined Constants for the NetBIOS Session
3183 Service. (See "Defined Constants and Variables" in the Detailed
3184 Specification for the value of these constants):
3185
3186 - SSN_SRVC_TCP_PORT - is the globally well-known TCP port
3187 allocated for the NetBIOS Session Service. The service accepts
3188 TCP connections on this port to establish NetBIOS Sessions.
3189 The TCP connection established to this port by the caller is
3190 initially used for the exchange of NetBIOS control information.
3191 The actual NetBIOS data connection may also pass through this
3192 port or, through the retargetting facility, through another
3193 port.
3194
31955.2.1. SESSION ESTABLISHMENT PROTOCOLS
3196
31975.2.1.1. USER REQUEST PROCESSING
3198
3199 PROCEDURE listen(listening name, caller name)
3200 /*
3201 * User initiated processing for B, P and M nodes
3202 *
3203 * This procedure assumes that an incoming session will be
3204 * retargetted here by a session server.
3205 */
3206 BEGIN
3207 Do TCP listen; /* Returns TCP port used */
3208 Register listen with Session Service, give names and
3209 TCP port;
3210
3211 Wait for TCP connection to open; /* Incoming call */
3212
3213 Read SESSION REQUEST packet from connection
3214
3215 Process session request (see section on
3216 processing initiated by the reception of session
3217 service packets);
3218
3219 Inform Session Service that NetBIOS listen is complete;
3220
3221 IF session established THEN
3222 return success and session information to user;
3223 ELSE
3224 return failure;
3225 END /* procedure */
3226
3227 PROCEDURE call(calling name, called name)
3228 /*
3229 * user initiated processing for B, P and M nodes
3230 */
3231
3232 /*
3233 * This algorithm assumes that the called name is a unique name.
3234 * If the called name is a group name, the call() procedure
3235 * needs to cycle through the members of the group
3236 * until either (retry_count == SSN_RETRY_COUNT) or
3237 * the list has been exhausted.
3238 */
3239 BEGIN
3240 retry_count = 0;
3241 retarget = FALSE; /* TRUE: caller is being retargetted */
3242 name_query = TRUE; /* TRUE: caller must begin again with */
3243 /* name query. */
3244
3245 REPEAT
3246 IF name_query THEN
3247 BEGIN
3248 do name discovery, returns IP address;
3249 TCP port = SSN_SRVC_TCP_PORT;
3250
3251 IF name discovery fails THEN
3252 return failure;
3253 ELSE
3254 name_query = FALSE;
3255 END
3256
3257 /*
3258 * now have IP address and TCP port of
3259 * remote party.
3260 */
3261
3262 establish TCP connection with remote party, use an
3263 ephemeral port as source TCP port;
3264 IF connection refused THEN
3265 BEGIN
3266 IF retarget THEN
3267 BEGIN
3268 /* retry */
3269 retarget = FALSE;
3270
3271 use original IP address and TCP port;
3272 goto LOOP;
3273 END
3274
3275 /* retry for just missed TCP listen */
3276
3277 pause(SESSION_RETRY_TIMER);
3278 establish TCP connection, again use ephemeral
3279 port as source TCP port;
3280
3281 IF connection refused OR
3282 connection timed out THEN
3283 return failure;
3284 END
3285 ELSE
3286 IF connection timed out THEN
3287 BEGIN
3288 IF retarget THEN
3289 BEGIN
3290 /* retry */
3291 retarget = FALSE;
3292 use original IP address and TCP port;
3293 goto LOOP;
3294 END
3295 ELSE
3296 BEGIN
3297 /*
3298 * incorrect name discovery was done,
3299 * try again
3300 */
3301
3302 inform name discovery process of
3303 possible error;
3304 name_query = TRUE;
3305 goto LOOP;
3306 END
3307 END
3308
3309 /*
3310 * TCP connection has been established
3311 */
3312
3313 wait for session response packet;
3314 CASE packet type OF
3315
3316 POSITIVE SESSION RESPONSE:
3317 return success and session established
3318 information;
3319
3320 NEGATIVE SESSION RESPONSE:
3321 BEGIN
3322
3323 CASE error OF
3324 NOT LISTENING ON CALLED NAME:
3325 NOT LISTENING FOR CALLING NAME:
3326 BEGIN
3327 kill TCP connection;
3328 return failure;
3329 END
3330
3331 CALLED NAME NOT PRESENT:
3332 BEGIN
3333 /*
3334 * called name does not exist on
3335 * remote node
3336 */
3337
3338 inform name discovery procedure
3339 of possible error;
3340
3341 IF this is a P or M node THEN
3342 BEGIN
3343 /*
3344 * Inform NetBIOS Name Server
3345 * it has returned incorrect
3346 * information.
3347 */
3348 send NAME RELEASE REQUEST for called
3349 name and IP address to
3350 NetBIOS Name Server;
3351 END
3352 /* retry from beginning */
3353 retarget = FALSE;
3354 name_query = TRUE;
3355 goto LOOP;
3356 END /* called name not present */
3357 END /* case */
3358 END /* negative response */
3359
3360 RETARGET SESSION RESPONSE:
3361 BEGIN
3362 close TCP connection;
3363 extract IP address and TCP port from
3364 response;
3365 retarget = TRUE;
3366 END /* retarget response */
3367 END /* case */
3368
3369 LOOP: retry_count = retry_count + 1;
3370
3371 UNTIL (retry_count &gt; SSN_RETRY_COUNT);
3372 return failure;
3373 END /* procedure */
3374
33755.2.1.2. RECEIVED PACKET PROCESSING
3376
3377 These are packets received on a TCP connection before a session
3378 has been established. The listen routines attached to a NetBIOS
3379 user process need not implement the RETARGET response section.
3380 The user process version, separate from a shared Session Service,
3381 need only accept (POSITIVE SESSION RESPONSE) or reject (NEGATIVE
3382 SESSION RESPONSE) a session request.
3383
3384 PROCEDURE session_packet(packet)
3385 /*
3386 * processing initiated by receipt of a session service
3387 * packet for a session in the session establishment phase.
3388 * Assumes the TCP connection has been accepted.
3389 */
3390 BEGIN
3391 CASE packet type
3392
3393 SESSION REQUEST:
3394 BEGIN
3395 IF called name does not exist on node THEN
3396 BEGIN
3397 send NEGATIVE SESSION RESPONSE with CALLED
3398 NAME NOT PRESENT error code;
3399 close TCP connection;
3400 END
3401
3402 Search for a listen with CALLING NAME for CALLED
3403 NAME;
3404 IF matching listen is found THEN
3405 BEGIN
3406 IF port of listener process is port TCP
3407 connection is on THEN
3408 BEGIN
3409 send POSITIVE SESSION RESPONSE;
3410
3411 Hand off connection to client process
3412 and/or inform user session is
3413 established;
3414 END
3415 ELSE
3416 BEGIN
3417 send RETARGET SESSION RESPONSE with
3418 listener's IP address and
3419 TCP port;
3420 close TCP connection;
3421 END
3422 END
3423 ELSE
3424 BEGIN
3425 /* no matching listen pending */
3426
3427 send NEGATIVE SESSION RESPONSE with either
3428 NOT LISTENING ON CALLED NAME or NOT
3429 LISTENING FOR CALLING NAME error
3430 code;
3431 close TCP connection;
3432 END
3433 END /* session request */
3434 END /* case */
3435 END /* procedure */
3436
34375.2.2. SESSION DATA TRANSFER PROTOCOLS
3438
34395.2.2.1. USER REQUEST PROCESSING
3440
3441 PROCEDURE send_message(user_message)
3442 BEGIN
3443 build SESSION MESSAGE header;
3444 send SESSION MESSAGE header;
3445 send user_message;
3446 reset and restart keep-alive timer;
3447 IF send fails THEN
3448 BEGIN
3449 /*
3450 * TCP connection has failed */
3451 */
3452 close NetBIOS session;
3453 inform user that session is lost;
3454 return failure;
3455 END
3456 ELSE
3457 return success;
3458 END
3459
3460 5.2.2.2. RECEIVED PACKET PROCESSING
3461
3462 These are packets received after a session has been established.
3463
3464 PROCEDURE session_packet(packet)
3465 /*
3466 * processing initiated by receipt of a session service
3467 * packet for a session in the data transfer phase.
3468 */
3469 BEGIN
3470 CASE packet type OF
3471
3472 SESSION MESSAGE:
3473 BEGIN
3474 process message header;
3475 read in user data;
3476 reset and restart keep-alive timer;
3477 deliver data to user;
3478
3479 END /* session message */
3480
3481 SESSION KEEP ALIVE:
3482 discard packet;
3483
3484 END /* case */
3485 END /* procedure */
3486
34875.2.2.3. PROCESSING INITIATED BY TIMER
3488
3489 PROCEDURE session_ka_timer()
3490 /*
3491 * processing initiated when session keep alive timer expires
3492 */
3493 BEGIN
3494 send SESSION KEEP ALIVE, if configured;
3495 IF send fails THEN
3496 BEGIN
3497 /* remote node, or path to it, is down */
3498
3499 abort TCP connection;
3500 close NetBIOS session;
3501 inform user that session is lost;
3502 return;
3503 END
3504 END /* procedure */
3505
35065.2.3. SESSION TERMINATION PROTOCOLS
3507
35085.2.3.1. USER REQUEST PROCESSING
3509
3510 PROCEDURE close_session()
3511
3512 /* initiated by a user request to close a session */
3513
3514 BEGIN
3515 close gracefully the TCP connection;
3516
3517 WAIT for the connection to close or SSN_CLOSE_TIMEOUT
3518 to expire;
3519
3520 IF time out expired THEN
3521 abort TCP connection;
3522 END /* procedure */
3523
35245.2.3.2. RECEPTION INDICATION PROCESSING
3525
3526 PROCEDURE close_indication()
3527 /*
3528 * initiated by a TCP indication of a close request from
3529 * the remote connection partner.
3530
3531 */
3532 BEGIN
3533 close gracefully TCP connection;
3534
3535 close NetBIOS session;
3536
3537 inform user session closed by remote partner;
3538 END /* procedure */
3539
35405.3. NetBIOS DATAGRAM SERVICE PROTOCOLS
3541
3542 The following are GLOBAL variables and should be NetBIOS user
3543 configurable:
3544
3545 - SCOPE_ID: the non-leaf section of the domain name preceded by a
3546 '.' which represents the domain of the NetBIOS scope for the
3547 NetBIOS name. The following protocol description only supports
3548 single scope operation.
3549
3550 - MAX_DATAGRAM_LENGTH: the maximum length of an IP datagram. The
3551 minimal maximum length defined in for IP is 576 bytes. This
3552 value is used when determining whether to fragment a NetBIOS
3553 datagram. Implementations are expected to be capable of
3554 receiving unfragmented NetBIOS datagrams up to their maximum
3555 size.
3556
3557 - BROADCAST_ADDRESS: the IP address B-nodes use to send datagrams
3558 with group name destinations and broadcast datagrams. The
3559 default is the IP broadcast address for a single IP network.
3560
3561 The following are Defined Constants for the NetBIOS Datagram
3562 Service:
3563
3564 - DGM_SRVC_UDP_PORT: the globally well-known UDP port allocated
3565 where the NetBIOS Datagram Service receives UDP packets. See
3566 section 6, "Defined Constants", for its value.
3567
35685.3.1. B NODE TRANSMISSION OF NetBIOS DATAGRAMS
3569
3570 PROCEDURE send_datagram(data, source, destination, broadcast)
3571
3572 /*
3573 * user initiated processing on B node
3574 */
3575
3576 BEGIN
3577 group = FALSE;
3578
3579 do name discovery on destination name, returns name type and
3580 IP address;
3581
3582 IF name type is group name THEN
3583 BEGIN
3584 group = TRUE;
3585 END
3586
3587 /*
3588 * build datagram service UDP packet;
3589 */
3590 convert source and destination NetBIOS names into
3591 half-ASCII, biased encoded name;
3592 SOURCE_NAME = cat(source, SCOPE_ID);
3593 SOURCE_IP = this nodes IP address;
3594 SOURCE_PORT = DGM_SRVC_UDP_PORT;
3595
3596 IF NetBIOS broadcast THEN
3597 BEGIN
3598 DESTINATION_NAME = cat("*", SCOPE_ID)
3599 END
3600 ELSE
3601 BEGIN
3602 DESTINATION_NAME = cat(destination, SCOPE_ID)
3603 END
3604
3605 MSG_TYPE = select_one_from_set
3606 {BROADCAST, DIRECT_UNIQUE, DIRECT_GROUP}
3607 DGM_ID = next transaction id for Datagrams;
3608 DGM_LENGTH = length of data + length of second level encoded
3609 source and destination names;
3610
3611 IF (length of the NetBIOS Datagram, including UDP and
3612 IP headers, &gt; MAX_DATAGRAM_LENGTH) THEN
3613 BEGIN
3614 /*
3615 * fragment NetBIOS datagram into 2 UDP packets
3616 */
3617 Put names into 1st UDP packet and any data that fits
3618 after names;
3619 Set MORE and FIRST bits in 1st UDP packet's FLAGS;
3620 OFFSET in 1st UDP = 0;
3621
3622 Replicate NetBIOS Datagram header from 1st UDP packet
3623 into 2nd UDP packet;
3624 Put rest of data in 2nd UDP packet;
3625 Clear MORE and FIRST bits in 2nd UDP packet's FLAGS;
3626 OFFSET in 2nd UDP = DGM_LENGTH - number of name and
3627 data bytes in 1st UDP;
3628 END
3629 BEGIN
3630 /*
3631 * Only need one UDP packet
3632 */
3633
3634 USER_DATA = data;
3635 Clear MORE bit and set FIRST bit in FLAGS;
3636 OFFSET = 0;
3637 END
3638
3639 IF (group == TRUE) OR (NetBIOS broadcast) THEN
3640 BEGIN
3641 send UDP packet(s) to BROADCAST_ADDRESS;
3642 END
3643 ELSE
3644 BEGIN
3645 send UDP packet(s) to IP address returned by name
3646 discovery;
3647 END
3648 END /* procedure */
3649
36505.3.2. P AND M NODE TRANSMISSION OF NetBIOS DATAGRAMS
3651
3652 PROCEDURE send_datagram(data, source, destination, broadcast)
3653
3654 /*
3655 * User initiated processing on P and M node.
3656 *
3657 * This processing is the same as for B nodes except for
3658 * sending broadcast and multicast NetBIOS datagrams.
3659 */
3660
3661 BEGIN
3662 group = FALSE;
3663
3664 do name discovery on destination name, returns name type
3665 and IP address;
3666 IF name type is group name THEN
3667 BEGIN
3668 group = TRUE;
3669 END
3670
3671 /*
3672 * build datagram service UDP packet;
3673 */
3674 convert source and destination NetBIOS names into
3675 half-ASCII, biased encoded name;
3676 SOURCE_NAME = cat(source, SCOPE_ID);
3677 SOURCE_IP = this nodes IP address;
3678 SOURCE_PORT = DGM_SRVC_UDP_PORT;
3679
3680 IF NetBIOS broadcast THEN
3681 BEGIN
3682 DESTINATION_NAME = cat("*", SCOPE_ID)
3683 END
3684 ELSE
3685
3686 BEGIN
3687 DESTINATION_NAME = cat(destination, SCOPE_ID)
3688 END
3689
3690 MSG_TYPE = select_one_from_set
3691 {BROADCAST, DIRECT_UNIQUE, DIRECT_GROUP}
3692 DGM_ID = next transaction id for Datagrams;
3693 DGM_LENGTH = length of data + length of second level encoded
3694 source and destination names;
3695
3696 IF (length of the NetBIOS Datagram, including UDP and
3697 IP headers, &gt; MAX_DATAGRAM_LENGTH) THEN
3698 BEGIN
3699 /*
3700 * fragment NetBIOS datagram into 2 UDP packets
3701 */
3702 Put names into 1st UDP packet and any data that fits
3703 after names;
3704 Set MORE and FIRST bits in 1st UDP packet's FLAGS;
3705
3706 OFFSET in 1st UDP = 0;
3707
3708 Replicate NetBIOS Datagram header from 1st UDP packet
3709 into 2nd UDP packet;
3710 Put rest of data in 2nd UDP packet;
3711 Clear MORE and FIRST bits in 2nd UDP packet's FLAGS;
3712 OFFSET in 2nd UDP = DGM_LENGTH - number of name and
3713 data bytes in 1st UDP;
3714 END
3715 BEGIN
3716 /*
3717 * Only need one UDP packet
3718 */
3719 USER_DATA = data;
3720 Clear MORE bit and set FIRST bit in FLAGS;
3721 OFFSET = 0;
3722 END
3723
3724 IF (group == TRUE) OR (NetBIOS broadcast) THEN
3725 BEGIN
3726 /*
3727 * Sending of following query is optional.
3728 * Node may send datagram to NBDD immediately
3729 * but NBDD may discard the datagram.
3730 */
3731 send DATAGRAM QUERY REQUEST to NBDD;
3732 IF response is POSITIVE QUERY RESPONSE THEN
3733 send UDP packet(s) to NBDD Server IP address;
3734 ELSE
3735 BEGIN
3736 get list of destination nodes from NBNS;
3737
3738 FOR EACH node in list
3739 BEGIN
3740 send UDP packet(s) to this node's
3741 IP address;
3742 END
3743 END
3744 END
3745 ELSE
3746 BEGIN
3747 send UDP packet(s) to IP address returned by name
3748 discovery;
3749 END /* procedure */
3750
37515.3.3. RECEPTION OF NetBIOS DATAGRAMS BY ALL NODES
3752
3753 The following algorithm discards out of order NetBIOS Datagram
3754 fragments. An implementation which reassembles out of order
3755 NetBIOS Datagram fragments conforms to this specification. The
3756 fragment discard timer is initialized to the value FRAGMENT_TO.
3757 This value should be user configurable. The default value is
3758 given in Section 6, "Defined Constants and Variables".
3759
3760 PROCEDURE datagram_packet(packet)
3761
3762 /*
3763 * processing initiated by datagram packet reception
3764 * on B, P and M nodes
3765 */
3766 BEGIN
3767 /*
3768 * if this node is a P node, ignore
3769 * broadcast packets.
3770 */
3771
3772 IF this is a P node AND incoming packet is
3773 a broadcast packet THEN
3774 BEGIN
3775 discard packet;
3776 END
3777
3778 CASE packet type OF
3779
3780 DATAGRAM SERVICE:
3781 BEGIN
3782 IF FIRST bit in FLAGS is set THEN
3783 BEGIN
3784 IF MORE bit in FLAGS is set THEN
3785 BEGIN
3786 Save 1st UDP packet of the Datagram;
3787 Set this Datagram's fragment discard
3788 timer to FRAGMENT_TO;
3789
3790 return;
3791 END
3792 ELSE
3793 Datagram is composed of a single
3794 UDP packet;
3795 END
3796 ELSE
3797 BEGIN
3798 /* Have the second fragment of a Datagram */
3799
3800 Search for 1st fragment by source IP address
3801 and DGM_ID;
3802 IF found 1st fragment THEN
3803 Process both UDP packets;
3804 ELSE
3805 BEGIN
3806 discard 2nd fragment UDP packet;
3807 return;
3808 END
3809 END
3810
3811 IF DESTINATION_NAME is '*' THEN
3812 BEGIN
3813 /* NetBIOS broadcast */
3814
3815 deliver USER_DATA from UDP packet(s) to all
3816 outstanding receive broadcast
3817 datagram requests;
3818 return;
3819 END
3820 ELSE
3821 BEGIN /* non-broadcast */
3822 /* Datagram for Unique or Group Name */
3823
3824 IF DESTINATION_NAME is not present in the
3825 local name table THEN
3826 BEGIN
3827 /* destination not present */
3828 build DATAGRAM ERROR packet, clear
3829 FIRST and MORE bit, put in
3830 this nodes IP and PORT, set
3831 ERROR_CODE;
3832 send DATAGRAM ERROR packet to
3833 source IP address and port
3834 of UDP;
3835 discard UDP packet(s);
3836 return;
3837 END
3838 ELSE
3839 BEGIN /* good */
3840 /*
3841
3842 * Replicate received NetBIOS datagram for
3843 * each recipient
3844 */
3845 FOR EACH pending NetBIOS user's receive
3846 datagram operation
3847 BEGIN
3848 IF source name of operation
3849 matches destination name
3850 of packet THEN
3851 BEGIN
3852 deliver USER_DATA from UDP
3853 packet(s);
3854 END
3855 END /* for each */
3856 return;
3857 END /* good */
3858 END /* non-broadcast */
3859 END /* datagram service */
3860
3861 DATAGRAM ERROR:
3862 BEGIN
3863 /*
3864 * name service returned incorrect information
3865 */
3866
3867 inform local name service that incorrect
3868 information was provided;
3869
3870 IF this is a P or M node THEN
3871 BEGIN
3872 /*
3873 * tell NetBIOS Name Server that it may
3874 * have given incorrect information
3875 */
3876
3877 send NAME RELEASE REQUEST with name
3878 and incorrect IP address to NetBIOS
3879 Name Server;
3880 END
3881 END /* datagram error */
3882
3883 END /* case */
3884 END
3885
38865.3.4. PROTOCOLS FOR THE NBDD
3887
3888 The key to NetBIOS Datagram forwarding service is the packet
3889 delivered to the destination end node must have the same NetBIOS
3890 header as if the source end node sent the packet directly to the
3891 destination end node. Consequently, the NBDD does not reassemble
3892 NetBIOS Datagrams. It forwards the UDP packet as is.
3893
3894 PROCEDURE datagram_packet(packet)
3895
3896 /*
3897 * processing initiated by a incoming datagram service
3898 * packet on a NBDD node.
3899 */
3900
3901 BEGIN
3902 CASE packet type OF
3903
3904 DATAGRAM SERVICE:
3905 BEGIN
3906 IF packet was sent as a directed
3907 NetBIOS datagram THEN
3908 BEGIN
3909 /*
3910 * provide group forwarding service
3911 *
3912 * Forward datagram to each member of the
3913 * group. Can forward via:
3914 * 1) get list of group members and send
3915 * the DATAGRAM SERVICE packet unicast
3916 * to each
3917 * 2) use Group Multicast, if available
3918 * 3) combination of 1) and 2)
3919 */
3920
3921 ...
3922
3923 END
3924
3925 ELSE
3926 BEGIN
3927 /*
3928 * provide broadcast forwarding service
3929 *
3930 * Forward datagram to every node in the
3931 * NetBIOS scope. Can forward via:
3932 * 1) get list of group members and send
3933 * the DATAGRAM SERVICE packet unicast
3934 * to each
3935 * 2) use Group Multicast, if available
3936 * 3) combination of 1) and 2)
3937 */
3938
3939 ...
3940
3941 END
3942 END /* datagram service */
3943
3944 DATAGRAM ERROR:
3945
3946 BEGIN
3947 /*
3948 * Should never receive these because Datagrams
3949 * forwarded have source end node IP address and
3950 * port in NetBIOS header.
3951 */
3952
3953 send DELETE NAME REQUEST with incorrect name and
3954 IP address to NetBIOS Name Server;
3955
3956 END /* datagram error */
3957
3958 DATAGRAM QUERY REQUEST:
3959 BEGIN
3960 IF can send packet to DESTINATION_NAME THEN
3961 BEGIN
3962 /*
3963 * NBDD is able to relay Datagrams for
3964 * this name
3965 */
3966
3967 send POSITIVE DATAGRAM QUERY RESPONSE to
3968 REQUEST source IP address and UDP port
3969 with request's DGM_ID;
3970 END
3971 ELSE
3972 BEGIN
3973 /*
3974 * NBDD is NOT able to relay Datagrams for
3975 * this name
3976 */
3977
3978 send NEGATIVE DATAGRAM QUERY RESPONSE to
3979 REQUEST source IP address and UDP port
3980
3981 with request's DGM_ID;
3982 END
3983 END /* datagram query request */
3984
3985 END /* case */
3986 END /* procedure */
3987
39886. DEFINED CONSTANTS AND VARIABLES
3989
3990 GENERAL:
3991
3992 SCOPE_ID The name of the NetBIOS scope.
3993
3994 This is expressed as a character
3995 string meeting the requirements of
3996 the domain name system and without
3997 a leading or trailing "dot".
3998
3999 An implementation may elect to make
4000 this a single global value for the
4001 node or allow it to be specified
4002 with each separate NetBIOS name
4003 (thus permitting cross-scope
4004 references.)
4005
4006 BROADCAST_ADDRESS An IP address composed of the
4007 nodes's network and subnetwork
4008 numbers with all remaining bits set
4009 to one.
4010
4011 I.e. "Specific subnet" broadcast
4012 addressing according to section 2.3
4013 of <A HREF="/rfcs/rfc950.html">RFC 950</A>.
4014
4015 BCAST_REQ_RETRY_TIMEOUT 250 milliseconds.
4016 An adaptive timer may be used.
4017
4018 BCAST_REQ_RETRY_COUNT 3
4019
4020 UCAST_REQ_RETRY_TIMEOUT 5 seconds
4021 An adaptive timer may be used.
4022
4023 UCAST_REQ_RETRY_COUNT 3
4024
4025 MAX_DATAGRAM_LENGTH 576 bytes (default)
4026
4027 NAME SERVICE:
4028
4029 REFRESH_TIMER Negotiated with NBNS for each name.
4030
4031 CONFLICT_TIMER 1 second
4032 Implementations may chose a longer
4033 value.
4034
4035 NAME_SERVICE_TCP_PORT 137 (decimal)
4036
4037 NAME_SERVICE_UDP_PORT 137 (decimal)
4038
4039 INFINITE_TTL 0
4040
4041 SESSION SERVICE:
4042
4043 SSN_SRVC_TCP_PORT 139 (decimal)
4044
4045 SSN_RETRY_COUNT 4 (default)
4046 Re-configurable by user.
4047
4048 SSN_CLOSE_TIMEOUT 30 seconds (default)
4049 Re-configurable by user.
4050
4051 SSN_KEEP_ALIVE_TIMEOUT 60 seconds, recommended, may be set to
4052 a higher value.
4053 (Session keep-alives are used only
4054 if configured.)
4055
4056 DATAGRAM SERVICE:
4057
4058 DGM_SRVC_UDP_PORT 138 (decimal)
4059
4060 FRAGMENT_TO 2 seconds (default)
4061
4062REFERENCES
4063
4064 [1] "Protocol Standard For a NetBIOS Service on a TCP/UDP
4065 Transport: Concepts and Methods", <A HREF="/rfcs/rfc1001.html">RFC 1001</A>, March 1987.
4066
4067 [2] J. Reynolds, J. Postel, "Assigned Numbers", <A HREF="/rfcs/rfc990.html">RFC 990</A>, November
4068 1986.
4069
4070 [3] P. Mockapetris, "Domain Names - Implementation and
4071 Specification", <A HREF="/rfcs/rfc883.html">RFC 883</A>, November 1983.
4072
4073</PRE>
4074<p align=center><script language="JavaScript"><!--
4075erfc("1002");
4076// --></script></p>
4077&nbsp;<br>
4078<div align="center">
4079<table border="0" cellpadding="3" width="100%" cellspacing="3">
4080<tr><td width="45%">
4081<p align="left">Previous: <a href="/rfcs/rfc1001.html">RFC 1001 - Protocol standard for a NetBIOS service on a TCP/UDP transport: Concepts and methods</a>
4082</p></td><td width="10%">&nbsp;</td><td width="45%">
4083<p align="right">Next: <a href="/rfcs/rfc1003.html">RFC 1003 - Issues in defining an equations representation standard</a>
4084</p></td></tr></table></div><p align="right">&nbsp;</p>
4085<HR SIZE=2 NOSHADE>
4086<DIV ALIGN=CENTER>[ <a href="/rfcs/">RFC Index</a> | <A HREF="/rfcs/rfcsearch.html">RFC Search</A> | <a href="/faqs/">Usenet FAQs</a> | <a href="/contrib/">Web FAQs</a> | <a href="/docs/">Documents</a> | <a href="http://www.city-data.com/">Cities</a> ]
4087<P>
4088</DIV>
4089<SMALL>
4090<ADDRESS>
4091<P ALIGN=CENTER>
4092
4093</P>
4094</ADDRESS>
4095</SMALL>
4096</BODY>
4097</HTML>
4098