The CISCO IP Routing Process: White Paper
The CISCO IP Routing Process: White Paper
by
Alexander Marhold
CCIE #3324, CCSI #20642, CCNP, CCDP
route-map map-tag [permit | deny] [sequence-number] FOR POLICY ROUTING
match ip address {access-list-number | name} [...access-list-number | name]
The CISCO Routing Process
match length min max including POLICY Routing
Policy Routing
on incoming interface
set ip next-hop ip-address [...ip-address] DATA Packets
set interface type number [...type number]
selected by: Output Access-list
Input Access-list
NAT / PAT Queueing
NAT ip policy route-map map-tag Accounting
DATA no match
or deny or Recursive Lookup
set default interface type number [... type number] OUTGOING to same protocol
set ip default next-hop ip-address [...ip-address]
S ... Static
C ... Connected
offset-list {access-list-number | name} in offset [type number] x .... dynamic routing
Route-TAGs
distance weight [address mask [access-list-number | name]] Route-TAGs
distribute-list {access-list-number | name} in [type number] OUTGOING coming from other protocol
passive-interface type number (only for Link State and EIGRP)
ip access-group {access-list-number | name} in
( for selected protocol)
distribute-list {access-list-number | name} out
Metric [routing-process |autonomous-system-number]
Incoming Outgoing
ROUTE Information Routes
Route Processing Route Processing
Routing Updates
Other Network
Information sources
Static Routes
OSPF
Eth ernet
Connected Interfaces
DATA Packets
Output Access-list
Input Access-list
NAT / PAT Queueing
NAT
Accounting
DATA
Recursive Lookup
Routing Table
S ... Static
C ... Connected
x .... dynamic routing
Process CLASSFUL and CLASSLESS are behaviors for What is "Gateway of last Resort",
using the default route when information about a default-network, ip route [Link] [Link] ?
specific subnet is not in the routing table, but
Packets are forwarded downstream a path other subnets of that mayor network are found IP Default-Network [Link] - This
from the sender to the receiver. in the routing table. is the command that will cause a router to treat
Route information (information about the [Link] as a gateway of last resort. A
reachability of a network) is forwarded Example: router can have multiple ip default-networks
UPSTREAM from router to router. entered.
# show ip route (edited output)
This is important to consider when using … Gateway of last resort - This is the term that
blocking of routing information in order to network [Link]/16 is subnetted is applied to a routing entry in the Cisco routing
prevent access to certain networks. 2 subnets, 2 masks table that the router will use to forward packets
R [Link]/24 [120/2] [Link] eth0
R [Link]/20 [120/4] [Link] ser0
to when it lacks a more specific route. This can
The packet forwarding is done by an … be learned from a route provided by another
independent decision of each router on the path, *S [Link]/0 [0/0] [Link] ser1 router that is tagged as a default by the
using the destination address of the packet and advertising router. The ip default-network
the Routing Table as basis for finding a next-hop. The router now receives a packet on eth1 with command is one way of having a router tag a
the destination address [Link] route as a gateway of last resort.
The router will consult the routing table (or a
special forwarding table, based on the content of This address belonging to a specific subnet of IP Default-Gateway - This command is used
the routing table), comparing the destination [Link]/16 is NOT in the routing table. in routers when IP routing disabled in order to
address with the network information in the give them an address to forward packets that are
routing table and will use the most specific - With IP CLASSLESS the router will take not in their address space. Routers in boot mode
network information for a decision about the the default route and forward the packet are a good example of this situation.
outgoing path. out on Serial 1. This is done independent of
The lookup process can be recursive, that any other subnet information for that IP ROUTE [Link] [Link] establishes a default
means, that more than one lookup may be mayor network [Link]/16. route (catch-all) if no specific route is found
needed in order to find the real next-hop-address
for forwarding the packet. - When CLASSFUL routing with the !!! CAVEAT !!!
If such a next-hop or an outgoing interface is command:
NO IP CLASSLESS is selected, The [Link] route has special meaning for RIP. It is
found the router will forward the packet on the automatically installed as the local gateway of last resort. No
specified connected interface. the router would delete the packet and ip default-network [Link] is required. RIP automatically
If no route is found and also no default-route is inform the sender via ICMP that he cannot advertises the route to [Link] even if redistribute static and
available or appropriate, the router will delete forward the packet as the specified subnet a default metric are not configured.
of the mayor network [Link]/16 is not For other routing protocols the router command:
the packet and inform the sender via ICMP about DEFAULT-INFORMATION … allows specific control of
this happening. in his table. forwarding or receiving default routes
Policy Routing
on incoming interface
set ip next-hop ip-address [...ip-address] DATA Packets
set interface type number [...type number]
selected by: Output Access-list
Input Access-list
NAT / PAT Queueing
NAT ip policy route-map map-tag Accounting
DATA no match
or deny or Recursive Lookup
set default interface type number [... type number]
set ip default next-hop ip-address [...ip-address]
Routing Table
S .. Static
C.. Connected
x .... dynamic routing
Internet [Link].
FR
IP POLICY ROUTE-MAP route-map-name ISL
PIX-to-OUT
Routing Table
S.. Sta tic
C ... Connecte d
x .. dynamic routin g
Route-TAGs
Route-TAGs
Metric
Incoming Outgoing
ROUTE In fo rmation Route s
Route Processing Route Processing
Metric
Incoming
ROUTE In fo rmatio n
Route Processing
Administrative Distance
INCOMING from LOCAL
0 Connecte d
1 Sta tic Route
5 EIG RP Summary
ip route prefix mask {address | 20 Exte rnal BGP
inte rfa ce} [d is ta nce] [ta g ta g] 90 Inte rnal EIG RP
[permanent] 100 IGRP
and fr om connected in te rfa ces 110 OSPF
115 IS-IS
120 RIP
170 Exte rnal EIG RP
200 Inte rnal BGP
255 <don´t use>
distr ib ute -lis t {access-lis t- number | name} out [in te rfa ce-name]
passiv e-in te rface type number
offs et-lis t {access-lis t- number | name} out
Routing Table offs et [ty pe number]
S .. Static
C .. Connecte d
x .. dynamic routin g
Route-TAGs
OUTGOING coming from other protocol
Outgoing
Route s
Route Processing
Metric
OUTGOING to another protocol
redis tr ib ute proto col [p rocess-id] {le vel- 1 | le vel- 1-2 | level-2} [metr ic
metr ic -value] [metr ic-ty pe ty pe-valu e] [m atc h {in te rnal | exte rnal 1 |
exte rnal 2}] [ta g ta g-value] [r oute -map map-ta g] [w eig ht weight] [s ubnets ]
defa ult- in fo rmatio n redistr ib utio n:
defa ult- in fo rmatio n orig in ate [a lw ays] [metric metr ic -valu e] [metr ic -ty pe ty pe-
valu e] {le vel- 1 | le vel- 1-2 | le vel-2} [r oute -map map-name] (RIP/O SPF)
defa ult- in fo rmatio n {in | out} {access-lis t- number | name} (IG RP/EIG RP)
before
shutdown 3 hops
3
RIP
R5 R3
1999, PRO IN Consulting GmbH Page 15 of 18
1
of 1 hop after shutdown of
R2-R3
route-map map-tag [permit | deny] [sequence-number] FOR POLICY ROUTING
match ip address {access-list-number | name} [...access-list-number | name]
The CISCO Routing Process
match length min max including POLICY Routing
Policy Routing
on incoming interface
set ip next-hop ip-address [...ip-address] DATA Packets
set interface type number [...type number]
selected by: Output Access-list
Input Access-list
NAT / PAT Queueing
NAT ip policy route-map map-tag Accounting
DATA no match
or deny or Recursive Lookup
set default interface type number [... type number] OUTGOING to same protocol
set ip default next-hop ip-address [...ip-address]
S ... Static
C ... Connected
offset-list {access-list-number | name} in offset [type number] x . .. dynamic routing
Route-TAGs
distance weight [address mask [access-list-number | name]] Route-TAGs
distribute-list {access-list-number | name} in [type number] OUTGOING coming from other protocol
passive-interface type number (only for Link State and EIGRP)
ip access-group {access-list-number | name} in
( for selected protocol)
distribute-list {access-list-number | name} out
Metric [routing-process |autonomous-system-number]
Incoming Outgoing
ROUTE Information Routes
Route Processing Route Processing
Link-state protocols discover neighboring routers by sending HELLO packets that help establish and maintain these adjacencies. For a connection to be established, several parameters must match between routers, such as having the same IP subnet, equal network type, and the same timer values. Once these conditions are verified, routers acknowledge each other's presence and proceed to exchange more detailed routing information using Link State Packets (LSPs).
In distance vector protocols, a passive interface stops the sending of routing updates over a specific interface, but does not prevent the reception of such updates. In contrast, link state protocols use passive interfaces to entirely block the establishment of adjacencies, thereby halting both outgoing and incoming link state announcements over that interface. This results in the connected network being treated as a stub network, advertised over other interfaces but not participating in dynamic routing updates on the passive interface itself, which can be advantageous for maintaining stable network boundaries and reducing unnecessary protocol chatter .
In the packet forwarding process, recursive lookup occurs when a router must perform multiple lookups in the routing table to determine the next-hop address for packet forwarding. Initially, the router checks its routing table to find the most specific match to the destination address. If this result does not immediately provide a next-hop address or an interface, the router may need to perform additional lookups using intermediate routing entries until it resolves the actual outgoing interface or next-hop IP address. This process ensures that packets are correctly forwarded along the optimal path based on current routing information .
Administrative distance is a value used by routers to select the best path when multiple routes to the same destination are available. It represents the trustworthiness of a source of routing information, with lower values indicating more trusted routes. This mechanism allows the router to prioritize routes from more reliable sources, such as static routes (which generally have the lowest distance) over dynamically learned routes, influencing both routing decisions and the stability of the network .
Link state protocols manage routing tables by employing Link State Packets (LSPs) to distribute detailed network topology information among routers. Each router generates its LSP containing data about its local connections, neighboring routers, and external routes. These packets are propagated throughout the network area, allowing each router to construct its complete view of the network topology. Using algorithms like Dijkstra's shortest-path, each router independently calculates the most efficient path to each destination. This method ensures optimal path selection and network resource utilization, leading to quicker convergence and a more resilient network infrastructure .
The split-horizon rule is a technique used to prevent routing loops in distance vector routing protocols. It prevents a router from sending updates about a route back through the interface from which the update was received. This rule ensures that routing information does not loop back on itself, reducing routing loops and enhancing the convergence time of the network. By preventing updates from being sent out the same interface they were received on, split-horizon maintains a more stable and efficient routing environment .
Classful and classless routing differ primarily in how they handle default routes when specific subnet information is not available in the routing table. Classful routing does not utilize the default route when a specific subnet is missing, but other subnets of the major network are present, leading to potential packet drops. Conversely, classless routing uses the default route to forward packets even if specific subnet information is absent, allowing continuous packet forwarding despite missing subnets. Classless routing is more flexible and efficient, as it can use any subnet information to make forwarding decisions .
Static routes, when used with external routing protocols, require careful consideration due to differences in administrative distance and potential for routing loops. Route redistribution allows static routes to enter into other routing protocols, converting them to the appropriate protocol metrics and information. However, issues can arise if these static routes, often set for quick fixes, possess a lower administrative distance, leading to network instability and suboptimal path selection. Additionally, improper configuration of static routes in redistribution can lead to looping and reachability problems, underlining the importance of comprehensive planning and consistent metric application across protocols .
A network is advertised in outgoing routing updates if it is present in the routing table and meets several conditions: it's specified via the NETWORK command or comes from another protocol through a redistribution command, follows the split-horizon rule, is not excluded by access lists or route maps, and is sent out over a non-passive interface. The distribute-list command can further refine these updates by filtering networks based on access lists, ensuring that only approved routes are propagated to neighboring routers. This control mechanism helps in tailoring routing updates to specific network policies and security requirements .
For distance vector protocols, the passive-interface command prevents the router from sending routing updates on the specified interface, but it does not stop the router from receiving updates through that interface. In contrast, for link state protocols and EIGRP, the command prevents the establishment of adjacencies and the sending of any link state packets, effectively halting both the sending and receiving of routing information on that interface .