Katana VentraIP

USB

Universal Serial Bus (USB) is an industry standard that allows data exchange and delivery of power between many various types of electronics. It specifies its architecture, in particular its physical interface, and communication protocols for data transfer and power delivery to and from hosts, such as personal computers, to and from peripheral devices, e.g. displays, keyboards, and mass storage devices, and to and from intermediate hubs, which multiply the number of a host's ports.[2]

This article is about the computer bus standard. For other uses, see USB (disambiguation).

Type

Bus

January 1996 (1996-01)

Since May 1996[1]

USB was originally designed to standardize the connection of peripherals to computers, replacing various interfaces such as serial ports, parallel ports, game ports, and ADB ports.[3] Prior versions of USB became commonplace on a wide range of devices, such as keyboards, mice, cameras, printers, scanners, flash drives, smartphones, game consoles, and power banks.[4] It has evolved into a standard to replace virtually all common ports on computers, mobile devices, peripherals, power supplies, and manifold other small electronics.


In the current standard the USB-C connector replaces the many various connectors for power (up to 240 W), displays (e.g. DisplayPort, HDMI), and many other uses, as well as all previous USB connectors.


As of 2024, USB consists of four generations of specifications: USB 1.x, USB 2.0, USB 3.x, and USB4. USB4 enhances the data transfer and power delivery functionality with


USB4 particularly supports the tunneling of the Thunderbolt 3 protocols, namely PCI Express (PCIe, load/store interface) and DisplayPort (display interface). USB4 also adds host-to-host interfaces.[2]


Each specification sub-version supports different signaling rates from 1.5 and 12 Mbit/s total in USB 1.0 to 80 Gbit/s (in each direction) in USB4.[5][6][7][2] USB also provides power to peripheral devices; the latest versions of the standard extend the power delivery limits for battery charging and devices requiring up to 240 watts (USB Power Delivery (USB-PD)).[8] Over the years USB(-PD) has been adopted as the standard power supply and charging format for many mobile devices, such as mobile phones, reducing the need for proprietary chargers.[9]

The USB interface is self-configuring, eliminating the need for the user to adjust the device's settings for speed or data format, or configure , input/output addresses, or direct memory access channels.[13]

interrupts

USB connectors are standardized at the host, so any peripheral can use most available receptacles.

USB takes full advantage of the additional processing power that can be economically put into peripheral devices so that they can manage themselves. As such, USB devices often do not have user-adjustable interface settings.

The USB interface is (devices can be exchanged without shutting the host computer down).

hot-swappable

Small devices can be powered directly from the USB interface, eliminating the need for additional power supply cables.

Because use of the USB logo is only permitted after , the user can have confidence that a USB device will work as expected without extensive interaction with settings and configuration.

compliance testing

The USB interface defines protocols for recovery from common errors, improving reliability over previous interfaces.

[12]

Installing a device that relies on the USB standard requires minimal operator action. When a user plugs a device into a port on a running computer, it either entirely automatically configures using existing , or the system prompts the user to locate a driver, which it then installs and configures automatically.

device drivers

Mini-A and Mini-B Connector

Micro-USB Cables and Connectors Specification 1.01

Supplement

InterChip USB

On-The-Go Supplement 1.3 makes it possible for two USB devices to communicate with each other without requiring a separate USB host

USB On-The-Go

Specification 1.1 Added support for dedicated chargers, host chargers behavior for devices with dead batteries

Battery Charging

Battery Charging Specification 1.2: with increased current of 1.5 A on charging ports for unconfigured devices, allowing High Speed communication while having a current up to 1.5 A

[28]

Link Power Management Addendum ECN, which adds a sleep power state

A message pipe is bi-directional and is used for control transfers. Message pipes are typically used for short, simple commands to the device, and for status responses from the device, used, for example, by the bus control pipe number 0.

A stream pipe is a uni-directional pipe connected to a uni-directional endpoint that transfers data using an ,[54] interrupt, or bulk transfer:

Isochronous transfers
At some guaranteed data rate (for fixed-bandwidth streaming data) but with possible data loss (e.g., realtime audio or video)
Interrupt transfers
Devices that need guaranteed quick responses (bounded latency) such as pointing devices, mice, and keyboards
Bulk transfers
Large sporadic transfers using all remaining available bandwidth, but with no guarantees on bandwidth or latency (e.g., file transfers)

