WEBVTT

00:00.750 --> 00:10.200
Well, here it is, a quick crash course review in IP addressing topics that it is assumed knowledge

00:10.500 --> 00:20.790
for someone like you who's going to be a pen tester or a cybersecurity analysts or just a any kind of

00:20.790 --> 00:23.700
cyber and security combination.

00:24.030 --> 00:30.450
So IP addressing is just stuff we have to know backwards, forwards, inside and out.

00:30.930 --> 00:41.760
And remember, it all comes down to binary where we have eight bits and an IPV four address has 32 of

00:41.760 --> 00:45.840
these bits and it has a 32 bit subnet mask.

00:46.080 --> 00:54.540
And those bits are used in combination to determine if you're on the same network with another node.

00:54.870 --> 01:01.140
So I will walk you through the calculations.

01:01.140 --> 01:04.170
And just again, a real crash course.

01:04.530 --> 01:07.710
But if you don't know this stuff, now is the time.

01:07.710 --> 01:12.780
You absolutely have to learn this stuff backwards, forwards, inside and out.

01:13.230 --> 01:18.510
So if you don't have access to curriculum, you'd want to start turning to something like YouTube for

01:18.510 --> 01:21.360
sure, and you'd want to start watching.

01:21.750 --> 01:28.500
I don't even have to search an IP address ENG or IP subnet NG or any of these topics in YouTube to know

01:28.680 --> 01:32.610
there's going to be thousands of videos on the subject there.

01:32.850 --> 01:39.690
You have to learn this stuff, get this stuff, learn if any of this review is foreign to you.

01:40.230 --> 01:50.370
Now, what I always do, any time I'm asked to do anything involving subheading or IP address calculations

01:50.370 --> 01:55.170
or anything like that, I always will make on my scratch paper.

01:55.440 --> 02:00.240
And you're always have some kind of note taking capability when you're in an exam.

02:00.480 --> 02:04.200
I will make a conversion chart that looks just like this.

02:04.560 --> 02:14.640
It is the values of the binary bit positions and it's to raise to the seventh equals 128 and notice

02:14.640 --> 02:17.120
it goes to raised to the zero is one.

02:17.130 --> 02:20.700
This table is so incredibly easy to complete.

02:21.480 --> 02:28.050
So, you know, we just know that two raised to the zero is the value of one because anything raised

02:28.050 --> 02:31.230
to the value of zero is equal to one.

02:31.650 --> 02:33.970
And once you know that, you just double it.

02:33.990 --> 02:41.700
One, two, four, eight, 16, 32, 64 and one take the appropriate to raise to the whatever values

02:41.700 --> 02:44.970
are in the first layer there or table row.

02:45.000 --> 02:45.440
That's it.

02:45.450 --> 02:45.980
That's it.

02:45.990 --> 02:46.680
It's a row.

02:46.980 --> 02:53.970
The first row of my conversion chart notice is those two raised to the whatever values and those come

02:53.970 --> 02:59.850
in handy later on when we're actually doing sub netting, for example.

03:00.510 --> 03:11.850
So the conversion chart in action, that binary address that we saw earlier, that 11001101 address,

03:12.300 --> 03:20.860
well that would convert to in decimal 128 plus 64 plus eight plus four plus one.

03:21.150 --> 03:23.190
Let me pause the video and do that math.

03:24.000 --> 03:27.990
Well, I think the answer is 205.

03:27.990 --> 03:29.400
And let me make sure that.

03:29.400 --> 03:29.810
Right.

03:29.820 --> 03:31.800
Let me grab the calculator.

03:32.070 --> 03:39.930
And if I go to the calculator, oh, in fact, we can even set it to scientific or programmer.

03:40.230 --> 03:51.960
And if I send it to programmer and say that I want to enter this in binary, so I say 110011.

03:52.940 --> 03:54.710
And then zero one.

03:56.150 --> 03:59.540
And notice we see it in decimal 205.

03:59.780 --> 04:00.720
So that's great.

04:00.740 --> 04:02.780
I just confirmed that my.

04:03.230 --> 04:07.340
I'll lower that calculator and keep it on our taskbar.

