A router is a device that manages the flow of data between network segments, or subnets. As multiple LANs or segments are connected together, multiple routes are created to get data from one LAN or segment to another. A router directs incoming and outgoing packets based on the information it holds about the state of its own network interfaces and a list of possible destinations for network traffic.

By projecting network traffic and routing needs, you can decide whether you want to use a dedicated hardware router, such as a Cisco router, or a software-based router, such as those included with Windows Server 2008. If you have heavy routing demands, you would almost always use dedicated hardware routers. For smaller networks, a software-based routing solution could be used. For routing, Microsoft Windows Server 2008 includes the Routing and Remote Access service.

Routing and Routers

When you send a packet from one computer to another computer, it first determines whether the packet is sent locally to another computer on the same LAN or to router so that it can be routed to the destination LAN. If the packet is meant to go to a computer on another LAN, it is sent to the router (or gateway). The router then determines the best route to take and forwards the packets to that route. The packet then goes to the next router and the entire process repeats itself until it gets to the destination LAN. The destination router then forwards the packets to the destination computer.

To determine the best route, the routes use complex routing algorithms, which take into account a variety of factors, including the speed of each transmission media, the number of network segments, and the network segment that carries the least traffic. Routers then share status and routing information to other routers so that they can provide better traffic management and bypass slow connections. In addition, routers provide additional functionality, such as the capability to filter messages and forward them to different places based on various criteria. Most routers are multiprotocol routers because they can route data packets using many different protocols.

A metric is a standard of measurement, such as hop count, that is used by routing algorithms to determine the optimal path to a destination. A hop is the trip a data packet takes from one router to another router or from a router to another intermediate point to another in the network. On a large network, the number of hops a packet has taken toward its destination is called the hop count. When a computer communicates with another computer, and the computer has to go through four routers, it has a hop count of four. With no other factors taken into account, a metric of four would be assigned. If a router had a choice between a route with four metrics and a route with six metrics, it would choose the route with four metrics over the route with six metrics. Of course, if you want the router to choose the route with six metrics, you can overwrite the metric for the route with four hops in the routing table to a higher value.

To keep track of the various routes in a network, routers create and maintain routing tables. Routers communicate with one another to maintain their routing tables through a routing update message. The routing update message can consist of all or a portion of a routing table. By analyzing routing updates from all other routers, a router can build a detailed picture of network topology.

Static Versus Dynamic Routes

Static routing algorithms are hardly algorithms at all, but are table mappings established by the network administrator prior to the beginning of routing. These mappings do not change unless the network administrator alters them. Algorithms that use static routes are simple to design and work well in environments where network traffic is relatively predictable and where network design is relatively simple.

Because static routing systems cannot react to network changes, they generally are considered unsuitable for today’s large, changing networks. Most of the dominant routing algorithms are dynamic routing algorithms, which adjust to changing network circumstances by analyzing incoming routing update messages. If the message indicates that a network change has occurred, the routing software recalculates routes and sends out new routing update messages. These messages flow through the network, stimulating routers to rerun their algorithms and change their routing tables accordingly.

NOTE

Dynamic routing algorithms can be supplemented with static routes where appropriate.

Distance-Vector Versus Link-State Algorithm

Routers use distance-vector–based routing protocols to periodically advertise or broadcast the routes in their routing tables, but they send it to only their neighboring routers. Routing information exchanged between typical distance-vector–based routers is unsynchronized and unacknowledged. Distance-vector–based routing protocols are simple and easy to understand and easy to configure. The disadvantage is that multiple routes to a given network can reflect multiple entries in the routing table, which leads to a large routing table. In addition, if you have a large routing table, network traffic increases as it periodically advertises the routing table to the other routers, even after the network has converged. Last, distance-vector protocol convergence of large internetworks can take several minutes.

Link-state algorithms are also known as shortest path first algorithms. Instead of using broadcast, link-state routers send updates directly (or by using multicast traffic) to all routers within the network. Each router, however, sends only the portion of the routing table that describes the state of its own links. In essence, link-state algorithms send small updates everywhere. Because they converge more quickly, link-state algorithms are somewhat less prone to routing loops than distance-vector algorithms. In addition, link-state algorithms do not exchange any routing information when the internetwork has converged. They have small routing tables because they store a single optimal route for each network ID. On the other hand, link-state algorithms require more CPU power and memory than distance-vector algorithms. Link-state algorithms, therefore, can be more expensive to implement and support and are considered harder to understand.

Routing Information Protocol

A popular routing protocol is the Routing Information Protocol (RIP), which is a distance-vector protocol designed for exchanging routing information within a small- to medium-size network. The biggest advantage of RIP is that it is extremely simple to configure and deploy.

RIP uses a single routing metric of hop counts (number of routers) to measure the distance between the source and a destination network. Each hop in a path from source to destination is assigned a hop-count value, which is typically 1. When a router receives a routing update that contains a new or changed destination network entry, the router adds one to the metric value indicated in the update and enters the network in the routing table. The sender’s IP address is used as the next hop.

