Routing is the process of moving information across an internetwork from source to destination.
|
Routing occurs at the network layer (layer 3) of the OSI model, or the internet layer of the TCP/IP protocol suite.
|
You can configure a router to use one or more routing protocols.
|
Routing protocols are used between routers to direct user traffic.
|
Routing protocols select optimal paths through the series of interconnected subnetworks.
|
Traditional network layer protocols then move information along these paths.
|
A routing protocol supports a routed protocol and is used only between routers to maintain routing tables.
|
Routers compare ^Rmetrics^r to determine an optimal path to a destination.
|
A metric is a standard of measurement based on one or more path characteristics.

Standard metrics include path cost, delay, hop count, and reliability.
|
Routing algorithms initialize and maintain routing tables.
|
Routing tables store routing information.
|
Initially, a router only knows how to reach networks or subnets that are directly connected to it.
|
Let's consider the example of a router with three interfaces, each connected to a different network.
|
The initial routing table only contains information for these directly connected systems.
|
There is no entry in the table for network 10.1.3.0 as it is not directly connected.
|
Routers learn of paths to destinations in three different ways:

• static routing
|
• default routing
|
• dynamic routing
@@
Static routes are manually defined as the only path to a destination.
|
A static route allows manual configuration of the routing table.
|
Static routes usually take precedence over routes chosen by dynamic routing protocols.
|
Routing updates are not sent on links if they are only defined by static routes. This conserves bandwidth.
|
However, you can override static routes with dynamic routing information through prudent assignment of administrative distance values.
|
Static knowledge is private. It is not conveyed to other routers as part of an update process.
|
Static routing works well in networks with simple design and predictable traffic.
|
If your network has a limited number of routers, you can configure your routing table manually.
|
Static routing is generally unsuitable for today's large, constantly changing networks.
|
You should limit static routes to those remote destinations that can only be reached through a single router.
|
Static routes do not keep up with dynamic changes in network topology.
|
The network administrator must manually update a static route entry whenever a topology change requires an update.
|
Static routing makes use of a network administrator's special knowledge about network topology.
|
For example, static routing allows an internetwork administrator to specify what is advertised about restricted partitions.
|
Where an internetwork can be reached by only one path, a static route to the partition will usually be sufficient.
|
Such a partition is called a ^Rstub network^r.
|
Configuring static routing to a stub network avoids the overheads incurred by dynamic routing.
|
To configure a static route using a Cisco router you use the command IP ROUTE.
|
The IP ROUTE command uses the arguments:

• ^Bnetwork^b - the destination network or subnet
| 	
• ^Bmask^b - the subnet task (optional, depending on
  destination)
|
• ^Baddress^b - the IP address of the next hop router
|
• ^Binterface^b - the interface to use to reach the
  destination
|
• ^Bdistance^b - the administrative distance (Optional)
|
The administrative distance is a rating of trustworthiness of a routing information source.

In Cisco routers, this is expressed as a numerical value between 0 and 255. The higher the value, the lower the trustworthiness rating.
|
Let's consider the example shown in the graphic.
|
Here the IP ROUTE command specifies a static route to the destination subnetwork 131.108.1.0.
|
The subnet mask 255.255.255.0 indicates that eight bits of subnetting are in effect.
|
Finally, the IP address of the next-hop router is specified as 131.108.2.1 (Cisco B).
|
For the example shown, the assignment of a static route from Cisco B to other networks locally attached to the Cisco A router is also possible.

