Lec-45: Find Range, Network Id, Host, Broadcast address with Numerical Examples in Hindi - YouTube

Channel: Gate Smashers

[0]
Hello friends, welcome to Gate Smashers. Let's solve one question on
[4]
Classful IP Addressing which will give you more clarity about the concept of IP Addressing
[10]
and this type of questions in GATE exam, UGC-NET,
[14]
Banking exams and many places you will get this type of questions.
[19]
Even in your college or University level exams
[22]
this type of question you will get many times
[25]
and with this question you will get clarity on
[28]
how we can solve questions on IP Addressing.
[32]
So here firstly there is a given IP Address, this one.
[38]
Now first of all I have to find that, I have already written 4 questions,
[44]
I have to find Network ID, 4th Host ID, Last Host, etc.
[49]
First, when you get this type of question, when you are given only an IP Address,
[55]
the first point is you have to find its class, means
[59]
which class it belongs to, if it is a Classful addressing.
[63]
I am already talking about Classful addressing.
[66]
So we have to first of all, find its class.
[70]
So what are the values of classes, the ranges we checked in the videos,
[75]
from previous videos you can study about range of Class A, Class B and Class C.
[81]
The range of Class C is 192 to 223.
[88]
This you have to remember.
[90]
Now in this Class C if you see the first octet,
[94]
always to find the class of an IP address, which class it belongs to,
[98]
you have to see the first octet only.
[101]
Means you can find out just by looking at the first octet.
[103]
So what's the value of first octet? 201.
[106]
Octet means all these values represent 8 bits,
[110]
means 8 bits, 8 bits, 8 bits and 8 bits.
[113]
So total 32 bits IP address is given to me.
[117]
So does 201 lie in this range? Yes, it does.
[121]
So what is the first point I know here?
[124]
This IP address belongs to Class C.
[130]
Now my next question is calculate the Network ID.
[134]
Although this question was not asked, but you will have to find it out
[137]
because here the question asked is Network ID,
[141]
that this IP address comes in which network.
[144]
So to find out that network you need the value of default mask.
[150]
And for default mask you need to know the class first
[153]
because value of mask changes according to the class.
[157]
So now we know Class C, so what is the mask value?
[161]
Mask value is 255.255.255.0
[168]
This is the default mask of Class C. So now I take default mask here,
[174]
what you have to do here is perform AND operation.
[178]
When you perform AND operation you will get the answer to the first question that is Network ID.
[183]
To perform AND operation one method is you open this,
[187]
means write 201 and write all values in binary,
[191]
and then write the values below in binary and perform AND operation bitwise.
[195]
Take each bit and perform corresponding AND operation. But
[199]
I will tell you a simple point, 255 means all 1s.
[204]
And if you AND any value with 255 then the same value will come again,
[210]
means 201 will again be 201. If you want to solve then
[216]
let's say if we open 20, to open 20 we can write it in binary as
[221]
000... 0
[227]
This will be 1.
[229]
00010010
[236]
This will be 0, 1, 2, 3, 4. 2 raised to power 4 is 16, and 2...
[243]
Sorry, this one will be 1.
[245]
Means you have to first convert it into binary.
[250]
When you convert into binary, this will be the value of 20 in binary.
[255]
255 is what? 1111 1111
[258]
If you simply perform AND operation here, you will find out
[264]
AND of 0 and 1 is 0, 0, 0, and 1 is 1,
[267]
1 & 0 is 0, 1 & 1 is 1, 0, 0
[274]
So the same value has come again, so you don't have to calculate again and again,
[279]
you save time here and copy the value as it is.
[283]
40 and 0. Here if you open 40, 0 means all eight values are 0.
[289]
So if you AND any value with 0, the answer will be 0 only.
[293]
So here you got the answer to the first question, what is the Network Id?
[298]
201.20.30.0
[302]
Means somewhere there is a network it can be of any organization,
[307]
let's say the organization name is ABC.com
[311]
Let's say the Network Id of that ABC.com is 201.20.30.0
[319]
You visualize it this way, that the whole world,
[322]
the entire worldwide web knows you by this IP address.
[328]
Now what is the second question? 4th Host. Host means what?
[332]
You find out the network, and now you have to find out the hosts.
[336]
Now in Class C how many hosts are there?
[339]
The last octet, the 4th octet in Class C tells about the host.
[345]
4th octet means how many hosts are possible in Class C? Total is 256.
[350]
But out of those, values of 2 hosts or 2 IP addresses, we don't use.
[356]
The first one and the last one. So here we talk about 4th host.
[362]
This is a Network Id. So after this what will be the next IP address in this?
[368]
Next IP address will be 201.20.30.1
[373]
Means you don't have to change this, you can't change Network values.
[377]
If you change this value then you will go from ABC.com to some XYZ.com
[383]
So you changed the whole network. So that's why only host bit is changed,
[388]
in Class C only the last octet tells about the host.
[392]
So if you open this, then 0000 0000
[396]
means keep changing these. So what becomes the first host? 001
[402]
Second host becomes what? 10
[404]
Third one becomes what? 11. Fourth one becomes what? 100
[409]
Means if you convert its value again to decimal then this value will be 4.
[415]
Means 201.20.30.4
[422]
So this will be the 4th host.
[425]
Although if you see it from 0, if you start from 0 then it is 5th,
[431]
but this value with .0, this is not to be given to any host
[437]
because it is to identify the whole network.
[441]
So no host will get this value. So first host will be .1
[446]
Second .2, Third .3, Fourth will be .4
[450]
So what becomes the 4th host? .4
[452]
This way if you are asked what will be the 10th host? .10
[456]
Means 201.20.30.10
[461]
Next, last host, this is a tricky question. If we talk about the last host,
[467]
then you don't have to touch 201.20.30,
[471]
only last values are what? 00000000
[476]
So in these values, what can be the maximum? 11111111
[482]
So what is your answer? 255. Means what is the value of last host? 255
[488]
But wait, this is the last IP address.
[493]
This is the last IP address of this network, this ABC.com
[499]
And we never give the last IP address to any host
[503]
because the last IP address is used as a broadcast address.
[508]
Means if I don't give 255 to any host, I don't give to any user,
[513]
then what will be the last one? One less than 255, that will be 254.
[519]
So my the answer to the third question comes 201.20.30.254
[528]
Now at last we talk about the broadcast address.
[530]
About broadcast address I want to tell you 2 points first,
[535]
broadcast addresses are of 2 types, one is limited and one is direct broadcast.
[543]
There is a limited and a direct broadcast.
[545]
So what is the difference between limited and direct broadcast address,
[549]
that you see here, limited means what?
[552]
Let's say that in this ABC.com there is a host,
[558]
And that host, in its organization, wants to send some message to everyone.
[568]
Means whatever number of people in that organization, to all of them,
[574]
a guy internally wants to send a message, wants to broadcast.
[579]
So in that case we use limited broadcast address,
[583]
and what is the value of limited braodcast address? All 1,
[586]
255.255.255.255
[592]
That is the point. Means if someone is in the organization
[597]
and he wants to send a message to everyone in the same organization
[601]
then he will simply put this destination address, message will reach everyone.
[606]
Means router will not cross ahead, router will internally send that message to everyone.
[612]
But there is another broadcast address that is direct broadcast address.
[617]
Direct broadcast address means there is one more network,
[622]
any let's say XYZ.com
[626]
If those people want to send a message to your organization,
[629]
and want to send a message to everyone in this organization,
[633]
means they want to broadcast in ABC. To broadcast in ABC
[638]
which destination address will they choose? They will choose 201.20.30.255
[647]
Means in this XYZ if anyone, any host
[652]
wants to send a message to all these people in ABC,
[656]
then he will use direct broadcast address and
[659]
the direct broadcast address of this ABC.com is what?
[662]
The last host of that network, the last IP address.
[666]
The last IP address is what? 201.20.30.255
[674]
So what is my direct broadcast? This is the direct broadcast.
[678]
So this host will put what in its destination IP address? 201.20.30.255
[686]
When this message comes to this router it will know that
[689]
this message is to be broadcast to everyone from ABC.
[693]
So this is how we calculate the direct broadcast address
[697]
and mostly you will not be asked about limited
[700]
because limited broadcast address is always same that is 255.255.255.255
[707]
and when do we use limited?
[709]
When a host wants to send message to everyone in the same organization,
[715]
then we use limited broadcast address.
[717]
But if some user from some other network wants to send message in your network,
[725]
or if I want to send message from my network to another network,
[728]
I want to broadcast message to all the people, then in that case,
[733]
we reserve the last IP address of that network for the direct broadcast address.
[740]
That's why they will mostly ask you about direct broadcast address,
[743]
because limited is always fixed.
[746]
And direct broadcast address if you want to find out, then simply what to do?
[750]
The last IP address of that network is the direct broadcast address.
[757]
So this is all about the question, how you have to solve question like this.
[762]
So if you like my video, please share it with your friends
[765]
and please subscribe my channel, Thank you.