1 00:00:00,090 --> 00:00:00,990 In this lesson, 2 00:00:00,990 --> 00:00:03,960 we're going to discuss IPv4 addressing. 3 00:00:03,960 --> 00:00:06,780 Now, IPv4, or Internet Protocol version 4, 4 00:00:06,780 --> 00:00:09,420 is extremely popular, and it's the most common type 5 00:00:09,420 --> 00:00:11,850 of IP addressing used in our networks. 6 00:00:11,850 --> 00:00:13,740 In fact, if you're like most people, 7 00:00:13,740 --> 00:00:16,470 you've probably seen an IPv4 address before. 8 00:00:16,470 --> 00:00:18,330 When you look at them, they're written as a series 9 00:00:18,330 --> 00:00:21,090 of four decimal numbers separated by dots. 10 00:00:21,090 --> 00:00:23,190 Some examples of an IPv4 address 11 00:00:23,190 --> 00:00:25,800 are things like 10.1.2.3 12 00:00:25,800 --> 00:00:30,330 or 172.21.243.67 13 00:00:30,330 --> 00:00:32,850 As you can see, each IPv4 address 14 00:00:32,850 --> 00:00:35,730 is made up of four different parts to form that address, 15 00:00:35,730 --> 00:00:38,730 and this is why we call it a dotted-decimal notation. 16 00:00:38,730 --> 00:00:39,690 When you're referring to each 17 00:00:39,690 --> 00:00:41,460 of those four parts individually though, 18 00:00:41,460 --> 00:00:43,080 we call these an octet 19 00:00:43,080 --> 00:00:45,510 because each of them is a decimal number that's being used 20 00:00:45,510 --> 00:00:48,540 to represent eight bits of a binary number. 21 00:00:48,540 --> 00:00:50,790 Now, since each octet uses a decimal number 22 00:00:50,790 --> 00:00:53,160 to represent an eight-bit binary number, 23 00:00:53,160 --> 00:00:57,870 each octet can be represented by value of 0 to 255 24 00:00:57,870 --> 00:01:01,350 in each of those four octets of an IPv4 address. 25 00:01:01,350 --> 00:01:03,390 Now, when all four octets are combined, 26 00:01:03,390 --> 00:01:06,330 we get four octets that contain eight bits each 27 00:01:06,330 --> 00:01:09,510 for a total of 32 bits of total addressable space 28 00:01:09,510 --> 00:01:12,000 when using an IPv4 address. 29 00:01:12,000 --> 00:01:14,790 Now, for example, let's say you have the IPv4 address 30 00:01:14,790 --> 00:01:18,810 of 192.168.1.4 31 00:01:18,810 --> 00:01:21,270 That is being written in dotted-decimal notation 32 00:01:21,270 --> 00:01:24,000 to make it easier for you and I as humans to read it, 33 00:01:24,000 --> 00:01:26,640 but to a computer, that actually isn't what it is. 34 00:01:26,640 --> 00:01:29,220 Instead, they understand this as binary, 35 00:01:29,220 --> 00:01:30,580 which is 11000000 36 00:01:33,148 --> 00:01:33,981 .10101000 37 00:01:36,687 --> 00:01:37,520 .00000001 38 00:01:40,455 --> 00:01:41,288 .00000100 39 00:01:44,550 --> 00:01:47,130 Now, as you can see, using the dotted-decimal notation 40 00:01:47,130 --> 00:01:50,310 is a lot easier for us to read out loud and for us to type, 41 00:01:50,310 --> 00:01:52,950 and so it's less prone for us experiencing human error 42 00:01:52,950 --> 00:01:54,060 when we enter those numbers 43 00:01:54,060 --> 00:01:55,800 into our network device configurations, 44 00:01:55,800 --> 00:01:57,450 and it's a lot easier to memorize 45 00:01:57,450 --> 00:02:00,060 the decimal version of this than the binary. 46 00:02:00,060 --> 00:02:02,640 Now, each IPv4 address is actually going to be created 47 00:02:02,640 --> 00:02:05,910 using two portions, which we refer to as the network portion 48 00:02:05,910 --> 00:02:08,370 and the host portion of the address. 49 00:02:08,370 --> 00:02:11,683 So when you get an IP address like 192.168.1.4, 50 00:02:13,413 --> 00:02:15,990 it's actually broken down into these two portions, 51 00:02:15,990 --> 00:02:17,940 the network and the host portion, 52 00:02:17,940 --> 00:02:21,900 by using a second 32-bit number known as a subnet mask. 53 00:02:21,900 --> 00:02:24,600 Now, when you look at a subnet mask in decimal form, 54 00:02:24,600 --> 00:02:27,420 it's going to look a lot like an IPv4 address, 55 00:02:27,420 --> 00:02:29,460 but if you look at it in binary form, 56 00:02:29,460 --> 00:02:31,410 you're going to see there's actually continuous strings 57 00:02:31,410 --> 00:02:33,090 of ones and zeros, 58 00:02:33,090 --> 00:02:35,220 with the ones identifying the network portion 59 00:02:35,220 --> 00:02:37,410 and the zeros identifying the host portion 60 00:02:37,410 --> 00:02:40,890 of that IPv4 address that it's going to be married up with. 61 00:02:40,890 --> 00:02:43,200 For example, let's say I have a subnet mask 62 00:02:43,200 --> 00:02:47,100 of 255.255.255.0 63 00:02:47,100 --> 00:02:49,980 Now, if we converted each of these octets into binary, 64 00:02:49,980 --> 00:02:53,373 we would actually get 11111111. 65 00:02:54,417 --> 00:02:55,250 11111111. 66 00:02:57,856 --> 00:02:58,689 11111111. 67 00:03:01,346 --> 00:03:04,590 00000000 68 00:03:04,590 --> 00:03:07,260 Notice we have three sets of eight ones 69 00:03:07,260 --> 00:03:10,500 and then one set of eight zeros in our binary form 70 00:03:10,500 --> 00:03:15,500 to represent the decimal equivalent of 255.255.255.0 71 00:03:16,170 --> 00:03:19,140 Now, when you look at that subnet mask, and you see a one 72 00:03:19,140 --> 00:03:21,360 in that binary representation of the subnet mask, 73 00:03:21,360 --> 00:03:25,020 this becomes the network portion of the IPv4 address. 74 00:03:25,020 --> 00:03:27,300 If you see a zero in the binary representation 75 00:03:27,300 --> 00:03:29,970 of the subnet mask, this becomes the host portion 76 00:03:29,970 --> 00:03:31,800 of the IPv4 address. 77 00:03:31,800 --> 00:03:35,580 So let's put this together by showing both the IPv4 address 78 00:03:35,580 --> 00:03:37,650 and its associated subnet mask. 79 00:03:37,650 --> 00:03:42,650 First, we have our IPv4 address of 192.168.1.4 80 00:03:43,170 --> 00:03:45,480 Next, we have our subnet mask underneath it 81 00:03:45,480 --> 00:03:49,290 of 255.255.255.0 82 00:03:49,290 --> 00:03:53,280 Now, anytime I see a 255 in my decimal representation, 83 00:03:53,280 --> 00:03:56,520 this is representing all ones if we converted it to binary, 84 00:03:56,520 --> 00:03:58,470 so it becomes part of that network portion 85 00:03:58,470 --> 00:04:00,150 of the IPv4 address. 86 00:04:00,150 --> 00:04:03,720 So in this case, the 192.168.1 87 00:04:03,720 --> 00:04:05,880 is our network portion of the address. 88 00:04:05,880 --> 00:04:07,710 Anytime I see an IPv4 address 89 00:04:07,710 --> 00:04:11,280 that starts with 192.168.1.something, 90 00:04:11,280 --> 00:04:12,780 this means that it's addressable 91 00:04:12,780 --> 00:04:15,600 as part of this local network because all those things 92 00:04:15,600 --> 00:04:18,060 are going to be part of this network portion. 93 00:04:18,060 --> 00:04:20,550 Now, everywhere I see those zeros in the subnet mask, 94 00:04:20,550 --> 00:04:22,410 this actually represents the host portion 95 00:04:22,410 --> 00:04:24,330 of the IPv4 address. 96 00:04:24,330 --> 00:04:27,450 In this case, that's the .4 portion of the address 97 00:04:27,450 --> 00:04:31,500 of 192.168.1.4 that we had before. 98 00:04:31,500 --> 00:04:34,620 And that .4 is going to represent this specific host, 99 00:04:34,620 --> 00:04:37,080 like a server, a desktop, a laptop, 100 00:04:37,080 --> 00:04:39,960 a tablet, a printer, or any other network device 101 00:04:39,960 --> 00:04:42,750 that was assigned this IPv4 address. 102 00:04:42,750 --> 00:04:47,750 So if I have an address like 192.168.1.50 103 00:04:47,910 --> 00:04:51,960 with a subnet 255.255.255.0, 104 00:04:51,960 --> 00:04:54,060 that device is on the same network 105 00:04:54,060 --> 00:04:57,480 as our 192.168.1.4 device, 106 00:04:57,480 --> 00:04:59,790 and they can communicate to each other using a switch, 107 00:04:59,790 --> 00:05:01,110 and we wouldn't even have to use a router 108 00:05:01,110 --> 00:05:02,940 because they're on the same network. 109 00:05:02,940 --> 00:05:05,310 This means our switch will transfer data back and forth 110 00:05:05,310 --> 00:05:08,370 between these two devices using just their MAC addresses, 111 00:05:08,370 --> 00:05:09,870 and we're not going to have to route traffic 112 00:05:09,870 --> 00:05:12,330 using a router between these two devices. 113 00:05:12,330 --> 00:05:17,330 Now, on the other hand, if I had a device like 172.16.0.100 114 00:05:17,490 --> 00:05:21,600 with a subnet mask of 255.255.255.0, 115 00:05:21,600 --> 00:05:24,420 this tells me that that device is on a different network, 116 00:05:24,420 --> 00:05:29,160 and specifically, it's on the 172.16.0.something network. 117 00:05:29,160 --> 00:05:31,020 So we're not going to be able to communicate 118 00:05:31,020 --> 00:05:35,070 with the original device at 192.168.1.4 119 00:05:35,070 --> 00:05:37,560 without leaving its network, routing the traffic 120 00:05:37,560 --> 00:05:41,550 to this new network of 172.16.0.something, 121 00:05:41,550 --> 00:05:43,530 and that way you have to do that using a router 122 00:05:43,530 --> 00:05:46,680 or a layer 3 switch to make that routing happen. 123 00:05:46,680 --> 00:05:48,600 Now, if this doesn't quite make sense yet, 124 00:05:48,600 --> 00:05:50,400 don't worry too much about it right now 125 00:05:50,400 --> 00:05:51,840 because we're going to dive much deeper 126 00:05:51,840 --> 00:05:54,780 into both subnetting and routing in their own lessons 127 00:05:54,780 --> 00:05:57,600 because we have barely scratched the surface so far. 128 00:05:57,600 --> 00:05:59,040 Now, the next thing we need to talk about 129 00:05:59,040 --> 00:06:01,830 is that it's important to realize that IPv4 addresses 130 00:06:01,830 --> 00:06:03,540 are going to be broken down into classes 131 00:06:03,540 --> 00:06:05,820 or groupings of ranges that can be used, 132 00:06:05,820 --> 00:06:09,090 and each class has its own default subnet mask. 133 00:06:09,090 --> 00:06:11,250 Each class is going to be identified by a letter, 134 00:06:11,250 --> 00:06:12,690 and there are five classes, 135 00:06:12,690 --> 00:06:17,250 class A, class B, class C, class D, and class E. 136 00:06:17,250 --> 00:06:18,300 To identify the class 137 00:06:18,300 --> 00:06:20,580 for a certain IPv4 address that you have, 138 00:06:20,580 --> 00:06:22,740 simply look at the first octet. 139 00:06:22,740 --> 00:06:24,450 A class A network's first octet 140 00:06:24,450 --> 00:06:27,540 will include a number between 1 and 127, 141 00:06:27,540 --> 00:06:32,400 and they're going to have a default subnet mask of 255.0.0.0 142 00:06:32,400 --> 00:06:34,590 This means that the network portion of the address 143 00:06:34,590 --> 00:06:37,680 is the first octet, and the second, third, and fourth octets 144 00:06:37,680 --> 00:06:39,840 will all make up the host portion. 145 00:06:39,840 --> 00:06:41,640 This allows a class A address 146 00:06:41,640 --> 00:06:46,200 to have up to 256 times 256 times 256 hosts 147 00:06:46,200 --> 00:06:47,400 on a single network, 148 00:06:47,400 --> 00:06:50,280 which means we have a total possible combination 149 00:06:50,280 --> 00:06:53,460 of 16.7 million IP addresses available 150 00:06:53,460 --> 00:06:58,260 for each one of our class A networks going from 1 to 127. 151 00:06:58,260 --> 00:07:00,150 A class B network's first octet 152 00:07:00,150 --> 00:07:03,540 is going to include a number between 128 and 191, 153 00:07:03,540 --> 00:07:08,460 and they have a default subnet mask of 255.255.0.0 154 00:07:08,460 --> 00:07:10,770 This means that the network portion of the address 155 00:07:10,770 --> 00:07:13,140 is made up of the first and second octets, 156 00:07:13,140 --> 00:07:15,360 and then the third and fourth octets will be reserved 157 00:07:15,360 --> 00:07:17,370 for that host portion of the address. 158 00:07:17,370 --> 00:07:19,080 This means that a class B network 159 00:07:19,080 --> 00:07:23,250 can have up to 256 times 256 hosts on a single network, 160 00:07:23,250 --> 00:07:28,020 which gives us 65,536 possible host IP addresses 161 00:07:28,020 --> 00:07:30,300 for each of our class B networks. 162 00:07:30,300 --> 00:07:32,340 Now, a class C network's first octet 163 00:07:32,340 --> 00:07:36,360 is going to include the number between 192 and 223, 164 00:07:36,360 --> 00:07:37,890 and these class C addresses 165 00:07:37,890 --> 00:07:39,480 are going to have a default subnet mask 166 00:07:39,480 --> 00:07:43,170 of 255.255.255.0 167 00:07:43,170 --> 00:07:45,180 This means that the network portion of the address 168 00:07:45,180 --> 00:07:47,580 is the first, second, and third octets, 169 00:07:47,580 --> 00:07:48,840 and then that fourth octet 170 00:07:48,840 --> 00:07:50,730 is going to make up your host portion. 171 00:07:50,730 --> 00:07:53,490 Because we only have a fourth octet for our host portion, 172 00:07:53,490 --> 00:07:55,800 this means a class C network will only be able to have 173 00:07:55,800 --> 00:08:00,540 up to 256 hosts or IP addresses on a single network. 174 00:08:00,540 --> 00:08:02,790 Now, a class D network's first octet 175 00:08:02,790 --> 00:08:06,990 is going to include the numbers between 224 and 239. 176 00:08:06,990 --> 00:08:08,130 Now, a class D address 177 00:08:08,130 --> 00:08:10,560 does not have a subnet mask assigned to them 178 00:08:10,560 --> 00:08:13,320 because these class D addresses are considered special, 179 00:08:13,320 --> 00:08:15,480 and they're reserved for something known as multicasting 180 00:08:15,480 --> 00:08:17,370 or multicast routing. 181 00:08:17,370 --> 00:08:20,220 Now, a multicast address is simply a logical identifier 182 00:08:20,220 --> 00:08:22,470 for a group of hosts in a computer network 183 00:08:22,470 --> 00:08:24,750 that are available to process datagrams or frames 184 00:08:24,750 --> 00:08:28,140 intended to be multicast for a designated network service. 185 00:08:28,140 --> 00:08:29,910 So the actual multicast address 186 00:08:29,910 --> 00:08:32,159 doesn't align to one specific host, 187 00:08:32,159 --> 00:08:34,919 but instead it refers to a group of hosts. 188 00:08:34,919 --> 00:08:36,900 Now, when you think about a multicast address, 189 00:08:36,900 --> 00:08:38,700 think about it like a group chat. 190 00:08:38,700 --> 00:08:39,870 You have a group chat name, 191 00:08:39,870 --> 00:08:41,820 in our case, a multicast address, 192 00:08:41,820 --> 00:08:43,890 and when you send a message to the group chat's name, 193 00:08:43,890 --> 00:08:46,740 all of the members of that group are going to get a copy of it. 194 00:08:46,740 --> 00:08:49,650 Well, the exact same thing happens in IPv4 195 00:08:49,650 --> 00:08:51,150 when you're using multicast, 196 00:08:51,150 --> 00:08:53,340 and that's what we use class D for. 197 00:08:53,340 --> 00:08:55,680 Now, the last class we have is known as class E, 198 00:08:55,680 --> 00:08:58,050 and class E's first octet is going to include a number 199 00:08:58,050 --> 00:09:00,990 between 240 and 255, 200 00:09:00,990 --> 00:09:02,640 and again, class E addresses 201 00:09:02,640 --> 00:09:04,860 do not have a subnet mask assigned to them 202 00:09:04,860 --> 00:09:06,270 because they are also special, 203 00:09:06,270 --> 00:09:08,610 and they're reserved for experimental purposes 204 00:09:08,610 --> 00:09:11,070 in terms of research and development only. 205 00:09:11,070 --> 00:09:12,690 This experimental range contains 206 00:09:12,690 --> 00:09:15,810 about 268 million IPv4 addresses 207 00:09:15,810 --> 00:09:18,990 that are reserved for what they call, quote, future use. 208 00:09:18,990 --> 00:09:21,090 Now, over the years, there have been a few proposals 209 00:09:21,090 --> 00:09:23,910 to reallocate these class E addresses for general use 210 00:09:23,910 --> 00:09:26,970 because we started running out of public IPv4 addresses 211 00:09:26,970 --> 00:09:30,780 over time inside of the class A, class B, and class C ranges 212 00:09:30,780 --> 00:09:32,850 because more and more devices have become connected 213 00:09:32,850 --> 00:09:34,560 to the internet over time. 214 00:09:34,560 --> 00:09:37,500 That said, to date, as of the time of me saying this, 215 00:09:37,500 --> 00:09:39,840 these class E addresses still remain allocated 216 00:09:39,840 --> 00:09:41,610 for experimental use only, 217 00:09:41,610 --> 00:09:44,190 and most IP implementations inside of our networks 218 00:09:44,190 --> 00:09:48,420 will consider any IP inside of the 240.0.0.0 219 00:09:48,420 --> 00:09:52,590 all the way up to 255.255.255.255 range 220 00:09:52,590 --> 00:09:54,600 to be considered invalid as the source 221 00:09:54,600 --> 00:09:56,850 or destination within your datagrams, 222 00:09:56,850 --> 00:09:59,040 and therefore, the datagram will be rejected 223 00:09:59,040 --> 00:10:00,840 by your destination system. 224 00:10:00,840 --> 00:10:03,270 For example, a Windows server or workstation 225 00:10:03,270 --> 00:10:05,610 will simply refuse to communicate with any device 226 00:10:05,610 --> 00:10:08,130 that's claiming it's in the class E address space 227 00:10:08,130 --> 00:10:10,380 because class E addresses should not be used 228 00:10:10,380 --> 00:10:12,870 in a production or workplace environment. 229 00:10:12,870 --> 00:10:14,370 All right, now that I've briefly discussed 230 00:10:14,370 --> 00:10:16,440 the concept of subnetting, I want to go ahead 231 00:10:16,440 --> 00:10:18,720 and point out that subnetting is just a process 232 00:10:18,720 --> 00:10:20,760 of taking a larger network portion 233 00:10:20,760 --> 00:10:23,670 and subdividing it down into smaller portions. 234 00:10:23,670 --> 00:10:26,100 Now, when it comes to subnetting and subnet masks, 235 00:10:26,100 --> 00:10:27,720 we have two different types. 236 00:10:27,720 --> 00:10:31,260 We have classful subnet masks and classless subnet masks. 237 00:10:31,260 --> 00:10:34,260 A classful subnet mask is one that uses the default 238 00:10:34,260 --> 00:10:36,570 with a particular IPv4 address. 239 00:10:36,570 --> 00:10:40,620 For example, if you have an address like 10.0.0.0, 240 00:10:40,620 --> 00:10:43,740 this is a class A address based on the first octet. 241 00:10:43,740 --> 00:10:46,470 So if we use a classful subnet mask with it, 242 00:10:46,470 --> 00:10:49,560 we're going to use 255.0.0.0, 243 00:10:49,560 --> 00:10:52,080 and this gives us 16.7 million hosts 244 00:10:52,080 --> 00:10:54,420 inside that single class A network. 245 00:10:54,420 --> 00:10:55,890 For a class B address, 246 00:10:55,890 --> 00:10:59,880 the default subnet mask is 255.255.0.0, 247 00:10:59,880 --> 00:11:03,090 and this gives us 65,536 hosts 248 00:11:03,090 --> 00:11:05,430 inside of the single class B network. 249 00:11:05,430 --> 00:11:07,920 For class C addresses, the default subnet mask 250 00:11:07,920 --> 00:11:11,550 is going to be 255.255.255.0, 251 00:11:11,550 --> 00:11:14,250 and this gives us up to 256 hosts 252 00:11:14,250 --> 00:11:16,320 in a single class C network. 253 00:11:16,320 --> 00:11:18,690 Now, unfortunately, these classful subnet masks 254 00:11:18,690 --> 00:11:20,100 often create network sizes 255 00:11:20,100 --> 00:11:22,290 that are way too big for us to use. 256 00:11:22,290 --> 00:11:24,120 For example, I probably don't need 257 00:11:24,120 --> 00:11:27,510 16.7 million host IP addresses for a home network, 258 00:11:27,510 --> 00:11:29,280 like a class A would provide me, 259 00:11:29,280 --> 00:11:33,990 nor do I need 65,536 hosts, like a class B provides. 260 00:11:33,990 --> 00:11:35,100 And to take it further, 261 00:11:35,100 --> 00:11:37,530 most of us also don't need 256 hosts, 262 00:11:37,530 --> 00:11:39,240 like a class C would provide. 263 00:11:39,240 --> 00:11:41,220 So instead, we might want to break down 264 00:11:41,220 --> 00:11:43,410 these larger networks into smaller portions 265 00:11:43,410 --> 00:11:46,050 using what's known as a classless subnet mask 266 00:11:46,050 --> 00:11:48,330 through a process known as subnetting. 267 00:11:48,330 --> 00:11:49,920 Now, a classless subnet mask 268 00:11:49,920 --> 00:11:51,720 is going to be used to borrow some of the host bits 269 00:11:51,720 --> 00:11:55,110 from an IPv4 address by reassigning them to a one 270 00:11:55,110 --> 00:11:57,960 in the binary representation of that subnet mask. 271 00:11:57,960 --> 00:11:59,700 And that way, we can increase 272 00:11:59,700 --> 00:12:00,840 the size of the network portion 273 00:12:00,840 --> 00:12:03,060 and decrease the size of the host portion 274 00:12:03,060 --> 00:12:05,280 for a given IPv4 address. 275 00:12:05,280 --> 00:12:07,680 For example, let's pretend I have an IP address 276 00:12:07,680 --> 00:12:11,070 of 192.168.1.0 277 00:12:11,070 --> 00:12:16,070 with a classful class C subnet mask of 255.255.255.0 278 00:12:16,470 --> 00:12:19,980 Now, this gives me 256 IPs for use in my network. 279 00:12:19,980 --> 00:12:23,340 But if I only need to use 64 IP addresses, 280 00:12:23,340 --> 00:12:25,920 I can instead borrow two bits from the host portion 281 00:12:25,920 --> 00:12:28,860 and assign them to the network portion of that subnet mask. 282 00:12:28,860 --> 00:12:33,390 And this gives me 255.255.255.192 283 00:12:33,390 --> 00:12:35,490 as my subnet mask instead. 284 00:12:35,490 --> 00:12:37,830 Now, since the default for a class C network 285 00:12:37,830 --> 00:12:41,190 is 255.255.255.0, 286 00:12:41,190 --> 00:12:42,510 and I'm choosing to use something else 287 00:12:42,510 --> 00:12:44,370 besides that as my subnet mask, 288 00:12:44,370 --> 00:12:47,700 I am now having a classless subnet mask. 289 00:12:47,700 --> 00:12:50,940 This process is known as classless inter-domain routing, 290 00:12:50,940 --> 00:12:54,390 or CIDR, and we usually abbreviate our IP addresses 291 00:12:54,390 --> 00:12:57,000 and subnet mask into one combined notation 292 00:12:57,000 --> 00:12:59,310 which we call CIDR notation, 293 00:12:59,310 --> 00:13:01,620 which we pronounce CIDR notation. 294 00:13:01,620 --> 00:13:06,030 For example, the IP address of 192.168.1.4 295 00:13:06,030 --> 00:13:10,560 with a subnet mask of 255.255.255.0 296 00:13:10,560 --> 00:13:15,560 could be abbreviated as 192.168.1.4/24 297 00:13:16,500 --> 00:13:18,630 if I'm writing it in CIDR notation. 298 00:13:18,630 --> 00:13:19,620 Now, you may be wondering, 299 00:13:19,620 --> 00:13:23,580 why did I put /24 to represent 255.255.255.0? 300 00:13:25,440 --> 00:13:27,900 Well, what we're really doing here is counting the number 301 00:13:27,900 --> 00:13:30,180 of binary digits that are listed as a one 302 00:13:30,180 --> 00:13:32,010 in the network portion of the address. 303 00:13:32,010 --> 00:13:36,090 So if we have 255.255.255.0, 304 00:13:36,090 --> 00:13:39,660 we actually have 24 ones followed by eight zeros, 305 00:13:39,660 --> 00:13:42,240 so we write this as a /24 306 00:13:42,240 --> 00:13:46,350 instead of having to write out 255.255.255.0 307 00:13:46,350 --> 00:13:50,010 This /24 is considered to be a classful subnet mask 308 00:13:50,010 --> 00:13:51,840 for any class c network. 309 00:13:51,840 --> 00:13:54,630 On the other hand, if I have the classless subnet mask 310 00:13:54,630 --> 00:13:58,440 of 255.255.255.192, 311 00:13:58,440 --> 00:14:02,417 I would write this IP address as 192.168.1.4/26 312 00:14:04,980 --> 00:14:07,410 Because, remember, we borrowed two host bits 313 00:14:07,410 --> 00:14:08,790 and changed them to ones, 314 00:14:08,790 --> 00:14:10,800 so they became part of the network bits. 315 00:14:10,800 --> 00:14:13,620 So now, instead of having 24 ones and eight zeros, 316 00:14:13,620 --> 00:14:16,380 I have 26 ones and only six zeros. 317 00:14:16,380 --> 00:14:19,680 This gives me a /26 class C subnet mask, 318 00:14:19,680 --> 00:14:21,090 which would be classless 319 00:14:21,090 --> 00:14:23,640 as a subnet mask for a class C network. 320 00:14:23,640 --> 00:14:25,650 Now, if you're using a class A subnet, 321 00:14:25,650 --> 00:14:27,120 it has to be considered classful 322 00:14:27,120 --> 00:14:29,490 if you have a /8 CIDR notation, 323 00:14:29,490 --> 00:14:33,150 which is a subnet mask of 255.0.0.0, 324 00:14:33,150 --> 00:14:35,130 to indicate that there are eight bits of ones 325 00:14:35,130 --> 00:14:38,070 and 24 bits of zeros in that subnet mask. 326 00:14:38,070 --> 00:14:40,710 For a class B subnet mask to be considered classful, 327 00:14:40,710 --> 00:14:43,440 it must have a CIDR notation of /16 328 00:14:43,440 --> 00:14:47,400 or a subnet mask of 255.255.0.0, 329 00:14:47,400 --> 00:14:49,590 which indicates that it has 16 bits of ones 330 00:14:49,590 --> 00:14:52,500 and 16 bits of zeros in that subnet mask. 331 00:14:52,500 --> 00:14:55,200 For a class C subnet masks to be considered classful, 332 00:14:55,200 --> 00:14:57,960 it must have a CIDR notation of /24 333 00:14:57,960 --> 00:15:02,160 or a subnet mask of 255.255.255.0 334 00:15:02,160 --> 00:15:04,020 to indicate that it has 24 bits of ones 335 00:15:04,020 --> 00:15:06,630 and eight bits of zeros in its subnet mask. 336 00:15:06,630 --> 00:15:09,300 So remember, IPv4 addresses are commonly used 337 00:15:09,300 --> 00:15:12,060 inside of our networks, and these IPv4 addresses 338 00:15:12,060 --> 00:15:15,450 are decimal representations of a 32-bit binary number 339 00:15:15,450 --> 00:15:17,910 that we would write out our IPv4 addresses in, 340 00:15:17,910 --> 00:15:19,560 our dotted-decimal notation, 341 00:15:19,560 --> 00:15:22,110 to represent each one of the four octets. 342 00:15:22,110 --> 00:15:24,390 These IPv4 addresses are further divided 343 00:15:24,390 --> 00:15:26,730 into network and host portions of the address 344 00:15:26,730 --> 00:15:28,470 based on their subnet masks. 345 00:15:28,470 --> 00:15:32,160 Remember that these IP addresses are classified into classes 346 00:15:32,160 --> 00:15:36,420 of class A, class B, class C, class D, and class E, 347 00:15:36,420 --> 00:15:38,850 depending on the first octet in their address, 348 00:15:38,850 --> 00:15:40,080 and then each of these classes 349 00:15:40,080 --> 00:15:42,390 has its own default subnet mask. 350 00:15:42,390 --> 00:15:44,310 When this default subnet mask is used, 351 00:15:44,310 --> 00:15:46,650 we call this a classful subnet mask. 352 00:15:46,650 --> 00:15:48,060 But if you use any subnet mask 353 00:15:48,060 --> 00:15:50,340 that is not the default for that specific class, 354 00:15:50,340 --> 00:15:53,043 we will call this a classless subnet mask instead.