Skip to main content

Standards and specs: The ins and outs of USB

See how USB developed and discuss the pros and cons of the standard

Peter Seebach is a standards enthusiast who has been using USB devices for years. He has actually needed to use the USB keyboard spec in his own code.

Summary:  The USB specification may be an example of that hybrid de jure or de facto standard, one that clearly earned wide acceptance through its technical merit. Learn the history of the USB standard and some of its benefits to users and vendors, as well as where it missed the boat.

Date:  26 Apr 2005
Level:  Introductory
Activity:  9278 views

The USB standard is practically ubiquitous -- everything from laptops to desktops to servers (to even embedded multimedia devices) has USB ports. Some USB peripherals can even take other USB peripherals: a USB printer may be able to connect to a USB camera. The initial standard saw widespread adoption, and a newer, higher-speed specification (2.0) is now fairly broadly used, although some devices or systems haven't yet been upgraded.

USB is an interesting technology in that it specifies mechanical connectors, electrical properties, and a higher-level protocol. Many standards specify only one or two of these options. USB is a complete standard. In fact, standardization in controller chips means that an operating system with USB drivers can have any standard USB expansion card on board and any standard USB device attached to the card -- and expect the device to work!

From merely existing as a half-supported set of patches on Windows® 95 to blossoming into a stable component of most major operating systems, software support for USB has grown dramatically over the last eight years or so.

USB at a glance

USB 1.0 came about in November 1995. Introduced in September 1998, the USB 1.1 standard (the first widely used one) was intended to become a de facto standard; it was developed by major players that included DEC, IBM®, Intel®, Microsoft®, and Compaq. USB peripherals can include everything from modems to joysticks. Windows 95 Rev. B, Windows 98, Windows 2000, Windows Me, and Mac OS 8 and higher support USB; version 2.0 is supported in Linux™ kernel 2.52 and up and in XP.

USB uses a tiered star topology, meaning that USB devices called hubs can serve as connection ports for other USB devices. Only one device needs to be actually plugged into the host PC. USB supports stand-alone or embedded hubs, and a single USB port can support up to 127 devices.

USB 1.1 had two data rates: 12 Mbps for high-speed throughput devices (disk drives) and 1.5 Mbps for lower bandwidth devices (joysticks). USB 2.0 (Hi-Speed USB 2.0), introduced in 2002, increased the peripheral-to-PC speed to 480 Mbps. Besides offering extremely high-speed throughput to external devices, it also enhances the performance of Web applications that may need multiple high-speed devices to run simultaneously. A recent spec, USG OTG 1.0a (USB On-The-Go), has been developed targeted at portable devices -- it offers them a small connector to fit the mobile form factor, low-power features, and most importantly, the limited ability to communicate with other USB peripherals without a PC host.

A USB peripheral simply plugs into a port and works without installing a card or powering the computer down (USB devices are hot-swappable). Although a separate power supply is usually not necessary for a USB device, it must be attached upstream to either the host PC or a powered hub. In USB, configuration occurs automatically. Host controllers manage driver software, bandwidth, and appropriate electrical power. USB controllers also have improved the performance of game control devices (joysticks, and so on) by eliminating the loss of calibration ("drift") due to cable length and CPU overhead -- USB effectively reduces CPU overhead.

There are four types of USB connectors: Type A, Type B, Mini B, and Mini A.

Interface Darwinism

The history leading to the USB specification follows a, if not easily predictable then at least, plausible evolutionary path.

The pre-USB landscape

Before USB, plugs were, well, plugs. A typical PC-compatible computer would have one or two RS-232 serial ports (DB9) capable of about 115,200 Kbps. It would have a single parallel port capable of fairly high speeds (roughly 300 Kbps or maybe 1.3 or 2.7 Mbps depending on which of the two extensions to the specification you were using). It might have PS/2 keyboard and mouse ports or possibly an AT keyboard port and no mouse port, or a special plug-in card for the mouse. If you had a good sound card, it might provide a 13-pin joystick port, which might or might not support a Y-cable to support a second joystick, and which probably supported a special cable to give you MIDI in and out cables. Expansion cards might give you more serial or parallel ports or possibly SCSI.

