1 00:00:00,000 --> 00:00:00,500 2 00:00:00,500 --> 00:00:03,210 I'd like you to imagine that a friend walks up to you 3 00:00:03,210 --> 00:00:05,880 and in casual conversation they ask you, 4 00:00:05,880 --> 00:00:07,920 can you tell me, says your friend, 5 00:00:07,920 --> 00:00:10,770 about a mask exactly what it does? 6 00:00:10,770 --> 00:00:13,420 Now if you're saying, oh, Keith, I know, I know. 7 00:00:13,420 --> 00:00:18,000 It absolutely identifies out of an IP version 4 address, 8 00:00:18,000 --> 00:00:22,920 it identifies which portion of that IP address is the network, 9 00:00:22,920 --> 00:00:27,040 and everything else beyond that is the actual host addresses. 10 00:00:27,040 --> 00:00:29,010 So here, my friend, are the details 11 00:00:29,010 --> 00:00:32,759 behind how the mask identifies which portion of an IP address 12 00:00:32,759 --> 00:00:33,820 is the network. 13 00:00:33,820 --> 00:00:35,974 So I ran IP config on my Windows machine, 14 00:00:35,974 --> 00:00:37,140 and this is what it gave me. 15 00:00:37,140 --> 00:00:41,070 It said my IP address is 192.168.1.15. 16 00:00:41,070 --> 00:00:42,120 Fantastic. 17 00:00:42,120 --> 00:00:46,270 So I broke that into binary just for display purposes. 18 00:00:46,270 --> 00:00:49,860 And the first number of 192, I put in red in binary here. 19 00:00:49,860 --> 00:00:52,050 168, right here in blue. 20 00:00:52,050 --> 00:00:54,570 The one in green, and the 15. 21 00:00:54,570 --> 00:00:57,600 So there's the decimal notation that we normally use, 22 00:00:57,600 --> 00:01:00,390 and the binary equivalent of each one of those. 23 00:01:00,390 --> 00:01:03,000 Now what I'd like to do is talk about the mask. 24 00:01:03,000 --> 00:01:08,910 There is also a 32-bit mask associated with each IP version 25 00:01:08,910 --> 00:01:09,960 4 address. 26 00:01:09,960 --> 00:01:12,270 So on the output of IP config up here 27 00:01:12,270 --> 00:01:14,610 it says that my mask, and that also brings me 28 00:01:14,610 --> 00:01:16,770 to a point of nicknames. 29 00:01:16,770 --> 00:01:19,830 For example, sometimes it's referred to as the mask. 30 00:01:19,830 --> 00:01:22,950 Sometimes it's referred to as the network mask. 31 00:01:22,950 --> 00:01:25,450 Sometimes it's referred to as the subnet mask. 32 00:01:25,450 --> 00:01:28,830 But any way you slice it, when we're talking about IP version 33 00:01:28,830 --> 00:01:34,200 4, it's referring to this device that identifies which portion, 34 00:01:34,200 --> 00:01:38,280 going from left to right, which portion of that IP address 35 00:01:38,280 --> 00:01:41,280 is the network, and which remaining portion is 36 00:01:41,280 --> 00:01:43,080 available for host addressing. 37 00:01:43,080 --> 00:01:44,520 So this is how it does it. 38 00:01:44,520 --> 00:01:49,090 That 32-bit mask is also represented in dotted decimal. 39 00:01:49,090 --> 00:01:50,520 So I have the mask right here. 40 00:01:50,520 --> 00:01:53,890 There's 255.255.255.0. 41 00:01:53,890 --> 00:01:57,390 So that's the mask literally off of the computer that I'm using. 42 00:01:57,390 --> 00:02:00,630 For display purposes, I converted the mask octets 43 00:02:00,630 --> 00:02:01,920 into binary. 44 00:02:01,920 --> 00:02:06,660 So there's the first 255, and the second 255, the third 255, 45 00:02:06,660 --> 00:02:08,910 and of course, this last octet of all zeros 46 00:02:08,910 --> 00:02:11,610 represents that decimal 0 right there. 47 00:02:11,610 --> 00:02:12,930 So here's the magic. 48 00:02:12,930 --> 00:02:16,200 The computer lines up all the bits 49 00:02:16,200 --> 00:02:20,370 of the actual IP address with those same bits in the mask as 50 00:02:20,370 --> 00:02:21,640 shown here. 51 00:02:21,640 --> 00:02:23,340 And so here's what the mask does. 52 00:02:23,340 --> 00:02:25,530 We simply follow the bits that are on. 53 00:02:25,530 --> 00:02:27,510 The bits that are on in the mask is 54 00:02:27,510 --> 00:02:31,750 representing which portion of the IP address is the network. 55 00:02:31,750 --> 00:02:34,830 So if we simply follow the mask and the bits that are on, 56 00:02:34,830 --> 00:02:36,930 and then stop when they stop, which in this case 57 00:02:36,930 --> 00:02:39,130 happens to be right here, that my friends, 58 00:02:39,130 --> 00:02:40,290 is the dividing line. 59 00:02:40,290 --> 00:02:42,960 Everything to the left is the network, 60 00:02:42,960 --> 00:02:46,870 and everything to the right is the actual host portion. 61 00:02:46,870 --> 00:02:49,470 So in this case, we could say that my computer is 62 00:02:49,470 --> 00:02:54,150 on network 192.168.1, the first three octets, 63 00:02:54,150 --> 00:02:58,410 and that my host address is .15 on that network. 64 00:02:58,410 --> 00:03:00,120 The way it actually determines this 65 00:03:00,120 --> 00:03:02,070 is by doing some multiplication. 66 00:03:02,070 --> 00:03:04,170 It multiplies the bit in the mask 67 00:03:04,170 --> 00:03:06,280 against the corresponding bit in the IP address, 68 00:03:06,280 --> 00:03:07,950 and if we did that, for example. 69 00:03:07,950 --> 00:03:10,020 1 times 1 equals 1. 70 00:03:10,020 --> 00:03:12,940 and 1 times 1 equals 1, 1 times 0 equals 0. 71 00:03:12,940 --> 00:03:16,260 Effectively, we're going to have the same exact number that we 72 00:03:16,260 --> 00:03:19,020 have up here down below. 73 00:03:19,020 --> 00:03:21,090 And the very last octet, what it's 74 00:03:21,090 --> 00:03:23,580 going to be if you multiply all those by 0, 75 00:03:23,580 --> 00:03:25,780 they're all going to be zero no matter what. 76 00:03:25,780 --> 00:03:28,650 So if we converted this back into decimal, 77 00:03:28,650 --> 00:03:33,900 it would be 192.168.1.0, and that's 78 00:03:33,900 --> 00:03:36,990 how we represent networks inside of IP version 4. 79 00:03:36,990 --> 00:03:39,810 And more specifically, we can put a slash here, and say 80 00:03:39,810 --> 00:03:46,380 24, which literally means that the first 24 bits, 8 bits here, 81 00:03:46,380 --> 00:03:48,420 and 8 bits here, and 8 bits here, 82 00:03:48,420 --> 00:03:52,560 those first consecutive 24 bits, going from left to right, 83 00:03:52,560 --> 00:03:55,470 represent the network, and the last 8 bits 84 00:03:55,470 --> 00:03:57,120 are available for host addresses, 85 00:03:57,120 --> 00:04:00,300 or like house addresses on those streets. 86 00:04:00,300 --> 00:04:02,652 I've got a little exercise I'd like you to do with me, 87 00:04:02,652 --> 00:04:03,360 and that is this. 88 00:04:03,360 --> 00:04:06,867 Let's pretend that this mask isn't this one right here, 89 00:04:06,867 --> 00:04:08,700 so we're going to replace that for a moment. 90 00:04:08,700 --> 00:04:14,030 And let's say that the mask instead is 255.255.0.0. 91 00:04:14,030 --> 00:04:20,399 So the mask in this octet would all be 0, just like that. 92 00:04:20,399 --> 00:04:22,140 And here's my question for you. 93 00:04:22,140 --> 00:04:26,550 Now that we have this mask, what is the actual network address 94 00:04:26,550 --> 00:04:30,270 if this is our mask, and how many bits of the IP address 95 00:04:30,270 --> 00:04:31,890 are being used for network? 96 00:04:31,890 --> 00:04:34,650 And how many bits are now available for host 97 00:04:34,650 --> 00:04:36,850 addressing on that network? 98 00:04:36,850 --> 00:04:39,930 So take a moment right now, go ahead and pause me. 99 00:04:39,930 --> 00:04:41,760 Determine what you think the correct answer 100 00:04:41,760 --> 00:04:44,070 is for the actual network address, 101 00:04:44,070 --> 00:04:46,550 and then we'll compare notes. 102 00:04:46,550 --> 00:04:47,150 Awesome. 103 00:04:47,150 --> 00:04:48,960 Thank you for taking a moment to do that. 104 00:04:48,960 --> 00:04:50,880 So here's how I would look at this. 105 00:04:50,880 --> 00:04:53,630 I'd say, well, we're going to follow the bits in the mask 106 00:04:53,630 --> 00:04:57,500 until they stop, and then you can draw a line, and everything 107 00:04:57,500 --> 00:05:01,080 to the left that is the network, and everything to the right 108 00:05:01,080 --> 00:05:02,850 are the host addresses. 109 00:05:02,850 --> 00:05:06,570 So we could say that with this mask, the network is 192.168, 110 00:05:06,570 --> 00:05:11,690 and then, anything beyond the mask when we're identifying 111 00:05:11,690 --> 00:05:13,490 the network, we just 0 out. 112 00:05:13,490 --> 00:05:18,050 So this is the 192.168.0.0 network slash 16. 113 00:05:18,050 --> 00:05:24,110 It's a 16-bit network, and we have another 16 bits available 114 00:05:24,110 --> 00:05:27,570 for host addresses on that network. 115 00:05:27,570 --> 00:05:29,660 I hope this has been informative for you, 116 00:05:29,660 --> 00:05:32,145 and I'd like to thank you for viewing. 117 00:05:32,145 --> 00:05:32,645