04:07.490 --> 04:12.320
We may need it again, but there's the proof of my manual addition.

04:12.590 --> 04:17.450
128 plus 64 plus eight plus four plus one does indeed.

04:17.530 --> 04:19.760
Two's equal, 205.

04:19.970 --> 04:23.300
And that's the decimal value of that octet.

04:23.660 --> 04:28.190
Now, what if we were asked, what is 212 in binary?

04:28.400 --> 04:34.010
Well, now we have to play a little subtraction game and that goes basically like this.

04:34.760 --> 04:40.970
Can we take 128 from 212 and not go into the negative?

04:41.270 --> 04:43.820
And the answer to that is, yes, we can.

04:44.120 --> 04:46.040
So we go ahead and do that.

04:46.040 --> 04:52.700
Subtraction 212, 128, rather, from 212.

04:53.030 --> 04:53.570
All right.

04:53.570 --> 04:54.560
Let me do this.

04:54.590 --> 04:56.390
Gosh, I'm doing this on paper.

04:56.400 --> 04:57.260
You can't see it.

04:57.260 --> 04:59.960
I know this is making for exciting television, isn't it?

05:00.320 --> 05:02.660
But let me just try and do this real quick.

05:05.330 --> 05:12.970
So we have oh my gosh, I suck at basic arithmetic.

05:12.980 --> 05:16.490
Now let me grab the calculator and just cheat.

05:17.000 --> 05:18.410
But you see what I'm doing, right?

05:18.410 --> 05:27.670
You're doing a big subtraction problem and you're getting it to where the remainder is going to be zero.

05:27.980 --> 05:30.260
So let me go with the standard calculator mode.

05:30.260 --> 05:31.640
We don't need to get fancy here.

05:31.850 --> 05:33.980
So we have 212.

05:34.220 --> 05:36.920
Can we subtract 128 from that?

05:36.920 --> 05:38.210
Yes, we can.

05:38.300 --> 05:39.740
And what's the remainder?

05:39.860 --> 05:40.910
It's 84.

05:41.210 --> 05:41.600
Okay.

05:41.600 --> 05:47.360
So we have a one turned on the one bit position in the two raised to the seventh.

05:47.690 --> 05:50.180
So now to raise to the six is 64.

05:50.180 --> 05:54.710
If we subtract that, we get 20.

05:55.040 --> 05:58.580
So we have a one in the position of 128.

05:58.580 --> 06:01.100
We have a one in the position of 64.

06:01.370 --> 06:02.930
We have 20 left over.

06:02.930 --> 06:09.350
We cannot subtract 32 from 20, but we can subtract 16 from 20.

06:09.710 --> 06:13.340
If I subtract 16 from 20, it gives us the remainder of four.

06:13.340 --> 06:22.550
So we have as one in the 16 position, we have a zero in the eight position, we have a one in the four

06:22.550 --> 06:27.710
position and then we have a zero in the two position and a zero in the one position.

06:28.010 --> 06:36.740
So the 212 in binary works out to 11010100.

06:36.920 --> 06:38.210
Can we test that?

06:38.390 --> 06:39.290
We sure can.

06:39.530 --> 06:44.360
So I grabbed the scientific calculator, or I can grab the programmer calculator.

06:44.360 --> 06:45.050
It's easier.

06:45.350 --> 06:48.500
And I will say I want to enter in binary

06:48.800 --> 06:55.520
11010100

06:55.760 --> 06:58.580
and that gives us 212.

06:58.820 --> 07:01.040
So we just checked our math there.

07:01.280 --> 07:02.750
That is great.

07:03.200 --> 07:09.430
So we can now look at an IP address in a whole different way.

07:09.430 --> 07:19.790
Gateway We know that 1921681 100 equates to the underlying binary, and we could even calculate what

07:19.790 --> 07:22.340
that underlying binary is.

07:22.880 --> 07:24.620
And that is pretty cool.

07:24.800 --> 07:26.660
And we could go the other direction as well.

07:27.290 --> 07:34.580
Now, subnet masks, remember, there's default subnet masks for the original address classes that were

