Cis82 7 RoutingDynamically
Cis82 7 RoutingDynamically
Routing Dynamically
Spring 2014
Chapter 3
2
Chapter 3: Objectives
⚫ Explain the basic operation of dynamic routing protocols.
⚫ Compare and contrast dynamic and static routing.
⚫ Determine which networks are available during an initial network
discovery phase.
⚫ Define the different categories of routing protocols.
⚫ Describe the process by which distance vector routing protocols
learn about other networks.
⚫ Identify the types of distance-vector routing protocols.
⚫ Configure the RIP routing protocol.
⚫ Configure the RIPng routing protocol.
⚫ Explain the process by which link-state routing protocols learn about
other networks.
3
Dynamic Routing Protocols
Evolution of Dynamic Routing Protocols
Routing Protocols Classification
5
Evolution of Dynamic Routing Protocols
6
Purpose of Dynamic Routing Protocols
Dynamic Routing Protocol
Algorithm
• Routing protocols use algorithms to I will use the EIGRP I will use the EIGRP
determine the best path to various DUAL algorithm to DUAL algorithm to
destinations. identify what the best identify what the best
routes are. routes are.
8
Dynamic versus Static Routing
Using Static Routing
R2(config)# ip route 172.16.3.0 255.255.255.0 172.16.2.2
• Very secure.
• Configuration complexity increases
• No advertisements are sent as compared to
dramatically as network grows.
dynamic routing protocols.
• Route to destination is always the same. • Manual intervention required to re-route traffic.
11
Dynamic Routing Scenario
Internet
13
Static Routing Scorecard
Advantages Disadvantages
• Less secure.
• Generally independent of the network size. • Additional configuration settings are required
to secure.
14
Static Routing Versus Dynamic Routing
Dynamic Routing Static Routing
Configuration Generally independent of the
Increases with network size
Complexity network size
15
Routing Protocol Operation
Dynamic Routing Protocol Operation
Update
Update
Update Update
Update Update
18
Note: Routers running RIPv2
Discover Directly Attached Networks
⚫ R1 adds the 10.1.0.0 network available through interface
FastEthernet 0/0 and 10.2.0.0 is available through interface Serial
0/0/0.
⚫ R2 adds the 10.2.0.0 network available through interface Serial
0/0/0 and 10.3.0.0 is available through interface Serial 0/0/1.
⚫ R3 adds the 10.3.0.0 network available through interface Serial
0/0/1 and 10.4.0.0 is available through interface FastEthernet 0/0.
19
This example is only for distance vector routing protocols (not link state routing protocols).
More later!
Distance vector routing protocols implement a routing loop prevention technique known as split horizon.
Split horizon prevents information from being sent out the same interface from which it was received.
For example, R2 does not send an update containing the network 10.1.0.0 out of Serial 0/0/0, because R2 learned
about network 10.1.0.0 through Serial 0/0/0. 20
This example is only for distance vector routing protocols (not link state routing protocols).
More later!
R 10.4.0.0 S0/0/1 1
21
This example is only for distance vector routing protocols (not link state routing protocols).
More later!
10.2.0.0(1), 10.3.0.0 10.1.0.0 10.3.0.0, 10.4.0.0 (1) 10.2.0.0, 10.1.0.0(1) 10.4.0.0 10.3.0.0, 10.2.0.0(1)
R 10.4.0.0 S0/0/1 1
22
This example is only for distance vector routing protocols (not link state routing protocols).
More later!
10.2.0.0(1), 10.3.0.0 10.1.0.0 10.3.0.0, 10.4.0.0 (1) 10.2.0.0, 10.1.0.0(1) 10.4.0.0 10.3.0.0, 10.2.0.0(1)
23
This example is only for distance vector routing protocols (not link state routing protocols).
More later!
10.2.0.0(1), 10.3.0.0 10.1.0.0 10.3.0.0, 10.4.0.0 (1) 10.2.0.0, 10.1.0.0(1) 10.4.0.0 10.3.0.0, 10.2.0.0(1)
24
This example is only for distance vector routing protocols (not link state routing protocols).
More later!
10.2.0.0(1), 10.3.0.0 10.1.0.0 10.3.0.0, 10.4.0.0 (1) 10.2.0.0, 10.1.0.0(1) 10.4.0.0 10.3.0.0, 10.2.0.0(1)
25
Split Horizon
10.3.0.0, 10.4.0.0
X
Network Interface Hop Network Interface Hop Network Interface Hop
⚫ Split horizon rule says that a router should not advertise a network through
the interface from which the update came.
Helps prevent routing loops caused by slow convergence.
26
Split Horizon – Route Poisoning
10.1.0.0 = 16 hops
X
Network Interface Hop Network Interface Hop Network Interface Hop
27
Split Horizon with Poison Reverse
10.3.0.0 = 16, 10.4.0.0 = 16
28
Network Discovery - Convergence
⚫ Convergence is when a network has complete and accurate information
about the entire network
⚫ Convergence time is the time it takes routers to share information,
calculate best paths, and update their routing tables.
⚫ NOTE:
A network is not completely operable until the network has converged.
29
Routing Protocol Classification
Classifying Routing Protocols
Cabrillo
College
AS-1
BGP
EIGRP
Static Route
ISP-2 AS-3
OSPF IS-IS
Default Static Route
Single customer
▪ BGP could be used to interconnect large organizations to service
providers and in between various service providers.
▪ Smaller organizations would typically connect using static routes but
could also use BGP.
33
Routing Protocol Operation
Distance Vector routing protocols are like signposts along the path to the final destination. 36
Distance Vector Concepts
37
Distance Vector
Routing Protocols
Link State routing protocols is like having a complete map of the network topology 39
Link-State Protocol Operation
⚫ Link-state protocols work best
in situations where
The network design is
hierarchical, usually occurring
in large networks.
The administrators have a
good knowledge of the
implemented link-state routing
protocol.
Fast convergence of the
network is crucial.
40
Link-State Routing
Protocols
41
Link-State Concepts
42
Link-State
Protocols Work
Best When
Routing update:
My 30 seconds are up. 172.16.0.0
I’m sending an update
to my RIP neighbor(s).
46
R3 Forwards a Classful Update to R2
Discontiguous Networks
172.16.1.0/24 192.168.1.0/30 192.168.2.0/30 172.16.2.0/24
.1 .1 .2 .2 .1 .1
S0/0/0 S0/0/0 S0/0/1 S0/0/1
G0/0 R1 R2 R3 G0/0
47
Connectivity Fails or Inconsistent at Best
Discontiguous Networks
172.16.1.0/24 192.168.1.0/30 192.168.2.0/30 172.16.2.0/24
.1 .1 .2 .2 .1 .1
S0/0/0 S0/0/0 S0/0/1 S0/0/1
G0/0 R1 R2 R3 G0/0
48
Classless Routing Protocols
172.16.1.0/24 192.168.1.0/30 192.168.2.0/30 172.16.2.0/24
.1 .1 .2 .2 .1 .1
S0/0/0 S0/0/0 S0/0/1 S0/0/1
G0/0 R1 R2 R3 G0/0
Routing update:
My 30 seconds are up.
I’m sending an update 172.16.1.0/24
to my RIP neighbor(s).
R2# show ip route | begin Gateway
Gateway of last resort is not set
Routing update:
My 30 seconds are up.
172.16.2.0/24 I’m sending an update
to my RIP neighbor(s).
50
Connectivity Success
172.16.1.0/24 192.168.1.0/30 192.168.2.0/30 172.16.2.0/24
.1 .1 .2 .2 .1 .1
S0/0/0 S0/0/0 S0/0/1 S0/0/1
G0/0 R1 R2 R3 G0/0
51
Routing Protocol Characteristics
⚫ Speed of Convergence:
Routing loops can occur when inconsistent routing tables are not
updated due to slow convergence in a changing network.
⚫ Scalability:
Large networks require a scalable the routing protocol.
⚫ Classful or Classless (Use of VLSM and summarization):
Classful routing protocols do not include the subnet mask and
cannot support VLSM while classless routing protocols do.
⚫ Resource Usage:
Defines how much memory space (RAM), CPU utilization, and link
bandwidth utilization is required by the routing protocol.
⚫ Implementation and Maintenance:
This describes the level of knowledge that is required for a network
administrator to implement and maintain the network based on the
routing protocol deployed.
Rick’s opinion…. Link state is easier to understand, maintain and
52
troubleshoot the distance vector.
Routing Protocols by Characteristic
53
Metrics
Purpose of a Metric
?
Routing Default
Description
Protocol Metric
RIP Hop count • Simple metric that counts the number of routers a packet traverses.
56
Routing Protocol Metrics
⚫ Different routing protocols use different metrics.
Routing metrics are not interchangeable between routing
protocols.
Two different routing protocols might choose different paths to
the same destination.
⚫ For example:
56 Kbps
57
R2# show ip route
<output omitted>
Gateway of last resort is not set
R 192.168.1.0/24 [120/1] via 192.168.2.1, 00:00:24, Serial0/0/0
C 192.168.2.0/24 is directly connected, Serial0/0/0
C 192.168.3.0/24 is directly connected, FastEthernet0/0
C 192.168.4.0/24 is directly connected, Serial0/0/1
R 192.168.5.0/24 [120/1] via 192.168.4.1, 00:00:26, Serial0/0/1
R 192.168.6.0/24 [120/1] via 192.168.2.1, 00:00:24, Serial0/0/0
[120/1] via 192.168.4.1, 00:00:26, Serial0/0/1
R 192.168.7.0/24 [120/1] via 192.168.4.1, 00:00:26, Serial0/0/1
R 192.168.8.0/24 [120/2] via 192.168.4.1, 00:00:26, Serial0/0/1
⚫ What happens when two or more routes to the same destination have
identical metric values?
The router load balances between these equal-cost paths.
All routing protocols do equal cost load balancing.
EIGRP also does unequal cost load balancing. 59
Purpose of Administrative Distance
⚫ What if a router learns about a remote
network from two different routing ?
sources.
⚫ What if RIP advertises the network as
10 hops away but OSPF advertises it
as a cumulative bandwidth of 100,000. So, which one would
⚫ Which is better RIP or OSPF? be preferred RIP or
Can’t tell OSPF? OSPF
RIP: 1.1.1.1. is
Can’t compare apples and oranges. 10 hops
OSPF: 1.1.1.1.
Note: This is not common. is 100,000 BW
⚫ Administrative distance (AD) is:
Used to determine which routing Which route would be
source takes precedence. preferred, OSPF or a Static
Used when there are multiple Route to the same network?
routing sources for the same Static Route
destination network address.
⚫ Lower the AD the more preferred the
routing source. 60
Purpose of Administrative Distance
⚫ Cisco uses Administrative distance
(AD) to define the preference of a
routing source.
⚫ Routing sources:
Directly connected networks
Static routes
Specific routing protocols
⚫ AD for static and dynamic can be
modifed (in CCNP)
Note
⚫ The term trustworthiness is
commonly used when defining
administrative distance.
⚫ The lower the administrative distance
value, the more trustworthy the route.
61
Purpose of Administrative Distance
⚫ AD: 0 to 255.
⚫ The lower the value, the more
preferred the route source.
⚫ AD of 0 is the most preferred.
Only a directly connected
network has an administrative
distance of 0, which cannot be
changed.
No better route to a network
than being directly connected
to that network.
⚫ AD of 255 means the router will
not believe the source of that route
Route will not be installed in
the routing table.
62
Administrative Distance of a Route
R2
R1 R3
63
Distance Vector Routing
Protocol
Distance Vector Routing Protocols
Dynamic Routing Protocols
65
Routing Information Protocol ver. 1 (RIPv1)
Characteristics and
RIPv1 RIPv2
Features
Supports VLSM
Supports CIDR
Supports Summarization
Secure
68
IGRP
⚫ The Interior Gateway Routing Protocol (IGRP) was the first proprietary
IPv4 routing protocol developed by Cisco in 1984.
⚫ Gave customers a choice between two standard protocols RIPv1 and
OSPF.
No hop limit
Easy to understand
⚫ Bandwidth and delay are used to create a composite metric.
Optionally, load and reliability can also be included in the calculation.
⚫ Routing updates are broadcast every 90 seconds, by default.
69
EIGRP
Characteristics and
IGRP EIGRP
Features
Both use a composite metric consisting of
Metric bandwidth and delay. Reliability and load can
also be included in the metric calculation.
Supports VLSM
Supports CIDR
Supports Summarization
Supports Authentication
71
Routing Information Protocol
Why RIP?
75
76
RIP Reference Topology
192.168.3.0/24
192.168.1.0/24 .1 G0/0
192.168.5.0/24
.1 DCE DCE .1
S0/0/0 S0/0/0 S0/0/1
G0/0 R1 R2 S0/0/1 R3 G0/0
.1 .2 .2 .1
192.168.2.0/30 192.168.4.0/30
G0/0
G0/0
G0/0
77
Entering Routing Configuration Mode
192.168.3.0/24
192.168.1.0/24 .1 G0/0
192.168.5.0/24
.1 DCE DCE .1
S0/0/0 S0/0/0 S0/0/1
G0/0 R1 R2 S0/0/1 R3 G0/0
.1 .2 .2 .1
192.168.2.0/30 192.168.4.0/30
R1# conf t
Enter configuration commands, one per line. End with
CNTL/Z.
R1(config)# router rip
R1(config-router)#
78
RIP Configuration Options
R1(config-router)# ?
Router configuration commands:
address-family Enter Address Family command mode
auto-summary Enable automatic network number summarization
default Set a command to its defaults
default-information Control distribution of default information
default-metric Set metric of redistributed routes
distance Define an administrative distance
distribute-list Filter networks in routing updates
exit Exit from routing protocol configuration mode
flash-update-threshold Specify flash update threshold in second
help Description of the interactive help system
input-queue Specify input queue depth
maximum-paths Forward packets over multiple paths
neighbor Specify a neighbor router
network Enable routing on an IP network
no Negate a command or set its defaults
offset-list Add or subtract offset from RIP metrics
output-delay Interpacket delay for RIP updates
passive-interface Suppress routing updates on an interface
redistribute Redistribute information from another routing
protocol
timers Adjust routing timers
traffic-share How to compute traffic share over alternate paths
validate-update-source Perform sanity checks against source address of
routing updates
version Set routing protocol version
R1(config-router)#
79
Advertising the R1 Networks
192.168.3.0/24
192.168.1.0/24 .1 G0/0
192.168.5.0/24
.1 DCE DCE .1
S0/0/0 S0/0/0 S0/0/1
G0/0 R1 R2 S0/0/1 R3 G0/0
.1 .2 .2 .1
192.168.2.0/30 192.168.4.0/30
192.168.1.0/24 .1 G0/0
192.168.5.0/24
.1 DCE DCE .1
S0/0/0 S0/0/0 S0/0/1
G0/0 R1 R2 S0/0/1 R3 G0/0
.1 .2 .2 .1
192.168.2.0/30 192.168.4.0/30
81
Advertising the R3 Networks
192.168.3.0/24
192.168.1.0/24 .1 G0/0
192.168.5.0/24
.1 DCE DCE .1
S0/0/0 S0/0/0 S0/0/1
G0/0 R1 R2 S0/0/1 R3 G0/0
.1 .2 .2 .1
192.168.2.0/30 192.168.4.0/30
82
Verifying RIP Settings on R1
R1# show ip protocols
*** IP Routing is NSF aware ***
192.168.1.0/24 .1 G0/0
192.168.5.0/24
.1 DCE DCE .1
S0/0/0 S0/0/0 S0/0/1
G0/0 R1 R2 S0/0/1 R3 G0/0
.1 .2 .2 .1
192.168.2.0/30 192.168.4.0/30
84
Verifying RIP Settings on R2
R2# show ip protocols
*** IP Routing is NSF aware ***
192.168.1.0/24 .1 G0/0
192.168.5.0/24
.1 DCE DCE .1
S0/0/0 S0/0/0 S0/0/1
G0/0 R1 R2 S0/0/1 R3 G0/0
.1 .2 .2 .1
192.168.2.0/30 192.168.4.0/30
87
Verifying RIP Routes on R3
192.168.3.0/24
192.168.1.0/24 .1 G0/0
192.168.5.0/24
.1 DCE DCE .1
S0/0/0 S0/0/0 S0/0/1
G0/0 R1 R2 S0/0/1 R3 G0/0
.1 .2 .2 .1
192.168.2.0/30 192.168.4.0/30
88
RIP Versions
R1# show ip protocols
*** IP Routing is NSF aware ***
<Output omitted>
RIPv2
192.168.1.0/24 .1 G0/0
192.168.5.0/24
.1 DCE DCE .1
S0/0/0 S0/0/0 S0/0/1
G0/0 R1 R2 S0/0/1 R3 G0/0
.1 .2 .2 .1
192.168.2.0/30
RIPv1 192.168.4.0/30
RIPv1
Note:
• Configuring version 1 enables RIPv1 only
• Configuring no version returns the router to the default settings.
90
Verifying RIP Routes on R1
192.168.3.0/24
RIPv2
192.168.1.0/24 .1 G0/0
192.168.5.0/24
.1 DCE DCE .1
S0/0/0 S0/0/0 S0/0/1
G0/0 R1 R2 S0/0/1 R3 G0/0
.1 .2 .2 .1
192.168.2.0/30
RIPv1 192.168.4.0/30
RIPv1
91
Enable and Verify RIPv2 on R2
192.168.3.0/24
192.168.2.0/30 192.168.4.0/30
RIPv1
RIPv2
R2(config)# router rip
R2(config-router)# version 2
R2(config-router)# end
R2#
R2# show ip protocols | section Default
Default version control: send version 2, receive version 2
Interface Send Recv Triggered RIP Key-chain
GigabitEthernet0/0 2 2
Serial0/0/0 2 2
Serial0/0/1 2 2
R2#
92
Verifying RIP Routes on R2
192.168.3.0/24
192.168.2.0/30 192.168.4.0/30
RIPv1
RIPv2
R2# show ip route | begin Gateway
Gateway of last resort is not set
93
Enable and Verify RIPv2 on R3
192.168.3.0/24
192.168.2.0/30
RIPv2 192.168.4.0/30
RIPv2
R3(config)# router rip
R3(config-router)# version 2
R3(config-router)# end
R3#
R3# show ip protocols | section Default
Default version control: send version 2, receive version 2
Interface Send Recv Triggered RIP Key-chain
GigabitEthernet0/0 2 2
Serial0/0/1 2 2
R3#
94
Verifying RIP Routes on R3
192.168.3.0/24
192.168.2.0/30
RIPv2 192.168.4.0/30
RIPv2
R3# show ip route | begin Gateway
Gateway of last resort is not set
95
96
Auto-Summary and
RIPv2
⚫ You still see the summarized 172.30.0.0/16 route with the same
two equal-cost paths. 97
Auto-Summary and RIPv2
⚫ The routing table for R2 now contains the individual subnets for 172.30.0.0/16.
⚫ Notice that a single summary route with two equal-cost paths no longer exists.
⚫ Each subnet and mask has its own specific entry, along with the exit interface and
100
next-hop address to reach that subnet.
Verifying RIPv2 Updates
102
⚫ Fully converged routing tables.
RIP Passive Interfaces
192.168.3.0/24
192.168.1.0/24 .1 G0/0
192.168.5.0/24
.1 DCE DCE .1
S0/0/0 S0/0/0 S0/0/1
G0/0 R1 R2 S0/0/1 R3 G0/0
.1 .2 .2 .1
192.168.2.0/30 192.168.4.0/30
Routing update:
192.168.1.0/24 192.168.1.0/24 192.168.5.0/24
.1 G0/0
.1 DCE DCE .1
S0/0/0 S0/0/0 S0/0/1
G0/0 R1 R2 S0/0/1 R3 G0/0
.1 .2 .2 .1
192.168.2.0/30 192.168.4.0/30
R2#
107
Configuring a Passive Interface
NOTE:
on R3
R3(config)# router rip
R3(config-router)# passive-interface default • As an alternative, all interfaces can be
R3(config-router)# no passive-interface s0/0/1 made passive using the passive-
R3(config-router)# end interface default command.
R3# • Interfaces that should not be passive can
*Mar 10 16:34:28.899: %SYS-5-CONFIG_I: Configured from console by
be re-enabled using the no passive-
console
R3# show ip protocols | begin Default interface command.
Default version control: send version 2, receive version 2
Interface Send Recv Triggered RIP Key-chain
Serial0/0/1 2 2
Automatic network summarization is not in effect
Maximum path: 4
Routing for Networks:
192.168.4.0
192.168.5.0
Passive Interface(s):
Embedded-Service-Engine0/0
GigabitEthernet0/0
GigabitEthernet0/1
GigabitEthernet0/3
Serial0/0/0
Routing Information Sources:
Gateway Distance Last Update
192.168.4.2 120 00:00:23
Distance: (default is 120)
R3#
108
RIP Propagating a Default Static Route
Internet
192.168.3.0/24
209.165.200.224/27
.226
110
Verifying RIP
Routes on R1
113
Configuring RIPng
RIPng Reference Topology
2001:DB8:CAFE:2::/64
2001:DB8:CAFE:1::/64 2001:DB8:CAFE:3::/64
:1 G0/0
:1 DCE DCE :1
S0/0/0 S0/0/0 S0/0/1
G0/0 R1 R2 S0/0/1 R3 G0/0
:1 :2 :2 :1
2001:DB8:CAFE:A001::/64 2001:DB8:CAFE:A002::/64
115
Enabling RIPng on the R1 Interfaces
2001:DB8:CAFE:2::/64
2001:DB8:CAFE:1::/64 2001:DB8:CAFE:3::/64
:1 G0/0
:1 DCE DCE :1
S0/0/0 S0/0/0 S0/0/1
G0/0 R1 R2 S0/0/1 R3 G0/0
:1 :2 :2 :1
2001:DB8:CAFE:A001::/64 2001:DB8:CAFE:A002::/64
116
Enabling RIPng on the R2 Interfaces
2001:DB8:CAFE:2::/64
2001:DB8:CAFE:1::/64 2001:DB8:CAFE:3::/64
:1 G0/0
:1 DCE DCE :1
S0/0/0 S0/0/0 S0/0/1
G0/0 R1 R2 S0/0/1 R3 G0/0
:1 :2 :2 :1
2001:DB8:CAFE:A001::/64 2001:DB8:CAFE:A002::/64
117
Enabling RIPng on the R3 Interfaces
2001:DB8:CAFE:2::/64
2001:DB8:CAFE:1::/64 2001:DB8:CAFE:3::/64
:1 G0/0
:1 DCE DCE :1
S0/0/0 S0/0/0 S0/0/1
G0/0 R1 R2 S0/0/1 R3 G0/0
:1 :2 :2 :1
2001:DB8:CAFE:A001::/64 2001:DB8:CAFE:A002::/64
118
Verifying RIP Settings on R1
2001:DB8:CAFE:2::/64
2001:DB8:CAFE:1::/64 2001:DB8:CAFE:3::/64
:1 G0/0
:1 DCE DCE :1
S0/0/0 S0/0/0 S0/0/1
G0/0 R1 R2 S0/0/1 R3 G0/0
:1 :2 :2 :1
2001:DB8:CAFE:A001::/64 2001:DB8:CAFE:A002::/64
119
Verifying Routing Table on R1
2001:DB8:CAFE:2::/64
2001:DB8:CAFE:1::/64 2001:DB8:CAFE:3::/64
:1 G0/0
:1 DCE DCE :1
S0/0/0 S0/0/0 S0/0/1
G0/0 R1 R2 S0/0/1 R3 G0/0
:1 :2 :2 :1
2001:DB8:CAFE:A001::/64 2001:DB8:CAFE:A002::/64
<Output omitted>
C 2001:DB8:CAFE:1::/64 [0/0]
via GigabitEthernet0/0, directly connected
L 2001:DB8:CAFE:1::1/128 [0/0]
via GigabitEthernet0/0, receive
R 2001:DB8:CAFE:2::/64 [120/2]
via FE80::FE99:47FF:FE71:78A0, Serial0/0/0
R 2001:DB8:CAFE:3::/64 [120/3]
via FE80::FE99:47FF:FE71:78A0, Serial0/0/0
C 2001:DB8:CAFE:A001::/64 [0/0]
via Serial0/0/0, directly connected
L 2001:DB8:CAFE:A001::1/128 [0/0]
via Serial0/0/0, receive
R 2001:DB8:CAFE:A002::/64 [120/2]
via FE80::FE99:47FF:FE71:78A0, Serial0/0/0
2001:DB8:CAFE:1::/64 2001:DB8:CAFE:3::/64
:1 G0/0
:1 DCE DCE :1
S0/0/0 S0/0/0 S0/0/1
G0/0 R1 R2 S0/0/1 R3 G0/0
:1 :2 :2 :1
2001:DB8:CAFE:A001::/64 2001:DB8:CAFE:A002::/64
R 2001:DB8:CAFE:2::/64 [120/2]
via FE80::FE99:47FF:FE71:78A0, Serial0/0/0
R 2001:DB8:CAFE:3::/64 [120/3]
via FE80::FE99:47FF:FE71:78A0, Serial0/0/0
R 2001:DB8:CAFE:A002::/64 [120/2]
via FE80::FE99:47FF:FE71:78A0, Serial0/0/0
R1#
121
Verifying RIP Routing Table on R2
2001:DB8:CAFE:2::/64
2001:DB8:CAFE:1::/64 2001:DB8:CAFE:3::/64
:1 G0/0
:1 DCE DCE :1
S0/0/0 S0/0/0 S0/0/1
G0/0 R1 R2 S0/0/1 R3 G0/0
:1 :2 :2 :1
2001:DB8:CAFE:A001::/64 2001:DB8:CAFE:A002::/64
R 2001:DB8:CAFE:1::/64 [120/2]
via FE80::FE99:47FF:FE75:C3E0, Serial0/0/0
R 2001:DB8:CAFE:3::/64 [120/2]
R2#
122
Verifying RIP Routing Table on R3
2001:DB8:CAFE:2::/64
2001:DB8:CAFE:1::/64 2001:DB8:CAFE:3::/64
:1 G0/0
:1 DCE DCE :1
S0/0/0 S0/0/0 S0/0/1
G0/0 R1 R2 S0/0/1 R3 G0/0
:1 :2 :2 :1
2001:DB8:CAFE:A001::/64 2001:DB8:CAFE:A002::/64
R 2001:DB8:CAFE:1::/64 [120/3]
via FE80::FE99:47FF:FE71:78A0, Serial0/0/1
R 2001:DB8:CAFE:2::/64 [120/2]
via FE80::FE99:47FF:FE71:78A0, Serial0/0/1
R 2001:DB8:CAFE:A001::/64 [120/2]
via FE80::FE99:47FF:FE71:78A0, Serial0/0/1
R3#
123
Link-State Routing Protocols
Classifying Routing Protocols
▪ Open Shortest Path First (OSPF)
Dynamic Routing Protocols
is the most common IGP routing
protocol implemented within an
organizational AS.
Interior Gateway Protocols • Began in 1987
(IGP) • OSPFv2 - OSPF for IPv4
networks
Link-State
• OSPFv3 - OSPF for IPv6
Routing Protocols networks
▪ Intermediate-System to
Intermediate-System (IS-IS) is a
less popular link-state protocol
sometimes used within service
OSPF IS-IS
provider networks.
IS-IS was designed by
International Organization for
Standardization (ISO )
125
Shortest Path First (SPF) Algorithm
127
R1 SPF Tree
128
R2 SPF Tree
129
R3 SPF Tree
130
R4 SPF Tree
131
R5 SPF Tree
132
Link-State Routing Process
1. Each router learns about its own links, its own directly connected networks.
(Interface is “up”)
2. Each router is responsible for meeting its neighbors on directly connected
networks. (OSPF Hello packets)
3. Each router builds a link-state packet (LSP) containing the state of each
directly connected link. (neighbor ID, link type, and bandwidth)
4. Each router floods the LSP to all neighbors, who then store all LSPs
received in a database.
Neighbors then flood the LSPs to their neighbors until all routers in the
area have received the LSPs.
5. Each router uses the database to construct a complete map of the topology
and computes the best path to each destination network.
The SPF algorithm is used to construct the map of the topology and to
determine the best path to each network. (Road map)
All routers will have a common map or tree of the topology, but each
router will independently determine the best path to each network within
that topology.
133
⚫ Detail and explanations are coming next!
Step 1: Learning About
Directly Connected
Networks
⚫ Step 1: Each router learns about its own links, its own directly
connected networks.
Interface configured with an IP address/subnet mask.
Directly connected networks are now part of the routing table
Regardless of the routing protocols used.
⚫ A link is an interface on a router.
⚫ For the link participate in the link-state routing process, it must be:
In the up state.
134
Included in the routing protocol (coming).
Step 1 Link 2
• Network: 10.2.0.0/16
• IP address: 10.2.0.1
• Type of network: Serial
• Cost of that link: 20
• Neighbors: R2
Link 1
• Network: 10.1.0.0/16
• IP address: 10.1.0.1 Link 3
• Type of network: Ethernet • Network: 10.3.0.0/16
• Cost of that link: 2 • IP address: 10.3.0.1
• Neighbors: None • Type of network: Serial
• Cost of that link: 5
• Neighbors: R3
Link 4
• Network: 10.4.0.0/16
⚫ Link states - Information about the state of a • IP address: 10.4.0.1
router’s links • Type of network: Serial
• Cost of that link: 20
⚫ This information includes interface’s: • Neighbors: R4
IP address/mask
Type of network
Ethernet (broadcast) or serial point-to-point
link
Cost of that link
Any neighbor routers on that link 135
Step 1
Initially:
⚫ Router unaware of any neighbor routers on the link.
⚫ Learns of neighbor when receives a Hello packet from the adjacent
neighbor.
136
Hello, I’m
R2
Neighbors
Hello, I’m
R4
Hello packets
⚫ “Keepalive” function
⚫ Stops receiving Hello packets from a neighbor, that neighbor is
considered unreachable and the adjacency is broken.
138
Step 3: Building
the Link-State
Packet
139
Step 3: Building
the Link-State
Packet
⚫ Step 4: Each router floods the LSP to all neighbors, who then store all
LSPs received in a database.
Each router floods its link-state information to all other link-state routers.
When a router receives an LSP from a neighboring router, sends that
LSP out all other interfaces, except the interface that received the LSP.
Flooding effect of LSPs throughout the routing area.
⚫ Link-state routing protocols calculate the SPF algorithm after the flooding is
complete.
141
Step 4: Flooding Link-State
Packets to Neighbors
Step 5:
Constructing a
Link-State
Database
⚫ Step 5 (Final Step):
Each router uses the
database to construct a
complete map of the
topology and computes
the best path to each
destination network.
⚫ Each router in the routing area can now use the SPF algorithm to
construct the SPF trees that you saw earlier.
144
Step 5: Constructing a Link-State Database
SPF Tree for R1
⚫ With a complete link-state database, R1 can use shortest path first (SPF)
algorithm to calculate shortest path to each network.
⚫ SPF algorithm results in an SPF tree.
145
Building the Shortest Path First
(SPF) Tree
Link State Database for R1
146
R1 Processes the LSPs from R2
Red: New
information
for tree.
⚫ The SPF algorithm begins by processing the following LSP information from R2:
Connected to neighbor R1 on network 10.2.0.0/16, cost of 20
Connected to neighbor R5 on network 10.9.0.0/16, cost of 10
147
Has a network 10.5.0.0/16, cost of 2
R1 Processes the LSPs from R3
Red: New
information
for tree.
⚫ The SPF algorithm begins by processing the following LSP information from R3:
Connected to neighbor R1 on network 10.3.0.0/16, cost of 5
Connected to neighbor R4 on network 10.7.0.0/16, cost of 10
148
Has a network 10.6.0.0/16, cost of 2
R1 Processes the LSPs from R4
Red: New
information
for tree.
⚫ The SPF algorithm begins by processing the following LSP information from R4:
Connected to neighbor R1 on network 10.4.0.0/16, cost of 20
Connected to neighbor R3 on network 10.7.0.0/16, cost of 10
Connected to neighbor R5 on network 10.10.0.0/16, cost of 10 149
Has a network 10.8.0.0/16, cost of 2
R1 Processes the LSPs from R5
Red: New
information
for tree.
⚫ The SPF algorithm begins by processing the following LSP information from R5:
Connected to neighbor R2 on network 10.9.0.0/16, cost of 10
Connected to neighbor R4 on network 10.10.0.0/16, cost of 10
Has a network 10.11.0.0/16, cost of 2 150
SPF Tree
151
Determining the
Shortest Path
⚫ Using the SPF tree, SPF algorithm results in the shortest path to each
network.
Note: Only the LANs are shown in the table, but SPF can also be used
to determine the shortest path to each WAN link network.
152
Network 10.5.0.0/16
Determining the via R2 Serial 0/0/0 2
at a cost of 22
Shortest Path
20
153
Determining the
Shortest Path
2
5
154
Determining the
Shortest Path
10
155
Determining the
Shortest Path
10
156
Network 10.9.0.0/16
Determining the via R2 Serial 0/0/0
at a cost of 30
Shortest Path 10
20
157
Determining the
Shortest Path
10
10
Network 10.10.0.0/16
via R3 Serial 0/0/1
at a cost of 25
158
Determining the
Network 10.11.0.0/16 via
Shortest Path R3 Serial 0/0/1 at a
cost of 27
5 2
10
10
159
Determining the
Shortest Path
⚫ Each router constructs its own SPF tree independently from all other
routers.
⚫ Link-state databases must be identical on all routers.
160
Generating a Routing Table from the SPF Tree
SPF Tree for R1
⚫ These paths listed previously can now be added to the routing table.
⚫ The routing table will also include
Directly connected networks
Routes from any other sources, such as static routes.
⚫ Packets will now be forwarded according to these entries in the routing
table.
161
Advantages of Link-State Routing Protocols
• When receiving an LSP, LS protocols immediately flood the LSP out all
interfaces except for the interface from which the LSP was received.
Fast Convergence • In contrast, RIP processes each message, updates the routing table,
then flood to the next neighbour.
• After the initial flooding of LSPs, link-state routing protocols only send
Event-driven
out an LSP when there is a change in the topology.
Updates • The LSP contains only the information regarding the affected link.
162
Disadvantages of Link-State Routing Protocols
163
Addressing Disadvantages
⚫ Create areas to minimize the router memory requirements,
processing requirements, and bandwidth requirenments.
164
Routing Table
Understanding the Routing
Table
166
Reference Topology – Connected and Local
Internet
172.16.2.0/24 172.16.3.0/24
209.165.200.234/30
209.165.200.224/30 209.165.200.228/30
168
Reference Topology
Internet
172.16.2.0/24 172.16.3.0/24
209.165.200.224/30 209.165.200.228/30
209.165.200.224/30 209.165.200.228/30
192.168.0.0/16
170
IPv4 Routing Table:
Ultimate route
Level 1 route
Level 1 parent route
Level 2 child routes
Ultimate Route
⚫ An ultimate route is a routing table entry that contains either:
a next-hop IP address or
an exit interface
This can be directly connected, dynamic, static, and link local
routes are ultimate routes.
R1#show ip route | begin Gateway
Gateway of last resort is 209.165.200.234 to network 0.0.0.0
⚫ A level 1 route is a route with a subnet mask equal to or less than the
classful mask of the network address.
173
Level 1 Route
Next-hop IP address
Level 1 Routes
and/or exit interface
192.168.1.0/24
192.168.0.0/16
0.0.0.0/0
174
Level 1
Routes
175
Level 1 Parent Route
⚫ A level 1 parent route is a level 1 route that is subnetted.
A level 1 parent route is automatically created any time a
subnet is added to the routing table.
A parent route can never be an ultimate route.
Each entry displays the classful network address, the number of
subnets and the number of different subnet masks that the
classful address has been subdivided into.
R1# show ip route | begin Gateway
Gateway of last resort is 209.165.200.234 to network 0.0.0.0
176
Level 2 Child Route
⚫ A level 2 child route is a route that is a subnet of a classful network
address.
Like a level 1 route, the source of a level 2 route can be a
directly connected network, a static route, or a dynamically
learned route. Level 2 child routes are also ultimate routes.
R1# show ip route | begin Gateway
Gateway of last resort is 209.165.200.234 to network 0.0.0.0
177
Child Routes (Using 12.4 IOS, so no Local Routes)
178
Routing Table Lookup Process
IP Packet
Routing Table
179
Route Lookup Process
1. If the best match is a level 1 ultimate route, then this route is used
to forward the packet.
2. If the best match is a level 1 parent route, proceed to the next step.
The router examines child routes of the parent route for a best match.
3. If there is a match with a level 2 child route, that subnet is used to
forward the packet.
4. If there is no match with any of the level 2 child routes, then the
router continues searching level 1 supernet routes in the routing
table for a match, including the default route, if there is one.
5. If there is now a lesser match with a level 1 supernet or default
routes, the router uses that route to forward the packet.
6. If there is not a match with any route in the routing table, the router
drops the packet.
180
R1#show ip route | begin Gateway 192.168.1.100
Gateway of last resort is 209.165.200.234 to network 0.0.0.0
1. If the best match is a level 1 ultimate route, then this route is used
to forward the packet.
185
Match Level 1 Routes (FYI)
Next-hop IP
Level 1 Routes Level 2 Routes address and/or
exit interface
192.168.1.0/24
192.168.0.0/16
0.0.0.0/0
186
Route Lookup Process (FYI)
1. If the best match is a level 1 ultimate route, then this route is used
to forward the packet.
2. If the best match is a level 1 parent route then the router examines
child routes (the subnet routes) of the parent route for a best
match.
3. If there is a match with a level 2 child route, that subnet is used to
forward the packet.
187
Match Level 2 Child Routes (FYI)
Next-hop IP
Level 1 Routes Level 2 Routes address and/or
exit interface
192.168.1.0/24
192.168.0.0/16
0.0.0.0/0
172.16.0.0 172.16.1./24
172.16.2./24
172.16.3./24
172.16.4./28
209.165.224.0 209.165.224.0/30
209.165.228.0/30
209.165.232.0/30
188
Match Supernet and Then Default Route
(FYI)
Next-hop IP
Level 1 Routes Level 2 Routes address and/or
exit interface
192.168.1.0/24
192.168.0.0/16
0.0.0.0/0
189
Best Route = Longest Match (FYI)
⚫ The best match is the route in the routing table that has the most
number of far left matching bits with the destination IPv4 address of
the packet.
⚫ The route with the greatest number of equivalent far left bits, or the
longest match, is always the preferred route.
191
A packet is destined for 172.16.0.10
⚫ The router has three possible routes that match this packet:
172.16.0.0/12
172.16.0.0/18
172.16.0.0/26.
192
R1#show ip route | begin Gateway 172.16.3.10
Gateway of last resort is 209.165.200.234 to network 0.0.0.0
193
Longest Match Example
172.16.3.10
194
Longest Match 172.16.3.10
Example
195
Longest Match 172.16.3.10
Example
196
Longest Match 172.16.3.10
Example
197
Question
⚫ Assume that a router has four routing processes running on it, and
each process has received these routes:
EIGRP (internal): 192.168.32.0/26
RIP: 192.168.32.0/24
OSPF: 192.168.32.0/19
198
Longest Match
199
Longest Match
200
Longest Match Quiz #1
201
Longest Match Quiz #1
202
Longest Match Quiz #2
203
Longest Match Quiz #2
204
IPv6 Routing Tables
R1# show ipv6 route
⚫ Components of the IPv6
<Output omitted>
routing table are very
C 2001:DB8:CAFE:1::/64 [0/0] similar to the IPv4 routing
via GigabitEthernet0/0, directly connected table (directly connected
L 2001:DB8:CAFE:1::1/128 [0/0]
via GigabitEthernet0/0, receive interfaces, static routes,
D 2001:DB8:CAFE:2::/64 [90/3524096] and dynamically learned
via FE80::3, Serial0/0/1
D 2001:DB8:CAFE:3::/64 [90/2170112] routes).
via FE80::3, Serial0/0/1 ⚫ IPv6 is classless by
C 2001:DB8:CAFE:A001::/64 [0/0]
via Serial0/0/0, directly connected design, all routes are
L 2001:DB8:CAFE:A001::1/128 [0/0] effectively level 1 ultimate
via Serial0/0/0, receive
D 2001:DB8:CAFE:A002::/64 [90/3523840] routes.
via FE80::3, Serial0/0/1 There is no level 1
C 2001:DB8:CAFE:A003::/64 [0/0]
via Serial0/0/1, directly connected parent of level 2 child
L 2001:DB8:CAFE:A003::1/128 [0/0] routes.
via Serial0/0/1, receive
L FF00::/8 [0/0]
via Null0, receive
R1#
206
Reference IPv6 Topology
S0/0/0
:2
R2
S0/0/1
2001:DB8:CAFE:A001::/64
:1
2001:DB8:CAFE:A002::/64
64 kbps
S0/0/0 1024 kbps
S0/0/1
:1 :2
LLA: FE80::1 1544 kbps LLA: FE80::3
S0/0/1 S0/0/0
:1 :2 R3
R1 2001:DB8:CAFE:A003::/64
G0/0 G0/0
:1 :1
2001:DB8:CAFE:1::/64 2001:DB8:CAFE:3::/64
207
Directly Connected Networks of R1
R1# show ipv6 route
<Output omitted>
C 2001:DB8:CAFE:1::/64 [0/0]
via GigabitEthernet0/0, directly connected
L 2001:DB8:CAFE:1::1/128 [0/0]
via GigabitEthernet0/0, receive
D 2001:DB8:CAFE:2::/64 [90/3524096]
via FE80::3, Serial0/0/1
D 2001:DB8:CAFE:3::/64 [90/2170112]
via FE80::3, Serial0/0/1
C 2001:DB8:CAFE:A001::/64 [0/0]
via Serial0/0/0, directly connected
L 2001:DB8:CAFE:A001::1/128 [0/0]
via Serial0/0/0, receive
D 2001:DB8:CAFE:A002::/64 [90/3523840]
via FE80::3, Serial0/0/1
C 2001:DB8:CAFE:A003::/64 [0/0]
via Serial0/0/1, directly connected
L 2001:DB8:CAFE:A003::1/128 [0/0]
via Serial0/0/1, receive
L FF00::/8 [0/0]
via Null0, receive
R1#
208
Directly Connected Networks of R1
Destination Metric
Network
C 2001:DB8:CAFE:A001::/64 [0/0]
via Serial0/0/0, directly connected
Route Administrative
Source Outgoing Distance
Interface
209
Remote Network Entries on R1
R1# show ipv6 route
<Output omitted>
C 2001:DB8:CAFE:1::/64 [0/0]
via GigabitEthernet0/0, directly connected
L 2001:DB8:CAFE:1::1/128 [0/0]
via GigabitEthernet0/0, receive
D 2001:DB8:CAFE:2::/64 [90/3524096]
via FE80::3, Serial0/0/1
D 2001:DB8:CAFE:3::/64 [90/2170112]
via FE80::3, Serial0/0/1
C 2001:DB8:CAFE:A001::/64 [0/0]
via Serial0/0/0, directly connected
L 2001:DB8:CAFE:A001::1/128 [0/0]
via Serial0/0/0, receive
D 2001:DB8:CAFE:A002::/64 [90/3523840]
via FE80::3, Serial0/0/1
C 2001:DB8:CAFE:A003::/64 [0/0]
via Serial0/0/1, directly connected
L 2001:DB8:CAFE:A003::1/128 [0/0]
via Serial0/0/1, receive
L FF00::/8 [0/0]
via Null0, receive
R1#
210
Remote Networks of R1
Destination Metric
Network
D 2001:DB8:CAFE:3::/64 [90/2170112]
via FE80::3, Serial0/0/1
Route Administrative
Source Outgoing Interface Distance
Link-Local Interfae
211
Chapter 3: Summary
⚫ Dynamic routing protocols:
⚫ Used by routers to automatically learn about remote networks from
other routers
⚫ Purpose includes: discovery of remote networks, maintaining up-to-
date routing information, choosing the best path to destination
networks, and ability to find a new best path if the current path is no
longer available
⚫ Best choice for large networks but static routing is better for stub
networks.
⚫ Function to inform other routers about changes
⚫ Can be classified as either classful or classless, distance-vector or
link-state, and an interior or an exterior gateway protocol
212
Chapter 3: Summary (cont.)
⚫ Dynamic routing protocols:
⚫ A link-state routing protocol can create a complete view or topology
of the network by gathering information from all of the other routers
⚫ Metrics are used to determine the best path or shortest path to
reach a destination network
⚫ Different routing protocols may use different (hops, bandwidth,
delay, reliability, and load)
⚫ Show ip protocols command displays the IPv4 routing protocol
settings currently configured on the router, for IPv6, use show ipv6
protocols
213
Chapter 3: Summary (cont.)
214