Академический Документы
Профессиональный Документы
Культура Документы
and Services
Arhitecturi pentru retele si servicii (ARS)
Intra-domain Routing
(Review & Extensions)
IGP EGP
Octavian Catrina 4
Distance Vector
Routing (DVR)
Review
RIP
DVR: Basic algorithm (1)
Each router:
(1) Maintains a table with all known routes (routing table)
Route = { network prefix, path metric, next hop, interface }
Network prefix identifies a set of destinations with the same path.
No next hop for directly connected networks.
Distance vector
(DVB) 10.2.0.0/16
10.1.0.0/16
DVC DVA
Metric = 1 10.5.0.0/16 10.6.0.0/16
C
10.3.0.0/16 A E
10.4.0.0/16
D
Octavian Catrina 7
Example: network startup
Router B Router A Router E
Route M NH Route M NH Route M NH
10.1.0.0/16 1 dir.con. 10.1.0.0/16 1 dir.con.
10.2.0.0/16 1 dir.con.
10.4.0.0/16 2
10.5.0.0/16 2 10.4.0.0/16 1 dir.con.
10.5.0.0/16 1 dir.con. 10.5.0.0/16 1 dir.con.
B 10.6.0.0/16 1 dir.con.
10.2.0.0
10.1.0.0
C Metric = 1 10.5.0.0 10.6.0.0
10.3.0.0 A E
10.4.0.0
Octavian Catrina 8
Example: state after convergence
Router B Via Router A Via Router E Via
Route M NH C A Route M NH B D E R M NH A
10.1.0.0/16 1 dc 3 - 10.1.0.0/16 1 dc. - 3 3 10.1.0.0/16 2 A 2
10.2.0.0/16 1 dc - 3 10.2.0.0/16 2 B 2 3 4 10.2.0.0/16 3 A 3
10.3.0.0/16 2 C 2 3 10.3.0.0/16 2 D 3 2 4 10.3.0.0/16 3 A 3
10.4.0.0/16 2 A 3 2 10.4.0.0/16 1 dc 3 - 3 10.4.0.0/16 2 A 2
10.5.0.0/16 2 A 4 2 10.5.0.0/16 1 dc. 3 3 - 10.5.0.0/16 1 dc -
10.6.0.0/16 3 A 5 3 10.6.0.0/16 2 E 4 4 2 10.6.0.0/16 1 dc. 3
10.2.0.0 B 10.1.0.0
For the basic DVR algorithm
10.2.0.0
10.1.0.0 For the basic DVR algorithm
C Metric = 1 10.5.0.0 10.6.0.0
10.3.0.0 A E
10.4.0.0
1. A-B loop.
Router C Via D Router D Via
Assume E, A mark
Route M NH B D Route M NH C A 10.6.0.0/16 as invalid
10.1/16 2 B 2 3 10.1/16 2 A 3 2 and an update BA.
10.2/16 1 dc. - 3 10.2/16 2 C 2 3 2. A-B-C-D loop.
10.3/16 1 dc 3 - 10.3/16 1 dc. - 3 Assume E, A, D mark
10.4/16 2 D 3 2 10.4/16 1 dc. 3 - 10.6.0.0/16 as invalid
10.5/16 3 B 3 3 10.5/16 2 A 4 2 and the updates:
10.6/16 4 B 4 4 10.6/16 3 A 5 3 C D A B.
Octavian Catrina 11
Counting to infinity
Router B Via Router A Via Router E Via
Route M NH C A Route M NH B D E R M NH A
10.1/16 1 dc 3 - 10.1/16 1 dc. - 3 3 10.1/16 2 A 2
10.2/16 1 dc. - 3 10.2/16 2 B 2 3 4 10.2/16 3 A 3
10.3/16 2 C 2 3 10.3/16 2 D 3 2 4 10.3/16 3 A 3
10.4/16 2 A 3 2 10.4/16 1 dc 3 - 3 10.4/16 2 A 2
10.5/16 2 A 4 2 10.5/16 1 dc. 3 3 - 10.5/16 1 dc -
10.6/16 3 A 5 3 B 10.6/16 2 E 4 4 2 10.6/16 1 dc. 3
10.2.0.0
10.1.0.0 For the basic DVR algorithm
C Metric = 1 10.5.0.0 10.6.0.0
10.3.0.0 A E
10.4.0.0
Octavian Catrina 12
DVR enhancements (1)
Cause of troubles
Routers ignore the actual topology. They rely on each others
routing updates. Basic algorithm permits mutual deception!
What can we do?
Simple enhancements can ensure convergence and avoid
most routing loops. Complete elimination is difficult/inefficient.
Ensuring convergence: Maximum path metric
The path metric is limited to a maximum value (infinity).
Destinations with a larger value are considered unreachable.
What value? Conflicting requirements:
Small value for fast convergence. Larger than any path metric.
Example: RIP infinity = 16!
Inefficient solution for routing loops.
Useful for announcing unreachable destinations.
Octavian Catrina 13
DVR enhancements (2)
Split horizon (simple)
Never advertise a route to the neighbor it was learned from.
RA builds a DV sent to RB by removing from the set of all the routes it
knows those for which RB is next hop (and the link between them).
Motivation
It is not useful: the neighbor knows it already.
It is harmful: the neighbor believes it is a different path.
Effects
Eliminates 2-router loops. Does not eliminate larger loops.
Speeds up convergence. Reduces routing update traffic.
Split horizon with poisoned reverse
Advertise infeasible routes with infinite metric (rather than
omitting them from the DV).
Increases the update size. In practice, it is used for limited time when
a (previously feasible) route becomes infeasible. Needed to speed up
convergence for the incremental update algorithm.
Octavian Catrina 14
Example: state after convergence
Router B Via Router A Via Router E Via
Route M NH C A Route M NH B D E R M NH A
10.1/16 1 dc - - 10.1/16 1 dc. - - - 10.1/16 2 A 2
10.2/16 1 dc. - - 10.2/16 2 B 2 3 - 10.2/16 3 A 3
10.3/16 2 C 2 3 10.3/16 2 D 3 2 - 10.3/16 3 A 3
10.4/16 2 A 3 2 10.4/16 1 dc - - - 10.4/16 2 A 2
10.5/16 2 A - 2 10.5/16 1 dc. - - - 10.5/16 1 dc -
10.6/16 3 A - 3 10.6/16 2 E - - 2 10.6/16 1 dc. -
10.2.0.0 B 10.1.0.0
For DVR with split-horizon
Octavian Catrina 17
RIP packets
RIP version 1 packet format
Encapsulation
Req/Resp (1) Version (1) must be zero (2)
UDP header Header
RIP Port = 520 Address family id (2) must be zero (2)
Route IPv4 address (4)
RIP header
must be zero (4)
Route entry
must be zero (4)
Octavian Catrina 22
LSR (3)
Derive the local routing table
A router derives the entries in the routing table from the
computed shortest paths.
Shortest paths for R1 Routing table for R1
1 2 2 Router R1
N1 R1 2 R2 N2 Route Next hop Metric
2 2 4 N1 dir.con. 1
3 3 3 N2 R2 4
2 1
N3 R3 R4 N4 N3 R3 4
0 0
1 N4 R4 3
1
1
N7 N5 R3 5
1
2 0 0 2 N6 R3 5
N5 R5 R6 N6
N7 R3 3
Each router runs the same shortest path algorithm on the same
graph (hopefully), but with a different root node - itself.
Hence each router computes a different set of paths: from itself
to all destinations. However, the shortest path algorithm
guarantees that the resulting routing tables are consistent.
Octavian Catrina 23
OSPF areas (1)
R1 External routes: External routes:
Area 1 N12, N13, N14 N12, N15 Area 2
N1
R4 R5 R7 R8
N3 N6 N7
R2 Backbone
N2 R3 area (0) R10
N4 N8
R6
Virtual link
belongs to R11
backbone
R9
Two-level network hierarchy N11
Types of routers R9
N11
Area internal routers:
R1, R2, R5, R6, R8, R9, R12. N9
R12
Area border routers (ABR):
N10
R3, R4, R7, R10, R11.
Area 3
Backbone routers:
All ABR + backbone internal routers (R5, R6).
AS border routers (ASBR):
R5, R7. Provide links to other AS.
Octavian Catrina 25
Intra-area vs. Inter-area routing
R1 External routes: External routes:
Area 1 N12, N13, N14 N12, N15 Area 2
N1
R4 R5 R7 R8
N3 N6 N7
R2 Backbone
N2 R3 area (0) R10
N4 N8
R6
Virtual link
R11
Routing information exchange R9
N11
Intra-area: Each router floods throughout
an area the state of its own links that N9
belong to the area. R12
backbone.
Octavian Catrina 28
OSPF topological database
Stub multi-access network
R1 From R1 N1
c1 c1
N1 To R1 N1
R1
N1 c1
From R1 R2
c1
R1 R2 To R1 c2 R1 R2
c1 c2 c2
R2 c1 c1 c2
A1 A2
A1 c2
A2 A1
A2 c1
Multi-access network
R1
c1 From R1 R2 R3 N1 c1
R1
R3 To R1 0
c3 0 c3
N1 R2 0 N1 R3
0 0
R2 R3 0
N1 c1 c2 c3 R2 c2
c2
Octavian Catrina 29
Link state advertisements (LSA)
LSA Advertisement Advertisement description
Type name
1 Router (links) Originated by all routers. Describes the collected states of the
advertisement router's interfaces to an area. Flooded throughout a single area
only.
2 Network (links) Originated for multi-access networks by the Designated Router.
advertisement Contains the list of routers connected to the network. Flooded
throughout a single area only.
3, 4 Summary (link) Originated by area border routers, and flooded throughout the
advertisement advertisement's associated area. Describes a route to a
destination inside the AS, but outside the area (inter-area route).
- Type 3 describes routes to networks.
- Type 4 describes routes to AS boundary routers.
Octavian Catrina 30
LSA examples
R1 External routes: External routes:
3 Area 1 N12, N13, N14 N12, N15 Area 2
N1 8
1 R4 R5 R7 R8
1 8 8 6 6 2 1 1
N3 N6 N7
R2 1 Backbone 7
3
N2 1 R3 area (0) 6 R10 2
2 8 6 7 5
N4 N8
2
R6 2
Virtual link
R1 Router LSA (Type 1) R3 Summary LSA for Aria 1 (Type R11
From R1 N1 N3 3, flooded in the backbone area) 1 R9
From R3 N1 N2 N3 N4 3
To R1 N11
1
N1 3 To R3
N3 1 N1 4
N9
N2 4 1 R12
N3 Network LSA (Type 2) 2
N3 1 N10
From R1 R2 R3 R4 N3
N4 2
To R1 0 Area 3
R2 0
R3 0
Networks in an area are assigned IP address blocks
R4 0 with certain prefixes. Routes to sets of blocks with a
N3 common prefix can be summarized ...
Octavian Catrina 31
Topological DBs for areas 1 and 0
R1 Area 1
3 R4 R5 R7 R8
N1 1 8 1
1 8 6 6 2 1
N3 N6 N7
R2 1 Backbone 7
3 1 R3 area (0) 6 R10 2
N2 7 5
2 8 6 Area 2
N4 N8
2
Area 0 DB R6 2
Virtual
From R3 R4 R5 R6 R7 R10 R11 link
Area 1 DB R11
To R3 6
From R1 R2 R3 R4 N3 R4 8 1 R9
To R1 0 R5 8 6 6 3
1 N11
R2 0 R6 8 7 5
R3 0 R7 6
R4 0 R10 7 2 N9
N1 3 1 R12
R11 2
2
N2 3 N1 4 4 N10
N3 1 1 1 1 N2 4 4
N4 2 N3 1 1 Area 3
N6 17 16 N4 2 3
N7 18 17 N6 2 2 4
Notes:
N8 17 18 N7 3 3 5 R11 is connected to areas 2, 3, and 0
N9 18 19 N8 4 2 2 (virtual). For simplicity, point-to-point links
N10 20 21 N9 1 are assumed unnumbered (but this is
N11 21 22 N10 4 problematic for R5, R6).
N11 3
Octavian Catrina 32
Setup & maintenance of the topological DB
Objectives
Consistent routing tables maintain synchronized topological
DBs in all routers, with fast update in case of topology changes.
Low control traffic and processing overhead use efficient
mechanisms for distributing the routing information (especially
for multi-access networks).
A Hello packet includes the sender's identity and the list of all the
known neighbors (on that link).
A neighbor is considered "dead" if it stops sending periodic Hello
packets (according to timer values in Hello packets).
On multi-access networks the Hello protocol also elects a
designated router and a backup designated router (next slides).
Octavian Catrina 34
Adjacency relation (1)
Adjacency relation
Two neighbor routers that directly exchange routing information
and synchronize their topological DBs are called adjacent.
To improve efficiency, only a subset of neighbor routers
establish adjacency relations.
Area 0
Point-to-point links R4
Always adjacent
R5
Octavian Catrina 35
Adjacency relation (2)
Adjacencies on multi-access networks
Adjacencies on multi-
OSPF routers use the Hello protocol R1 access network N3
R4, elected
to elect: N1
DR for N3
- a Designated Router (DR) and Area 1 N3
R2
- a Backup Designated Router (BDR).
N2 R3
Adjacencies are only set up between N4
the DR/BDR and the other routers. All routers also set up
adjacencies with the BDR.
DR responsibilities
Routers on a multi-access network synchronize their topological
DB with the DR: DB exchange with the DR at adjacency setup
(not any-to-any), followed by LSA updates afterwards.
DR floods a Network-LSA which lists the routers connected to
the multi-access network.
DR disseminates the LSAs from the rest of the AS to the routers
on its multi-access network.
Octavian Catrina 36
OSPF packets
Type Packet name Protocol function
Octavian Catrina 37
OSPF packet formats (1)
OSPF packet header
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Version # | Type | Packet length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Router ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Area ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Checksum | AuthType |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Authentication |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Authentication |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Octavian Catrina 39
OSPF packet formats (3)
Link State (LS) Request packet: OSPF Header +
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LS type |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Link State ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Advertising Router |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ... |
Octavian Catrina 40
Adjacency setup (1)
Router ID: R3
Router ID: R1 172.16.1.3 Router ID: R2
172.16.1.1 172.16.1.2
172.16.1.0/24
Adjacency Adjacency
Scenario: OSPF on router R1 has just started.
state state
Router R2 is currently DR. R1 will accept R2 as DR.
Down Down
Hello (RouterID = R1; Neighbors = none; DR = none; ...)
Init Init
Hello (RouterID = R2; Neighbors = R1, R3, ...; DR = R2; ...)
ExStart ExStart
Initialize topology DB exchange
Octavian Catrina 41
Adjacency setup (2)
Router ID: R3
Adjacency Adjacency
state Exchange of topology DB continued state
...
Exchange Exchange
Database Description (Seq = y+1, I = 0, M = 0, MS = 1)
New LS Update received by R4 from another router New LS Update received by R3 from another router
R1 R1
N1 R4, elected N1 R4, elected
DR for N3 LS Update DR for N3
Area 1 N3 Area 1 N3
R2 R2
N2 R3 N2 R3 LS Update
N4 N4
N5 N5
DR uses multicast, DR uses multicast,
if available if available
Octavian Catrina 43
Topology update - examples (2)
Scenario: New network N1 attached to R1:
R1 sends LS Update with Router LSA announcing link to N1 (to R4 = DR, and to BDR).
LS Update is flooded all over the area, hop-by-hop, reliably (LS Ack, retransmission).
LSA sequence number allows routers to distinguish duplicates and discard them.
Each router runs SPF algorithm and updates its routing table.
Also, the area's ABRs send in the other areas LS Update containing a Summary LSA
announcing the route to N1.
R1 Area 1
3
N1 LS Update DR for N3
1 R4 R5
1 8 6 N5
N3
R2 1 7
3
N2 1 R3 6
6 7
N4 N6
2
R6
After receiving LS Update
from R3, R6 suppresses
LS Update
the copy from R5
LS Ack (same sequence #)
Octavian Catrina 44
LS Update processing
Yes Is seq.
Add to DB Send LS Ack
higher?
to source
Send LS Ack No
End
to source
Send LS Update
with newer LSA
Flood the LSA to source
within the area
Implicit Ack
End
Octavian Catrina 45