Skip to main content

I'll take an example of a computer network and show you how does

I'll take an example of a computer network and show you how does 

I'll take an example of a computer network and show you how does
I'll take an example of a computer network and show you how does
the actual things work in computer networks let's say you are in India and this is somewhere somewhere in one network Airtel network in India and this is your host host means your computer see this is the network let's assume this is the atl network in some region in india and this is your host and this is a process okay process so what is it network and within the network there are many hosts and one of the hosts is your computer and the other one is you know it's in a host there are many processes and one process is you have opened your web browser and you have type

www.google.com now you want to go to Google and get a web page and assume that Google's Google's network is in California somewhere in US and this is the network in which Google is present and now inside that network one of the server is Google server this is the host and one of the

process is this server which you want to connect which means from your process at home you want to connect to the process of Google we not to get the web page right so what did you type in your web browser is www.google.com now when you type this that name domain name you know that domain name has to be converted in such a way that you are going to identify

the network here see which means your request has to start from here and it has to first reach the destination network isn't it it has to reach the destination network and after reaching the destination network your request has to reach the host destination host within the network and after reaching the destination host it has to reach

the destination process right therefore step one is your request has to reach the destination work and step two is if a request has to reach the destination host and step three is your request has to reach the destination process there are three steps involved

in here right so in order to get the identify the network delay station network and destination host you have actually given only www.google.com the domain name right so you gave only this www.google.com and now using this name this domain name we have to identify the network and then the host and then

the process right so somehow we have to convert this domain name into some numbers so that it can be identified so there has to be a service which converts the domain name into IP address Y IP address is IP address will have two parts one part is called network ID

and other part is called host ID therefore using network ID we can reach the target network and using host ID we can reach the let know target host and there in order to reach the process we need something called as port number since since you are talking about web service which is HTTP all

The web services will be run at port number 80 that is globally known so everyone knows that you know if the if it is a web service it is 80 therefore in order to reach the process the port number will be used which is already predefined as a well different port right so this is how it happens first thing is your dominant of mine name has to be converted into IP address

and your IP address is going to have two parts one is network ID and other is host ID network ID is used to reach the network and host ID the user is the host and there in order to reach the process we actually need the process number also which is nothing but port number and most of the port

numbers are already predefined and they are fixed right and for the well known services since it is a well known service it is fixed if it is not a well known service you should even know what is the port number at which you know the target server is running for example FTP it is 21 SMTP it is 25 so likewise we have all the for well-

defined ports for well-defined services we have a different port numbers now the step is how are we going to convert this domain name into IP address so in order to do that see one thing is if you know the IP address directly you can contact the service server but then it is very difficult to remember the IP numbers right because we are we cannot dunno we are good with remembering the names rather than remembering the

numbers that is why even is the Internet service provider is supposed to provide you with a service called domain name service which means inside your network itself it is supposed to configure a domain name server so before actually contacting the Google you will actually contact the domain name server and ask for the IP address of what is the IP address of google.com and now DNS is going to return you the IP

address of google.com once you get the IP address of google.com you know you can directly reach it now this entire procedure which is converting the domain name to IP address is actually overhead see we wanted to reach Google we didn't want to reach DNS but then we had to reach DNS because we are we want to convert it right therefore this entire step is called DNS overhead so

what we generally do is we don't go to DNS all the time we generally do it for the first time and then we save the IP address in our computer for some time and whenever we know there is X it has expired generally we know we use a log for some time and whenever it is expired again we will go to the DNS so first time when you are

contacting any server sometimes the service will be late because there is DNS overhead second time if you use the service then I know it will be straight forward right so one thing you should note is the main main important thing in this

communication is IP address so let's talk about IP address in detail and before talking about IP address I want to talk even about the binary numbers okay so I wish I'll talk about binary numbers and then IP address now yeah so now let's see about I before going to IP address

I want to talk about binary numbers a bit so binary numbers are you know this right number system has you all and the first binary the first number system was unary right so what is unary number system is we have only one symbol which is nothing but zero so this is the most popular number

system you know even you have used it in abacus abacus long back in your childhood right so if I had to represent any number like 1 I represented using 1 0 if I had to represent 2 I represent using 2 zeros if I have to use 3 I know it is 3 zeros so this is nothing but unary number system and after that unary number system the most popular number system is decimal number system in decimal number system you know we have

 0 1 2 3 so on 9 which means 10 symbols and you know you are very much aware of it now the next number system which is popular is binary because of the invention of the computers we have been using binary in binary number system the base is 2 and therefore the number of symbols we have is 0 and 1 so always remember if the

