Skip to content
Know.itKnow.it
Create an animated lesson
On request

This article is free to read. Creating a lesson uses your daily or stored credits; review the language and settings before starting.

How does USB work?

TechnologyLesson on requestFree to readयह पेज हिंदी में पढ़ें

Quick answer

USB works through a host controller that polls connected devices over four wires: two for power and two for differential data. Each device gets a unique address, and data moves in packets between host and device endpoints, using transfer types suited to different needs like control, interrupt, bulk or isochronous.

USB works by using a host controller to manage a tiered network of devices over a cable whose classic USB 2.0 core has four wires, two for power and two for differential data; newer versions add high-speed pairs. The host polls each device, and data packets travel between host and device endpoints using assigned addresses and pipe configurations.

Step by step

  1. The host supplies 5 volts on VBUS and Ground, powering the device and signalling a connection.
  2. The host detects a voltage change on D+ or D- and resets the device to a known state.
  3. The host reads the device descriptor, assigns a unique address, and selects a configuration.
  4. The host and device exchange data packets through endpoints using one of four transfer types.
  5. The host polls each device regularly, managing bandwidth and power for all connected devices.

Key things to understand

  1. A USB 2.0 cable contains four wires: VBUS and Ground supply 5 volts, while D+ and D- carry data as a differential pair.
  2. The host controller, usually inside a computer, acts as the master and polls each connected device in turn.
  3. Each device is assigned a unique address by the host during enumeration, allowing many devices to share the bus.
  4. Data moves in packets between host and device endpoints, which are logical channels identified by address and endpoint number.
  5. USB supports four transfer types: control, interrupt, bulk and isochronous, each suited to different data needs.

Labelled diagram

  1. Host

    Computer or hub controller that manages all bus traffic and power delivery.

  2. Cable

    Four wires: VBUS, Ground, D+ and D- for power and differential data.

  3. Device

    Peripheral with endpoints that receive and send data packets.

  4. Enumeration

    Host assigns address and reads descriptors to identify the device.

  5. Data transfer

    Packets move between host and device endpoints using a chosen transfer type.

USB host-to-device connection and data flow

Real-world examples

  • A USB flash drive plugged into a laptop is enumerated, assigned an address, and appears as a storage drive.
  • A smartphone connected by USB to a charger draws power over VBUS while negotiating the correct current.
  • A USB keyboard sends interrupt transfer packets whenever a key is pressed, which the host reads as typed characters.
  • An external hard drive uses bulk transfers to move large files reliably, with error checking and retries.

Common mistake

✗ Myth: USB devices can send data whenever they want, like a peer-to-peer network.

✓ Fact: USB is a host-controlled bus. The host polls each device in turn, so devices only transmit when asked, preventing collisions and managing bandwidth.

People also ask

What is the difference between USB 2.0 and USB 3.0?
USB 2.0 runs at up to 480 Mbps with one data lane, while USB 3.0 adds extra lanes for up to 5 Gbps and uses separate wires for SuperSpeed data. USB 3.0 also improves power management and is backward compatible with USB 2.0 devices.
How does a USB hub work?
A USB hub acts as a splitter, connecting multiple devices to one host port. It manages power and data routing, and the host treats each downstream device as if directly connected, assigning addresses and polling them in turn.
Why does USB have a maximum cable length?
USB signals weaken over distance due to resistance and capacitance in the cable. The standard limits cable length to about 5 metres for full-speed and 3 metres for low-speed to ensure reliable data transfer without errors.
What happens when you plug in a USB device?
The host detects a voltage change on the data lines and resets the device. It then reads the device descriptor, assigns an address, and loads the correct driver so the device becomes usable.
Why do USB cables have different connectors?
Different connectors suit different roles: Type-A and Type-B for hosts and peripherals, Mini and Micro for smaller devices, and Type-C for reversible, higher-power, higher-speed links. The shape prevents wrong connections and supports evolving standards.
How does USB transfer data so quickly?
Speed comes from high-frequency differential signalling on the data pair, combined with multiple data lanes in newer versions. Each generation raises the signalling rate or adds lanes, raising bandwidth from 1.5 Mbps to tens of Gbps.
Can USB carry both power and data at the same time?
Yes, the VBUS and Ground wires deliver power while the D+ and D- wires carry data simultaneously. This lets a single cable charge a device and exchange files or commands without a separate power supply.

Part of the guide: How the Internet Works →