This was not good. You might have a scanner with SCSI and parallel interfaces, a mouse that supported PS/2 and serial, a printer with serial and parallel, a modem with only serial, a MIDI keyboard, a joystick -- by this point, adding a single device could also demand that you reload drivers for three other devices since you were going to have to shuffle them around. Many devices came in two or three models that supported different ports.

The parallel port, being the only cheap high-speed port in "port" (so to speak), was horrendously abused. Any device connecting to a serial or parallel port would require a custom driver and, by the way, did I mention that there was no reliable way to figure out which custom driver that was if you lost the CD?

Serial devices required you to configure the device and the computer for the same baud rate, handshake, parity, data bits, and stop bits. (Handshaking might be either hardware or software; hardware handshaking had at least two incompatible protocols.)

This situation was awful for everyone. Peripheral vendors had to navigate a twisty maze of alternative versions, and adding new peripherals was difficult at best.... This was the epitome of the "good ole days" where the whole scheme was bad.

Then, one day the sun rose just a bit brighter for users of peripherals (which meant, everyone with a computer). The first USB specification, USB 1.0, showed up in November 1995 (the same year Apple adopted the IEEE 1394 Firewire standard). A few Windows systems at the time had USB ports. The only USB devices I saw that early were an Intel-branded Webcam and some very specialized front panel devices for use with the "Infinia" line of Toshiba computers. (I still have one of these devices, but alas, no drivers for it.)

Back then, USB drivers were fairly specialized patches each of which only ran atop a specific version of Windows; different versions of Windows had different USB drivers. The USB specification and hardware were almost entirely irrelevant to most users. The USB 1.1 specification, which improved things quite a bit, came out in September 1998. The 1998 specification was the one adopted in Windows 98.

The adoption problem

USB, even after support for it was available in Windows, faced an adoption problem. Standard adoption is largely driven by network effects; the utility of a standard-compatible device comes from its ability to interoperate with other things compatible with the same standard. A standard is only useful to you if there are compatible devices and if there are a lot of them.

This creates a Catch-22 situation for adoption. If users lack USB ports or drivers, those users cannot buy a USB device. For vendors, that limits the market for USB devices and makes it more reasonable to develop peripherals for other ports (such as the once-ubiquitous serial and parallel ports, or the SCSI port if you also wanted to tap the Mac market).

Even if users would prefer a USB device, they would still be more willing to accept a non-USB device since it can be connected to their computer. Even if USB is a better, more desirable piece of technology, it may not be more marketable than the alternatives! The number of people who would buy a USB Webcam might be smaller than the number who would buy a serial Webcam -- and almost all of them could be persuaded to buy a serial one instead.

Enter the iMac.

The original "bondi blue" iMac was the first computer to offer USB ports without offering "legacy" ports. That's right -- no serial ports, no ADB. This changes the network effects. Before the iMac showed up, there were many millions of PC users who had no USB ports and perhaps a couple of million who had a USB port and also legacy ports. The biggest market in 1998 was in serial and parallel ports (or joystick ports, PS/2 ports, and so on) -- there was no reason to target the USB market. That would just restrict your audience.

The iMac presented a ready-made market of users who chose the Mac line for its graphics capability. In turn, the iMac offered a captive audience of users who would buy a USB peripheral but would not buy any other kind of peripheral. These users provided a market for USB peripherals that wasn't facing competition from other port choices. The result was a flood of USB devices in white-and-blue plastic. This was a crucial turning point that created a reason (tied to a proven system choice) to prefer USB to non-USB ports.

Once adoption was foist onto this substantial segment of users, the technical merits of the technology won out easily. USB's technical superiority (for most peripherals) to the conglomeration of a half-dozen different port types was unambiguous.

Survival of the fittest

After adoption was a proven benefit, USB simply annihilated a lot of its competition. Joystick ports died. Serial and parallel ports suffered a loss of popularity, although the plain old 16550 UART and other RS-232 serial devices still enjoy substantial popularity as console ports for embedded systems and servers (see Resources). The PS/2 keyboard and mouse ports have survived unchanged for most PCs, although a few systems don't offer full support for them. My laptop has no PS/2 ports; its "port replicator" does.

