How many subnets are needed?
I'm just starting out with networks. I'm trying to determine how many subnets are needed for this network:
BRANCH1, BRANCH2 and HQ are routers. The Boxes between routers and PCs are switches.
The Scenario is:
The BRANCH1 LAN 1 will require 10 host IP addresses.
The BRANCH1 LAN 2 will require 10 host IP addresses.
The BRANCH2 LAN 1 will require 10 host IP addresses.
The BRANCH2 LAN 2 will require 10 host IP addresses.
The HQ LAN will require 20 host IP addresses.
The link from HQ to BRANCH1 will require an IP address for each end of the link.
The link from HQ to BRANCH2 will require an IP address for each end of the link.I've counted that I would need 7 subnets for this.
BRANCH1 and BRANCH2 require 2 subnetworks + one for their link to HQ, each. (Total 6) HQ requires 1 subnetwork. This brings us to a total of seven.
but the following questions in my exercise seem to indicate there are 8 subnetworks needed. Am I missing one somewhere?
41 Answer
Your reasoning is correct. According to the schema there is no need for more that seven networks.
We can imagine multiple possibilities what the eighth network could be for but none of them is depicted in the schema:
- connection to the Internet with another subnet
- a routed VPN tunnel subnet
- a VPN client subnet
- additional VLAN on some of the sites
etc.
Additional exercise
Interesting task is also to compute the minimal sizes of the subnets. Every subnet (connected through a gateway) needs at least 3 addresses: network, broadcast, gateway.
- subnet with 10 hosts: 4 bit host part (28 bit mask length) => 16 IP addresses - 3 - 10 - 1 (for the switch) = 2 free addresses will rest
- subnet with 20 hosts: 5 bit host part (27 bit mask length) => 32 IP addresses - 3 - 20 - 1 = 8 will rest
- links: 2 bit host part (30 bit mask length) => 4 IP addresses - 2 (network and broadcast) - 2 (gateways) = 0 will rest