Introduction To Routing
Introduction To Routing
These materials are licensed under the Creative Commons Attribution-NonCommercial 4.0 International license
(http://creativecommons.org/licenses/by-nc/4.0/)
172.16.0.0/16
Packet: Destination R3 announced
IP address: 172.16.1.1 from here
R1 R2
172.16.0.0/16
Packet: Destination R3 announced
IP address: 172.16.1.1 from here
R1 R2
R2’s IP routing table
R4
172.16.0.0/16 R3 172.16.1.1
172.16.1.0/24
172.16.1.0/24 R4 exists inside
172.16.0.0/16 announced from
172.18.0.0/16 R5 here
172.19.0.0/16 R6
…… Match!
IP route lookup:
Longest match routing
• Based on destination IP address
172.16.0.0/16
Packet: Destination R3 announced
IP address: 172.16.1.1 from here
R1 R2
R2’s IP routing table
R4
172.16.0.0/16 R3 172.16.1.1
172.16.1.0/24
172.16.1.0/24 R4 exists inside
172.16.1.0/24 announced from
172.18.0.0/16 R5 here
172.19.0.0/16 R6
…… Match as well!
IP route lookup:
Longest match routing
• Based on destination IP address
172.16.0.0/16
Packet: Destination R3 announced
IP address: 172.16.1.1 from here
R1 R2
R2’s IP routing table
R4
172.16.0.0/16 R3 172.16.1.0/24
172.16.1.0/24 R4 172.16.1.1
does not exist inside announced from
172.18.0.0/16 R5 here
172.18.0.0/16
172.19.0.0/16 R6
…… Does not match!
IP route lookup:
Longest match routing
• Based on destination IP address
172.16.0.0/16
Packet: Destination R3 announced
IP address: 172.16.1.1 from here
R1 R2
R2’s IP routing table
R4
172.16.0.0/16 R3 172.16.1.0/24
172.16.1.0/24 R4 announced from
172.18.0.0/16 R5 172.16.1.1
here
172.19.0.0/16 R6 does not exist inside
…… 172.19.0.0/16 Does not match!
IP route lookup:
Longest match routing
• Based on destination IP address
172.16.0.0/16
Packet: Destination R3 announced
IP address: 172.16.1.1 from here
R1 R2
R2’s IP routing table
R4
172.16.0.0/16 R3 172.16.1.0/24
172.16.1.0/24 R4 Longest match, 24 bit prefix announced from
172.18.0.0/16 R5 here
172.19.0.0/16 R6
……
Routing versus Forwarding
Static Routes
Connected Routes
The FIB
• FIB is the Forwarding Table
– It contains destinations, the interfaces and the next-hops to get to those
destinations
– It is built from the router’s Global RIB
– Used by the router to figure out where to send the packet
– Cisco IOS: show ip cef
The Global RIB
• The Global RIB is the Routing Table
– Built from the routing tables/RIBs of the routing protocols and static routes
on the router
• Routing protocol priority varies per vendor – see addendum
– It contains all the known destinations and the next-hops used to get to
those destinations
– One destination can have lots of possible next-hops – only the best next-
hop goes into the Global RIB
– The Global RIB is used to build the FIB
– Cisco IOS:
show ip route
Explicit versus Default Routing
• Default: Pointing all destinations to another device
– Simple, cheap (CPU, memory, bandwidth)
– No overhead
– Low granularity (metric games)
• Explicit: Every known destination (default free zone)
– Complex, expensive (CPU, memory, bandwidth)
– High overhead
– High granularity (every destination known)
• Hybrid: Default plus some destinations
– Minimise overhead
– Provide useful granularity
– Requires some filtering knowledge
Egress Traffic
• How packets leave your network
• Egress traffic depends on:
– Route availability (what others send you)
– Route acceptance (what you accept from others)
– Policy and tuning (what you do with routes from others)
– Peering and transit agreements
Ingress Traffic
• How packets enter your network
• Ingress traffic depends on:
– What information you send and to whom
– Based on your addressing and ASes
– Based on others’ policy (what they accept from you and what they do with
it)
Autonomous System (AS)
AS 100
packet flow
accept announce
AS 1 announce
routing flow
accept AS 2
packet flow
REN
BGP and
OSPF/IS-IS
BGP Static/BGP