isochronous

A USB system consists of a host with one or more downstream facing ports (DFP),[52] and multiple peripherals, forming a tiered-star topology. Additional USB hubs may be included, allowing up to five tiers. A USB host may have multiple controllers, each with one or more ports. Up to 127 devices may be connected to a single host controller.[53][30]: 8–29  USB devices are linked in series through hubs. The hub built into the host controller is called the root hub.


A USB device may consist of several logical sub-devices that are referred to as device functions. A composite device may provide several functions, for example, a webcam (video device function) with a built-in microphone (audio device function). An alternative to this is a compound device, in which the host assigns each logical device a distinct address and all logical devices connect to a built-in hub that connects to the physical USB cable.


USB device communication is based on pipes (logical channels). A pipe is a connection from the host controller to a logical entity within a device, called an endpoint. Because pipes correspond to endpoints, the terms are sometimes used interchangeably. Each USB device can have up to 32 endpoints (16 in and 16 out), though it is rare to have so many. Endpoints are defined and numbered by the device during initialization (the period after physical connection called "enumeration") and so are relatively permanent, whereas pipes may be opened and closed.


There are two types of pipe: stream and message.


When a host starts a data transfer, it sends a TOKEN packet containing an endpoint specified with a tuple of (device_address, endpoint_number). If the transfer is from the host to the endpoint, the host sends an OUT packet (a specialization of a TOKEN packet) with the desired device address and endpoint number. If the data transfer is from the device to the host, the host sends an IN packet instead. If the destination endpoint is a uni-directional endpoint whose manufacturer's designated direction does not match the TOKEN packet (e.g. the manufacturer's designated direction is IN while the TOKEN packet is an OUT packet), the TOKEN packet is ignored. Otherwise, it is accepted and the data transaction can start. A bi-directional endpoint, on the other hand, accepts both IN and OUT packets.


Endpoints are grouped into interfaces and each interface is associated with a single device function. An exception to this is endpoint zero, which is used for device configuration and is not associated with any interface. A single device function composed of independently controlled interfaces is called a composite device. A composite device only has a single device address because the host only assigns a device address to a function.


When a USB device is first connected to a USB host, the USB device enumeration process is started. The enumeration starts by sending a reset signal to the USB device. The signaling rate of the USB device is determined during the reset signaling. After reset, the USB device's information is read by the host and the device is assigned a unique 7-bit address. If the device is supported by the host, the device drivers needed for communicating with the device are loaded and the device is set to a configured state. If the USB host is restarted, the enumeration process is repeated for all connected devices.


The host controller directs traffic flow to devices, so no USB device can transfer any data on the bus without an explicit request from the host controller. In USB 2.0, the host controller polls the bus for traffic, usually in a round-robin fashion. The throughput of each USB port is determined by the slower speed of either the USB port or the USB device connected to the port.


High-speed USB 2.0 hubs contain devices called transaction translators that convert between high-speed USB 2.0 buses and full and low speed buses. There may be one translator per hub or per port.


Because there are two separate controllers in each USB 3.0 host, USB 3.0 devices transmit and receive at USB 3.0 signaling rates regardless of USB 2.0 or earlier devices connected to that host. Operating signaling rates for earlier devices are set in the legacy manner.

Asynchronous – The ADC or DAC are not synced to the host computer's clock at all, operating off a free-running clock local to the device.

Synchronous – The device's clock is synced to the USB start-of-frame (SOF) or Bus Interval signals. For instance, this can require syncing an 11.2896 MHz clock to a 1 kHz SOF signal, a large frequency multiplication.[79]

[78]

Adaptive – The device's clock is synced to the amount of data sent per frame by the host

[80]

Low-speed (LS) and Full-speed (FS) modes use a single data wire pair, labeled D+ and D−, in . Transmitted signal levels are 0.0–0.3 V for logical low, and 2.8–3.6 V for logical high level. The signal lines are not terminated.

half-duplex

High-speed (HS) uses the same wire pair, but with different electrical conventions. Lower signal voltages of −10 to 10 mV for low and 360 to 440 mV for logical high level, and termination of 45 Ω to ground or 90 Ω differential to match the data cable impedance.

