Jeff Duntemanns Drive-By Wi-Fi Guide

The TCP/IP protocols have become so pervasive in local area networking that Microsoft wants each Windows machine to have an IP address at all times, even when there's no DHCP server to request one from. So in circumstances where a computer discovers no connection to the outside world, or no DHCP server anywhere it can reach, the computer can give itself an IP address.

The technology is called Automatic Private IP Addressing (APIPA) and it's present in Windows 98, Windows 2000, and Windows XP. If a computer looks for a DHCP server and can't find one, APIPA takes over, and generates a local IP address from a special block of non-routable IP addresses reserved by the Internet Assigned Numbers Authority (IANA) for use by Microsoft in Windows: 169.254.0.1 through 169.254.255.254. APIPA also provides a Class B subnet mask of 255.255.0.0.

Because each computer gives itself an IP address under APIPA, there's always the possibility that two computers on the same local area network might by chance pull the same number. A protocol called ARP (Address Resolution Protocol) prevents such conflicts, basically by having each computer's APIPA module ask permission over the network before using a particular IP address. If one of the other computers is already using that address, it responds negatively, and APIPA repeats the process, choosing another address and asking permission until no other device on the network objects.

APIPA is strictly a hole-filler technology, and the Windows APIPA module checks for the presence of a DHCP server every five minutes. If a DHCP server comes back online somewhere on the network, APIPA will request configuration from DHCP, and the local IP address that comes back replaces the one generated by APIPA.

Typically, an IP address generated by a router appliance intended for home networks will be in the block 192.168.X.X. If you check the IP on your computer and you see an IP address starting with 169.254, you can be fairly confident that that address came from APIPA and not DHCP.

APIPA is important in Wi-Fi work under very particular circumstances: If you create a wireless ad-hoc network (more on which in Chapter 5) there is typically no DHCP server available, and all computers joining in the ad-hoc network will have IP addresses generated by APIPA. This is extremely useful, as the alternative is to configure each computer with a local IP address by hand, making sure that no two computers are using the same address. This is definitely something better left to computers to do.

Категории