Routing is the process of choosing a path over which to send packets, which is a primary function of the internet protocol (IP). A router (commonly referred to as a gateway) is a device that forwards packets from one physical network to another. When a router receives a packet, the network adapter forwards the datagrams to the IP layer. IP examines the destination address on the datagram and then compares it to an IP routing table. A decision is then made as to where the packet is to be forwarded. This lesson explains basic IP routing concepts.
After this lesson, you will be able to
Estimated lesson time: 40 minutes
A router helps local area networks (LANs) and wide area networks (WANs) to achieve interoperability and connectivity, and can link LANs that have different network topologies, such as Ethernet and Token Ring. Each packet sent over a LAN has a packet header that contains source and destination address fields. Routers match packet headers to a LAN segment and choose the best path for the packet, optimizing network performance. As each route is found, the packet is sent to the next router, called a hop, until finally delivered to the destination host. If a route is not found, an error message is sent to the source host. For example, if a packet is sent from Computer A to Computer C, as illustrated in Figure 9.1, the best route uses only one hop. If Router 1 is the default router for Computer A, the packet will be rerouted through Router 2. Computer A will be notified of the better route by which to send packets to Computer C.
Figure 9.1 Packet routed from Computer A to Computer C
To make routing decisions, the IP layer consults a routing table that is stored in memory, as illustrated in Figure 9.2.
Figure 9.2 IP layer consulting a routing table
A routing table contains entries with the IP addresses of router interfaces to other networks that it can communicate with. A routing table is a series of entries, called routes, that contain information about where the network IDs of the internetwork are located. A routing table in a computer that is running Windows 2000 is built automatically, based on its TCP/IP configuration. You can view a routing table by typing route print at a command prompt, as illustrated in Figure 9.3.
Figure 9.3 Displaying a routing table using a command prompt
The routing table is not exclusive to a router. A host also has a routing table that is used to determine the optimal route.
Routers use different processes to obtain routing information depending on whether the router performs static or dynamic IP routing. Static routing is a function of IP that limits you to fixed routing tables. Static routing requires that routing tables are built and updated manually. You use the Route command to add static entries to the routing table (see Table 9.1).
Table 9.1 Route Commands
|To add or modify a static route, type the following:||Purpose|
|route add [network] mask [netmask] [gateway]||Adds a route|
|route -p add [network] mask [netmask] [gateway]||Adds a persistent route|
|route delete [network] [gateway]||Deletes a route|
|route change [network] [gateway]||Modifies a route|
|route print||Displays the routing table|
|route -f||Clears all routes|
In this practice, you update a Windows 2000-based routing table by means of static routers.
For example, to add a route to enable communications with network 10.107.24.0 from a host on network 10.107.16.0, you would type route add 10.107.24.0 mask 255.255.255.0 10.107.16.2, as illustrated in Figure 9.4.
Figure 9.4 Adding a static route to a routing table
If a route changes, static routers do not inform each other of the change. Neither do static routers exchange routes with dynamic routers. In contrast, dynamic routing automatically updates the routing tables, reducing administrative overhead. However, dynamic routing increases traffic in large networks.
Dynamic routing is a function of routing protocols, such as the Routing Information Protocol (RIP) and Open Shortest Path First (OSPF). Routing protocols periodically exchange routes to known networks among dynamic routers. If a route changes, other routers are automatically informed of the change. You must have multiple network adapters (one per network) on a Windows 2000 Server or Windows 2000 Advanced Server. In addition, you must install and configure Routing and Remote Access because dynamic routing protocols are not installed by default when you install Windows 2000.
Windows 2000 offers two primary IP routing protocols: The Routing Information Protocol (RIP) and the Open Shortest Path First (OPFS) protocol. You can choose one or the other depending on such factors as network size and topology. These routing protocols are explained in the next two sections.
RIP is a routing protocol provided for backwards compatibility with existing RIP networks. RIP allows a router to exchange routing information with other RIP routers to make them aware of any change in the internetwork layout. RIP broadcasts the information to neighboring routers, and sends periodic RIP broadcast packets containing all routing information known to the router. These broadcasts keep all internetwork routers synchronized.
OSPF is a routing protocol that enables routers to exchange routing information and create a map of the network that calculates the best possible path to each network. Upon receiving changes to this map (actually a database, called the link-state database), the routing table is recalculated. As the size of the link-state database increases, memory requirements and route computation times increase. To address this scaling problem, OSPF divides the inter-network into collections of contiguous networks called areas. Areas are connected to each other through a backbone area. A backbone router in OSPF is a router that is connected to the backbone area. Backbone routers include routers that are connected to more than one area. However, backbone routers do not have to be Area Border Routers (ABRs). Routers that have all networks connected to the backbone are internal routers.
Each router only keeps a link-state database for those areas that are connected to the router. ABRs connect the backbone area to other areas, as illustrated in Figure 9.5.
Figure 9.5 A basic OSPF area design
An OSPF-routed environment is best suited to a large to very large, multipath, dynamic IP internetwork such as a corporate or institutional campus or worldwide corporate or institutional internetwork.
The following are guidelines for managing your internal and border routers.
Follow these steps on Server01 (the Windows 2000 Server) to administer a router:
You can administer a remote server once it appears as an item in the console tree.
Routers forward packets from one physical network to another. The IP layer consults a routing table that is stored in memory. A routing table contains entries with the IP addresses of router interfaces to other networks. Static routers require that routing tables be built and updated manually. With dynamic routing, if a route changes, other routers are automatically informed of the change.