Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do USB Control Transfers guarantee delivery?

Tags:

usb

USB 2.0 specifies 4 types of transfers (in section 5.4 Transfer Types):

  • Control Transfers
  • Isochronous Transfers
  • Interrupt Transfers
  • Bulk Transfers

Section 5.8 says that Bulk Transfers provide:

  • Access to the USB on a bandwidth-available basis
  • Retry of transfers, in the case of occasional delivery failure due to errors on the bus
  • Guaranteed delivery of data but no guarantee of bandwidth or latency

(Emphasis mine.)

I don't see a similar statement for Control Transfers. Do they also guarantee delivery? If not, how are users expected to handle failures?

Please provide a citation(s) to support your answer.

like image 985
cp.engr Avatar asked Oct 18 '22 03:10

cp.engr


People also ask

What is USB control transfer?

All USB devices must support at least one endpoint called the default endpoint. Any transfer that targets the default endpoint is called a control transfer.

What is isochronous transfer in USB?

Isochronous Transfers are used for transmitting real-time information such as audio and video data, and must be sent at a constant rate. USB isochronous data streams are allocated a dedicated portion of USB bandwidth to ensure that data can be delivered at the desired rate.

What is USB bulk?

A USB bulk endpoint can transfer large amounts of data. Bulk transfers are reliable that allow hardware error detection, and involves limited number of retries in the hardware. For transfers to bulk endpoints, bandwidth is not reserved on the bus.


1 Answers

The USB specification provides robust error detection and recovery for control transfers. The control transfer will either be completed or the USB host will know that it failed, and I think that's what "guaranteed delivery" is supposed to mean. This is important because control transfers are used to set up the device when you plug it into a computer and they are also used for many important purposes by the various USB device classes (e.g. they are used to set the baud rate of a serial port on a USB CDC ACM device).

From section 5.5.5 of the USB 2.0 specification:

The USB provides robust error detection and recovery/retransmission for errors that occur during control transfers. Transmitters and receivers can remain synchronized with regard to where they are in a control transfer and recover with minimum effort. Retransmission of Data and Status packets can be detected by a receiver via data retry indicators in the packet. A transmitter can reliably determine that its corresponding receiver has successfully accepted a transmitted packet by information returned in a handshake to the packet. The protocol allows for distinguishing a retransmitted packet from its original packet except for a control Setup packet. Setup packets may be retransmitted due to a transmission error; however, Setup packets cannot indicate that a packet is an original or a retried transmission.

The only transfer type without guaranteed delivery is isochronous. Also, the start of frame (SOF) packets don't have guaranteed delivery.

like image 74
David Grayson Avatar answered Oct 21 '22 04:10

David Grayson