routing table look up process

25
The Routing Table Lookup Process - Understanding ip classless CCNA/CCNP Rick Graziani Cabrillo College

Upload: baraynavab

Post on 12-Nov-2014

7.536 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Routing Table Look Up Process

The Routing Table Lookup Process- Understanding ip classless

CCNA/CCNP

Rick Graziani

Cabrillo College

Page 2: Routing Table Look Up Process

Rick Graziani [email protected]

The IP Routing Table

• This information and much more 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) 

• Note: There is much more in depth information in the documents above and you are encouraged to read them.

Page 3: Routing Table Look Up Process

Rick Graziani [email protected]

Classful and Classless: Routing Behavior versus Routing Protocol

Notes:

• Classful or classless routing behavior has nothing to do with classful or classless routing protocols.

Routing Protocol

• Classful/Classless routing protocols are only concerned about how the routes get into the table. (Building the routing table.)

Routing Behavior (nothing to do with Routing Protocol)

• Classful/Classless routing behavior has to do with the lookup process within the routing table AFTER the routes have entered the routing table. (Looking up routes in the routing table).

Page 4: Routing Table Look Up Process

Rick Graziani [email protected] 4

Directly Connected Networks

RouterB#show ip routeCodes: 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, ia - IS-IS inter

area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static route Gateway of last resort is not set RouterB#

Router B Router CRouter A

s0 s0 s0s1

fa0 fa0 fa0

172.16.1.0/24

172.16.2.0/24

172.16.3.0/24 172.16.4.0/24

192.168.1.0/24.1

.1 .2

.1

.1

.1

.2

Page 5: Routing Table Look Up Process

Rick Graziani [email protected] 5

Directly Connected Networks

RouterB#debug ip routing

RouterB(config)#interface s 1

RouterB(config-if)#ip add 192.168.1.1 255.255.255.0

RouterB(config-if)#no shutdown

00:59:48: %LINK-3-UPDOWN: Interface Serial1, changed state to up

00:59:48: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1, changed state

to up

00:59:48: RT: add 192.168.1.0/24 via 0.0.0.0, connected metric [0/0]

00:59:48: RT: interface Serial1 added to routing table

RouterB(config-if)#end

RouterB#undebug all

All possible debugging has been turned off

RouterB#

Page 6: Routing Table Look Up Process

Rick Graziani [email protected] 6

Directly Connected Networks

RouterB#show ip route

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

<text omitted>

 

Gateway of last resort is not set

 

C 192.168.1.0/24 is directly connected, Serial1

RouterB#

Ultimate Routes

