Download as pdf or txt
Download as pdf or txt
You are on page 1of 27

Presentation_ID © 2002, Cisco Systems, Inc. All rights reserved.

1
Introduction to Classless
Routing Concepts and RIPv2
(Extra: The Routing Table)
Rick Graziani
graziani@cabrillo.edu
http://www.cabrillo.cc.ca.us/~rgraziani

Session Number
Updated:2/18/03
Presentation_ID © 2002, Cisco Systems, Inc. All rights reserved. 2
Note to Instructors
This presentation will introduce you to the following:
• Classless Routing Protocols
• RIPv2
• The Routing Table
– The route lookup process
– Classful versus Classless routing behavior

• Please email any questions or issues you might find in this


presentation to Rick Graziani at graziani@cabrillo.edu

Presentation_ID © 2002, Cisco Systems, Inc. All rights reserved. 3


Classless Routing Protocols
“The true characteristic of a classless routing protocol is the ability to
carry subnet masks in their route advertisements.” Jeff Doyle, Routing
TCP/IP

Benefits:
• All-zeros and all-ones subnets
- Although some vendors, like Cisco, can also handle this with classful
routing protocols.
• VLSM
– Can have discontiguous subnets
– Better IP addressing allocation
• CIDR
– More control over route summarization

Presentation_ID © 2002, Cisco Systems, Inc. All rights reserved. 4


Classless Routing Protocols
Classless Routing Protocols:
• RIPv2
• EIGRP
• OSPF
• IS-IS
• BGPv4

Presentation_ID © 2002, Cisco Systems, Inc. All rights reserved. 5


Few RIP facts
• RIP still working on routers and hosts The Grim Router
today.
• IP RIP derived from RIP by Xerox for
its XNS protocol stack.
• Initially implemented in Berkeley UNIX
routed program.
• RIPv1 – Charles Hedrick, RFC 1058,
1988
• RIPv2 – Gary Malkin, RFC 1723, 1994
• RIPng for IPv6 – Gary Malkin, RFC
2080, 1997 (proposed standard),
extension to RIPv2 message format.

Presentation_ID © 2002, Cisco Systems, Inc. All rights reserved. 6


RIP version 1
• Classful Routing Protocol, sent over UDP port 520
• Does not include the subnet mask in the routing updates.
• Automatic summarization done at major network boundaries.
• Updates sent as broadcasts unless the neighbor command is uses
which sends them as unicasts.
0 1 2 3 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| command (1) | version (1) | must be zero (2) |
+---------------+---------------+-------------------------------+
| address family identifier (2) | must be zero (2) |
+-------------------------------+-------------------------------+
| IP address (4) |
+---------------------------------------------------------------+
| must be zero (4) |
+---------------------------------------------------------------+
| must be zero (4) |
+---------------------------------------------------------------+
| metric (4) |
Presentation_ID+---------------------------------------------------------------+
© 2002, Cisco Systems, Inc. All rights reserved. 7
RIP version 2
• Classless Routing Protocol, sent over UDP port 520
• Includes the subnet mask in the routing updates.
• Automatic summarization at major network boundaries can be disabled.
• Updates sent as multicasts unless the neighbor command is uses which
sends them as unicasts.
0 1 2 3 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| command (1) | version (1) | must be zero (2) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Address Family Identifier (2) | Route Tag (2) |
+-------------------------------+-------------------------------+
| IP Address (4) |
+---------------------------------------------------------------+
| Subnet Mask (4) |
+---------------------------------------------------------------+
| Next Hop (4) |
+---------------------------------------------------------------+
| Metric (4) |
+---------------------------------------------------------------+
Presentation_ID © 2002, Cisco Systems, Inc. All rights reserved. 8
Configuring RIPv2
RIP defaults to RIPv1. To modify RIP to use version 2:

Router(config)# router rip


Router(config-router)# version 2

To go back to RIP version 1:

Router(config)# router rip


Router(config-router)# version 1

To turn off automatic summarization at major network boundaries:

Router(config-router)# no auto-summary

Presentation_ID © 2002, Cisco Systems, Inc. All rights reserved. 9


Default Routes and RIPv2
Configuring a default route using a “quad-zero” static route:

Router(config)# ip route 0.0.0.0 0.0.0.0 serial0


Router(config)# router rip
Router(config-router)# default-information originate
• Required starting with IOS 12.1 (always sends?)

Configuring a default route using the ip default-network command:

Router(config)# ip route 0.0.0.0 0.0.0.0 serial0


or route to the specific network

Router(config)# router rip


