Next we need to take a look at classful versus classless or CIDR addressing. Some of the characteristics of addressing a class full routing are going to be things like all subnetworks or subnetted networks will have the same interval. Meaning that if I were to take a network and chop it up into pieces, each piece would be the same size, or they would have the same range or what we call the interval. So all subnets are contiguous and therefore have the same subnet mask. If a Class B network then is divided into 8 networks as they said, all 8 subnets, all subnet 8 subnets works will have the same subnet mask, in this case would be 224. So you'd see 224 in the third octet of the subnet mask. Default Class B network subnet mask is going to be 255.255.0.0. But since we need 8 more subnets we're going to have to borrow some of the host bits, turn them into network bits to create these networks. And that's really the process of of subnetting. Subnetting is the process whereby I take some of the zero's that I have in the host portion of the address and turn them into ones. And then change the sub net mask to accommodate that number of networks. In a classless routing or CIDR, all subnetted networks can have different intervals, meaning that on one side of a router I could have a certain sub net mask and on the other side of the router, it would be different, okay? So all subnets don't need to be contiguous. So for example, a network, you could have a /16 on one side of a router with a /19 on the other side of the router. In other words, there are no classes. All subnets are represented by a forward slash and in so many number of bits and x number of bits to represent the network portion of the IP address. Another way to look at this, is that classful use a fixed subnet mask with a fixed contiguous number of bits in the network portion of the address. Where with classless, you determine how many bits you want to use for the network portion of the address. So when we're looking at, going back and forth here again, the difference between classful and classless. Classful when we say classes we're saying class A, B and C, and we'll look at a table that in just a moment here. But classful routing protocols that build routing tables do not send their subnet mask information with their routing updates. So router running in classful routing protocol, we'll do one of two things when it receives a route. If the router has a directly connected interface belonging to the same major network, it's going to apply the same subnet mask as that interface. If the router does not have any interfaces belonging to the same major network, it will apply the classful subnet mask to the route, meaning a default A, a default B, or a default C mask. Default A being to 255.0.0.0. Class B we have two 255s or 255.255.0.0. And then Class C having three 255s or 255.255.255.0. Some examples of classful routing protocols are going to be RIP Version 1 and IGRP. So when we say belonging to the same major network, this simply indicates that they belong to the same classful network. For example, if I have 10.1.1.0 and 10.2.2.0, they belong to the same major network, that would be the 10 network, the 10.000 network, okay? Because their default subnet mask would be 255.0.0.0. And so they would be both on the 10 network. However, 10.1.2.3 and 11.1.2.3 do not belong to the same major network. Let's take a look at now some classful address ranges. Here we can see in this table that we have five different classes of address A, B, C, D, and E. We use what has been used in the past as A, B, and C. As far as I know, most of the classful ranges are pretty much gone if not completely gone. D and E, D is going to be a multicast range, and E is going to be experimental. If you look at a Class A address, you're going to know it's a Class A address because in the first octet, if it's between 1 and 126, 127 is loopback. That's a Class A address. Here you can see looking at the top row going across next to A, it says the first octet bits, the blue bits here they don't change. So for a Class A address, it's always going to start off with zero something. And then the next seven bits are going to represent the rest of the network. And then the last 24 bits in black, if you look to the far right, are going to be the host portion of the address. So if you were to create a number such as 50, which is between 1 and 126, 50 is always going to have the first bit as zero. because the first bit is your 128 bit remember, the second bit is the 64 bit. And so that's why between 1 and 126, the first bit is always zero. The next column there you can see again just a simple representation between N network in blue and H host bits in black. And then we see the default subnet mask 255.0.0.0. We see the binary representation of the default subnet mask. And then we can see going to Class B in Class B it's going to be 128 to 191. And so in the next column there you see 10, a Class B address always starts off with 10 because that first bit is 128. The next one is going to be zero. Because if we're going to go up to 191, it's going to look like 10 and all once. Then we move over and we can see then that our network portion in blue is two octets represented by the default subnet mask of 255.255.0.0. And then we see the binary representation and so on. Class C is always going to start off as 110 because 110 is going to give us numbers between 192 and 223 and so on and so forth. And you can see the same pattern is true for both D and E networks. So, why are we starting off with classful addressing rather than classless? Mostly because it's a little bit easier to teach subnetting. Because we're starting from the premise that if I have a default class address like a Class B, I know that my starting point is 16 bits. Notice there in blue we have eight bits dot 8 bits. So the process of subnetting is barring host bits zeros to create networks and turning them into one's. If we borrow host bits then the number of host bits we borrow is used to mathematically figure out how many networks we want to create. It's based on 2 to the end. So there's a trade off, the more host bits we borrow, the more networks we create. So as we borrow host bits or zeros moving to the right, we double in binary the number of networks or ones we can create while cutting in half the number of hosts per subnet that are left. I mean, just look at it mathematically. If you look at the bottom example, there are 255.255.240. We have borrowed four bits in that 3rd octet. Well if we borrow four bits and double moving to the right, because it's based to then that's four less zeros we have for hosts represented by the green zeros. If we were to go the other direction and we wanted more host, we could take the ones and turn them to host. That would be mathematically the same process. Just in reverse, I would double the number of hosts while cutting the number of networks in half. But again, that's really not what we're trying to do here, we're trying to take a large network and divided into smaller subnets. And again, we do that by taking the zeros in green and turning them into ones. And again, the number of zeros I turn into one's determines the number of networks I can create. Now I know that this might look a little busy, so let's go ahead and break it down a bit. At the top of the diagram here, we can see our patterns of obits turned on eight bits and their placeholder values. The ones place to place, four placed eighth place, 16th place 32, 64, 128, that's going to help us calculate our seven at mask. Now there's really five questions if you look in the botto, left that you need to answer in order to do submitting. And as we're going through this, we're going to go through each one, one at a time. You're going to see highlighted across the top, each question being answered or addressed. So question number one then is, what is the default class that we're starting off with? In other words, is it a class A network that we want to chop up, a class B network, a class C network. And so the next question is, how many subnets do we require from this? Let's just say, a class B network, if we want to create four networks we need to borrow two bits. Why is that remember to, to the end? That's going to be our process for figuring out how many networks we want, we know that two to the 2 bits borrowed is four. That gives me four combinations of zeros and ones, for example, 0, 0, 0, 1, 1, 0 and 1,1. Those are the only four combinations that we get out of two bits. And so when I borrow two bits, the next thing here to create my ford networks as a result of that. Those two bits are 128 plus 64 which equals my sub net mask, that is 192. Again, if you're going from the left to the right, you can add up 128 and 64 that's what you're going to get. Now in parentheses there, I have a little eye for interval. Now notice there that there is a relationship mathematically between the mask and the interval. The interval also called the range dictates the size, or number of hosts that I'm going to have in each of my networks. If you look to the left in the blocked in area, looks like a little legend there. You see where it says 256 minus the mask gives me the interval. Remember that's 256 is the total number of combinations we get with eight bits, you're thinking? I thought it was 255, well it's zero through 255 gives me 256 combinations. If I subtract the mask from that, that gives me the size of my range. If you go down this column number four, you can see that 192 plus 64 is 256. 224 plus 32 is 256, 240 plus 16 is 256 and so on, all the way down. So the blue and the purple numbers added together always give me 256. So again, this relates to the last slide, mathematically as I'm borrowing zeros and turning them into ones. I'm creating more networks, but the size of those networks get smaller. I mean I only have so many bits mathematically to play with, if I borrow eight bits to create 255, excuse me, 256 networks. My mask is going to be 255 and my interval is going to be one, which is in many cases not used specifically if we're talking about a class C network. All right, so I have determined that I want four networks. And that it had to borrow two bits to create four networks, and that two bits added up together, starting from the left is 128 plus 64. It gives me 1 92, and that will leave me with so many hosts per network. Which is the last question or the last thing we would need to address. And so for example, if two to the end represents the number of networks in this case for that I want, and I needed to bits in order to create that. That gives me a mask of 192, the number of hosts actually is two to the end -2. And the reason for that is we still get 64 combinations with to the end. The reason we subtract two is because the first address in the range is going to be zero. And we would throw out the last address as well, which should be all ones which would be a broadcast on that sub network. So we always throw out the first address which is zero, it just indicates this network only. And we throw out the last address which is 255, which is a broadcast. And that's basically how we go through and do submitting now. Over time, you can look at your sub net mask, and if you're troubleshooting and you see 240 in your head. You can say, well my host should be within intervals or multiples of 16 of each other. In other words, zero through 15 would be one range, 16 through 31 would be the second range. And if hosts were too far away from each other, they must be on a separate sub network. So again, real quick and down and dirty way to do this is just take 256 minus the mask. Gives me the interval 256 minus the interval gives me the mask, and again I can see those ranges very clearly. Now we want to do is kind of work a few problems. The first thing we'll do is try to calculate some subnets and host for a class C network and as you can see, I did the first one for you there. So once we do that, we again going across, I didn't number the columns here, it's the same process. The steps are once we know what class of address we have, what is the number of subnets required, in the first example at six. How many bits do we need to borrow to create those subnets? And I put three actually three bits will give me eight combinations, but it doesn't say I need eight, I need six. So if for some reason the number isn't exact, I have to go to the next highest multiple. So if it said number of subnets required was nine. I have to go up to the next highest number on my sub net chart. And I would have to borrow four bits, and then I just have some extra sudden that's left over. But in this case here the three bits that I used in order to create my six networks results in a sub net mask of 224 which is going to be 128 plus 64 plus 32. And that will give me 224. The number of hosts that I have left though, if you look in your table would be 30. It would be 32 B two to the n minus two again throughout the zero and throughout the one address. And that would give me 30 hosts for each of those three subnets. Notice we're all the way down into a classy network, so we only have eight bits to play with. And so if I use three of those bits to create sub sub networks, that only leaves me five left over in order to create hosts. Now, why don't you pause the audio for a moment and go ahead and fill out the rest of the table? Okay, this is what you should have gotten here. If you wanted to create a 42 sub networks, you would have to borrow 6 bits. The result in subnet mask in the last octet would be 252 and it would give you two hosts per sub that not much. So again you borrowed 6, you only have 2 bits left, which is four combinations, subtracting zeros and ones gives you two hosts. And then again as you're going down through the rest of the table there, you can see that if you wanted 11 sub nets again, you'd have to move to the next highest level. You'd have to borrow 4 bits in order to create that many networks. It's going to give you a subnet mask at 240 with 14 hosts and then 29 again, 29 is not an even multiple. So I would have to go up to the next highest number and I would have to borrow 5 bits in order to create that number of subnets, 5 bits continuously is 248 in the subnet mask. And that only leaves me 3 bits or eight combinations minus zeros and ones to give me six hosts per subnet. Let's take a look now at calculating subnets and hosts for Class B network here. You can see that in the column on the left, let's start over now, we're going to take a look at calculating sub nets and hosts for Class B network. Again, we have the same steps you can see in the left column, it says required number of subnets is 12. In order to get 12 sub nets, we're going to have to borrow 4 bits borrowing 4 bits will actually give us 14 actually, 16 networks four combinations, let's start over one more time. Next, we're going to go ahead and calculate sub nets and hosts for Class B network. As you can see the steps are the same In the column on the left. It says number of sudden that's required is 12, in order to get 12 sub nets, we have to borrow 4 bits that will actually give us 16 combinations. And four bits continuously in the subnet mask would move the default subnet mask from 255 to 255.0.0 to 255.255.240, 240, again being the 1 28 bit plus 64 plus 32 plus 16 equals to 40. And this is going to give us, why 4094 hosts? Well, because remember, it's not just the zeros in the last octet because at 240 remember is four 1s and four os. So it's actually four 0s in the third octet and eight more 0s in the last octet for a total of 12 zeros. And mathematically if you go from the right to the left and double in binary 12 times you will get 4,094 combinations. Now take a moment and go ahead and fill out the rest of the table. [MUSIC] All right, is this what you got? This is what you should have gotten here. You can see again again, you can go ahead and look at that and do the math on this. But if you were to get or need 99 subnets, you're going to have to borrow seven bits and that's actually going to give you 128 combinations. Again, my result subnet mask for that is going to be 255.255.128.0. We're going to have then nine bits left over the 128 Is again one bit shy of being a full octet. So you're going to have seven 1s and a zero in the third octet and then another eight zeros in the last octet. So you'll have nine zeros which is going to give us 512 hosts per submit minus zeros and ones which is 510. And if you look at the rest of these again, mathematically it's just a matter of figuring out how many subnets do you need, how many bits do you need to borrow in order to create that number? The result in subnet mask from having that many bits changed in a row in that particular octet and the resultant number of hosts per submit as a result of that. Lastly we want to go ahead and calculate subnets and host for Class A network. And again, as you see, there are five steps or five questions or things to be addressed. And here we have in the left hand column number of subnets required as 100, 200, 1500 and 4000. So if we want 100 subnets we actually can do that by borrowing seven bits, which will give me 100 and 28 combinations. 7 bits continuously, gives me a subnet mask of 128 and what that does then is that gives me a lot of bits left over. It gives me the eighth bit in the second octet because we're borrowing seven and then 16 more bits or 16 more zeros for total of 17. And that gives me a total number of 131,070 hosts per subnet. So again, if you have a Class A network, you could divide it up into 100 subnets. Each of those 100 subnets would have 131,000 hosts in them. Because again we have a lot of host bits that we can borrow. Okay go ahead and take a moment and go through and fill out the rest of the table. [MUSIC] This is what you should have gotten here. As you can see going from 100 to 200 just involved borrowing one more bit and we went from 128 to 2 55. But notice again, this is a good illustration of borrowing one more bit in order to create twice as many networks. But notice in the right hand column, my 131,000 now got divided in half because we moved one bit further to the right, so that gave us one less host bit. So again divided that in half. When we move from 200 to 1500 subnets, I have to actually borrow two more bits or my results subnet mask in this case goes to 255.255.192.0. And again notice the relationship there on the number of hosts. The last one here is 4000 subnets that are required and for this we would borrow two more bits going from 10 to 12. Notice my subnet mask now is all the way down into the last octet and notice how many hosts per submit are left over as a result of that, not many, just 14. So you can kind of see that trade off there as I borrow more bits to the right and my mask begins to move to the right, taking up zeros and turning them into ones. I actually get less hosts per submit.