• Routes with masks equal to or less than default classful mask (includes supernet routes.

Page 7: Routing Table Look Up Process

Rick Graziani [email protected] 7

Creating a Parent/Child Route

RouterB(config)#interface fastethernet 0RouterB(config-if)#ip add 172.16.3.1 255.255.255.0RouterB(config-if)#no shutdown01:21:11: RT: add 172.16.3.0/24 via 0.0.0.0, connected metric [0/0]01:21:11: RT: interface FastEthernet0 added to routing tableRouterB(config-if)#endRouterB#undebug allAll possible debugging has been turned offRouterB#RouterB#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile,<text omitted> Gateway of last resort is not set  172.16.0.0/24 is subnetted, 1 subnetsC 172.16.3.0 is directly connected, FastEthernet0C 192.168.1.0/24 is directly connected, Serial1RouterB#

Page 8: Routing Table Look Up Process

Rick Graziani [email protected] 8

Parent, Child, Ultimate Routes

So far on Router B:

Parent Route: 172.16.0.0/24 is subnetted, 1 subnets

Child Route: C 172.16.3.0 is directly connected, FastEthernet0

Ultimate Route: C 192.168.1.0/24 is directly connected, Serial1

Router B Router CRouter A

s0 s0 s0s1

fa0 fa0 fa0

172.16.1.0/24

172.16.2.0/24

172.16.3.0/24 172.16.4.0/24

192.168.1.0/24.1

.1 .2

.1

.1

.1

.2

Page 9: Routing Table Look Up Process

Rick Graziani [email protected] 9

Creating Another Child Route

RouterB(config)#inter s 0

RouterB(config-if)#ip add 172.16.2.2 255.255.255.0

RouterB(config-if)#end

 

RouterB#show ip route

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

<text omitted>

 

Gateway of last resort is not set

 

172.16.0.0/24 is subnetted, 2 subnets

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

RouterB#

Page 10: Routing Table Look Up Process

Rick Graziani [email protected] 10

Same structure no matter the source of route

RouterB#show ip route

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

<text omitted>

 

Gateway of last resort is not set

 

172.16.0.0/24 is subnetted, 4 subnets

S 172.16.4.0 is directly connected, Serial1

R 172.16.1.0 [120/1] via 172.16.2.1, 00:00:08, Serial0

C 172.16.2.0 is directly connected, Serial0

C 172.16.3.0 is directly connected, FastEthernet0

10.0.0.0/16 is subnetted, 1 subnets

S 10.1.0.0 is directly connected, Serial1

C 192.168.1.0/24 is directly connected, Serial1

S 192.168.100.0/24 is directly connected, Serial1

RouterB#

Page 11: Routing Table Look Up Process

Rick Graziani [email protected] 11

New Topology and Examples

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

Page 12: Routing Table Look Up Process

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.

Ultimate Routes

• Routes with masks equal to or less than default classful mask (includes supernet routes.

Page 13: Routing Table Look Up Process

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 14: Routing Table Look Up Process

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.

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 15: Routing Table Look Up Process

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 16: Routing Table Look Up Process

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 17: Routing Table Look Up Process

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 18: Routing Table Look Up Process

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 19: Routing Table Look Up Process

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

RouterB(config)# no ip classlessA Graphical Look! The Roach Router Motel• This might help you remember the difference between the no ip classless and the ip

classless command (and then again, maybe not )• no ip classless: “The packets get in, but they can’t get out.” • Once the lookup process enters, because of the parent-bait, they never look any further.

(Looks for a match within the child routes.)• Note: They only enter if there is a match with the parent-bait.

Page 20: Routing Table Look Up Process

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.1RouterB(config)# no ip classless

RouterB#ping 172.26.4.1

Sending 5, 100-byte ICMP Echoes to 172.16.4.1, timeout is 2 seconds:

.....

Success rate is 0 percent (0/5)

Page 21: Routing Table Look Up Process

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

RouterB(config)# ip classlessThe Roach Router Motel – There’s a hole!• ip classless: “The packets get in, and they have a way out.” • Once the lookup process enters, because of the parent-bait, they can look

further in the routing table if there is no match. • If there is a match, the process ends, else the process continues looking for a

default or supernet route.• Again, they only enter if there is a match with the parent-bait.

Page 22: Routing Table Look Up Process

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

RouterB(config)# ip classless

RouterB#ping 172.16.4.1Sending 5, 100-byte ICMP Echoes to 172.16.4.1, timeout is 2

seconds:!!!!!Success rate is 100 percent (5/5),round-trip

min/avg/max=56/57/60 ms

Page 23: Routing Table Look Up Process

Rick Graziani [email protected]

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.

Page 24: Routing Table Look Up Process

Rick Graziani [email protected]

Classful and Classless: Routing Behavior versus Routing Protocol

Notes:

• Classful or classless routing behavior has nothing to do with classful or classless routing protocols.

Routing Protocol

• Classful/Classless routing protocols are only concerned about how the routes get into the table. (Building the routing table.)

Routing Behavior (nothing to do with Routing Protocol)

• Classful/Classless routing behavior has to do with the lookup process within the routing table AFTER the routes have entered the routing table. (Looking up routes in the routing table).

Page 25: Routing Table Look Up Process

The Routing Table Lookup Process- Understanding ip classless

CCNA/CCNP

Rick Graziani

Cabrillo College