# How many hosts can an IPv4 /22 network handle at most?

This came up in a test question and I would like to know the real answer as the possible choices confuse me.

How many hosts can a network handle at the most, based on the following address: 135.46.56.0/22

A: 1024, B: 1023, C: 1022, D: other

So if I'm not mistaken, /22 is 1024 (2^10) hosts. However, I'm not sure if network and broadcast address should be taken into consideration. I have the big book of networking by Tanenbaum and the example shown there doesn't exclude either one. I have an app on my phone that does this calculation and it points out the usable number of IP addresses is 1022 (google also found a claculator that said the usable number was 1023).

Could someone clear this up for me?

• Are you a CCNA student? because that comes pretty well explained in your course's docs you know. Jun 11 '14 at 6:17
• @arielnmz I'm a university student, and I had to google what CCNA stands for, so no, I'm not a CCNA student :) Jun 11 '14 at 7:48
• CCNA is a networking course by Cisco, many schools have it available that's why I was wondering. Jun 11 '14 at 17:51

For most (if not all) real-world scenarios he answer is C: 1022 addresses.

In theory you could use all 1024 addresses. But RFC 919 explains why you should reserve two addresses for special purposes: broadcast to all hosts and addressing the network itself.

You could choose any two addresses to be these special addresses, but If different IP implementations are to be compatible, there must be a distinguished number to denote "all hosts". (RFC 919, section 7).

The RFC concludes with this nice summary:

If the use of "all ones" in a field of an IP address means "broadcast", using "all zeros" could be viewed as meaning "unspecified". There is probably no reason for such addresses to appear anywhere but as the source address of an ICMP Information Request datagram. However, as a notational convention, we refer to networks (as opposed to hosts) by using addresses with zero fields. For example, 36.0.0.0 means "network number 36" while 36.255.255.255 means "all hosts on network number 36".

http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing

Yes. `(addr)/22` = 1024 addresses, with traditionally one reserved for broadcast, and one reserved for the network itself.

• Don't you mean C which is 1022 (1024-2)? D is for other. Jun 10 '14 at 0:19
• @romeozor: oops, you're right Jun 11 '14 at 5:59