However this requires a static route assignment for each destination network present.
@@
It is not necessary to create a separate routing table entry for every remote network in your system.
|
The system administrator can manually define a default route.
|
A default route is the path to take when no other route to the destination is known.
|
Packets destined for networks not specifically listed in the routing table can be forwarded to a default router.
|
A default router can also be referred to as a ^Rrouter of last^r ^Rresort^r, a router to which all unroutable packets are sent.
|
There must be an entry for this default router in the routing table.
|
Default routes can be set as a result of the administrator's static configuration.
|
You can configure a default router in your routing table by creating a routing entry using 0.0.0.0 as a destination.
|
Default routes can also be advertised by dynamic routing with knowledge of many protocols.
|
Let's consider an example where the routers in Company X only have specific knowledge of the Company X internetwork.
|
Maintaining specific information for every other network accessible through the Internet would be unreasonable.
|
Instead, the default route informs each router in Company X that packets for unknown destinations should be directed to the Internet.
|
To set up a default route you need to use the command IP DEFAULT-NETWORK.
|
The^B NETWORK-NUMBER^b argument contains the IP network number or subnet number defined as the default.
|
A typical example of how to set up a default route is shown in the graphic.
|
The command IP DEFAULT-NETWORK defines the class C network address 192.168.17.0 as the destination path for packets that have no routing table entry.
@@
Dynamic routing uses algorithms that analyze incoming routing update messages in real time.
|
Dynamic routes are entered into a routing table automatically, using information obtained from one or more routing protocols.
|
Initially, the network administrator must enter configuration commands to start dynamic routing.
|
The great advantage of dynamic routing is its ability to adapt automatically to topology change.
|
Changes in dynamic knowledge are exchanged between routers as part of the update process.
|
If a routing update message indicates a network change, the routing software recalculates routes and sends out new routing update messages.
|
These messages permeate the network and stimulate other routers to rerun their algorithms to keep routing knowledge consistent.
|
Let's consider an example to illustrate the benefit of dynamic routing.
|
First, consider the case where static knowledge is used to route a packet between two networks.
|
Router A refers to its routing table and uses the static knowledge there to relay the packet to Router D.
|
Router D does the same to relay the packet to Router C.
|
Router C delivers the packet to the destination host.
|
Now, let's assume that the path between Router A and Router D fails.
|
Router A is no longer able to relay the packet to Router D.
|
Until Router A is reconfigured to relay packets by way of Router B, communication with the destination network is impossible.
|
Now consider a dynamically configured system.
|
The routing table generated by Router A indicates that the preferred path to the destination network is via Router D.
|
When Router A recognizes that the link to Router D is down, it adjusts its routing table accordingly.
|
Router A now makes the alternate path through Router B the preferred path to the destination.  
|
Once the link between Router A and Router D is restored, Router A can again update its routing table to indicate its preferred path.
|
The success of dynamic routing depends on two basic router functions:

• maintenance of a routing table
|
• timely distribution of routing
  updates to other routers
|
Dynamic routing protocols maintain routing tables by doing the following:

• discovering routes to remote
  destinations
|
• advertising routes and their costs
  to other routers and hosts
|
Dynamic routing relies on the routing protocol to maintain and distribute routing knowledge.
|
The routing protocol defines the set of rules used by routers to communicate with each other.
|
For example, a routing protocol describes

• how updates are conveyed
|
• what information is conveyed
|
• when to convey information
|
• how to locate recipients of the updates
|
The routing algorithm is fundamental to dynamic routing.
|
The routing knowledge base needs to reflect an accurate, consistent view of the internetwork topology.
|
This concept is known as ^Rconvergence^r.
|
Convergence occurs when all routers are operating with the same view of the internetwork topology.
|
Fast convergence is a very desirable feature, as disruption of routing occurs during the time routers spend recomputing optimal paths.
|
The primary objective of a dynamic routing algorithm is to determine the best information to include in the routing table.
|
Each algorithm interprets "best" in its own way.
|
The routing algorithm generates a number or ^Rmetric^r for each path through the network.
|
Metrics are calculated on one or more characteristics of a path.
|
For more information on how to implement dynamic routing in an IP internetwork see the following CBT Systems courses:

• ^RImplementing Distance Vector 
   Routing Protocols^r

• ^RImplementing OSPF on Cisco 
   Routers^r

• ^RImplementing Enhanced IGRP 
   on Cisco Routers^r
@@
Most network communication occurs within small logical groups.
|
Routing systems often mimic this behavior by designating logical groups of nodes as domains, autonomous systems, or areas.
|
A ^Rrouting domain^r or ^Rautonomous^r ^Rsystem^r (AS) is a portion of an internetwork under common administrative authority.
|
An AS consists of routers that share information using the same routing protocol.
|
The Network Information Center (NIC), (RIPE in Europe), assigns a unique 16-bit AS number which you use in configuring your system.
|
With certain protocols, you can subdivide an AS into ^Rrouting areas.^r
|
Interior routing protocols are used to communicate within a single AS.
|
Interior routing algorithms are relatively simple because routers only need to know of other routers in the same domain.
|
The amount of routing update traffic can be reduced accordingly, depending on the routing algorithm used.
@@
Interior routing is implemented at the internet layer of the TCP/IP suite of protocols.
|
An interior router can use an IP routing protocol and a specific routing algorithm to accomplish routing.
|
The selection of IP as a routing protocol involves the setting of both global and interface parameters.
|
Examples of interior IP routing protocols include:

• RIP - a distance vector routing protocol
|
• IGRP - Cisco's distance vector routing protocol
|
• OSPF - a link-state routing protocol
|
• Enhanced IGRP - Cisco's balanced
  distance vector routing protocol
@@
Routing Information Protocol (RIP) is a distance vector routing protocol.
|
The distance vector routing approach determines the direction and distance (vector) to any link in the internetwork.