Router(config-router)# ip default-network 192.168.1.0
Router(config-router)# network 192.168.1.0
Presentation_ID © 2002, Cisco Systems, Inc. All rights reserved. 10
RIPv2 Example
Scenario: 207.0.0.0/16
207.1.0.0/16
Internet 207.2.0.0/16
• Discontiguous subnets static route to 207.3.0.0/16
etc.
207.0.0.0/8
• VLSM 10.0.0.0/8
.1 e0
• CIDR .1
ISP
.25 s0 s1 .21

With
autosummarization 192.168.4.24/30
192.168.4.20/30
ISP will load
balance for all
172.30.200.32/28
packets destined
Lo2
for 172.30.0.0/16 .26 s0 s0 .22 `
172.30.200.16/28
Lo1
Lo0
172.30.2.0/24
.1 SantaCruz1 SantaCruz2 Lo0
.1
.1 e0 .1 e0 172.30.110.0/24

172.30.1.0/24 172.30.100.0/24
Presentation_ID © 2002, Cisco Systems, Inc. All rights reserved. 11
SantaCruz1
RIPv2 Example
router rip
network 172.30.0.0 207.0.0.0/16
207.1.0.0/16
network 192.168.4.0 Internet 207.2.0.0/16
version 2 static route to 207.3.0.0/16
etc.
no auto-summary 10.0.0.0/8 207.0.0.0/8

.1 e0
.1
SantaCruz2
ISP
router rip .25 s0 s1 .21
network 172.30.0.0
network 192.168.4.0
version 2 192.168.4.24/30
192.168.4.20/30
no auto-summary
172.30.200.32/28
ISP Lo2
.26 s0 s0 .22 `
172.30.200.16/28
router rip Lo0
Lo1

redistribute static 172.30.2.0/24


.1 SantaCruz1 SantaCruz2 Lo0
.1
.1 e0 .1 e0 172.30.110.0/24
network 10.0.0.0
network 192.168.4.0 172.30.1.0/24 172.30.100.0/24
version 2
no auto-summary

ip route 207.0.0.0 255.0.0.0 null0

Presentation_ID © 2002, Cisco Systems, Inc. All rights reserved. 12


SantaCruz2#show ip route
Examining a Routing Table
172.30.0.0/16 is variably subnetted, 6 subnets, 2 masks
C 172.30.200.32/28 is directly connected, Loopback2
C 172.30.200.16/28 is directly connected, Loopback1
R 172.30.2.0/24 [120/2] via 192.168.4.21, 00:00:21, Serial0
R 172.30.1.0/24 [120/2] via 192.168.4.21, 00:00:21, Serial0
C 172.30.100.0/24 is directly connected, Ethernet0
C 172.30.110.0/24 is directly connected, Loopback0
192.168.4.0/30 is subnetted, 2 subnets
R 192.168.4.24 [120/1] via 192.168.4.21, 00:00:21, Serial0 207.0.0.0/16
207.1.0.0/16
C 192.168.4.20 is directly connected, Serial0 Internet 207.2.0.0/16
static route to 207.3.0.0/16
R 10.0.0.0/8 [120/1] via 192.168.4.21, 00:00:21, Serial0 etc.
10.0.0.0/8 207.0.0.0/8
R 207.0.0.0/8 [120/1] via 192.168.4.21, 00:00:21, Serial0
.1 e0
.1
ISP
.25 s0 s1 .21
Supernet, classless routing protcols
will route supernets (CIDR)
192.168.4.24/30
192.168.4.20/30

