USB2.0 USB3.0 actual transmission speed

USB2.0 USB3.0 actual transmission speed

The transmission speed in the USB2.0 specification is 480 Mbps (i.e. 60 MB/s). However, the data transmission speed of many USB2.0 devices in actual operation is far from this. For example, copying something with a PC USB flash disk is often much slower than 60MB/s. Why?

In fact, we can also see some reasons. The USB bus only transmits data through a pair of differential lines. It only needs to support various devices at the same time (a USB HOST device can be used at the same time by attaching multiple slave devices under the USB HUB). To support two-way transmission, there must be a complex protocol. There must be a lot of overhead on the protocol. In addition, for a single device, only part of the transmission bandwidth can be obtained.

In general, there are the following factors:

USB protocol overhead, USB bandwidth allocation, hardware structure, USB device driver

USB protocol overhead

In the process of USB data communication, not all valid information is transmitted on the bus, but also various protocol information such as synchronization signal, type identification, check code, handshake signal, etc. Therefore, it is impossible for the actual data transmission rate to reach the bus transmission limit speed of 480 Mbps. And for different transmission types, there are different protocol overhead.

USB has four transmission modes: control transmission, batch transmission, interrupt transmission and synchronous transmission.

According to USB protocol, USB2.0 tells the mode that there are 8 micro frames in one second. The maximum speed transmission of the mode in 4 is calculated as follows:

Transmission type

Packet length/Byte

Maximum transmission times per microframe

Maximum speed/(MB/s)

Control transmission

64

31

15.137

Interrupt transmission

1024

3

23.436

Batch transfer

512

13

50.781

Synchronous transmission

1024

3

24.436

 Control transmission: The control transmission is bidirectional transmission, and the amount of data is usually small. It is mainly used to query, configure and send general commands to USB devices.

Interrupt transmission: Interrupt transmission mode is mainly used to periodically query whether the equipment has interrupt data to transmit. This transmission mode is applied to small, scattered, and unpredictable data transmission occasions. Keyboard, mouse, etc.

Batch transmission: When accessing the USB bus, it has the lowest priority compared with other transmission types. USB HOST always gives priority to other types of transmission. When the bus bandwidth is surplus, batch transmission, printers, scanners, storage devices, etc. will be arranged.

Synchronous transmission: Synchronous transmission is applicable to data transmission at a fixed rate and can tolerate occasional errors. Real time transmission is generally used for devices such as UVC cameras. Data will not be retransmitted in case of error.

USB bandwidth allocation

USB protocol stipulates that the control transmission shall ensure that 10% bandwidth can be used at low/full speed and 20% bandwidth can be used at high speed. Batch transmission does not reserve any bandwidth. That is, the remaining bandwidth can be used only when the control transmission and other transmissions do not need to use their bandwidth. Therefore, although batch transmission can transmit a large amount of data as soon as possible in a period of time when the bus is idle, batch transmission may work slowly when the bus is busy.

Usually, the host computer uses a variety of USB devices, such as mouse, keyboard, camera, printer and scanner, which use different transmission methods. If only one device monopolizes the entire bandwidth of the system in batch transmission mode at the beginning, the speed will be very fast (close to 53 MB/s). However, if some newly inserted devices need to use 20% of the reserved bandwidth for controlling transmission, the available bandwidth for batch transmission of previous devices will drop to 80% of the original, and the transmission speed may be less than 42 MB/s. As a more extreme case, before the batch transmission equipment is inserted, the existing equipment completely occupies 20% of the reserved bandwidth in the controlled transmission mode. Other devices also occupy the rest in the form of interruption or synchronous transmission

hardware structure

In fact, the hardware structure of commonly used USB interfaces is shown in the figure below. A USB HUB has multiple devices attached to it. Even when we use a PC, we directly use the USB interface of the computer. That is also because the manufacturer has put USB HUB into the PC, so that there are so many USB interfaces.

The sum of all data of USB HUB's peripherals (Device side) is the same as that of the HOST side, and the HOST side cannot exceed 480Mb/s, so the 480Mb/s speed is shared, not exclusive.

USB device driver

USB device driver can be divided into device driver, USB bus driver and USB controller driver. The application contacts the USB device driver by using API functions. The USB device driver completes the data reading and writing of the device by calling the driver. USB bus driver and USB 2.0 controller driver are provided by the operating system. The device driver completes the communication with the bus driver by constructing the URB (USB Request Block) and passing it to the bus driver.

In general, device drivers need to generate interrupts frequently. The priority of the device driver system is not high. When the computer is under heavy load or other interrupts with higher priority occur, its interrupts cannot be processed and need to wait. If the device driver passes the URB to the USB bus, set a large buffer The frequency of interrupts is reduced and the waiting time is reduced. So as to improve the speed of data transmission. In addition, adjusting the driver's measures such as command queuing policy and changing the size of request packets can also have an impact on the USB data transmission speed.

To sum up, the commonly said 480 Mbps is the upper limit of the USB2.0 bus speed Considering the cost of communication protocol, the transmission speed of actual data is only 53 MB/s (426 Mbps) in theory Under actual comprehensive conditions, 15 MB/s to 25 MB/s can be used as reasonable high-speed targets.

USB3.0 actual transmission speed

The maximum transmission bandwidth of USB3.0 is up to 5.0Gbps (500MB/s).

The bandwidth of 5Gbps is not 625MB/s obtained by dividing 5Gbps by 8, but uses the same 10 Bit transmission mode as SATA (a pair of error correction codes are added on the basis of USB2.0), so its full speed is only 500MB/s.

This is the theoretical transmission value. If several devices share a USB channel, the main control chip will allocate and control the bandwidth available to each device. For example, in USB1.1, all devices can only share 1.5MB/s bandwidth. If a single device occupies all the bandwidth of the USB interface, it will bring difficulties to the use of other devices.

Regardless of the theoretical speed of USB3.0, the actual transmission speeds of USB3.0 interface products are respectively 60MB/s to 140MB/s and 50MB/s to 90MB/s. Many so-called USB 3.0 USB flash drives and hard disks in the market have fast read speeds, but low write speeds.

In addition, if the mobile hard disk is a USB2.0 interface and is connected to the PC USB3.0 interface to transmit data, the theoretical maximum transmission rate is 60MB/S of USB2.0.

Backward compatibility

USB 3.0 and USB 2.0 (or earlier) A-plugs and sockets are designed for interoperability.

USB 3.0 B-type sockets (such as those found on peripherals) are larger than USB 2.0 (or earlier versions), and can accommodate larger USB 3.0 B-type plugs and smaller USB 2.0 (or earlier versions) B-type socket plugs.

USB 3.0 B-type plug is larger than USB 2.0 (or earlier version) B-type plug; Therefore, the USB 3.0 B-type plug cannot be inserted into the USB 2.0 (or earlier) B-type socket.

Micro USB 3.0 (Micro-B) plugs and sockets are mainly used for small portable devices, such as smartphones, digital cameras and GPS devices. Micro USB 3.0 sockets are backward compatible with Micro USB 2.0 plugs.

ESATAp socket is an eSATA/USB combination designed to accept USB Type-A plug of USB 2.0 (or earlier), so it can also accept USB 3.0 Type-A plug.

 

Back to blog

Leave a comment

Please note, comments need to be approved before they are published.