Distance vector routing protocols periodically send complete routing table updates to their neighbors.

Distant vector algorithms do not allow a router to know the exact topology of an internetwork.
|
RIP maintains only the best route to a destination.
|
When a router detects a topology change, it recalculates its routes and sends routing update messages.
|
Each entry in a RIP routing table provides a variety of information.
|
A typical RIP routing table entry has the following information:

• the destination network
|
• the next hop on the way
|
• timers
|
• a single metric
|
RIP uses a hop count metric to indicate distance to a destination.
|
The maximum allowable hop count is 15.
|
RIP makes use of timers to regulate performance.
|
The RIP ^Rrouting update timer^r ensures that each router broadcasts a complete copy of its routing table to all neighbors at regular intervals.
|
Neighbors are routers with interfaces to a common network.
|
This interval is typically set to 30 seconds.
|
The combination of the ^Rroute invalid timer^r and the ^Rflush^r ^Rtimer^r serves to determine when a route is marked invalid and eventually removed from the table.
|
RIP includes a number of features to aid operating stability:

• ^Rholddowns^r are used to prevent regular
  update messages from reinstating a route
  that has gone bad
|
Holddowns tell routers to embargo for a specified period any changes that might affect recently removed routes.

This prevents inoperative routes from being prematurely restored to other routers' tables.
|
• ^Rsplit horizons^r and ^Rpoison^r ^Rreverse updates^r
  are used to prevent routing loops
|
The split horizon rule dictates that information is never sent back in the direction from which it came.

This helps to prevent routing loops between adjacent routers.

Poison reverse updates are intended to defeat larger routing loops.
|
RIP is useful for routing within small to moderate-sized, homogeneous internetworks.
|
Its small hop count limit and single metric do not allow much flexibility in complex environments.
@@
Interior Gateway Routing Protocol (IGRP) is a distance vector routing protocol.
|
IGRP is designed to operate within autonomous systems that have complex topology.
|
IGRP design caters for media with diverse bandwidth and delay characteristics.
|
Organizations with large internetworks are now replacing RIP with the more robust IGRP.
|
IGRP is designed to work in any network environment.
|
IGRP uses a combination of metrics in the routing decision.
|
Internetwork delay, bandwidth, reliability, and load all feature in the routing decision.
|
You can manually set the weighting factors for each metric over a wide range.
|
This allows you to tailor metric settings in internetworks with widely varying performance characteristics.
|
As metric components are combined in a user-definable algorithm, you can influence route selection in an intuitive way.
|
IGRP permits multipath routing.
|
Multiple paths can be used even where the metrics for the paths are different.

Only routes with metrics that are within a certain range of the best route are used as multiple paths.
|
IGRP makes use of holddowns, split horizons, and poison reverse updates to enhance operating stability.
|
IGRP uses a number of timers to control performance.
|
IGRP timers include an update timer, an invalid timer, a holddown timer, and a flush timer.
|
The holddown timer setting is usually calculated to be just greater than the length of time necessary to update the entire network with a routing change.
|
IGRP has default settings for each of these timers.
@@
Open Shortest Path First (OSPF) is a link-state routing protocol.
|
Link-state routing protocols send routing information to all nodes in the internetwork.

Routers send only that portion of the routing table that describes the state of its own links.

A link-state routing algorithm maintains full knowledge of distant routers and how they interconnect.
|
As OSPF accumulates link-state information, it uses the SPF algorithm to calculate the shortest path to each node.
|
Although OSPF is an interior routing protocol, it can receive and send routes to other autonomous systems.
|
Unlike RIP, OSPF can operate within a hierarchy.
|
OSPF partitions an AS into logical areas to reduce routing traffic.
|
Intra-area routing occurs when the source and destination are in the same area.
|
Interarea routing occurs when they are in different areas.
|
<f>An OSPF backbone is responsible for distributing routing information between areas.
|
The backbone consists of all area border routers and their attached routers.
|
AS border routers running OSPF learn of exterior routes through exterior gateway protocols like EGP or BGP.
|
Once an SPF router is initialized, it uses the OSPF ^Rhello protocol^r to acquire neighbors.
|
Hello packets also serve as ^Rkeepalives^r, informing routers that other routers are still functional.
|
On multiaccess networks the hello protocol elects a ^Rdesignated router^r.
|
A multiaccess network refers to networks supporting more than two routers.
|
The designated router is responsible for generating link-state advertisements (LSAs) for the entire multiaccess network.
|
Designated routers allow a reduction in network traffic and topological database size.
|
Additional features offered by OSPF include:

