Cisco Certified Network Associate Day 3 (PM). Welcome back everybody.This is Imran Rafai, your trainer for this entire series. Today as you see on the screen we will be dealing with subnetting and like I discussed in the last video, submitting is a very very easy concept. Once you understand the submitting concept subnetting can, for most part be done in your heads. and you don't really need a pen and paper. And... I think once you watches this video well and if you try to learn everything that i'm gonna put in here I'm sure all of you can do submitting in your minds. When I started preparing this presentation I realized submitting is going to be a large topic which I cannot cover in one video so what I'm gonna do is... in Day 3 (PM) I will cover the submitting of class C IP Address. For Class B and Class A IP address I will have another video and let's call it Day 3 late-night. So lets call it Day 3 (LN) and I will have class A class B submitting and I will have another concept called Supernetting covered there. So lets not waste much time and get straight in day 3(pm) where we will deal with Subnetting. What is Subnetting? we discussed in our last video subnetting is nothing but breaking down a large network. Now if you considered the room that is shown on the screen.... it's a large room but just by putting this one wall in between this large room is broken down into two separate rooms that's exactly what submitting is! Subnetting is taking a large network and breaking it down and treating them as separate networks. Now to understand subnetting, we need to talk a little bit about IP addresses. There are two types of IP addresses: you have the private IP addresses and you have the public ip addresses. What is a private IP address? Private IP addresses are addresses in this range. So we have for class A - 10.0.0.0 to 10.255 255 255 That is nothing but 16,777,216 IP Addresses! In Class B 172.16.0.0 to 172.31.255 255 and that is 1,048,576 IP Addresses! In class C we have 192.168.0.0 to 192.168.255.255 which is nothing but 65536 IP Addresses..... now what are public IP addresses and private IP address? Private IP addresses are IP addresses that cannot go on the internet ... So if an internet web server gets a packet which says source IP addresses 192.168.1.1 that packet would be immediately drop because these IP addresses are the private IP addresses and they can only travel on local network.....so in today's situation..... internet assigns public IP addresses to your Router...So you have a router which would is publc facing or internet facing and they will get a public IP... Computers in your local LAN will all be assigned a private IP by your Router... or maybe this device that is facing the network.... So that's how internet works in today's scenario but when IP version 4 was designed the designers hoped that IP version 4 will be used in such a way that all the computers on the Internet would have seperate.... ....unique IP addresses..... unique IP Version 4 IP addresses because when they designed that they though.... there are 4.2 billion IP addresses in this 32bit IPv4 address and they thought that would be enough for the whole world.... forever! Maybe they did not anticipate internet to grow as it grew in the last couple of decades and then very soon they realized they wouldl run out of IPv4 and that is when IPv6 was designed and also concepts like NAT, which we will learn later...it is nothing but Network Address Translation and Private IP came about! Now what happened is when internet started growing so fast .....many devices..... you know every every human being today....you have a computer... you have an iPad.... you an iphone or any phone and all these phone and devices also try and connect to the internet! Now 4.2 billion is a very very small address space far an internet that is growing so fast! So when NAT and public private IP came about, it reduced the number of IP addresses that had to be assigned to each computers and each computers in today's scenario does not have an IP address that is internet facing! So the whole design of the internet had to be changed when the IPv4 addresses started running out! So in those days what happened is because the classful IP addresses when any company....lets say a company had two computers or ten computers.... when the went to the internet service provider and then told them that they wanted an IP address they wanted internet for their companies and companies' devices and they wanted IP addresses they would allocate... lets say for instance 192.168.1.0 range... now 1.0 range with /24 according to how we discussed in the last video it has 254 IP addresses but the company had only maybe 10 computers. So it literally wasted about 244 IP addresses! Now that is what happened and Internet IP addresses were running out very very fast and that is about the time when they realized that there was a need for submitting, where they could break down these large networks and treat them as separate networks! So before we go into submitting let us do a recap and let's see how class C IP addresses work! Class C IP address 192.168.100.225 Subnet Mask is 255.255.255.0 when we convert it into binary this is what we get and knowing what we know from our previous video, we know that the separation of network and host happens here and this is nothing but slash 24 Right? because it has 24 one's! According to the formulae 2^(host bits)... the number of host bit is 8 because we have 8 ZEROS -2 ....so this Class C network has 254 valid hosts! When you make all the host bits as 0 of the IP address That is the NETWORK ID of that network and IP addresses in that network can go from 1, 2, 3, 4, 5, 6, 7, 8,..... it goes on until all the bits of your host part becomes 1s... which is nothing but a decimal equivalent of 255.... so if you put that onto a pie chart ......0 is like the first IP address and 255 is the last IP Address.... so you have 1, 2, 3 4, 5, 6, 7, 8 and all the IP address within this range! Right? Okay let's get into submitting now is when we get into really interesting things! Lets take the same IP address 192.168.100.225 Subnet mask is 255.255.255.0.... that is your class C IP address First thing we need to know the minute you say subnetting we go into something called CLASSLESS! and when you see /24.... whenever you see a 'slash' notation... it is nothing but CIDR notation... and CIDR stands for Classless Inter Domain Routing! Now once you start doing submitting like I said you take the whole concept of class full addresses and you throw it out of the window! So from now onwards we are going to deal with class less IP addresses so we would take 192.168.100.225 this is classy C IP address so it's a slash 24 but we cannot say it is class C anymore because we are doing subnetting and be we'll be dealing with CIDR! So lets say we want to break this network into 2 as you see here on the screen! So it's like an apple if you take an apple and give it one cut it breaks into two pieces right so to break a network in to 2 we borrow one bit as shown here..... so initially this was the host part so these were all ZEROS according to classC but we want to submitting.... so what we do is from the host we borrow one bit! so instead of the line being here ... the line now will be here.... right? So this is the network part! Now..... the minute you see submitting we need to find out the network ID and the host ID for these two separate networks.... now these are two separate networks you have subnet 1 here and this is subnet 2.... so we need to find a network id of each of these subnets and the broadcast ID. How do we do that? We see the subnet mask and we see the last bit.... the last bit is this..... this is got a place....if you can remember this place value 128 64 32 16 8 4 2 1 this has got a place value of 128! That means each of these subnets have a block size of 128 including 0 so when you say block size is 128 -2 is 126 which is nothing but the number of hosts it can have..... so 126 hosts plus you have one network ID and one broadcast ID which would be 128! So what do we do?..... let's do this..... the network ID of the first one is always 192.168.100 and make this part ZERO.....so that is the first network.... that the first subnet and that's a network ID. To get the second network ID all you do is add the place value!..... So network ID of this second subnet is 192.168.100.128! How do we get the broadcast id of these subnets.......what you do is -1 from 128 so it is 127 that's the broadcast ID and of course you can't to go beyond 255... so 255 is the broadcast ID of second subnet! That's all there is to submitting.... so subnetting is nothing but borrowing a bit from your host part and create a network..... so you're breaking this network into two so borrowing one bit .... so originally if you remember subnet mask was 255.255.255.0 now the new subnet mask because we borrowed one bit this part ... let me take another color this part is now.... the fourth OCTET is nothing but 128 because '1000000' is nothing but 128! in Decimel! And as we know because we have now slash 25 because we have 25 bits in the network part These addresses are going to be slashed 25 addresses Right .... now that is nothing but subnetting and it's very easy! To understand this concept a little more, we take another example! Now you get an IP address 192.168.100.225 subnet mask is 255.255.255.192 we will convert he subnet mask into binary... that will be THIS and if you see the original separation was here.... because of this new borrowals.... our separation is here now.... right? What does the last bit.... the place value of the last bit is 64 so each of this subnet will have 64 as the block size... Another way of doing this is if you take..... we know that the whole network is 256 divide by 4 it becomes 64! If the block size is 64 each of the subnets can have 62 valid IP addresses and you can find that obviously by using this formula 2^(Number of Zeros)-2 = 62 The network ID is 192.168.100.0... that is the first network's network ID .... by making this 0.... keep adding the place of the last bit.... so 0... 64 then add another 64.... which is 128 an add another 64 which is 192! How to get the broadcast ID of these networks? Minus 1.... so 64 -1 is 63...... 128-1 is 127..... 192 -1 is 191..... this is the broadcast id of each of these subnets.... and this as we know is slash 26 because 192 is nothing but borrowed 2 bits.... so it is slash 26 For class C borrowing table..... I have made a small table to make things very easy.... when we borrow one bit the mask value becomes 128 ... if you see here.....so it is going to 255.255.255.128 when you borrow one bit it creates 2 subnets..... how do you know 2 subnets? It's very easy ... 2^number of bits borrowed! 2^1 is 2.. the block size as we see here.... if one bit is borrowed block size is the place value.... so 128 is a place value! number host is always 2 minus from the block size! CIDR is slashed 25 because it was 24 class C you adding one more... so it is slash 25 When you borrow 2 bit, the mask value becomes 192 That is 128 plus 64..... so the mask value is 255 255 255 192 It creates 4 subnets If you borrow 2 bits ... 2^2 is 4 subnets Place value is 64.... so that's the block size....number of hosts is always MINUS 2 .... so it is 62 CIDR is slashed 26 ....similarly for 3 borrowed its the mask value is 224 as you can see on the bottom of your screens that is also got by adding where ever you have 1s.... so 1, 2, 3 128 +64 + 32 is 224.... It has 8 Subnets Block Size is 32 - 2 is 30... CIDR is /27 and block size... you see the last bits value is 32 .. it is the block size. Similarly 4 bits is this.... 5 bits is this... 6bit if you borrowed.... this is the value I wouldn't want you to remember the whole table but I would want you to remember this value .....so whenever you see onebit borrowing you can know the subnet mask is 128 if is 2 bits... 192....3 bits is 224.... 4 bits is 240... 5 bits is 248 6-bits is 252 So this is going to be a magic number so just remember this number I think that is going to be very, very very easy and the ofcourse the block size can be derived by looking at this magic table and the CIDR obviously you can see how many bits you are borrowing... just add that to 24.... and you have the CIDR. This is pertaining to class C..... we will be discussing about Class B and Class A in the next video. All right let's get into some problems.... we will try to understand submitting a little more! We have a requirement it says create 3 subnetworks. Use a class C IP address 192.168.1.0 and it says determine the network ID and broadcast ID of all the subnets. First what do we do can we break a network into 3? No we can either break it into 2 or 4 it's always multiples of 2 ....so to create 3 network we break it into four networks.... if you want to break in 4 we know we have to borrow 2 bits and the last bits place value is 64 then we know that each of the subnets have a block size of 64.... that is 64 -2 is 62 valid hosts in each of these subnets. How do we get the Network ID of each of these subnets? Start with 192.168.1.0 add 64 .... add 64... add 64! .0 is here .64 is here .128 is here .192 is here! these are all the network ID of each of these 4 subnets How do we get the broadcast ID? 64-1=63....so that is the broadcast ID of this network... 128-1=127.. 191 is the broadcast ID here... and 255 is the broadcast id here!!! Very simple! And questions like this.... determining the network ID and broadcast ID is going to be part of your CCNA So start creating the solutions....So start doing these calculations in your mind .....it's going to be very very easy and in your exams you will not have much time it will be very fast. They will ask you a question and then if you spend more time on that one question you're gonna waste a lot of time later in the exam. So immediately you see a question quickly get the network ID and broadcast ID and answer it.....lets look another question... so your question is going to be something like this! you will have an IP address ... they will give you a subnet mask and they will tell you find the network ID and broadcast ID of this particular IP address! Quickly we say stash 27 slash 27 we know ....24 is Class C... 25 26 27 so that is three bits! so as seen on the magic table three bits that means each of these subnets have 32 each of the subnets have 32 as block size.. that means it has 30 host in each of these networks We start at 192.168.225.0 as your network ID of the of the first subnet and keep adding 32 0 32 64 96 128 160 192 224 that's your network ID how to get the broadcast id? 31, 63, 95, 127, 159, 191, 223, 255 Now where does this IP address come.... 192.168.225.212? Each of these number represents the last OCTET... so 212 comes here .....that means the answers for this question.... to find the network ID and the broadcast ID is this ....192.168.225.192 is our network ID and 192.168.225.223 is our Broadcast ID So in our exams you will just have a question like this and they'd give you four options and immediately if you do this you can know that this answer is the right answer..... so you don't need to waste much time quickly can go to the next question Alright next let's get into another concept called VLSM. VLSM stands for Variable Length Subnet Mask In all our previous example we broke down a network into equal parts..... now that is not feasible in many cases. Lets for instance take this question.... it says design a network with 3 networks marketing, sales, management marketing require sixty computer sales request 100 computers management request 34 computers.... Now like in our previous question...you cannot break a network into 3.... you break it 4... but the problem is the minute you break it into 4... each of them will support only 62 host.... but we have a requirement for 100 computers in the sales department but in this because we need only three there are sixty 2 hosts here that is wasted So a better way of breaking down the network is like this .... we break 126 as one part and then you break and 62 in 62 for the other parts how do you do that..... first take the highest requirements.... the highest requirement is 100 computers Take your magic table see how many bits you need to borrow for 100 hosts First we borrow one bit.... can be borrow 2 bits? So the minute we borrow 2 bits, the block size become 64 64 means you only have 62 valid hosts.....but we need hundred hosts... so we have to stay at 1 bit borrowing When you borrow 1 bit let's start with 192.168.1.0 so your network ID is 0 but with borrowing of 1 bit, the block size is 128 So the next IP address that is gonna start is 128 so the broadcast ID is one less its 127! In between we have 126 valid hosts which is perfectly fine to accommodate our sales department! now next highest is marketing department which requires sixty computers sixty computers.... can we go to 3 bits? No we can't because it is 32... we need to stay at 2 bits....so when we borrow 2 bits.... our block size is 64....... so we start with an IP address 192 168 1.128 because that's the next available IP address and we add 64 so that is .....192 is going to be here one less than that is 191....so 128 to 191 if you add both these numbers... it is 64 IP addresses ..... so that's block 64 is the block size -2 you get 62 valid host....which is perfect for the marketing department which requires only 60 computers So network ID is 192.168.1.128 and the broadcast ID is 192.168.1.191 But remember here it is slash 25 but in the marketing department it's going to be slash 26 Next we go to the management department So the management requires 34 computers We can't borrow 3 bits becasue in 3 bits we get only 30 valid host..... if you see here 32 - 2.... but we need 34 hosts so we leave it at 2 bit borrowing and we know the next IP address is 192.168.1.192 and since it is 2 bit borrowing It is a block size of 64.... So the broadcast id is 255 network ID is 192.168.1.192 /26 and broadcast Id is 192.168.1.255/26 It's very easy, isn't it? It is very easy and it is something I think....er.... ofcourse you require a lot of practice.... but if you practice it well it is going to be very, very easy..... so what we will do is end this video here..... We will come back in our next video we will deal with class A and class B submitting and ofcourse we will also deal with another concept called SUPERNETTING and we will try and do a lot of CCNA exam prep questions so that we get practice and of course like I've told this before I don't think I can repeat it enough...please watch this video as many times as you want ....so that you get through with the entire concept of subnetting and you should be able to it in your mind..... you don't really need to pick up a pen or paper... you dont need to take a calculator.... obviously you cannot get a calculator for the exam... so dont even think about your calculator but I would say try and get it in your mind so that it becomes second nature to do all your binary multiplications, binary tables and all these things should be second nature so you can quickly find out the answers and your subnettings. If you have any questions like I have always told you, please feel free to write to me or you could also comment on the section below this video Please share this video..... please like it and please subscribe to our YouTube channel .....Thank you so much for watching and I am here to help you anytime ANYTIME....you want .....Thank You so much.... BYE