📄 rfc1002.txt
字号:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| A (0x41) | C (0x43) | A (0x41) | C (0x43) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| A (0X41) | 0x07 | N (0x4E) | E (0x45) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| T (0x54) | B (0x42) | I (0x49) | O (0x4F) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| S (0x53) | 0x03 | C (0x43) | O (0x4F) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| M (0x4D) | 0x00 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Each section of a domain name is called a label [7 (page 31)]. A
label can be a maximum of 63 bytes. The first byte of a label in
compressed representation is the number of bytes in the label. For
the above example, the first 0x20 is the number of bytes in the
left-most label, EGFCEFEECACACACACACACACACACACACA, of the domain
name. The bytes following the label length count are the characters
of the label. The following labels are in sequence after the first
label, which is the encoded NetBIOS name, until a zero (0x00) length
count. The zero length count represents the root label, which is
always null.
A label length count is actually a 6-bit field in the label length
field. The most significant 2 bits of the field, bits 7 and 6, are
flags allowing an escape from the above compressed representation.
If bits 7 and 6 are both set (11), the following 14 bits are an
offset pointer into the full message to the actual label string from
another domain name that belongs in this name. This label pointer
allows for a further compression of a domain name in a packet.
NetBIOS implementations can only use label string pointers in Name
Service packets. They cannot be used in Session or Datagram Service
packets.
NetBIOS Working Group [Page 6]
RFC 1002 March 1987
The other two possible values for bits 7 and 6 (01 and 10) of a label
length field are reserved for future use by RFC 883[2 (page 32)].
Note that the first octet of a compressed name must contain one of
the following bit patterns. (An "x" indicates a bit whose value may
be either 0 or 1.):
00100000 - Netbios name, length must be 32 (decimal)
11xxxxxx - Label string pointer
10xxxxxx - Reserved
01xxxxxx - Reserved
4.2. NAME SERVICE PACKETS
4.2.1. GENERAL FORMAT OF NAME SERVICE PACKETS
The NetBIOS Name Service packets follow the packet structure defined
in the Domain Name Service (DNS) RFC 883 [7 (pg 26-31)]. The
structures are compatible with the existing DNS packet formats,
however, additional types and codes have been added to work with
NetBIOS.
If Name Service packets are sent over a TCP connection they are
preceded by a 16 bit unsigned integer representing the length of the
Name Service packet.
1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ ------ ------- +
| HEADER |
+ ------ ------- +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
/ QUESTION ENTRIES /
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
/ ANSWER RESOURCE RECORDS /
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
/ AUTHORITY RESOURCE RECORDS /
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
/ ADDITIONAL RESOURCE RECORDS /
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
NetBIOS Working Group [Page 7]
RFC 1002 March 1987
4.2.1.1. HEADER
1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| NAME_TRN_ID | OPCODE | NM_FLAGS | RCODE |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| QDCOUNT | ANCOUNT |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| NSCOUNT | ARCOUNT |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Field Description
NAME_TRN_ID Transaction ID for Name Service Transaction.
Requestor places a unique value for each active
transaction. Responder puts NAME_TRN_ID value
from request packet in response packet.
OPCODE Packet type code, see table below.
NM_FLAGS Flags for operation, see table below.
RCODE Result codes of request. Table of RCODE values
for each response packet below.
QDCOUNT Unsigned 16 bit integer specifying the number of
entries in the question section of a Name
Service packet. Always zero (0) for responses.
Must be non-zero for all NetBIOS Name requests.
ANCOUNT Unsigned 16 bit integer specifying the number of
resource records in the answer section of a Name
Service packet.
NSCOUNT Unsigned 16 bit integer specifying the number of
resource records in the authority section of a
Name Service packet.
ARCOUNT Unsigned 16 bit integer specifying the number of
resource records in the additional records
section of a Name Service packet.
The OPCODE field is defined as:
0 1 2 3 4
+---+---+---+---+---+
| R | OPCODE |
+---+---+---+---+---+
NetBIOS Working Group [Page 8]
RFC 1002 March 1987
Symbol Bit(s) Description
OPCODE 1-4 Operation specifier:
0 = query
5 = registration
6 = release
7 = WACK
8 = refresh
R 0 RESPONSE flag:
if bit == 0 then request packet
if bit == 1 then response packet.
The NM_FLAGS field is defined as:
0 1 2 3 4 5 6
+---+---+---+---+---+---+---+
|AA |TC |RD |RA | 0 | 0 | B |
+---+---+---+---+---+---+---+
Symbol Bit(s) Description
B 6 Broadcast Flag.
= 1: packet was broadcast or multicast
= 0: unicast
RA 3 Recursion Available Flag.
Only valid in responses from a NetBIOS Name
Server -- must be zero in all other
responses.
If one (1) then the NBNS supports recursive
query, registration, and release.
If zero (0) then the end-node must iterate
for query and challenge for registration.
RD 2 Recursion Desired Flag.
May only be set on a request to a NetBIOS
Name Server.
The NBNS will copy its state into the
response packet.
If one (1) the NBNS will iterate on the
query, registration, or release.
TC 1 Truncation Flag.
NetBIOS Working Group [Page 9]
RFC 1002 March 1987
Set if this message was truncated because the
datagram carrying it would be greater than
576 bytes in length. Use TCP to get the
information from the NetBIOS Name Server.
AA 0 Authoritative Answer flag.
Must be zero (0) if R flag of OPCODE is zero
(0).
If R flag is one (1) then if AA is one (1)
then the node responding is an authority for
the domain name.
End nodes responding to queries always set
this bit in responses.
4.2.1.2. QUESTION SECTION
1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
/ QUESTION_NAME /
/ /
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| QUESTION_TYPE | QUESTION_CLASS |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Field Description
QUESTION_NAME The compressed name representation of the
NetBIOS name for the request.
QUESTION_TYPE The type of request. The values for this field
are specified for each request.
QUESTION_CLASS The class of the request. The values for this
field are specified for each request.
QUESTION_TYPE is defined as:
Symbol Value Description:
NB 0x0020 NetBIOS general Name Service Resource Record
NBSTAT 0x0021 NetBIOS NODE STATUS Resource Record (See NODE
STATUS REQUEST)
QUESTION_CLASS is defined as:
NetBIOS Working Group [Page 10]
RFC 1002 March 1987
Symbol Value Description:
IN 0x0001 Internet class
4.2.1.3. RESOURCE RECORD
1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
/ RR_NAME /
/ /
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| RR_TYPE | RR_CLASS |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| TTL |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| RDLENGTH | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
/ /
/ RDATA /
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Field Description
RR_NAME The compressed name representation of the
NetBIOS name corresponding to this resource
record.
RR_TYPE Resource record type code
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -