Networking Question - What is a VALID Subnet Address? [duplicate]

Possible Duplicate:
How does IPv4 Subnetting Work?

I am currently revising Networking for the Cisco CCNA1. One of the questions that I am struggling to answer is the following:

Which of the following IPv4 addresses are vaild subnet addresses:

  • 172.16.4.127 /26
  • 172.16.4.155 /26
  • 172.16.4.193 /26
  • 172.16.4.95 /27
  • 172.16.4.159 /27
  • 127.16.4.207 /27

I can't get my head around how to know understand when a subnet address is valid or not.

Many thanks


IP addresses are 32-bits long, the mask is also 32 bits. When you perform a logical AND of the address and the mask, you get the subnet address. See this wikipedia section on how to determine the network prefix.

My mental shortcut that works for netmasks >= 25 is I subtract the mask length from 32 and look at the last octet of the IP address... that is the maximum host bits in the address (call that number h). If the last octet is evenly divisible by 2**h, then that is a subnet address.

For example, 172.16.4.127/26... 32 - 26 = 6. 2**6 = 64 and 127 % 64 = 63. Therefore, 172.16.4.127 is not a valid subnet address... in fact it is the broadcast address for the 172.16.4.64/26 subnet. Good luck with your CCNA exam.


The answer is either all, or none depending on what they mean.

The normal understanding of a 'valid' subnet address is one in which the address quoted is the lowest possible in the specified range. Hence a /26 (64 addresses) would end with a multiple of 64, and a /27 would end with a multiple of 32.

None of the addresses you've quoted meet that rule.

  • 172.16.4.127 /26 - this is the broadcast address for 172.16.4.64 /26
  • 172.16.4.155 /26 - this sits in the range 172.16.4.128 - 191
  • 172.16.4.193 /26 - this is the first usable address in 172.16.4.192 /26
  • 172.16.4.95 /27 - this is the broadcast address for 172.16.4.64 /27
  • 172.16.4.159 /27 - this is the broadcast address for 172.16.4.128 /27
  • 127.16.4.207 /27 - this sits in the range 172.16.4.192 - 223

Are you sure you copied them correctly?