• type of service (TOS) routing
|
• support for one or more metrics
|
• variable length subnet masks (VLSMs)
@@
Cisco's Enhanced IGRP combines the advantages of link-state protocols with those of distance vector protocols.
|
This balanced hybrid routing protocol uses distance vectors to determine the best paths to destination networks.
|
However, it resembles a link-state protocol in the way it uses topology changes to trigger routing database updates.
|
Enhanced IGRP is only available on Cisco routers.
|
Enhanced IGRP includes the following features:

• fast convergence
|
• variable length subnet masks
|
• partial bounded updates
|
• multiple network layer support
|
An Enhanced IGRP router receives full routing tables from its neighbors when it first communicates with them.
|
Thereafter, only changes to a routing table (or partial updates) are sent.
|
These partial updates are bounded in that they are only sent to neighboring routers that are affected by the changes.
|
Bounded, partial updates account for the improved bandwidth efficiency of Enhanced IGRP.
|
Enhanced IGRP supports path selection and packet switching for more than one routed protocol.
|
Network layer protocols currently supported include IP, AppleTalk, and Novell IPX.
|
The superior performance of Enhanced IGRP relies on a number of new features.
|
A ^Rneighbor table^r records the address and interface of each new neighbor discovered.
|
A ^Rtopology table^r contains all destinations advertised by neighboring routers.
|
Enhanced IGRP assigns ^Rroute states ^r(either active or passive) to entries in the routing table.
|
A destination is in the passive state when the router is not performing a recomputation.
|
If ^Rfeasible successors^r are always available, a destination never has to go into the active state.
|
A feasible successor refers to a neighboring router that is currently being used for packet forwarding but is not part of a routing loop.
|
Feasible successors provide the next least-cost path without introducing routing loops.
|
This leads to fewer route recomputations.
|
^RRoute tagging^r marks routes as internal or external.
|
Internal routes originate within an Enhanced IGRP autonomous system.
|
External routes are learned by another routing protocol or reside in the routing table as static routes.
|
Route tagging allows you to customize routing.
|
Enhanced IGRP provides compatibility and seamless interoperation with IGRP routers.
@@
Exterior routing protocols are specifically designed to route between Autonomous Systems.
|
However, some can also route within Autonomous Systems.
|
Exterior routing algorithms are more complex than interior routing algorithms, as they need to know about a greater number of other routers.
@@
The first of these protocols to gain wide acceptance was Exterior Gateway Protocol (EGP).
|
Although EGP is a dynamic routing protocol, it uses a very simple design.
|
By today's standards, EGP is not considered a true routing protocol.
|
Its routing updates only specify that certain networks are accessible through certain routers.
|
EGP does not use metrics and therefore cannot make intelligent routing decisions.
|
It cannot detect routing loops.
|
EGP has three main functions:

• routers running EGP establish a 
  set of neighbors or routers with 
  which they wish to share 
  accessibility information
|
• EGP routers poll their neighbors to 
  see if they are "alive"
|
• EGP routers send update messages 
  containing accessibility information 
  on networks within their ASs
|
The limited use of routing update messages places a topology restriction on any internetwork using EGP.
|
In addition to update messages, EGP also uses the following message types:

• neighbor acquisition - used to test
  if neighbors are alive
|
• neighbor reachability - used to 
  determine when a neighbor is down
|
• poll - used to acquire accessibility 
  information about the networks
  on which remote hosts reside
|
• error - used to identify various
  EGP error conditions
|
The current trend is towards more capable exterior gateway protocols like BGP.
@@
Border Gateway Protocol (BGP) is an inter-AS routing protocol created for use in the Internet.
|
BGP has the advantage that it can be used both within and between autonomous systems.
|
Two BGP neighbors communicating between autonomous systems must reside on the same physical network.
|
Communication between BGP routers within the same AS ensures that each has a consistent view of the AS.
|
This communication is also used to determine which BGP will serve as the connection point to or from certain external ASs.
|
Unlike EGP, BGP is capable of detecting routing loops.
|
The initial data exchange between two routers is the entire BGP routing table.
|
Incremental updates are sent out as the routing tables change.
|
The BGP metric specifies the degree of preference of a particular path.
|
Preference can be based on AS count, type of link, and other factors.

Metrics are typically assigned by the network administrator through configuration files.
|
BGP maintains a routing table with all feasible paths to a particular network.
|
However, it only advertises the optimal path in its update messages.
|
BGP update messages consist of "network number/AS path" pairs.
|
The AS path indicates the string of autonomous systems through which the specified network can be reached.
|
In addition to update messages, BGP uses three other message types:

• open - this is the first message
  sent once a transport protocol
  connection is established
|
• notification - this message is sent
  when an error is detected
|
• keepalive - these are sent often
  enough to keep the holddown timer
  from expiring
@@
