[music]
Okay, so now we have the concept of a device, and you can envision
it being a server or a mainframe or whatever you want,
but we've got the concept of a
networking device connecting to a cable.
That networking device says, Okay,
I'm running the Ethernet protocol,
which means I'm not the only one
on this cable.
There could be an unknown quantity
of devices on the same cable as me.
I don't know.
Before Ethernet, I did know.
Before Ethernet back in 1969,
I just knew it was me and one other
mainframe and that's it.
We can't make that assumption any more.
Now that this device is running Ethernet,
he says, I'm in a broadcast domain.
It could be me and one other guy or it could be me and 20 guys on
this cable. I just don't know.
So now the developers of Ethernet said,
Okay, well, so what I'm communicating on this cable,
as I communicate, I could do it in one of three different ways.
I could do a broadcast, which means
that I'm putting my 1s and 0s
on this cable.
It's meant for everybody.
In the case of a broadcast,
really we don't even need any kind of an address.
If Ethernet had been developed -
let's just imagine this -
if the developers of Ethernet had said,
okay, anytime anything goes into an Ethernet frame, regardless of
what it is, it's going to go to everybody.
It's just always going to be like that.
Then they would not have needed an address at all.
There wouldn't be a need for it.
But clearly, that's not the way it works
and that doesn't really make
sense to develop it that way,
so they said, okay, we could do broadcasts.
There might be a need for that, or we could do unicast.
Maybe when someone's putting something in the wire,
it's going to be meant for one other device on that same wire.
So they said, okay, in that
particular case we need an address.
So when this data is being put on
the wire, it needs to have a unique
source address of where it came from,
and it needs to have a unique
destination address of where it's going to.
Also keep in mind right here, now we've got devices that have
two addresses that they're using, because remember,
IP came first.
So I've got this device connected
to a network that for several years
has been utilizing this 32 bit number -
this IP number - and the
first 8 bits have been the network,
the remaining 24 bits at the
end have been my own unique host identifier.
Now in addition to that, if I'm coupling Ethernet to IP,
if I'm saying, Okay well, at Layer 2, you're now running Ethernet,
now in addition to an IP address,
I have to also utilize a second address,
a MAC address -
a Layer 2 media access control address,
which is what Ethernet uses.
So the developers of these addresses said,
Okay, we need to structure the
address in such a way that if I'm
sending it to everyone as a broadcast,
both my Layer 3 IP address
and my Layer 2 MAC address need to reflect that.
I need to come up with some kind of address that says this is for
everybody on this cable, and I'll
show you in just a second what that looks like.
Then they said, Okay, what if I'm
sending it directly to Bob's computer?
Bob's computer is on the same broadcast domain as me.
Once again, at Layer 3, I need to
say in the world of IP that this
came from my IP address and it's going to Bob's IP address.
And at Layer 2 - in the world of Ethernet
- I need to say it came
from my MAC address and it's going to Bob's MAC address.
And then the third form of communication was multicast.
Multicast is the concept where on this cable,
this Ethernet broadcast domain,
let's say there's 100 devices -
100 PCs and servers and stuff.
Now, I'm going to start transmitting
data on this cable, and of the 99 devices
on this cable - in addition to me -
maybe 6 of them need this information.
Well, broadcast is not appropriate
because I don't want it to go
out to everybody, and I could do unicast.
I could take this information,
send one copy of it to Sally's unicast address,
copy it again and send
another copy on the cable of Tom's
unicast address, but that would
put a lot of burden on me to make
multiple copies of the same data and
send it out there multiple times.
So they came up with a third
alternative which is called multicast.
Multicast is the idea that -
just like unicast or broadcast -
I'm putting one copy of the data on the wire.
I"m just sending out once, but at the
Layer 3 address and at the
Layer 2 address, it has a special
address that says this is going
to a group of people.
It's not going to everybody.
It's not going to just one person.
It's going to a group of people.
What's kind of interesting is that in the world of multicast,
the sender of the information - which is me,
the one who's transmitting the information -
really doesn't know and doesn't care how many people are in that group.
It's sort of like broadcast in that regard.
When you put a broadcast on a wire,
you don't know who's out there.
You don't know who's going to get
it or how many people are going
to get it. You don't care.
You're just saying, Hey, everybody, whoever's out there,
this is for everyone.
Multicast is kind of the same way where you're saying,
Okay, hey, I'm putting some data on the wire.
If there are any interested individuals,
here you go. So it's actually-- in my example of the 100 people
on the wire where there's 6 people
actually want this and the other
people don't, I have to use a
special address at Layer 3 and
Layer 2 called a multicast address.
It's formatted in a unique way.
It's still 32-bits at Layer 3,
and it's still 48-bits at Layer 2,
but the structure of a multicast
address is such a way that
the receivers - those six people - are looking for it.
They're saying, Okay, I'm looking--
as data comes in the wire,
as I'm seeing the electrical voltage going across,
I'm saying, Okay, see, well I'm running Ethernet which tells me
that 60 bits into it is where I will
find the destination MAC address
- who it's going to.
Now if I'm a unique individual I will say,
Okay, well, if that destination
MAC address is broadcast, I've got
to pick it up.
I have to look at it - see if I'm interested.
If that destination address is mine
- my own unicast address -
clearly I have to pick that up and look at it.
But now I'm looking for a third type of address.
If that destination address is a special multicast address that I
have been told I need to look for,
I will pick it up and process it.
In the world of multicast, you've got this concept of senders and receivers.
You've got one sender who
is sending one copy of the data,
and you've got potentially multiple receivers.
And it's really the job of the
receivers to somehow discover what
that special address is going to be,
and for them to start listening
to that. That's a whole different world.
We're not going to get into that today about,
how do the receivers discover that special multicast address?
How do they know what to look for?
There's various different ways to do that.
But the idea is, what makes
multicast different from broadcast
is that it's only a select group
of people that's actually looking
for that data.
In a broadcast domain, everybody's still going to see it.
Because remember, in the broadcast domain,
the concept is,
you put something in a wire,
that electrical energy is seen by everyone
on that wire. The question is, What people,
when they see that electrical energy, are going to ignore it?
What people are going to process it and say,
This is for me.
In the case of multicast, it's a group of people.
Now we've got this concept of devices having two addresses,
a Layer 3 IP address and a Layer 2 MAC address.
Now we know that those two addresses
can be formatted in one of three
different ways as broadcast, unicast and multicast.
When it comes to network software applications,
as we can see here, they fall
in two different categories.
There's some network software that
just makes the assumption, like ARP,
the address resolution protocol,
that when you invoke the software,
when you tell it to start up, that software will say,
Okay, I am designed in such a way
that I am only going to talk to
people in my own broadcast domain.
I don't even know about other broadcast domains.
I don't even know they exist.
I'm just going to talk to people in my broadcast domain.
Those types of software applications,
technically, they don't even
need IP. All they really need is a
Layer 2 address if they're going
to talk in their own broadcast domain.
But most software falls into the second category,
those capable of intra or inter broadcast domain communications.
So a common misconception when
people are first starting to learn
about IP, is they think, okay, well
an IP address then is equivalent
to a broadcast domain.
I've got one cable here and so that's going to be one network,
that's going to need an IP address,
going to need a network address.
And then I've got another cable
over here in a different building,
that's a different broadcast domain
so that's going to need a network address.
People think, okay, they're equivalent.
IP address equals broadcast domain.
And that's not quite the case.
As we see here, IP is used to address networks.
Those networks might take the form
of a broadcast domain if they're
using Ethernet or Token Ring, or they
could be using some other protocol
that makes it a point-to-point network like HDLC or PPP.
The main idea is that whenever you have a cable,
and you expect IP packets to go across that cable,
either end of that cable needs to
know that this is part of a network.
We need an IP address to represent this network,
whether it be point-to-point or a
broadcast domain - a collection
of Ethernet devices.
So an IP address,
we know that the original developers of IP,
they structured it in such a way that it had two parts to it.
The first 25% of that address -
I guess if you're looking, this would be the left here -
the first 8 bits represent the network.
So let's just say if we're talking about Ethernet,
that represents the broadcast domain.
Everybody on that Ethernet segment
has the same 8 bits in common.
They're part of the same group, part of the same clique.
And then the remaining 24 bits at
the end are unique on every single host.
So if we're talking about a broadcast domain,
if I'm talking about an Ethernet
segment that's got 100 devices on it,
because they're all part of the same broadcast domain,
they can all see each other's electrical energy,
from a Layer 3 perspective, from an IP perspective,
it was originally designed that
they would all have the first eight
bits in common.
They'd all have the same eight bits.
They're all part of the same group.
But then of those 100 devices,
the remaining 24 bits would have unique patterns.
Each device would have it's own unique,
what they call host address or host bits.
Okay, so we have devices that have two addresses -
a Layer 3 IP address and a Layer 2 address.
Let's just say it's a MAC address,
and some application running way
up here - Layer 7 of the OSI model.
So that application gets invoked and that application says,
Okay, I need to hook into IP so I
can actually get out of my chassis,
get out of my box and put some data on the wire.
Okay, well, we know that as far as Layer 2 is concerned-
the MAC layer, the data link layer, let's say -
we know that that application has
one fundamental question it has
to answer as far as networking is concerned.
It has to answer the question:
the destination I'm trying to reach,
the person I want to talk to,
are they on the same wire as me,
on the same broadcast domain, or are they not?
Are they in some other broadcast domain,
meaning that when I put my electrical energy on this wire,
they can't see it because they're
not on this broadcast domain.
So every application that's network
aware has to answer that question.
So if the application determines that,
okay, the destination I'm trying
to reach is in my broadcast domain.
I can talk to him directly.
He will see my electrical energy as soon as I start putting it on
the wire. Well, that application can't skip past IP.
You might think Okay, well in
that particular case, we don't need
to use IP at all.
Let's just skip past it and just
go straight to Layer 2 addresses.
Can't do that.
If a system - like a laptop, or a PC -
is running both IP and Ethernet,
you can't skip past IP.
So when you put your data on the wire, you're going to have an IP
address in there and a MAC address.
Now, in this particular case, if the
person I'm talking to is on my wire,
the IP address is kind of
irrelevant because I'm talking to
them directly via their Layer 2 address.
If they're on my wire, now I discover
what their Layer 2 address is,
so as I'm transmitting my bits
at Layer 2 their NIC card can say,
Oh, this is for me.
There's other people seeing it, but this is for me.
And once my NIC card identifies
that as a unicast transmission,
it doesn't really need to see the IP address,
but we can't skip past it
so the destination IP address will be in there as well.
Now, let's say I'm trying to talk
to somebody that's not on my wire,
someone that's on a different broadcast domain.
Well, same thing.
When I put my data on the wire, I can't skip past Layer 2.
Even though the person I'm trying
to talk to technically can't see
my Layer 2 - they can't see my electrical energy - I can't just
take data, address it with the
destination IP address to the person
that's 5000 miles away and put on my cable
because my cable says, Well, wait a second.
I'm running a Layer 2 protocol.
I'm running Ethernet, and the rules
of Ethernet state I need a Layer 2 address.
So when you're
talking to somebody that's not in
the same broadcast domain as you, you say,
Okay, well, what do I use as a
Layer 2 address, because they're
not on the same broadcast domain.
This is where the concept of a default gateway comes in -
a router. A router is someone, is a
device that should know not only
the broadcast domain he's connected to,
which is the same one you are on,
but he should also know about other
broadcast domains.
So he's like an intermediary device.
So in the case of that, if my application says,
Okay, let's see here.
The destination I need to talk to
is not on my broadcast domain.
It's somewhere else,
then the destination says, Okay, here's what I need to do.
At Layer 3, I will source the
data from my IP address, from my
unique eight bit combination of my network,
then at Layer 3 I will put the
destination IP address as the
destination I'm trying to reach and
he has a unique eight bit combination
of bits, then we send that down to Layer 2.
At Layer 2, I will put the source
address as my own NIC cards MAC address -
my Layer 2 address - and the destination address will be,
Okay, who on my broadcast domain
can help me get this data to
where it needs to go?
The router, the default gateway.
So at Layer 2, the Layer 2 address will be the router.
For those of you who are studying for your CCNE,
this is a foundational thing you need to be aware of,
is that when you've got a device running Ethernet and IP,
whenever it puts data on the wire,
you will always see two addresses
in that data. You will see a Layer 2 MAC
and a Layer 3 IP address.
Both of them will be in there.
If the person you're trying to talk to is on your wire,
is in your broadcast domain, the destination Layer 3 address will
be the person you're trying to talk to,
and the destination Layer 2 address
will be the person you're trying
to talk to. It's being unicast directly to them.
But if the person you're trying to
talk to is in a remote broadcast domain,
which might be a dozen feet or 2,000 miles away,
at Layer 3, nothing changes.
At Layer 3 ,it's still your source IP
address going to their destination
IP address. What changes is Layer 2.
At Layer 2, because you can't talk to them directly,
you use your source MAC address
and you use your default gateway's
MAC address as the destination.
The assumption is as I'm putting
the electrical energy on the wire,
the default gateway will will say, Oh, that's for me.
I see my MAC address here.
And then when he gets that Ethernet frame and he removes it,
and he goes up to Layer 3, that's when the router will say,
Ah well, at Layer 2 it looked like
this was a unicast transmission
for me, but at Layer 3 it's not.
At Layer 3 it says, Oh, the
destination IP address is not one of mine.
It's somebody else's.
Now it's the router's job to forward
that data into another broadcast domain
and it will hop through
various broadcast domains until it
reaches the destination broadcast domain.
So this is what we're talking about here.
On the top, we've got one broadcast domain,
which is called LAN-1.
And so in the original days of IP,
we reserved the first eight bits for that network,
and so it might be seven 0s and a 1.
On the bottom, we have LAN-2, a second broadcast domain,
so that needs a different, unique group number,
a different, unique network number.
So how do computers and mainframes
and stuff actually see this?
So we know that a MAC address is in binary,
48 bits long, so there's 48 bits right there.
An IP address,
little bit shorter, 32 bits long.
So what does a computer see when it looks at incoming data?
I'll go ahead and expand this a little bit for you here.
So there is the source on the right
sending data to the destination
on the left. What's coming in is just a string
of thousands of 1s and 0s.
So where are these addresses in all this?
Well, if that destination device
is running the Ethernet protocol,
he's going to say, Okay, the first
64 bits that I saw coming in
is a bunch of Ethernet stuff -
basically what we call the preamble.
Then from bit 65 to bit 112,
that's the destination MAC address.
And then the bits 113 through 160 are the source MAC address.
Now hopefully nobody will ever actually ask you to do this,
but if someone said, Hey,
I'm going to give you a piece of paper
that's got 2000 bits in binary written on it,
can you tell me what the destination
MAC address is in this long
string of bits?
This is how you do it.
You'd say, Okay, well, if this thing is Ethernet,
it means that somewhere in here is a MAC address.
You would look right at bit 65 and go from 65 to 112.
That would be your destination MAC.
Then 113 to 160 would be your source MAC.
Then Ethernet says, Okay, I've got
another 16 bits of Ethernet stuff,
and I'm done.
So as far as Ethernet is concerned,
all of that is Layer 1 and
Layer 2. So that's Layer 2 stuff that Ethernet interprets.
Once Ethernet is done, it removes all of that stuff,
sends it up to Layer 3.
If we're assuming that IPv4
is going to run at Layer 3,
now IPv4 starts by looking right here.
This is what IPv4 sees.
It says, Okay, the first 96 bits are IP stuff."
So if you ever do a Google search on an IPv4 header,
you'll see that IPv4 actually has
a lot of bits it needs to look
at before it ever gets to any address.
It has like an IP version field, IP header length,
whole bunch of stuff.
So it's 96 bits of stuff that IP looks at.
Then at bit number 273, that's where
we see our source IP address.
Because an IP address is 32 bits long, that goes from bit 273 to
bit 304, and then from bit 305 to 336
is the destination IP address.
Then there's more bits beyond this
that are other IP stuff like IP options.
Then you're going to have
a whole string of bits after that,
which is what TCP looks at.
Then they're going to have a whole
string of bits after that for
what FTP looks at, or telnet looks at.
So really, a simple packet of like
telnet or email is going to
be thousands of bits long.
But within the first few hundred bits
is where you're going to see
your MAC addresses and your IP addresses encoded.
So that's what your computer sees.
[music]