USB Device Bus (Demo)

Video Activity
Join over 3 million cybersecurity professionals advancing their career
Sign up with
Required fields are marked with an *
or

Already have an account? Sign In »

Time
21 hours 25 minutes
Difficulty
Intermediate
CEU/CPE
21
Video Transcription
00:00
>> Hey Cybrarians.
00:00
>> Welcome back to the Linux+ course here at Cybrary,
00:00
>> I'm your instructor Rob Goelz.
00:00
>> In today's lesson,
00:00
>> we're going to be talking about the USB Device Bus.
00:00
So upon completion of this lesson,
00:00
you're going to be able to understand
00:00
how the Universal Serial Bus,
00:00
aka USB, works with Linux.
00:00
We're going to be able to explain how
00:00
USB device connections are handled and
00:00
use the "lsusb" command to list
00:00
devices on the system when we get into our demo.
00:00
USB supports multiple devices on a single serial bus,
00:00
it can theoretically support anywhere
00:00
from 96 to 255 devices,
00:00
but that is limited by the number of
00:00
controllers, power, and bandwidth.
00:00
I've never seen a system that can take 255 USB devices,
00:00
but I guess it's theoretically possible.
00:00
Now USB is a high-speed interface and
00:00
it's gone faster with each and every release.
00:00
It started out with 12 megabits per second on USB 1.0,
00:00
and now we're up to 800 megabits per second on USB 3.0.
00:00
USB actually refers to the bus, the bus type,
00:00
while the port refers to
00:00
the connection into the bus or we plug in.
00:00
A thumb drive is a USB device form factor,
00:00
and we can see some examples of that on the right.
00:00
A flash drive is
00:00
a USB storage device that uses flash memory.
00:00
Now, in order for USB device to
00:00
be recognized by a Linux system,
00:00
this system has to have kernel modules installed that
00:00
recognize the USB controller
00:00
that's installed in the system, right?
00:00
Where the system plugs into,
00:00
there's actually a controller on the system,
00:00
and then we also have kernel modules
00:00
installed that recognize the device itself.
00:00
What is getting plugged into the system.
00:00
The connection process for USB
00:00
has the following rough steps.
00:00
Basically, the kernel module is going to detect
00:00
the USB device and it's going to
00:00
create a uevent in this system files system, sys.
00:00
From here, we remember udev detects as
00:00
uevents and configures the device per the rules
00:00
that has this udev rules and it creates an entry
00:00
for the device in the /dev directory.
00:00
Some Linux distros may have udev rules to
00:00
non-USB devices automatically enforced/media,
00:00
but this is not always the case.
00:00
Remember this, the "lsusb" command is
00:00
used to list USB devices on the system.
00:00
Now we can see USB devices in a tree or
00:00
hierarchical view format by using the command "lsusb -t".
00:00
But we can also use "lsusb -v" for evictor,
00:00
which displays additional output by
00:00
using the verbose flag, v for verbose.
00:00
Let's have a look at this command with some demo time.
00:00
Okay, so here we are in
00:00
our demo environment and
00:00
let's just play around with lsusb.
00:00
If Ralph the [inaudible] was, let's just go
00:00
ahead and type lsusb,
00:00
we see that's pretty boring output.
00:00
There's only two devices on this VM, I'm sorry.
00:00
If we want to get a more verbose output,
00:00
maybe a little bit more detailed,
00:00
we could do an lsusb -v "Enter".
00:00
There we go. Alright.
00:00
That's a little too much information, right?
00:00
So let's try doing
00:00
just an lsusb -t. Let's
00:00
see this in the tree or hierarchical view.
00:00
All right, and then we can see how
00:00
these devices are actually laid out,
00:00
so the human interface driver is actually coming
00:00
off of the root hub or the USB controller,
00:00
probably more likely, right?
00:00
And if we wanted to, we could
00:00
combine the two options together,
00:00
lsusb -tv, and we get more of like a Goldilocks zone,
00:00
somewhere in the middle, which is,
00:00
too much information and not enough.
00:00
Now we can see that tree output
00:00
and we can also see a little bit more of
00:00
verbose information about all of the USB devices.
00:00
With that, we've reached the end of this lesson.
00:00
In this lesson, we covered how USB works in Linux,
00:00
we talked about the USB connection
00:00
processing requirements,
00:00
and then also we used the "lsusb" command
00:00
to list USB devices in our demo.
00:00
Thanks so much for being here
00:00
>> and I look forward to seeing you in the next lesson.
Up Next