-2

If you're given:

Number of needed subnets: 2
Network Address: 195.223.50.0

I can answer the following:

Address Class: C
Default Subnet Mask: 255.255.255.0
Custom Subnet Mask: 255.255.255.192
Total number of subnets: 2^2 = 4 Total number of host addresses: 2^6 (8-2 = 6)
Number of usable addresses: 2^6 -2
Number of bits borrowed: 2

BUT.... if I'm asked....

What is the 3rd subnet range?
What is the subnet number for the 2nd subnet?
What is the subnet broadcast address for the 1st subnet?
What are the assignable addresses for the 3rd subnet?

How would I answer these... All I remember from the procedure is to look at the last number in the Custom subnet mask (192) and do 256 - 192 to get 64 and then use 64 to increment something. But I'm not sure what each question is asking. Please help, and explain step by step for each question.

Also, what would be different if I was faced with the Address Class of B in this situation?

Paul Lo
  • 6,032
  • 6
  • 31
  • 36
Savish Khan
  • 53
  • 1
  • 1
  • 8

1 Answers1

3

this really isn't a programming question, and we generally don't use Classful Addressing (A,B,C,D...) anymore as everything is now CIDR and VLSM (http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)

But as you are using a subnet mask of 255.255.255.192 that equates to a /26 (64 IPS). to computer number of ips per CIDR you can use the following formula num ips (/x) = 2^(32-x) So /26 = 2^(32-26) or 2^6 which is 64.

The rest is basically just binary math.

1 /24 = 2 /25 1 /25 = 2 /26 1 /26 = 2 /27 And so forth.

So when breaking a /24 down into /26 subnets, you will get 4 Subnets of 64 hosts each.

(important to remember that each subnet's size will alway be a power of 2, and they always need to start on bit boundary).

So the first subnet will start at .0 (this isn't always the case, since if you are given a /27 and need to break it down into 4 /29's it is possible that it will start on a different number, but in the case of /24's first subnet is 0)

The IP of the subnet is the network, the last IP of the subnet is the broadcast, the rest of the ips are the useable host addresses.

To compute the useable IPs you would use 2^(32-x)-2. So in your case of /26 ,each subnet will have 62 useable IPS.

So back to first subnet.

195.223.50.0/26
195.223.50.0 is the network (first address) 195.223.50.64 is the broadcast (last address) 195.223.50.1 - 195.223.50.62 are useable hosts

The next subnet's network is 195.223.50.64, and the next one would be 195.223.50.128 and the last one would be 195.223.50.192

what is different when staring with a /16 (standard subnet size for legacy class b networks) is that you start off with 2^16 (65k) IPS to break up into subnets, as opposed to 2^8(256), an you have much greater room to be wasteful.

Doon
  • 19,719
  • 3
  • 40
  • 44
  • You're probably the only person in the internet who gave a complete beginner like me a useful insight on this! – adrpino Feb 26 '19 at 08:56