More About Ip Addresses
As we have seen in previous post ip address is of 32 bits
With 32 bits,we will get 2^32 diffrent ip addresses,by using formula 2^n (n is the number of bits)
ip address is combination of two addresses in one address ,they are
1.device address
2.network address in which device in
for example if we have address 200.0.0.1 which is device ip address ,then network address will be 200.0.0.0.
NOTE: ALways first ip address is used for network address,last adresss ip is used for broadcast address.
range of 32 bits
00000000.00000000.00000000.00000000 - 0.0.0.0
11111111.11111111.11111111.11111111 -255.255.255.255
Initial classification
Initially they have choosen first 8 bits for network address remaining 24 bits for host addresses
with that we will get 2^8 networks ,2^24 hosts per network
256 networks not enough so classful addresses came
classful classfication
in classful addressing they are 5 diffrent classes class A,B,C,D,E.
Lets go through the difrrent classes
class A
same as initial classification here also they have choosen first 8 bits for network address remaining 24 bits for host addresses
fnnnnnnn.hhhhhhhh.hhhhhhhh.hhhhhhhh
f-fixed bit
n- network bits
h - host bits
NOTE:The first octet first bit is fxed and set to 0
total no. of ip’s=2^31 total networks 2^7 = 128 networks = 126(practical) , total no. of hosts can be configured /network 2^24 =16 M Hosts(ips)
range
00000000 - 0
00000001 - 1
.
.
01111111 - 127
range can be 0-127 ,but the practical range can be 1-126 0.0.0.0 , 127.0.0.0 addresses are reserved usable ip space: 1.0.0.0 - 126.0.0.0 Used for large networks
class B
In classB they have choosen first 16 bits for network address remaining 16 bits for host addresses
ffnnnnnn.nnnnnnnn.hhhhhhhh.hhhhhhhh
The first octet first two bits are fxed and set to 10
total no. of ip’s we get with 30 bits(32-2fixed bits)=2^30
total networks = 2^14
totla no. of hosts can be configured /network =2^16
range
10000000 - 128
10000001 - 129
.
.
.
10111111 - 191
range 128.0.0.0 - 191.255.0.0
class C
In classC they have choosen first 24 bits for network address remaining 8 bits for host addresses
with that we will get 2^24 networks ,2^8 hosts per network
fffnnnnn.hhhhhhhh.hhhhhhhh.hhhhhhhh
The first octet first three bits are fxed and set to 110
range
11000000 - 192
11000001 - 193
.
.
11011111 - 223
total networks = 2^21
range 192.0.0.0 - 223.255.255.0
Now we can say which class the ip belongs to by seeing its range
classA 1-126
ClassB 128-191
class c 192-223
class D,E addresses used for special purposes
class A | class B | class C | |
---|---|---|---|
total ip’s | 2^31 | 2^30 | 2^29 |
total networks | 2^7 | 2^14 | 2^21 |
total hosts | 2^24-2 | 2^16-2 | 2^8-2 |
Range | 1.0.0.0 - 126.0.0.0 | 128.0.0.0 - 191.255.0.0 | 192.0.0.0 - 223.255.255.0 |