It would not be easy to find a system that does not have A Universal Serial Bus (USB) port.
I've covered 'USB Port Management', but maybe it's time to look a little deeper now that there are newer releases of USB.
USB Standard Speeds
USB started with standard 1 and is now on standard 4. So, let's look through the differences.
The standards for 1.0 and 1.1 had transmission speeds up to 12 Mbps and released in 1996. Standard 2.0 increased the speed to 480Mbps. Things sped up again with the 3.0 standard at 5 Gbps, which also included 3.1 Gen 1. Standard 3.1 Gen 2 doubled the speed to 10 Gbps. Later again, standard 3.2 upped the speed to 20 Gbps, but this is Type-C to Type-C. Finally, standard 4.0 went as high as 40 Gbps.
The list is:
USB Standard Speed
1.0/1.1 12 Mbps
2.0 480 Mbps
3.0/3.1 Gen 1 5000 Mbps (5 Gbps)
3.1 Gen 2 10000 Mbps (10 Gbps)
3.2 20000 Mbps (20 Gbps)
4.0 40000 Mbps (40 Gbps)
Now, notice that the standard reaches 4.0, but the Linux commands, such as 'lsusb' and 'lspci' only show USB 3.1, even if the port is a higher standard.
Let's look into that and see how we can determine the port standard.
Initially, we will work without a device connected to the ports.
Electrical Output
The voltage output of US ports is all 5 volts. The difference is in the Amps and wattage.
For USB 1.0 and 2.0, the amps are 0.5A and 2.5W. USB 3.0, 3.1 and 3.2 supply 0.9A for 4.5W for connected devices. If you are using USB 4.0, then the amps are 3A and the wattage is 15W.
The list is:
USB Standard Amps Watts
1.0/1.1/2.0 0.5A 2.5W
3.0/3.1/3.2 0.9A 4.5W
4.0 3A 15W
If the USB port cannot supply the proper power to a device through the port, then the device will need power from another source.
USB Placement
The USB Root Hubs are not positioned on the motherboard with direct access to the Central Processing Unit (CPU). The USB Hubs connect to the Peripheral Component Interconnect (PCI) or the Peripheral Interconnect Interface Express (PCIe) bus.
So data is from the CPU to the PCI (PCIe) then to the USB Root Hub. Once the USB Root Hub has the data, it is passed to the USB device on the USB bus. Data going from a USB Device to the CPU travels in reverse order.
The USB bus allows for 'splitting' from one port to multiple ports by using a USB Hub. Sometimes an external device, such as a monitor, can have extra USB Ports that are established as a hub.
Linux Commands and Output
To determine what is available in your system, you have a few commands and parameters to determine what is available.
For these screenshots, I will use an HP Envy Laptop.
To get the basic list of USB devices, use the command:
Figure 1 shows my output.
FIGURE 1
As you can see from the Figure, there are four buses on the system, numbered 1 to 4. Each bus can be a different USB standard, with different speed and power abilities. Let's look at these closer.
The main hubs are listed as 'Linux Foundation #.# root hub'. The numbers will be standard number, but these could be incorrect since it lists all version 3.x as 3.0. In Figure 1, you'll see that there are two 2.0 and two 3.0 hubs. Some root hubs may be internal, while others are external ports.
Bus 1 is a 2.0 standard. It shows a device on Bus 1 that is an HD camera, the webcam. It also shows 'Synaptics', which is the touch pad. We could assume that this is completely an internal port. My laptop has two USB A ports. The port on the right of the laptop is Bus 1. I determined this by plugging in a USB flash drive and it showed up as Bus 1. So, Bus 1 is internal and external. If you plan on using the webcam and the right port, do not use a device that requires high bandwidth that would cause issues with the bandwidth used by the webcam.
For Bus 2, it is listed as the USB standard 3.0. No devices are shown as being on it. Let's leave that for now.
Bus 3 uses the 2.0 standard and also has the Bluetooth device on it. This, again, is internal. If I place a USB flash drive in the left USB A port, it shows up as Bus 3. So we now know that both USB A ports are using standard 2.0.
Looking at Bus 4, it is listed as the 3.0 standard.
Now, we have two buses that are listed as the 3.0 standard. On the right side of my laptop is a C port. If I connect in a USB flash drive that has a USB C connector, the command 'lsusb' shows it as being on Bus 2. It lists the device as 'Sandisk 3.2 Gen1', see Figure 2.
FIGURE 2
Now, this is a basic look at the USB ports. We can get into this deeper soon.
Looking back, I mentioned that each USB root hub sent and received data to and from the CPU through the PCI Bus, so we should see how this is set up.
USB and PCI
We ran the command 'lsusb' and saw some basic information. Let's try something to show a little more detail:
Using two 'v' allows more verbose information. The output is shown in Figure 3. Each root hub entry shows a location for the USB device, 'sys/bus/usb/devices/usb#'. It is possible that the USB hubs could be enumerated in a different order when booting. Your system should number them the same each time, but there is always a possibility.
FIGURE 3
We can now see the device 'file' for each USB hub and this can help allow us to match it to a PCI bus. To see the PCI bus list, we can use the command:
The output is shown in Figure 4.
FIGURE 4
In the output, you can see that there are four USB devices listed, which match up with our output from the 'lsusb -tvv'. On my laptop, USB1 and USB2 are on the same bus together '0000:04:00.3'. USB3 and USB4 are on the same PCI bus. If you have high-speed devices on your USB ports, you can now see where bandwidth may be shared not only in the USB root hubs, but now in the PCI bus.
Real USB Standards
As I've stated before, the 'lsusb' command lists everything as either USB 2.0 or 3.0. So, let's see if we can get closer to the real USB standards.
We can specify individual devices to get information from. If I looked at my USB root hub on Bus 2 and Device 1, with the command:
This command will list just the root hub, but if we add a '-v', we can get a more detailed information about the device.
What we are looking at more specifically, is the value of the binary-coded decimal for the USB device (bcdUSB). To see this specifically, we can use the command:
The result for the hub is '3.10' showing that the hub supports the USB standard 3.1, but is it Gen 1 or Gen 2?
We need to see the speed at which the hub can operate. If you use the previous command without passing it through 'grep', you'll see a lot of information pass by and the last few lines say something about '10Gb/s', but ignore these lines. Instead, we look for a line that says 'Device can operate at'. So, run the command:
The result is a line that states the hub operates at 5GB/s making the hub USB 3.1 Gen 1.
NOTE: There is a line labeled 'iSerial' which lists the PCI bus as we discussed before.
If I add in my USB Type-C flash drive, which is USB 3.2, and should support a max speed of 20 Gbps, I can run the following code:
I get a listing that the device supports speeds of 12Mbps, 480Mbps and 5Gbps. The limitation was negotiated when the device was plugged into the port. The port, as we saw before, is USB 3.1 Gen 1 and only supports a max of 5Gbps.
We can further 'grep' the keyword 'MaxPower' for the USB flash and see that the Amps the device is receiving from the hub is '896mA' or '.896A'. which stands up for the 3.x standard of a maximum of '.9A'.
Conclusion
Other than having your specs on a computer from the manufacturer, you can find the USB specs with a little effort.
Knowing which ports are where on a system and how they work on different buses can help you determine what port to use for what device. You can help maximize bandwidth for devices.
I've covered 'USB Port Management', but maybe it's time to look a little deeper now that there are newer releases of USB.
USB Standard Speeds
USB started with standard 1 and is now on standard 4. So, let's look through the differences.
The standards for 1.0 and 1.1 had transmission speeds up to 12 Mbps and released in 1996. Standard 2.0 increased the speed to 480Mbps. Things sped up again with the 3.0 standard at 5 Gbps, which also included 3.1 Gen 1. Standard 3.1 Gen 2 doubled the speed to 10 Gbps. Later again, standard 3.2 upped the speed to 20 Gbps, but this is Type-C to Type-C. Finally, standard 4.0 went as high as 40 Gbps.
The list is:
USB Standard Speed
1.0/1.1 12 Mbps
2.0 480 Mbps
3.0/3.1 Gen 1 5000 Mbps (5 Gbps)
3.1 Gen 2 10000 Mbps (10 Gbps)
3.2 20000 Mbps (20 Gbps)
4.0 40000 Mbps (40 Gbps)
Now, notice that the standard reaches 4.0, but the Linux commands, such as 'lsusb' and 'lspci' only show USB 3.1, even if the port is a higher standard.
Let's look into that and see how we can determine the port standard.
Initially, we will work without a device connected to the ports.
Electrical Output
The voltage output of US ports is all 5 volts. The difference is in the Amps and wattage.
For USB 1.0 and 2.0, the amps are 0.5A and 2.5W. USB 3.0, 3.1 and 3.2 supply 0.9A for 4.5W for connected devices. If you are using USB 4.0, then the amps are 3A and the wattage is 15W.
The list is:
USB Standard Amps Watts
1.0/1.1/2.0 0.5A 2.5W
3.0/3.1/3.2 0.9A 4.5W
4.0 3A 15W
If the USB port cannot supply the proper power to a device through the port, then the device will need power from another source.
USB Placement
The USB Root Hubs are not positioned on the motherboard with direct access to the Central Processing Unit (CPU). The USB Hubs connect to the Peripheral Component Interconnect (PCI) or the Peripheral Interconnect Interface Express (PCIe) bus.
So data is from the CPU to the PCI (PCIe) then to the USB Root Hub. Once the USB Root Hub has the data, it is passed to the USB device on the USB bus. Data going from a USB Device to the CPU travels in reverse order.
The USB bus allows for 'splitting' from one port to multiple ports by using a USB Hub. Sometimes an external device, such as a monitor, can have extra USB Ports that are established as a hub.
Linux Commands and Output
To determine what is available in your system, you have a few commands and parameters to determine what is available.
For these screenshots, I will use an HP Envy Laptop.
To get the basic list of USB devices, use the command:
Code:
sudo lsusb
Figure 1 shows my output.
FIGURE 1
As you can see from the Figure, there are four buses on the system, numbered 1 to 4. Each bus can be a different USB standard, with different speed and power abilities. Let's look at these closer.
The main hubs are listed as 'Linux Foundation #.# root hub'. The numbers will be standard number, but these could be incorrect since it lists all version 3.x as 3.0. In Figure 1, you'll see that there are two 2.0 and two 3.0 hubs. Some root hubs may be internal, while others are external ports.
Bus 1 is a 2.0 standard. It shows a device on Bus 1 that is an HD camera, the webcam. It also shows 'Synaptics', which is the touch pad. We could assume that this is completely an internal port. My laptop has two USB A ports. The port on the right of the laptop is Bus 1. I determined this by plugging in a USB flash drive and it showed up as Bus 1. So, Bus 1 is internal and external. If you plan on using the webcam and the right port, do not use a device that requires high bandwidth that would cause issues with the bandwidth used by the webcam.
For Bus 2, it is listed as the USB standard 3.0. No devices are shown as being on it. Let's leave that for now.
Bus 3 uses the 2.0 standard and also has the Bluetooth device on it. This, again, is internal. If I place a USB flash drive in the left USB A port, it shows up as Bus 3. So we now know that both USB A ports are using standard 2.0.
Looking at Bus 4, it is listed as the 3.0 standard.
Now, we have two buses that are listed as the 3.0 standard. On the right side of my laptop is a C port. If I connect in a USB flash drive that has a USB C connector, the command 'lsusb' shows it as being on Bus 2. It lists the device as 'Sandisk 3.2 Gen1', see Figure 2.
FIGURE 2
Now, this is a basic look at the USB ports. We can get into this deeper soon.
Looking back, I mentioned that each USB root hub sent and received data to and from the CPU through the PCI Bus, so we should see how this is set up.
USB and PCI
We ran the command 'lsusb' and saw some basic information. Let's try something to show a little more detail:
Code:
sudo lsusb -tvv
Using two 'v' allows more verbose information. The output is shown in Figure 3. Each root hub entry shows a location for the USB device, 'sys/bus/usb/devices/usb#'. It is possible that the USB hubs could be enumerated in a different order when booting. Your system should number them the same each time, but there is always a possibility.
FIGURE 3
We can now see the device 'file' for each USB hub and this can help allow us to match it to a PCI bus. To see the PCI bus list, we can use the command:
Code:
stat -c%N /sys/bus/usb/devices/usb*
The output is shown in Figure 4.
FIGURE 4
In the output, you can see that there are four USB devices listed, which match up with our output from the 'lsusb -tvv'. On my laptop, USB1 and USB2 are on the same bus together '0000:04:00.3'. USB3 and USB4 are on the same PCI bus. If you have high-speed devices on your USB ports, you can now see where bandwidth may be shared not only in the USB root hubs, but now in the PCI bus.
Real USB Standards
As I've stated before, the 'lsusb' command lists everything as either USB 2.0 or 3.0. So, let's see if we can get closer to the real USB standards.
We can specify individual devices to get information from. If I looked at my USB root hub on Bus 2 and Device 1, with the command:
Code:
sudo lsusb -s 002:001
This command will list just the root hub, but if we add a '-v', we can get a more detailed information about the device.
What we are looking at more specifically, is the value of the binary-coded decimal for the USB device (bcdUSB). To see this specifically, we can use the command:
Code:
sudo lsusb -s 002:001 -v | grep bcdUSB
The result for the hub is '3.10' showing that the hub supports the USB standard 3.1, but is it Gen 1 or Gen 2?
We need to see the speed at which the hub can operate. If you use the previous command without passing it through 'grep', you'll see a lot of information pass by and the last few lines say something about '10Gb/s', but ignore these lines. Instead, we look for a line that says 'Device can operate at'. So, run the command:
Code:
sudo lsusb -s 002:001 -v | grep operate
The result is a line that states the hub operates at 5GB/s making the hub USB 3.1 Gen 1.
NOTE: There is a line labeled 'iSerial' which lists the PCI bus as we discussed before.
If I add in my USB Type-C flash drive, which is USB 3.2, and should support a max speed of 20 Gbps, I can run the following code:
Code:
sudo lsusb -s 002:003 -v | grep operate
I get a listing that the device supports speeds of 12Mbps, 480Mbps and 5Gbps. The limitation was negotiated when the device was plugged into the port. The port, as we saw before, is USB 3.1 Gen 1 and only supports a max of 5Gbps.
We can further 'grep' the keyword 'MaxPower' for the USB flash and see that the Amps the device is receiving from the hub is '896mA' or '.896A'. which stands up for the 3.x standard of a maximum of '.9A'.
Conclusion
Other than having your specs on a computer from the manufacturer, you can find the USB specs with a little effort.
Knowing which ports are where on a system and how they work on different buses can help you determine what port to use for what device. You can help maximize bandwidth for devices.