Author Topic: What are encapsulated command and response  (Read 10823 times)

turboscrew

  • Member
  • ***
  • Posts: 8
What are encapsulated command and response
« on: March 20, 2015, 09:15:16 am »
I've been trying to get a grasp of encapsulated commands and responses, but haven't succeeded.
I've read the specs and searched the web, but couldn't fit the pieces together.
I'm interested in both RNDIS and NCM (and the general idea).

How are the encapsulated commands/responses used?
What goes through control EP and what through data EP? And in which order?
A pointer to a message diagram would be awesome.
How is encapsulated transfer different from the basic general bulk transfer.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: What are encapsulated command and response
« Reply #1 on: March 20, 2015, 05:35:15 pm »
Bulk transfer is the transport mechanism. Bulk transfers can carry data for any of a number of purposes including mass storage, printer, network communications.

RNDIS and NCM are higher-level protocols that can define the purpose and use of the data carried by bulk transfers.

RNDIS uses the terms data and control channels, which correspond to USB bulk and control endpoints and pipes. NCM doesn't use the control endpoint.

turboscrew

  • Member
  • ***
  • Posts: 8
Re: What are encapsulated command and response
« Reply #2 on: March 20, 2015, 07:32:24 pm »
Sorry, I wasn't clear: I'd like to know about encapsulated commands and responses as such (the idea) and how RNDIS and NCM devices handle them.

At some point I got the impression that RNDIS sends data messages by sending the "message header data" to the control EP and the actual raw data to the bulk EP. Or is it just bulk transfer with the bulk data wrapped in message structures?

Encapsulated commands and responses seem to be used quite a lot (internet sticks, tethering), but any descriptions about them seems to be quite hard to find. Most example drivers don't do it, because it's considered too complicated (I think).


Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: What are encapsulated command and response
« Reply #3 on: March 22, 2015, 11:08:10 am »
From the RNDIS spec:

2.2 Message Syntax
The REMOTE_NDIS_PACKET_MSG message is the only message exchanged over the data channel, and the rest of the messages defined in the following table are control messages.

NCM uses bulk and interrupt endpoints, see sections 5.3 and 6.3 in the NCM spec.

turboscrew

  • Member
  • ***
  • Posts: 8
Re: What are encapsulated command and response
« Reply #4 on: March 22, 2015, 01:03:47 pm »
OK, thanks.