Section 6.8: Routing

TCP/IP has the capability to route packets between different networks or subnets. In Windows Server 2003, this capability is also provided through RRAS, which allow a Windows Server 2003 computer to function as a multiprotocol router, a Demand-Dial Router, and a Remote Access Server. The multiprotocol router functionality allows RRAS to simultaneously route IP, IPX, and AppleTalkYou can also use PPP to combine the routing and the remote access services on the same computer, and in this way, create a Windows Server 2003 remote access router.

The basic concept of routing is that each packet on a network has a source address and a destination address. These two addresses are stored in the packet's header information. Any device on the network that receives this packet can inspect the header to determine the packet's destination. However, routing also includes the process of choosing the best path over which to transmit packets during network communication over a Local Area Network (LAN) or Wide Area Network (WAN). This is accomplished through the use of routers, which can forwards the packets from one physical network to another and can link different network topologies, such as Ethernet and Token Ring. Windows Server 2003 provides LAN routing through the Routing and Remote Access Service (RRAS).

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. Routing tables are used to make the routing decisions.

6.8.1: Routing Tables

A routing table is a database repository that contains entries, which contain information on each possible logical destination network that is known to the router. There are two ways in which a routing table can be populated: a route can be entered manually, this is called static routing; or a router can dynamically learning a route. Once router learns a route, it is added to its route table. Windows Server 2003 has support for static routing as well as dynamic routing, based on open-standard dynamic routing protocols.

The Default Gateway

A gateway is a device that connects networks using different communication protocols in a way that allows for information to pass from one network to the other. It both transfers and converts the information into a form that can be used by the protocols on the receiving network. In other words, a gateway is a kind of router. The default gateway is the path used to pass information when the device does not know where the destination is. In other words, a default gateway is a router that connects your host to remote network segments. It is the exit point for all the packets in your network that have destinations outside your network.

When a packet arrives at the routing device, the routing table is queried to discover the lowest cost route to the intended destination. When there is no specific information concerning that network in the routing table, the packet will be forwarded to the default gateway, under the assumption that the default gateway will forward the packet to its intended destination.

There are three basic types of routes:

• A Host route, which is a route to a specific IP address in the network. A host is a particular computer, or more specifically, an interface on a computer or device. In these cases, the network mask is always 255.255.255.255 (/32). Host routes are typically used for custom routes to specific hosts. This helps in the optimization and control of a network.

• A Network ID route, which is a route for classful, classless,

subnet, and supernetted destinations. The network mask in these cases will be somewhere between 129.0.0.0 (/1) and 255.255.255.254 (/31).

• A Default route, which is a route to all other destinations. This route is used when the routing table cannot find a host or network ID route that matches the destination in the packet's header. The default route has a destination of 0.0.0.0 and a network mask of 0.0.0.0 (/0), and it is sometimes expressed as 0/0. All destinations not found in the routing table are simply forwarded to this destination, where the specific destination address will be found.

Each route in the routing table contains the necessary forwarding information for a range of destination IP addresses. This information includes two values for the destination IP address: the next-hop interface and the next-hop IP address. The next-hop interface is the next physical or logical device over which the IP packet will be forwarded. The next-hop IP address is the IP address of the node to which the IP packet is being forwarded. In an indirect delivery, the next-hop IP address is the IP address of a directly reachable intermediate router to which the packet is being forwarded.

6.8.1.1: Static Routing

A statically defined route is a route that is manually entered into the routing table. These routing tables must also be updated manually to ensure that the routing paths remain efficient. You use the route command to add static entries to the routing table. Table 6.5 lists the parameters for the route command.

Table 6.5: Route Command Parameters