Because RIP uses only hop count to determine the best path to an internetwork. If RIP finds more than one link to the same remote network with the same hop count, it automatically performs a round-robin load balance. RIP can perform load balancing for up to six equal-cost links.

However, a problem with using hops as the only metric is when two links to a remote network have different bandwidths. For example, if you have one link that is a 56KB switched link and a T1 running at 1.544Mbps, there would be some inefficiency when sending equal data through both pathways. This is known as pinhole congestion. To overcome pinhole congestion, you have to design a network with equal bandwidth links or use a routing protocol that takes bandwidth into account.

RIP prevents routing loops from continuing indefinitely by implementing a limit on the number of hops allowed in a path from the source to a destination. The maximum number of hops in a path is 15. If a router receives a routing update that contains a new or changed entry, and if increasing the metric value by one causes the metric to be infinity (in this case, 16), the network destination is considered unreachable. Of course, this makes it impossible for RIP to scale to large or very large internetworks. Note: The count-to-infinity problem is the reason why the maximum hop count of RIP for IP internetworks is set to 15 (16 for unreachable). Higher maximum hop count values would make the convergence time longer when count-to-infinity occurs.

Initially, the routing table for each router includes only the networks that are physically connected to it. A RIP router periodically (every 30 seconds) sends announcements that contain its routing table entries so that the other routers can update their routing tables. RIP version 1 uses IP broadcast packets for its announcements. RIP version 2 uses multicast or broadcast packets for its announcements. All RIP messages are sent over UDP port 520.

RIP routers can also communicate routing information through triggered updates, which are triggered when the network topology changes. Different from the scheduled announcements, the triggered updates are sent immediately rather than held for the next periodic announcement. For example, when a router detects a link or router failure, it updates its own routing table and sends the updated routes. Each router that receives the triggered update modifies its own routing table and propagates the change to the other routers.

You can configure each RIP router with a list of routers (by IP address) that accepts RIP announcements. By configuring a list of RIP peers, RIP announcements from unauthorized RIP routers are discarded. In addition, to prevent RIP traffic from being received by any node except neighboring RIP routers, you can set up some routers to use unicast RIP announcements to neighboring RIP routers.

Because the RIP is a distance-vector protocol, as internetworks grow larger in size, the periodic announcements by each RIP router can cause excessive traffic. Another disadvantage of RIP is its high convergence time. When the network topology changes, it may take several minutes before the RIP routers reconfigure themselves to the new network topology. As the network reconfigures itself, routing loops may form that result in lost or undeliverable data. To help prevent routing loops, RIP implements split-horizon.

To overcome some of RIP shortcomings, RIP Version 2 (RIP II) was introduced. RIP v2 provides the following features:

You can use a password for authentication by specifying a key that is used to authenticate routing information to the router. Simple password authentication was defined in RFC 1723, but newer authentication mechanisms, such as Message Digest 5 (MD5), are available.

RIP v2 includes the subnet mask in the routing information and supports variable-length subnets. Variable-length subnet masks can be associated with each destination, allowing an increase in the number of hosts or subnets that are possible on your network.

The routing table can contain information about the IP address of the router that should be used to reach each destination. This helps prevent packets from being forwarded through extra routers on the system.

Multicast packets speak only to RIP v2 routers and are used to reduce the load on hosts not listening to RIP v2 packets. The IP multicast address for RIP v2 packets is 224.0.0.9. Note: Silent RIP nodes must also be listening for multicast traffic sent to 224.0.0.9. If you are using Silent RIP, verify that your Silent RIP nodes can listen for multicasted RIP v2 announcements before deploying multicasted RIP v2.

Exam Alert

RIPv2 supports multicasting for updating the routing tables. RIPv1 does not support this feature. RIPv1 routers cannot communicate with RIPv2 routers that use multicasting for updates.

Open Shortest Path First (OSPF)

For small or medium networks, distributing data throughout the network and maintaining a route table at each router is not a problem. When the network grows to a size that includes hundreds of routers, the routing table can be quite large (several megabytes) and calculating routes requires significant time as the number of router interfaces goes up or down.

Some protocols, such as Open Shortest Path First (OSPF), allow areas (grouping of contiguous networks) to be grouped together into an autonomous system (AS). Areas that make up the autonomous areas usually correspond to an administrative domain, such as a department, a building, or a geographic site. An AS can be a single network or a group of networks, which is owned and administered by a common network administrator or group of administrators.

OSPF is a link-state routing protocol used in medium-sized and large networks that calculates routing table entries by constructing a shortest-path tree. OSPF is designed for large internetworks (especially those spanning more than 15 router hops). The disadvantage of OSPF is that it’s generally more complex to set up and requires a certain amount of planning.

Exam Alert

The Open Shortest Path First (OSPF) routing protocol component in Routing and Remote Access has been removed from Windows Server 2008.