distance vector routing - rip

122
Ch. 7 – Distance Vector Routing Protocols Part 1 of 2: Distance Vector Routing and RIP Rick Graziani Cabrillo College

Upload: networkingcentral

Post on 08-May-2015

2.718 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Distance Vector Routing - RIP

Ch. 7 – Distance Vector Routing ProtocolsPart 1 of 2: Distance Vector Routing and

RIP

Rick Graziani

Cabrillo College

Page 2: Distance Vector Routing - RIP

Rick Graziani [email protected] 2

Overview

• Describe how routing loops can occur in distance vector routing • Describe several methods used by distance vector routing protocols to

ensure that routing information is accurate • Configure RIP • Use the ip classless command • Troubleshoot RIP • Configure RIP for load balancing • Configure static routes for RIP • Verify RIP

Page 3: Distance Vector Routing - RIP

Rick Graziani [email protected] 3

Distance Vector Routing Updates

• Routing table updates occur periodically or when the topology in a distance vector protocol network changes.

• Topology change updates proceed systematically from router to router.

• Distance vector algorithms call for each router to send its entire routing table to each of its adjacent neighbors.

• The routing tables include information about the total path cost. This path cost is defined by the metric.

Page 4: Distance Vector Routing - RIP

Rick Graziani [email protected] 4

Distance Vector Routing Metrics

• RIP – Hop Count• IGRP and EIGRP – Bandwidth, Delay, Reliability, Load• Cisco’s OSPF – Bandwidth• IS-IS – Cost• BGP – Number of AS or policy

No! MTU is never used as a routing metric. Some documentation is incorrect on this item.

Page 5: Distance Vector Routing - RIP

Rick Graziani [email protected] 5

Triggered Updates

• Triggered updates are sent whenever a router sees a topology change or a change in routing information (from another router).

• The router does not have to wait for the period timer, but can send them immediately.

• Triggered updates do not need to include the entire routing table but only the modified route(s).

• Triggered updates must still be sent to adjacent routers, from router to router, like other routing updates.

Page 6: Distance Vector Routing - RIP

Rick Graziani [email protected] 6

Triggered Updates

• Most distance-vector routing protocols limit the frequency of triggered updates so that a flapping link does not put an unnecessary load on the network.

• Typically, triggered updates can be “triggered” by:– Interface transition to the up or down state– A route has entered or exited an unreachable (down)

state – A new route is installed in the routing table

Page 7: Distance Vector Routing - RIP

Rick Graziani [email protected] 7

Routing Loop Issues

• Distance vector routing protocols are simple in their implementation and configuration, but this comes at a price. Pure distance vector routing protocols suffer from possible routing loops.

• Routing loops can cause major network problems, from packets getting lost (blackholed) in your network, to bringing down your entire network.

• Several remedies have been added to distance-vector algorithms to help prevent routing loops including:

– Split horizon– Hold-down timers– Defining a maximum metric

Page 8: Distance Vector Routing - RIP

Rick Graziani [email protected] 8

Routing Loop Issues

What can cause routing loops?• Routing loops can occur when there are:

– Incorrect or inconsistent routing updates due to slow convergence after a topology change.

– Incorrect or incomplete routing information– Static routes incorrectly configured with an intermediate address which

does not become resolved in the routing table.

Page 9: Distance Vector Routing - RIP

Rick Graziani [email protected] 9

Routing Loop Issues

Routing Loop Example

• Assume for the remainder of this example that Router C’s preferred path to network 1 is by way of Router B.

• Router C’s routing table has a distance of 3 to network 1 via Router B.

Page 10: Distance Vector Routing - RIP

Rick Graziani [email protected] 10

Routing Loop Issues

Network 1 Fails Router E sends an update to Router A. Router A stops routing packets to network 1. But Routers B, C, and D continue to do so because they have not yet been

informed about the failure. Router A sends out its update. Routers B and D stop routing to network1, (via Router A). However, Router C is still not updated. To router C, network 1 is still reachable via router B.

Page 11: Distance Vector Routing - RIP

Rick Graziani [email protected] 11

Routing Loop Issues

Router C sends a periodic update to Router D Router C sends a periodic update to Router D indicating a path to network 1

(by way) of via Router B. (4 hops).

Router D’s Routing Table information for Network 1 Current path to Network 1 = Unreachable (down) Information from Router C: Network 1 : 4 hops by way of Router C Normally, Router D ignores this routing information because it usually has a

better route, 2 hops, via Router A, but this route is now down. Router D changes its routing table to reflect this (good) better, but incorrect

information, Network 1 by way of Router C (4 hops) Router D propagates the information to Router A.

Page 12: Distance Vector Routing - RIP

Rick Graziani [email protected] 12

Routing Loop Issues

Routers A changes its routing table Router A adds new route to its routing table, get to Network 1 by way of Router

D (5 hops). Propagates the information to Routers B and E. Router B (and Router E) change their routing tables Router B now believes it can get to Network 1 by way of Router A (6 hops). Wow! I was about to tell Router C that Network 1 was down via Router B, but

now I have new information! Propagates the incorrect information to Router C.

Page 13: Distance Vector Routing - RIP

Rick Graziani [email protected] 13

Routing Loop Issues

Router C changes its routing table Router C still believes it can get to Network 1 by way of Router B (7 hops). Of course now it believes it is 7 hops instead of 3. Propagates the newer but still incorrect information to Router D.

Here we go again! Data packets destined for Network 1 get caught in a routing loop, from Routers

A to D to C to B to A to D etc. As routing updates continue between the routers, the hop count gets greater –

to infinity? (Not quite – we will see in a moment.)

Page 14: Distance Vector Routing - RIP

Rick Graziani [email protected] 14

Defining a Maximum

Problem: Count to infinity

Solution: Defining a Maximum

• Distance vector routing algorithms are self-correcting, but a routing loop problem can require a count to infinity.

• To avoid this prolonged problem, distance vector protocols define infinity as a specific maximum number.

• This number refers to a routing metric which may simply be the hop count.

• When the metric value exceeds the maximum value, and as each router receives this maximum metric, the network is then considered unreachable.

Page 15: Distance Vector Routing - RIP

Rick Graziani [email protected] 15

Split Horizon

• A route pointing back to the router from which packets were received is called a reverse route.

• Split horizon is a technique for preventing reverse routes between two routers.

• The Split Horizon Rule: when sending updates out a particular interface, do not include networks that were learned from updates received on that interface.

Page 16: Distance Vector Routing - RIP

Rick Graziani [email protected] 16

Split Horizon Rule – Avoiding Routing Loops

• Routers RTA and RTB have their initial routing tables and are ready to exchange routing information via a distance-vector routing protocol like RIP.

Split Horizon disabled

• If split horizon were disabled the routing updates would include all of the networks in their routing tables including their directly connected networks and any networks learned from any interface.

RTA RTB10.1.1.0/24

Routing Table Net. Hops Ex-Int10.1.1.0/24 0 e010.1.2.0/24 0 s0

10.1.2.0/24 10.1.3.0/24

s0 s0e0 e0

.1 .1.1 .2

Routing Table Net. Hops Ex-Int10.1.2.0/24 0 s010.1.3.0/24 0 e0

Simple Split Horizon

Initial routing tables

Page 17: Distance Vector Routing - RIP

Rick Graziani [email protected] 17

Split Horizon Disabled• After the initial exchange of updates everything in the routing tables

look fine.• Because split horizon is disabled, the 10.1.2.0/24 network is sent by

both routers, but neither router includes the other’s route to 10.1.2.0/24 (1 hop) in the routing table, because it has a current route with a better metric of 0.

Initial routing tables

New routing tables

10.1.2.0/24 network is included because split horizon has been disabled

RTA RTB10.1.1.0/24

Routing Table Net. Hops Ex-Int10.1.1.0/24 0 e010.1.2.0/24 0 s0

10.1.2.0/24 10.1.3.0/24

s0 s0e0 e0

.1 .1.1 .2

Routing Table Net. Hops Ex-Int10.1.2.0/24 0 s010.1.3.0/24 0 e0

Routing Update Next-hopNet. Hops Address10.1.1.0/24 1 10.1.1.110.1.2.0/24 1 10.1.1.1

Routing Update Next-hopNet. Hops Address10.1.2.0/24 1 10.1.2.210.1.3.0/24 1 10.1.2.2

Routing Table Net. Hops Ex-Int10.1.1.0/24 0 e010.1.2.0/24 0 s010.1.3.0/24 1 10.1.2.2

Routing Table Net. Hops Ex-Int10.1.2.0/24 0 s010.1.3.0/24 0 e010.1.1.0/24 1 10.1.2.1

Page 18: Distance Vector Routing - RIP

Rick Graziani [email protected] 18

Split Horizon Disabled• After the next exchange of updates everything in the routing tables look fine

and the routing tables are converged.• Because split horizon is disabled, besides the 10.1.2.0/24 network, the

networks learned from the other router in the previous update is also sent by both routers.

• However, neither router includes those networks, because it has a current route with a better metric of 0.

RTA RTB10.1.1.0/24 10.1.2.0/24 10.1.3.0/24

s0 s0e0 e0

.1 .1.1 .2

Routing Update Next-hopNet. Hops Address10.1.1.0/24 1 10.1.1.110.1.2.0/24 1 10.1.1.110.1.3.0/24 2 10.1.1.1

Routing Update Next-hopNet. Hops Address10.1.2.0/24 1 10.1.2.210.1.3.0/24 1 10.1.2.210.1.1.0/24 2 10.1.2.2

Routing Table Net. Hops Ex-Int10.1.1.0/24 0 e010.1.2.0/24 0 s010.1.3.0/24 1 10.1.2.2

Routing Table Net. Hops Ex-Int10.1.2.0/24 0 s010.1.3.0/24 0 e010.1.1.0/24 1 10.1.2.1

Routing Table Net. Hops Ex-Int10.1.1.0/24 0 e010.1.2.0/24 0 s010.1.3.0/24 1 10.1.2.2

Routing Table Net. Hops Ex-Int10.1.2.0/24 0 s010.1.3.0/24 0 e010.1.1.0/24 1 10.1.2.1

Previous routing tables

Networks in red were included because split horizon has been disabled

New routing tables

Page 19: Distance Vector Routing - RIP

Rick Graziani [email protected] 19

Split Horizon Disabled – 10.1.3.0/24 down

