introduction to classless routing concepts and ripv2
TRANSCRIPT
111© 2002, Cisco Systems, Inc. All rights reserved.Presentation_ID
2© 2002, Cisco Systems, Inc. All rights reserved.
Session NumberPresentation_ID
Introduction to Classless Routing Concepts and RIPv2
(Extra: The Routing Table)Rick Graziani
http://www.cabrillo.cc.ca.us/~rgraziani
Updated:2/18/03
333© 2002, Cisco Systems, Inc. All rights reserved.Presentation_ID
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 [email protected]
444© 2002, Cisco Systems, Inc. All rights reserved.Presentation_ID
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
555© 2002, Cisco Systems, Inc. All rights reserved.Presentation_ID
Classless Routing Protocols
Classless Routing Protocols:
• RIPv2
• EIGRP
• OSPF
• IS-IS
• BGPv4
666© 2002, Cisco Systems, Inc. All rights reserved.Presentation_ID
Few RIP facts
• RIP still working on routers and hosts 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.
The Grim Router
777© 2002, Cisco Systems, Inc. All rights reserved.Presentation_ID
RIP version 1
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) | +---------------------------------------------------------------+
• 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.
888© 2002, Cisco Systems, Inc. All rights reserved.Presentation_ID
RIP version 2
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) | +---------------------------------------------------------------+
• 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.
999© 2002, Cisco Systems, Inc. All rights reserved.Presentation_ID
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
101010© 2002, Cisco Systems, Inc. All rights reserved.Presentation_ID
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
111111© 2002, Cisco Systems, Inc. All rights reserved.Presentation_ID
RIPv2 Example
Scenario:
• Discontiguous subnets
• VLSM
• CIDR
e0
ISP
SantaCruz2SantaCruz1
192.168.4.20/30
172.30.1.0/24
Internet
s0
s0 s0
s1
172.30.100.0/24
e0
192.168.4.24/30
.21
.22
.25
.26
10.0.0.0/8
e0.1
.1.1
Lo0Lo0
172.30.110.0/24172.30.2.0/24 .1
.1
.1
static route to207.0.0.0/8
207.0.0.0/16207.1.0.0/16207.2.0.0/16207.3.0.0/16
etc.
` 172.30.200.16/28
172.30.200.32/28
Lo1
Lo2
With autosummarization ISP will load balance for all packets destined for 172.30.0.0/16
121212© 2002, Cisco Systems, Inc. All rights reserved.Presentation_ID
RIPv2 ExampleSantaCruz1router rip network 172.30.0.0 network 192.168.4.0 version 2 no auto-summary SantaCruz2router rip network 172.30.0.0 network 192.168.4.0 version 2 no auto-summary ISProuter rip redistribute static network 10.0.0.0 network 192.168.4.0 version 2 no auto-summary
ip route 207.0.0.0 255.0.0.0 null0
e0
ISP
SantaCruz2SantaCruz1
192.168.4.20/30
172.30.1.0/24
Internet
s0
s0 s0
s1
172.30.100.0/24
e0
192.168.4.24/30
.21
.22
.25
.26
10.0.0.0/8
e0.1
.1.1
Lo0Lo0
172.30.110.0/24172.30.2.0/24 .1
.1
.1
static route to207.0.0.0/8
207.0.0.0/16207.1.0.0/16207.2.0.0/16207.3.0.0/16
etc.
` 172.30.200.16/28
172.30.200.32/28
Lo1
Lo2
131313© 2002, Cisco Systems, Inc. All rights reserved.Presentation_ID
e0
ISP
SantaCruz2SantaCruz1
192.168.4.20/30
172.30.1.0/24
Internet
s0
s0 s0
s1
172.30.100.0/24
e0
192.168.4.24/30
.21
.22
.25
.26
10.0.0.0/8
e0.1
.1.1
Lo0Lo0
172.30.110.0/24172.30.2.0/24 .1
.1
.1
static route to207.0.0.0/8
207.0.0.0/16207.1.0.0/16207.2.0.0/16207.3.0.0/16
etc.
` 172.30.200.16/28
172.30.200.32/28
Lo1
Lo2
SantaCruz2#show ip route
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
C 192.168.4.20 is directly connected, Serial0
R 10.0.0.0/8 [120/1] via 192.168.4.21, 00:00:21, Serial0
R 207.0.0.0/8 [120/1] via 192.168.4.21, 00:00:21, Serial0
Examining a Routing Table
Supernet, classless routing protcols will route supernets (CIDR)
141414© 2002, Cisco Systems, Inc. All rights reserved.Presentation_ID
RIPv2: Sending and Receiving Updates
ISP#debug ip ripRIP protocol debugging is onISP#01:23:34: RIP: received v2 update from 192.168.4.22 on Serial101:23:34: 172.30.100.0/24 -> 0.0.0.0 in 1 hops01:23:34: 172.30.110.0/24 -> 0.0.0.0 in 1 hopsISP#01:23:38: RIP: received v2 update from 192.168.4.26 on Serial001:23:38: 172.30.2.0/24 -> 0.0.0.0 in 1 hops01:23:38: 172.30.1.0/24 -> 0.0.0.0 in 1 hopsISP#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 001:24:31: 172.30.1.0/24 -> 0.0.0.0, metric 2, tag 001:24:31: 172.30.100.0/24 -> 0.0.0.0, metric 2, tag 001:24:31: 172.30.110.0/24 -> 0.0.0.0, metric 2, tag 001:24:31: 192.168.4.24/30 -> 0.0.0.0, metric 1, tag 001:24:31: 192.168.4.20/30 -> 0.0.0.0, metric 1, tag 0<text omitted>
ISP(config)# line console 0
ISP(config-line)# logging synchronous
multicast
Includes mask
151515© 2002, Cisco Systems, Inc. All rights reserved.Presentation_ID
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
16© 2002, Cisco Systems, Inc. All rights reserved.
Session NumberPresentation_ID
EXTRA:The Routing Table
The Lookup Processes, Classless and Classful Routing Behaviors
Rick Graziani
171717© 2002, Cisco Systems, Inc. All rights reserved.Presentation_ID
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)
181818© 2002, Cisco Systems, Inc. All rights reserved.Presentation_ID
Parent and Child Routes
RouterB#show ip route
172.16.0.0/24 is subnetted, 3 subnetsR 172.16.1.0 [120/1] via 172.16.2.1, 00:00:20, Serial0C 172.16.2.0 is directly connected, Serial0C 172.16.3.0 is directly connected, FastEthernet0C 192.168.1.0/24 is directly connected, Serial1S 172.0.0.0/8 is directly connected, Serial1S 160.0.0.0/4 is directly connected, Serial1S* 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.
191919© 2002, Cisco Systems, Inc. All rights reserved.Presentation_ID
Lookup what?
RouterB#show ip route
172.16.0.0/24 is subnetted, 3 subnetsR 172.16.1.0 [120/1] via 172.16.2.1, 00:00:20, Serial0C 172.16.2.0 is directly connected, Serial0C 172.16.3.0 is directly connected, FastEthernet0C 192.168.1.0/24 is directly connected, Serial1S 172.0.0.0/8 is directly connected, Serial1S 160.0.0.0/4 is directly connected, Serial1S* 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.
202020© 2002, Cisco Systems, Inc. All rights reserved.Presentation_ID
Parent and Child Routes
RouterB#show ip route
172.16.0.0/24 is subnetted, 3 subnetsR 172.16.1.0 [120/1] via 172.16.2.1, 00:00:20, Serial0C 172.16.2.0 is directly connected, Serial0C 172.16.3.0 is directly connected, FastEthernet0C 192.168.1.0/24 is directly connected, Serial1S 172.0.0.0/8 is directly connected, Serial1S 160.0.0.0/4 is directly connected, Serial1S* 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!
212121© 2002, Cisco Systems, Inc. All rights reserved.Presentation_ID
Parent and Child Routes
RouterB#show ip route
172.16.0.0/24 is subnetted, 3 subnetsR 172.16.1.0 [120/1] via 172.16.2.1, 00:00:20, Serial0C 172.16.2.0 is directly connected, Serial0C 172.16.3.0 is directly connected, FastEthernet0C 192.168.1.0/24 is directly connected, Serial1S 172.0.0.0/8 is directly connected, Serial1S 160.0.0.0/4 is directly connected, Serial1S* 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!
222222© 2002, Cisco Systems, Inc. All rights reserved.Presentation_ID
Parent and Child Routes
RouterB#show ip route
172.16.0.0/24 is subnetted, 3 subnetsR 172.16.1.0 [120/1] via 172.16.2.1, 00:00:20, Serial0C 172.16.2.0 is directly connected, Serial0C 172.16.3.0 is directly connected, FastEthernet0C 192.168.1.0/24 is directly connected, Serial1S 172.0.0.0/8 is directly connected, Serial1S 160.0.0.0/4 is directly connected, Serial1S* 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!
232323© 2002, Cisco Systems, Inc. All rights reserved.Presentation_ID
Classful Routing Behavior
RouterB#show ip route
172.16.0.0/24 is subnetted, 3 subnetsR 172.16.1.0 [120/1] via 172.16.2.1, 00:00:20, Serial0C 172.16.2.0 is directly connected, Serial0C 172.16.3.0 is directly connected, FastEthernet0C 192.168.1.0/24 is directly connected, Serial1S 172.0.0.0/8 is directly connected, Serial1S 160.0.0.0/4 is directly connected, Serial1S* 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
242424© 2002, Cisco Systems, Inc. All rights reserved.Presentation_ID
Classless Routing Behavior
RouterB#show ip route
172.16.0.0/24 is subnetted, 3 subnetsR 172.16.1.0 [120/1] via 172.16.2.1, 00:00:20, Serial0C 172.16.2.0 is directly connected, Serial0C 172.16.3.0 is directly connected, FastEthernet0C 192.168.1.0/24 is directly connected, Serial1S 172.0.0.0/8 is directly connected, Serial1S 160.0.0.0/4 is directly connected, Serial1S* 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
252525© 2002, Cisco Systems, Inc. All rights reserved.Presentation_ID
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.
262626© 2002, Cisco Systems, Inc. All rights reserved.Presentation_ID
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.
272727© 2002, Cisco Systems, Inc. All rights reserved.Presentation_ID