base is in if the base of a number system is n we have n symbols in the number system and all the symbols will be starting from 0 1 2 3 so on n minus 1 right and now the binary number system we have 0 comma 1 and then we have hexa octal is Merchiston octal number system in which the base is 8 therefore the symbols are 0 1 2 3 so on 7 and in hexadecimal number system we

have 16 16 symbols but then since we have only 10 digits 0 1 2 3 so on 9 we have used ABCD ABCD so on F as the remaining 6 right so these are 10 and + 6 that is right it is hexa and now a represents 10 B represents 11 and F represents 15 okay so this is all about the number system so we have all these number systems but no the most

popular number system is binary coming to computer science therefore I would like to you know I'd ask you to be very good with binary number system especially the powers of tools and coming to this you know you should you should have grip over these numbers so to power 1 to power 1 - Part 2 to power 3 so on to power 10 - pattern is nothing but 1 0 to 4 and

sometimes it is also called as K K represents 1 0 to 4 okay and then M M represents to power 20g Giga to power 30 T tera to power 40 so it should be very good with all these all these conventions notations what is M and what is G what is G especially in computers and it is going to be very important and we shall talk more about binary numbers once let us say I have one bit one bit one binary bit with one bit how many numbers are possible how many

binary numbers are possible okay so with one weight we can have two binary numbers 0 and 1 if I have 2 bits if I have 2 bits how many binary numbers are possible I can have four binary numbers 0 0 0 1 1 0 1 1 which means 0 1 2 & 3 with 3 bits with 3 bits how many binary numbers are possible you know it is going to be 8 right why I

have 3 blank spaces and 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 okay now this this part you know you know it well now next thing is if I choose one bit if I choose one bit how many parts will I be dividing the entire space into let us say this is called the address space or number space with two

bits this space contains four numbers with three bits this space contains eight numbers right so now my next question is let us assume that we have such a space and now if I choose one bit let us say I'm choosing the first bit if I choose one bit how many parts will I be dividing the entire space into it turns out that we could divide this entire space into two parts isn't it if I choose one bit I am dividing the entire space into two parts one part contains all zeros in this

selected bit and other part contains all ones in the selected bit isn't it so if I choose one bit I am going to divide the entire space into two parts isn't it now in this in this space also just check it if I choose one bit the first bit I'll be dividing the entire space into two parts one space will be having zeros in the selected part and other space will be having ones in the selected part all right now if I

choose two bits two bits then I'll be dividing the entire space into four parts one space will be having zero zero in the selected locations other space will be having zero was in the selected location other space will be having one zero and other space will be having one one right so if I choose two bits I'll be dividing the entire number space into 2 power 2 which is nothing but 4 parts so similarly if we have chosen 3 bits then how many parts would you be dividing the

entire embassy into 2 power 3 parts which is nothing but 8 isn't it if you have chosen 3 bits then how many parts would be actually dividing it which means you know all the bits are going to be distinct and every number is going to be in a separate part therefore you are going to get to power

three parts which is nothing but eight parts right so one thing you have note here is if I have a n B number if I have n bit number a number is containing n bits then the total number of know the total number of bits or numbers present in the number spaces to power n so to power and numbers will be present in this space right and if I choose K bits anywhere first leading part or no any any part if you choose K bits then you are dividing the entire number system into 2 power K parts isn't it so totally there are 2 power n numbers by choosing K bits you are dividing it into 2 power K parts

therefore what is the size of each part see we have 2 power K parts which are containing a total of 2 power M numbers isn't it then what will be the size of each part each part size will be 2 power n divided by 2 power K which is nothing but 2 power n minus K so this is important now coming to computer networks this n bits is nothing but I I P address and the K bits which I choose is nothing but network ID part and n minus K bits is nothing but host ID part so if I choose K bits then I will be getting 2 power K networks and size of each Network is 2 power at minus K it can be extendable to operating systems in

operating systems this M it is nothing but generally address the address of a memory and the K bits is nothing but the page offset or no page number or block number or segment number and the remaining bits are nothing but phase offset or page size right and coming to computer organization this bits is nothing but the address and these K bits is nothing but tag or block

offset and this is nothing but block size that is nothing but block number okay now these the same coming to know this computer networks we have IP address whose size is 32 bits right in computer networks the IP address is going to be 32 bits 32 bits okay and now these 32 bits initially what they do you know using the 32 bits we know that the number of IP

