[music]
Okay, so up until this point in time, we've
had this concept where some device was running TCP/IP,
the protocol stack, and part of TCP/IP meant that that
device had to have a 32-bit number assigned to it - an
IP address. And how that device looked at that 32-bit
number was, was it a really old style device, where it
just looked at the first eight bits and that was it?
Or, was it a newer device that used classful
addressing, where it said, Well, I'm going to look at
the first two or three bits there and determine if my
address is A, B, or C. And then based on that, I'll
figure out where the dividing line is between my
network bits and everything left over - my host bits.
Well, even though this classful addressing did end
up giving us thousands and thousands of more available
networks. Even that very soon became apparent that it
was not going to be enough. It wasn't going to be
enough. So it soon became apparent that "Hey look," you
know, if a company goes to the Regional Internet Registry or a
service provider and that company says, "Look I'm
really big, and I'm going to need a thousand networks. You
know, I've got 800 different departments of employees. In
addition to that, I want all my printers on one network.
I want all my voice phones on another. I want all my
fax machines on other one," so I actually need a
thousand broadcast domains, a thousand networks. Well if
the Regional Internet Registry or the service
provider gave them one thousand public classful
networks, at that rate those classful networks were
soon going to be gone. So this is where in 1985 the
concept of subnets came into play. So originally we have
this. We have a building, four floors in the building.
Let's just assume that each floor requires its own
unique network. So back in the classful days, we said,
Okay, we'll give each one of those floors its own unique
classful network - the 20, the 21, the 22, and the 23
networks. But that wasn't very scalable. Even that was
going to run out. So instead, they said, Okay,
here's what we're going to do. We will give you a
single classful network, the 20 network, the class A 20
network, and you will now divide that one network into
multiple smaller pieces - what we call subnetworks.
Now in a classful scheme, if all those devices in that
building in the right were doing classful IP
addressing, they would say, We're all in one network. We
looked at the first byte-- and the number 20 in binary
starts out with zero, right? The 128 bit is off. So
they'd say, Oh The 120 bit is off, which means that
this is a Class A address which means the first byte
tells us our network. Oh, the first byte's number 20.
Okay, anything beginning with the number 20 is in my
network, belongs to my group. But clearly, that's
not the case here. Here, we've got four different
broadcast domains. So with subnetting we're saying,
"Hey look, don't worry about your class. Your class is
kind of irrelevant. Don't look at the first bit or two
bits or three bits. Instead, look at something else."
So now you're not going to look at your class
identifier anymore. Now, I'm going to give you a new
piece of information that tells you, of that 32 bit
number where to draw that dividing line between the
network portion and the host. This is where a subnet
mask comes into play. Can't do subnetting without a
subnet mask. So we know, as a review that when you get a
network from an ISP you're going to have the network
part and the host part. Now, from the ISP's perspective,
the service provider, they don't care what you do with
your host bits. They're going to assume that you're
just going to assign those host bits in unique
combinations to your laptops, in your PCs, in
your servers, and so on and so forth. But what they do
care about is, they say, "Look! We just gave you,
let's say, an 8-bit network. We gave you the number 20."
So the ISP says, "That is now registered to you. No
other company in the entire world can have that 8-bit
pattern on their network. That belongs to you, and we
will make sure we advertise, while the other ISPs
throughout the entire world, that the 20 network belongs
right here. So in Germany, Mongolia, China, if you guys
ever need to send a packet to something that's starting
with 20, send it here, and we'll get it to this company,
which is, you know, our customer." So it's very
important that the network they gave you, the network bits, you
don't mess around with those. So if you start
changing your network bits now, you're infringing on
some other company. So let's say for example, an ISP
leases you this network, 129.1.0.0. Now if we're
dealing with a classful architecture, classful IP
addressing, you would look at that and you'd say, "Okay
let's see, 129. Let's convert that into binary."
128 bit is on, 64 bit is off. Boom, I'm done. That is
a class B address which tells me that the first half
of that address, the first 2 bytes, 129.1, is the
network. So this is what the ISP is thinking. The ISP is
thinking, "Okay, Keith's company over here that we
just leased this network to, they own 129.1." Nobody else
in the whole world owns 129.1. So there's what it looks
like in binary. So the ISP says, Don't change those
bits in red. If you do, we're going to be very
unhappy with you. But you can do whatever you want
with those last 16 bits. Those are host bits. So the
ISP's assumption - the service provider's
assumption - is that I have one network, one broadcast
domain, that uses that 16-bit pattern to identify
itself, 129.1 but that raises the question: what if
I have other broadcast domains? What if I need two
networks or three or four? Well certainly, the ISP would be
more than happy to take my money to buy another
network, and another, and another. The ISP will say,
Oh sure, yeah, we'd love to sell you 129.2 and 129.3 and
129.30. Come to us with your money. We'll give you as
many networks as you need. So I say, "Well, you know, if I'm
spending $100 a month on that one network, I don't necessarily
have another $2,000 a month to spend to get a couple
dozen more networks." So remember, the ISP says,
"Look, as long as you don't change those red bits,
that's all we care about." So I say, "Well, wait a
second. We know that all the devices in the same
broadcast domain all have to agree on what the name of
their group is, in binary." What the binary pattern is
for their broadcast domain. What their binary network
is. I know I can't change the first 16 bits. Well, why
don't I do this. Why don't I give them a unique 18 bit
pattern like this? I'll keep the first 16 bits the same
because I can't change that. That's what my service
provider gave me. But, of the last 16 bits, I'm going
to take those two bits there in green. Instead of telling my
laptops, Hey, look at those two bits as part of your
host pattern. I'm going to say, No, I don't want you to
do that. All laptops on that segment on the left there,
of your 32-bit number, for all of you, the first 18
bits represent your network, represent your group. So
basically what I've done is I've taken these two green
bits that used to be host bits and I've repurposed
them. I've converted them into networking bits. I've
added them to the existing 16 networking bits I already
had that I couldn't change. And because the ISP doesn't
care what I do with these 16 bits on the end, I can do
whatever I want with that. So I'll say, Okay, all you
guys here on the left, this is your 18-bit network. And
all you guys on the right, I'll use a different 18-bit
network for you. Still keeping the 16 bits I got
from my ISP consistent, but now this is what's called
subnetting. Subnetting is taking one network and
dividing it into two or three or four or five or
hundreds of subnetworks, keeping the original bit
pattern of your original network consistent across
all of them. So in this particular example here of
my 32-bit number now, we can classify those 32 bits into
one of three buckets. We've got our original networking
bits which are the ones in red. Those are the ones I
can't change that I've bought and paid for from my
regional Internet registry or from my service provider.
And then we have some host bits which are no longer host
bits which I've now repurposed or reused as
networking bits. I'm now telling my laptops, Add that
to your existing network section. That's part of your
group name and those are called subnet bits. And I've
got my host bits on the end. So here's the question.
Original IP, the devices just assume back in the
1960s the first 8 bits represented their group,
represented their network. Move forward to what was it?
1985, I think it was, or 1981, it was in the slides
back, to Classful addressing. Now a device
take a look at the first few bits of the IP address and
said, what class am I? A, B, or C? That'll tell me where
my network ends and where my host portion begins. Now
we're saying as a third alternative, don't use
either one of those methods. I'm going to arbitrarily
tell you that of your 32 bit number, the first 18 bits,
or the first 20 bits, or the first 28 bits represent your
group. But how do I give it that information? How do I
tell it of those 32 bits where that dividing line can
arbitrarily fall? And that's where subnet mask came into
place. So here we see prior to subnet masks just the
first few bits identified how much of the address
belong to your network, and then you were done, that was
it, you feel into an A, B, or C, and that's all you
had. So in this particular case, the PC on the left
says, "Okay, I've now identified my network
numbers being 129.1. So if I need to create a packet, if
the destination of that packet is also 129.1, great!
I know they're on the same wire as me. I know that when
I put my electrical energy on this wire that represents
1s and 0s, they will see it because they're in the same
broadcast domain as I am. But if I need to create a
packet going to a destination that's not
129.1, that's anything else, they are not in my broadcast
domain, which means, I need to send it to my router to
get it to wherever it needs to go." So he says, "Okay, all
of my particular network, my network is 129.1.0.0 and if
I ever need to send a broadcast well, my group is
129.1 and I'll set all the host bits to 1s. So the broadcast
address for this particular network is 129.1.255.255.
Okay, now we go into subnet masks. So now on my laptop or
my PC or my tablet, I have to provide it two pieces of
information: the IP address and right next to that
another 32-bit number in binary which is called a
subnet mask. And the two are used to compare against
each other. Now here I've put them one on top of each
other to make it real clear. I said, Okay, here's your
32-bit number which is your IP address and just below
that is your subnet mask. And the way that your laptop or
smartphone or tablet looks at this, it says, Okay, I'm
going to do a one-for-one comparison. For every bit in
my subnet mask that's a 1, that means the corresponding
bit in the IP address belongs to my network,
belongs to my group, my broadcast domain. And for a
bit in my subnet mask that's a 0, that means the
corresponding bit in my IP address belongs to my own
unique host identifier. So now, here with this subnet
mask, I'm telling it, Okay, don't worry about the class
anymore. Forget about the fact that it says 1 0 at the
beginning. That's irrelevant. Instead, the
subnet mask says, of your 32-bit number, the first 24
bits represent your specific group, your broadcast
domain. So now the laptop says, Okay, based on that,
anybody else I want to talk to who's in my broadcast
domain, who's on my wire, should also have the exact
same 24-bit pattern as me, which is 129.1.1. And so now
if I need to send a packet to anybody that does not
match those first 24 bits, that means they're in a
different broadcast domain, and I'll need to use my
default gateway. So now my network has changed a little
bit. My network is still the same 129.1.0. Remember
previously he said, "Oh my network is only the first
half of the address. I'm class B so it's 129.1." Now
he's saying, "Oh the Subnet mask is telling me it's
129.1.0." I got to include that 0 as part of my network
address, and if I want to send a broadcast, that would
be 129.1.1.255. So this is the purpose of the Subnet
mask. It's a comparison tool to help the device with the
IP address to know specifically of those 32
bits where the dividing line ends. Which portion of the
32 bits are the network, and which portion are unique
host bits. And we represent subnet masks in one of three
different ways. Typically, you won't see it in binary,
but this is how your laptop sees it. It's just a string
of binary bits, but typically we convert just
like we convert a 32 bit IP address into dotted decimal.
We do the same thing to the subnet mask. We take that
entire 32 bit binary number and convert it into dotted
decimals. So this would be a common representation
255.255.0.0. And a lot of times in papers and books and
stuff, they'll shorten it even further. They'll say,
"Okay well, in this combination here, I'm seeing
that the first 16 bits are all 1's so that's telling
me, that of my 32 bit number, the first 16 bits
are the network portion. So, shorthand notation would be
/16. Well, guess what? I have some more questions for
you! So here we go. Let me expand this a little bit. A
few more quiz questions. Same thing. I will give you
guys 30 seconds to think about it and then I will
show you the answer. So here we go, quiz number 3. Given
the following subnet mask in binary, what is the
equivalent representation in dotted-decimal and shorthand?
Okay, time's up. So here is our answer. So if
you take a look at all the 1s and remember that your 1s
represent your networking bits, if you just add them
up, you've got 8 + 8 + 4 which says of the 32 bits,
the first 20 of them are networking bits. So that gives
us our shorthand answer of /20. And if you convert this
into a dotted-decimal number, all 1s is 255.255
and the first four 1s, if you add those up, 128 + 64 +
32 + 16 gives you 240. So that's why answer D is the
correct answer also. Let's do a couple more of these. If the
following subnet mask were to applied to a PC's NIC, how many
bits of the IP address would be interpreted as networking
bits? All right, and the answer to this, 29 of those
bits will be considered networking bits. Let's just
do that one on the whiteboard real quick. So
we had 255-- so let's just make this a little bit
larger. We had 255.255.255.248, so if we
take a look at that, we know the number 255 is that, so
that tells me that all 8-bits of the 1st octet are
networking bits. All 8-bits of the 2nd octet and all
eight bits of the third octet. And then if we take a
look at the number 248, that's the first five bits
as being networking bits. So if you add all those up,
eight plus eight plus eight is 24. 24 plus five gives
us-- what subnet mask would be appropriate in dotted
decimal to indicate to a host that the first 26 bits
of its IP address should be considered as the network?
All right, the correct answer for this one was
answer B, the first 26 bits of the IP address. So if
we're looking at the first 26 bits, it looks like this.
One, two, three, four, five, six, seven, eight. One, two,
three, four, five, six, seven, eight. One, two,
three, four, five, six, seven, eight. That's the 1st
24-bits, 1-2, so there's 26, 3-4-5-6-7-8, and when you
convert those numbers, you've got 255.255.255.192.
Given the following IP address and subnet mask,
identify the sub network address of this host. So
what you have here is a full 32-bit host IP address, and
when the host IP address, when that host looks at that
IP address that he's got, as well as his corresponding
subnet mask, what is the network that he will assume
that he is on, that he's sitting on? Remember, the
key thing here, about this is, in a 32-bit IP address,
if all the host bits are 0s, that is your network number.
So you're trying to extract from this, what the network is,
where all the host bits are zeroed out.
Okay, the answer to this one is answer A. So let's work through
the logic of how this one works. So here we had 137.54.101.77,
and a corresponding subnet mask was 255.255.224.0. Now
whenever you see a-- within a subnet mask, if an entire
byte is the number 255, remember, that's real easy,
right? That means that all eight bits of that byte in the
corresponding IP address belong to the network. So that
means that this entire byte of 137 belongs to the
network, and this entire byte of 54 belongs to the
network. Now where it may have gotten a little
difficult for you was in the third byte because we don't
have all 8 bits. 224 is this number, that's 224 which
tells me of the number 101 only the first 3 bits belong
to the network, and then everything else to the right
needs to be zeroed out as host bits. So to do this, we
had to convert the number 101 - just the first 3 bits
of it - into binary. So with 101, the 128-bit is off,
64-bit is on, 32-bit is on, 64 plus 32 is 96. At this
point, we can't go any further because if we turned
on the 16-bit, that would be too high. And then
everything else, needs to be zeroed out. 12345678. So
this is telling us here that these bits here in the pink
boxes all belong to the network. Everything else are
host bits. So when you convert that entire thing
into a dotted decimal number, that's what gave you
your final answer of 137.54.96.0 because remember
to identify the network that means all host bits have to
be zeroed out. What if I were to ask you using the
same IP address and same Subnet mask to identify the
broadcast address of this network? Remember what makes
the network address different than the broadcast
address? And the network address, all the host bits
are 0 because you're referring to the wire itself
not any particular host on that wire. You're referring
to the broadcast domain in general. Well in a
broadcast, you're saying I'm sending it to all the hosts,
every single host there is. So 011 ends my network, and
if I'm sending it to all my hosts, it looks like that
because all my host bits are set to ones. So to identify
the broadcast address, it would be 137.54, and then
what's this entire byte right here? Well that entire
byte, what is it? That's 1 number shy of the number 128
isn't it? Because the next binary pattern bigger than
that would be 100000 which is 128 so that means that
number is 127.254. So using that 1 IP address and Subnet
mask, we were able to extract from that, and this
is exactly the way your laptop does it. It extracts
from that the network address says, "Okay, once my
networking bits end, I'm just going to zero out
everything." That's the network. That's the
broadcast domain. That's my group. And it says, "Okay
and if I turn all those host bits to 1's, that's how I
send a broadcast to everyone in my group." Let's do
another one. Given the following IP address and
subnet mask in binary, identify which of the
answers below provide for the broadcast address of
this network. We just did that. So let's see if you can
do that for yourself. Okay, time's up. So if we take a look
at this. According to the subnet mask, this right here
belongs to our network because the subnet mask says
the first 16 bits belong to the network. So what is that
number? Well, just by process of elimination
you can pretty much assume it's 67 to begin
with and then the second number is three so that
eliminates answer D, that can't be right. So 67.3 and
we're being asked to identify the broadcast
address so that means that all of the host bits have to
be set to 1's. So that means it would 67.3.255.255 and that
gives us our answer. Let's do a couple more. I want to
make sure you really have this. Different permutations
of the same question. Given the following IP address and
subnet mask, identify which of the answers below provide
for the broadcast address of this network so a very
similar but, a little bit different. Give you 30
seconds for this one. All right, time's up. So in this
particular case, the subnet mask was real easy, right?
Tells us that the first 3 octets belong to the network, and
so if we take our host bits and we set them all to the
ones to make a broadcast, that gives us our correct
answer of 130.54.6.255. Let's do another one. Given
the following IP address and Subnet mask - now we're back
in binary - identify which of the answers below
provides for the broadcast address of this network.
Thirty seconds beginning now. Okay, so in this one
right here, we've got all of this belongs to the network
because that's what matches our Subnet mask pattern. And so
if we're going to identify the broadcast address that means
all these remaining host bits have to be set to 1's.
All right, so this right here, that's easy. If that's
all set to 1's that's 255. So we've got 67.3 and then in
the third octet, if we have 011 and then we set the rest
of it to all 1's, that would give us 67.3. - I made a
mistake here, it's not just the first 3 bits, it's the
first 4 bits. The network mask did not quite line up
underneath. That's where we ended, the first 4 bits
there. So now, if we set the remaining stuff to 1's, that
third octet if we convert that into dotted decimal,
will give us the number 111. 01101111 is the number 111.
One more quiz question. One more and then we'll keep
going on. Same type of thing - identify the broadcast
address for this network. Time's up. Correct answer
was the bottom one. In this particular case,
255.255.224, that tells us that all of 77, all of 42,
and then of the number 200, the first three bits because
224 is 111 and then all five 0s. Kind of hard for me to
draw it here so forgive my sloppy drawing. That's 224.
So the number 200, we've got the first three bits we're
concerned with. So the 128-bit is on, 64-bit is on,
32-bit is off. That gives us the number 192. Everything
else is host bits. So if we're trying to identify the
broadcast address, we have five more bits here so let's
go ahead and draw those in. One, two, three, four, five,
and then one, two, three, four, five, six, seven,
eight. So 77.42, this is the number 223.255. That is the
broadcast address of that network.
[music]