Well, here it is, a quick crash course review in IP addressing topics that it is assumed knowledge
for someone like you who's going to be a pen tester or a cybersecurity analysts or just a any kind of
cyber and security combination.
So IP addressing is just stuff we have to know backwards, forwards, inside and out.
And remember, it all comes down to binary where we have eight bits and an IPV four address has 32 of
these bits and it has a 32 bit subnet mask.
And those bits are used in combination to determine if you're on the same network with another node.
So I will walk you through the calculations.
And just again, a real crash course.
But if you don't know this stuff, now is the time.
You absolutely have to learn this stuff backwards, forwards, inside and out.
So if you don't have access to curriculum, you'd want to start turning to something like YouTube for
sure, and you'd want to start watching.
I don't even have to search an IP address ENG or IP subnet NG or any of these topics in YouTube to know
there's going to be thousands of videos on the subject there.
You have to learn this stuff, get this stuff, learn if any of this review is foreign to you.
Now, what I always do, any time I'm asked to do anything involving subheading or IP address calculations
or anything like that, I always will make on my scratch paper.
And you're always have some kind of note taking capability when you're in an exam.
I will make a conversion chart that looks just like this.
It is the values of the binary bit positions and it's to raise to the seventh equals 128 and notice
it goes to raised to the zero is one.
This table is so incredibly easy to complete.
So, you know, we just know that two raised to the zero is the value of one because anything raised
to the value of zero is equal to one.
And once you know that, you just double it.
One, two, four, eight, 16, 32, 64 and one take the appropriate to raise to the whatever values
are in the first layer there or table row.
That's it.
It's a row.
The first row of my conversion chart notice is those two raised to the whatever values and those come
in handy later on when we're actually doing sub netting, for example.
So the conversion chart in action, that binary address that we saw earlier, that 11001101 address,
well that would convert to in decimal 128 plus 64 plus eight plus four plus one.
Let me pause the video and do that math.
Well, I think the answer is 205.
And let me make sure that.
Right.
Let me grab the calculator.
And if I go to the calculator, oh, in fact, we can even set it to scientific or programmer.
And if I send it to programmer and say that I want to enter this in binary, so I say 110011.
And then zero one.
And notice we see it in decimal 205.
So that's great.
I just confirmed that my.
I'll lower that calculator and keep it on our taskbar.
We may need it again, but there's the proof of my manual addition.
128 plus 64 plus eight plus four plus one does indeed.
Two's equal, 205.
And that's the decimal value of that octet.
Now, what if we were asked, what is 212 in binary?
Well, now we have to play a little subtraction game and that goes basically like this.
Can we take 128 from 212 and not go into the negative?
And the answer to that is, yes, we can.
So we go ahead and do that.
Subtraction 212, 128, rather, from 212.
All right.
Let me do this.
Gosh, I'm doing this on paper.
You can't see it.
I know this is making for exciting television, isn't it?
But let me just try and do this real quick.
So we have oh my gosh, I suck at basic arithmetic.
Now let me grab the calculator and just cheat.
But you see what I'm doing, right?
You're doing a big subtraction problem and you're getting it to where the remainder is going to be zero.
So let me go with the standard calculator mode.
We don't need to get fancy here.
So we have 212.
Can we subtract 128 from that?
Yes, we can.
And what's the remainder?
It's 84.
Okay.
So we have a one turned on the one bit position in the two raised to the seventh.
So now to raise to the six is 64.
If we subtract that, we get 20.
So we have a one in the position of 128.
We have a one in the position of 64.
We have 20 left over.
We cannot subtract 32 from 20, but we can subtract 16 from 20.
If I subtract 16 from 20, it gives us the remainder of four.
So we have as one in the 16 position, we have a zero in the eight position, we have a one in the four
position and then we have a zero in the two position and a zero in the one position.
So the 212 in binary works out to 11010100.
Can we test that?
We sure can.
So I grabbed the scientific calculator, or I can grab the programmer calculator.
It's easier.
And I will say I want to enter in binary
11010100
and that gives us 212.
So we just checked our math there.
That is great.
So we can now look at an IP address in a whole different way.
Gateway We know that 1921681 100 equates to the underlying binary, and we could even calculate what
that underlying binary is.
And that is pretty cool.
And we could go the other direction as well.
Now, subnet masks, remember, there's default subnet masks for the original address classes that were
defined.
They had originally said, okay, let's make a default mask for Class A in two, five, five and then
000.
That's eight bits.
Notice the prefix notation, eight bits of masking.
If we do 255255, that's 16 bits of masking and 24 bits of masking with that 2552552550.
So here's the thing.
As we extend the size of the subnet mask, we reduce the number of nodes we can support per network.
So that's the big balancing act that you're playing with subnet masks.
The more bits you have to use to identify the network, the less bits you have left over to identify
hosts.
So now let's check out an example of an IP address and a subnet mask and let's figure out the prefix
notation for that mask.
So here we can see 255255255, 224.
So we have eight bits of on bits in the first octet and then we have eight bits of on bits in the next
octet.
Then we have eight bits of on bits in the third octet.
So that's eight plus eight plus eight, that's 24 bits.
But then to 24, how many bits are on for the two.
24.
Well it sure looks like three bits are being utilised there to give us that number 224.
And in fact, that makes sense from our table, doesn't it?
The two raised to the seventh was 128, the two raised to the sixth was the 64 and the two raised to
the fifth was the 32.
If you add 128 plus 64 plus 32, I do believe.
Let me do that on my scratch paper.
128 plus 64 plus 32.
That is 14 carry the one that is nine and then 12 carry the 1 to 24.
So 128, 64 and 32.
Those three bits give us the 224 value.
This is a slash 27 mask.
Now if you are brand new to something like this.
First of all, you do have your work cut out for you.
You definitely want to go and study this intently.
But just to let you know, you're always going to have a way to check your work.
Right.
So that's what's great about this.
So we were just looking in the example where we had an IP address and then we had the 255255 224 in
the last octet.
And I said that it was a slash 27 mask that would result.
And notice we can go ahead and confirm that with any good old IP subnet calculator that we might find
floating around the interweb.
Now again, remember, this is a fast paced review of this material.
If this is something you need to go back and study, that is just fine.
Don't be ashamed by any of this.
That may be foggy or fuzzy and you need to go back and you need to learn this stuff.
Let's talk more about those address classes.
So what they did to create the address classes was they just forced the initial bit settings.
So they said the initial bit setting of the address, the IP address itself, forget the subnet mask.
Now we're talking about the IP address itself.
If it's forced to a zero at the very first octet, well then this will make for the address classes
of class AA, which is 1 to 127.
127 is actually unusable.
They reserved that for loopback purposes.
So it's really 1 to 126.
Then they did the class B, it's forced to the one zero high order bit setting.
And this gives us addresses numbered 128 to 191 in the first octet, class C was a high order bit setting
of 110, which gave us 192 to 223 and class d1110 224 two 239.
What is the Class D for?
Why don't you see those on your IP address primary?
You know, Nic often.
Well, it's because those are for multicast addressing and multicast addresses.
They are going to be assigned to your network interface card.
But when some application most likely is subscribing to receive a multicast feed, then it will dynamically
start listening on one of those multicast IP addresses.
So multicast a very interesting area of IP.
All right.
So how about some netting?
Well, take a look at this scenario.
We have the ten .0.0.0 network.
It would normally have the Class a/8, but we do four bits of sub netting, so we end up having a slash
12 and that equates to 255 to 40 zero zero for the subnet mask.
What this means is if we're using two bits for some netting, well then the four bits that we're using
for subletting plugs into our formula as to raise to the four.
And that's going to give us 16 subnets that we could work with.
Now if we are using 16 ah excuse me, if we are using four bits for sub netting.
Right.
So we're using the four bits of sub netting plus the eight bits in the first octet for that subnet mask.
So we're using the 12 bits total for the network addressing well if there's 32 bits in the address and
we're using 12 of those for identifying the network, then that's going to leave 20 bits for host addressing
plugging 20 into our formula of two raised to the X, we get over a million hosts per subnet.
Isn't that amazing?
And you need a calculator to figure out that number.
Notice the minus two when you're calculating the hosts per subnet.
That's because no host can have an all zeros or an all one's host address.
Those are reserved for network ID and the broadcast on that subnet.
So interesting there.
We'd need a calculator to figure out the host for subnet.
What would the subnets look like.
Will they would increment on that number 16.
Yeah.
So we saw that the 16 subnets that we could create.
Yeah.
They increment on that number 16, it's what we call the block size.
So you'd have ten 000 1016 zero zero 1030 200.
Yeah.
And that would be your subnets.
So cool.
Now there is another type of sub netting question that we should be able to answer pretty easily, and
that is if we have 1921681024 and we need to create six subnets.
Well, if we steal or borrow three bits, we can create eight additional subnets.
That's two to the three.
If we're borrowing the three bits.
So if they needed six, we can give them eight.
That's great.
They'll have more than they need.
And notice the subnets are going to be shown below there.
We're going to borrow the three bits, so we'll have the slash 27 mask and then we'll be incrementing
here on 32 because we go three bits deep in to our conversion chart and we have a block size of 32.
So it's zero 32, 64, 96, one, 28, 160, and there would be eight of these.
But I just bothered to list the six that they need.
But notice there would be two additional subnets that, hey, we may need in the future.
So these are the types of examples.
These are the types of things you need to know about IP addresses backwards, forwards, inside and
out.
And again, this is a very fast paced review of what you need to know.
You can certainly chat with me if you are struggling to find additional education in this area.
But like I said, it's all over the place because all aspects of information technology folks should
really know this.
By the way, let's think about public versus private for a moment.
So we have all of these private devices, as you can see here, with their private addressing of 192168.
That's great.
But we do need a public IP address still and we know that network address translation is what will allow
all these devices to have their addresses translated into the public IP for communication on the public
internet.
So one of the big things that you also should have committed to memory is what are those private address
spaces?
What are those IPv4 address spaces that cannot communicate by themselves on the public Internet that
need translation?
There's three classes of them defined in the famous requests for comment.
1918.
So requests for comments 1918 is something else that I have memorized the title for sure.
And they reserved all of the ten slash eight.
They reserved the one 7216 slash 12.
That gives us one 7216 to 172, 31 to 50 5 to 55.
And they reserved the 192.
168 slash 16, which gives us 1921682192168255255.
Now, what you often see in practice is that for large corporations they'll use the tender space because
they want a ton of address space in their corporation.
Medium sized companies tend to use one 7216, and you've seen it plenty of times.
When do ISP's set up their little home routers to do?
Yeah.
Disseminate the smallest address spaces the 1921681 or the 1921680 or the 192168 ten.
So they'll use that class C address space for the private addressing.
Well, I hope you enjoyed that.
Just blazingly fast kind of review of key IP addressing concepts.
Again, make sure that you understand IP addressing backwards, forwards, inside and out.