172.30.200.32/28
Lo2
.26 s0 s0 .22 `
172.30.200.16/28
Lo1
Lo0
.1 SantaCruz1 SantaCruz2 Lo0
172.30.2.0/24 .1
.1 e0 .1 e0 172.30.110.0/24

172.30.1.0/24 172.30.100.0/24
Presentation_ID © 2002, Cisco Systems, Inc. All rights reserved. 13
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#01:23:34: RIP: received v2 update from 192.168.4.22 on Serial1
01:23:34: 172.30.100.0/24 -> 0.0.0.0 in 1 hops
01:23:34: 172.30.110.0/24 -> 0.0.0.0 in 1 hops
ISP# Includes mask
01:23:38: RIP: received v2 update from 192.168.4.26 on Serial0
01:23:38: 172.30.2.0/24 -> 0.0.0.0 in 1 hops
01:23:38: 172.30.1.0/24 -> 0.0.0.0 in 1 hops multicast
ISP#
01:24:31: RIP: sending v2 update to 224.0.0.9 via Ethernet0 (10.0.0.1)
01:24:31: 172.30.2.0/24 -> 0.0.0.0, metric 2, tag 0
01:24:31: 172.30.1.0/24 -> 0.0.0.0, metric 2, tag 0
01:24:31: 172.30.100.0/24 -> 0.0.0.0, metric 2, tag 0
01:24:31: 172.30.110.0/24 -> 0.0.0.0, metric 2, tag 0
01:24:31: 192.168.4.24/30 -> 0.0.0.0, metric 1, tag 0
01:24:31: 192.168.4.20/30 -> 0.0.0.0, metric 1, tag 0
<text omitted>

Presentation_ID © 2002, Cisco Systems, Inc. All rights reserved. 14


Extra: Other RIPv2 Commands
Router(config-router)# neighbor ip-address
Defines a neighboring router with which to exchange unicast routing information.
(RIPv1 or RIPv2)

Router(config-if)# ip rip send|receive version 1 | 2 | 1 2


Configures an interface to send/receive RIP Version 1 and/or Version 2 packets

Router(config-if)# ip summary-address rip ip_address


ip_network_mask
Specifies the IP address and network mask that identify the routes to be
summarized.

Authentication and other nice configuration commands and examples:


http://www.cisco.com/en/US/products/sw/iosswrel/ps1831/products_configuration
_guide_chapter09186a00800d97f7.html

Presentation_ID © 2002, Cisco Systems, Inc. All rights reserved. 15


EXTRA:
The Routing Table
The Lookup Processes, Classless and
Classful Routing Behaviors
Rick Graziani
graziani@cabrillo.edu

Session Number
Presentation_ID © 2002, Cisco Systems, Inc. All rights reserved. 16
The IP Routing Table
• This information is included as two PDF documents.
• Can also be downloaded from my web site:
The Routing Table: Part 1 or 2 - The Routing Table Structure (PDF)
The Routing Table: Part 2 or 2 - The Routing Table Lookup Process
(PDF)

Presentation_ID © 2002, Cisco Systems, Inc. All rights reserved. 17


Parent and Child Routes
RouterB#show ip route

172.16.0.0/24 is subnetted, 3 subnets


R 172.16.1.0 [120/1] via 172.16.2.1, 00:00:20, Serial0
C 172.16.2.0 is directly connected, Serial0
C 172.16.3.0 is directly connected, FastEthernet0
C 192.168.1.0/24 is directly connected, Serial1
S 172.0.0.0/8 is directly connected, Serial1
S 160.0.0.0/4 is directly connected, Serial1
S* 0.0.0.0/0 is directly connected, Serial1

Parent Route
• Created automatically whenever there is a route with a mask greater
than the classful mask.
• For non-VLSM routes, contains the mask of the child routes.
Child Routes
• Routes with masks greater than the default classful mask.

Presentation_ID © 2002, Cisco Systems, Inc. All rights reserved. 18


Lookup what?
RouterB#show ip route

172.16.0.0/24 is subnetted, 3 subnets


R 172.16.1.0 [120/1] via 172.16.2.1, 00:00:20, Serial0
C 172.16.2.0 is directly connected, Serial0
C 172.16.3.0 is directly connected, FastEthernet0
C 192.168.1.0/24 is directly connected, Serial1
S 172.0.0.0/8 is directly connected, Serial1
S 160.0.0.0/4 is directly connected, Serial1
S* 0.0.0.0/0 is directly connected, Serial1

Routing Table process matches:


• The routing table process compares the left-most bits in the packet’s
destination IP address with the left-most bits in the route in the routing table,
looking for a longest-bit-match.
• The subnet mask of the route in the routing table specifies the minimum
number of left-most bits that must match.
• Before checking child routes, the classful mask of the parent route is used.
• For child routes the parent route’s mask is used.
• For VLSM routes, the mask is contained with the child route.
Presentation_ID © 2002, Cisco Systems, Inc. All rights reserved. 19
Parent and Child Routes
RouterB#show ip route

172.16.0.0/24 is subnetted, 3 subnets


R 172.16.1.0 [120/1] via 172.16.2.1, 00:00:20, Serial0
C 172.16.2.0 is directly connected, Serial0
C 172.16.3.0 is directly connected, FastEthernet0
C 192.168.1.0/24 is directly connected, Serial1
S 172.0.0.0/8 is directly connected, Serial1
S 160.0.0.0/4 is directly connected, Serial1
S* 0.0.0.0/0 is directly connected, Serial1

DA = 192.168.1.10
• 16 bits of 172.16.0.0 do not match, so child routes are not checked.
• 24 bits of 192.168.1.0/24 do match, so this route is used.
DA = 172.16.2.1
• 16 bits of 172.16.0.0 do match, so child routes are checked.
• 24 bits of 172.16.1.0 do not match, so continue to next child route.
• 24 bits of 172.16.2.0 do match, so this route is used!
Presentation_ID © 2002, Cisco Systems, Inc. All rights reserved. 20
Parent and Child Routes
RouterB#show ip route

172.16.0.0/24 is subnetted, 3 subnets


R 172.16.1.0 [120/1] via 172.16.2.1, 00:00:20, Serial0
C 172.16.2.0 is directly connected, Serial0
C 172.16.3.0 is directly connected, FastEthernet0
C 192.168.1.0/24 is directly connected, Serial1
S 172.0.0.0/8 is directly connected, Serial1
S 160.0.0.0/4 is directly connected, Serial1
S* 0.0.0.0/0 is directly connected, Serial1

DA = 32.1.1.10
• 16 bits of 172.16.0.0 do not match, so child routes are not checked.
• 24 bits of 192.168.1.0/24 do not match, so this route is not used.
• 8 bits of 172.0.0.0/8 do not match, so this route is not used.
• 4 bits of 160.0.0.0/4 do not match, so this route is not used.
• 0 bits of 0.0.0.0/0 does match, so this route is used!

Presentation_ID © 2002, Cisco Systems, Inc. All rights reserved. 21


Parent and Child Routes
RouterB#show ip route

172.16.0.0/24 is subnetted, 3 subnets


R 172.16.1.0 [120/1] via 172.16.2.1, 00:00:20, Serial0
C 172.16.2.0 is directly connected, Serial0
C 172.16.3.0 is directly connected, FastEthernet0
C 192.168.1.0/24 is directly connected, Serial1
S 172.0.0.0/8 is directly connected, Serial1
S 160.0.0.0/4 is directly connected, Serial1
S* 0.0.0.0/0 is directly connected, Serial1

DA = 172.16.4.1
• 16 bits of 172.16.0.0 do match, so child routes are checked.
• 24 bits of 172.16.1.0 do not match, so continue to next child route.
• 24 bits of 172.16.2.0 do not match, so continue to next child route.
• 24 bits of 172.16.3.0 do not match, no more child routes.
Now what??? It depends!

Presentation_ID © 2002, Cisco Systems, Inc. All rights reserved. 22


Classful Routing Behavior
RouterB#show ip route

172.16.0.0/24 is subnetted, 3 subnets


R 172.16.1.0 [120/1] via 172.16.2.1, 00:00:20, Serial0
C 172.16.2.0 is directly connected, Serial0
C 172.16.3.0 is directly connected, FastEthernet0
C 192.168.1.0/24 is directly connected, Serial1
S 172.0.0.0/8 is directly connected, Serial1
S 160.0.0.0/4 is directly connected, Serial1
S* 0.0.0.0/0 is directly connected, Serial1

DA = 172.16.4.1
Router(config)# no ip classless
• With classful routing behavior, if the child routes are checked but
there are no matches, the routing lookup process ends and the Packet
is dropped. (The packets get in, but they can’t get out!)
• Supernet and default routes are not checked.
• Default with IOS 11.2 and prior
Presentation_ID © 2002, Cisco Systems, Inc. All rights reserved. 23
Classless Routing Behavior
RouterB#show ip route

172.16.0.0/24 is subnetted, 3 subnets


R 172.16.1.0 [120/1] via 172.16.2.1, 00:00:20, Serial0
C 172.16.2.0 is directly connected, Serial0
C 172.16.3.0 is directly connected, FastEthernet0
C 192.168.1.0/24 is directly connected, Serial1
S 172.0.0.0/8 is directly connected, Serial1
S 160.0.0.0/4 is directly connected, Serial1
S* 0.0.0.0/0 is directly connected, Serial1

DA = 172.16.4.1
Router(config)# ip classless
• With classless routing behavior, if the child routes are checked but
there are no matches, the routing lookup process continues with other
routes in the routing table, including supernet and default routes.
• 8 bits of 172.0.0.0/8 do match, so this route is used!
• Default with IOS 11.3 and later
Presentation_ID © 2002, Cisco Systems, Inc. All rights reserved. 24
VLSM and Routing Tables
RouterX#show ip route

172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks


C 172.16.1.4/30 is directly connected, Serial0
C 172.16.1.8/30 is directly connected, Serial1
C 172.16.3.0/24 is directly connected, FastEthernet0
RouterX#

Parent Route
• Created automatically whenever there is a route with a mask greater
than the classful mask.
• For VLSM routes, the mask is the default classful mask.
Child Routes
• Routes with masks greater than the default classful mask.
• For VLSM routes, each child route has its own mask.

Presentation_ID © 2002, Cisco Systems, Inc. All rights reserved. 25


Classful and Classless:
Routing Behavior versus Routing Protocol
Notes:
• Classful or classless routing behavior has nothing to do
with classful or classless routing protocols.
• Classful/Classless routing protocols are only concerned
about how the routes get into the table.
• Classful/Classless routing behavior has to do with the
lookup process within the routing table AFTER the routes
have entered the routing table.

Presentation_ID © 2002, Cisco Systems, Inc. All rights reserved. 26


Presentation_ID © 2002, Cisco Systems, Inc. All rights reserved. 27

You might also like