# What's the formal definition of the magic number of a network? [closed]

I know what the magic number of a network is. I know how to compute it - `2 ^ ((32 - n) % 8)`. I know what it's used for and how to use it.

I don't how how to define it formally. In a recent interview I was left speechless after being asked to deliver a one line definition of the magic number of a network, which made me feel rather stupid.

-

## closed as not constructive by MadHatter, Dave M, mgorven, Khaled, Tom O'ConnorMar 9 '13 at 16:15

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

You didn't want to work for them anyway. – Tom O'Connor Mar 9 '13 at 16:15

No need to feel stupid, it is the sort of term that only comes from a text book and not the real world. Everything is derivable from just the IP and subnet mask, you can quite happily be an expert in subnetting without even having heard of it.

It is basically the number not covered by the mask, ie. the number of IP addresses in each subnet. (although remember from that you then lose the network and broadcast addresses)

If you don't want to simply AND the IP with the mask, then you can work out the start of the subnet by writing down multiples of this number. Personaly I find that a long way round.

-
The magic number is the number of IP addresses in each subnet if and only if the number of bits for the network id is greater than 24 right? – Aadit M Shah Mar 9 '13 at 1:49
For larger networks you simply apply the same technique to the 'interesting' (ie. not 0 or 255) octet. So if it was the 3rd octet then it would be the number of IP addresses divided by 256. – JamesRyan Mar 10 '13 at 1:27

For a one sentence answer, I would say: "The magic number is a number used to help determine the network and broadcast addresses for a network, when given just an IP and netmask."

-

The magic number is the number of IP addresses in each subnet.

-