OK, so in the last lecture, we talked about converting IP addresses into binary.
So the reason we do that is so that you can think about a layer three address in the same way that a
computer thinks about the way we address computers, see bits and binary humanzee decimals and words.
So this is really the first step into understanding something.
Now we're going to really put your newfound knowledge to work.
So let's go ahead and open the command prompt and take a look at the IP address so you can see here
I changed it to 10 that we got five to thirty four.
Subnet mask is now 255 1855 activity to that zero.
This is what we're going to do, right.
I'm going to show you how you can determine which subnet or VLAN a particular host is sitting on right
now.
And you're also going to learn in the next lecture how you can calculate the total number of hosts that
might be assigned to that subnet.
So, you know, why would you want to do this?
Why?
Why does this matter?
Because when you're thinking about scanning a billion or running an attack, you need to know what you're
up against.
Right.
And this will help you get a better view of the lay of the land.
All right.
So first thing we want to do is just draw a little chart first.
We're just going to create a couple of rows in the first row, which is going to represent the values
of the interesting octet in your subnet mask.
OK, so in other words, you have the octet.
This is going to represent the octet where the bits are changing from one to zeros.
So you have that transition from consecutive months, two consecutive zeros.
And we're just going to zoom in on that decimal value for that mask and then analyze the bit positions.
So let me show you what I'm talking about.
We have 128.
Right, then we have 192.
224.
To 40 to 48.
Two fifty two and two fifty five, one, two, three, four, five, six, seven, a missing one.
Oh I forgot to four.
Let's go back to fifty four to fifty five.
So these are subnet mask values that we're looking at right here.
OK, and now we're going to try to position values underneath that.
And I'm going to do is double one starting from the right side?
I'm going to double the number one until I get all the way to the leftmost position.
And I'm going explain what this means.
Don't worry.
But these are the position values also known as the block sizes.
I started one top of one to two squared is four.
And you can see this to the four is eight to the five is 16, and just keep on going 128.
OK, so we have the mask values on the top, we got the block sizes on the bottom, and then we're going
to have a section for the current bit positions.
So let's review something really fast is what we're up against, right?
10 dot three dot five dot thirty four and Damascus 255 dot 255 dot 252 that zero.
Right.
So what this means is that these first two bits.
These first two octets.
It's like that, and the doctor, these are consisting of 16 beds, a here, a here, this ACTTAB has
a mix of ones and zeros.
So it's not exactly 60 Minutes.
So if we know that we start with 16 bits here, we can then zoom in and change the color a little bit.
We can then zoom in from that third octet and look at this expanded position sort of layout for it.
OK, so we've got 16 minutes.
And if we want to keep counting until we get until 20 to 17, 18, 19, 20, 21, 22.
So you can see that when we get to 250 to see, we've counted 22 bits.
OK, so we're going to call that a 22.
All right.
So again, these are the mask values up here.
These are the block sizes.
And the bit positions would be one, two, three, four, five, six.
Right.
Because this number 252 and you break down the number of bits.
This is what equals.
How do I know?
Because 128 plus 64 plus 32 for 16 plus eight plus four equals 252.
So that's why we have 22 consecutive bits.
And that's the subnet mask here.
These last two bits are zero.
So these are the big positions.
Now, this is where things get a little bit messy because in order to determine the network we're on,
we need to get that block size in the way we get the block size is we look at the rightmost bit of the
mask.
So let me just clear things up a little bit to make more sense of this to 55 to 45 to 50 to zero.
This is one, two, three, four, five, six, seven, eight, five, six, seven, eight, one, two,
three, four, five, six, seven, eight.
Right.
So the rightmost bit the third octet is the interesting octet where they 021 transition happens.
The rightmost bit is this one.
And if you remember, you may not.
But from that previous screen, when you looked at all the enmasse values, we had 128, 192, 224,
240, and you should write these out every time.
It's really good to memorize these.
Fifty two to fifty four to fifty five.
And if you look at this, so you have eight here, get it here that 16, 17, 18, 19, 20, 21, 22,
22, like 22 here.
This equals this, OK?
And if you look at the rightmost bit of the mask, this one right here, this is actually in the one
two four eight 16, 32, 64, 128 252 is in this position, the number four position.
Right.
So number four is the block size.
That's the main thing I want you to see.
And so now that we have the block size, this is where we do the math.
So we know the block size is a four.
What do we do with it?
We can do is we take the last network octet value of the IP 10 dot three dot five dot 34, last network
octet value of this IP is this five adelines up from the mask is what shows you the network portion.
Clearly the ten is in the network portion section.
The three that the network portion because of the 255 255 for the ten fifty five for the three and there's
252.
That's also the network portion.
It's in the third octet for this five.
So what we do is we take that five and we divide it by the block side the four.
So when we take five divided by four, we're going to get one point something.
All we care about is the one.
That's it.
We don't care about the remainder.
We just need the number.
And then once we have that number, we multiply this number by the block size and one times four is
equal to four.
That's all the math we need to know.
OK, so I hope that's not too complicated.
OK, it's just a matter of first determining the block size and then taking that block size.
Then it's a matter of taking the the interesting bit in the interesting octet and dividing that by the
block size and taking that result and multiplying it by the block size.
And then you have that number.
Now what you can do is write out your subnets because, you know, now.
Some that ranges, we're not going get into the rain just completely right now, but let me show you
what you know now from this map that we just did what you can do now.
You can take that IP 10.
And as you're writing this out, you know, the block size of the four.
So we're in the third octet.
So you put a four there and then you just put a zero for the hosts.
That's the first network.
The second one would be ten.
Three, eight.
You just add another four.
It's the second network.
And these could be different floors of the same building.
They could be different departments.
They could be different, you know, logical units just depends on how the organization is divided.
But these are different subnets.
You do 12 here, right?
It keeps going.
And the point here now is now that we have these different subnets, we're going to we can basically
see, you know, where our IP address is, because if you look at this, you can see now that we have
10 DOT 4.0 and the next one is ten to zero, what, ten point three to five.
That thirty four fits in between both of these networks.
So we know then that we are on the 10 that we got, that's the zero network, this whole system, that
network, his host is not in the top three eight zero network in the next election to show you how you
can build your ranges and we can actually show your broadcast interests in the network I.D. and all
that good stuff.
I will say that for the next.
Let's see in a second.