Firewire and Bluetooth are the serious, live competition to USB. Bluetooth keyboards and mice are currently much more expensive than wireless devices using other specs. If their price drops, they may offer a real alternative. Firewire has been very successful in media and mass storage where the higher performance (compared to USB 1.1) earned it early dominance. Its weakness is the lack of detailed protocol specification. No one would bother trying to make a Firewire keyboard.

Strengths and weaknesses

Now to look at some of the benefits and areas that are lacking in the USB specification.

Strength: Specification flexibility and thoroughness

One of the interesting traits of USB is that it offers standardization of the mechanical form of ports, their electrical qualities, and the protocol used for them. This bears repeating because many specifications don't go nearly this far. The RS-232 standard specifies signaling, but not necessarily every common physical port design. The parallel port standard defines signaling and physical structures, but still doesn't say much about what data will pass over the port.

Specifications normally run the range from complete-but-specialized to incomplete-but-generic. USB offers some fairly complete, specified instruction, such as the mass storage spec or the human interface device spec, but also leaves room for developer expansion and development. If you have a USB mass storage driver, any standard-compliant USB device (whether it's a card reader, a disk, or a CD burner) will work with it. When you have the human interface device driver, most keyboards, mice, and joysticks will work without further intervention.

On the other hand, if your device is totally unlike any other, the spec provides for sending packets back and forth, offering a flexible protocol layer.

In some cases, a device will use only part of the USB spec. Nintendo Gameboy SP is rechargeable -- and a third party sells a USB charging cable for it. This uses the physical spec and power, but doesn't even show up as a device. The protocol is ignored entirely. This is common enough that some car and airplane AC adapters now offer a "dumb" USB port which just provides power for rechargeable devices.

On the other side of the same coin, not all USB devices have recognizable cables. My laptop has a built-in Bluetooth controller which is actually attached over USB. It uses the USB protocol and probably standard USB electrical signaling, but not the USB physical port specification. (Another connector on the same laptop is probably USB, but the only device I know of for it, a Webcam, never interested me.)

Weakness: Physical connectors

The physical connectors are one of the greatest weaknesses in the USB specification. Originally, the USB spec provided a simple pairing: A ports on computers, B ports on peripherals, with each cable having one end of each type. This is not too bad of a scheme. However, the A port design itself is not friendly from a usability perspective. It's too easy to plug things in upside down. Labeling of which side is "up" is not entirely consistent, so since ports are often on the back of a machine and out of view, really the design ought to be distinguishable by feel.

Around the time of USB 2.0, a couple of new connectors started showing up, one of which is much smaller than the original ones. That's nice, but it introduces a potential incompatibility: now not all cables work with all devices. (Some don't seem to be actually related to the standard. My digital camera uses a port which I've never seen on anything else -- it is the same as an older camera from the same vendor. This requires a non-standard cable. For shame!)

One thing that appears to be underspecified is the clearance to be found around a port. Many devices have no cable, but are too wide or thick to allow another device to be plugged into an adjacent port. Manufacturers clearly know about this -- many such devices come with a six-inch extension cable to allow the device to be plugged in. It's still annoying.

As for a more subtle "defect," I have some USB 2.0 devices whose plug is inset so that not all cables will fit in.

Connectors are probably the weakest point of the USB spec since they are harder to use than they should be. Some people complain about USB cables coming unplugged under slight tension. A cable with a clear orientation that a user could check by feel would have been a wonderful, user-centered-design idea. It's one of the small details that Firewire got right.

Strength: Revisiting the cable

A quick review of the cabling reminds me to point out the following: The self-contained cable handling both signals and power was a genius of an idea since it provided for a large number of USB devices which can run entirely off the system-supplied power.

Strength: Documentation

Documentation is one of the best aspects of USB. Detailed documentation on the specification is easily and freely available. This played a substantial role in encouraging hardware developers to use the standard protocols defined by the USB standard instead of trying to "innovate" in ways that leave software developers scrambling to support undocumented hardware.

This had the additional effect of providing consistently good open source support for USB devices. Particular credit goes to Lennart Augustsson's work on the NetBSD USB implementation which is quite frankly awe-inspiring (see Resources). The NetBSD implementation was unusually complete and stable back when USB devices were still fairly experimental to many users. The net result is a huge base of code under flexible and open licensing terms (providing a way to sanity-check implementation questions) and also a lot of practical information about device quirks.

The fact that the USB protocol includes specific documentation for devices such as mass storage devices, keyboards and mice, and even a standard printer device protocol (designed to support parallel/USB adapters) made it possible for software developers to produce drivers that would support a broad range of devices and for hardware developers to produce devices that would work with a broad range of software.

It is hard to overstate the importance of clear, comprehensive documentation. Aftermarket attempts to do the same thing for SCSI interfaces and for scanners never achieved the kind of broad support and reliable interoperability that USB's formal specification attained.

Alternatives and extensions

The USB 2.0 specification introduced higher-speed options at 480 Mbps (a number which looks carefully calculated to exceed the performance of that of the IEEE 1394 Firewire at 400 Mbps). The labeling of the speed of devices has become very confusing, with recommendations that 12 Mbps devices be labeled "USB 2.0" and 480 Mbps devices be labeled "Hi-Speed" without a reference to the 2.0 spec! (According to the literature, 12 Mbps devices should fall under both the 1.1 and 2.0 versions.) It's a good thing to improve performance, but the confusing terminology hurts users.

A more curious thing is the proposal for wireless USB. This may sound crazy, but a lot of the USB specification's value is in the clearly written and well-documented protocol that allows driver writers to easily support a variety of devices. This is a good idea for an extension, silly though it might seem at first.

Learning the lessons

Advertising for the early USB didn't match up with true user experiences very well. Enthusiastic proclamations that USB would support 127 devices quickly faded as users learned that a seven-port hub was probably the practical limit. Beyond that, bandwidth concerns and protocol overhead made life too difficult.

The 12 Mbps bandwidth, while high compared with other existing protocols, was not fast enough to be shared among too many devices. Before USB 2.0 came along, some vendors provided PCI cards with four separate USB 1.1 controllers, each with a single port, to allow users to get 48 Mbps of total bandwidth, thereby repairing the utopian ideal by using a mundane practice. Even on newer systems, multiple USB controllers seem to provide improved performance and reduced latency. This matters more to users than the theoretical option of connecting more than a hundred peripherals on a single bus.

Once again, the cable design was poor. If nothing else, users would benefit from a cable design which makes touch-and-feel connections easier.

The self-contained cable handling both signals and power was simply brilliant. For the large number of USB devices which can run entirely off the supplied power, USB's handling of this is masterful. It would be nice if vendors were better about disclosing power requirements though. In practice, 90% of devices "just work" without additional hassle. The side effect of a market in USB charging devices is probably unintentional, but absolutely fascinating.

The USB 2.0 spec helped address overall bandwidth problems, but exacerbated confusion about performance by adopting an essentially contradictory description for device speeds. It also introduced a new connector type (the Mini-B for PDAs and cell phones and the like), a reasonable connector that probably will cause no usability ripple at all in the user's experience.

The USB spec has to be considered a rousing success, included in such areas as:

  • Self-powered devices
  • Convenient expansion
  • Reliable hot-plugging
  • Excellent documentation
  • Free implementations
  • Comprehensive device specifications
  • Low-cost parts

The experiences of everyone involved with the technology, from hardware vendors to software developers to garden variety users, has been immeasurably improved. Eight years ago, it seemed normal to explain to new computer users why you needed to have six different port types. Now, it seems ludicrous to even consider saying something like that.

The USB standard is a shining example of a standard earning wide acceptance through clear technical merit.


About the author

Peter Seebach

Peter Seebach is a standards enthusiast who has been using USB devices for years. He has actually needed to use the USB keyboard spec in his own code.


Trademarks  |  My developerWorks terms and conditions

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

Zone=Multicore acceleration
ArticleTitle=Standards and specs: The ins and outs of USB

My developerWorks community


Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Special offers