Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
USB
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== System design <span class="anchor" id="HOST"></span>== A USB system consists of a host with one or more downstream facing ports (DFP),<ref>{{cite web |title=Type-C CC and VCONN Signals |publisher=Microchip Technology, Inc. |url=https://microchipdeveloper.com/usb:tc-pins |access-date=August 18, 2023}}</ref> and multiple peripherals, forming a tiered-[[star topology]]. Additional [[USB hub]]s may be included, allowing up to five tiers. A USB host may have multiple controllers, each with one or more ports. Up to 127 devices may be connected to a single host controller.<ref>{{cite web | title = Universal Serial Bus Specification Revision 2.0 | pages = 13; 30; 256 | format = [[ZIP (file format)|ZIP]] | url = http://www.usb.org/developers/docs/usb_20_101111.zip |website=USB.org | date = 11 October 2011 | access-date = 8 September 2012 | archive-url = https://web.archive.org/web/20120528075527/http://www.usb.org/developers/docs/usb_20_101111.zip | archive-date = 28 May 2012}}</ref><ref name=USB30Spec/>{{rp|at=8β29}} USB devices are linked in series through hubs. The hub built into the host controller is called the ''root hub''. A USB device may consist of several logical sub-devices that are referred to as ''device functions''. A ''composite device'' may provide several functions, for example, a [[webcam]] (video device function) with a built-in microphone (audio device function). An alternative to this is a ''[[compound device]],'' in which the host assigns each logical device a distinct address and all logical devices connect to a built-in hub that connects to the physical USB cable. [[File:USB pipes and endpoints (en).svg|thumb|alt=Diagram: Inside a device are several endpoints, each of which connects by a logical pipe to a host controller. Data in each pipe flows in one direction, though there is a mixture going to and from the host controller.|USB endpoints reside on the peripheral device: The channels to the host are referred to as ''pipes''.]] USB device communication is based on ''pipes'' (logical channels). A pipe connects the host controller to a logical entity within a device, called an ''[[Communication endpoint|endpoint]]''. Because pipes correspond to endpoints, the terms are sometimes used interchangeably. Each USB device can have up to 32 endpoints (16 ''in'' and 16 ''out''), though it is rare to have so many. Endpoints are defined and numbered by the device during initialization (the period after physical connection called ''enumeration'') and so are relatively permanent, whereas pipes may be opened and closed. There are two types of pipe: stream and message. * A ''message'' pipe is bi-directional and is used for ''control'' transfers. Message pipes are typically used for short, simple commands to the device, and for status responses from the device, used, for example, by the bus control pipe number 0. * A ''stream'' pipe is a uni-directional pipe connected to a uni-directional endpoint that transfers data using an ''[[isochronous]]'',<ref>{{cite web |url = http://www.usb.org/developers/presentations/SuperSpeed_USB_DevCon_Isochronous_Froelich.pdf |title = Isochronous Protocol |date = 20 May 2009 |access-date = 21 November 2014 |author = Dan Froelich |website = USB.org |url-status=dead |archive-url = https://web.archive.org/web/20140817061140/http://www.usb.org/developers/presentations/SuperSpeed_USB_DevCon_Isochronous_Froelich.pdf |archive-date = 17 August 2014 }}</ref> ''interrupt'', or ''bulk'' transfer: *;Isochronous transfers: At some guaranteed data rate (for fixed-bandwidth streaming data) but with possible data loss (e.g., realtime audio or video) *;Interrupt transfers: Devices that need guaranteed quick responses (bounded latency) such as pointing devices, [[Computer mouse|mice]], and keyboards *;Bulk transfers: Large sporadic transfers using all remaining available bandwidth, but with no guarantees on bandwidth or latency (e.g., file transfers) When a host starts a data transfer, it sends a TOKEN packet containing an endpoint specified with a [[tuple]] of ''(device_address, endpoint_number)''. If the transfer is from the host to the endpoint, the host sends an OUT packet (a specialization of a TOKEN packet) with the desired device address and endpoint number. If the data transfer is from the device to the host, the host sends an IN packet instead. If the destination endpoint is a uni-directional endpoint whose manufacturer's designated direction does not match the TOKEN packet (e.g. the manufacturer's designated direction is IN while the TOKEN packet is an OUT packet), the TOKEN packet is ignored. Otherwise, it is accepted and the data transaction can start. A bi-directional endpoint, on the other hand, accepts both IN and OUT packets. [[File:USB 2 and 3.jpg|thumb|alt=Rectangular opening where the width is twice the height. The opening has a metal rim, and within the opening a flat rectangular bar runs parallel to the top side.|Two USB 3.0 Standard-A receptacles (left) and two USB 2.0 Standard-A receptacles (right) on a computer's front panel]] Endpoints are grouped into ''interfaces'' and each interface is associated with a single device function. An exception to this is endpoint zero, which is used for device configuration and is not associated with any interface. A single device function composed of independently controlled interfaces is called a ''composite device''. A composite device only has a single device address because the host only assigns a device address to a function. When a USB device is first connected to a USB host, the USB device enumeration process is started. The enumeration starts by sending a reset signal to the USB device. The signaling rate of the USB device is determined during the reset signaling. After reset, the USB device's information is read by the host and the device is assigned a unique 7-bit address. If the device is supported by the host, the [[device driver]]s needed for communicating with the device are loaded and the device is set to a configured state. If the USB host is restarted, the enumeration process is repeated for all connected devices. The host controller directs traffic flow to devices, so no USB device can transfer any data on the bus without an explicit request from the host controller. In USB 2.0, the host controller [[Polling (computer science)|polls]] the bus for traffic, usually in a [[Round-robin scheduling|round-robin]] fashion. The throughput of each USB port is determined by the slower speed of either the USB port or the USB device connected to the port. High-speed USB 2.0 hubs contain devices called transaction translators that convert between high-speed USB 2.0 buses and full and low speed buses. There may be one translator per hub or per port. Because there are two separate controllers in each USB 3.0 host, USB 3.0 devices transmit and receive at USB 3.0 signaling rates regardless of USB 2.0 or earlier devices connected to that host. Operating signaling rates for earlier devices are set in the legacy manner.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)