fireflies said:
Then how to distribute this? I mean, no calculation, the real scenario? Like you are a network engineer.. what intermediary devices will you use and what are the default gateway IP and interface IPs?
This amounts to the question:
why are you doing subnetting? So begin from there. Is subnetting done for structuring the network, for using different technologies (e.g. Ethernet, WAN etc.), retaining a space of addresses or most commonly controlling network traffic? Then, by using the appropriate devices at the corresponding level of the TCP/IP stack and the appropriate subnet mask(s) you'll achieve the desired configuration.
For subnet masking, you apply a mask in order to be able to recognize the
network and
node parts of an IP address, with network bits represented by
1's in the mask and node bits represented by
0's. Applying a bitwise logical AND between
IP and
subnet mask you get the network address. You may already know all this but I mention it just in case you miss something. Now, adding more bits to the default subnet mask (i.e. to 255.0.0.0 for Class
A, 255.255.0.0 for Class
B and
255.255.255.0 for Class
C) you do further subnetting, with the constraints of node addresses all 0's and all 1's occupied for the
local network and
broadcast address respectively - although these can be used in newer standards. The number of subnets is calculated using the formula ##2^n - 2## where ##n## is the number of bits that you have additionally used. Now, if you multiply the number of subnets with the number of nodes that are available per subnet you get the total number of nodes available for the combination of Class
and subnet mask.