I'd like you to imagine that a friend walks up to you
and in casual conversation they ask you,
can you tell me, says your friend,
about a mask exactly what it does?
Now if you're saying, oh, Keith, I know, I know.
It absolutely identifies out of an IP version 4 address,
it identifies which portion of that IP address is the network,
and everything else beyond that is the actual host addresses.
So here, my friend, are the details
behind how the mask identifies which portion of an IP address
is the network.
So I ran IP config on my Windows machine,
and this is what it gave me.
It said my IP address is 192.168.1.15.
Fantastic.
So I broke that into binary just for display purposes.
And the first number of 192, I put in red in binary here.
168, right here in blue.
The one in green, and the 15.
So there's the decimal notation that we normally use,
and the binary equivalent of each one of those.
Now what I'd like to do is talk about the mask.
There is also a 32-bit mask associated with each IP version
4 address.
So on the output of IP config up here
it says that my mask, and that also brings me
to a point of nicknames.
For example, sometimes it's referred to as the mask.
Sometimes it's referred to as the network mask.
Sometimes it's referred to as the subnet mask.
But any way you slice it, when we're talking about IP version
4, it's referring to this device that identifies which portion,
going from left to right, which portion of that IP address
is the network, and which remaining portion is
available for host addressing.
So this is how it does it.
That 32-bit mask is also represented in dotted decimal.
So I have the mask right here.
There's 255.255.255.0.
So that's the mask literally off of the computer that I'm using.
For display purposes, I converted the mask octets
into binary.
So there's the first 255, and the second 255, the third 255,
and of course, this last octet of all zeros
represents that decimal 0 right there.
So here's the magic.
The computer lines up all the bits
of the actual IP address with those same bits in the mask as
shown here.
And so here's what the mask does.
We simply follow the bits that are on.
The bits that are on in the mask is
representing which portion of the IP address is the network.
So if we simply follow the mask and the bits that are on,
and then stop when they stop, which in this case
happens to be right here, that my friends,
is the dividing line.
Everything to the left is the network,
and everything to the right is the actual host portion.
So in this case, we could say that my computer is
on network 192.168.1, the first three octets,
and that my host address is .15 on that network.
The way it actually determines this
is by doing some multiplication.
It multiplies the bit in the mask
against the corresponding bit in the IP address,
and if we did that, for example.
1 times 1 equals 1.
and 1 times 1 equals 1, 1 times 0 equals 0.
Effectively, we're going to have the same exact number that we
have up here down below.
And the very last octet, what it's
going to be if you multiply all those by 0,
they're all going to be zero no matter what.
So if we converted this back into decimal,
it would be 192.168.1.0, and that's
how we represent networks inside of IP version 4.
And more specifically, we can put a slash here, and say
24, which literally means that the first 24 bits, 8 bits here,
and 8 bits here, and 8 bits here,
those first consecutive 24 bits, going from left to right,
represent the network, and the last 8 bits
are available for host addresses,
or like house addresses on those streets.
I've got a little exercise I'd like you to do with me,
and that is this.
Let's pretend that this mask isn't this one right here,
so we're going to replace that for a moment.
And let's say that the mask instead is 255.255.0.0.
So the mask in this octet would all be 0, just like that.
And here's my question for you.
Now that we have this mask, what is the actual network address
if this is our mask, and how many bits of the IP address
are being used for network?
And how many bits are now available for host
addressing on that network?
So take a moment right now, go ahead and pause me.
Determine what you think the correct answer
is for the actual network address,
and then we'll compare notes.
Awesome.
Thank you for taking a moment to do that.
So here's how I would look at this.
I'd say, well, we're going to follow the bits in the mask
until they stop, and then you can draw a line, and everything
to the left that is the network, and everything to the right
are the host addresses.
So we could say that with this mask, the network is 192.168,
and then, anything beyond the mask when we're identifying
the network, we just 0 out.
So this is the 192.168.0.0 network slash 16.
It's a 16-bit network, and we have another 16 bits available
for host addresses on that network.
I hope this has been informative for you,
and I'd like to thank you for viewing.