To USB or Not to USB

Bit Error Rates for USB 3.2

Bit Error Rates (BER) in wired and wireless communication communicate the “allowable” or target number of errors (rejected or non-transmitted data) that can occur over some given time. Usually this is measured of a period time like a second.

Wired interfaces enable faster speeds because a hard wire has less ways it can be interfered with on the path from one product to another. Even wired interfaces like USB and Ethernet, basically any wired interface port, generates https://en.wikipedia.org/wiki/Electromagnetic_interference which can interfere with data transmission inside or outside the device. For example, Electromagnetic Interference (EMI) in PCs is tightly regulated by the FCC in the U.S. For USB specifically, the BER tolerance is low because it’s a wired interface.

The FCC does not regulate hair dryers and thus can emit enough EMI to bring down a nuclear power plant.

Wireless interfaces tend to be slower. Wireless signals travel through the air and things like other wireless standards, dry wall, wood beams, steel beams, brick and mortar, microwave ovens, radio signals, x-ray machines and radioactive bananas can interfere with your WiFi or phone signal.

So here on Tuesday, or what I call Pre-Wednesday, we have a blog about USB.

What are the BER allowed by USB? How does USB 3.2 deal with errors?

Short answer: Detect, retry 3 times, let software or user decide to continue to retry or stop the device and return to manufacturer as a defective product.

At the physical layer, (PHY) bit error rate allowed is 1 bit in 1012 bits. The lower allowance for BER is because there are several layers that impact this, the transmitting PHY, the receptacle, the cable, the cable quality, the receiving receptacle, and the receiving PHY.

From the USB 3.2 specification, “To provide protection against occasional bit errors, packet framing and link commands have sufficient redundancy to tolerate single-bit errors. Each packet includes a CRC to provide error detection of multiple bit errors. When data integrity is required an error recovery procedure may be invoked in hardware or software.”

Specifically, if the CRC detects an error either the software or the hardware (controller) will initiate a request to re-transmit the data. This is done in the Link and Protocol layers of the controller. The same request should/can be done by the host controller up to 3 times. After that, the software/driver can take over and either reset and try again, or somehow notify the system that the transmission has failed.

At the link layer which is inside the digital logic of the controller the BER is 1 bit in 1020 bits. The expectation is that once the data is inside the silicon, there should be few errors so strict standard is reasonable. Again, if an error is detected through CRC, up to 3 retries by the controller can be attempted.

NOTE: The reason the USB-IF allows software to make the decision on the final number of retries or recovery is it is possible to allow for the user proceed even with a bad connection at a slower speed.

On the PHY side, if an error is detected on the PHY

USB defines four general types of transfers.

Control transfers – used to configure the device. For example, “I am a mouse, and I will be sending you clicks and changes in x,y coordinates as a interrupt transfer.” Control transfers require little bandwidth and 100% accuracy. Since the packets are small, USB just retries. If for some reason this data can’t get through when the peripheral is connected, the device will never be recognized and won’t work. It won’t work because the host doesn’t know how to communicate with the peripheral.

Interrupt transfers – used to send short, simple data through like keyboard, mouse, touch pad, touchscreen, or game controller. A few dropped packets is okay.

In general for Control and Interrupt transfers the amount of data is so small that a few retries will not impact overall throughput.

Bulk transfers – used to transfer data with 100% accuracy. For example, if you print a picture, every pixel must be correct. For Bulk Transfers, retries need to continue until either the data is transmitted correctly or the device is timed-out by software and informs the user the USB peripheral isn’t working properly.

Isochronous transfer – used to stream data but packets can be “lost”. Used for streaming video and audio. In this case, packets can be dropped often because the next frame of video or audio must be delivered to keep streaming. In this case no retries are attempted. This means that lots of BER will mean terrible streaming of the video for incomplete or bad pictures and or poor audio.

That’s it.

Here’s an XKCD that has something wireless transmissions over solar system distances.

Isochronous Transfers: Periodic, continuous communication between host and device, typically used for time-relevant information. This transfer type also preserves the concept of time encapsulated in the data. This does not imply, however, that the delivery needs of such data is always time-critical.

Interrupt Transfers: Low-frequency, bounded-latency communication.

Bulk Transfers: Non-periodic, large-packet bursty communication, typically used for data that can use any available bandwidth and can also be delayed until bandwidth is available

Eric started working on USB in 1995, starting with the world’s first BIOS that supported USB Keyboards and Mice while at Award Software. After a departure into embedded systems software for real-time operating systems, he returned to USB IP cores and software at inSilicon, one of the leading suppliers of USB IP. In 2002, inSilicon was acquired by Synopsys and he’s been here since. He also served as Chairman of the USB On-The-Go Working Group for the USB Implementers Forum from 2004-2006.

Eric received an M.B.A. from Santa Clara University and an M.S. in Engineering from University of California Irvine, and a B.S. in Engineering from the University of Minnesota. and is a licensed Professional Engineer in Civil Engineering in the State of California.