USB Remote NDIS Devices and Windows
Updated: June 29, 2009
The Microsoft Windows XP and Windows CE .NET operating systems include built-in support for RNDIS USB Drivers. This article is provided for hardware manufacturers who are creating USB network adapters that take advantage of these capabilities in Windows operating systems. It is assumed that the reader is familiar with the Remote NDIS Specification; Universal Serial Bus Specification, Revision 1.1; and the USB Communications Device Class Specification, Revision 1.0.
On This Page
Introduction and Background
Remote NDIS is a Windows architecture for natively supporting network devices on dynamic Plug and Play buses. Windows XP and Windows CE .NET ship with native support for USB Remote NDIS Ethernet adapters. This article provides an informational overview and guide to building a USB Remote NDIS adapter, including a USB descriptor sample.
Readers should be familiar with Universal Serial Bus specification. In particular, readers should understand the hierarchical set of descriptors that define Universal Serial Bus (USB) device functionality to the operating system. The Remote NDIS Specification is required as the definitive document. The other specifications listed at the end of this article are required for reference.
The "legacy-free" PC revolution will eliminate not only legacy connection ports such as serial, parallel, and PS/2 but also legacy expansion buses such as ISA and PCI in mainstream PCs. The resulting "sealed case" PCs will require either built-in networking support on the motherboard or support for network adapters on external buses. Microsoft has designed the Remote NDIS architecture to support external network adapters and provide native vendor-independent driver support in Windows.
USB and Windows
USB ports exist on almost all new PCs and are natively supported in current versions of Windows. In addition to providing for external expansion and dynamic Plug and Play, USB allows devices to be self-describing. USB devices describe their functionality to the PC through a set of descriptors similar to those shown in the sample later in this article. Those descriptors include class codes that indicate to the operating system which drivers to load, even if there is no direct Vendor ID (VID) or Product ID (PID) match in the installed INF.
Remote NDIS is a simple extension of the well-understood and time-tested NDIS architecture. It allows for standard, in-the-box support for network adapters on external Plug and Play buses such as USB.
NDIS provides support for a wide range of functionality for traditional network adapters. The potentially large set of features of a network adapter is exposed and managed through NDIS-defined Object Identifiers (OIDs), which are traditionally serviced by the NDIS miniport driver for the adapter. Remote NDIS leverages this large body of specification and architecture work by routing OIDs to the device itself and eliminating the adapter-specific miniport driver. In a sense, the miniport driver is implemented in the RNDIS-compliant network adapter itself.
From the adapters point of view, Remote NDIS consists of a small set of control messages and a conduit for OIDs and data packets. Tables 1 through 3 list the Remote NDIS control messages and data messages. For details, see the Remote NDIS Specification.
Table 1: Control messages sent by the host PC to the adapter
Table 2: Control messages sent by the adapter to the host PC
The Remote NDIS Specification lists the OIDs that the adapter must support. The specification also lists optional OIDs that the adapter can support for value-added features.
Table 3: Data message used by both PC and adapter to transmit packets
In a working scenario, a Remote NDIS Ethernet adapter and a host PC would exchange messages as follows:
Remote NDIS has a provision for combining multiple RndisPackets into a single bus transfer. On the adapter side, using multi-packet transmits is essential for good performance.
USB Remote NDIS Ethernet Adapter
For each bus type, the control and data messages must be transmitted to the adapter in a different way. The Remote NDIS Specification includes a chapter for each supported bus that describes the low-level issues related to message transmission on that bus.
The USB chapter describes how control and data messages are addressed to device endpoints. A USB Remote NDIS device is required to implement the following endpoints:
The USB Remote NDIS microport driver continuously reads the Interrupt endpoint for device notifications. The only defined notification indicates that the host should read the Control endpoint. This scheme eliminates the need to post reads to the Control endpoint until there is something there to read.
The next section shows a sample set of descriptors that describe the Interface and Endpoint layout of a USB Remote NDIS Ethernet adapter.
Sample USB Remote NDIS Ethernet Adapter
The following is a sample set of descriptors for a USB Remote NDIS Ethernet Adapter. It includes a Communication Class interface and a Data Class interface, which is required for the adapter to qualify as a legal USB Communication Device Class (CDC) device even though it is a single-function device.
The Device Descriptor is returned independently. The Configuration descriptor and all following descriptors are returned as a single block in the order shown.
Control messages are sent on the Control endpoint. Notification messages are sent on the Interrupt In endpoint in the Communication Class interface. Data messages are sent on the Bulk In and Bulk Out endpoints in the Data interface. For brevity, string descriptors are not shown.
If any portion of this sample contradicts a controlling specification, the specification takes precedence.
Table A1: USB Device Descriptor
Table A2: USB Configuration Descriptor
Interface Descriptor for Communication Class Interface
Table A3: USB Communication Class Interface Descriptor
The following are class-specific descriptors of the USB Communication Class. As such, they follow the Communication Class Interface descriptor and precede any Endpoint descriptors for the interface.
Table A4: USB Communication Class Call Management Descriptor
Table A5: USB Communication Class Abstract Control Management Descriptor
Table A6: USB Communication Class Union Functional Descriptor
Notification Endpoint Descriptor
Table A7: Descriptor for Notification Endpoint
Interface Descriptor for Data Class Interface
Table A8: USB Data Class Interface Descriptor
Data In Endpoint Descriptor
Table A9: Descriptor for Bulk IN Endpoint
Data Out Endpoint Descriptor
Table A10: Descriptor for Bulk OUT Endpoint
Call to Action
Universal Serial Bus Specification, Revision 1.1, at
USB Communications Device Class Specificaiton, Revision 1.0, at
Remote NDIS Specification, Revision 1.0, at