1 00:00:00,000 --> 00:00:03,000 In this section we gonna look at IP subnetting. 2 00:00:03,000 --> 00:00:06,000 I’d like to teach you multiple methods for subnetting. 3 00:00:06,000 --> 00:00:10,000 Subnetting is one of those subject that a lot of Network Engineers struggle with. 4 00:00:10,000 --> 00:00:13,000 But in this section I hope I'll be able to simplify for you 5 00:00:13,000 --> 00:00:15,000 and give you various methods. 6 00:00:15,000 --> 00:00:18,000 So that any subnetting questions that you might encounter 7 00:00:18,000 --> 00:00:21,000 can be completed quickly and easily. 8 00:00:21,000 --> 00:00:23,000 There are 2 main parts in this section: 9 00:00:23,000 --> 00:00:27,000 in the 1st part I'm gonna show you 2 methods to quickly and easily answer 10 00:00:27,000 --> 00:00:32,000 questions like, what subnet is this host on or what is a last host in this subnet? 11 00:00:32,000 --> 00:00:35,000 So I’m gonna teach you the binary method and then 12 00:00:35,000 --> 00:00:38,000 I’m gonna teach you what I call the quick method. 13 00:00:38,000 --> 00:00:41,000 I suggest that you look at both and then choose one 14 00:00:41,000 --> 00:00:43,000 and get good at that specific method. 15 00:00:43,000 --> 00:00:46,000 I think binary is very important to understand. 16 00:00:46,000 --> 00:00:50,000 But as the quick method name indicates it’s very quick and easy 17 00:00:50,000 --> 00:00:53,000 to answer subnetting questions using the quick method. 18 00:00:53,000 --> 00:00:57,000 In the 2nd part I’d like to show you how to create multiple subnets 19 00:00:57,000 --> 00:01:01,000 when given a specific network or subnet, so you will be able to answer questions 20 00:01:01,000 --> 00:01:07,000 like subnet this network into at least 10 subnets or subnet this network 21 00:01:07,000 --> 00:01:09,000 into subnets each having 10 hosts on them. 22 00:01:09,000 --> 00:01:15,000 So in part 1 you'll be given an IP address and then you gonna need to learn 23 00:01:15,000 --> 00:01:20,000 how to work out the subnet address, 1st host address, last host address 24 00:01:20,000 --> 00:01:25,000 and the broadcast address and we'll gonna use 2 methods: the binary method 25 00:01:25,000 --> 00:01:28,000 and the quick method, and as I mentioned I suggest that you choose 1 of the 26 00:01:28,000 --> 00:01:32,000 2 methods, look at both, decide which one you prefer 27 00:01:32,000 --> 00:01:35,000 and then learn and get good at that specific method. 28 00:01:35,000 --> 00:01:37,000 So here's the typical example: 29 00:01:37,000 --> 00:01:43,000 You’ve been given a host with an address of 192.168.10.18 for the /24 mask 30 00:01:43,000 --> 00:01:46,000 and you’ll need to be able to answer the following questions: 31 00:01:46,000 --> 00:01:52,000 what IP address with router 1 be configured with, this router being router 1 32 00:01:52,000 --> 00:01:57,000 if it is to use the first IP address in the same subnet as PC 1? 33 00:01:57,000 --> 00:01:59,000 Which is the PC here? The second question could be: 34 00:01:59,000 --> 00:02:02,000 What broadcast address is used by PC 1? 35 00:02:02,000 --> 00:02:06,000 or thirdly what IP address would router 1 be configured with if it is to use 36 00:02:06,000 --> 00:02:10,000 the last IP address in the same subnet as PC1? 37 00:02:10,000 --> 00:02:13,000 So the first question was, what IP address will the router use if it is 38 00:02:13,000 --> 00:02:15,000 configured with the first IP address? 39 00:02:15,000 --> 00:02:19,000 And the third one is: what IP address would it be configured with if it were 40 00:02:19,000 --> 00:02:22,000 configured with the last IP address in the subnet? 41 00:02:22,000 --> 00:02:25,000 And fourthly, a question could be what subnet is PC 1 part of? 42 00:02:25,000 --> 00:02:29,000 so you should within 30 to 60 seconds be able to answer those question 43 00:02:29,000 --> 00:02:31,000 and I’m gonna show you how to do that now. 44 00:02:31,000 --> 00:02:35,000 So the first method is to use binary to work out the answers. 45 00:02:35,000 --> 00:02:39,000 I personally prefer binary because it's used all over the place in networking. 46 00:02:39,000 --> 00:02:42,000 And I want you get your head around how binary works. 47 00:02:42,000 --> 00:02:44,000 It will save you a lot of time in the long run. 48 00:02:44,000 --> 00:02:46,000 Please refer to the binary section of this course 49 00:02:46,000 --> 00:02:49,000 if you are not sure about the basics of binary. 50 00:02:49,000 --> 00:02:52,000 we are going to assume knowledge of binary now 51 00:02:52,000 --> 00:02:55,000 we're just gonna use binary to work out the answer to those questions. 52 00:02:55,000 --> 00:02:58,000 In the binary method, you need to remember 4 rules 53 00:02:58,000 --> 00:03:01,000 to work out the network with subnet address 54 00:03:01,000 --> 00:03:05,000 you fill the host portion of the address with binary 0's 55 00:03:05,000 --> 00:03:08,000 So you work out which part is network and which part is host 56 00:03:08,000 --> 00:03:11,000 and you fill the host portion with binary 0's. 57 00:03:11,000 --> 00:03:14,000 To work out the broadcast address, 58 00:03:14,000 --> 00:03:17,000 you fill the host portion of the address with binary 1's. 59 00:03:17,000 --> 00:03:22,000 To work out the first host in the subnet, you fill the host portion of the 60 00:03:22,000 --> 00:03:26,000 address with binary 0's except for the very last bit which is set to a binary 1. 61 00:03:26,000 --> 00:03:31,000 And to work out the last host in the subnet, you fill the host portion of the 62 00:03:31,000 --> 00:03:35,000 address with binary 1's except for the last bit which is set to binary 0. 63 00:03:35,000 --> 00:03:38,000 If you remember those 4 rules, you will be able to work out the answer to any 64 00:03:38,000 --> 00:03:41,000 of those questions very quickly. 65 00:03:41,000 --> 00:03:42,000 So let’s start the basic example. 66 00:03:42,000 --> 00:03:52,000 We have a PC with an IP address 192.168.1.18/24 or it could be written as 67 00:03:52,000 --> 00:03:58,000 192.168.1.18 with the mask of 255.255.255.0 68 00:03:58,000 --> 00:04:03,000 As you learnt in the IP addressing section, these 2 are equivalent subnet mask. 69 00:04:03,000 --> 00:04:08,000 It's very similar to saying tomato or tomato or router or router. 70 00:04:08,000 --> 00:04:12,000 It means the same thing it's just a different way of displaying the subnet mask. 71 00:04:12,000 --> 00:04:18,000 Now hopefully you remember that 24 means 24 bits in the subnet mask 72 00:04:18,000 --> 00:04:22,000 in other word 8 bits in the first octet, 8 bits in the second octet 73 00:04:22,000 --> 00:04:27,000 and the 8 bits in the third octet. That means the first 3 octets are network. 74 00:04:27,000 --> 00:04:33,000 So 192.168.1 is the network portion of the address and this last octet is the 75 00:04:33,000 --> 00:04:36,000 host portion and that’s how I’ve written it here. 76 00:04:36,000 --> 00:04:40,000 The first 3 octets are displayed in black representing the network portion and 77 00:04:40,000 --> 00:04:44,000 the last octet is shown in red which represents the host portion of the address. 78 00:04:44,000 --> 00:04:47,000 There’s no point converting the network portion into binary. 79 00:04:47,000 --> 00:04:54,000 So I’ve just left as it is, so the subnet is equal to 192.168.1. 80 00:04:54,000 --> 00:04:58,000 and if you remember back to our rules to get the subnet, 81 00:04:58,000 --> 00:05:01,000 you fill the host portion of the address with binary 0's 82 00:05:01,000 --> 00:05:07,000 So this is the single octet, so 8 binary 0's need to fill that host portion. 83 00:05:07,000 --> 00:05:13,000 If you convert 8 binary 0's back into decimal you'll get the value 0. 84 00:05:13,000 --> 00:05:18,000 So the subnet is 192.168.1.0 for this specific IP address. 85 00:05:18,000 --> 00:05:23,000 To get the first host in the subnet, you fill the host portion of the address 86 00:05:23,000 --> 00:05:28,000 with binary 0's except for the last bit which make binary 1. 87 00:05:28,000 --> 00:05:30,000 So an octet once again is 8 bits. 88 00:05:30,000 --> 00:05:34,000 So there are 7 binary 0's followed by single binary 1. 89 00:05:34,000 --> 00:05:36,000 Converting that back to decimal you get 1, 90 00:05:36,000 --> 00:05:41,000 so the first host in this subnet is 192.168.1.1 91 00:05:41,000 --> 00:05:46,000 To work out the last host, fill the host portion of the address with binary 1's 92 00:05:46,000 --> 00:05:50,000 except for the last bit you set to binary 0 93 00:05:50,000 --> 00:05:56,000 That's 7 binary 1's followed by binary 0, if you convert that back to decimal 94 00:05:56,000 --> 00:05:58,000 you'll get the value 254. 95 00:05:58,000 --> 00:06:03,000 So the very last host in this subnet is 192.168.1.254 96 00:06:03,000 --> 00:06:07,000 To get the broadcast address, fill the host portion of the address 97 00:06:07,000 --> 00:06:14,000 with binary 1's, so single octet fill with binary 1's is equal to 255 in decimal 98 00:06:14,000 --> 00:06:19,000 So there you have it. We can work out the subnet, the first host, the last host 99 00:06:19,000 --> 00:06:23,000 and the broadcast address very quickly and easily using the binary method. 100 00:06:23,000 --> 00:06:29,000 So if you were ask to configure the 1st IP address in the same subnet as PC 1 101 00:06:29,000 --> 00:06:33,000 on the routers interface you would know that you need to configure the IP address 102 00:06:33,000 --> 00:06:43,000 192.168.1.1/24 or 192.168.1.1 255.255.255.0 103 00:06:43,000 --> 00:06:48,000 You could be expected to type the commands unto the router to configure it with 104 00:06:48,000 --> 00:06:52,000 the relevant IP address, later in this course you'll learn the commands to do that 105 00:06:52,000 --> 00:06:57,000 But for now, realize that you might need to work out first, last, broadcast and 106 00:06:57,000 --> 00:07:00,000 subnet addresses When giving a specific IP address. 107 00:07:00,000 --> 00:07:03,000 This is our first example using the binary method 108 00:07:03,000 --> 00:07:05,000 I’d like to show you more complicated example now. 109 00:07:05,000 --> 00:07:12,000 So in this example you've been given an IP address 172.16.35.123/20 110 00:07:12,000 --> 00:07:15,000 or in other words 255.255.240.0 111 00:07:15,000 --> 00:07:18,000 This is a little bit more complicated because the mask 112 00:07:18,000 --> 00:07:21,000 does not fall on the octet boundary, 113 00:07:21,000 --> 00:07:26,000 in other words, it's not a simple /8 or /16 or /24 subnet. 114 00:07:26,000 --> 00:07:29,000 The network and host portion lies somewhere in the third octet. 115 00:07:29,000 --> 00:07:35,000 So just to reiterate, /20 means that 20 bits of the 32 bit IP address 116 00:07:35,000 --> 00:07:39,000 which are used for networks or subnet portion and the remaining 12 bits are used 117 00:07:39,000 --> 00:07:41,000 as the host portion of the address. 118 00:07:41,000 --> 00:07:45,000 So somewhere in the third octet, the network host portion changes. 119 00:07:45,000 --> 00:07:52,000 So once again our IP address is 172.16.35.123/20 120 00:07:52,000 --> 00:07:57,000 Now the first octet is 8 bits in size , the second octet is 8 bits in size. 121 00:07:57,000 --> 00:07:59,000 So adding those together you get 16 bits. 122 00:07:59,000 --> 00:08:05,000 The third octet is 8 bits in size, so adding those 3 together gives you 24 bits. 123 00:08:05,000 --> 00:08:10,000 So /20 in the subnet mask means that the split between subnet 124 00:08:10,000 --> 00:08:13,000 and host occurs somewhere in the third octet. 125 00:08:13,000 --> 00:08:17,000 So once again the first octet is 8 bits, second octet is 8 bits thus 126 00:08:17,000 --> 00:08:20,000 20 bits puts the split somewhere in the third octet. 127 00:08:20,000 --> 00:08:24,000 So what you need to do is convert the third and fourth octet 128 00:08:24,000 --> 00:08:27,000 into binary because they both have host bits. 129 00:08:27,000 --> 00:08:30,000 There’s no need to convert the first 2 octets into binary 130 00:08:30,000 --> 00:08:33,000 because no host bits are found in the first 2 octets. 131 00:08:33,000 --> 00:08:44,000 So 00100011 is the binary equivalent of decimal 35, 0 followed by 4 binary 1's 132 00:08:44,000 --> 00:08:50,000 followed by 0 followed by 2 binary 1's is the binary equivalent of decimal a 123. 133 00:08:50,000 --> 00:08:57,000 So all we’ve done is convert 35 and 123 into their binary equivalents. 134 00:08:57,000 --> 00:09:00,000 Please see the binary section of this course if you are not 135 00:09:00,000 --> 00:09:03,000 sure how to convert decimal into binary and back again. 136 00:09:03,000 --> 00:09:09,000 20 bits of subnet mask put us in this position because we have 8 bits 137 00:09:09,000 --> 00:09:12,000 plus 8 bits in the first 2 octets which give us a total 138 00:09:12,000 --> 00:09:19,000 of 16 binary bits plus 1 is 17 plus 1 is 18 plus 1 is 19 plus 1 is 20 139 00:09:19,000 --> 00:09:25,000 So we can draw a line at this point to split the network and host portion 140 00:09:25,000 --> 00:09:29,000 To the left of this line, the binary bits indicate network or subnet, 141 00:09:29,000 --> 00:09:33,000 to the right of this line the binary bits indicates host. 142 00:09:33,000 --> 00:09:39,000 So there are split between network and host portions in this address at this line. 143 00:09:39,000 --> 00:09:43,000 So to work out the answers you need to remember the 4 rules. 144 00:09:43,000 --> 00:09:48,000 The first rule states that, to work out the network or subnet address, 145 00:09:48,000 --> 00:09:51,000 you need to fill the host portion of the address with binary 0's. 146 00:09:51,000 --> 00:09:54,000 So to the right of the line we need to fill 147 00:09:54,000 --> 00:09:58,000 this entire portion of the address with binary 0's. 148 00:09:58,000 --> 00:10:02,000 So once again 20 bits of subnet mask put us in this position 149 00:10:02,000 --> 00:10:05,000 and we fill everything to the right with binary 0's. 150 00:10:05,000 --> 00:10:12,000 So we end up having 172.16 the first 4 bits of the third octet 151 00:10:12,000 --> 00:10:15,000 remain the same and all remaining bits are set to binary 0. 152 00:10:15,000 --> 00:10:21,000 When you convert that back to decimal, please note firstly that these 4 bits 153 00:10:21,000 --> 00:10:26,000 in red plus the following 4 bits in green are part of the third octet. 154 00:10:26,000 --> 00:10:31,000 So 0010 followed by 0000 when converted from binary 155 00:10:31,000 --> 00:10:36,000 to decimal gives us a value of 32. The fourth octet is filled with 0's. 156 00:10:36,000 --> 00:10:42,000 So converting an octet filled with binary 0's to decimal give us a value of 0. 157 00:10:42,000 --> 00:10:47,000 So the subnet address is 172.16.32.0 158 00:10:47,000 --> 00:10:53,000 Now to work out the first host address, fill the host portion of the address 159 00:10:53,000 --> 00:10:58,000 with binary 0's except for the last bit which is set to binary 1. 160 00:10:58,000 --> 00:11:04,000 So here you go, the first host is equal to 172.16.0010 161 00:11:04,000 --> 00:11:09,000 remember, we don’t touch this portion of the address, we only change the host 162 00:11:09,000 --> 00:11:13,000 portion of the address, so we fill the host portion with binary 0's 163 00:11:13,000 --> 00:11:16,000 except for the last bit which we set to binary 1. 164 00:11:16,000 --> 00:11:21,000 Once again the third octet consist of 4 binary bits which are part of the network 165 00:11:21,000 --> 00:11:25,000 or subnet and 4 binary bits which a part of the host portion. 166 00:11:25,000 --> 00:11:30,000 Those 4 red binary bits together with those 4 green binary bits 167 00:11:30,000 --> 00:11:33,000 give us a decimal value of 32. 168 00:11:33,000 --> 00:11:39,000 The last octet is 7 binary 0's followed by single binary 1 169 00:11:39,000 --> 00:11:45,000 which is equal to decimal 1, so the first host address is 172.16.32.1 170 00:11:45,000 --> 00:11:49,000 To work out the last host address, fill the host portion of the address 171 00:11:49,000 --> 00:11:54,000 with binary 1's except for the last bit which is set to binary 0. 172 00:11:54,000 --> 00:12:02,000 So the last host is equal to 172.16.0010 followed 4 binary 1's, in the third octet 173 00:12:02,000 --> 00:12:07,000 followed by 7 binary 1's in the fourth octet and then lastly a binary 0. 174 00:12:07,000 --> 00:12:13,000 So the third octet consist of this 4 red bits and this 4 green bits. 175 00:12:13,000 --> 00:12:18,000 So if you convert 0010 followed by 4 1's into decimal 176 00:12:18,000 --> 00:12:22,000 you'll get the decimal equivalent which is 47, 7 binary 1's 177 00:12:22,000 --> 00:12:30,000 followed by binary 0, gives you the equivalent decimal value of 254. 178 00:12:30,000 --> 00:12:37,000 So the last host in this subnet is 172.16.47.254 179 00:12:37,000 --> 00:12:41,000 To work out the broadcast address, fill the host portion 180 00:12:41,000 --> 00:12:44,000 of the address with binary 1's. 181 00:12:44,000 --> 00:12:50,000 So the broadcast address is equal to 172.16.0010 182 00:12:50,000 --> 00:12:53,000 Once again, the network and subnet portion are left as is. 183 00:12:53,000 --> 00:12:56,000 And then you fill the host portion with binary 1's. 184 00:12:56,000 --> 00:13:02,000 So the third octet is equal to 0010 and 4 binary 1's 185 00:13:02,000 --> 00:13:06,000 which once again gives you the decimal equivalent of 47. 186 00:13:06,000 --> 00:13:12,000 8 binary 1's in octet gives you the decimal value 255. 187 00:13:12,000 --> 00:13:18,000 So the broadcast address would be 172.16.47.255 188 00:13:18,000 --> 00:13:28,000 So in summary, an address of 172.16.35.123 with the subnet mask of /20 resides 189 00:13:28,000 --> 00:13:37,000 on subnet 172.16.32.0 and has a broadcast address of 172.16.47.255 190 00:13:37,000 --> 00:13:42,000 the first host in the same subnet is 172.16.32.1 191 00:13:42,000 --> 00:13:47,000 and the last host in the same subnet is 172.16.47.254 192 00:13:47,000 --> 00:13:52,000 This was a slightly more complicated example, but I’m hoping that by now 193 00:13:52,000 --> 00:13:55,000 you have learned the process to work out subnet first host, last host and 194 00:13:55,000 --> 00:14:00,000 broadcast address when given an IP address and its subnet mask.