Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the minimum latency of USB 3.0

Tags:

usb

hardware

First up, I don't know much about USB, so apologies in advance if my question is wrong.

In USB 2.0 the polling interval was 0.125ms, so the best possible latency for the host to read some data from the device was 0.125ms. I'm hoping for reduced latency in USB 3.0 devices, but I'm finding it hard to learn what the minimum latency is. The USB 3.0 spec says, "USB 2.0 style polling has been replaced with asynchronous notifications", which implies the 0.125ms polling interval may no longer be a limit.

I found some benchmarks for a USB 3.0 SSDs that look like data can be read from the device in just slightly less than 0.125ms, and that includes all time spent in the host OS and the device's flash controller.

http://www.guru3d.com/articles_pages/ocz_enyo_usb_3_portable_ssd_review,8.html

Can someone tell me what the lowest possible latency is? A theoretical answer is fine. An answer including the practical limits of the various versions of Linux and Windows USB stacks would be awesome.

To head-off the "tell me what you're trying to achieve" question, I'm creating a debug interface for the ASICs my company designs. ie A PC connects to one of our ASICs via a debug dongle. One possible use case is to implement conditional breakpoints when the ASIC hardware only implements simple breakpoints. To do so, I need to determine when a simple breakpoint has been hit, evaluate the condition, if false set the processor running again. The simple breakpoint may be hit millions of times before the condition becomes true. We might implement the debug dongle on an FPGA or an off-the-shelf USB 3.0 enabled micro-controller.

like image 812
Andrew Bainbridge Avatar asked Dec 12 '12 00:12

Andrew Bainbridge


People also ask

How fast is USB 3.0 supposed to be?

The theoretical transfer speed of USB 3.0 is 4.8 Gbit/s (600MBps) vs. 480 Mbit/s (60MBps) which is a 10X improvement. Sustained transfer speeds (real life) for external hard drives are about 85MBps for USB 3.0 and about 22MBps for USB 2.0, so about a 5X improvement but still a significant advancement in transfer speed.

Is USB 3.0 the fastest USB?

Speed -- USB 2.0 offers a transfer rate of about 480 Mbps, whereas USB 3.0 offers a transfer rate of about 4,800 Mbps which is equal to about 5 GB. This super-fast transfer speed of USB 3.0 can be especially useful when backing up or transferring large amounts of data, such as an external hard drive.

Does USB c reduce latency?

USB-A and USB-C are just connectors. They have no latency associated with them. You probably mean that the USB 3.1 protocol has lower latency than USB 2.0. This is true, but irrelevant because the laptop will not be using USB 3.1 in any case.

Why USB 3.0 is faster?

The USB 3.0 sends the data down the tunnel at such a huge rate it maxes out the tunnel's capacity so the end result may be a faster download than a USB 2.0. But with a USB 3.0 port you get a much bigger 'pipe' so the data travels even faster still.


2 Answers

Answering my own question...

I've come to realise that this question kind-of misses the point of USB 3.0. Unlike 2.0, it is not a shared-bus system. Instead it uses a point-to-point link between the host and each device (I'm oversimplifying but the gist is true). With USB 2.0, the 125 us polling interval was critical to how the bus was time-division multiplexed between devices. However, because 3.0 uses point-to-point links, there is no multiplexing to be done and thus the polling interval no longer exists. As a result, the latency on packet delivery is much less than with USB 2.0.

In my experiments with a Cypress FX-3 devkit, I have found that it is easy enough to get an average round trip from Windows application to the device and back with an average latency of 30 us. I suspect that the vast majority of that time is spent in various OS delays, eg the user-space to kernel-space mode switch and the DPC latency within the driver.

like image 199
Andrew Bainbridge Avatar answered Sep 18 '22 13:09

Andrew Bainbridge


I've got a couple of resources for you, one I've just downloaded which is the complete specs ... several pdfs zipped up for USB3, and here is short excerpt from page 58,59 (USB 3_r1.0_06_06_2011.pdf):

USB 2.0 transmits SOF/uSOF at fixed 1 ms/125 μs intervals. A device driver may change the interval with small finite adjustments depending on the implementation of host and system software. USB 3.0 adds mechanism for devices to send a Bus Interval Adjustment Message that is used by the host to adjust its 125 μs bus interval up to +/-13.333 μs.

In addition, the host may send an Isochronous Timestamp Packet (ITP) within a relaxed timing window from a bus interval boundary.

Here is one more resource which looked interesting which deals with calculating latency.

You make a good point about operating system latency issues, especially in not real time operating systems.

I might suggest that you check on SuperUser too, maybe someone has other ideas. CHEERS

like image 29
happy coder Avatar answered Sep 22 '22 13:09

happy coder