addresses possible total number of IP addresses possible is 2 power 32 that is what we know and now what they thought was initially when the company that works first you know first introduced for ARPANET and other networks they divided it into static parts like this they divided this 32 bits into 8 bits of network ID and 24 bits of host ID part with 8 bits of network ID how many networks do we get to power 8 which is nothing but 256 and with 24 bits how many what is the size of each network is 2 power

24 2 4 24 is nothing but 16 million hosts which means if I use this classification of 8 bits for network ID and 24 bits for post ID I am going to get roughly 256 networks and size of each network is going to be 16 million so 256 is a very small number in 1980s and 1970s this 256 number was enough there is an is computer networks

used to be are the networks used to be very very small I mean there used to be very less number of networks every caller used to be one network and roughly there are hundreds of networks even less than hundreds so initially when they proposed this ARPANET and all 256 networks was good enough but if you take today's

networks even in one city if you take any city like Delhi of Hyderabad Mumbai even in one city we are going to have 256 networks therefore this is clearly not scalable so we didn't use this at all and moreover if you if you buy one network of this size we are going to buy we are going to get 16 million IP addresses and 16 million IP addresses is not too big number no no practical networks other than this NASA

and Pentagon have a requirement of 16 million force therefore this this system is no not really scalable that is why they have gone for the next one is class full class full number system classful IP addressing so we shall discuss about classful now let us see how the I pedals are classified in the class

full manner so we know that IP address is the 32-bit number so let's see so IP address is nothing but a 32-bit number 32 bits were there and in this study to using 32 bits what are the total number of addresses we get the total number of addresses we get using 32 bits is nothing but 2 power 32 so 2 power 32 numbers we get in this right so what they did was instead of dividing it directly

into network ID part in host ID part they used some other way which is actually scalable so they have chosen the first bit the first bit has been chosen if you choose one bit we have seen this in the previous lecture if you know if you choose one bit we are actually dividing the entire IP addresses into two parts this that 2 power 32 numbers

 will be actually divided into two parts one part will contain 0 in that first bit and the other part will contain one in the first bit right so total numbers were 2 power 32 and I have chosen one bit because of which we divided the entire numbers into two parts then what is the size of first part at what is the size of second part the size of first part

is 2 power 31 the size of second part is 2 power 31 there is an is 2 power 32 when it is divided into half we are going to get 2 were 30 wasn't - or 31 right and now the second part the first part has been left out like that and now they are chosen the second part if you look at the second part how many numbers were in the second

part the total number of numbers present in the second part or 2 power 31 correct and moreover our IP address was 32 bits out of which first bit is already chosen we had 32 bits out of which first bit is already chosen and that bit is set as 1 right and now in the remaining part this size this size of this total part is 2 power 31 this one is 2 power 31 so in this to power at it one

numbers I am going to choose the second bit so if I choose the second bit if I choose the second bit then I am again dividing the entire power part under addresses into two parts the first part will contain 1 0 as the leading bit 1 0 1 0 so on 1 0 and the second half will contain 1 1 1 1 1 1 1 1 so on right now the actual size of this entire day you

know number space is 2 power 31 I divided to two parts therefore size of each spa each part is 2 power 30 here 2 power 30 right and we don't we don't do anything with the first part and we take the second part now if we take the second part how many bits our IP address is now it doesn't change it is having 32 bits as usual but then out of which the first two bits are already fixed as one one right and how many bits are

remaining the number of bits remaining is 30 therefore the total size of the center number space is 2 power 30 okay now in this two part 30 I'll choose the third bit so first two bits are already fixed which is one one now I am choosing one more bit

because of which in the third bit because of which the entire amber specs is divided into two parts the first part will contain 1 1 0 1 1 0 so on 1 1 0 and the second part will contain 1 1 1 1 1 1 1 1 1 now what is the size of each part 2 power 29 by initial sizes to 4:30 at of which I have Dino taken this even if it didn't understand this maybe since we have fixed up 3 bits how many bits are remaining now 29 bits so how many

numbers do you get with 29 bits to about 29 even you could use it that way also now I will not take tiles not do anything with the first part I will choose the second part this part and now our IP address is as usual 32 bits how many bits are there in here the number of bits in this one is 3 bits right so already first three bits are fixed as 1 1 1 then how many bits are remaining 29 bits using 29 bits how what are the size of the entire number spills to power 29 now I'll

choose the fourth bit if I choose the 4th bit then I am dividing the entire number space into two halves right so one half will contain one see the total number of bits remaining is 29 therefore the size of this entire number space is to about 29 now the first stop is already containing 1 1 1 now have chosen the 4th bit the 4th bit could be 0 which means in the first part all the numbers will contain 1 1 1 0 1 1 1 0 right and in this part all the numbers will

