What exactly are the differences between a USB host and device

usbusb deviceusb-host

Came across some doubts:

  1. What exactly are the differences between a USB host and device? Is it just that who powers the bus?
  2. When two devices connect how the device say "hey I will be the host and you be the device?"
  3. Can one device acts as a host as well as a device. For example, "A" should act as a device when a USB host is connected, and "A" should act as host when a USB device is connected?

Best Answer

What exactly are the differences between a USB host and device?

The host initiates all communication on the bus, the device only responds when asked by the host. For Details see the specs on usb.org.

When two devices connect [...]

One must behave as the host and the other as the device. Details can be found in the USB OTG Specs.

Can one device acts as a host as well as a device?

For example, many Android phones and tablets can (requires Android 3+). The "magic" is in the On-the-Go cable/adapter, which switches the phone into host mode by pulling the ID pin to GND.