Subnet Masks

One of the values that your computer must have to participate in a TCP/IP network is a subnet mask. The subnet mask comes from your Internet Service Provider. They either hand it to you in a list of values to be entered manually, or (more commonly) it comes from your ISP's DHCP server, along with your IP address and default gateway address.

Subnet masks exist to give network administrators fine control over the division of an IP address into a network address and host address. A subnet mask specifies what portion of an IP address is the network address, and what portion is the host address. The best way to get a handle on this is to look at the three default subnet masks, one for each of the three classes of IP addresses. Table 3.2 lists the three default subnet masks.

Table 3.2: The Three Default Subnet Masks.

Class

Mask

A

255.0.0.0

B

255.255.0.0

C

255.255.255.0

Look back to Figure 3.4, and compare the structure of the subnet masks shown above to the structure of the three classes of IP address. Note that subnet mask octets containing 255 indicates the network address portion of the IP address, whereas octets containing 0 indicate the host address portion of the IP address.

Subnet masks are really binary-number bitmaps. 255 is the value represented by a byte in which all 8 bits are set to binary 1. If you've done any work in programming (or certain types of mathematics) you may have used sequences of binary bits like this to 'mask off ' parts of a number or another bitmap. By adding additional bits to one of the three default subnet masks, it's possible to cut a network into subnetworks. How this is done is fascinating but would take a chapter all to itself. What's important is how to recognize when two devices are on the same subnet.

When Routers and Access Points Fight

This comes up sometimes in Wi-Fi work, and a fairly common experience provides a good example. Wi-Fi access points contain miniature Web servers, and their setup pages are accessed through a Web browser. (I'll have more to say about this in later chapters.) In the access point's manual, you're usually given a particular local IP address for the setup page. The D-Link DWL-900AP+, for example, comes with its setup page at 192.168.0.50. If you build this IP address into a Web-formatted URL, you can bring up the setup page from any computer on your network. That is, you can bring it up if the IP address given is in the same subnet as your router-and therefore within the address range that your router recognizes as present in your network.

In my case, I had a Linksys BEFSR41 router on my network. It comes pre-set for a local IP address of 192.168.1.1, and the Class C subnet mask of 255.255.255.0. I plugged the D-Link access point into one of the router's switch ports and typed in its setup IP address.

Nothing.

It might have been cause for panic (or a tech support call) but one look at the two IP addresses told me that they were not on the same subnet. Table 3.3 lines them up so you can see what I saw.

Table 3.3: Conflicting Subnets.

Network Address

Host Address

 

Network Subnet Mask

255.255.255.

0

Router Setup IP

192.168. 1.

1

Access Point Setup IP

192.168. 0.

50

The '255' octets of the subnet mask specify the network address portion of an IP address. I've highlighted them along with the corresponding octets of the two device IP addresses. The shaded portions of the two device addresses are not identical-and that means that they're not technically on the same network!

Here's how I fixed this problem:

  1. I went into the router's setup page and changed its setup page IP address to 192.168.0.1.

  2. Router and access point were then on the same network. (Can you tell why? Look back at Table 3.3 if you're not clear on this!) That allowed me to bring up the access point's setup page at 192.168.0.50.

  3. I changed the access point's configuration so that instead of relying on a fixed local IP address, it requested a local address from the network's DHCP server when it powered up. This guarantees that router and access point will always be on the same network address, because the router's DHCP server only issues host IP addresses in the same network address as the router itself.

  4. I logged back into the router's setup page and changed it back to 192.168.1.1.

  5. I powered the access point down and up again. This forces it to request a new IP address from the DHCP server.

  6. I logged back into the router's setup page and inspected its DHCP clients table to get the new local IP address for the access point.

  7. I used this IP address to bring up the access point setup page, and configured the access point.

Now technically, stopping after Step 1 would have allowed everything to work… if nothing else depended on the address of the router. In my case, I had documented my network's setup to include a particular setup page address for the router, and I wanted to keep that setup as it had been. This isn't an arbitrary preference: I feel it's better practice to configure all network devices to pull their IP addresses from the network's DHCP server. The router should stay where it is, and everything else on the network should follow it.

The lesson taken from this incident is that when things don't work, take a close look at the various IP addresses you may have to use to set up a network. Communication among the various devices on your network requires that all devices have host addresses on the same root network address. The subnet mask tells you what part of your IP address is the network address.

You might well ask: What if one of the numbers in the subnet mask is something other than 255 or 0? This is less common in small networks, but it's perfectly legal. Unfortunately, it's also much more difficult to explain. You'll have to study the subnet masking process in detail, or call for expert help.

Unfortunately, you may not get much help from manufacturers of routers and access points, some of whom will refuse to support their products when used in conjunction with products of other manufacturers. This is shameful, but it's a fact of life, and the main reason I suggest to non-technical people: buy all your network gear from the same manufacturer!



Jeff Duntemann's Drive-By Wi-Fi Guide
Jeff Duntemanns Drive-By Wi-Fi Guide
ISBN: 1932111743
EAN: 2147483647
Year: 2005
Pages: 181

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net