# Why 127 max USB devices?

**URL:** <https://boards.straightdope.com/t/why-127-max-usb-devices/263289>\
**Category:** Factual Questions\
**Created:** [September 6, 2004, 1:45am UTC](https://boards.straightdope.com/t/why-127-max-usb-devices/263289 "2004-09-06T01:45:04Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![emekthian](https://avatars.discourse-cdn.com/v4/letter/e/ecae2f/32.png) [@emekthian](https://boards.straightdope.com/u/emekthian)\
**Post date:** [September 6, 2004, 1:45am UTC](https://boards.straightdope.com/t/why-127-max-usb-devices/263289/1 "2004-09-06T01:45:04Z")

</div>

Why can there only be 127 USB devices connected to a computer? And what’s the signifigance of 127?

---

<div class="post-metadata">

**Author:** ![Dr.Lao](https://avatars.discourse-cdn.com/v4/letter/d/2bfe46/32.png) [@Dr.Lao](https://boards.straightdope.com/u/Dr.Lao)\
**Post date:** [September 6, 2004, 1:49am UTC](https://boards.straightdope.com/t/why-127-max-usb-devices/263289/2 "2004-09-06T01:49:57Z")

</div>

It is one less than 128.

---

<div class="post-metadata">

**Author:** ![mike1dog](https://avatars.discourse-cdn.com/v4/letter/m/ba9def/32.png) [@mike1dog](https://boards.straightdope.com/u/mike1dog)\
**Post date:** [September 6, 2004, 1:56am UTC](https://boards.straightdope.com/t/why-127-max-usb-devices/263289/3 "2004-09-06T01:56:57Z")

</div>

The real question, is can you find 127 devices you’d want to hook up to your computer?

---

<div class="post-metadata">

**Author:** ![Musicat](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/musicat/32/20189_2.png) [@Musicat](https://boards.straightdope.com/u/Musicat)\
**Post date:** [September 6, 2004, 2:08am UTC](https://boards.straightdope.com/t/why-127-max-usb-devices/263289/4 "2004-09-06T02:08:57Z")

</div>

IANAU (USB expert), but the number 127 strongly suggests that 7 bits of a binary byte or word was allocated for device assignment.

Probably on the (then) logical observation that “who would ever want to connect more than 127 devices to a computer?”

Sorta like, “Who would ever need more than 640K of RAM? Ever??”

Why do you ask? Are you running out of connection possibilities already?

---

<div class="post-metadata">

**Author:** ![astro](https://avatars.discourse-cdn.com/v4/letter/a/9dc877/32.png) [@astro](https://boards.straightdope.com/u/astro)\
**Post date:** [September 6, 2004, 2:14am UTC](https://boards.straightdope.com/t/why-127-max-usb-devices/263289/5 "2004-09-06T02:14:59Z")

</div>

See [Project Hydra: the USB Multiheaded Monster](http://www.linuxjournal.com/article.php?sid=6518)

> [@](#):
>
> Before embracing this idea as the console access cure-all, however, we should discuss the limitations. The first is the USB bus, which is limited to 127 devices per controller. This seems like a lot, but it is important to remember that hubs count as one device, and under Linux the root hub also counts as a device. So, consider a tree of USB hubs and USB-serial adapters. Let n be the number of ports per hub, k be the number of hubs in the tree and r be the number of USB-serial adapters. This gives us a total of n \* k ports. To connect the k hubs in a tree we require a minimum of k – 1 interconnects, so the maximum number of USB-serial adapters is r = nk – (k – 1). Because there is a maximum of 126 devices (127 minus one for the root hub), in the best case we have k + r = 126. Solving for nk yields two equations, nk = 125 and r = 126 – k. When nk = 125 does not have an integer solution, it is best to round k up; otherwise, less than the maximum number of ports will be available. Consequently, with four-port hubs (n = 4) we have k = 32 and r = 94, for a maximum of 94 USB-serial adapters on a single controller. With seven-port hubs, k = 18 and r = 108.
> 
> We can do a little better than 127 devices by using additional USB controllers. Although most PCs are equipped with multiple USB ports, these ports often are on the same controller, and the 127 device limit constrains both ports. Even if we add more controllers, there is an upper limit of 256 USB-serial devices allowed, or r \</= 256. This is a limitation of the number of allowable minor numbers for the assigned USB-serial major number, which is 188. More industrious users probably could modify the driver to allow additional majors. Adding additional controllers also may be required in cases where the serial ports have a high baud rate; keep in mind the USB bus is limited to 12Mbps. Timing issues also may keep the usable number of USB-serial adapters below the theoretical limit, but adding controllers is relatively easy and inexpensive.

---

<div class="post-metadata">

**Author:** ![engineer\_comp\_geek](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/engineer_comp_geek/32/504_2.png) [@engineer\_comp\_geek](https://boards.straightdope.com/u/engineer_comp_geek)\
**Post date:** [September 6, 2004, 3:32am UTC](https://boards.straightdope.com/t/why-127-max-usb-devices/263289/6 "2004-09-06T03:32:14Z")

</div>

USB packets look like this:

Token:  
Packet ID: 8 bits  
Address: 7 bits  
Endpoint: 4 bits  
CRC: 5 bits

Start of frame:  
Packet ID: 8 bits  
Frame Number: 11 bits  
CRC: 5 bits

Data Packet:  
Packet ID: 8 bits  
Data: 0-1023 bytes  
CRC: 16 bits

Handshake:  
Packet ID: 8 bits

The exact details of how this is all put together is a bit beyond the technical level of this post, but since the address is only 7 bits, you can only have 128 devices on the entire bus (with 7 bits that can each be on and off, there are only 128 total different combinations of bits possible). This includes your computer, so that leaves 127 other things you can attach to it.

As for why they only chose to allot 7 bits to the address field, keep in mind that this bus was designed to run the keyboard, mouse, printer, and a few accessories attached to your computer (like maybe a scanner or a digital camera). Most people never have more than half a dozen devices attached to their system, so 128 devices is far more than the average person needs.

---

<div class="post-metadata">

**Author:** ![gazpacho](https://avatars.discourse-cdn.com/v4/letter/g/6f9a4e/32.png) [@gazpacho](https://boards.straightdope.com/u/gazpacho)\
**Post date:** [September 6, 2004, 6:04am UTC](https://boards.straightdope.com/t/why-127-max-usb-devices/263289/7 "2004-09-06T06:04:42Z")

</div>

> [@](#):
>
> The exact details of how this is all put together is a bit beyond the technical level of this post, but since the address is only 7 bits, you can only have 128 devices on the entire bus (with 7 bits that can each be on and off, there are only 128 total different combinations of bits possible). This includes your computer, so that leaves 127 other things you can attach to it.

Address 0 is reserved devices coming out of reset not the computer. For example say you have a hub with 5 devices plugged into it. on reset the hub will listen to address zero. The PC will then send a request to the hub at address 0. This request will ask the hub what it is. The hub will respond that it is a hub. Until the hub is configured it will not pass the requests to the down stream ports. The PC will then assign a non zero address to the hub. The PC will then turn on the first hub port to which something is attached and send a request to address 0 to find out what is attached to that port. Then that device will be assigned a non zero address. This process repeats until all devices are configured.

---

<div class="post-metadata">

**Author:** ![TechnologicalAdvancement](https://avatars.discourse-cdn.com/v4/letter/t/a87d85/32.png) [@TechnologicalAdvancement](https://boards.straightdope.com/u/TechnologicalAdvancement)\
**Post date:** [November 30, 2014, 12:09am UTC](https://boards.straightdope.com/t/why-127-max-usb-devices/263289/8 "2014-11-30T00:09:37Z")

</div>

> [@Musicat](#):
>
> IANAU (USB expert), but the number 127 strongly suggests that 7 bits of a binary byte or word was allocated for device assignment.
> 
> Probably on the (then) logical observation that “who would ever want to connect more than 127 devices to a computer?”
> 
> Sorta like, “Who would ever need more than 640K of RAM? Ever??”
> 
> Why do you ask? Are you running out of connection possibilities already?

Hehehe. 640K of Ram? Hi there 2004. 10 years later we don’t even measure in kilobytes anymore, we use gigabytes now. I, at the time of this post, have 16gigs of Ram in my computer and use about 8 during a game and more when multitasking. Don’t ever under estimate how technology will advance. Who knows maybe some day we will have networks where someone will need that many usb connections. Certainly someday someone will make an account on here for fun to make fun of me for the current specs of 2014. I have no doubt that someday there will be terabyte ram, usb networks, and beyond.

---

<div class="post-metadata">

**Author:** ![johnpost](https://avatars.discourse-cdn.com/v4/letter/j/f17d59/32.png) [@johnpost](https://boards.straightdope.com/u/johnpost)\
**Post date:** [November 30, 2014, 12:13am UTC](https://boards.straightdope.com/t/why-127-max-usb-devices/263289/9 "2014-11-30T00:13:47Z")

</div>

> [@mike1dog](#):
>
> The real question, is can you find 127 devices you’d want to hook up to your computer?

lots of fans to cool your overheating computer.

---

<div class="post-metadata">

**Author:** ![friedo](https://avatars.discourse-cdn.com/v4/letter/f/8edcca/32.png) [@friedo](https://boards.straightdope.com/u/friedo)\
**Post date:** [November 30, 2014, 12:14am UTC](https://boards.straightdope.com/t/why-127-max-usb-devices/263289/10 "2014-11-30T00:14:30Z")

</div>

> [@TechnologicalAdvancement](#):
>
> Hehehe. 640K of Ram? Hi there 2004. 10 years later we don’t even measure in kilobytes anymore, we use gigabytes now.

I measure things in individual bytes all the time.

---

<div class="post-metadata">

**Author:** ![typoink](https://avatars.discourse-cdn.com/v4/letter/t/ecb155/32.png) [@typoink](https://boards.straightdope.com/u/typoink)\
**Post date:** [November 30, 2014, 12:25am UTC](https://boards.straightdope.com/t/why-127-max-usb-devices/263289/11 "2014-11-30T00:25:38Z")

</div>

> [@TechnologicalAdvancement](#):
>
> Hehehe. 640K of Ram? Hi there 2004. 10 years later we don’t even measure in kilobytes anymore, we use gigabytes now. I, at the time of this post, have 16gigs of Ram in my computer and use about 8 during a game and more when multitasking. Don’t ever under estimate how technology will advance. Who knows maybe some day we will have networks where someone will need that many usb connections. Certainly someday someone will make an account on here for fun to make fun of me for the current specs of 2014. I have no doubt that someday there will be terabyte ram, usb networks, and beyond.

Musicat was referencing a famous quotation from Bill Gates in the 80s. Even in 2004, PCs would use much, much more RAM than that.

---

<div class="post-metadata">

**Author:** ![Isilder](https://avatars.discourse-cdn.com/v4/letter/i/cc9497/32.png) [@Isilder](https://boards.straightdope.com/u/Isilder)\
**Post date:** [November 30, 2014, 4:00am UTC](https://boards.straightdope.com/t/why-127-max-usb-devices/263289/12 "2014-11-30T04:00:40Z")

</div>

> [@TechnologicalAdvancement](#):
>
> Hehehe. 640K of Ram? Hi there 2004. 10 years later we don’t even measure in kilobytes anymore, we use gigabytes now.

1984 to 1989… in 1992 I got a 80386 with 8 megabytes.

---

<div class="post-metadata">

**Author:** ![Measure\_for\_Measure](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/measure_for_measure/32/557_2.png) [@Measure\_for\_Measure](https://boards.straightdope.com/u/Measure_for_Measure)\
**Post date:** [November 30, 2014, 4:19am UTC](https://boards.straightdope.com/t/why-127-max-usb-devices/263289/13 "2014-11-30T04:19:28Z")

</div>

> [@typoink](#):
>
> Musicat was referencing a famous quotation from Bill Gates in the 80s. Even in 2004, PCs would use much, much more RAM than that.

c. 1981 even. Though Bill Gates [denies ever saying anything like that](http://www.computerworld.com/article/2534312/operating-systems/the--640k--quote-won-t-go-away----but-did-gates-really-say-it-.html). [More.](http://quoteinvestigator.com/2011/09/08/640k-enough/)

---

<div class="post-metadata">

**Author:** ![beowulff](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/beowulff/32/542_2.png) [@beowulff](https://boards.straightdope.com/u/beowulff)\
**Post date:** [November 30, 2014, 4:20am UTC](https://boards.straightdope.com/t/why-127-max-usb-devices/263289/14 "2014-11-30T04:20:17Z")

</div>

> [@Isilder](#):
>
> 1984 to 1989… in 1992 I got a 80386 with 8 megabytes.

I had a 68020 machine with 8GB of RAM in 1987…

---

<div class="post-metadata">

**Author:** ![Habeed](https://avatars.discourse-cdn.com/v4/letter/h/a587f6/32.png) [@Habeed](https://boards.straightdope.com/u/Habeed)\
**Post date:** [November 30, 2014, 5:04am UTC](https://boards.straightdope.com/t/why-127-max-usb-devices/263289/15 "2014-11-30T05:04:18Z")

</div>

> [@beowulff](#):
>
> I had a 68020 machine with 8 **G** B of RAM in 1987…

You probably meant to type an M there, which would still have been a monster machine for 1987. The 486dx2 I used in the early 90s had that much RAM, and the chip itself was only available in 1992.

A fully loaded [ETA10](http://www.museumwaalsdorp.nl/computer/en/eta10p.html), a beast of a supercomputer in 1987 (with 10 gigaflops of performance! 8 CPUS! liquid nitrogen cooling) could have 2 gigabytes of RAM.

---

<div class="post-metadata">

**Author:** ![beowulff](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/beowulff/32/542_2.png) [@beowulff](https://boards.straightdope.com/u/beowulff)\
**Post date:** [November 30, 2014, 5:13am UTC](https://boards.straightdope.com/t/why-127-max-usb-devices/263289/16 "2014-11-30T05:13:20Z")

</div>

> [@Habeed](#):
>
> You probably meant to type an M there, which would still have been a monster machine for 1987. The 486dx2 I used in the early 90s had that much RAM, and the chip itself was only available in 1992.
> 
> A fully loaded [ETA10](http://www.museumwaalsdorp.nl/computer/en/eta10p.html), a beast of a supercomputer in 1987 (with 10 gigaflops of performance! 8 CPUS! liquid nitrogen cooling) could have 2 gigabytes of RAM.

Yeah, M.

I remember a friend who had a conversation with a tech support guy who absolutely would not believe her when she told him she had 32M of RAM in her machine - he thought she didn’t know the difference between RAM and Disk. But, these were Macs used by graphics designers, and they had lots of RAM for Photoshop.

---

<div class="post-metadata">

**Author:** ![andrewm](https://avatars.discourse-cdn.com/v4/letter/a/c57346/32.png) [@andrewm](https://boards.straightdope.com/u/andrewm)\
**Post date:** [November 30, 2014, 3:00pm UTC](https://boards.straightdope.com/t/why-127-max-usb-devices/263289/17 "2014-11-30T15:00:27Z")

</div>

> [@mike1dog](#):
>
> The real question, is can you find 127 devices you’d want to hook up to your computer?

The limit is not 127 devices per computer, but 127 devices per bus. Computers often have multiple USB busses, plus the ability to add more through expansion cards.
