Overview of Windows Server 2003 Networking
This topic covers the methods used by Windows Server 2003 to determine the proper address and port at each Network layer. It uses the standard Open System Interconnection (OSI) model as a road map (see Figure 4.2). Windows networking doesn't precisely follow OSI, but the structure is close enough to permit parallels.
Figure 4.2. Diagram of OSI layers and Windows Server 2003 network drivers.
Data Link Layer
In the OSI model, the data link layer defines methods for packaging data to be transmitted over physical media. The OSI data link layer is divided by IEEE 802.1 into a Media Access Control (MAC) layer and a Logical Link Control (LLC) layer.
Windows networking does not implement separate MAC and LLC drivers. Instead, the network transport drivers handle LLC, whereas MAC duties are handled by the Network Driver Interface Specification driver (NDIS), Ndis.sys, along with a set of miniport and filter drivers written by vendors. Adapter miniport drivers come in the form of SYS drivers stored under \Windows\Drivers. A driver is installed with the help of an associated INF file located in \Windows\Inf. The network INF files are prefixed with NET*.
The NDIS and adapter miniport drivers work with the controller chip on the adapter to frame data for transmission. The transmission method depends on the physical media. It could be Ethernet, Token Ring, IEEE 802.11b wireless, or some other communication method.
A transmission frame requires a MAC address to identify the destination interface. NDIS cannot discover this address. A higher-level protocol must supply it.
The MAC address is branded into the adapter's ROM. It consists of a unique six-octet number. The first three octets identify the manufacturer. (For example, the machine I'm using has a NetGear adapter branded with 00A0CC for the manufacturer's ID.) Most major manufacturers have several MAC IDs assigned to them. The final three octets of the MAC address are assigned in sequence by the manufacturer.
Network and Transport Layers
A little further up the OSI stack is the Network layer, responsible for traffic management, and the Transport layer, responsible for connection management. In TCP/IP, Network layer functions are assigned to the Internet Protocol (IP) and Transport layer functions are assigned to either the Transport Control Protocol (TCP) or the User Datagram Protocol (UDP). Windows Server 2003 uses a single driver, Tcpip.sys, to implement both protocols.
Addressing at the Network layer takes the form of an IP address, a 32-bit number normally shown in dotted-decimal notation, such as 10.1.50.233. Every IP packet must contain the IP address of the destination host unless it is a broadcast or multicast packet. A key responsibility of Tcpip.sys is to determine the IP address associated with a packet's destination.
Addressing at the Transport layer takes the form of a port number. Many TCP/IP network applications have well-known port numbers. For example, FTP uses TCP port 21 and HTTP uses TCP port 80. RFC 1700, "Assigned Numbers," lists these port numbers.
The combination of an IP address and a port number is called a socket. A high-level application provides a socket number that the Tcpip.sys driver parses into its component parts when constructing datagrams and packets.
Some high-level applications do not use TCP or UDP. These so-called raw IP applications communicate directly to the IP layer. Windows Server 2003 supports raw IP applications as long as they use standard API calls where the host identification can be extracted. A respected member of the Internet community, Steve Gibson, has voiced concerns over this raw IP support because of the potential for Denial-of-Service and spoofing exploits. Read a summary of Mr. Gibson's white paper at grc.com/dos/xpsummary.htm.
The OSI Session layer is responsible for handling connection-oriented communications. This works in a similar fashion to human communication. You and I make eye contact, we shake hands, and we maintain each other's attention while we alternately speak and listen.
The standard 32-bit IP address space is becoming a deployment barrier thanks to the limited number of networks and hosts it can support. Its 128-bit replacement, IPv6, has been in standards track for several years but is making slow inroads. Legacy hardware must be upgraded to support it, and the proliferation of Network Address Translation (NAT) has taken away the urgency to upgrade. IPv6 is described in RFC 2460, "Internet Protocol, Version 6 (IPv6) Specification."
If you want to enable IPv6 support in Windows Server 2003, do so by running ipv6 install at a command prompt or by clicking install in the interface properties window. This makes no changes to the UI tools. All IPv6 protocol management is performed using the ipv6 utility. The IPv4 and IPv6 address spaces can coexist on the same machine.
Rather than create a separate driver for session management, the TCP/IP stack gives responsibility to the TCP protocol to implement Session layer functionality. TCP assigns a session number to a connection, sequences the datagrams exchanged across the connection, and guarantees delivery of those datagrams. High-level applications usually obtain session support by calling upon TCP, but they are also free to use their own session-control methods.
Sessionless applications resemble dysfunctional relationships where one computer listens only as long as the other computer has something interesting to say. When it is not necessary to build a session, high-level applications use the UDP protocol. UDP is capable of packaging data into a single datagram and does not guarantee delivery of that datagram. Applications typically use UDP for broadcasts/multicasts and brief messages. DNS, for example, uses UDP.
Presentation layer functionality, such as encryption and data translation, is not implemented as a distinct set of drivers in Windows Server 2003. Applications must provide this service, if they require it.
At the top of the OSI model sits the Application layer. This is where the Windows Server 2003 network services live. An example is the LAN Manager Workstation service and its complementary file system driver, Mrxsmb.sys. The workstation service communicates with the LAN Manager Server service and its file system driver, Srv.sys.
Network applications can use any method they desire for identifying their peers. Windows networking components such as LAN Manager Workstation and LAN Manager Server use computer names. These names are often called NetBIOS names because the underlying command protocol, Server Message Block (SMB), has its roots in NetBIOS. See section, "SMB and NetBIOS Names," for more information.
A NetBIOS name consists of 15 characters and a 1-byte service identifier. If the actual name has fewer than 15 characters, the name is padded to 15 bytes before appending the service identifier. For example, the Messenger service on computer SVR3 would identify itself in an SMB message as SVR3 <03>. The number in angle brackets is the service ID.
NetBIOS Name Restrictions
NetBIOS names are often called flat names because they have no hierarchical structure. Flat names must be unique within a Windows domain. Also, flat names must be unique regardless of their domain or workgroup affiliation if the hosts share the same network segment. For example, a computer in the LOX domain with an IP address of 10.1.1.1/16 cannot have the same name as a computer in the BAGEL domain with the IP address 10.1.1.2/16. This is not true of TCP/IP host names. DNS is perfectly happy saying, "This is my brother Darrell and this is my other brother Darrell."
Quite a while back, Microsoft and IBM tried to introduce a form of hierarchical domain naming called scope options into NetBIOS, but these scopes were clumsy to use and never really caught on. The design simulated DNS naming hierarchies in a very limited way, but was too convoluted to be effective.
NetBIOS names can contain any ANSI character, including spaces, with the following exceptions: /\":;|<>+=,?*. Acceptable NetBIOS names include the following:
Some characters are permitted in NetBIOS names but not included in standard DNS naming. See RFC 952, "DOD Internet Host Table Specification," and RFC 1123, "Requirements for Internet Hosts—Application and Support," for more information. Because Windows Server 2003 computers live in both the TCP/IP world and the NetBIOS world, you may want to avoid characters not supported by DNS. A commonly used character in Windows names, the underscore, is now part of the official DNS character set but not universally recognized thanks to older DNS servers.
SMB and NetBIOS Names
NetBIOS is a high-level network interface. It got its name because it was originally implemented in hardware. A NetBIOS application builds a data structure called a Network Control Block (NCB) then initiates a BIOS function call to send the NCB contents to a network adapter. Windows Server 2003 supports NetBIOS applications using a NetBIOS emulator, which traps the BIOS calls and converts them to network function calls.
NetBIOS applications are becoming very rare. SMB applications such as LanMan Workstation and LanMan Server use NetBIOS naming but are not NetBIOS applications. The reason for the similar nomenclature lies in their shared history. IBM co-developed NetBIOS with Sytek and it became a de facto standard for PC network interfaces. At the same time, IBM and Microsoft were working with 3Com to develop the network command language that eventually became SMB. Early versions of SMB applications used NetBIOS as a network interface with NETBEUI (NetBIOS Extended User Interface) as a transport protocol.
Beginning with NT Advanced Server (and versions of OS/2 LAN Manager and Warp from IBM), SMB matured into a transport-independent command language. Because SMB and NetBIOS grew up together, backward compatibility required that a few NetBIOS conventions be retained in SMB. This includes NetBIOS naming and NetBIOS name resolution.
The final byte in a NetBIOS computer name designates a service such as Browser, Domain Controller, and so forth. The combination of the computer name in the first 15 bytes and the service ID in the 16th byte forms a unique identifier, similar to the way an IP address and TCP/UDP port number combine to form a unique socket. Figure 4.3 shows a list of the NetBIOS record types managed by a WINS server. See the "Installing WINS" topic in this chapter for information on using the WINS console.
Figure 4.3. WINS console showing NetBIOS record types managed by a WINS server.
The combination of NetBIOS name and service identifiers are classified into NetBIOS name types. The Netbt.sys driver uses NetBIOS name types to handle name registration. Here are the registration handling methods:
The associated name/service combination can use only one IP address. If another computer tries to register the same name/service combination with a different IP address, it will be challenged. If one Windows Server 2003 computer named BORIS is already on the network, for example, a second computer named BORIS will not be permitted to register the same NetBIOS service.
Multiple computers can use the associated name/service combination. The Netbt.sys driver uses the Group type to define multicast groups. An SMB message directed at a multicast group in network 10.1.0.0, for example, would use an IP multicast address of 10.1.255.255. Multicasting reduces the processing load on computers in the network because only members of the multicast group need to examine the packet.
This name/service combination must be unique, but can be associated with multiple IP addresses. The Netbt.sys driver uses the Multihomed type to designate services registered by a machine with multiple network adapters. The computer's name/service combination is registered with the IP address of each adapter.
This special group designation identifies primary and backup domain controllers. A primary domain controller (PDC) normally replicates with its backup domain controllers (BDCs) using multicasts for efficiency. Some routers block multicast packets. This is where WINS takes over. The WINS server takes the multicast replication packets and directs them as unicast packets directly to the IP addresses of BDCs in its database. These unicast packets make it through intervening routers to their respective BDCs.