Hello Friends, Welcome to Gate Smashers in today's video we are going to discuss Subnetting and subnetting we are discussing in classful addressing where we divide IP addresses into different classes class A, B, C, D, E and here if we talk about one of the most important topic is of computer networks that is subnetting and students very easily get confused that what is subnetting? how actually we divide network into subnets So in this video I am going to explain you with examples that why actually subnetting is done What it is? and how actually we implement it? So first of all, what is Subnetting? dividing the big network into small networks means we have a big network and that we have to divide into small networks that is what a simple meaning of subnetting So question No. 1 comes that what is its purpose? Why we are dividing it? So if we take a simple example Let's say we have a big university a big organization Now the bigger the organization, the bigger the university the more you will find it difficult to maintain it How? Let's say we take address of class A, In class A we know that two twenty 2 raise to power 24 No. of host are possible inside every class A network now in this much number, it is in crores this much no. of host are possible to maintain all these to manage all these is will obviously be difficult, but if we divide this into small small parts then the maintenance will become easy. Suppose we have a big university in big university different departments for examinations, placement there are department for co-curricular activity department for academics and library system to manage all these either you appoint one administrator but obviously managing all this is very difficult. and if we divide this into separate parts Let's say we made one subnet for examination that you handle examinations only one we made for placement which will see placement related activity one we made let's say for academics for academics related one we made for co-curricular activities which will talk related to that only So we did logically divided the big network in our organization, we can divide in multiple also. The network whose address we take for that we have been assigned in internet we need number authority. There we will need assigned authority but what we are doing internally we always do subnetting within the organization with our own choice, so we can make multiple subnets. So obviously So this will have separate network admin network admin, network admin, network admin so of their respective blocks, their own subnets they will take care off So maintenance is easy, and managing all this is easy and here when class A has so many number of host so the wastage there will be also less. Second thing we will talk here about security In such a large organization when there are a number of host I have to authorize each of those hosts. users have made passwords we have to provide them IP address so somewhere here it will be difficult. But if I make different departments and I divide this separately here then what will happen to security that will be enhanced. so this is the main advantage, Of whom? of subnetting but there are problems also we will discuss after this This is the basic funda why we do subnetting. Now comes question No. 2 that how subnetting is done? How we actually implement the subnetting? For that we take an example here I have taken a network from Class C and in the network of class C What we have to do? What is the first class C network we have taken? 200.10.20.0 how do we know it is class C From starting octet we can know so what is the range? from 190 to 223 so from here we come to know this is class C So you can do subnetting in class A, B, C all three. We are doing in C because writing the range would be easy, otherwise writing the range will be difficult because there are many host in class A and class B but what we have here How many host do we have here? within class C, Total obviously two fifty six. because the last octet we have that defines what are the number of host? But how many are usable host? the zeroth one manages the entire network if we want to represent whole network then we don't use the first host and the last i.e 255 So we don't use this two because this is direct broadcast address and this starting address is the address of this network. And how do we define in class A, B, C what is the broadcast address? I have already made video on this, you must check that video once. Because subnetting is the next topic first you should know what is classful addressing? how do we divide? and how do we define octet and all other things So if you check that video once you will find subnetting very easy and their link I have already given in the description box. So here this is direct broadcast address and this is the starting address of this whole network. What does it mean by whole network? Whole world means www identify you with which IP address? It knows with this IP address So obviously this IP address you will not give to any internal host. So how much total usable you will have now? Two fifty four Now what we are saying, No! I want to divide 254 logically in two subnets means this is total network within which there are multiple host i.e 254 but further I have to divide this also logically so what is the meaning of dividing logically? that let's say I have to divide into two parts means I have to divide this whole network in two parts how we do here? let's say 200.10.20. The first important point is that whenever we do subnetting in subnetting, the network bit they should not have any effect on them they should remain as it is and in class C what are the first three octet? Network and if you disturbed any bit here you changed any bit So the entire network will change Means, you had to go to Delhi and you reached Bombay. This will happen if you change the network ID So in order to fix network ID so three octet in class C belong to network so you don't even open them don't even represent them in binary but the last octet, you open that Means, What is there in last octet? one two, three, four, five, six, seven, eight there are eight positions because it is an octet Octet means eight bit so we had written places eight times Similarly let's say what I am doing 200.10.20. one two, three, four, five, six, seven, eight What we are doing here? First ID, means The three octet of this network there are 24 bit, 8, 8 and 8 don't disturb this. we will use this last octet It means to use it that the first position the first position which is msb here What we will do to msb bit? We will fix it. Means, this one msb here I have fixed it here Fixing it means that to the whole network what I did in two parts? I divided it Dividing in two parts means that that this network one is subnet 1 and other subnet 2 the one which is subnet 1 What we did in subnet 1? In the first value what we did there? we made it zero and other one which is subnet 2, so the bit there, what will it become? It will become 1, this means it is fixed. This 0 is fixed you can't change it and this one is fixed here you can't change it So, now what to do? Its easy. How many are left at last? 7 bit Fill it How will you fill it? First what will you fill? 0, 0, 0, 0, 0, 0, 0 What will be next? 0, 0, 0 0, 0, 0 1, 2, 3, 4 5, 6, 7 What you will do to 7th position? You make the 7th position one and this position what it is already? 0 fixed and the network after that is fixed doing similarly you do 1, 0, 1, 1 doing like that in the last 7th bit you have to make variation Upto where you will make variation? What is the last octet formed? What is the last value formed? This first 0 we have is fixed 1, 1, 1, 1 1, 1, 1 1, 2, 3, 4, 5, 6, 7, 7 ones So how will you write it in decimals? 200. 200.10.20.0 from here upto where? 200.10.20. see this one is the last octet so what are 7 ones? 127 Because what is last value, it is 0 you don't have to change it you had fixed it, then only we have divided it logically into two parts always we have to reserve the host bit so we reserved one bit of the host that is msb it is divided in two parts if we reserve two bits of host then this can be divided into four parts and if we reserve first three bits of host then we have eight parts So in this way we can divide So what did it become? 127 All these became 127 Now if we see this What will it become? What will be the first value here? 0, 0, 0, 0 0, 0, 0 what will be next, 0, 0, 0, 0, 0, 0, 1 next 0, 0, 0, 0, 0, 1, 0 doing like that the last one 1, 1, 1, 1, 1, 1, 1 and what is next? Next to this you have 1 fixed, look here 1 is also fix here here also and here too it is fixed If you rewrite this overall in decimal What it will become? 200.10.20. What is 1 followed by seven zeroes? 128 to 200.10.20 don't even disturb this The first three octet you don't have to disturb this at all don't even move a single bit Now what is the last one What is eight ones 255 simple meaning Simply we reserved one bit always reserve msb you will have it divided in two parts so this has become subnet 1 whose range is this this is subnet 2 whose range is this So in which way questions come here At first this question comes If you have to divide in two parts, then write range so we have written here ranges for both What can come as next question? that What will be the network ID of this subnet? means what will be its subnet ID? So its subnet ID basically will be This will be its subnet ID and and for this subnet what will be broadcast address What is the direct broadcast address? The last one So what is 127 for this It is direct broadcast address Now if third question comes total number of host possible within this S1 what are the total no. of host? that is 0 to 127, means 128 but out of that, how many are usable? for usable do minus 2 means 126 why we did minus 2? We always do minus 2, because the first IP address what it will be for that subnet? its network ID and the last one what it will be for this subnet? Direct broadcast address Now come to S2 Now if we talk about S2 S2 will also have subnet ID So what is the subnet ID? First one that is 128 and what is the direct broadcast address of this subnet last one that is 255 So here the total No. of IP address are how much? 128 but how many are usable? that you will actually give to the host either you are giving through dscp or manual so how much you will give? 126, because you have to minus 2, here So if we look here overall at first when we had not used subnetting so we have written here, 254 are usable but now see how many are usable? 126 + 126 means 252 are usable so somewhere you got a little less no. of IP because of There are two subnets, each has its own ID each one has its direct broadcast address So what we do like this? In case you have a little bit of confusion you check this video once again and everything will be completely clear Next what we can ask here? or which question can come basically? that here we said that, of this S1 What is the ID of this subnet? What is the ID of this subnet? This one. and what is the ID of this full network? This one Means this is the ID of this entire network. And what is the ID of this S1 subnet? It is also this So sometimes we get confused that we are giving this as the network ID also and same is the ID of subnet S1 same way if we talk about direct broadcast address So what was the direct broadcast address of entire network? before subnetting that was this one, i.e 255 and the direct broadcast address of S2 What is it? That is also 255. So don't get confused at all. Because this depends whether you are inside the network or outside the network How can you understand this? Let say you purchased a plot the empty plot you have purchased that is your whole network now inside that plot you are putting multiple rooms there that is a subnetting So if someone is standing outside the house so he knows your house No. house No. is 180 Now the house No. 180 I will know obviously that we are talking about this network so as soon as any packet will come on this router this is an external gateway gateway will come to this router and there it will be written 200.10.20.0 or anything is written 10, 20 or 30 So what will it do? default marks What is the default marks class C? 255.255.255.0 So we will add it and what will you get as soon as you add it? This IP address you will get. because this subnet this router does not know what we have done inside. So to know internally What we did to find out internally? simple, what we have placed here? We placed one internal router What to do with this internal router now? The packet which is from here will be sent here, packet from here will be sent here now how it will do this? How will the packet from here be sent here basically What do we need here to send it? Mask What is the default mask of class C? 255.255.255.0 So whatever packet came from outside that will move to this network. but in this network whether we have to go to S1 or to S2, how we will find out? With subnet mask so subnet mask will obviously be where we did subnetting subnetting we did inside so the internal router what we have to give to it? subnet mask default mask is here so mask how we will find subnet mask? so subnet mask obviously will be 255.255.255 because for outer world this is class C only so this will be the default mask of class C But what we did? We have divided this subnet this network into two subnets How many No. of bits we reserved? How many No. of bit are reserved here? 1 bit is reserved so that much bit you reserved write it as 1 all the bits you reserved so reserved 1 bit after the dot you reserved 1 bit so 1 followed by all zero, seven zeroes so 1, 2, 3, 4, 5, 6, 7 7 zeroes so this is 128 means the actual subnet mask that will come is this so what subnet mask you will give here? 255.255.255.128 What is its benefit? You will see now Let say one packet came and inside that packet what is the destination address written? Let say destination address is 200.10.20.15 15 is written 200.10.20.15 Now this packet will come internally from here as it came internally what is subnet mask? 255.255.255.128 So when we masked this and this what will happen when you mask this What is 128, one followed by seven zeroes 1, 2, 3, 4, 5, 6, 7 and what is 15? 0, 0, 0, 0, 1, 1, 1, 1 so you will add this, what will happen? all zero all zero means which subnet? this one or this one obviously this with 0 so the packet will move towards this side its a simple funda. and if its address is more than this Let's say address of the packet is destination address is 130 so when you add here with 130 so when you add here with 130 so the subnet mask above will remain fix and when you open 130 what it will become? 1, 0, 0, 0, 0, 0, 1, 0 when you add this what will be the answer? one followed by seven zero, its simple we added here so what it this? 128 So where is 128? 128 is the ID of S2 subnet ID of S2 so the packet will move this side This actually is the funda of subnetting In subnetting this is also basically a question How we divide in ranges? We have to write ranges along with that also to write direct broadcast address of each subnet network ID, direct broadcast address and at last subnet mask, so to write subnet mask all the table you have reserved that much bit you make as 1 and the rest as it is you know what is default mask 255.255.255 if it is class B then according to class B if it is A then according to class A this is the basic funda of what? subnetting under classful at last let me tell you a small point the disadvantage, we had talked about advantage but not talked about disadvantage so what is the disadvantage? A small point students have to keep in mind we generally find IP address What are IP address? network ID and host ID means first you have to find its network ID and inside the network find the host then you will get the host inside the host you will have to find out port No. that is your process ID after doing this three step you will reach that particular user or or on that particular process but now your No. of steps has increased, how? First you have to find the network ID you came to this network this is the complete network of your organization In that network, on which subnet you want to go You want to go to S1 or S2 one step is increased then, let's say you have to go to S1 on which host on S1 you have to go? and in that host on which process you want to go So overall this you will have to find out So here a little computation has increased but your maintenance, management has become easy security has increased. So these are the benefits of what? of subnetting Thank You.