07:34.580 --> 07:35.240
defined.

07:35.780 --> 07:41.660
They had originally said, okay, let's make a default mask for Class A in two, five, five and then

07:41.660 --> 07:42.740
000.

07:42.740 --> 07:44.390
That's eight bits.

07:44.390 --> 07:49.130
Notice the prefix notation, eight bits of masking.

07:49.670 --> 07:59.750
If we do 255255, that's 16 bits of masking and 24 bits of masking with that 2552552550.

08:00.350 --> 08:01.940
So here's the thing.

08:02.390 --> 08:12.440
As we extend the size of the subnet mask, we reduce the number of nodes we can support per network.

08:12.590 --> 08:16.910
So that's the big balancing act that you're playing with subnet masks.

08:17.240 --> 08:24.320
The more bits you have to use to identify the network, the less bits you have left over to identify

08:24.410 --> 08:25.040
hosts.

08:26.410 --> 08:34.060
So now let's check out an example of an IP address and a subnet mask and let's figure out the prefix

08:34.060 --> 08:35.980
notation for that mask.

08:36.460 --> 08:40.540
So here we can see 255255255, 224.

08:40.630 --> 08:49.240
So we have eight bits of on bits in the first octet and then we have eight bits of on bits in the next

08:49.240 --> 08:49.680
octet.

08:49.690 --> 08:53.830
Then we have eight bits of on bits in the third octet.

08:54.160 --> 08:57.940
So that's eight plus eight plus eight, that's 24 bits.

08:58.120 --> 09:03.010
But then to 24, how many bits are on for the two.

09:03.010 --> 09:03.730
24.

09:03.820 --> 09:09.970
Well it sure looks like three bits are being utilised there to give us that number 224.

09:10.180 --> 09:13.480
And in fact, that makes sense from our table, doesn't it?

09:13.840 --> 09:25.060
The two raised to the seventh was 128, the two raised to the sixth was the 64 and the two raised to

09:25.060 --> 09:27.880
the fifth was the 32.

09:28.060 --> 09:32.650
If you add 128 plus 64 plus 32, I do believe.

09:32.650 --> 09:34.300
Let me do that on my scratch paper.

09:34.540 --> 09:37.990
128 plus 64 plus 32.

09:38.650 --> 09:47.110
That is 14 carry the one that is nine and then 12 carry the 1 to 24.

09:47.350 --> 09:50.200
So 128, 64 and 32.

09:50.380 --> 09:53.290
Those three bits give us the 224 value.

09:53.500 --> 09:56.650
This is a slash 27 mask.

09:58.430 --> 10:01.440
Now if you are brand new to something like this.

10:02.480 --> 10:06.110
First of all, you do have your work cut out for you.

10:06.140 --> 10:08.840
You definitely want to go and study this intently.

10:08.840 --> 10:13.010
But just to let you know, you're always going to have a way to check your work.

10:13.370 --> 10:13.710
Right.

10:13.730 --> 10:15.600
So that's what's great about this.

10:15.610 --> 10:25.790
So we were just looking in the example where we had an IP address and then we had the 255255 224 in

10:25.790 --> 10:26.840
the last octet.

10:27.080 --> 10:32.750
And I said that it was a slash 27 mask that would result.

10:32.990 --> 10:40.790
And notice we can go ahead and confirm that with any good old IP subnet calculator that we might find

10:40.790 --> 10:42.560
floating around the interweb.

10:43.540 --> 10:49.000
Now again, remember, this is a fast paced review of this material.

10:49.210 --> 10:55.100
If this is something you need to go back and study, that is just fine.

10:55.120 --> 10:57.100
Don't be ashamed by any of this.

10:57.100 --> 11:01.390
That may be foggy or fuzzy and you need to go back and you need to learn this stuff.

11:01.870 --> 11:04.100
Let's talk more about those address classes.

11:04.120 --> 11:12.130
So what they did to create the address classes was they just forced the initial bit settings.

11:12.340 --> 11:18.100
So they said the initial bit setting of the address, the IP address itself, forget the subnet mask.

11:18.100 --> 11:20.300
Now we're talking about the IP address itself.