SuperSpeed (SS) adds two additional pairs of shielded twisted data wires (and new, mostly compatible expanded connectors) besides another grounding wire. These are dedicated to full-duplex SuperSpeed operation. The SuperSpeed link operates independently from USB 2.0 channel and takes a precedence on connection. Link configuration is performed using LFPS (Low Frequency Periodic Signaling, approximately at 20 MHz frequency), and electrical features include voltage de-emphasis at transmitter side, and adaptive linear equalization on receiver side to combat electrical losses in transmission lines, and thus the link introduces the concept of link training.

SuperSpeed+ (SS+) uses a new coding scheme with an increased signaling rate (Gen 2×1 mode) and/or the additional lane of USB-C (Gen 1×2 and Gen 2×2 modes).

USB signals are transmitted using differential signaling on twisted-pair data wires with 90 Ω ± 15% characteristic impedance.[93] USB 2.0 and earlier specifications define a single pair in half-duplex (HDx). USB 3.0 and later specifications define one dedicated pair for USB 2.0 compatibility and two or four pairs for data transfer: two pairs in full-duplex (FDx) for single lane variants require SuperSpeed connectors; four pairs in full-duplex for two lane (×2) variants require USB-C connectors. USB4 Gen 4 requires the use of all four pairs but allow for asymmetrical pairs configuration,[94] in this case one lane is used for the upstream data and the other three for the downstream data or vice-versa. USB4 Gen 4 use pulse amplitude modulation on 3 levels, providing a trit of information every baud transmitted, the transmission frequency of 12.8 GHz translate to a transmission rate of 25.6 GBd[95] and the 11-bit–to–7-trit translation provides a theoretical maximum transmission speed just over 40.2 Gbit/s.[96]


A USB connection is always between an A end, either a host or a downstream port of a hub, and a B end, either a peripheral device or the upstream port of a hub. Historically this was made clear by the fact that hosts had only Type-A ports and peripheral devices had only Type-B, and every (valid) cable had one Type-A plug and one Type-B plug. USB-C (Type-C) is a single connector that replaces all Type-A and Type-B connectors (legacy connectors), so when both sides are modern equipment with USB-C ports they negotiate which is the host (A) and which is the device (B).

OUT transaction

IN transaction

SETUP transaction

Control transfer exchange

The basic transactions of USB are:

Comparisons with other connection methods[edit]

FireWire (IEEE 1394)[edit]

At first, USB was considered a complement to FireWire (IEEE 1394) technology, which was designed as a high-bandwidth serial bus that efficiently interconnects peripherals such as disk drives, audio interfaces, and video equipment. In the initial design, USB operated at a far lower data rate and used less sophisticated hardware. It was suitable for small peripherals such as keyboards and pointing devices.


The most significant technical differences between FireWire and USB include:

Security threats[edit]

Due to the prevalency of the USB standard, there are many exploits using the USB standard. One of the biggest instances of this today is known as the USB Killer, a device which damages devices by sending high voltage pulses across the data lines.


In versions of Microsoft Windows before Windows XP, Windows would automatically run a script (if present) on certain devices via autorun, one of which are USB mass storage devices, which may contain malicious software.[122]

Axelson, Jan (1 September 2006). (1st ed.). Lakeview Research. ISBN 978-1-931-44804-8.

USB Mass Storage: Designing and Programming Devices and Embedded Hosts

——— (1 December 2007). (2nd ed.). Lakeview Research. ISBN 978-1-931-44806-2.

Serial Port Complete: COM Ports, USB Virtual COM Ports, and Ports for Embedded Systems

——— (2015). (5th ed.). Lakeview Research. ISBN 978-1-931448-28-4.

USB Complete: The Developer's Guide

Hyde, John (February 2001). (2nd ed.). Intel Press. ISBN 978-0-970-28465-5.

USB Design by Example: A Practical Guide to Building I/O Devices

(PDF). Keysight Technologies. Technologies Application Note (1382–3). Keysight.

"Debugging USB 2.0 for Compliance: It's Not Just a Digital World"

Joel Johnson (29 May 2019). . Fast Company.

"The unlikely origins of USB, the port that changed everything"

Leigh, Peter (24 May 2020). (video).

Why Does USB Keep Changing?

Parikh, Bijal. . Engineers Garage. WTWH Media. Retrieved 7 May 2022.

"USB (Universal Serial Bus): An Overview"

Barnatt, Christopher (25 September 2022). (video).

Explaining USB: From 1.0 to USB4 V2.0 (ExplainingComputers)