Brief summary of the RNDIS protocol (Windows Embedded CE 6.0)

1/6/2010

A brief summary of the RNDIS protocol and the implementation details are outlined below.

The device firmware handles remote NDIS messages similar to the semantics of the NDIS miniport driver interface. The following are a few examples to illustrate this:

  • Initialization (REMOTE_NDIS_INITIALIZE_MSG), resetting (REMOTE_NDIS_RESET_MSG).
  • Setting/Querying OID (REMOTE_NDIS_QUERY_MSG, REMOTE_NDIS_SET_MSG).
  • Indicating media status (REMOTE_NDIS_INDICATE_STATUS_MSG).
  • Transmitting and receiving packets (REMOTE_NDIS_PACKET_MSG).

For USB the RNDIS USB transport uses the abstract control model defined by the USB Communication Device Class (CDC), version 1.1 which defines 2 interfaces, namely a communication interface and a data interface. The 2 interfaces are mapped to USB as follows (totaling 4 USB endpoints):

  • Communication Class interface of type Abstract Control, which uses Single endpoint for event notification.
  • Control endpoint (shared, bi-directional) for control messages.
  • Data Class interface which uses 2 bulk endpoints for data traffic (IN bulk EP for device to host and OUT bulk EP for host to device bulk transfer).

RNDIS messages are sent to the device using Encapsulated Command requests over the communication interface, and RNDIS packets are sent to/from device over the data interface.

The control message flow is as follows:

  • Control message from the host to the device is sent as SEND_ENCAPSULATED_COMMAND.
  • The device sends a RESPONSE_AVAILABLE notification on the CDC interface’s event notification end point after the command is processed and a response is pending.
  • The host then sends a GET_ENCAPSULATED_RESPONSE message to retrieve this response.

The data flow is as follows:

  • The data channel for device consists of Bulk IN and OUT endpoints in the Data Class interface.
  • From the host to the device, it uses the standard USB bulk transfer to the Bulk OUT endpoint of the Data Class interface.
  • From the device to the host it uses the Bulk IN endpoint of the Data Class interface.
  • Both sides read up to the maximum number of bytes indicated by the MaxTransferSize field in REMOTE_NDIS_INITIALIZE_MSG and REMOTE_NDIS_INITIALIZE_CMPLT messages.
  • If the last REMOTE_NDIS_PACKET_MSG ends with a USB packet of length exactly of the wMaxPacketSize for the endpoint, a one-byte zero packet must be sent.
  • Multiple REMOTE_NDIS_PACKET_MSG messages may be sent in one single transfer in either direction.

In summary, RNDIS specification eliminates the need for OEM miniport driver in the host machine and provides a protocol to remote the NDIS miniport driver implementation to the remote device. For USB the RNDIS uses the CDC abstract control model to achieve this utilizing the communication class interface for status and notification and data class interface for packet transfers.

See Also

Concepts

USB RNDIS in ActiveSync 4.0
RNDIS USB Client
ActiveSync using RNDIS solution
Connection issues with RNDIS

Other Resources

RNDIS
RNDISFN client driver