Professional Documents
Culture Documents
OUTLINE
Basic Routing
Routing Information Protocol (RIP)
Interior Gateway Routing Protocol (IGRP) and Enhanced IGRP (EIGRP)
Open Shortest Path First (OSPF)
Border Gateway Protocol (BGP)
2
ROUTING AND FORWARDING
Routing
How to determine the routing table entries
carried out by routing daemon
Forwarding
Look up routing table & forward packet from
input to output port
carried out by IP layer
4
STATIC ROUTING
Used on hosts or on very small networks
Manually tell the machine where to send the packets for each prefix
% netstat -nr
Routing Table:
Destination Gateway Flags Ref Use Interface
------------- ------------ ----- ---- ----- ---------
130.207.7.0 130.207.7.27 U 1 9090 ce0
130.207.6.0 130.207.7.1 UG 1 2058
130.207.102.0 130.207.7.1 UG 1 101
130.207.97.0 130.207.7.1 UG 1 351
130.207.3.0 130.207.7.1 UG 1 15961
130.207.99.0 130.207.7.1 UG 1 1705
130.207.98.0 130.207.7.1 UG 1 201
130.207.29.0 130.207.7.1 UG 1 18
130.207.28.0 130.207.7.1 UG 1 779
130.207.26.0 130.207.7.1 UG 1 524
130.207.117.0 130.207.7.1 UG 1 433
130.207.116.0 130.207.7.1 UG 1 14667
130.207.23.0 130.207.7.1 UG 1 4724
130.207.119.0 130.207.7.1 UG 1 4406
130.207.114.0 130.207.7.1 UG 1 5489
224.0.0.0 130.207.7.27 U 1 0 ce0
default 130.207.7.1 UG 1 44950
127.0.0.1 127.0.0.1 UH 7 2344869 lo0
5
HIERARCHICAL ROUTING
network “flat”
7
AUTONOMOUS SYSTEMS - MACEDONIA
8
TYPES OF AUTONOMOUS SYSTEMS
Stub AS: has only a single connection to the outside world.
Multihomed AS: has multiple connections to the outside world, but
refuses to carry transit traffic
Transit AS: has multiple connections to the outside world, and can
carry transit and local traffic. (If one AS is an ISP for another, then the
former is a transit AS)
Internet Exchange Point autonomous system (IP or IPX) – physical
infrastructure through which ISPs exchange Internet traffic between
their networks (ASs)
9
10
PEERING AND INTER-AS CONNECTIVITY
Peering Center
AS
Tier 2 (transit AS)
Content or
Tier 2 (transit AS)
Application Service Tier 2 (transit AS)
AS AS Provider (Non-transit)
AS AS AS
AS
11
AS NUMBER
For exterior routing, an AS needs a globally unique AS
integer number (initially 16-bit, but now 32-bit).
Currently (mid-2016), there are about 54000 unique
autonomous networks (and growing)
Stub AS, which is the most common type, does not need an
AS number since the prefixes are placed at the provider’s
routing table
Transit AS needs an AS number
Request an AS number from the ARIN, RIPE and APNIC
(IANA assigns AS number blocks to Regional Internet
Registers -RIRs)
12
INTERCONNECTED ASES
3c
3a 2c
3b 2a
AS3 2b
1c
AS2
1a
1b
1d AS1
Forwarding table is
configured by both intra-
and inter-AS routing
Intra-AS
Routing
Inter-AS
Routing
algorithm
algorithm algorithm Intra-AS sets entries for
Forwarding
internal dests
table Inter-AS & Intra-AS sets entries
for external dests
13
INTER-AS TASKS AS1 needs:
Suppose router in AS1 1. to learn which dests are
receives datagram for which reachable through AS2
dest is outside of AS1 and which through AS3
Router should forward packet
towards one of the gateway 2. to propagate this
routers, but which one? reachability info to all
routers in AS1
Job of inter-AS routing!
3c
3a 2c
3b 2a
AS3 2b
1c
AS2
1a
1b
1d AS1
14
INTER AND INTRA DOMAIN ROUTING
InteriorGateway Protocol (IGP): routing within AS
• RIP, OSPF
Exterior Gateway Protocol (EGP): routing between AS’s
• BGPv4
Border Gateways perform IGP & EGP routing
IGP
R EGP IGP
R R
R
R
R
AS A
AS C
R
R
IGP
AS B
15
INTRA-AS ROUTING
16
INTER-AS ROUTING PROTOCOLS
Border Gateway Protocol (BGP)
BGP-4: de facto standard
Path Vector Algorithm
17
ADMINISTRATIVE DISTANCES
The administrative distance (AD) is used to rate the trustworthiness of
routing information received on a router from a neighbor router.
An administrative distance is an integer from 0 to 255, where 0 is the
most trusted and 255 means NO traffic will be passed via this route.
18
DEFAULT ADMINISTRATIVE DISTANCES
Route Source Default AD
Connected Interface 0
Static Route 1
EIGRP 90
IGRP 100
OSPF 110
RIP 120
Unknown 255 (no traffic)
19
THE THREE CLASSES OF ROUTING PROTOCOLS
20
OUTLINE
Basic Routing
Routing Information Protocol (RIP)
Interior Gateway Routing Protocol (IGRP) and Enhanced IGRP (EIGRP)
Open Shortest Path First (OSPF)
Border Gateway Protocol (BGP)
21
ROUTING INFORMATION PROTOCOL (RIP)
RFC 1058
RIP based on routed, “route d”, distributed in BSD UNIX
Uses the distance-vector algorithm
Runs on top of UDP, port number 520
Metric: number of hops
Max limited to 15
suitable for small networks (local area environments)
value of 16 is reserved to represent infinity
small number limits the count-to-infinity problem
22
RIP OPERATION
Router sends update message to neighbors every 30 sec
A router expects to receive an update message from each
of its neighbors within 180 seconds in the worst case
If router does not receive update message from neighbor
X within this limit, it assumes the link to X has failed and
sets the corresponding minimum cost to 16 (infinity)
Uses split horizon with poisoned reverse
Convergence speeded up by triggered updates
neighbors notified immediately of changes in distance vector table
23
Figure 14.8 Example of a domain using RIP
24
RIP message format
25
Request messages
26
Example 1
28
RIP PROBLEMS
Counting-to-infinity problem:
Simple configuration A->B->C. If C fails, B needs to update and thinks
there is a route through A. A needs to update and thinks there is a
route thru B.
No clear solution, except to set “infinity” to be small (eg 16 in RIP)
Split-horizon: If A’s route to C is thru B, then A advertises C’s route
(only to B) as infinity.
Slow convergence after topology change:
Due to count to infinity problem
Also information cannot propagate thru node until it recalculates routing info.
29
RIP PROBLEMS (CONTD)
Black-holes:
If one node goes broke and advertises route of zero to several key
networks, all nodes immediately point to it.
Broadcasts consume non-router resources
Does not support subnet masks (VLSMs)
No authentication
30
BASIC RIP
RIP
32
BEFORE RIP – ROUTER B
Router-B#sh 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 def
U - per-user static route, o - ODR
33
WITH RIP – ROUTER A
Router-A#sh 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 def
U - per-user static route, o - ODR
34
WITH RIP – ROUTER B
Router-B#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B – BGP
[edited for brevity]
Gateway of last resort is not set
35
RIP NETWORK FAILURE
Router-A#sh ip route
Codes: [edited for brevity]
36
RIPV2
Why ? Installed base of RIP routers
Provides:
VLSM support
Authentication
Multicasting
“Wire-sharing” by multiple routing domains,
Tags to support EGP/BGP routes.
37
Figure 14.13 RIP version 2 format
38
Figure 14.14 Authentication
39
OUTLINE
Basic Routing
Routing Information Protocol (RIP)
Interior Gateway Routing Protocol (IGRP) and Enhanced IGRP (EIGRP)
Open Shortest Path First (OSPF)
Border Gateway Protocol (BGP)
40
INTERIOR GATEWAY ROUTING PROTOCOL (IGRP)
41
ENHANCED INTERIOR GATEWAY ROUTING
PROTOCOL (EIGRP)
Cisco proprietary
Classless
Uses autonomous system numbers
A number assigned to a group of routers under mutual administration.
42
EIGRP – TYPES OF PACKETS
Reliable-> acknowledged
5 types of packets:
Hello – Identifies neighbors. Sent as periodic multicast.
Update – Advertises routes. Updates are sent as multicast only if there is a
change.
Ack – Acknowledges receipt of an update
Query – Ask about routes if the paths are lost. Multicast to neighbors. If
there is not a response from some neighbor - > unicast query until it gets a
reply of after 16 attempts
Reply – Answer a query. Unicast – indicating the path, or that there is no
path.
43
EIGRP - NEIGHBORS
Before EIGRP routers exchange routes with each
other, they must become neighbors.
There are three conditions that must be met for
neighborship establishment:
1) Hello received
2) AS numbers match
3) Identical metrics (K-values)
Sends periodic hellos
If hellos are missed over a long period of time (hold
time) the neighbor is removed
List of neighbors kept in neighbors table
44
“SOPHISTICATED METRIC”
45
EXAMPLE – EIGRP METRIC
46
DUAL
Advertised distance – the cost from the neighbor to the destination
Feasible distance – the cost from the router to the destination
Feasibility requirement – a path where the neighbors advertised
distance < best feasible distance, has no loops
Successor – the neighbor with the best path
Feasible successor – neighbors that meet the feasibility requirement
Example
47
DUAL - EXAMPLE
Advertised Feasible
distance distance
Ohrid 310 310+180=490 Possibility
Veles 95 95+55=150 Feasible successor
Stip 40 40+90=130 Successor 48
EIGRP
Three tables
Neighbor table
Topology table
Routing table
49
EIGRP FEATURE COMPARISON
Link-state Features Distance-vector Features
51
LINK STATE ROUTING
52
LINK STATE ROUTING
53
LINK STATE ROUTING
Flooding of LSPs
The creating node sends a copy of LSP out of each interface
A node that receives an LSP compares it with the copy it may
already have
Sequence number of the copy > sequence number of the arrived LSP = discard the
arrived LSP
Otherwise
Discard the old LSP and keeps the new one
Send a copy of it out of each interface except the one from which the packet
arrived
54
OPEN SHORTEST PATH FIRST
RFC 2328 (v2)
Fixes some of the deficiencies in RIP
Enables each router to learn complete network topology
Each router monitors the link state to each neighbor and
floods the link-state information to other routers
Each router builds an identical link-state database
Allows router to build shortest path tree with router as root
OSPF typically converges faster than RIP when there is a
failure in the network
55
OPEN SHORTEST PATH FIRST
Three tables
Neighbor
Topology (no gossiping)
Routing
56
OSPF LOGIC
1) Each router discovers its neighbors on each interface.
The list of neighbors is kept in a neighbor table.
2) Each router uses a reliable protocol to exchange
topology information with its neighbors.
3) Each router places the learned topology information
in its topology database.
57
OSPF LOGIC (CONT.)
4) Each router runs the SPF algorithm against its own
topology database to calculate the best routes to each
subnet in the database.
5) Each router places the best route to each subnet in the
IP routing table.
58
RID
What is RID (the name of the router)
The highest physical IP address
Virtual IP addresses beat physical IP addresses
Router ID command
Example
59
OSPF TERMINOLOGY
RID – router ID – highest IP (virtual, physical)
DR - designated router (highest priority, highest RID)
No. SPtree = No. areas for all interfaces
Metric = cost
Advertises list of connections
Multicast hellos
AllSPF dest = 224.0.0.5 (from DR to all routers)
AllDRs dest = 224.0.0.6 (from routers to DRs and BDRs)
60
OSPF FEATURES
Multiple routes to a given destination, one per type of service
Support for variable-length subnetting by including the subnet mask
in the routing message
Distribution of traffic over multiple paths of equal cost
Authentication to ensure routers exchange information with trusted
neighbors
Uses notion of area to partition sites into subsets
Designated router to minimize table maintenance overhead
61
OSPF FEATURES
At steady state:
All routers have same LS database
Occasional Hello messages (10 sec) & LS updates sent (30 min)
62
OSPF FEATURES
Metric
OSPF protocol allows the administrator to assign a cost, called the
metric, to each route
Based on a type of service (minimum delay, maximum throughput,
and so on)
63
METRIC
The metric is cost
Cost = 108/bandwidth
Flexible link cost which can range from 1 to
65,535
Examples Ethernet – 10
56 kbps – 1785
Fast Ethernet – 1
64 kbps – 1562
Gigabit Ethernet – 1
T1 – 64
10 Gigabit Ethernet - 1
E1 – 48 64
OSPF NETWORK
To improve scalability, AS may be partitioned into areas
Area is identified by 32-bit Area ID
Router in area only knows complete topology inside area & limits the flooding
of link-state information to area
Area border routers summarize info from other areas
Each area must be connected to backbone area (0.0.0.0)
Distributes routing info between areas
Internal router has all links to nets within the same area
Area border router has links to more than one area
Backbone router has links connected to the backbone
Autonomous system boundary (ASB) router has links to another autonomous
system.
65
HIERARCHICAL OSPF
66
OSPF AREAS
To another AS
N1 R1 N5
N2 R3 R6 N4 R7
R2 N6
R4
R5
N3
Area 2
Area 0
Area 1 R8
ASB: 4
ABR: 3, 6, and 8 N7
IR: 1,2,5,7 R = router
N = network
BBR: 3,4,5,6,8
Area 3
67
NEIGHBOR, ADJACENT & DESIGNATED ROUTERS
Neighbor routers: two routers that have interfaces to a common
network
Neighbors are discovered dynamically by Hello protocol
Adjacent router: neighbor routers become adjacent when they
synchronize topology databases by exchange of link state
information
Neighbors on point-to-point links become adjacent
Routers on multiaccess nets become adjacent only to designated &
backup designated routers
Reduces size of topological database & routing traffic
68
BECOMING ADJACENT ROUTERS
Send hello -> down state
Receive hello -> Init state (check criterion)
Receive hello -> 2-way state
Am I listed as a neighbor?
69
Hello packet (profile of the router)
71
Figure 14.19 Areas in an autonomous system
72
Figure 14.20 Types of links
73
Figure 14.21 Point-to-point link
74
Figure 14.22 Transient link
75
DESIGNATED ROUTER
Receives updates and distributes them to each segment
router
DR and BDR are elected on the basis of highest OSPF
priority, and highest IP address
Default priority is 1 and a priority of 0 prevents a router from being
elected
76
Figure 14.23 Stub link
77
Figure 14.25 Types of OSPF packets
78
Figure 14.26 OSPF common header
79
Figure 14.27 Link state update packet
80
Figure 14.28 LSA general header
81
Router link (type 1 LSA)
82
Figure 14.30 Router link LSA
E – is it ASBR
B – is it ABR
Link state ID (in LSA header): originating router ID
83
Table 14.2 Link types, link identification, and link data
84
Example 3
Give the router link LSA sent by router 10.24.7.9 in Figure 14.31.
Solution
This router has three links: two of type 1 (point-to-point) and one of type 3
(stub network). Figure 14.32 shows the router link LSA.
85
Figure 14.31 Example 3
86
Figure 14.32 Solution to Example 3
87
Network link (type 2 LSA)
88
Figure 14.34 Network link advertisement format
89
Example 4
Solution.
90
Figure 14.35 Example 4
91
Figure 14.36 Solution to Example 4
92
Example 5
In Figure 14.37, which router(s) sends out router link LSAs?
Solution
All routers advertise router link LSAs.
a. R1 has two links, N1 and N2.
b. R2 has one link, N1.
c. R3 has two links, N2 and N3.
93
Figure 14.37 Example 5 and Example 6
94
Example 6
In Figure 14.37, which router(s) sends out the network link LSAs?
Solution
All three network must advertise network links:
a. Advertisement for N1 is done by R1 because it is the only attached router and
therefore the designated router.
b. Advertisement for N2 can be done by either R1, R2, or R3, depending on which
one is chosen as the designated router.
c. Advertisement for N3 is done by R3 because it is the only attached router and
therefore the designated router.
95
Summary link to network (type 3 LSA) –
ABR summary route
96
Figure 14.39 Summary link to network LSA
97
Summary link to AS boundary router
(type 4 LSA) – ASBR location
98
Figure 14.41 Summary link to AS boundary router LSA
99
External link (type 5 LSA) – ASBR
summary route
100
Figure 14.43 External link LSA
101
Database description packet
102
Link state request packet
103
Link state acknowledgment packet
104
AREAS & LSA PROPAGATION
105
OSPF --- ISSUES
Processor intensive
Flooding traffic
Complexity
Five Messages
Hello, exchange, request, flood update and flood ack
Three algorithms (Dijkstra, flooding, exchange)
A lot of code
106