In: Computer Science
1. Given the network 192.168.17.0 /24, calculate the broadcast, range and last host address for the fourth subnet, given that the all-zeros subnet is the first subnet if you have to create 15 subnets.
2. Given an IP network of 180.5.0.0 /16, calculate the subnet mask required to create 50 subnets with the maximum number of hosts. Then calculate the network address, the range of useable host addresses and the broadcast address of the LAST 3 subnets.
1).IP address given = 192.168.17.0/24
Number of subnets = 15
Here,prefix of IP address is 24 which means first 24 bits of IP address is fixed and 8 bits are available for host. And we know that for subnets, the number of bits are borrowed from host portion .
Now, number of bits to be borrowed = ceil(log2(number of subnets)) = ceil(log215) = 4 bits
So, out of 8 bits available for hosts first 4 bits belong to subnets.and total of only 4 bits belong to hosts now.
First subnet has all 4 bits as zeroes.so,
First subnet's first 4 bits in borrowed portion = 0000
Second subnet's first 4 bits in borrowed portion = 0001
Third subnet's first 4 bits in borrowed portion = 0010
Fourth subnet's first 4 bits in borrowed portion = 0011
For 4th subnet:-
broadcast address is made when all bits belonging to host portion are made 1's.
Broadcast address = 192.168.17.(00111111)2 = 192.168 17.63/28
First address = 192.168.17.(00110000)2 = 192.168.17.48/28
last address = 192.168.17.(00111110)2 = 192.168.17.62/28
Range = (192.168.17.48/28 -- 192.168.17.62/28)
2). Actually in CIDR notation any IP address in a block can be used as network address because we know the prefix from any IP address in block and therefore we know which portion of numbers are fixed.
180.5 0.0/16
Number of bits to be borrowed = ceil(log2(number of subnets)) = ceil(log250) = 6 bits
Mask is obtained by making all bits belonging to network portion as 1's.
So, subnet Mask = 255.255.(11111100)2.0 = 255.255.252.0
LAST 3 subnets:-
3rd last subnet :-
Network address = 180.5.(10111100)2.0/22 = 180.5.188.0/22
First IP address = 180.5.188.0/22
Last IP address = 180.5.(10111111)2.(11111110)2 = 180.5.191.254/22
Range = 180.5.188.0/22 --- 180.5.191.254/22
broadcast address = 180.5.(10111111)2.1111111 = 180.5.191.255/22
2nd last subnet :-
Network address = 180.5.(11000000)2.0/22 = 180.5.192.0/22
First IP address = 180.5.192.0/22
Last IP address = 180.5.(11000011)2.(11111110)2= 180.5.195.254/22
Range = 180.5.192.0/22 --- 180.5.195.254/22
broadcast address = 180.5.(11000011)2.1111111 = 180.5.195.255/22 last subnet :-
Network address = 180.5.(11000100)2.0/22 = 180.5.196.0/22
First IP address = 180.5.196.0/22
Last IP address = 180.5.(11000111)2.(11111110)2= 180.5.199.254/22
Range = 180.5.196.0/22 --- 180.5.199.254/22
broadcast address = 180.5.(11000111)2.1111111 = 180.5.199.255/22