11:20.920 --> 11:27.850
If it's forced to a zero at the very first octet, well then this will make for the address classes

11:27.880 --> 11:32.690
of class AA, which is 1 to 127.

11:33.100 --> 11:36.280
127 is actually unusable.

11:36.280 --> 11:38.500
They reserved that for loopback purposes.

11:38.830 --> 11:41.290
So it's really 1 to 126.

11:41.890 --> 11:47.200
Then they did the class B, it's forced to the one zero high order bit setting.

11:47.200 --> 11:54.790
And this gives us addresses numbered 128 to 191 in the first octet, class C was a high order bit setting

11:54.790 --> 12:02.290
of 110, which gave us 192 to 223 and class d1110 224 two 239.

12:02.800 --> 12:04.570
What is the Class D for?

12:04.930 --> 12:09.340
Why don't you see those on your IP address primary?

12:09.340 --> 12:10.720
You know, Nic often.

12:10.720 --> 12:16.660
Well, it's because those are for multicast addressing and multicast addresses.

12:16.900 --> 12:20.920
They are going to be assigned to your network interface card.

12:21.130 --> 12:29.410
But when some application most likely is subscribing to receive a multicast feed, then it will dynamically

12:29.410 --> 12:32.800
start listening on one of those multicast IP addresses.

12:33.040 --> 12:37.270
So multicast a very interesting area of IP.

12:38.260 --> 12:38.770
All right.

12:38.770 --> 12:40.630
So how about some netting?

12:40.870 --> 12:42.880
Well, take a look at this scenario.

12:43.180 --> 12:46.780
We have the ten .0.0.0 network.

12:46.900 --> 12:55.480
It would normally have the Class a/8, but we do four bits of sub netting, so we end up having a slash

12:55.480 --> 13:01.480
12 and that equates to 255 to 40 zero zero for the subnet mask.

13:02.080 --> 13:09.850
What this means is if we're using two bits for some netting, well then the four bits that we're using

13:09.850 --> 13:14.890
for subletting plugs into our formula as to raise to the four.

13:14.890 --> 13:18.490
And that's going to give us 16 subnets that we could work with.

13:19.150 --> 13:27.070
Now if we are using 16 ah excuse me, if we are using four bits for sub netting.

13:27.130 --> 13:27.520
Right.

13:28.000 --> 13:36.040
So we're using the four bits of sub netting plus the eight bits in the first octet for that subnet mask.

13:36.280 --> 13:46.720
So we're using the 12 bits total for the network addressing well if there's 32 bits in the address and

13:46.720 --> 13:55.090
we're using 12 of those for identifying the network, then that's going to leave 20 bits for host addressing

13:55.570 --> 14:06.310
plugging 20 into our formula of two raised to the X, we get over a million hosts per subnet.

14:06.640 --> 14:07.930
Isn't that amazing?

14:07.930 --> 14:10.390
And you need a calculator to figure out that number.

14:10.660 --> 14:14.200
Notice the minus two when you're calculating the hosts per subnet.

14:14.530 --> 14:21.040
That's because no host can have an all zeros or an all one's host address.

14:21.310 --> 14:25.900
Those are reserved for network ID and the broadcast on that subnet.

14:26.380 --> 14:28.000
So interesting there.

14:28.000 --> 14:31.030
We'd need a calculator to figure out the host for subnet.

14:31.780 --> 14:33.880
What would the subnets look like.

14:33.880 --> 14:37.750
Will they would increment on that number 16.

14:37.990 --> 14:38.440
Yeah.

14:38.860 --> 14:45.160
So we saw that the 16 subnets that we could create.

14:45.160 --> 14:45.530
Yeah.

14:45.550 --> 14:49.660
They increment on that number 16, it's what we call the block size.

14:49.930 --> 14:56.320
So you'd have ten 000 1016 zero zero 1030 200.

14:56.380 --> 14:56.710
Yeah.

14:56.710 --> 14:59.380
And that would be your subnets.

14:59.950 --> 15:00.790
So cool.

15:01.830 --> 15:09.780
Now there is another type of sub netting question that we should be able to answer pretty easily, and

