If you and I went in to business and we manufactured
network cards that plugged into ethernet networks,
one of our responsibilities in building and manufacturing
these cards is to make sure that each of our network adapters
had burned into it or programmed into it
a 48-bit unique address that that network adapter could
use as it communicates locally on that network segment.
One of the uses for a layer 2 address on a network adapter
is that it allows a unique way of identifying that adapter
on a network segment.
And these layer 2 ethernet addresses
are 48 bits in length.
But you know, it's kind of a pain
to talk to about 48 bits between friends as 101100.
It's just too tedious.
So what we do when we represent those where humans
are going to be reading it--
we're usually using hexadecimal characters,
12 hexadecimal characters to represent those 48 bits.
Another interesting phenomenon is that these layer 2 addresses
have lots of different names, including
names like an ethernet address or a layer 2
address or a physical address.
Even though this is a layer 2 type of function
because the addresses are going to be part of the layer 2
frames, I suppose because they're
burned into some of the network adapters.
And a network adapter is a physical thing.
It got the term physical address.
But in any case, all these terms and names
are referring to the layer 2 ethernet address.
And while we're doing name calling,
another name that these are often referred to as are MAC
addresses-- capital M, capital A, capital C--
where that Mac doesn't stand for Macintosh.
It stands for Media Access Control.
And it's because we have these layer 2 addresses that
intelligent devices like a layer 2 switch can take advantage
of that information-- for example,
where this frame is coming from and where it's going to--
because the source and destination layer
2 addresses are inside that layer 2 frame.
So a switch can make intelligent forwarding decisions
based on that layer 2 address information
in each of the frames.
And oftentimes, when learning something new--
like, for example, wow, there's a layer 2 address
on my network adapter.
It's often fun to take a look at what yours is.
And so here's a couple of different ways,
depending on the platform that you're on,
that you can look at your layer 2 address.
So let's begin on a Linux box.
If you happen to be on a Linux box,
the command would be IF config.
It'll list your interfaces.
And as part of that, it's going to list the hardware address,
which would be one more name that we could refer
to the layer 2 address as-- so ethernet address, layer 2
address, physical address, MAC address, or hardware address.
They've also put some colons in to help separate two characters
at a time.
On a Windows platform, we'd go ahead and run the command
ipconfig/all.
So if you go to the interface you're concerned about,
you can look at the details for that.
And then just below that, here we
have the physical address, which is that bad boy right there.
And once again, is represented by 12 hexadecimal characters
representing a 48-bit unique MAC address.
And even if we're not on a wired Ethernet network,
we still use the concept of a layer 2
address when working with Wi-Fi.
So even on a mobile device, it's going
to show us a Wi-Fi address, which once again is
12 hexadecimal characters.
They've thrown in some colons there just
to make it easier to read.
And that represents a 48-bit layer 2 address.
And if we're on a network device--
maybe a router or a switch--
we'd use the appropriate command there.
So the commands may vary a little bit between Juniper
and HP and Cisco.
So here on this Cisco device, I'm
going to issue the command show interfaces fast
ethernet 1/1, which will show us a lot of details regarding
that interface, fast ethernet 1/1,
including the layer 2 address.
So we'll press Enter.
So here, among a lot of other details,
it's showing us the address is this bad boy right there.
And so in this output, Cisco is giving us
four characters and a period.
So whether a vendor is using colons or periods
to separate the numbers, they're doing so just
to make it a little bit easier to read.
And then one last thing that I thought would be fun to do
is let's take a look at a packet capture in Wireshark
to take a look at the layer 2 information
and take a look at some ethernet frames that
are including both the source and destination layer 2
addresses in those frames.
So we'll just pick this top one here.
And here in the Layer 2 Information, if we expand that,
that's showing us regarding this ping request--
I'm cheating a little bit by just seeing this
is a ping request right here--
the layer 2 destination address in that layer 2
header, this frame, is this guy right there.
And the source address, the individual
that's sourcing this frame on this network,
has this layer 2 address, this MAC address right here.
And one of the big benefits of including the source
and destination layer 2 addresses inside of frames
is that a network device--
for example, a layer 2 switch--
can now look at those addresses and make intelligent forwarding
decisions on the local network based on where
that frame needs to go.
In this Nugget, we've taken a look
at layer 2 Ethernet addresses.
I hope this has been informative for you,
and I'd like to thank you for viewing.