USB Devices and Transfer Characteristics

There are a wide range of USB devices intended for a wide range of purposes, and this means that implementation details can vary widely.

A device can be self powered, bus powered or both. The USB can provide a power supply up to 500mA for its devices. If there are only bus powered devices on the bus the maximum power dissipation could be exceeded and therefore self powered devices exist. They need to have their own power supply. Devices that support both power types can switch to self powered mode when attaching an external power supply.

Even the maximum communication speed can differ for particular USB devices. The USB specification differentiates between low speed and full speed devices. Low speed devices (such as mice, keyboards, joysticks etc.) communicate at 1.5MBit/s and have only limited capabilities. Full speed devices (such as audio and video systems) can use up to 90% of the 12Mbit/s which is about 10Mbit/s including the protocol overhead. High speed devices (introduced in USB 2.0) can theoretically get to around 400Mbps, although a lot of other factors come into play at this speed.

Hubs

Physically there exist one, two or four USB ports at the rear, front or side panel of a computer. These ports can be used to attach normal devices or a hub. A hub is a USB device which extends the number of ports to connect other USB devices. The maximum number of user devices is reduced by the number of hubs on the bus (i.e. if you attach 50 hubs, then at most 77 (=127-50) additional devices can be attached. Hubs are always full speed (for USB 1.1 compliant hubs) or high speed (for USB 2.0 compliant hubs) devices . If the hub is self powered, then any device can be attached to it. However if the hub is bus powered, then only low power (100mA max) devices can be attached to it. A bus powered hub should not be connected to another bus powered hub - you should alternate between bus powered and self powered hubs.

Normally the physical ports of the host controller are handled by a virtual root hub. This hub is simulated by the host controllers device driver and helps to unify the bus topology. So every port can be handled in the same way by the USB subsystem's hub driver.

Data Flow Types

The communication on the USB is done in two directions and uses four different transfer types. Data directed from the host to a device is called downstream or OUT transfer. The other direction is called upstream or IN transfer. Depending on the device type different transfer variants are used:

Human Interface Devices (HID)

The HID class consists primarily of devices that are used by humans to control the operation of computer systems. Typical examples of HID class devices include:

Keyboards and pointing devices for example, standard mouse devices, trackballs, and joysticks.
Front-panel controls for example: knobs, switches, buttons, and sliders.
Controls that might be found on devices such as telephones, VCR remote controls, games or simulation devices for example: data gloves, throttles, steering wheels, and rudder pedals.