• Routing tables are not sent at the exactly same time. This is done on purpose to avoid collisions on broadcast networks like Ethernet.

• Here, the 10.1.3.0/24 network fails, and before RTB sends out its routing update, RTB receives a routing update from RTA.

RTA RTB10.1.1.0/24 10.1.2.0/24 10.1.3.0/24

s0 s0e0 e0

.1 .1.1 .2

Routing Update Next-hopNet. Hops Address10.1.1.0/24 1 10.1.1.110.1.2.0/24 1 10.1.1.110.1.3.0/24 2 10.1.1.1

Routing Table Net. Hops Ex-Int10.1.1.0/24 0 e010.1.2.0/24 0 s010.1.3.0/24 1 10.1.2.2

Routing Table Net. Hops Ex-Int10.1.2.0/24 0 s010.1.3.0/24 0 e010.1.1.0/24 1 10.1.2.1

Routing Table Net. Hops Ex-Int10.1.1.0/24 0 e010.1.2.0/24 0 s010.1.3.0/24 1 10.1.2.2

Routing Table Net. Hops Ex-Int10.1.2.0/24 0 s010.1.3.0/24 2 10.1.2.110.1.1.0/24 1 10.1.2.1

X

Previous routing tables

Networks in red were included because split horizon has been disabled

New routing tables

Page 20: Distance Vector Routing - RIP

Rick Graziani [email protected] 20

Split Horizon Disabled – 10.1.3.0/24 down• RTB notices that it has a route to 10.1.3.0/24 via RTA. Even though it is 2

hops it is certainly better than its current situation of “unreachable” so it accepts this better, but incorrect information from RTA.

• RTB now forwards all packets destined for 10.1.3.0/24 to RTA at 10.1.2.1.• RTA receives these packets and forwards them to RTB at 10.1.2.2.• RTB forwards them back to RTA at 10.1.2.1.• And so on! The packets get blackholed in this routing loop.

RTA RTB10.1.1.0/24 10.1.2.0/24 10.1.3.0/24

s0 s0e0 e0

.1 .1.1 .2

Routing Update Next-hopNet. Hops Address10.1.1.0/24 1 10.1.1.110.1.2.0/24 1 10.1.1.110.1.3.0/24 2 10.1.1.1

Routing Table Net. Hops Ex-Int10.1.1.0/24 0 e010.1.2.0/24 0 s010.1.3.0/24 1 10.1.2.2

Routing Table Net. Hops Ex-Int10.1.2.0/24 0 s010.1.3.0/24 0 e010.1.1.0/24 1 10.1.2.1

Routing Table Net. Hops Ex-Int10.1.1.0/24 0 e010.1.2.0/24 0 s010.1.3.0/24 1 10.1.2.2

Routing Table Net. Hops Ex-Int10.1.2.0/24 0 s010.1.3.0/24 2 10.1.2.110.1.1.0/24 1 10.1.2.1

X

Previous routing tables

Networks in red were included because split horizon has been disabled

New routing tables

Page 21: Distance Vector Routing - RIP

Rick Graziani [email protected] 21

RTA RTB10.1.1.0/24

Routing Table Net. Hops Ex-Int10.1.1.0/24 0 e010.1.2.0/24 0 s0

10.1.2.0/24 10.1.3.0/24

s0 s0e0 e0

.1 .1.1 .2

Routing Table Net. Hops Ex-Int10.1.2.0/24 0 s010.1.3.0/24 0 e0

Routing Update Next-hopNet. Hops Address10.1.1.0/24 1 10.1.1.1

Routing Update Next-hopNet. Hops Address10.1.3.0/24 1 10.1.2.2

Routing Table Net. Hops Ex-Int10.1.1.0/24 0 e010.1.2.0/24 0 s010.1.3.0/24 1 10.1.2.2

Routing Table Net. Hops Ex-Int10.1.2.0/24 0 s010.1.3.0/24 0 e010.1.1.0/24 1 10.1.2.1

Routing Update Next-hopNet. Hops Address10.1.1.0/24 1 10.1.1.1

Routing Update Next-hopNet. Hops Address10.1.3.0/24 1 10.1.2.2

Previous routing tables

New routing tables

Split Horizon Enabled

Page 22: Distance Vector Routing - RIP

Rick Graziani [email protected] 22

Split Horizon Enabled• As you can see, with split horizon enabled, RTA does not send RTB (out s0)

