Classful and Classless Routing
Protocols
CIS 185 Advanced Routing (CCNP 1)
Spring 2006
Rick Graziani
Resources
• Information for this presentation is
largely based on the following book:
• Routing TCP/IP, Volume 1, 2nd Edition
By Jeff Doyle, Jennifer DeHaven Carroll
ISBN: 1587052024
• Thank you to Jeff Doyle, Jennifer
Carroll, and Cisco Press for the use of
their graphics and other materials for
this presentation.
Rick Graziani graziani@[Link] 2
Resources
• For more in depth information and
especially for instructors, I highly
recommend the following book:
• Cisco IP Routing: Packet Forwarding &
Intra-domain Routing Protocols
by Alex Zinin
ISBN: 0201604736
• Thank you to Alex Zinin for the use of
his materials for this presentation.
Rick Graziani graziani@[Link] 3
Note to instructors
• This presentation is not solely based on information from
the Cisco Academy CCNP 1 curriculum.
• Much of the information for this presentation is from
Routing TCP/IP, Volume 1, 2nd Edition
By Jeff Doyle and Jennifer Carroll.
• Alex Zinin’s book, Cisco IP Routing, has also been very
helpful in creating this presentation.
• I feel the information in this book does a more adequate
job of discussing the objectives and outcomes necessary
for understanding the concepts, implementation, and
troubleshooting of routing protocols, whether it is for
university academics, certification, or professional
advancement.
Rick Graziani graziani@[Link] 4
Classful Routing Protocol
Sending Routing Updates
• Routing update includes only the:
– Network address
– Metric
• If the routing update is being sent out of an interface with a different
major network, then the update is summarized to the classful address.
Receiving Routing Updates
• If routing update belongs to the same major network as the interface it
is being received on, the subnet mask of the interface is applied to the
network in the routing update.
• If routing update belongs to a different major network than the interface
it is being received on, the classful subnet mask of the network is
applied to the network in the routing update.
Rick Graziani graziani@[Link] 5
How a Classful Routing Protocol Populates the Routing
Table (RIPv1) SanJose2
hostname SanJose2
Note: This lab includes important interface ethernet 0
information regarding classful routing ip add [Link] [Link]
protocols and boundary routers interface serial 0
ip add [Link] [Link]
router rip
network [Link]
SanJose1
hostname SanJose1
interface ethernet 0
ip add [Link] [Link]
interface serial 0
ip add [Link] [Link]
interface serial 1
ip add [Link] [Link]
router rip
network [Link]
network [Link]
Baypointe
hostname Baypointe
interface ethernet 0
ip add [Link] [Link]
interface serial 0
ip add [Link] [Link]
router rip
Rick Graziani graziani@[Link]
network [Link] 6
Viewing the debug ip rip output and the routing tables
SanJose2
SanJose2# debug ip rip
[Link] RIP: received v1 update from [Link] on Serial0
[Link] [Link] in 1 hops
[Link] [Link] in 1 hops
[Link] [Link] in 2 hops
SanJose2#
[Link] RIP: sending v1 update to [Link] via Ethernet0 ([Link])
[Link] subnet [Link], metric 1
[Link] subnet [Link], metric 2
[Link] network [Link], metric 2
[Link] network [Link], metric 3
[Link] RIP: sending v1 update to [Link] via Serial0 ([Link])
[Link] subnet [Link], metric 1
SanJose2#
[Link] RIP: received v1 update from [Link] on Serial0
[Link] [Link] in 1 hops
[Link] [Link] in 1 hops
[Link] [Link] in 2 hops
SanJose2# undebug all
SanJose2#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
<omitted>
Gateway of last resort is not set
[Link]/24 is subnetted, 3 subnets
C [Link] is directly connected, Serial0
R [Link] [120/1] via [Link], [Link], Serial0
C [Link] is directly connected, Ethernet0
R [Link]/24 [120/1] via [Link], [Link], Serial0
R [Link]/24 [120/2] via [Link], [Link], Serial0
Rick Graziani graziani@[Link] 7
How a Classful Routing Protocol Populates the
Routing Table (RIPv1)
• IMPORTANT INFORMATION: RIPv1 is a classful routing protocol. Classful routing
protocols do not send the subnet mask with network in routing updates, ie. [Link] is
sent by SanJose1 to SanJose2 without any subnet mask information.
• QUESTION: Notice that SanJose2 is receiving the subnet [Link] from SanJose1,
which is put in the routing table under the parent network (classful network) of [Link]
with the /24 subnet mask ([Link]/24 is subnetted, 3 subnets). Also notice that the
RIP message received from SanJose1 was “[Link] in 1 hops” but did not include a
subnet mask for the subnet. How does SanJose2 know that this subnet has a /24
([Link]) subnet mask?
• ANSWER: SanJose2 received this information on an interface belonging to the same
classful network as the incoming [Link] update. The IP address that SanJose1
received the “[Link] in 1 hops” message was on (Serial 0) with an IP address of
[Link] and a subnet mask of [Link]. SanJose2 uses its own subnet mask
and applies it to this and all other [Link] subnets it receives on this interface. The
[Link] network is placed with the other [Link] /24 subnets in the routing table.
• Routers running RIPv1 are limited to using the same subnet mask for all subnets with the
same classful network. Classless routing protocols like RIPv2 allow the same major
(classful) network to use different subnet masks on different subnets. This is known as
VLSM (Variable Length Subnet Masks) and is discussed in Cabrillo’s CCNA Sem 2
course and the CCNP Advanced Routing.
Rick Graziani graziani@[Link] 8
SanJose1
SanJose1#debug ip rip
RIP protocol debugging is on
SanJose1#
[Link] RIP: sending v1 update to [Link] via Ethernet0 ([Link])
[Link] subnet [Link], metric 1
[Link] subnet [Link], metric 2
[Link] network [Link], metric 1
[Link] network [Link], metric 2
[Link] RIP: sending v1 update to [Link] via Serial0 ([Link])
[Link] subnet [Link], metric 1
[Link] network [Link], metric 1
[Link] network [Link], metric 2
[Link] RIP: sending v1 update to [Link] via Serial1 ([Link])
[Link] network [Link], metric 1
SanJose1#
[Link] RIP: received v1 update from [Link] on Serial0
[Link] [Link] in 1 hops
SanJose1#
[Link] RIP: received v1 update from [Link] on Serial1
[Link] [Link] in 1 hops
SanJose1# undebug all
SanJose1#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
<omitted>
Gateway of last resort is not set
[Link]/24 is subnetted, 3 subnets
C [Link] is directly connected, Serial0
C [Link] is directly connected, Ethernet0
R [Link] [120/1] via [Link], [Link], Serial0
[Link]/30 is subnetted, 1 subnets
C [Link] is directly connected, Serial1
R [Link]/24 [120/1] via [Link], [Link], Serial1
Rick Graziani graziani@[Link] 9
How a Classful Routing Protocol Populates the
Routing Table (RIPv1)
Reflections
• The same subnet route information applies with routes sent from
SanJose2 to SanJose1 (see Reflections for SanJose2).
• SanJose1 knows that the [Link] update has a subnet mask of /24
because it received it on an interface with a /24 subnet mask (Serial 0,
[Link] [Link]).
Rick Graziani graziani@[Link] 10
SanJose1#debug ip rip
RIP protocol debugging is on
SanJose1#
[Link] RIP: sending v1 update to [Link] via Ethernet0 ([Link])
[Link] subnet [Link], metric 1
[Link] subnet [Link], metric 2
[Link] network [Link], metric 1
[Link] network [Link], metric 2
[Link] RIP: sending v1 update to [Link] via Serial0 ([Link])
[Link] subnet [Link], metric 1
[Link] network [Link], metric 1
[Link] network [Link], metric 2
[Link] RIP: sending v1 update to [Link] via Serial1 ([Link])
[Link] network [Link], metric 1
SanJose1#
[Link] RIP: received v1 update from [Link] on Serial0
[Link] [Link] in 1 hops
SanJose1#
[Link] RIP: received v1 update from [Link] on Serial1
[Link] [Link] in 1 hops
SanJose1# undebug all
SanJose1#show ip route
Codes: <omitted>
Gateway of last resort is not set
[Link]/24 is subnetted, 3 subnets
C [Link] is directly connected, Serial0
C [Link] is directly connected, Ethernet0
R [Link] [120/1] via [Link], [Link], Serial0
[Link]/30 is subnetted, 1 subnets
C [Link] is directly connected, Serial1
R [Link]/24 [120/1] via [Link], [Link], Serial1
Rick Graziani graziani@[Link] 11
How a Classful Routing Protocol Populates the
Routing Table (RIPv1)
More Reflections
• IMPORTANT INFORMATION: Notice the RIP update being sent out Serial 1:
RIP: sending v1 update to [Link] via Serial1 ([Link])
network [Link], metric 1
• Compare that to the same information for the [Link] network being sent out
Serial 0 & Ethernet 0:
RIP: sending v1 update to [Link] via Serial0 ([Link])
subnet [Link], metric 1
• Notice that the [Link] subnets are being summarized to their classful
network address of [Link] when sent out Serial 1 to Baypointe.
• RIP automatically summarizes RIP updates between classful networks.
Because the [Link] update is being sent out an interface (Serial 1) on a
different classful network ([Link]), RIP sends out only a single update for
the entire classful network instead of all of the different subnets. This is similar
to what we did with summarizing several static routes into a single static route.
• A router like SanJose1, which has an interface in more than one classful
network is sometimes called a “boundary router” in RIP. Boundary routers
automatically summarize RIP subnets from one classful network to the other.
Rick Graziani graziani@[Link] 12
How a Classful Routing Protocol Populates the
Routing Table (RIPv1)
More Reflections (continued)
• How is this an advantage? Fewer updates sent and received, resulting in less
bandwidth used for routing updates between SanJose1 and Baypointe. Just as
importantly, Baypointe will now only have a single route for the [Link]/16
network, no matter how many subnets there are or how it is subnetted. This will
result in faster lookup process in the routing table for Baypointe.
• What do you expect to see in Baypointe’s received RIP messages and its
routing table? That’s right, only a single [Link] network via SanJose1.
• Are there any disadvantages? Yes, discontinguous networks. We will see
this later, but the idea here is what if Baypointe had another connection via
Serial 1 to another router, SantaCruz1 on [Link]/30 subnet, which also
has other [Link]/24 subnets ([Link]/24, [Link]/24, etc.).
Baypointe would also receive the same [Link] network from SantaCruz1 as
well. Baypointe would not know how to reach the specific subnet, and
mistakenly load-balance the packets between the two routers. We will see an
example of this later this semester.
Rick Graziani graziani@[Link] 13
Baypointe
Baypointe#debug ip rip
RIP protocol debugging is on
Baypointe#
[Link] RIP: received v1 update from [Link] on Serial0
[Link] [Link] in 1 hops
Baypointe#
[Link] RIP: sending v1 update to [Link] via Ethernet0 ([Link])
[Link] network [Link], metric 2
[Link] network [Link], metric 1
[Link] RIP: sending v1 update to [Link] via Serial0 ([Link])
[Link] network [Link], metric 1
Baypointe#
Baypointe#undebug all
Baypointe#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
<omitted>
Gateway of last resort is not set
R [Link]/16 [120/1] via [Link], [Link], Serial0
[Link]/30 is subnetted, 1 subnets
C [Link] is directly connected, Serial0
C [Link]/24 is directly connected, Ethernet0
Rick Graziani graziani@[Link] 14
How a Classful Routing Protocol Populates the
Routing Table (RIPv1)
Reflections
• Notice that Baypointe is only receiving the classful summary of the [Link]
subnets:
RIP: received v1 update from [Link] on Serial0
[Link] in 1 hops
• SanJose1 automatically summarized the subnets into a single classful update.
• This keeps Baypointe’s routing table smaller, resulting in faster routing table
lookups.
• This also isolates any changes in the [Link] network on SanJose1 and
SanJose2 from affecting Baypointe. In other words, SanJose1 and SanJose2
can add and delete [Link]/24 subnets without affecting Baypointe’s routing
table, as Baypointe doesn’t care. Baypointe will send all packets destined for
the [Link]/16 network to SanJose1. Baypointe’s routing table:
R [Link]/16 [120/1] via [Link], [Link], Serial0
Also, the subnet mask scheme could be changed (i.e. to /27) on the [Link]
network without affecting Baypointe’s routing table or the RIP update sent to
Baypointe by SanJose1.
Rick Graziani graziani@[Link] 15
Classless Routing Protocol
Sending Routing Updates
• Routing update includes the:
– Network address
– Subnet mask
– Metric
Receiving Routing Updates
• Network address and subnet mask received and
processed for possible entry into the routing table.
Rick Graziani graziani@[Link] 16
RIPv2 Example
Scenario: [Link]/16
[Link]/16
Internet
• Discontiguous subnets static route to
[Link]/16
[Link]/16
etc.
• VLSM [Link]/8 [Link]/8
• CIDR .1
.1 e0
ISP
• Supernet to [Link]/8 .25 s0 s1 .21
With the default
auto-summary on [Link]/30
ISP, it will load [Link]/30
balance for all
packets destined for [Link]/28
[Link]/16 Lo2
.26 s0 s0 .22 `
[Link]/28
Lo1
Lo0
[Link]/24
.1 SantaCruz1 SantaCruz2 Lo0
.1
.1 e0 .1 e0 [Link]/24
[Link]/24 [Link]/24
Rick Graziani graziani@[Link]
SantaCruz1 RIPv2 Example
router rip
network [Link] [Link]/16
[Link]/16
network [Link] Internet [Link]/16
static route to [Link]/16
version 2 etc.
[Link]/8 [Link]/8
no auto-summary
.1 e0
.1
SantaCruz2 ISP
.25 s0 s1 .21
router rip
network [Link]
network [Link] [Link]/30
version 2 [Link]/30
no auto-summary
[Link]/28
Lo2
ISP .26 s0 s0 .22 `
[Link]/28
Lo1
Lo0
router rip .1 SantaCruz1 SantaCruz2 Lo0
[Link]/24 .1
redistribute static .1 e0 .1 e0 [Link]/24
network [Link]
[Link]/24 [Link]/24
network [Link]
version 2
no auto-summary
ip route [Link] [Link] null0
Rick Graziani graziani@[Link]
SantaCruz2#show ip route
Examining a Routing Table
[Link]/16 is variably subnetted, 6 subnets, 2 masks
C [Link]/28 is directly connected, Loopback2
C [Link]/28 is directly connected, Loopback1
R [Link]/24 [120/2] via [Link], [Link], Serial0
R [Link]/24 [120/2] via [Link], [Link], Serial0
C [Link]/24 is directly connected, Ethernet0
C [Link]/24 is directly connected, Loopback0
[Link]/30 is subnetted, 2 subnets
R [Link] [120/1] via [Link], [Link], Serial0
[Link]/16
C [Link] is directly connected, Serial0 [Link]/16
Internet [Link]/16
R [Link]/8 [120/1] via [Link], [Link], Serial0 [Link]/16
static route to
etc.
R [Link]/8 [120/1] via [Link], [Link], [Link]/8
Serial0 [Link]/8
.1 e0
.1
ISP
.25 s0 s1 .21
Supernet, classless routing protcols
will route supernets (CIDR)
[Link]/30
[Link]/30
[Link]/28
Lo2
.26 s0 s0 .22 `
[Link]/28
Lo1
Lo0
.1 SantaCruz1 SantaCruz2 Lo0
[Link]/24 .1
.1 e0 .1 e0 [Link]/24
[Link]/24 [Link]/24
Rick Graziani graziani@[Link]
RIPv2: Sending and Receiving Updates
ISP(config)# line console 0
ISP(config-line)# logging synchronous
ISP#debug ip rip
RIP protocol debugging is on
ISP#[Link] RIP: received v2 update from [Link] on Serial1
[Link] [Link]/24 -> [Link] in 1 hops
[Link] [Link]/24 -> [Link] in 1 hops
ISP# Includes mask
[Link] RIP: received v2 update from [Link] on Serial0
[Link] [Link]/24 -> [Link] in 1 hops
[Link] [Link]/24 -> [Link] in 1 hops multicast
ISP#
[Link] RIP: sending v2 update to [Link] via Ethernet0 ([Link])
[Link] [Link]/24 -> [Link], metric 2, tag 0
[Link] [Link]/24 -> [Link], metric 2, tag 0
[Link] [Link]/24 -> [Link], metric 2, tag 0
[Link] [Link]/24 -> [Link], metric 2, tag 0
[Link] [Link]/30 -> [Link], metric 1, tag 0
[Link] [Link]/30 -> [Link], metric 1, tag 0
<text omitted>
Rick Graziani graziani@[Link]
Adding a default Routes to RIPv2
[Link]/16
ISP [Link]/16
Internet [Link]/16
router rip static route to [Link]/16
etc.
[Link]/8 [Link]/8
redistribute static
.1 e0
network [Link] .1
ISP
network [Link] .25 s0 s1 .21
version 2
no auto-summary [Link]/30
[Link]/30
default-information originate
[Link]/28
Lo2
[Link]/28
ip route [Link] [Link] null0 .26 s0 s0 .22 Lo1 `
Lo0
.1 SantaCruz1 SantaCruz2 Lo0
ip route [Link] [Link] [Link] [Link]/24 .1
[Link]/24
.1 e0 .1 e0
etherenet0
[Link]/24 [Link]/24
Rick Graziani graziani@[Link]
Classful and Classless Routing
Protocols
CIS 185 Advanced Routing (CCNP 1)
Spring 2006
Rick Graziani