WebAppendix-3 (NMEX) Some more examples of netmasks

Let’s say you need a range of 1800 addresses. The quick way to choose the netmask for this is to look at the Table in Module 4.6. This shows you that the smallest range that can accommodate this number of addresses is 2048, which corresponds to netmask FF.FF.F8.0 (hex) or 255.255.248.0 (decimal).

We can approach the same question the other way round. The smallest power of two that is greater than 1800 is 211 = 2048. Therefore the host part of our netmask must have eleven 0-bits on the right. Figure-1 shows how these gives us the same netmask as before, namely 255.255.248.0.

Figure-1 Netmask for a range of at 1800 addresses.

That is the netmask that will give a range size of 2048 addresses. To specify an actual range of that size, you would of course have to specify an IP address as well.

 

Netmasks for small ranges of IP addresses

Because IP address-space is in great demand, when you sign up for a new Internet connection from an ISP – especially on ADSL or cable – they will usually give you as small a range of public IP addresses as possible. The following ranges (and corresponding netmasks) are common:

Range size

Netmask

Note

4

255.255.255.252

This gives you only 1 usable address for hosts on your network. (See below.)

8

255.255.255.248

5 usable addresses.

16

255.255.255.240

13 usable addresses.

From any range you lose two addresses – the network address and the broadcast address (Modules 4.10, 4.11) – which you can’t use for your own hosts. And, when your Internet connection is via a router (as opposed to a modem) the internal interface of the router uses one of the remaining addresses, so it total you lose three addresses from your public IP address range.

Netmasks for "ADSL modem" connections

Some ISPs give you a really nasty setup, particularly if you are a domestic broadband customer. Instead of giving you a proper ADSL router (or letting you use your own) they give you what they call an "ADSL USB modem". This is a system to avoid for lots of reasons:

1. The box they provide really is like an old modem for dial-up over a phone line:

2. It’s USB only, so it won’t work with older PCs.

3. Because your machine is acting as the "router", you can’t insert a firewall between your end-user machine and the Internet. (C.f. Module 23.11.)

4. You can only connect a single PC to the Internet unless the PC controlling the modem can provide some form of Internet connection sharing (C.f. Module 23.11.)

5. You get a single public IP address and that’s it.

What to do instead

a. Go to a better ISP who give you a much better, normal connection, and often at a lower price and don’t populate their technical department exclusively with morons.

b. Consider a device such as the Draytek Vigor 2200USB Router. This takes over the control of the ADSL modem from your PC and looks like a normal router to the rest of your network. After that you something that behaves like a normal network and apart from the lack of public IP addresses, it gets over all the snags listed above. (We’ve never actually used one of these – because we were careful about choosing our ISP in the first place – so we can’t recommend you buy one, but they’re worth investigating.)