Page 235 - Hacking Roomba
P. 235

216       Part III — More Complex Interfacing





                                                Debugging Network Devices

                          Even though the SitePlayer Telnet makes an easy time of getting it on the Net, not all
                          devices are so agreeable, and you may even run into problems where the SitePlayer Telnet
                          appears to be acting up. In those cases, it’s good to know how to debug network devices.
                          Modern operating systems provide all the tools you need to debug most network problems.
                          First, note that there are usually three levels of addressing what happens on the Internet:

                          ■ DNS name: The human-readable name, like www.yahoo.com. It is sort of like a person’s
                            full name. The DNS name is made for humans; computers don’t need it. A DNS server
                            is a device that acts like a phone book and maps DNS names to IP address numbers.
                            There are many giant DNS servers on the Internet, for the big namespaces like .com
                            and .net, but your ISP also runs one for your neighborhood network, and your router
                            may be running one too.
                          ■ IP address: The number obtained from the DNS name used on the Internet. An exam-
                            ple is 66.94.230.42. It is analogous to a person’s phone number, except instead of
                            being made up of seven single digits, it’s made up of four 8-bit numbers, usually writ-
                            ten with periods between them. Your router may have a DHCP server, which is a device
                            that dynamically assigns IP addresses to new devices on your personal network.

                          ■ MAC address: The hardware address used by the Ethernet and Wi-Fi protocols. It
                            is analogous to a person’s home address, as it identifies the actual physical device,
                            whereas IP addresses can be moved from device to device. Every network device con-
                            tains its own mapping of IP addresses to MAC addresses for the addresses it has seen.
                            This mapping is called an ARP cache. If a network device needs to use an IP address
                            for which it doesn’t know the MAC address, it announces that it doesn’t through the
                            Ethernet cable and hopes that someone responds.

                          The expansion of all the acronyms above isn’t that important (and in fact can be counter-
                          intuitive) compared to their functions. If you’d like to know more about the different proto-
                          cols mentioned above, one of the best sources is Wikipedia (www.wikipedia.org).

                          Debugging DNS Names
                          DNS can be debugged with almost any network program, since they all perform a DNS
                          lookup. The preferred tools of choice however are host and dig, with nslookup as the
                          standby if those are not present. If your computer does not have the host program, search
                          on the Net and get it as it’s much easier to use than the others.
                          The fastest way to test whether a DNS name resolves to an IP address is to type host and
                          the DNS name you’re curious about. Here are two examples of the host command, one
                          finding a DNS lookup and one not:
                              % host www.wiley.com
   230   231   232   233   234   235   236   237   238   239   240