Universal Serial Bus (USB) provides a serial bus standard for connecting devices, usually to computers such as PCs and the Apple Macintosh, but is also becoming commonplace on video game consoles and PDAs, and even devices like televisions and home stereo equipment.
The USB specification is at version 2.0 (with revisions) as of March 2006. Hewlett-Packard, Intel, Lucent, Microsoft, NEC, and Philips jointly led the initiative to develop a higher data transfer rate than the 1.1 specification. The USB 2.0 specification was released in April 2000 and was standardized at the end of 2001. Equipment conforming with any version of the standard will also work with devices designed to any of the previous specifications (backwards compatibility).
The radio spectrum-based USB implementation is known as Wireless USB or WUSB
USB connects several devices to a host controller through a chain of hubs. In USB terminology, devices are referred to as functions, because in theory what we know as a device may actually host several functions, such as a router that is a Secure Digital Card reader at the same time. The hubs are special purpose devices that are not officially considered functions. There always exists one hub known as the root hub, which is attached directly to the host controller.
USB endpoints actually reside on the connected device: the channel to the host is referred to as a pipe. These devices/functions (and hubs) have associated pipes (logical channels) which are connections from the host controller to a logical entity on the device named an endpoint.
These endpoints (and their respective pipes) are numbered 0-15 in each direction, so a device/function can have up to 32 active pipes, 16 inward and 16 outward. (The OUT direction shall be interpreted out of the host controller and the IN direction is into the host controller.)
Each endpoint can transfer data in one direction only, either into or out of the device/function, so each pipe is uni-directional. Endpoint 0 is however reserved for the bus management in both directions and thus takes up two of the 32 endpoints - all USB devices are required to implement endpoint 0, so there is always an inward and an outward pipe numbered 0 on any given device.
In these pipes, data is transferred in packets of varying length. Each pipe has a maximum packet length, typically 2n bytes, so a USB packet will often contain something on the order of 8, 16, 32, 64, 128, 256, 512 or 1024 bytes.
The pipes are also divided into four different categories by way of their transfer type:
When a device (function) or hub is attached to the host controller through any hub on the bus, it is given a unique 7 bit address on the bus by the host controller.
Devices that attach to the bus can be full-custom devices requiring a full-custom device driver to be used, or may belong to a device class. These classes define an expected behavior in terms of device and interface descriptors so that the same device driver may be used for any device that claims to be a member of a certain class.