contain 1 1 1 1 1 1 1 1 so on 1 1 1 1 right therefore what is the size of this part size of this part is 2 power 28 and size of this part is 2 power 28 right so this is how they classified the entire IP addresses into now the first part which starts with 0 the first part which starts with 0 they call details class a and the second part which starts

with 1 0 they call it as Class B and the third part which starts with 1 1 0 they call it as Class C and this one as Class D and this one else Class E now we shall go into each class one by one and we shall discuss what is what is about them but I know before that I want to discuss one thing see now in class a what is the total number of IP addresses present that is one question in class say the total

number of IP addresses present in stupor 31 in Class B what is the total number of IP addresses present it is two four thirty in Class C what is the total number of hybridizes present to about twenty nine in Class D it is two power 28 that is the first thing you have to remember so one kind of question is given any class what is the total number of hypotheses present okay and

now I'll just I'll just explain by taking each class one by one about what is the range and all okay so let me take about Class A so I'm talking about Class A okay now before going to any know any further I want to discuss about how the IP address is represented IP address can be represented in two ways one is you can represent it as a 32-bit number all zeros and ones that is one way and second thing is you can convert

the enter 32 bits into a decimal number that will be a very huge number that is one way and the third way is you could divide the entire IP address of 32 bits see we have IP address of 32 bits okay so we can divide the entire IP address of 32 bits into four parts right of eight bits each eight eight eight eight and convert these eight bits into decimal number and then put a dot in the middle that is called dotted decimal

representation so what is data decimal representation is given the 32 bit number I am going to divide it into 8 bits 8 bits 8 bits 8 bits they are called octaves we are going to get four octaves and take each octet and encode it to decimal and take the decimal number and put the dots in the middle that is also called as dotted decimal

representation which is the most popular representation you could use any representation like binary number or decimal number but then the most popular representation use practically is dotted decimal number system right which means we are going to divide into eight bits and then we are going to put it dot now one interesting point is one thing is for sure

given a IP address in binary you could just see that if it is starting with zero you can say that it is class here if the binary number is starting with one zero you can say that it is Class B even starting with 1 1 0 plus C 1 1 1 0 it is Class D that one you can directly say but then given a number in dotted decimal number system how could you find out what is the class to which IP address

belongs to in order to answer that question you know it is easier if you take the first octet first 8 bits and examine the first bit isn't it because the first octet contains the first bit now if it is starting with 0 then it is

 class here and one more thing interesting thing is these are all called prefix course prefix course means classiest starts with 0 Class B starts with 1 0 Class C starts with 1 1 0 and Class D starts with 1 1 1 0 and class II starts with 1 1 1 1 right so now if you take any prefix of you know previous class let us say 0 that will not be a prefix of any of the others right which means 0 will not be a

valid prefix to any of the other classes if you take 1 0 1 0 will not be present as a prefix for any of the other classes similarly 1 1 0 is also not 1 1 1 0 is also not so it is easier to we know classify the IP addresses in two classes this way let's talk about class here first I am just examining class here here ok so you know you know that class

here contains class here is starting with 0 and there are 32 bits Algeciras it i want to talk about class here okay the first point is number of IP addresses in class here is 2 power 31 IP addresses okay and second point is they have taken the 32 bits and they divided class here into two parts like this the first bit is going to be 0 as it is and how many bits are remaining seven bits are

remaining right so they have taken 8 bits as network ID and 24 bits as host ID part right and now the first bit is already fixed a 0 out of 8 bits first bit is already fixed as 0 then how many bits are remaining here 7 bits so with 7 bits how many networks of class he are present with 7 bits to power 7 which is nothing but 128 networks of class here or present right and now if you take any

network how many IP addresses are present in one class it is 2 power 24 to power 24 is 16 million there for 16 million IP addresses are present per one network in class here these 2 numbers are important right so theoretically there are 128 networks of class here and in each network there are 

16 million IP addresses right but then practically let's see the numbers ok now the next question is if I have these 8 bits what is the range so 8 bits are this 0 followed by 1 2 3 4 5 6 7 right I am talking about only the first octet why am I talking about only first octet is that is what contains these starting bits if I know the starting bits then I can know what is the class it belongs to

therefore I am not examining all the objects I am examining only the first octet so using the first octet I want to see what is the range of numbers that can fall in first octant if the network actually belongs to class here or if the IP address belongs to class here right so now 0 and all these 7 bits can be the starting can be zeros 0 zero zero zero zero zero right therefore starting at

