Routing Protocols

This section covers four main routing protocols:

■ Routing Information Protocol (RIP)

■ Enhanced Interior Gateway Routing Protocol (EIGRP)

■ Open Shortest Path First (OSPF)

■ Border Gateway Protocol (BGP)

Before discussing the characteristic of each protocol, this section covers how routers (Cisco routers, in particular) generally route IP packets.

Routing is a process whereby a path to a destination host is selected by either a dynamic or static routing protocol. A routing protocol is an algorithm that routes data across the network. Each router makes routing decisions from host to destination based on specific metrics used by the operating routing protocol. For example, RIP uses hop count (commonly known as the network diameter) to decide which router interface the data is sent over. A lower hop count is always preferred. OSPF, on the other hand, uses a cost metric; the lower a path's cost, the more preferred it is as a path to the destination.

Routing IP across a network of Cisco routers requires IP address allocation to interfaces and then a static or dynamic routing protocol to advertise these networks to local or remote routers. After these networks are advertised, IP data can flow across the network. Routing occurs at Layer 3 (the network layer) of the OSI model.

By default, IP routing is enabled on Cisco routers. The command used to start or disable IP routing is [no] ip routing. By default, IP routing is enabled on all routers, so you do not see this command by viewing the configuration. On the Catalyst switches, you have to enable IP routing to make it a Layer 3 device. Consider a one-router network with two directly connected Ethernet interfaces as an introductory example. Figure 1-13 displays a two-port Ethernet router configured with two subnets.

PC1 can communicate with PC2, as shown in Figure 1-13, because Cisco routers route to directly connected interfaces.

The Cisco IOS command show ip route is used to view the IP routing table, and a number of symbols define how remote or local networks have been discovered. Table 1-7 defines the various symbols and their meanings. The Cisco Documentation CD-ROM defines the routing fields or codes as follows.

Figure 1-13 Connected Routes

Directly Connected Networks

PC 1 E0 E1

PC 1

PC 2

PC 2

R1#show ip route

Codes C- connected, S- static, I- IGRP, R- RIP, M- mobile, B- BGP D- EIGRP, EX- EIGRP external, Q- QSPF, 1A- OSPF inter area N1- OSPF NSSA external type 1, N2- OSPF NSSA external type 2 E1- OSPF external type 1, E2- OSPF external type 2, E- EGP i- IS-IS, L1- IS-IS level-1, L2- IS-IS level-2.*-candidate default U- per-user static route, o- ODR

Gateway of last resort is not set is subnetted, 2 subnets C is directly connected, Ethernet0 C is directly connected, Ethernet1 R1#

Table 1-7 show ip route Defined*

Field Value



Indicates the protocol that derived the route. Possible values include

the following:

I—IGRP derived

R—RIP derived

O—OSPF derived



E—EGP derived

B—BGP derived


EX—EIGRP external

I—IS-IS derived



P—Periodic downloaded static route

U—Per-user static route

O—On-demand routing

50 Chapter 1: General Networking Topics Table 1-7 show ip route Defined* (Continued)

Field Value



Indicates the type of route. Possible values include the following:

*—The last path used when a packet was forwarded. It pertains only to the non-fast-switched packets. However, it does not indicate what path will be used next when forwarding a non-fast-switched packet, except when the paths are equal cost.

IA—OSPF interarea route.

E1—OSPF external type 1 route.

E2—OSPF external type 2 route.

N1—OSPF NSSA external type 1 route.

N2—OSPF NSSA external type 2 route.

O [90/5] via, 0:01:00, Ethernet2

Indicates the address of the remote network.

E [200/128] via, 0:02:22, Ethernet2


The first number in the brackets is the information source's administrative distance; the second number is the metric for the route.


Specifies the address of the next router to the remote network.

0:01:00 (O [90/ 5] via

Specifies the last time the route was updated, in hours:minutes:seconds.


Specifies the interface through which the specified network can be reached.

*Part of this table taken from ind_r/1rfindp2.htm#102251, all rights are reserved to Cisco.

*Part of this table taken from ind_r/1rfindp2.htm#102251, all rights are reserved to Cisco.

By default, Cisco IOS assigns to each routing protocol an administrative distance (AD) that indicates the trustworthiness of a routing entry if more than one path exists to a remote network running two or more routing algorithms. You can configure the AD value from the default with the distance administrative-distance Cisco IOS command if you want to manually choose RIP over OSPF, for example. The value for administrative-distance can be 1 to 255.

IP routing protocols support multipath destinations. In other words, if more than one path exists to a remote network, then metrics are used to determine whether load balancing will occur. If load balancing occurs and more than one routing protocol has learned this remote path, then the distinguisher becomes the AD—the lower its value, the more trusted it is. Remember that AD is first considered the delineator, followed by the metric.

Table 1-8 displays the administrative distances enabled by default on Cisco routers.

Table 1-8 Default Administrative Distances

Route Source

Default Administrative Distance

Connected interface


Static route


EIGRP summary route


External BGP


Internal EIGRP












EIGRP external route


Internal BGP




For example, Table 1-8 demonstrates that an EIGRP (AD 90) route is preferred over a network entry discovered by RIP (AD 120) because the AD is lower, or more trustworthy.

NOTE The IP address source and destination in an IP datagram do not alter, but the Layer 2 MAC source and destination do, for example, when PC1 sends a packet to PC2 in Figure 1-13. The TCP/IP software on PC1 identifies that the remote destination ( is not locally connected and sends the Layer 3 frame to the local gateway address, For the Layer 2 frame to traverse the local Ethernet, the destination Layer 2 MAC address must be that of the local router or gateway. PC2 resides on a different subnet, so the destination MAC address will be that of Router R1 (E0 burnt-in address) or the default gateway address of Router R1 then strips the Layer 2 header and installs its own Layer 2 header when the packet enters the network where PC2 resides. The Layer 2 header contains the source address (Layer 2) of R1 E1 and destination address of PC2's MAC address. The Layer 3 IP source and destination addresses do not change during the routing of the IP packet. The exception to changes in Layer 3 addressing is when Network Address Translation (NAT) is used.

Was this article helpful?

0 0

Post a comment