information about 10.1.3.0/24 because it learned it from RTB (same s0), and RTB does not send RTA (out s0) information about 10.1.1.0/24 to RTA because it learned it from RTA (same s0). (This also includes the common network between them.

RTA RTB10.1.1.0/24

Routing Table Net. Hops Ex-Int10.1.1.0/24 0 e010.1.2.0/24 0 s0

10.1.2.0/24 10.1.3.0/24

s0 s0e0 e0

.1 .1.1 .2

Routing Table Net. Hops Ex-Int10.1.2.0/24 0 s010.1.3.0/24 0 e0

Routing Update Next-hopNet. Hops Address10.1.1.0/24 1 10.1.1.1

Routing Update Next-hopNet. Hops Address10.1.3.0/24 1 10.1.2.2

Routing Table Net. Hops Ex-Int10.1.1.0/24 0 e010.1.2.0/24 0 s010.1.3.0/24 1 10.1.2.2

Routing Table Net. Hops Ex-Int10.1.2.0/24 0 s010.1.3.0/24 0 e010.1.1.0/24 1 10.1.2.1

Routing Update Next-hopNet. Hops Address10.1.1.0/24 1 10.1.1.1

Routing Update Next-hopNet. Hops Address10.1.3.0/24 1 10.1.2.2

Previous routing tables

New routing tables

Page 23: Distance Vector Routing - RIP

Rick Graziani [email protected] 23

Split Horizon Enabled – 10.1.3.0/24 down• RTB notices 10.1.3.0/24 is down and puts this route into hold-down state in

its routing table. (hold-down coming next)• RTB immediately sends out a triggered update for only this route (if there were

others in the routing table) with a metric of infinity, 16.• RTA receives the triggered update and puts the route for 10.1.3.0/24 into

hold-down state.

Previous routing tables

New routing tables

RTA RTB10.1.1.0/24 10.1.2.0/24 10.1.3.0/24

s0 s0e0 e0

.1 .1.1 .2

Routing Table Net. Hops Ex-Int10.1.1.0/24 0 e010.1.2.0/24 0 s010.1.3.0/24 1 10.1.2.2

Routing Table Net. Hops Ex-Int10.1.2.0/24 0 s010.1.3.0/24 (down) e010.1.1.0/24 1 10.1.2.1

Routing Table Net. Hops Ex-Int10.1.1.0/24 0 e010.1.2.0/24 0 s010.1.3.0/24 (down) 10.1.2.2

X

Routing Update Next-hopNet. Hops Address10.1.3.0/24 16 10.1.2.2

Routing Table Net. Hops Ex-Int10.1.2.0/24 0 s010.1.3.0/24 (down) e010.1.1.0/24 1 10.1.2.1

Page 24: Distance Vector Routing - RIP

Rick Graziani [email protected] 24

Split Horizon Enabled – 10.1.3.0/24 down

• Notice that RTA never sends RTB a routing update for 10.1.3.0/24, because split horizon is enabled on these interfaces.

Previous routing tables

New routing tables

RTA RTB10.1.1.0/24 10.1.2.0/24 10.1.3.0/24

s0 s0e0 e0

.1 .1.1 .2

Routing Table Net. Hops Ex-Int10.1.1.0/24 0 e010.1.2.0/24 0 s010.1.3.0/24 1 10.1.2.2

Routing Table Net. Hops Ex-Int10.1.2.0/24 0 s010.1.3.0/24 (down) e010.1.1.0/24 1 10.1.2.1

Routing Table Net. Hops Ex-Int10.1.1.0/24 0 e010.1.2.0/24 0 s010.1.3.0/24 (down) 10.1.2.2

X

Routing Update Next-hopNet. Hops Address10.1.3.0/24 16 10.1.2.2

Routing Table Net. Hops Ex-Int10.1.2.0/24 0 s010.1.3.0/24 (down) e010.1.1.0/24 1 10.1.2.1

Page 25: Distance Vector Routing - RIP

Rick Graziani [email protected] 25

Split Horizon with Poison Reverse• Many vendor implementations of distance vector routing protocols like Cisco’s RIP and

IGRP apply a special kind of split horizon, called split horizon with poison reverse.

• “Split horizon with poison reverse means that, instead of not advertising routes to the source, routes are advertised back to the source with a metric of 16, which will make the source router ignore the route. It is perceived that explicitly telling a router to ignore a route is better than not telling it about the route in the first place.” (Lewis, Cisco TCP/IP Routing)

• One drawback is that routing update packet sizes will be increased when using Poison Reverse, since they now include these routes.

Split Horizon with Poison ReverseRTA RTB10.1.1.0/24 10.1.2.0/24 10.1.3.0/24

s0 s0e0 e0

.1 .1.1 .2

Routing Table Net. Hops Ex-Int10.1.1.0/24 0 e010.1.2.0/24 0 s010.1.3.0/24 1 10.1.2.2

Routing Table Net. Hops Ex-Int10.1.2.0/24 0 s010.1.3.0/24 0 e010.1.1.0/24 1 10.1.2.1

Routing Update Next-hopNet. Hops Address10.1.1.0/24 1 10.1.1.110.1.2.0/24 16 10.1.2.110.1.3.0/24 16 10.1.2.1

Routing Update Next-hopNet. Hops Address10.1.3.0/24 1 10.1.2.210.1.2.0/24 16 10.1.2.210.1.1.0/24 16 10.1.2.2

“Poisoned” routes in red. Routing tables remain the same.

Page 26: Distance Vector Routing - RIP

Rick Graziani [email protected] 26

Split Horizon Enabled by DefaultSplit horizon with poison reverse is enabled by default for all interfaces except:• Physical interfaces or multipoint sub-interfaces using Frame Relay or SMDS

encapsulation (CCNA Semester 4 and CCNP)

To disable split horizon on an interface: Router(config-if)# no ip split-horizonTo enable split horizon on an interface: Router(config-if)# ip split-horizon

RTA RTB10.1.1.0/24 10.1.2.0/24 10.1.3.0/24

s0 s0e0 e0

.1 .1.1 .2

Routing Table Net. Hops Ex-Int10.1.1.0/24 0 e010.1.2.0/24 0 s010.1.3.0/24 1 10.1.2.2

Routing Table Net. Hops Ex-Int10.1.2.0/24 0 s010.1.3.0/24 0 e010.1.1.0/24 1 10.1.2.1

Routing Update Next-hopNet. Hops Address10.1.1.0/24 1 10.1.1.110.1.2.0/24 16 10.1.2.110.1.3.0/24 16 10.1.2.1

Routing Update Next-hopNet. Hops Address10.1.3.0/24 1 10.1.2.210.1.2.0/24 16 10.1.2.210.1.1.0/24 16 10.1.2.2

“Poisoned” routes in red.

Split Horizon with Poison Reverse

Page 27: Distance Vector Routing - RIP

Rick Graziani [email protected] 27

Route poisoning

• When route poisoning is used with triggered updates it will speed up convergence time because neighboring routers do not have to wait 30 seconds before advertising the poisoned route.

Page 28: Distance Vector Routing - RIP

Rick Graziani [email protected] 28

Preventing routing loops with holddown timers

• The main function of holddown timers is to prevent the distance vector routing protocol from establishing routing loops during periods of network transition (topology changes).

• “The rule: Once a route is marked unreachable, it must stay in this state for a period of time assumed sufficient for all routers to receive new information about the unreachable network. In essence, we instruct the routers to let the rumors calm down and then to pick up the truth.” (Zinin, Cisco IP Routing)

• The amount of time a router remains in “this state” is determined by the holddown timer.

Page 29: Distance Vector Routing - RIP

Rick Graziani [email protected] 29

Preventing routing loops with holddown timers

Curriculum

• A count to infinity problem can be avoided by using holddown timers.

• When a router receives an update from a neighbor indicating that a previously accessible network is now inaccessible, the router marks the route as inaccessible and starts a hold-down timer.

Page 30: Distance Vector Routing - RIP

Rick Graziani [email protected] 30

Preventing routing loops with holddown timers

Same Route from same neighbor: Network is back up (Correct News)

• If at any time before the hold-down timer expires an update is received from the same neighbor indicating that the network is again accessible, the router marks the network as accessible and removes the hold-down timer.

Page 31: Distance Vector Routing - RIP

Rick Graziani [email protected] 31

Preventing routing loops with holddown timers

Better Route from different neighbor (Correct News)

• If at any time before the hold-down timer expires an update arrives from a different neighboring router with a better metric than originally recorded for the network, the router marks the network as accessible and removes the hold-down timer.

Page 32: Distance Vector Routing - RIP

Rick Graziani [email protected] 32

Preventing routing loops with holddown timers

Poorer Route from a different neighbor. (Incorrect News)

• If at any time before the hold-down timer expires an update arrives from a different neighboring router with a poorer metric than originally recorded for the network the update is ignored and the hold-down timer continues.

• Ignoring an update with a poorer metric when a hold-down is in effect allows more time for the knowledge of a disruptive change to propagate through the entire network.

Page 33: Distance Vector Routing - RIP

Rick Graziani [email protected] 33

Avoiding routing loops with triggered updates

• Triggered update is sent immediately in response to some change in the routing table.

• The router that detects a topology change immediately sends an update message to adjacent routers that, in turn, generate triggered updates notifying their adjacent neighbors of the change.

• When a route fails, an update is sent immediately rather than waiting on the update timer to expire.

• Triggered updates, used in conjunction with route poisoning, ensure that all routers know of failed routes before any holddown timers can expire.

Page 34: Distance Vector Routing - RIP

Rick Graziani [email protected] 34

Let’s look at a related item in IP, the TTL field. Taken from information added to Ch. 9 TCP/IP.

IP Header 0 15 16 31

4-bit Version

4-bit Header Length

8-bit Type Of Service (TOS)

16-bit Total Length (in bytes)

16-bit Identification

3-bit Flags

13-bit Fragment Offset

8 bit Time To Live

TTL

8-bit Protocol

16-bit Header Checksum

32-bit Source IP Address

32-bit Destination IP Address

Options (if any)

Data

IP’s TTL – Time To Live field

Page 35: Distance Vector Routing - RIP

Rick Graziani [email protected] 35

• When a packet is first generated a value is entered into the TTL field.

• Originally, the TTL field was the number of seconds, but this was difficult to implement and rarely supported.

• Now, the TTL is now set to a specific value which is then decremented by each router.

IP Header 0 15 16 31

4-bit Version

4-bit Header Length

8-bit Type Of Service (TOS)

16-bit Total Length (in bytes)

16-bit Identification

3-bit Flags

13-bit Fragment Offset

8 bit Time To Live

TTL

8-bit Protocol

16-bit Header Checksum

32-bit Source IP Address

32-bit Destination IP Address

Options (if any)

Data

IP’s TTL – Time To Live field

Page 36: Distance Vector Routing - RIP

Rick Graziani [email protected] 36

Decrement by 1, if 0 drop the packet.

IP Header 0 15 16 31

4-bit Version

4-bit Header Length

8-bit Type Of Service (TOS)

16-bit Total Length (in bytes)

16-bit Identification

3-bit Flags

13-bit Fragment Offset

8 bit Time To Live

TTL

8-bit Protocol

16-bit Header Checksum

32-bit Source IP Address

32-bit Destination IP Address

Options (if any)

Data

IP’s TTL – Time To Live field

• If the router decrements the TTL field to 0, it will then drop the packet (unless the packet is destined specifically for the router, I.e. ping, telnet, etc.).

• Common operating system TTL values are:– UNIX: 255– Linux: 64 or 255 depending upon vendor and version– Microsoft Windows 95: 32 – Other Microsoft Windows operating systems: 128

Page 37: Distance Vector Routing - RIP

Rick Graziani [email protected] 37

• The idea behind the TTL field is that IP packets can not travel around the Internet forever, from router to router.

• Eventually, the packet’s TTL which reach 0 and be dropped by the router, even if there is a routing loop somewhere in the network.

Decrement by 1, if 0 drop the packet.

IP Header 0 15 16 31

4-bit Version

4-bit Header Length

8-bit Type Of Service (TOS)

16-bit Total Length (in bytes)

16-bit Identification

3-bit Flags

13-bit Fragment Offset

8 bit Time To Live

TTL

8-bit Protocol

16-bit Header Checksum

32-bit Source IP Address

32-bit Destination IP Address

Options (if any)

Data

IP’s TTL – Time To Live field

Page 38: Distance Vector Routing - RIP

Rick Graziani [email protected] 38

RIP routing process

• Request for Comments (RFC) 1058

• RIP has evolved over the years from a Classful Routing Protocol, RIP Version 1 (RIP v1), to a Classless Routing Protocol, RIP Version 2 (RIP v2). RIP v2 enhancements include:– Ability to carry additional packet routing information. – Authentication mechanism to secure table updates. – Supports variable length subnet masking (VLSM).

Page 39: Distance Vector Routing - RIP

Rick Graziani [email protected] 39

Configuring RIP

Page 40: Distance Vector Routing - RIP

Rick Graziani [email protected] 40

Configuring RIP

RIP and IGRP:

• Classful network statements only

• IOS will take subnetted networks but will translate it into the classful network for the running-config.

Page 41: Distance Vector Routing - RIP

Rick Graziani [email protected] 41

Configuring RIP

Rick’s Clarifications (This is for IGPs only and not EGPs such as BGP):• The network command does two things: 1. Determines which interfaces will participate in sending and receiving routing

updates, as long as the interface IP address falls in the range of the network command.

2. Determines which networks this router will announce as being directly connected to in its routing updates to other routers.

• The network numbers do not necessarily have to be based on the network class, as it depends on the routing protocol. Network numbers are based on the network class for RIP, IGRP, and usually EIGRP, but can be more specific for OSPF, EIGRP and IS-IS.

Page 42: Distance Vector Routing - RIP

Rick Graziani [email protected] 42

Triggered Extensions

Triggered Extensions to RIP• http://www.cisco.com/en/US/products/sw/iosswrel/ps1830/products_feature_gu

ide09186a008008746f.html• There were two problems using RIP to connect to a WAN:

– Periodic broadcasting by RIP generally prevented WAN circuits from being closed.

– Even on fixed, point-to-point links, the overhead of periodic RIP transmissions could seriously interrupt normal data transfer because of the quantity of information that hits the line every 30 seconds.

• To overcome these limitations, triggered extensions to RIP cause RIP to send information on the WAN only when there has been an update to the routing database.

• Periodic update packets are suppressed over the interface on which this feature is enabled.

interface serial 0  ip rip triggered

Page 43: Distance Vector Routing - RIP

Rick Graziani [email protected] 43

Triggered Extensions

• RFC 2091, Triggered Extensions to RIP to Support Demand Circuits.• When triggered extensions to RIP are enabled, routing updates are transmitted

on the WAN only if one of the following occurs:– The router receives a specific request for a routing update. (Full database is

sent.) – Information from another interface modifies the routing database. (Only

latest changes are sent) – The interface comes up or goes down. (Partial database is sent.) – The router is first powered on, to ensure that at least one update is sent.

(Full database is sent.) • You might want to enable this feature if you are using an on-demand circuit and

you are charged for usage time. Fewer routing updates will incur lower usage costs.

interface serial 0  ip rip triggered

Page 44: Distance Vector Routing - RIP

Rick Graziani [email protected] 44

RIP MessageData Link Frame       MAC Source Address       MAC Destination Address = Broadcast IP Packet       IP Source Address        IP Destination Address = Broadcast: 255.255.255.255       Protocol field = 17 for UDP UDP Segment       Source Port number field = 520 for RIP Message RIP Message (Data portion of IP Packet):       Routes: Network IP Address        Hops (metric)

Data Link Frame Header

IP Packet Header

UDP Segment Header

RIP Message

The RIPv1 Protocol

Page 45: Distance Vector Routing - RIP

Rick Graziani [email protected] 45

• Command: 1 signifying a Request or 2 signifying a Reply

• Version: 1 for RIP v 1 or 2 for RIP v 2

• Address Family Identifier: 2 signifying IP (only exception is for a Request for the Router’s full routing table, later Semester in RIP v 2)

• IP Address: The address of the destination route, which may be a network address, a subnet address of a host address.

• Metric: Hop count between 1 and 16. Note: With RIP the sending router increases the metric before sending out the RIP message.

• Note: The routing table knows the next-hop-ip-address (via) from the source IP address of the packet.

Data Link Frame Header

IP Packet Header

UDP Segment Header

RIP Message

0 7 8 15 16 23 24 31 Command = 1 or 2 Version = 1 Must be zero

Address family identifier (2 = IP) Must be zero IP Address (Network Address)

Must be zero Must be zero

Metric (Hops)

Multiple Routes, up to a maximum of 25

Address family identifier (2 = IP) Must be zero IP Address (Network Address)

Must be zero Must be zero

Metric (Hops)

Page 46: Distance Vector Routing - RIP

Rick Graziani [email protected] 46

RIP v2 message format

• All the extensions to the original protocol are carried in the unused fields.

• The Address Family Identifier (AFI) field is set to two for IP. The only exception is a request for a full routing table of a router or host, in which case it will be set to zero.

Page 47: Distance Vector Routing - RIP

Rick Graziani [email protected] 47

RIP v2 message format

• The Route Tag field provides a way to differentiate between internal and external routes.

• External routes are those that have been redistributed into the RIP v2.• The Next Hop field contains the IP address of the next hop listed in the IP

Address field.• Metric indicates how many internetwork hops, between 1 and 15 for a valid

route, or 16 for an unreachable route.

Page 48: Distance Vector Routing - RIP

Rick Graziani [email protected] 48

Configuring RIP

RIP must be enabled and the networks specified. The remaining tasks are optional. Among these optional tasks are:

• Specifying a RIP version (RIPv1 or RIPv2)• Enabling RIP authentication• Configuring route summarization on an interface • Verifying IP route summarization • Disabling automatic route summarization (RIPv2)• Running IGRP and RIP concurrently• Disabling the validation of source IP addresses • Enabling or disabling split horizon • Connecting RIP to a WAN

Page 49: Distance Vector Routing - RIP

Rick Graziani [email protected]

ip classless command

• IP classless only affects the operation of the forwarding processes in IOS. IP classless does not affect the way the routing table is built.

• This command concerns classless and classful routing behavior, which is not the same as classless and classful routing protocols (later).

Page 50: Distance Vector Routing - RIP

Rick Graziani [email protected]

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.

Page 51: Distance Vector Routing - RIP

Rick Graziani [email protected]

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.

Page 52: Distance Vector Routing - RIP

Rick Graziani [email protected]

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.

Page 53: Distance Vector Routing - RIP

Rick Graziani [email protected]

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.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!

Page 54: Distance Vector Routing - RIP

Rick Graziani [email protected]

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!

Page 55: Distance Vector Routing - RIP

Rick Graziani [email protected]

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!

Page 56: Distance Vector Routing - RIP

Rick Graziani [email protected]

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

Page 57: Distance Vector Routing - RIP

Rick Graziani [email protected]

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

Page 58: Distance Vector Routing - RIP

Rick Graziani [email protected] 58

Common RIP Configuration Issues

Split Horizon

• The following command is used to disable split horizon:

GAD(config-if)#no ip split-horizon

• The following command is used to enable (default) split horizon:

GAD(config-if)#ip split-horizon

Page 59: Distance Vector Routing - RIP

Rick Graziani [email protected] 59

Common RIP Configuration Issues

Holddown Timer

• The ideal setting would be to set the timer just longer than the longest possible update time for the internetwork.

• To change the holddown timer:

Router(config-router)#timers basic update invalid holddown flush [sleeptime]

Page 60: Distance Vector Routing - RIP

Rick Graziani [email protected] 60

Common RIP Configuration Issues

Update Timer

• The default RIP update interval in Cisco IOS is 30 seconds. This can be configured for longer intervals to conserve bandwidth, or for shorter intervals to decrease convergence time.

• To change the update internal:

GAD(config-router)#update-timer seconds

Page 61: Distance Vector Routing - RIP

Rick Graziani [email protected] 61

Common RIP Configuration Issues

For RIP and IGRP, the passive interface command stops the router from sending updates to a particular neighbor, but the router continues to listen and use routing updates from that neighbor. (More later.)

• Also used when there are no routers on that interface, such as stub LANs.

Router(config-router)# passive-interface interface

router rip passive-interface fastethernet 0/0 

Page 62: Distance Vector Routing - RIP

Rick Graziani [email protected] 62

Common RIP Configuration Issues

• Because RIP is a broadcast protocol, the network administrator may have to configure RIP to exchange routing information in a non-broadcast network such as Frame Relay.

• In this type of network, RIP needs to be told of other neighboring RIP routers.

• To do this use the router rip command:

Router(config-router)# neighbor ip address

Page 63: Distance Vector Routing - RIP

Rick Graziani [email protected] 63

Common RIP Configuration Issues

• By default, the Cisco IOS software receives RIP Version 1 and Version 2 packets, but sends only Version 1 packets.

• The network administrator can configure the router to only receive and send Version 1 packets or the administrator can configure the router to send only Version 2 packets.

Page 64: Distance Vector Routing - RIP

Rick Graziani [email protected] 64

Compatibility with RIP v1

NewYork

interface fastethernet0/0

ip address 192.168.50.129 255.255.255.192

ip rip send version 1

ip rip receive version 1

interface fastethernet0/1

ip address 172.25.150.193 255.255.255.240

ip rip send version 1 2

interface fastethernet0/2

ip address 172.25.150.225 225.255.255.240

router rip

version 2

network 172.25.0.0

network 192.168.50.0

• Interface FastEthernet0/0 is configured to send and receive RIP v1 updates.

• FastEthernet0/1 is configured to send both version 1 and 2 updates.

• FastEthernet0/2 has no special configuration and therefore sends and receives version 2 by default.

RIPv2

Page 65: Distance Vector Routing - RIP

Rick Graziani [email protected] 65

Verifying RIP configuration

Page 66: Distance Vector Routing - RIP

Rick Graziani [email protected] 66

Verifying RIP configuration

• Also: show running-config

Page 67: Distance Vector Routing - RIP

Rick Graziani [email protected] 67

Troubleshooting RIP update issues

Page 68: Distance Vector Routing - RIP

Rick Graziani [email protected] 68

Troubleshooting RIP update issues

Other commands to troubleshoot RIP:

• show ip rip database

• show ip protocols {summary}

• show ip route

• debug ip rip {events}

• show ip interface brief

Page 69: Distance Vector Routing - RIP

Rick Graziani [email protected] 69

Load balancing with RIP

• RIP is capable of load balancing over as many as six equal-cost paths, with four paths being default. RIP performs what is referred to as “round robin” load balancing.

• This means that RIP takes turns forwarding packets over the parallel paths.

• This is only part of the story…

Page 70: Distance Vector Routing - RIP

Rick Graziani [email protected] 70

Fast Switching and Process Switching

The following information is taken from Routing TCP/IP Volume I by Jeff Doyle.

• Load sharing or Load balancing allows routers to take advantage of multiple paths to the same destination.

• Equal-cost load balancing: – Distributes packets equally among multiple paths with equal

metrics– RIP, EIGRP, OSPF, IS-IS and BGP

• Unequal-cost load balancing: – Distributes packets among multiple paths with different metrics,

inversely proportional to the cost of the routes.– IGRP, EIGRP

• Load sharing can be either:– Per Destination (Fast Switching) – Per Packet ( Process Switching)

Page 71: Distance Vector Routing - RIP

Rick Graziani [email protected] 71

Fast Switching – Per Destination Load Balancing

• The default for most interfaces is Fast Switching.• Load balancing is distributed according to the destination IP address.• Given two paths to the same network, all packets for one destination IP

address will travel over the first path, all packets for a second destination will travel over the second path, all packets for the third destination will again travel over the first path, and so on.

• To enable fast switching: Router(config-if)# ip route-cache• To enable distributed or process switching: Router(config-if)# no ip route-cache

ping 10.0.0.1ping 10.0.0.2

Router(config-if)# ip route-cache

Page 72: Distance Vector Routing - RIP

Rick Graziani [email protected] 72

Fast Switching – Per Destination Load Balancing

Fast Switching1. Router switches first packet to a particular destination, a routing table lookup

is performed and an exit interface is selected.2. The necessary data-link information to frame the packet for the selected

interface is retrieved including any ARP cache information.3. The route and data-link information is stored in fast switching cache.4. The router uses the cache to look up subsequent packets.5. All other packets to the same destination are immediately switched out the

same interface without the router performing another routing table lookup, including any recursive lookups. (Also no ARP cache lookup).

ping 10.0.0.1ping 10.0.0.2

Router(config-if)# ip route-cache

Page 73: Distance Vector Routing - RIP

Rick Graziani [email protected] 73

Process Switching – Per Packet Load Balancing

ping 10.0.0.1ping 10.0.0.2

Router(config-if)#no ip route-cache

Process Switching• Given equal cost paths, per packet load sharing means that one packet to a

destination is sent over one link, the next packet to the same destination is sent over the next link, and so on.

• If the paths are unequal cost, the load balancing may be one packet over the higher-cost link for every three packets over the lower-cost link, or similar ratio.

• With process switching, for every packet, the router performs a route table lookup and selects an interface, and looks up the data-link information.

• To enable distributed or process switching: Router(config-if)# no ip route-cache

Page 74: Distance Vector Routing - RIP

Rick Graziani [email protected] 74

Which one?

ping 10.0.0.1ping 10.0.0.2

Router(config-if)#no ip route-cache

Fast Switching or Process Switching

• Process switching (per packet load balancing) has a price, load balancing may be distributed more evenly but the lower switching time and processor utilization of fast switching are lost.

ping 10.0.0.1ping 10.0.0.2

Router(config-if)# ip route-cache

Fast Switching Process Switching

Page 75: Distance Vector Routing - RIP

Rick Graziani [email protected] 75

Using debug ip packet withFast Switching and Process Switching

• debug ip packet can be used to observe packets sent and received and the interfaces that are involved.

• IMPORTANT: The debug ip packet command allows only process switched packets to be observed. Fast switch packets are not displayed (except for the first packet in the flow).

Router# debug ip packet

IP: s=192.168.3.2 (FastEthernet0), d=10.0.0.1 (Serial0/0),

g=192.168.1.2, forward

IP: s=192.168.3.2 (FastEthernet0), d=10.0.0.1 (Serial0/1),

g=192.168.2.2, forward

IP: s=192.168.3.2 (FastEthernet0), d=10.0.0.1 (Serial0/0),

g=192.168.1.2, forward

IP: s=192.168.3.2 (FastEthernet0), d=10.0.0.1 (Serial0/1),

g=192.168.2.2, forward

Page 76: Distance Vector Routing - RIP

Rick Graziani [email protected] 76

Load balancing across multiple paths

• Note: The example used in this section of the online curriculum is really for IGRP/EIGRP and does not fit well in this section of RIP.

• By default, most IP routing protocols install a maximum of four parallel routes in a routing table.

• Static routes always install six routes. • The exception is BGP, which by default allows only one path to a

destination.• The range of maximum paths is one to six paths. To change the

maximum number of parallel paths allowed, use the following command in router configuration mode:

Router(config-router)#maximum-paths [number]

Page 77: Distance Vector Routing - RIP

Rick Graziani [email protected] 77

RIP and Administrative Distance

Page 78: Distance Vector Routing - RIP

Rick Graziani [email protected] 78

RIP and Floating Static Routes

• Floating static routes are static routes which are used as backup routes.

• They are only injected into the routing table when a route with a lower administrative distance (dynamic or another static route) goes down.

• Should the route with the lower administrative distance come back up then the floating static route is removed from the routing table.

172.16.0.0/16X

router rip

network 192.168.13.0

ip route 172.16.0.0 255.255.0.0 bri0/1 130

Page 79: Distance Vector Routing - RIP

Rick Graziani [email protected] 79

RIPv1 Labs – 3 Scenarios (Optional)

• Read the following lab.

• Review the configurations and the outputs.

Page 80: Distance Vector Routing - RIP

Rick Graziani [email protected] 80

Objective

•  In this lab, you will configure RIP routing in three different scenarios.

• At the end of each scenario, all hosts and all routers should be able to reach (ping) each other.

 

Scenario

 There are five separate classful networks. After configuring RIP, we want to view the RIP update messages being sent and received by each router.

 

• Scenario 1: Running RIPv1 on classful networks

• Scenario 2: Running RIPv1 on subnets and between classful networks

• Scenario 3: Running RIPv1 on a stub network

 

These three scenarios can be done in sequence or separately.

RIPv1 Labs – 3 Scenarios

Page 81: Distance Vector Routing - RIP

Rick Graziani [email protected] 81

Setup• Use the 8 Steps to Success to help you configure the routers.• Be sure your cabling is correct, as this causes more troubleshooting issues

than anything else.• If the routers have a startup-config already on them, erase it and reboot the

routers.• Configure the routers to include hostnames and the proper interface commands

including IP addresses, subnet masks, etc. • Each router should be able to ping the interface of the adjacent (neighboring)

router and the host on its LAN (Ethernet) interface. • Test and troubleshoot as necessary.

Basic Configurations • There is a Basic Configuration included for each scenario, but it does not

include clock rate, no shutdown and some other necessary commands.• Note: Even though some of the networks are in numerical order, obviously this

does not need to be the case. We only did this to make it easier to remember where the networks originated from.

RIPv1 Labs – 3 Scenarios

Page 82: Distance Vector Routing - RIP

Rick Graziani [email protected] 82

Optional: Keeping outputs from interrupting our inputs

 

Before we begin to configure RIP, lets configure the console 0 port to keep debug and other output messages from interrupting our input. Use the following command on each router to keep the debug out from interfering with you command-line input:

 

Router(config)# line console 0

Router(config-line)# logging synchronous

 

Optional: Changing the default timeout

 

After 10 minutes, by default, if there is no input via the console, the user will be logged off. Although a good idea in production environment, in a lab environment this can be somewhat annoying. To turn-off the automatic timeout feature, we use the command: exec-timeout minutes [seconds], setting both the minutes and seconds to 0.

 

Router(config)# line console 0

Router(config-line)# exec-timeout 0 0

RIPv1 Labs – 3 Scenarios

Page 83: Distance Vector Routing - RIP

Rick Graziani [email protected] 83

SanJose2

hostname SanJose2

interface ethernet 0

ip add 192.168.1.1 255.255.255.0

interface serial 0

ip add 192.168.2.1 255.255.255.0

 

SanJose1

hostname SanJose1

interface ethernet 0

ip add 192.168.3.1 255.255.255.0

interface serial 0

ip add 192.168.2.2 255.255.255.0

interface serial 1

ip add 192.168.4.2 255.255.255.0

 

Baypointe

hostname Baypointe

interface ethernet 0

ip add 192.168.5.1 255.255.255.0

interface serial 0

ip add 192.168.4.1 255.255.255.0

Scenario 1: Running RIPv1 on classful networks

Page 84: Distance Vector Routing - RIP

Rick Graziani [email protected] 84

Objective: Running RIPv1 on classful networks This scenario is the same one we used in the network discovery lab, with the same

configurations and the same outputs. The concepts specific to this scenario will become more clear when we view the differences between this scenario and Scenario 2: Running RIPv1 on subnets and between classful networks.

 Step 1 – Configuring RIP First, lets enable RIP on each router.  From global configuration you will enter the command (the default is RIPv1):Router(config)#router rip Once you are in the Router RIP configuration sub-mode, all you need to do is enter the

classful network address for each directly connected network, using the network command.

Router(config-router)#network directly-connected-classful-network-address

 

Scenario 1: Running RIPv1 on classful networks

Page 85: Distance Vector Routing - RIP

Rick Graziani [email protected] 85

Here are the commands for each router:

 

SanJose2#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

SanJose2(config)#router rip

SanJose2(config-router)#network 192.168.1.0

SanJose2(config-router)#network 192.168.2.0

 

Baypointe#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Baypointe(config)#router rip

Baypointe(config-router)#network 192.168.4.0

Baypointe(config-router)#network 192.168.5.0

 

SanJose1#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

SanJose1(config)#router rip

SanJose1(config-router)#network 192.168.2.0

SanJose1(config-router)#network 192.168.3.0

SanJose1(config-router)#network 192.168.4.0

Scenario 1: Running RIPv1 on classful networks

Page 86: Distance Vector Routing - RIP

Rick Graziani [email protected] 86

Step 2 – Understanding the network command

 

SENDING RIP MESSAGES

Each router will begin to send RIP update message out each interface belonging to one of the network statements.

SanJose2(config)#router rip

SanJose2(config-router)#network 192.168.1.0

SanJose2(config-router)#network 192.168.2.0

 

For example, SanJose2 to will send out RIP update messages on Ethernet 0 because that interface has an IP address that belong to the network 192.168.1.0, and on Serial 0 because that interface has an IP address that belongs to the network 192.168.2.0.

Just because a router has a directly connected network does not mean it will automatically include that network in its routing updates to neighboring routers. The network command also tells the RIP to include these networks in its updates to adjacent neighbors.

To view the RIP messages being sent and received use the debug ip rip command.

 

SanJose2# debug ip rip

RIP protocol debugging is on

 SanJose2

01:03:27: RIP: sending v1 update to 255.255.255.255 via Ethernet0 (192.168.1.1)

01:03:27: network 192.168.2.0, metric 1

01:03:27: RIP: sending v1 update to 255.255.255.255 via Serial0 (192.168.2.1)

01:03:27: network 192.168.1.0, metric 1

Page 87: Distance Vector Routing - RIP

Rick Graziani [email protected] 87

LISTENING FOR RIP MESSAGESRouters will also listen for RIP messages on each interface belonging to one of the

network statements. For example, SanJose2 to will listen for RIP update messages on Ethernet 0

because that interface has an IP address that belong to the network 192.168.1.0, and also listen for RIP update messages on Serial 0 because that interface has an IP address that belongs to the network 192.168.2.0.

As RIP messages are received router, will add those networks in the messages to their routing tables:

If the RIP message contains a network not currently in the routing table.If the RIP message contains a network with a better metric (fewer hops) than an

entry currently in the routing table. SanJose201:10:56: RIP: received v1 update from 192.168.2.2 on Serial001:10:56: 192.168.4.0 in 1 hops01:10:56: 192.168.3.0 in 1 hops

Scenario 1: Running RIPv1 on classful networks

Page 88: Distance Vector Routing - RIP

Rick Graziani [email protected] 88

Step 3 – Viewing the debug ip rip output and the routing tables

 

Remember that SanJose1 will learn routes to networks from SanJose2. It will then send that information to Baypointe, telling Baypointe that it is the next hop to get to those networks, and incrementing the metric (hop count) by one.

 

After convergence, each router will continue to send its RIP update messages out the appropriate interfaces every 30 seconds.

 

Lets look at the debug messages and the routing table for each router:

Scenario 1: Running RIPv1 on classful networks

Page 89: Distance Vector Routing - RIP

Rick Graziani [email protected] 89

SanJose2 

01:30:45: RIP: sending v1 update to 255.255.255.255 via Ethernet0 (192.168.1.1)

01:30:45: network 192.168.4.0, metric 2

01:30:45: network 192.168.5.0, metric 3

01:30:45: network 192.168.2.0, metric 1

01:30:45: network 192.168.3.0, metric 2

01:30:45: RIP: sending v1 update to 255.255.255.255 via Serial0 (192.168.2.1)

01:30:45: network 192.168.1.0, metric 1

SanJose2#

01:30:50: RIP: received v1 update from 192.168.2.2 on Serial0

01:30:50: 192.168.4.0 in 1 hops

01:30:50: 192.168.5.0 in 2 hops

01:30:50: 192.168.3.0 in 1 hops

SanJose2#

 

SanJose2#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

<omitted>

i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default

U - per-user static route, o - ODR 

Gateway of last resort is not set

 

R 192.168.4.0/24 [120/1] via 192.168.2.2, 00:00:10, Serial0

R 192.168.5.0/24 [120/2] via 192.168.2.2, 00:00:10, Serial0

C 192.168.1.0/24 is directly connected, Ethernet0

C 192.168.2.0/24 is directly connected, Serial0

R 192.168.3.0/24 [120/1] via 192.168.2.2, 00:00:10, Serial0

SanJose2#

Page 90: Distance Vector Routing - RIP

Rick Graziani [email protected] 90

SanJose1 

01:33:05: RIP: received v1 update from 192.168.4.1 on Serial1

01:33:05: 192.168.5.0 in 1 hops

SanJose1#

01:33:07: RIP: received v1 update from 192.168.2.1 on Serial0

01:33:07: 192.168.1.0 in 1 hops

01:33:08: RIP: sending v1 update to 255.255.255.255 via Ethernet0 (192.168.3.1)

01:33:08: network 192.168.4.0, metric 1

01:33:08: network 192.168.5.0, metric 2

01:33:08: network 192.168.1.0, metric 2

01:33:08: network 192.168.2.0, metric 1

01:33:08: RIP: sending v1 update to 255.255.255.255 via Serial0 (192.168.2.2)

01:33:08: network 192.168.4.0, metric 1

01:33:08: network 192.168.5.0, metric 2

01:33:08: network 192.168.3.0, metric 1

01:33:08: RIP: sending v1 update to 255.255.255.255 via Serial1 (192.168.4.2)

01:33:08: network 192.168.1.0, metric 2

01:33:08: network 192.168.2.0, metric 1

01:33:08: network 192.168.3.0, metric 1

 

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 

C 192.168.4.0/24 is directly connected, Serial1

R 192.168.5.0/24 [120/1] via 192.168.4.1, 00:00:12, Serial1

R 192.168.1.0/24 [120/1] via 192.168.2.1, 00:00:10, Serial0

C 192.168.2.0/24 is directly connected, Serial0

C 192.168.3.0/24 is directly connected, Ethernet0

Page 91: Distance Vector Routing - RIP

Rick Graziani [email protected] 91

Baypointe 

01:34:53: RIP: sending v1 update to 255.255.255.255 via Ethernet0 (192.168.5.1)

01:34:53: network 192.168.4.0, metric 1

01:34:53: network 192.168.1.0, metric 3

01:34:53: network 192.168.2.0, metric 2

01:34:53: network 192.168.3.0, metric 2

01:34:53: RIP: sending v1 update to 255.255.255.255 via Serial0 (192.168.4.1)

01:34:53: network 192.168.5.0, metric 1

Baypointe#

01:34:56: RIP: received v1 update from 192.168.4.2 on Serial0

01:34:56: 192.168.1.0 in 2 hops

01:34:56: 192.168.2.0 in 1 hops

01:34:56: 192.168.3.0 in 1 hops

 

Baypointe#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default

U - per-user static route, o - ODR 

Gateway of last resort is not set

 

C 192.168.4.0/24 is directly connected, Serial0

C 192.168.5.0/24 is directly connected, Ethernet0

R 192.168.1.0/24 [120/2] via 192.168.4.2, 00:00:23, Serial0

R 192.168.2.0/24 [120/1] via 192.168.4.2, 00:00:23, Serial0

R 192.168.3.0/24 [120/1] via 192.168.4.2, 00:00:23, Serial0

Page 92: Distance Vector Routing - RIP

Rick Graziani [email protected] 92

NOTE: At this point all routers should be able to ping all networks. We will discuss RIP much more in the chapter on Routing Protocols (RIP).

 Step 4 – Turning-off debug Don’t forget to turn-off debug when you are done collecting the output. Router# undebug allorBaypointe# undebug ip rip  Step 5 – Reflections• For each router compare the RIP received messages with its routing table. Now you see

how the information is entered into the routing table.• Cisco IOS uses split horizon with poison reverse, however this information is not

displayed with debug ip rip command.• You will notice that the routers send RIP messages out their stub Ethernet interfaces,

even though there are no routers out there to receive those messages. This does take up unnecessary bandwidth on the link; so later we will see how to keep those RIP messages from going out those interfaces.

Scenario 1: Running RIPv1 on classful networks

Page 93: Distance Vector Routing - RIP

Rick Graziani [email protected] 93

SanJose2

hostname SanJose2

interface ethernet 0

ip add 172.30.1.1 255.255.255.0

interface serial 0

ip add 172.30.2.1 255.255.255.0

 

SanJose1

hostname SanJose1

interface ethernet 0

ip add 172.30.3.1 255.255.255.0

interface serial 0

ip add 172.30.2.2 255.255.255.0

interface serial 1

ip add 192.168.4.9 255.255.255.252

 

Baypointe

hostname Baypointe

interface ethernet 0

ip add 192.168.5.1 255.255.255.0

interface serial 0

ip add 192.168.4.10 255.255.255.252

Scenario 2: Running RIPv1 on subnets and between classful networks

Note: This lab has some important information regarding RIP and boundary routers!

Page 94: Distance Vector Routing - RIP

Rick Graziani [email protected] 94

Objective: Running RIPv1 on subnets and between classful networks

 

In this scenario we will see how subnetted routes are distributed with the same classful network. We will also see how RIPv1 automatically summarizes between classful network boundaries. You will notice that SanJose1 and SanJose2 have subnets belonging to the 172.30.0.0 network, but Baypointe does not.

 

Making changes between Scenario 1 and Scenario 2

 

Be sure to change the IP addressing as displayed in the diagram and Basic Configuration section for Scenario 2. Sometimes when changing the IP address on a serial interface, you may need to reset that interface by doing a shutdown, wait for the LINK-5-CHANGED message, then follow it with a no shutdown command.

 

If you have just completed Scenario 1, lets remove RIP by issuing the following command on each router:

 

Router(config)# no router rip

Scenario 2: Running RIPv1 on subnets and between classful networks

Page 95: Distance Vector Routing - RIP

Rick Graziani [email protected] 95

Step 1 – Configuring RIP

 

Once again, lets enable RIP on each router.

 

Once you are in the Router RIP configuration sub-mode, all you need to do is enter the classful network address for each directly connected network, using the network command. If a router has multiple interfaces on the same classful network, you will only need to enter a single command enabling RIP on all interfaces for that network.

Router(config-router)#network directly-connected-classful-network-address

 

Scenario 2: Running RIPv1 on subnets and between classful networks

Page 96: Distance Vector Routing - RIP

Rick Graziani [email protected] 96

Here are the commands for each router:

 

SanJose2#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

SanJose2(config)#router rip

SanJose2(config-router)#network 172.30.0.0

 

Notice we only used a single network statement for SanJose2, which includes both interfaces, on different subnets, of the 172.30.0.0 major network.

 

SanJose1#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

SanJose1(config)#router rip

SanJose1(config-router)#network 172.30.0.0

SanJose1(config-router)#network 192.168.4.0

 

Again, notice that we only used a single network statement for SanJose1, which includes both interfaces, on different subnets, of the 172.30.0.0 major network.

 

Baypointe#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Baypointe(config)#router rip

Baypointe(config-router)#network 192.168.4.0

Baypointe(config-router)#network 192.168.5.0

Page 97: Distance Vector Routing - RIP

Rick Graziani [email protected] 97

Question: What would happen if you entered a network statement that was a subnet? For example:

SanJose2(config)#router rip

SanJose2(config-router)#network 172.30.1.0

 

Answer: The IOS would automatically convert it to a classful network statement:

SanJose2#show running-config

router rip

network 172.30.0.0

Scenario 2: Running RIPv1 on subnets and between classful networks

Page 98: Distance Vector Routing - RIP

Rick Graziani [email protected] 98

Step 2 – Viewing the debug ip rip output and the routing tables SanJose2 SanJose2# debug ip rip00:14:10: RIP: received v1 update from 172.30.2.2 on Serial000:14:10: 172.30.3.0 in 1 hops00:14:10: 192.168.4.0 in 1 hops00:14:10: 192.168.5.0 in 2 hopsSanJose2#00:14:29: RIP: sending v1 update to 255.255.255.255 via Ethernet0 (172.30.1.1)00:14:29: subnet 172.30.2.0, metric 100:14:29: subnet 172.30.3.0, metric 200:14:29: network 192.168.4.0, metric 200:14:29: network 192.168.5.0, metric 300:14:29: RIP: sending v1 update to 255.255.255.255 via Serial0 (172.30.2.1)00:14:29: subnet 172.30.1.0, metric 1SanJose2#00:14:39: RIP: received v1 update from 172.30.2.2 on Serial000:14:39: 172.30.3.0 in 1 hops00:14:39: 192.168.4.0 in 1 hops00:14:39: 192.168.5.0 in 2 hopsSanJose2# undebug all SanJose2#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP <omitted> Gateway of last resort is not set  172.30.0.0/24 is subnetted, 3 subnetsC 172.30.2.0 is directly connected, Serial0R 172.30.3.0 [120/1] via 172.30.2.2, 00:00:08, Serial0C 172.30.1.0 is directly connected, Ethernet0R 192.168.4.0/24 [120/1] via 172.30.2.2, 00:00:08, Serial0R 192.168.5.0/24 [120/2] via 172.30.2.2, 00:00:08, Serial0

Page 99: Distance Vector Routing - RIP

Rick Graziani [email protected] 99

Reflections

• IMPORTANT INFORMATION: RIPv1 is a classful routing protocol. Classful routing protocols do not send the subnet mask with network in routing updates, ie. 172.30.1.0 is sent by SanJose1 to SanJose2 without any subnet mask information.

• QUESTION: Notice that SanJose2 is receiving the subnet 172.30.3.0 from SanJose1, which is put in the routing table under the parent network (classful network) of 172.30.0.0 with the /24 subnet mask (172.30.0.0/24 is subnetted, 3 subnets). Also notice that the RIP message received from SanJose1 was “172.30.3.0 in 1 hops” but did not include a subnet mask for the subnet. How does SanJose2 know that this subnet has a /24 (255.255.255.0) subnet mask?

• ANSWER: SanJose2 received this information on an interface belonging to the same classful network as the incoming 172.30.3.0 update. The IP address that SanJose1 received the “172.30.3.0 in 1 hops” message was on (Serial 0) with an IP address of 172.30.2.1 and a subnet mask of 255.255.255.0. SanJose2 uses its own subnet mask and applies it to this and all other 172.30.0.0 subnets it receives on this interface. The 172.30.3.0 network is placed with the other 172.30.0.0 /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 later (Cabrillo’s CCNA Sem 2 course and the CCNP Advanced Routing).

Scenario 2: Running RIPv1 on subnets and between classful networks

Page 100: Distance Vector Routing - RIP

Rick Graziani [email protected] 100

SanJose1 SanJose1#debug ip ripRIP protocol debugging is onSanJose1#00:17:52: RIP: sending v1 update to 255.255.255.255 via Ethernet0 (172.30.3.1)00:17:52: subnet 172.30.2.0, metric 100:17:52: subnet 172.30.1.0, metric 200:17:52: network 192.168.4.0, metric 100:17:52: network 192.168.5.0, metric 200:17:52: RIP: sending v1 update to 255.255.255.255 via Serial0 (172.30.2.2)00:17:52: subnet 172.30.3.0, metric 100:17:52: network 192.168.4.0, metric 100:17:52: network 192.168.5.0, metric 200:17:52: RIP: sending v1 update to 255.255.255.255 via Serial1 (192.168.4.9)00:17:52: network 172.30.0.0, metric 1SanJose1#00:18:10: RIP: received v1 update from 172.30.2.1 on Serial000:18:10: 172.30.1.0 in 1 hopsSanJose1#00:18:12: RIP: received v1 update from 192.168.4.10 on Serial100:18:12: 192.168.5.0 in 1 hopsSanJose1# undebug all SanJose1#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP <omitted> Gateway of last resort is not set  172.30.0.0/24 is subnetted, 3 subnetsC 172.30.2.0 is directly connected, Serial0C 172.30.3.0 is directly connected, Ethernet0R 172.30.1.0 [120/1] via 172.30.2.1, 00:00:14, Serial0 192.168.4.0/30 is subnetted, 1 subnetsC 192.168.4.8 is directly connected, Serial1R 192.168.5.0/24 [120/1] via 192.168.4.10, 00:00:10, Serial1 

Page 101: Distance Vector Routing - RIP

Rick Graziani [email protected] 101

Reflections

• The same subnet route information applies with routes sent from SanJose2 to SanJose1 (see Reflections for SanJose2).

• SanJose1 knows that the 172.30.1.0 update has a subnet mask of /24 because it received it on an interface with a /24 subnet mask (Serial 0, 172.30.3.2 255.255.255.0).

Scenario 2: Running RIPv1 on subnets and between classful networks

Page 102: Distance Vector Routing - RIP

Rick Graziani [email protected] 102

SanJose1#debug ip ripRIP protocol debugging is onSanJose1#00:17:52: RIP: sending v1 update to 255.255.255.255 via Ethernet0 (172.30.3.1)00:17:52: subnet 172.30.2.0, metric 100:17:52: subnet 172.30.1.0, metric 200:17:52: network 192.168.4.0, metric 100:17:52: network 192.168.5.0, metric 200:17:52: RIP: sending v1 update to 255.255.255.255 via Serial0 (172.30.2.2)00:17:52: subnet 172.30.3.0, metric 100:17:52: network 192.168.4.0, metric 100:17:52: network 192.168.5.0, metric 200:17:52: RIP: sending v1 update to 255.255.255.255 via Serial1 (192.168.4.9)00:17:52: network 172.30.0.0, metric 1SanJose1#00:18:10: RIP: received v1 update from 172.30.2.1 on Serial000:18:10: 172.30.1.0 in 1 hopsSanJose1#00:18:12: RIP: received v1 update from 192.168.4.10 on Serial100:18:12: 192.168.5.0 in 1 hopsSanJose1# undebug all SanJose1#show ip routeCodes: <omitted> Gateway of last resort is not set  172.30.0.0/24 is subnetted, 3 subnetsC 172.30.2.0 is directly connected, Serial0C 172.30.3.0 is directly connected, Ethernet0R 172.30.1.0 [120/1] via 172.30.2.1, 00:00:14, Serial0 192.168.4.0/30 is subnetted, 1 subnetsC 192.168.4.8 is directly connected, Serial1R 192.168.5.0/24 [120/1] via 192.168.4.10, 00:00:10, Serial1

Page 103: Distance Vector Routing - RIP

Rick Graziani [email protected] 103

More Reflections• IMPORTANT INFORMATION: Notice the RIP update being sent out Serial 1:RIP: sending v1 update to 255.255.255.255 via Serial1 (192.168.4.9) network 172.30.0.0, metric 1

• Compare that to the same information for the 172.30.0.0 network being sent out Serial 0 & Ethernet 0:

RIP: sending v1 update to 255.255.255.255 via Serial0 (172.30.2.2) subnet 172.30.3.0, metric 1

• Notice that the 172.30.0.0 subnets are being summarized to their classful network address of 172.30.0.0 when sent out Serial 1 to Baypointe.

• RIP automatically summarizes RIP updates between classful networks. Because the 172.30.0.0 update is being sent out an interface (Serial 1) on a different classful network (192.168.4.0), 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.

Scenario 2: Running RIPv1 on subnets and between classful networks

Page 104: Distance Vector Routing - RIP

Rick Graziani [email protected] 104

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 172.30.0.0/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 172.30.0.0 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 192.168.4.12/30 subnet, which also has other 172.30.0.0/24 subnets (172.30.4.0/24, 172.30.5.0/24, etc.). Baypointe would also receive the same 172.30.0.0 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.

Scenario 2: Running RIPv1 on subnets and between classful networks

Page 105: Distance Vector Routing - RIP

Rick Graziani [email protected] 105

Baypointe 

Baypointe#debug ip rip

RIP protocol debugging is on

Baypointe#

00:20:09: RIP: received v1 update from 192.168.4.9 on Serial0

00:20:09: 172.30.0.0 in 1 hops

Baypointe#

00:20:24: RIP: sending v1 update to 255.255.255.255 via Ethernet0 (192.168.5.1)

00:20:24: network 172.30.0.0, metric 2

00:20:24: network 192.168.4.0, metric 1

00:20:24: RIP: sending v1 update to 255.255.255.255 via Serial0 (192.168.4.10)

00:20:24: network 192.168.5.0, 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 172.30.0.0/16 [120/1] via 192.168.4.9, 00:00:11, Serial0

192.168.4.0/30 is subnetted, 1 subnets

C 192.168.4.8 is directly connected, Serial0

C 192.168.5.0/24 is directly connected, Ethernet0

Page 106: Distance Vector Routing - RIP

Rick Graziani [email protected] 106

Reflections

• Notice that Baypointe is only receiving the classful summary of the 172.30.0.0 subnets:

RIP: received v1 update from 192.168.4.9 on Serial0

172.30.0.0 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 172.30.0.0 network on SanJose1 and SanJose2 from affecting Baypointe. In other words, SanJose1 and SanJose2 can add and delete 172.30.0.0/24 subnets without affecting Baypointe’s routing table, as Baypointe doesn’t care. Baypointe will send all packets destined for the 172.30.0.0/16 network to SanJose1. Baypointe’s routing table:

R 172.30.0.0/16 [120/1] via 192.168.4.9, 00:00:11, Serial0

Also, the subnet mask scheme could be changed (i.e. to /27) on the 172.30.0.0 network without affecting Baypointe’s routing table or the RIP update sent to Baypointe by SanJose1.

Scenario 2: Running RIPv1 on subnets and between classful networks

Page 107: Distance Vector Routing - RIP

Rick Graziani [email protected] 107

Scenario 3: Running RIPv1 on a stub network

SanJose2

hostname SanJose2

interface ethernet 0

ip add 172.30.1.1 255.255.255.0

interface serial 0

ip add 172.30.2.1 255.255.255.0

 

SanJose1

hostname SanJose1

interface ethernet 0

ip add 172.30.3.1 255.255.255.0

interface serial 0

ip add 172.30.2.2 255.255.255.0

interface serial 1

ip add 192.168.4.9 255.255.255.252

 

Baypointe

hostname Baypointe

interface ethernet 0

ip add 192.168.5.1 255.255.255.0

interface serial 0

ip add 192.168.4.10 255.255.255.252

Page 108: Distance Vector Routing - RIP

Rick Graziani [email protected] 108

Objective: Running RIPv1 on a stub network

 

In this scenario we will modify Scenario 2 to only run RIP between SanJose1 and SanJose2. Scenario 3 is a very common situation for many companies. It is very common that a company will want to run a dynamic routing protocol (RIPv1 in our case) within their own network, but find in unnecessary to run a dynamic routing protocol between their company and their ISP.

 

For Scenario 3 let us assume that Baypointe is the ISP for our Company XYZ, which consists of the SanJose1 and SanJose2 routers using the 172.30.0.0/16 major network, subnetted with a /24 mask.

 

Company XYZ is a stub network, meaning there is only one way in and out of the 172.30.0.0/16 network, in via SanJose1 (a.k.a. the entrance router) and out via Baypointe (the ISP). It is doesn’t make sense for SanJose1 to send Baypointe the RIP update of 172.30.0.0 every 30 seconds, because Baypointe has no other way to get there. RIP update message from SanJose1 to Baypointe, if RIP were configured:

RIP: received v1 update from 192.168.4.9 on Serial0

172.30.0.0 in 1 hops 

Instead, it makes more sense for Baypointe to have a static route configured for the 172.30.0.0/16 network via SanJose1.

 

Well, how about traffic from Company XYZ towards the Internet? It makes no sense for Baypointe to send more than the 120,000 summarized Internet routes to SanJose1. All SanJose1 needs to know is that if it is not in the 172.30.0.0 network then send it to the ISP, Baypointe. This is the same for all other Company XYZ routers (only SanJose2 in our case), that they would send all traffic with destination IP addresses other than 172.30.0.0 to SanJose1 who would forward them on to Baypointe.  Let’s see how to configure this.

Page 109: Distance Vector Routing - RIP

Rick Graziani [email protected] 109

Making changes between Scenario 2 and Scenario 3

 

Be sure to change the IP addressing as displayed in the diagram and Basic Configuration section for Scenario 3. Sometimes when changing the IP address on a serial interface, you may need to reset that interface by doing a shutdown, wait for the LINK-5-CHANGED message, then follow it with a no shutdown command.

 

If you have just completed Scenario 2, lets remove RIP by issuing the following command on each router:

 

Router(config)# no router rip

Page 110: Distance Vector Routing - RIP

Rick Graziani [email protected] 110

Step 1 – Configuring RIP on SanJose1 and SanJose2

 

Here are the commands for each router:

 

SanJose2#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

SanJose2(config)#router rip

SanJose2(config-router)#network 172.30.0.0

 

SanJose1#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

SanJose1(config)#router rip

SanJose1(config-router)#network 172.30.0.0

 

Notice that we are only including the 172.30.0.0 interfaces, networks, for SanJose1. We will not be exchanging RIP updates with Baypointe via the 192.168.4.0/30 network.

Page 111: Distance Vector Routing - RIP

Rick Graziani [email protected] 111

Step 2 - Configuring the default static route on SanJose1

 

On SanJose1, let’s configure a static default route, sending all default traffic, packets with destination IP addresses which do not match a specific route in the routing table, to Baypointe. 

SanJose1(config)# ip route 0.0.0.0 0.0.0.0 serial 1

 

Notice, since the exit interface is a point-to-point serial interface we chose to use the exit-interface instead of a intermediate-address (next-hop-ip address), saving the router from having to do a recursive lookup. However, using an intermediate-address (next-hop-ip-address) would have worked also.

 

Previous to IOS version 12.1, SanJose1 would propagate, send, this default route automatically via RIP with its RIP updates to all other routers (in this case SanJose2). SanJose2 and all other routers will receive this default route via RIP and forward to all other routers in the RIP routing domain.

 

However, with IOS 12.1 and later, we need to enter the default-information originate command on Baypointe, the router with the static default route. This will tell SanJose1 to include the static default route with its RIP updates to SanJose2. 

SanJose1(config)#router rip

SanJose1(config-router)#default-information originate

Page 112: Distance Vector Routing - RIP

Rick Graziani [email protected] 112

Step 3 - Configuring the static route on Baypointe for the 172.30.0.0/16 network

 

Since Baypointe and SanJose1 are not exchanging RIP updates, we need to configure a static route on Baypointe for the 172.30.0.0/16 network. This will send all 172.30.0.0/16 traffic, packets with destination IP addresses of 172.30.x.x, to SanJose1.

 

Baypointe(config)# ip route 172.30.0.0 255.255.0.0 serial 0

 

Once again, notice, since the exit interface is a point-to-point serial interface we chose to use the exit-interface instead of a intermediate-address (next-hop-ip address), saving the router from having to do a recursive lookup. However, using an intermediate-address (next-hop-ip-address) would have worked also.

Page 113: Distance Vector Routing - RIP

Rick Graziani [email protected] 113

SanJose1

SanJose1#debug ip rip

RIP protocol debugging is on

SanJose1#

02:09:10: RIP: received v1 update from 172.30.2.1 on Serial0

02:09:10: 172.30.1.0 in 1 hops

SanJose1#

02:09:29: RIP: sending v1 update to 255.255.255.255 via Ethernet0 (172.30.3.1)

02:09:29: subnet 172.30.2.0, metric 1

02:09:29: subnet 172.30.1.0, metric 2

02:09:29: default, metric 1

02:09:29: RIP: sending v1 update to 255.255.255.255 via Serial0 (172.30.2.2)

02:09:29: subnet 172.30.3.0, metric 1

02:09:29: default, metric 1

SanJose1#

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 0.0.0.0 to network 0.0.0.0

 

172.30.0.0/24 is subnetted, 3 subnets

C 172.30.2.0 is directly connected, Serial0

C 172.30.3.0 is directly connected, Ethernet0

R 172.30.1.0 [120/1] via 172.30.2.1, 00:00:13, Serial0

192.168.4.0/30 is subnetted, 1 subnets

C 192.168.4.8 is directly connected, Serial1

S* 0.0.0.0/0 is directly connected, Serial1

Page 114: Distance Vector Routing - RIP

Rick Graziani [email protected] 114

Reflections

• Notice that the static default route is being propagated by SanJose1 to other routers (SanJose2) via RIP.

• Notice the static route in the routing table and the “Gateway of last resort.”

Scenario 3: Running RIPv1 on a stub network

Page 115: Distance Vector Routing - RIP

Rick Graziani [email protected] 115

SanJose2

 SanJose2#debug ip rip

RIP protocol debugging is on

SanJose2#

02:07:06: RIP: received v1 update from 172.30.2.2 on Serial0

02:07:06: 172.30.3.0 in 1 hops

02:07:07: 0.0.0.0 in 1 hops

SanJose2#

02:07:23: RIP: sending v1 update to 255.255.255.255 via Ethernet0 (172.30.1.1)

02:07:23: subnet 172.30.2.0, metric 1

02:07:23: subnet 172.30.3.0, metric 2

02:07:23: default, metric 2

02:07:23: RIP: sending v1 update to 255.255.255.255 via Serial0 (172.30.2.1)

02:07:23: subnet 172.30.1.0, metric 1

SanJose2#

SanJose2#undebug all

 

SanJose2#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

<omitted>

i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default

U - per-user static route, o - ODR

Gateway of last resort is 172.30.2.2 to network 0.0.0.0 

172.30.0.0/24 is subnetted, 3 subnets

C 172.30.2.0 is directly connected, Serial0

R 172.30.3.0 [120/1] via 172.30.2.2, 00:00:22, Serial0

C 172.30.1.0 is directly connected, Ethernet0

R* 0.0.0.0/0 [120/1] via 172.30.2.2, 00:00:22, Serial0

Page 116: Distance Vector Routing - RIP

Rick Graziani [email protected] 116

Reflections

• Notice that SanJose2 is receiving the default route from SanJose1.

• SanJose2 forwards that default route out Ethernet 0, a RIP enabled interface, although there are no other routers on that segment.

• Notice the default route in the routing table and that it was learned via RIP.

• Notice the “Gateway of last resort” 

Scenario 3: Running RIPv1 on a stub network

Page 117: Distance Vector Routing - RIP

Rick Graziani [email protected] 117

Baypointe

  

No RIP messages, as we are not running RIP.

 

Baypointe#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default

U - per-user static route, o - ODR

 

Gateway of last resort is not set

 

S 172.30.0.0/16 is directly connected, Serial0

192.168.4.0/30 is subnetted, 1 subnets

C 192.168.4.8 is directly connected, Serial0

C 192.168.5.0/24 is directly connected, Ethernet0

Reflections

• Notice that RIP is not being used on Baypointe. The only routes that are not directly-connected is the static route.

Page 118: Distance Vector Routing - RIP

Rick Graziani [email protected] 118

show ip protocols command  SanJose2 router from Scenario 3. SanJose2#show ip protocolsRouting Protocol is "rip" Sending updates every 30 seconds, next due in 11 seconds Invalid after 180 seconds, hold down 180, flushed after 240 Outgoing update filter list for all interfaces is Incoming update filter list for all interfaces is Redistributing: rip Default version control: send version 1, receive any version Interface Send Recv Key-chain Ethernet0 1 1 2 Serial0 1 1 2 Routing for Networks: 172.30.0.0 Routing Information Sources: Gateway Distance Last Update 172.30.2.2 120 00:00:04 Distance: (default is 120)SanJose2#

  Be sure to understand this command. We will examine it again when we take a closer look at RIPv1,

RIPv2 and IGRP. Take a look at the items in bold and make sure you understand them.

Scenario 3: Running RIPv1 on a stub network

Page 119: Distance Vector Routing - RIP

Rick Graziani [email protected] 119

A Few Final Notes 

 RIP uses broadcasts

• Notice that RIPv1 sends out its RIP updates via an IP broadcast.

02:07:23: RIP: sending v1 update to 255.255.255.255 via Ethernet0 (172.30.1.1)

All devices on the segment will see these RIP updates.

  

The passive-interface command

• How can you keep a RIP update from being sent out an interface which does not have any other routers? (i.e The Ethernet interfaces in our network.)

• Because the network statement includes all interfaces which have an IP address on that classful network, by default RIP will send out updates out each one of those interfaces.

• Do keep RIP from sending updates out an interface which does not have any other routers, you can use the passive-interface command.

• The passive-interface command allows the interface to receive RIP updates on the interface, but does not send RIP updates out that interface.

• For example, to keep SanJose2 from sending out RIP updates out Ethernet 0, you can do the following:

SanJose2(config)#router rip

SanJose2(config-router)#network 172.30.0.0

SanJose2(config-router)#passive-interface Ethernet 0

Page 120: Distance Vector Routing - RIP

Rick Graziani [email protected] 120

What is with the /30 network?

• /30 or 255.255.255.252 subnet masks are quite common on serial links.

• A /30 subnet mask helps maximize the hosts addresses, which is perfect for a point-to-point serial link, allowing the following for each subnet:

– 1 network address– 2 host addresses– 1 broadcast address 

IP Class: C IP Address: 192.168.4.0

Mask Bits: 6 Subnet Mask: 255.255.255.252

Subnets: 62+1 IP Major Net: 192.168.4.0

Hosts/Subnet: 2 Major Net Bcast: 192.168.4.255 

Subnets for Fixed Length Subnet Masking

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

No. Subnet Hosts Hosts Broadcast Address From To Address 

0 192.168.4.0 192.168.4.1 192.168.4.2 192.168.4.3

1 192.168.4.4 192.168.4.5 192.168.4.6 192.168.4.7

2 192.168.4.8 192.168.4.9 192.168.4.10 192.168.4.11

3 192.168.4.12 192.168.4.13 192.168.4.14 192.168.4.15

4 192.168.4.16 192.168.4.17 192.168.4.18 192.168.4.19

5 192.168.4.20 192.168.4.21 192.168.4.22 192.168.4.23

6 192.168.4.24 192.168.4.25 192.168.4.26 192.168.4.27

7 192.168.4.28 192.168.4.29 192.168.4.30 192.168.4.31

8 192.168.4.32 192.168.4.33 192.168.4.34 192.168.4.35

9 192.168.4.36 192.168.4.37 192.168.4.38 192.168.4.39

<omitted>

61 192.168.4.244 192.168.4.245 192.168.4.246 192.168.4.247

62 192.168.4.248 192.168.4.249 192.168.4.250 192.168.4.251

63 192.168.4.252 192.168.4.253 192.168.4.254 192.168.4.255  

Page 121: Distance Vector Routing - RIP

Rick Graziani [email protected] 121

How can I remove a single network from RIP?

 

Instead of using the following command to remove all networks from RIP:

Router(config)# no router rip

 

You can specify just the network you wish to remove by using the no network command, for example:

Router(config)#router rip

Router(config-router)#no network 172.30.0.0

  

Debug ip routing - FYI

 

        If you wish to see what is happening in the router’s routing table process, you can use the debug ip routing command: 

SanJose2#debug ip routing

IP routing debugging is on

SanJose2#conf t

Enter configuration commands, one per line. End with CNTL/Z.

SanJose2(config)#router rip

SanJose2(config-router)#network 172.30.0.0

SanJose2(config-router)#

00:15:03: RT: add 172.30.3.0/24 via 172.30.2.2, rip metric [120/1]

00:15:03: RT: add 0.0.0.0/0 via 172.30.2.2, rip metric [120/1]

00:15:03: RT: default path is now 0.0.0.0 via 172.30.2.2

00:15:03: RT: new default network 0.0.0.0

Page 122: Distance Vector Routing - RIP

Rick Graziani [email protected] 122

End of Part I

• End of Part I

• See Part II for IGRP