network is zero starting number is zero and next one is zero zero zero zero zero zero zero 1 therefore the next number is 1 right and next one is 0 0 0 0 0 1 0 therefore the next number is 2 so on the last number is 1 1 1 1 1 1 1 7 1 7 months is nothing but 127 ok so remember this 1 1 is nothing but 1 2 1 is nothing but 3 3 months is nothing but 7 which means if I have only once it is

nothing but 2 power number of ones minus 1 isn't it it is 7 because it is 2 power 3 minus 1 if I have n once and once then it is nothing but 2 power n minus 1 if I have 7 months it is nothing but 2 power 7 minus 1 which is nothing but 127 therefore the number of networks or 0 to 127 which is nothing but 128 but we are not going to use 0 and 127 I'll explain you later why we are not going to use 0 and 127 practically

therefore practically the number of networks present in class yeah is 126 even though we got 128 we are not going to use 0 as a valid plus your network and 127 as a value classier Network therefore even though we have 128 as theoretical number practical number is going to be 126 so practically 126 networks of classy are present and in each Network we have 116

 million IP addresses right so this is the range so now the range of the class here is 1 to 126 ok so the range of class a is nothing but 1 to 126 so if you see any IP address in which the starting number is either in any of them in one to 126 you can say that it is class here network right so if you look at class your network we have observed that there are nearly 2 got 24 I P addresses in

class via network which means 16 million holes you get configure million hosts so generally who will buy this class a network is a very big organizations like NASA Pentagon such things right but a small organizations they cannot afford to buy it therefore we go for Class B in Class B they know since it is very big classiest very big they solved it in two plus B so let's see about what is the range and what are the other

things of class be coming to Class B again we have the same thing so one thing is in Class B how many Iparis are present to power 30 IP addresses are present and all these to power that the IP addresses have to be divided into networks and force right so whatever you want to play in Class B had to play with only 2 power 30 numbers so the question is how many IP addresses are totally present in Class B it is 2 power 30 and then we are going to divide into

Network sender host right so first thing is if I have a 32-bit number Class B always starts with 1 0 which means first two bits are fixed you cannot do anything with the first two bits they are already permanent permanently fixed right and how they divided the 32 bits is they divide into 16 bits of network ID and 16 bits of host ID this is what they divided now with using 16 bits of network ID okay 16 bits of network ID we are going to use it already one first two bits are fixed just 1 0 then how many bits are remaining the total number of bits

remaining is 14 so how many networks are present in Class B it is 2 power 14 which is nearly equal to 16,000 right roughly equal to 16,000 networks so in Class B number of networks is 16,000 which is 2 power 14 and if you buy any Class B Network how many IP addresses you get is 2 power 16 IP addresses are present in one network right so totally there are 2 power in networks and each network contains 2 power 16 IP addresses therefore total number of IP

addresses to power 30 that is what we have we just divided into networks and opposed okay and now I want to see the range just by looking at the first 8 bits I want to find out what is the range of Class B I am NOT interested in looking at all the 16 bits or 32 bits I want to see the first octet so first octet is nothing but just the first 8 bits right so

first 8 bits are nothing but 1 0 followed by 1 2 3 4 5 6 so these are the first eight bits right now now 1 0 followed by 6 bits 0 0 0 0 this is the first number so what do you get 128 so the weight of the you know first you know if you have 8 bits and the first bit is 1 the weight of this is 2 power 7 which is nothing but 128 you can convert that binary numbers okay that I will leave it to you as exercise and the last one is 0 next 1 is 0 0 0 0 0 1 which is nothing but 129 and 0 0 0 0 1 0 which is nothing but 130 so on the last

one is 1 2 3 4 5 6 6 months so 6 months is nothing but 31 already we have 128 as the weight of the first bit and there are 6 bits here so which is 31 so 128 plus 31 which is nothing but 1 second 6 months is not 131 6 1 6 2 power 6 minus 1 which is 63 therefore 128 plus 63 is 191 therefore the last one is 191 you need not buy hot this range you know we can derive it this way so the range of the practical range of Class B is 128 to 191 now one interesting question is if you look at the range of plus B you get confused that you know I'm showing only 128 to 191


numbers so which is nothing but 64 I am showing you only 64 numbers but then I am saying that there are nearly 16,000 networks I am showing you 64 numbers and I am saying that there are 64 thousand numbers how is it possible is we got only 64 numbers because we have examined only the first octet of 16 bits there is one more octet isn't it the total the total network ID part of plus B is 16 bits but then I have shown you only eight bits here using 8 bits I got 64 numbers and how ma

Comments