Parameter Function
route add [network] mask [subnetmask] [gateway] Adds a route
route -p add [network] mask [subnetmask] [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

A Windows Server 2003 computer can act as a static IP router if it is a multihomed computer, i.e., if it contains multiple network interface cards. You can configure a separate IP address and subnet mask for each network adapter, and define routes for the directly attached networks.

Class-Based Routing

Class-based routing determines the network ID based on the IP address class. Class-based routing protocols do not advertise the subnets of a class-based network ID on network segments that are not a subnet of the class-based network ID. Rather, on network segments that are not a subnet of the class-based network ID, they advertise the summarized class-based network ID. Class-based IP routers summarize the subnets of a class-based network ID by advertising the class-based network ID. Because of this behavior, all subnets must be contiguous.

Classless Routing

Classless routing protocols advertise the network mask with the network ID. Because no mask assumptions are made, classless routing allows discontiguous subnets of a network ID, variable-length subnetting, CIDR blocks, and route aggregation.

The advantages to using static routes are the administrator has total control of what is in the routers routing table and there is no network overhead for a routing protocol. The disadvantage of using only static routes is they do not scale well.

6.8.1.2: Dynamic Routing

Dynamic routing is a process in which a routing protocol will find the best path in a network and maintain that route. Once a route fails, the routing protocol will automatically find an alternate route to the destination. Routing protocols are easier to use than static routes. However, a routing protocol will consume more CPU cycles and network bandwidth than a static route.

6.8.2: Routing Protocols

Windows Server 2003 supports two dynamic routing protocols: the Routing Information Protocol (RIP); and Open Shortest Path First (OSPF). These routing protocols periodically exchange routes to known networks among dynamic routers. If a route changes, other routers are automatically informed of the change. Both RIP and OSPF are interior gateway protocols (IGPs) that use routers to communicate.

6.8.2.1: Routing Information Protocol (RIP)

Routing Information Protocol (RIP) is a distance-vector routing protocol. Distance vector routing protocols propagate routing information in the form of a network ID and its "distance" or hop count. RIP has a maximum distance of 15 hops. Any destination that is more than 15 hops is considered unreachable. RIP version 1 operates through broadcast announcements and is a class-based routing protocol. This means that route advertisements in RIP v1 do not carry subnet mask information. Consequently, only network addresses that use their default subnet mask, following their classful boundaries, will work properly in a RIP version 1 configured environment. RIP version 2 is a classless routing protocol. Thus, the latter's announcement includes a network ID and a subnet mask.

Note: Classful boundaries are network boundaries that exist between networks that are configured with their default subnet masks.

After initialization, the RIP router periodically announces the appropriate routes in its routing table for each interface. The exact set of routes being announced depends on whether the RIP router is implementing split horizon or split horizon with poison reverse.

Fault tolerance for RIP internetworks is based on the time-out of RIP-learned routes. If a change occurs in the internetwork topology, RIP routers can send a routing update immediately rather than waiting for a scheduled announcement.

6.8.2.2: Open Shortest Path First (OSPF)

OSPF is designed for use on large or very large networks and to overcome the shortcomings of RIP in large networks. It is more efficient than RIP. It provides faster detection and changes of the network topology, which means that there is less chance of encountering the count-to-infinity problem. OSPF routes are also loop-free. When using OSPF, large networks can be broken down into smaller contiguous groups of networks, called areas. Routing table entries can then be minimized by using the technique called summarizing, which allows for the creation of default routes for routes outside the area. In addition, the subnet mask is advertised with OSPF, which provides support for disjointed subnets and supernetting; route exchanges between OSPF routers can be authenticated; and OSPF routers can calculate least-cost routes to external destinations because external routes can be advertised internally.

OSPF is a link state routing protocol that propagates routing information to other routers in the same area in the form of link state advertisements (LSAs) that contain information about interfaces, gateways, and metrics. OSPF routers collect this information into a link state database that is shared and synchronized among the various routers. The various routers use this database to determine the shortest path to other routers using the shortest path first (SPF) algorithm. The cost of each router interface is assigned by the network administrator. This number can include the delay, the bandwidth, and any monetary cost factors. However, the accumulated cost of any OSPF network can never be more than 65,535. The link state database is synchronized by all OSPF routers and the information contained in the database is used to compute routing table entries. Each OSPF router forms an adjacency with its neighboring routers.

When the router initializes, it sends out an LSA that contains only its own configuration. Over time, the router receives LSAs from other routers. The original router includes these routes in its own LSA and eventually will again send out its LSA, containing the information it received. This process is called flooding. Every router in the area then has the information from all other routers in the area.

After the link state database is compiled, the router determines the lowest cost path to each destination using the Dijkstra algorithm. Every other router and network reachable from that router will then have a shortest, least-cost path calculated. The resulting data structure is called the SPF tree. The SPF tree is different for each router in the network, because the routes are calculated based on each router as the root of the tree. After the SPF tree is calculated, the routing table is created from the information it contains. An entry will be created for each network in the area of the router. The routing table will contain the network ID, the subnet mask, the IP address of the appropriate router for traffic to be directed to for that network, the interface over which the router is reachable, and the OSPF-calculated cost to that network. This cost is the metric unit, not the hop count as it would be in an RIP-routed network.

Any time a change occurs in the internetwork, information about the change is flooded to the entire network. Every time updated information about the link state database is received, the routes in the routing table are recalculated.

OSPF router interfaces must be configured for an appropriate network type because the OSPF message address will be set for the specified network type. OSPF supports three network types:

• Broadcast, which is a network that is connected by two or more routers and broadcast traffic is passed between them. Examples of broadcast networks include Ethernet and FDDI.

• Non-broadcast multiple access (NBMA), which is a network that is connected by two or more routers but broadcast traffic does not pass on this network. OSPF must be configured to use IP unicasting instead of multicasting. Examples of this type of network include Asynchronous Transfer Mode (ATM) and Frame Relay.

• Point-to-Point, which is a network that is connected by only two routers. Examples of Point-to-Point networks include WAN links such as Digital Subscriber Line (DSL) or Integrated Services Digital Network (ISDN).