DNS and DHCP IP

145 same result. In a hierarchical LAN design, the best high-availability topology involves two routers running VRRP or HSRP. Every end device on the subnet then treats the virtual address shared by these two routers as the default gateway.

5.7 DNS and DHCP

Two important IP-related applications are used in most large-scale LANs. Domain Name Service DNS is an application that provides mapping between host names and the corresponding IP addresses. Dynamic Host Configuration Protocol DHCP is a facility that provides a way to dynamically configure IP devices when they connect to the network. The DNS client lookup procedure is built into just about every operating system. This procedure allows you to connect to your favourite web site by its name rather than having to remember the IP address. When you look up an arbitrary address on the Internet, your computer sends out a query to a preconfigured DNS server IP address. This query asks the DNS server to convert or resolve this name into an address. Once your local computer has the information it requires, it stores it so it wont need to ask again. The greatest advantage to using DNS this way is not that it allows a human to remember the name rather than the address, although this feature is convenient. Rather, it is important because it allows the administrator to change IP addresses with relative ease. For example, if it is necessary to take the server offline and replace it with another, the administrator can simply set DNS to map the same name to a new address. For efficiency, the end devices that request this name-to-address conversion generally store it in a local cache. Thus, DNS provides the ability to associate a maximum age for a particular address. For example, when the DNS server responds with the IP address, it may also tell the client device that it should only remember this address for five minutes. Once this period is over, if the client connects to this device again, it needs to do another lookup. The naming system used by DNS is hierarchical. The various segments are separated by dots. For example, there might be a web server named www.oreilly.com. In this case, the top-level domain is .com. There are several top-level domains such as .org, .net, and .gov, as well as country-specific codes such as .us, .uk, and .ca. The next field to the left defines the organizational domain name. There can be many hosts within that organization, one of which is called www. In fact, DNS allows the administrators of the local domain to define more layers of hierarchy. DHCP is a protocol that makes it possible to automatically configure end devices. The most common things to include in this configuration are the devices IP address, mask, and default gateway. It is also possible to configure several other kinds of information, such as the addresses of the DNS servers, time servers, database, or application servers. Indeed, the protocol itself is highly flexible and makes it possible in theory to configure just about anything the end device might need. The interesting thing about DHCP is that, in the common example of setting up an IP address, the client device doesnt have enough information to get onto the network when it starts out. It doesnt have an IP address and it doesnt know where its default gateway is. In general, it doesnt even know the IP address of the DHCP server. All this device can really do is send out an all-hosts broadcast to 255.255.255.255 looking for a DHCP server. For its source address, it has to use the generic source address 0.0.0.0 , because it doesnt know anything else to use. In the default situation, the router for this network segment refuses to pass along a broadcast of this type. You either need to have a DHCP server for every segment or the router needs to cooperate. Usually, the router is set up to automatically forward these broadcasts to a particular IP address, which will be the DHCP server. This IP address could be somewhere very far away in the network, perhaps several 146 hops away. The router has to not only forward the clients request packet through the network to the server, but it also has to be able to receive the configuration information from the server so it can pass it along to the client. Most routers have the ability to pass this information along. On Cisco routers, doing this requires the use of the IP Helper Address feature. 147

Chapter 6. IP Dynamic Routing

The network needs to understand how to get packets through from one side to the other. This can be accomplished in several ways. In a simple network with only one or two routers, it is probably most efficient to configure this routing information into the routers manually. However, in a large or complex network, the routers need to learn and update routing information through the network automatically. This is particularly true for networks that offer multiple redundant paths for fault-tolerance purposes. Dynamic routing protocols give the network a way of healing around link or equipment failures. This is because they can see all of the different paths through a network and pick the best one at any given moment. When one path becomes unusable, another is selected. The routing of IP packets is always handled by means of a routing table. This table is basically just a list of destination networks and the next hop required to get to these destinations. It may also contain other supplemental information, such as an estimate of how much it costs to use that particular route, and it may contain several different options for directing traffic to some destinations. This concept of the cost of a route is relatively open and vague. The cost could be a function of any number of variables, such as the number of hops, the net latency of the path, the minimum bandwidth along the path, as well as other less tangible factors. For example, it may be better to avoid a particular route because of a usage charge. Or in some cases the network administrators direct traffic through networks under their direct control, instead of using a possibly shorter path through a foreign network. It is interesting how these routing tables come into being, how they are updated when the topology changes, and how they avoid problems like loops. Several commonly used methods keep routing tables up- to-date. The earliest and more popular routing protocols typically used a Distance Vector Algorithm. Then Link State Algorithms became popular. I discuss one popular protocol, Border Gateway Protocol BGP, that uses a completely different algorithm relying on a Path Vector system. All of these algorithms fulfill two main functions. First, they allow the routers on the network to keep track of changes in the state of the network that require changing routing tables. Second, they provide a mechanism for eliminating routing loops. A routing loop is exactly what it sounds like: one router forwards a packet to its next hop to be delivered to the eventual destination. But instead of sending the packet on, the second router just forwards it back to the first one, perhaps via other intermediate routers. This is clearly a serious problem for a network, and it is relatively easy to get such loops when the routers are responsible for figuring out for themselves how to send data through the network. This is why sophisticated algorithms are required to prevent them. Before discussing the more sophisticated dynamic methods of maintaining routing tables through a network, I start with simple static routing. This discussion helps explain the problems that dynamic routing was developed to solve. Further, it is common in large networks to use a mixture of static and dynamic routing, so it is important to understand where each method is useful.

6.1 Static Routing

Conceptually, the simplest method for maintaining routing tables is to configure them into the routers manually. This method naturally relies on the accuracy of the network administrator to avoid problems such as loops. It is also up to the administrator to update the tables whenever something changes anywhere in the network.