Chapter 6: IP Routing Essentials: Instructor Materials
Chapter 6: IP Routing Essentials: Instructor Materials
Chapter 6: IP Routing Essentials: Instructor Materials
Essentials
Instructor Materials
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 2
Routing Protocol Overview
• A router is necessary to transmit packets between network segments.
• A router’s primary function is to move a packet from one network to a different
network.
• This section will cover distance vector algorithms, enhanced distance vector
algorithms, link state algorithms, and path vector algorithms.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 3
Routing Protocol Overview
Routing Protocol Overview
• A router’s primary function is to move an IP packet from one network to a different
network.
• A router learns about nonattached networks through configuration of static routes or
through dynamic IP routing protocols.
• Dynamic IP routing protocols distribute network topology information between routers
and provide updates without intervention when a topology change in the network
occurs.
• With dynamic routing protocols, routers try to select the best loop-free path on which to
forward a packet to its destination IP address.
• A network of interconnected routers and related systems managed under a common
network administration is known as an autonomous system (AS), or a routing domain.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 4
Routing Protocol Overview
Routing Protocol Overview (Cont.)
The common dynamic routing protocols found
on most routing platforms today are as follows:
• Routing Information Protocol Version 2
(RIPv2)
• Enhanced Interior Gateway Routing (EIGRP)
• Open Shortest Path First (OSPF)
• Intermediate System-to-Intermediate System
(IS-IS)
• Border Gateway Protocol (BGP)
With the exception of BGP, the protocols in this list are designed and optimized for routing
within an autonomous system and are known as Interior Gateway Protocols (IGPs).
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 5
Routing Protocol Overview
Distance Vector Algorithms
Distance vector routing protocols, such as RIP, advertise routes as vectors, where distance is a
metric (or cost) such as hop count, and vector is the next-hop router’s IP used to reach the
destination:
• Distance - The distance is the route metric to reach the network.
• Vector - The vector is the interface or direction to reach the network.
When a router receives routing information from a neighbor, it stores it in a local routing database,
and the distance vector algorithm (such as the Bellman-Ford and Ford-Fulkerson algorithms) is
used to determine which paths are the best loop-free paths to each reachable destination.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 6
Routing Protocol Overview
Enhanced Distance Vector Algorithms
The diffusing update algorithm (DUAL) is an enhanced distance vector algorithm that EIGRP uses
to calculate the shortest path to a destination within a network. EIGRP advertises network
information to its neighbors as other distance vector protocols do, but it has some enhancements:
• It sends updates only when there is a change in the network. It does not send full routing table
updates in a periodic fashion, as distance vector protocols do.
• It uses hellos and forms neighbor
relationships just as link-state protocols do.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 10
Path Selection
Path Selection
Path selection has three main components:
• Prefix length - The prefix length represents the number of leading binary bits in the
subnet mask that are in the on position.
• Administrative distance - Administrative distance (AD) is a rating of the trustworthiness
of a routing information source. If a router learns about a route to a destination from more
than one routing protocol, and all the routes have the same prefix length, then the AD is
compared.
• Metrics - A metric is a unit of measure used by a routing protocol in the best-path
calculation. The metrics vary from one routing protocol to another.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 11
Path Selection
Prefix Length
Assume that a router has the following routes with various prefix lengths in the routing table:
10.0.3.0/28, 10.0.3.0/26, and 10.0.3.0/24.
Each of these routes, also known as prefix routes or simply prefixes, has a different prefix length
(subnet mask). The routes are considered to be different destinations, and they will all be installed
into the RIB, also known as the routing table. The routing table also includes the outgoing interface
and the next-hop IP address (unless the prefix is a connected network). Table 6-2 shows this routing
table.
Prefix IP Address Range Next Hop Outgoing Interface
Table 6-2 10.0.3.0/28 10.0.3.0–10.0.3.15 10.1.1.1 Gigabit Ethernet 1/1
Representation of
Routing Table 10.0.3.0/26 10.0.3.0–10.0.3.63 10.2.2.2 Gigabit Ethernet 2/2
10.0.3.0/24 10.0.3.0–10.0.3.255 10.3.3.3 Gigabit Ethernet 3/3
If a packet needs to be forwarded, the route chosen depends on the prefix length, where the longest
prefix length is always preferred. The forwarding decision is a function of the FIB and results from the
calculations performed in the RIB. The RIB is calculated through the combination of routing protocol
metrics and administrative distance.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 12
Path Selection Routing Protocol Default Administrative
Administrative Distance Distance
Because the EIGRP internal route has the best AD, it is the one installed into the routing table, as
demonstrated in Table 6-4.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 15
Path Selection
Metrics- Unequal-Cost Load Balancing
By default, routing protocols install only routes with the lowest path metric. However, EIGRP can
be configured to install multiple routes with different path metrics. This allows for unequal-cost load
balancing across multiple paths. Traffic is transmitted out the router’s interfaces based on that
path’s metrics in ratio to other the interface’s metrics.
Figure 6-7 shows a topology with four routers running EIGRP. The delay has been incremented on
R1’s Gi0/2 interface from 1 μ to 10 μ. R1 sees the two paths with different metrics. The path from
R1 to R3 via R1–R2–R3 has been assigned a path metric of 3328, and the path via R1–R4–R3
has been assigned a path metric of 5632.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 17
Static Routing
Static Routing and Static Route Types
Static routes are useful when:
• Dynamic routing protocols cannot be used on a router because of limited router CPU or
memory.
• Routes learned from dynamic routing protocols need to be superseded.
Static routes can be classified as one of the following:
• Directly attached static routes
• Recursive static route
• Fully specified static route
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 18
Static Routing
Directly Attached Static Routes
A static route that uses only the outbound next-hop interface is known as a directly attached static
route. The outbound interface specified must be in an up state for the route to be installed into the
RIB.
Note: Configuring a directly attached static route to an interface that uses Address Resolution
Protocol (ARP), such as an Ethernet network, causes problems and is not recommended. The
router must repeat the ARP process for every destination that matches the static route, which
consumes CPU and memory. In larger networks, this can cause router instability issues.
Point-to-point (P2P) serial interfaces do not use ARP, so static routes can directly reference the
outbound interface of a router. Directly attached static routes are configured with the command ip
route network subnetmask next-hop-interface-id..
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 20
Static Routing
Recursive Static Routes
The forwarding engine on Cisco devices needs to know which interface an outbound packet
should use.
• A recursive static route specifies the IP address of the next-hop address.
• The recursive lookup occurs when the router queries the RIB to locate the route toward the
next-hop IP address (connected, static, or dynamic) and then cross-references the
adjacency table.
• Recursive static routes are configured with the command ip route network subnet-mask
next-hop-ip.
• Recursive static routes require the route’s next-hop address to exist in the routing table to
install the static route into the RIB. A recursive static route may not resolve the next-hop
forwarding address using the default route (0.0.0.0/0) entry. The static route will fail next-
hop reachability requirements and will not be inserted into the RIB.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 21
Static Routing
Recursive Static Routes (Cont.)
Figure 6-9 shows a topology with R1 and R2 connected using the Gi0/0 port. R1 uses a
recursive static route to the 10.22.22.0/24 network, and R2 uses a recursive static route to the
10.11.11.0/24 network to allow connectivity between these networks.
• Specifying the next-hop address along with the physical interface removes the recursive lookup and
does not involve the ARP processing problems that occur when using only the outbound interface.
• Fully specified static routes are configured with the command ip route network subnet-mask
interface-id next-hop-ip.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 23
Static Routing
Floating Static Routing
Using a floating static route is a common technique for providing backup connectivity for prefixes
learned via dynamic routing protocols. A floating static route is configured with an AD higher than
that of the primary route (default AD on a static route is 1). Because the AD is higher than that of
the primary route, it is installed in the RIB only when the primary route is withdrawn. In Figure 6-
11, R1 and R2 are configured with two links. The 10.12.1.0/24 transit network is preferred to the
10.12.2.0/24 network.
Example 6-10 shows the configuration of the
floating static route on R1, and R2 would be
configured similarly. The static route using the
Ethernet link (10.12.1.0/24) has an AD of 10,
and the serial link (10.12.2.0/24) has an AD set
to 210.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 24
Static Routing
Static Null Routes
Configuring a static route to a null interface provides a method of dropping network
traffic without requiring the configuration of an access list. Creating a static route to
the Null0 interface is a common technique to prevent routing loops.
Figure 6-12 shows a common topology in which company ABC has acquired the
172.16.0.0/20 network range from its service provider. ABC uses only a portion of the
given addresses but keeps the large network block in anticipation of future growth.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 25
Static Routing
Static Null Routes (Cont.)
Example 6-14 shows the routing loop that occurs
when packets originate from R2 addressed to an
unused address on the 172.16.0.0 network.
Packets that do not match any route in the table on
R1, are sent using the default route to the ISP, who
then resends them back to R1. This continues until
TTL expires. Notice the IP address in the traceroute
alternative between the ISP router (192.168.1.2)
and R1 (192.168.1.1).
To prevent the routing loop, a static route is added
for 172.16.0.0/20, pointed to the Null0 interface on
R1. Any packets addressed to the 172.16.0.0/20
network that are not in the routing table of R1 will
be dropped. Example 6-15 shows the static null
route configuration for R1.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 26
Static Routing
IPv6 Static Routes
The static routing principles for IPv4 routes are
exactly the same for IPv6. IPv6 static routes are
configured with the command ipv6 route network/
prefix-length { next-hop-interface-id | [next-hop-
interface-id] next-ip-address}.
Figure 6-13 shows R1 and R2 with IPv6 addressing
to demonstrate static routing.
R1 needs a static route to R2’s 2001:db8:22::/64
network, and R2 needs a static route to R1’s
2001:d8:11::/64 network. Example 6-17 demonstrates
the IPv6 static route configuration for R1 and R2.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 28
Virtual Routing and Forwarding
Virtual Routing and Forwarding
The global VRF is identical to the regular routing table of non-VRF routers:
• Every router’s VRF maintains a separate routing table; it is possible to allow for overlapping
IP address ranges.
• VRF creates segmentation between network interfaces, network subinterfaces, IP addresses,
and routing tables.
• Configuring VRF on a router ensures that the paths are isolated, network security is
increased, and encrypting traffic on the network is not needed to maintain privacy between
VRF instances.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 29
Virtual Routing and Forwarding
Virtual Routing and Forwarding (Cont.)
Figure 6-14 shows two routers to help visualize the
VRF routing table concept. One of the routers has
no VRFs configured, and the other one has a
management VRF instance named MGMT.
The creation of multiprotocol VRF instances
requires the global configuration command vrf
definition vrf-name. Under the VRF definition
submode, the command address-family {ipv4 |
ipv6} is required to specify the appropriate address
family. The VRF instance is then associated to the
interface with the command vrf forwarding vrf-
name under the interface configuration submode.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 30
Virtual Routing and Forwarding
Virtual Routing and Forwarding (Cont.)
The following steps are required to create a VRF and assign it to an interface:
Step 1. Create a multiprotocol VRF routing table by using the command vrf definition vrf-name.
Step 2. Initialize the appropriate address family by using the command address-family {ipv4 |
ipv6}. The address family can be IPv4, IPv6, or both.
Step 3. Enter interface configuration submode and specify the interface to be associated with the
VRF instance by using the command interface interface-id.
Step 4. Associate the VRF instance to the interface or subinterface by entering the command vrf
forwarding vrf-name under interface configuration submode.
Step 5. Configure an IP address (IPv4, IPv6, or both) on the interface or subinterface by entering
either or both of the following commands:
IPv4 - ip address ip-address subnet-mask [secondary]
IPv6 - ipv6 address ipv6-address/prefix-length
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 31
Virtual Routing and Forwarding
Virtual Routing and Forwarding (Cont.)
Table 6-5 provides a set of interfaces and IP addresses that overlap between the global routing table and
the VRF instance.
Interface IP Address VRF Global
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 33
Prepare for the Exam
Key Topics for Chapter 6
Description
Term
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 35
Prepare for the Exam
Command Reference for Chapter 6
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 36