15:09.780 --> 15:17.310
that is if we have 1921681024 and we need to create six subnets.

15:17.670 --> 15:24.270
Well, if we steal or borrow three bits, we can create eight additional subnets.

15:24.360 --> 15:25.800
That's two to the three.

15:26.040 --> 15:27.750
If we're borrowing the three bits.

15:28.170 --> 15:30.960
So if they needed six, we can give them eight.

15:31.410 --> 15:32.050
That's great.

15:32.070 --> 15:33.810
They'll have more than they need.

15:33.930 --> 15:38.910
And notice the subnets are going to be shown below there.

15:39.060 --> 15:47.460
We're going to borrow the three bits, so we'll have the slash 27 mask and then we'll be incrementing

15:47.460 --> 15:58.060
here on 32 because we go three bits deep in to our conversion chart and we have a block size of 32.

15:58.320 --> 16:05.370
So it's zero 32, 64, 96, one, 28, 160, and there would be eight of these.

16:05.550 --> 16:08.640
But I just bothered to list the six that they need.

16:09.000 --> 16:16.200
But notice there would be two additional subnets that, hey, we may need in the future.

16:16.950 --> 16:20.850
So these are the types of examples.

16:20.850 --> 16:27.660
These are the types of things you need to know about IP addresses backwards, forwards, inside and

16:27.660 --> 16:28.140
out.

16:28.530 --> 16:33.930
And again, this is a very fast paced review of what you need to know.

16:34.230 --> 16:40.080
You can certainly chat with me if you are struggling to find additional education in this area.

16:40.090 --> 16:46.560
But like I said, it's all over the place because all aspects of information technology folks should

16:46.560 --> 16:47.460
really know this.

16:48.390 --> 16:53.130
By the way, let's think about public versus private for a moment.

16:53.550 --> 17:01.690
So we have all of these private devices, as you can see here, with their private addressing of 192168.

17:01.710 --> 17:02.340
That's great.

17:02.670 --> 17:10.890
But we do need a public IP address still and we know that network address translation is what will allow

17:10.890 --> 17:17.850
all these devices to have their addresses translated into the public IP for communication on the public

17:17.850 --> 17:18.300
internet.

17:18.600 --> 17:25.650
So one of the big things that you also should have committed to memory is what are those private address

17:25.650 --> 17:26.280
spaces?

17:26.550 --> 17:34.230
What are those IPv4 address spaces that cannot communicate by themselves on the public Internet that

17:34.230 --> 17:35.760
need translation?

17:36.240 --> 17:41.070
There's three classes of them defined in the famous requests for comment.

17:41.100 --> 17:42.000
1918.

17:42.450 --> 17:48.150
So requests for comments 1918 is something else that I have memorized the title for sure.

17:48.480 --> 17:51.150
And they reserved all of the ten slash eight.

17:51.750 --> 17:55.440
They reserved the one 7216 slash 12.

17:55.560 --> 18:00.870
That gives us one 7216 to 172, 31 to 50 5 to 55.

18:01.170 --> 18:02.800
And they reserved the 192.

18:02.820 --> 18:09.900
168 slash 16, which gives us 1921682192168255255.

18:10.530 --> 18:18.000
Now, what you often see in practice is that for large corporations they'll use the tender space because

18:18.000 --> 18:21.270
they want a ton of address space in their corporation.

18:21.690 --> 18:26.670
Medium sized companies tend to use one 7216, and you've seen it plenty of times.

18:26.820 --> 18:30.330
When do ISP's set up their little home routers to do?

18:30.570 --> 18:30.860
Yeah.

18:30.900 --> 18:39.450
Disseminate the smallest address spaces the 1921681 or the 1921680 or the 192168 ten.

18:39.750 --> 18:44.850
So they'll use that class C address space for the private addressing.

18:45.570 --> 18:47.460
Well, I hope you enjoyed that.

18:47.760 --> 18:52.770
Just blazingly fast kind of review of key IP addressing concepts.

18:53.040 --> 19:00.480
Again, make sure that you understand IP addressing backwards, forwards, inside and out.
