More Related Content
Similar to Ars msr 1-intradomain
Similar to Ars msr 1-intradomain (20)
Ars msr 1-intradomain
- 2. © Octavian Catrina 2
Routing in the Internet
⚫ Routing and administrative boundaries
⚫ The Internet is a federation of autonomous IP networks, owned
and operated by different organizations.
⚫ Each organization manages autonomously:
⚫ the connectivity and routing within its own network;
⚫ the policies for interconnection with other networks.
⚫ Internet routing must take into account these
administrative boundaries
⚫ Autonomous System (AS)
⚫ An AS is a connected group of networks under a single
technical administration, with consistent interior routing, and
unified exterior routing policy (RFC 1786,1930).
An AS is also called routing domain.
⚫ An AS is treated as a single entity by the rest of the Internet.
- 3. © Octavian Catrina 3
Intra-domain vs. inter-domain routing
IGP EGP
Inter-domain routing
⚫ Based on AS interconnection
topology and routing policies.
⚫ Designated pairs of AS border
routers exchange routing info.
⚫ Focus on scalability, route
stability, convergence.
⚫ Exterior routing (or gateway)
protocols (EGP): BGP4.
Intra-domain routing
⚫ Based on IP network topology
and performance metrics.
⚫ All routers in the AS participate
in route finding and selection.
⚫ Focus on efficiency and
performance (QoS).
⚫ Interior routing (or gateway)
protocols (IGP): RIP, OSPF, ...
- 4. © Octavian Catrina 4
Intra-domain: Main routing algorithms
Distance-vector routing (DVR) Link-state routing (LSR)
What routing
information does
a router send?
Costs of the best paths known
by the router to all (known)
destinations.
Costs of the links to the
networks directly connected to
the router.
To what routers?
Only to neighbor (directly
connected) routers.
To all other routers in the
routing domain.
How is it used to
build the routing
table?
Every router learns the costs of
the paths to all destinations,
via each of its neighbors.
For each destination, the next
hop is the neighbor offering the
best path to that destination
(distributed Bellman-Ford
shortest path algorithm).
Every router builds a complete
map of the routing domain, as
a labeled graph.
Every router runs a shortest
path algorithm (Dijkstra) on this
graph and finds the tree of best
paths from itself to all
destinations.
Example
RIP: Routing Information
Protocol
OSPF: Open Shortest Path
First
- 6. © Octavian Catrina 6
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.
(2) Advertises known routes to all neighbors (periodic/triggered)
⚫ List of { network prefix, path metric } = Distance Vector (DV).
Distance
vector (DVB)
A
B
C
D
E
10.5.0.0/16
10.3.0.0/16
10.2.0.0/16
10.1.0.0/16
10.4.0.0/16
10.6.0.0/16
Metric = 1
DVB
DVB
These DVR examples assume:
Link metric (cost) = 1
Path metric = link-count.
Advertised DVs contain the path
metric value in the routing table.
Router B: routing table
Dst. Prefix M NH IF
10.1.0.0/16 1 d.c. e
10.2.0.0/16 1 d.c. w
10.3.0.0/16 2 C w
10.4.0.0/16 2 A e
10.5.0.0/16 2 A e
10.6.0.0/16 3 A e
M = route metric
NH = next hop
IF = interface
d.c. = directly connected
Note that the path metric used by
the protocol RIP in the advertised
DVs and the routing table is slightly
different - see example later.
- 7. © Octavian Catrina 7
DVR: Basic algorithm (2)
A
B
C
D
E
10.5.0.0/16
10.3.0.0/16
10.2.0.0/16
10.1.0.0/16
10.4.0.0/16
10.6.0.0/16
Metric = 1
DVA
DVC
(3) Updates its own routing table based on DVs from neighbors
For each destination (network) not directly connected:
⚫ Next hop = Neighbor that offers best path.
⚫ Path metric = neighbor’s metric + shared network metric.
⚫ Best path metric = Min all neighbors { Path metric }.
Router B: DV from neighbors
Dst. Prefix C A
10.1.0.0/16 2 +1=3
10.2.0.0/16 2 +1=3
10.3.0.0/16 1 +1=2 2 +1=3
10.4.0.0/16 2 +1=3 1 +1=2
10.5.0.0/16 3 +1=4 1 +1=2
10.6.0.0/16 4 +1=5 2 +1=3
Router B: Dir. con.
Dst. Prefix M
10.1.0.0/16 1
10.2.0.0/16 1
Router B: routing table
Dst. Prefix M NH
10.1.0.0/16 1 d.c.
10.2.0.0/16 1 d.c.
10.3.0.0/16 2 C
10.4.0.0/16 2 A
10.5.0.0/16 2 A
10.6.0.0/16 3 A
Distance
vector (DVB)
- 8. © Octavian Catrina 8
Example: Network startup
Router B
Dst. Prefix M NH
10.1.0.0/16 1 d.c.
10.2.0.0/16 1 d.c.
Router A
Dst. Prefix M NH
10.1.0.0/16 1 d.c.
10.4.0.0/16 1 d.c.
10.5.0.0/16 1 d.c..
Router E
Dst. Prefix M NH
10.5.0.0/16 1 d.c.
10.6.0.0/16 1 d.c.
Router C
Dst. Prefix M NH
10.2.0.0/16 1 d.c.
10.3.0.0/16 1 d.c.
Router D
Dst. Prefix M NH
10.3.0.0/16 1 d.c.
10.4.0.0/16 1 d.c.
A
B
C
D
E
10.5.0.0/16
10.3.0.0/16
10.2.0.0/16
10.1.0.0/16
10.4.0.0/16
10.6.0.0/16
Metric = 1
- Initially, the routers know only
routes to directly connected
networks, learned from the IP
configuration of their interfaces.
- The routers send DVs with
known routes to their neighbors.
- Routing info propagates hop-
by-hop until all the routers learn
routes to all destinations.
E.g., assume
a sequence
of updates:
E → A;
A → B, D;
B, D → C, A;
etc.
- 9. © Octavian Catrina 9
Example: State after convergence
Router B
Dst. Prefix M NH
10.1.0.0/16 1 d.c.
10.2.0.0/16 1 d.c.
10.3.0.0/16 2 C
10.4.0.0/16 2 A
10.5.0.0/16 2 A
10.6.0.0/16 3 A
Router E
Dst. Prefix M NH
10.1.0.0/16 2 A
10.2.0.0/16 3 A
10.3.0.0/16 3 A
10.4.0.0/16 2 A
10.5.0.0/16 1 d.c.
10.6.0.0/16 1 d.c.
Router C
Dst. Prefix M NH
10.1.0.0/16 2 B
10.2.0.0/16 1 d.c.
10.3.0.0/16 1 d.c.
10.4.0.0/16 2 D
10.5.0.0/16 3 B
10.6.0.0/16 4 B
Router D
Dst. Prefix M NH
10.1.0.0/16 2 A
10.2.0.0/16 2 C
10.3.0.0/16 1 d.c.
10.4.0.0/16 1 d.c.
10.5.0.0/16 2 A
10.6.0.0/16 3 A
Router A
Dst. Prefix M NH
10.1.0.0/16 1 d.c.
10.2.0.0/16 2 B
10.3.0.0/16 2 D
10.4.0.0/16 1 d.c.
10.5.0.0/16 1 d.c.
10.6.0.0/16 2 E
Convergence time:
- Very slow for periodic
updates (e.g., RIP sends
updates every 30 sec).
- Much faster for triggered
updates (on request or to
advertise DV changes).
A
B
C
D
E
10.5.0.0/16
10.3.0.0/16
10.2.0.0/16
10.1.0.0/16
10.4.0.0/16
10.6.0.0/16
Metric = 1
For the basic DVR algorithm
Via
B D E
- 3 3
2 3 4
3 2 4
3 - 3
3 3 -
4 4 2
Via
A
2
3
3
2
-
3
Via
C A
3 -
- 3
2 3
3 2
4 2
5 3
Via
B D
2 3
- 3
3 -
3 2
3 3
4 4
Via
C A
3 2
2 3
- 3
3 -
4 2
5 3
- 10. © Octavian Catrina 10
Towards real-life DVR protocols
⚫ Incremental update of the routing table
⚫ Routers incrementally update their routing table for each
received DV, instead of storing the DVs for all neighbors.
⚫ For each entry in a received DV:
⚫ If the received path metric is smaller than own metric, update the
route: metric = received metric, next hop = neighbor.
⚫ If the received path metric is larger than own metric, but comes
from the same neighbor, update the route: metric = received metric.
⚫ Otherwise ignore the received DV entry.
⚫ How to handle infeasible routes?
⚫ Different cases: link/interface, path, or router failures.
⚫ Route timeout: Delete a route if not advertised for a long time.
A basic mechanism applicable in all cases, but rather slow. Example:
Periodic updates every 30 sec. Declare a route invalid if not advertised
for 180 sec. Delete the route after other 180 sec.
⚫ Notification of infeasible routes? (We'll discuss this later.)
- 11. © Octavian Catrina 11
Routing loops and “counting to infinity”
A
B
C
D
E
10.5.0.0/16
10.3.0.0/16
10.2.0.0/16
10.1.0.0/16
10.4.0.0/16
10.6.0.0/16
Metric = 1
- The link E ↔10.6.0.0/16 fails.
- E believes that it can still reach
10.6.0.0/16 via A, changes its
table and sends an update to A.
- What happens next? The path
metric increases indefinitely.
- Routing loops. The routers
cannot detect that a destination
has become unreachable.
Router B
Dst. Prefix M NH
10.1.0.0/16 1 d.c.
10.2.0.0/16 1 d.c.
10.3.0.0/16 2 C
10.4.0.0/16 2 A
10.5.0.0/16 2 A
10.6.0.0/16 3 A
Router E
Dst. Prefix M NH
10.1.0.0/16 2 A
10.2.0.0/16 3 A
10.3.0.0/16 3 A
10.4.0.0/16 2 A
10.5.0.0/16 1 d.c.
10.6.0.0/16 1 d.c.
Router C
Dst. Prefix M NH
10.1.0.0/16 2 B
10.2.0.0/16 1 d.c.
10.3.0.0/16 1 d.c.
10.4.0.0/16 2 D
10.5.0.0/16 3 B
10.6.0.0/16 4 B
Router D
Dst. Prefix M NH
10.1.0.0/16 2 A
10.2.0.0/16 2 C
10.3.0.0/16 1 d.c.
10.4.0.0/16 1 d.c.
10.5.0.0/16 2 A
10.6.0.0/16 3 A
Router A
Dst. Prefix M NH
10.1.0.0/16 1 d.c.
10.2.0.0/16 2 B
10.3.0.0/16 2 D
10.4.0.0/16 1 d.c.
10.5.0.0/16 1 d.c.
10.6.0.0/16 2 E
Via
B D E
- 3 3
2 3 4
3 2 4
3 - 3
3 3 -
4 4 2
Via
A
2
3
3
2
-
3
Via
C A
3 -
- 3
2 3
3 2
4 2
5 3
Via
B D
2 3
- 3
3 -
3 2
3 3
4 4
Via
C A
3 2
2 3
- 3
3 -
4 2
5 3
For the basic DVR algorithm
- 12. © Octavian Catrina 12
DVR enhancements (1)
⚫ Cause of troubles
⚫ Routers ignore the actual topology. They rely on each other’s
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.
- 13. © 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.
- 14. © Octavian Catrina 14
Example: State after convergence
Router B
Dst. Prefix M NH
10.1.0.0/16 1 d.c.
10.2.0.0/16 1 d.c.
10.3.0.0/16 2 C
10.4.0.0/16 2 A
10.5.0.0/16 2 A
10.6.0.0/16 3 A
Router E
Dst. Prefix M NH
10.1.0.0/16 2 A
10.2.0.0/16 3 A
10.3.0.0/16 3 A
10.4.0.0/16 2 A
10.5.0.0/16 1 d.c.
10.6.0.0/16 1 d.c.
Router C
Dst. Prefix M NH
10.1.0.0/16 2 B
10.2.0.0/16 1 d.c.
10.3.0.0/16 1 d.c.
10.4.0.0/16 2 D
10.5.0.0/16 3 B
10.6.0.0/16 4 B
Router D
Dst. Prefix M NH
10.1.0.0/16 2 A
10.2.0.0/16 2 C
10.3.0.0/16 1 d.c.
10.4.0.0/16 1 d.c.
10.5.0.0/16 2 A
10.6.0.0/16 3 A
Router A
Dst. Prefix M NH
10.1.0.0/16 1 d.c.
10.2.0.0/16 2 B
10.3.0.0/16 2 D
10.4.0.0/16 1 d.c.
10.5.0.0/16 1 d.c.
10.6.0.0/16 2 E
Split-horizon:
Eliminates trivial loops,
faster convergence.
Example:
What happens if the link
from E to10.6.0.0/16 fails?
Via
B D E
- - -
2 3 -
3 2 -
- - -
- - -
- - 2
Via
A
2
3
3
2
-
-
Via
C A
- -
- -
2 3
3 2
- 2
- 3
Via
B D
2 3
- -
- -
3 2
3 3
4 4
Via
C A
3 2
2 3
- -
- -
4 2
5 3
A
B
C
D
E
10.5.0.0/16
10.3.0.0/16
10.2.0.0/16
10.1.0.0/16
10.4.0.0/16
10.6.0.0/16
Metric = 1
For DVR with split-horizon
- 15. © Octavian Catrina 15
DVR enhancements (3)
⚫ Triggered updates
⚫ “Send an update whenever the metric of a route changes,
besides the periodic updates.“
⚫ Much faster convergence (than for periodic updates), but we
have to avoid update "storms".
⚫ Related enhancement: Allow a router to request an update
(e.g., after booting up, to build up its routing table).
⚫ Hold-down
⚫ When a route becomes infeasible, wait for a certain time (hold-
down timer) before accepting worse routes to that destination.
Wait until information about the incident propagates to all routers.
⚫ The route is marked and advertised as unreachable.
Even if it was not advertised earlier due to split horizon.
The route may still be used to forward packets (no alternative).
⚫ Less routing anomalies during convergence. For triggered
updates, less control traffic but longer convergence duration.
- 16. © Octavian Catrina 16
RIP timers (Cisco RIP)
Timer Description Default value
Update timer Time interval between the transmission of periodic
update messages.
30 sec.
Invalid timer Time interval until a route is considered invalid
because no updates confirming it have been
received. When it expires, the route is marked and
advertised as unreachable. Also, it is “hold down”
for the duration of the hold-down timer.
180 sec.
Hold-down timer Time interval during which a route is “hold down”.
This occurs when a neighbor indicates a network
as unreachable or the invalid timer expires. The
route is advertised as unreachable.
180 sec.
Flush timer Time interval until the route is removed from the
routing table if not confirmed by updates.
240 sec.
Sleep timer Optional delay before sending a triggered update
- 17. © Octavian Catrina 17
RIP packets
Up to 25 RIP
route entries (DV)
UDP header
RIP Port = 520
RIP header
…
(other route entries)
Route metric (4)
must be zero (4)
must be zero (4)
Route IPv4 address (4)
RIP version 1 packet format
Address family id (2)
Req/Resp (1) Version (1)
must be zero (2)
must be zero (2)
Header
Route entry
…
(other route entries)
Route metric (4)
Next Hop (4)
Route Subnet Mask (4)
Route IPv4 address (4)
Address family id (2)
Req/Resp (1) Version (1)
must be zero (2)
Route Tag (2)
RIP version 2 packet format
Header
Route entry
Main RIPv2 improvements:
- Full support for subnetting,
including VLSM.
- Authentication.
- Packets are multicast not
broadcast.
Encapsulation
- 18. RIPv2 example (1/2)
© Octavian Catrina 18
RIP: sending v2 update to 224.0.0.9 via S0 (172.16.2.6)
172.16.3.0/24 via 0.0.0.0, metric 1
172.17.1.0/24 via 0.0.0.0, metric 1
172.18.1.0/24 via 0.0.0.0, metric 3
172.18.2.0/30 via 0.0.0.0, metric 2
RIP: sending v2 update to 224.0.0.9 via E0 (172.16.3.2)
172.16.1.0/24 via 0.0.0.0, metric 2
172.16.2.4/30 via 0.0.0.0, metric 1
172.17.1.0/24 via 0.0.0.0, metric 1
172.18.1.0/24 via 0.0.0.0, metric 3
172.18.2.0/30 via 0.0.0.0, metric 2
RIP: sending v2 update to 224.0.0.9 via E1 (172.17.1.1)
172.16.1.0/24 via 0.0.0.0, metric 2
172.16.2.0/30 via 0.0.0.0, metric 2
172.16.2.4/30 via 0.0.0.0, metric 1
172.16.3.0/24 via 0.0.0.0, metric 1
172.16.1.0/24
172.17.1.0/24
172.18.2.0/30
E0
RB RC RD
RE
RA
172.16.2.0/30
172.16.3.0/24
172.16.2.4/30
172.18.1.0/24
E0 E0
S0
S0
S1
E1 E0
S0 S0
S0
E0
.1
.5
.1
.2
.1 .2
.6
.2
.2
.1
.1
.1
RIP: received v2 update from 172.16.2.5 on S0
172.16.1.0/24 via 0.0.0.0 in 1 hops
172.16.2.0/30 via 0.0.0.0 in 1 hops
RIP: received v2 update from 172.16.3.1 on E0
172.16.1.0/24 via 0.0.0.0 in 2 hops
172.16.2.0/30 via 0.0.0.0 in 1 hops
RIP: received v2 update from 172.17.1.2 on E1
172.18.1.0/24 via 0.0.0.0 in 2 hops
172.18.2.0/30 via 0.0.0.0 in 1 hops
224.0.0.9 = Multicast address
with link scope: “All RIP-aware
routers on this link”.
R 172.16.1.0/24 [1 hops] via 172.16.2.5, S0
R 172.16.2.0/30 [1 hops] via 172.16.2.5, S0
[1 hops] via 172.16.3.1, E0
C 172.16.2.4/30 is directly connected, S0
C 172.16.3.0/24 is directly connected, E0
C 172.17.1.0/24 is directly connected, E1
R 172.18.1.0/24 [2 hops] via 172.17.1.2, E1
R 172.18.2.0/30 [1 hops] via 172.17.1.2, E1
RIP updates
received by RC
RC’s routing table
RIP updates
sent by RC
The path metric used by RIP in the
routing table and the advertised
DVs is slightly different from the
examples given earlier:
Path metric = hop-count.
Advertised DVs contain the metric
value in the routing table
incremented by 1.
- 19. RIPv2 example (2/2)
© Octavian Catrina 19
Distance vector
advertised by
RC to RB
RIPv2 periodic update
sent by RC to RB
172.16.1.0/24
172.17.1.0/24
172.18.2.0/30
E0
RB RC RD
RE
RA
172.16.2.0/30
172.16.3.0/24
172.16.2.4/30
172.18.1.0/24
E0 E0
S0
S0
S1
E1 E0
S0 S0
S0
E0
.1
.5
.1
.2
.1 .2
.6
.2
.2
.1
.1
.1
- 21. © Octavian Catrina 21
OSPF overview
⚫ Hierarchical network structure
⚫ The routing domain is divided into several areas interconnected
by a backbone area scalability, efficiency.
⚫ Link State Routing enhancements
⚫ Optimizations of the topological database and the routing info
exchange (e.g., for multi-access networks with many routers).
⚫ The topology of an area is hidden to the rest of the AS.
⚫ LSR within each area. Route summarization between areas.
Lower routing information traffic (flooding) and path computation
overhead. Smaller routing tables.
⚫ OSPF: Open Shortest Path First
⚫ IGP based on Link State Routing (LSR).
⚫ OSPF version 2: RFC 2328 (1998).
⚫ OSPF version 3: RFC 5340 (2008).
Area 0
Backbone area
ABR ABR ABR
Area 1 Area 3
Area 2
- 22. © Octavian Catrina 22
Link State Routing (LSR) (1)
⚫ Build the topological database
⚫ Each router distributes the state of its own links to all routers in
the domain (using reliable hop-by-hop flooding).
⚫ All routers collect the advertised link states and build identical
copies of a database describing the topology of the domain.
Physical network topology
and link costs
Graph model of the network topology
determined by each router and stored
in its local topological database
Directed labeled graph (edges are
labeled with the link metrics)
Link State
Advertisements
R2
R1
R3
R5
R4
R6
N1 N2
N3 N4
N5 N6
N7
2
2 3
2
2
4
1
1
1
1
3 3
1 2
2 1
2 2
N5
N3 R3
R5
R4
R6
N1 R1 R2
N6
N4
N2
N7
1
2
2
2
1
2
1
1
3
2
2
2
4
1
1
3
2
0 0
0 0
3
- 23. © Octavian Catrina 23
LSR (2)
⚫ Find the shortest paths
⚫ All routers independently run the same algorithm (Dijkstra) to
find the shortest paths from the topological database.
⚫ Each router computes a tree of shortest paths, with itself as
root, to all destinations.
⚫ The shortest paths are recomputed when the topology changes.
Network topology graph
Run shortest-paths algorithm
on the sub-graph containing
only the transit nodes
Add the shortest paths
to non-transit (stub) nodes
Example: shortest paths for R1
N5
N3 R3
R5
R4
R6
N1 R1 R2
N6
N4
N2
N7
1
2
2
2
1
2
1
1
3
2
2
2
4
1
1
3
2
0 0
0 0
3
N5
N3 R3
R5
R4
R6
N1 R1 R2
N6
N4
N2
N7
1
2
2
2
1
2
1
1
3
2
2
2
4
1
1
3
2
0 0
0 0
3
R3
R5
R4
R6
R1 R2
N7
1
1
3
2
2
2
4
1
1
3
2
0 0
0 0
3
- 24. © Octavian Catrina 24
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
Router R1
Dst. Prefix Next hop Metric
N1 dir.con. 1
N2 R2 4
N3 R3 4
N4 R4 3
N5 R3 5
N6 R3 5
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.
N5
N3 R3
R5
R4
R6
N1 R1 R2
N6
N4
N2
N7
1
2
2
2
1
2
1
1
3
2
2
2
4
1
1
3
2
0 0
0 0
3
- 25. © Octavian Catrina 25
OSPF areas (1)
⚫ Two-level network hierarchy
⚫ The AS is structured into multiple areas
interconnected by a backbone area
(using physical or virtual links).
⚫ An area is a contiguous collection of
networks, delimited by routers.
⚫ The backbone area also connects the
AS to other ASes.
N1
Backbone
area (0)
Area 1
Area 3
Area 2
N2
N3
N4
N6 N7
N8
N11
N9
N10
R1
R2
R4
R3
R5
R6
R7
R10
R8
R11
R9
R12
External routes:
N12, N13, N14
External routes:
N12, N15
Virtual link
belongs to
backbone
- 26. © Octavian Catrina 26
OSPF areas (2)
⚫ Types of routers
⚫ Area internal routers:
R1, R2, R5, R6, R8, R9, R12.
⚫ Area border routers (ABR):
R3, R4, R7, R10, R11.
⚫ Backbone routers:
All ABR + backbone internal routers (R5, R6).
⚫ AS border routers (ASBR):
R5, R7. Provide links to other AS.
N1
Backbone
area (0)
Area 1
Area 3
Area 2
N2
N3
N4
N6 N7
N8
N11
N9
N10
R1
R2
R4
R3
R5
R6
R7
R10
R8
R11
R9
R12
External routes:
N12, N13, N14
External routes:
N12, N15
Virtual link
- 27. © Octavian Catrina 27
Intra-area vs. Inter-area routing
⚫ Routing information exchange
⚫ Intra-area: Each router floods throughout
an area the state of its own links that
belong to the area.
⚫ Inter-area: A separate topological DB is
maintained per area. The topology of an
area is invisible outside the area.
⚫ The backbone redistributes routing info
between areas.
N1
Backbone
area (0)
Area 1
Area 3
Area 2
N2
N3
N4
N6 N7
N8
N11
N9
N10
R1
R2
R4
R3
R5
R6
R7
R10
R8
R11
R9
R12
External routes:
N12, N13, N14
External routes:
N12, N15
Virtual link
- 28. © Octavian Catrina 28
Inter-area routing info exchange
⚫ Redistribution of routes via the backbone is similar to route advertisements
in DVR. Similar way of computing route metrics.
⚫ Redistribution can be limited for stub networks (replaced by default route).
⚫ Inter-area routing information exchange
⚫ An ABR has a separate database for each area
it belongs to. It reports on the backbone topology
summaries (routes) for its non-backbone areas.
⚫ It injects into its non-backbone areas summaries
about other areas learned on the backbone. It
also injects external routes learned from ASBRs.
N1
Backbone
area (0)
Area 1
Area 3
Area 2
N2
N3
N4
N6 N7
N8
N11
N9
N10
R1
R2
R4
R3
R5
R6
R7
R10
R8
R11
R9
R12
External routes:
N12, N13, N14
External routes:
N12, N15
Virtual link
- 29. © Octavian Catrina 29
IP packet forwarding
⚫ Packet forwarding
⚫ Intra-area traffic is independently
handled by each area (based on its
own routing info, links).
⚫ Inter-area traffic is forwarded via the
backbone.
N1
Backbone
area (0)
Area 1
Area 3
Area 2
N2
N3
N4
N6 N7
N8
N11
N9
N10
R1
R2
R4
R3
R5
R6
R7
R10
R8
R11
R9
R12
External routes:
N12, N13, N14
External routes:
N12, N15
Virtual link
Intra-area
Inter-area
- 30. © Octavian Catrina 30
OSPF Topological Database (TDB)
R2
R1
A1 A2
c1 c2
From R1 R2
To R1 c2
R2 c1
A1 c2
A2 c1
From R1 R2
To R1 c2
R2 c1
R2
R1
Unnumbered
c1 c2
c1
c2
R2
R1
A1
c1
c2
R2
A2
R1
c1 c2
From R1 R2 R3 N1
To R1 0
R2 0
R3 0
N1 c1 c2 c3
R2
R1
c1
c3
R3
c2
N1
c1
c2
R1
0 c3
R3
R2
0 0
N1
c1
R1
N1
From R1 N1
To R1
N1 c1
c1
R1 N1
⚫ Point-to-point network
⚫ Multi-access network
⚫ Stub multi-access network
- 31. © Octavian Catrina 31
Link state advertisements (LSA)
LSA
Type
Advertisement
name
Advertisement description
1 Router (links)
advertisement
Originated by all routers. Describes the collected states of the
router's interfaces to an area. Flooded throughout a single area
only.
2 Network (links)
advertisement
Originated for multi-access networks by the Designated Router.
Contains the list of routers connected to the network. Flooded
throughout a single area only.
3, 4 Summary (link)
advertisement
Originated by area border routers, and flooded throughout the
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.
5 AS external link
advertisement
Originated by AS boundary routers, and flooded throughout the
AS. Each AS external link advertisement describes a route to a
destination in another AS. Default routes for the AS can also be
described by AS external link advertisements.
- 32. © Octavian Catrina 32
LSA examples
R1 Router LSA (Type 1)
From R1 N1 N3
To R1
N1 3
N3 1
N3 Network LSA (Type 2)
From R1 R2 R3 R4 N3
To R1 0
R2 0
R3 0
R4 0
N3
R3 Summary LSA for Aria 1 (Type
3, flooded in the backbone area)
From R3 N1 N2 N3 N4
To R3
N1 4
N2 4
N3 1
N4 2
Backbone
area (0)
Area 1
Area 3
Area 2
N3
N4
N6 N7
N8
N11
N9
N10
R1
R2
R4
R3
R5
R6
R7
R10
R8
R11
R9
R12
External routes:
N12, N13, N14
External routes:
N12, N15
Virtual link
2
1
1
1
3
1
1
1
1
3
3
2
8
N2
N1
8
8 6
8
6
7
6
6
7
2
5
2
2
1 1
2
⚫ Networks in an area are assigned IP address blocks
with certain prefixes. Routes to sets of blocks with a
common prefix can be summarized ...
- 33. © Octavian Catrina 33
TDB examples: Area 1 and Area 0
Backbone
area (0)
Area 1
Area 3
Area 2
N3
N4
N6 N7
N8
N11
N9
N10
R1
R2
R4
R3
R5
R6
R7
R10
R8
R11
R9
R12
Virtual
link
2
1
1
1
3
1
1
1
1
3
3
2
8
N2
N1 8
8 6
6
7
6
6
7
2
5
2
2
1 1
2
From R1 R2 R3 R4 N3
To R1 0
R2 0
R3 0
R4 0
N1 3
N2 3
N3 1 1 1 1
N4 2
N6 17 16
N7 18 17
N8 17 18
N9 18 19
N10 20 21
N11 21 22
Area 1 DB
From R3 R4 R5 R6 R7 R10 R11
To R3 6
R4 8
R5 8 6 6
R6 8 7 5
R7 6
R10 7 2
R11 2
N1 4 4
N2 4 4
N3 1 1
N4 2 3
N6 2 2 4
N7 3 3 5
N8 4 2 2
N9 1
N10 4
N11 3
Area 0 DB
Notes:
R11 is connected to areas 2, 3, and 0
(virtual). For simplicity, point-to-point links
are assumed unnumbered (but this is
problematic for R5, R6).
- 34. © Octavian Catrina 34
Setup and maintenance of the TDB
⚫ Objectives
⚫ Consistent routing tables maintain synchronized TDBs 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).
⚫ Mechanisms for creating/maintaining the TDB
⚫ Neighbor discovery: Directly connected OSPF routers discover
each-other (Hello protocol).
⚫ Adjacency setup: Neighbor routers set up an efficient topology
for routing information exchange (adjacency relations).
⚫ DB synchronization: During adjacency setup, routers perform
an initial synchronization of their TDBs.
⚫ DB update: Routers maintain/update their TDB by reliable
flooding of LSAs following adjacency relations.
- 35. © Octavian Catrina 35
Neighbor discovery
Area 1 N3
N4
R1
R2
R4
R3
N2
N1
Hello!
⚫ Neighbor relation
⚫ Routing information travels hop-by-hop OSPF routers
attached to the same link (physical or virtual) must discover and
identify each-other, i.e., establish a "neighbor relation".
⚫ OSPF Hello protocol
⚫ The Hello protocol is used to establish
and maintain neighbor relationships.
⚫ Hello packets are sent periodically out all
router interfaces (multicast, if supported).
⚫ 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).
- 36. © Octavian Catrina 36
Adjacency relation (1)
⚫ Adjacency relation
⚫ Two neighbor routers that directly exchange routing information
and synchronize their TDBs are called adjacent.
⚫ To improve efficiency, only a subset of neighbor routers
establish adjacency relations.
⚫ Multi-access networks
⚫ Any-to-any adjacencies would be
inefficient (e.g., imagine the initial
exchange of the TDBs and flooding
of the LSA updates).
Area 1 N3
N4
R1
R2
R4
R3
N2
N1 What
adjacencies?
Area 0
R4 R5
Always adjacent
⚫ Point-to-point links
⚫ Routers connected by a point-to-
point link are always adjacent.
- 37. © Octavian Catrina 37
Adjacency relation (2)
⚫ Adjacencies on multi-access networks
⚫ 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.
Adjacencies on multi-
access network N3
Area 1 N3
N4
R1
R2
R4, elected
DR for N3
R3
N2
N1
All routers also set up
adjacencies with the BDR.
⚫ OSPF routers use the Hello protocol
to elect:
- a Designated Router (DR) and
- a Backup Designated Router (BDR).
⚫ Adjacencies are only set up between
the DR/BDR and the other routers.
- 38. © Octavian Catrina 38
OSPF packets
⚫ OSPF runs directly over IP (protocol id=89).
⚫ OSPF packets are exchanged only between adjacent routers.
Except for the packets used in the process of discovering neighbors and
setting-up adjacencies.
Type Packet name Protocol function
1 Hello Used to discover and maintain neighbor relationships between
routers, and elect the DR/BDR on multi-access networks.
2 Database
Description (DD)
Contains a summary of the topological database contents.
Used to synchronize databases during adjacency setup.
3 Link State (LS)
Request
Request to download specified entries in the topological
database.
4 Link State (LS)
Update
Contains updates for the topological database.
5 Link State (LS)
Ack
Acknowledges the receipt of a Link State Update (OSPF
provides a reliable transfer of routing information updates).
- 39. © Octavian Catrina 39
Adjacency setup (1)
Router ID: R1
Down Down
Adjacency
state
Adjacency
state
Hello (RouterID = R1; Neighbors = none; DR = none; ...)
Init
Hello (RouterID = R2; Neighbors = R1, R3, ...; DR = R2; ...)
ExStart
Database Description (Seq = x , I = 1, M = 1, MS = 1)
Database Description (Seq = y, I = 1, M = 1, MS = 1)
ExStart
Exchange Exchange
172.16.1.1 172.16.1.2
Init
Router ID: R2
Scenario: OSPF on router R1 has just started.
Router R2 is currently DR. R1 will accept R2 as DR.
Initialize TDB exchange
Elect master (MS=1).
Master leads the DD
exchange. Assuming
R2>R1, R2 becomes
master. M=1 indicates
more LSA headers to
be exchanged.
Exchange TDB: Database description
Database Description (Seq = y+1, I = 0, M = 1, MS = 1)
. . .
Database Description (Seq = y , I = 0, M = 1, MS = 0)
Database Description (Seq = y+1 , I = 0, M = 1, MS = 0)
Router ID: R3
172.16.1.0/24
172.16.1.3
Router ID = IP address
of an interface.
DD packets contain
headers of the LSAs in
the TDB. Each DD
packet acknowledges
the previous one
(sequence numbers).
- 40. © Octavian Catrina 40
Adjacency setup (2)
Router ID: R1
Loading Loading
Adjacency
state
Adjacency
state
Full
LS Request (IDs of requested LSAs)
LS Update (requested LSAs)
Exchange Exchange
172.16.1.1 172.16.1.2
Full
Router ID: R2
. . .
Database Description (Seq = y+1, I = 0, M = 0, MS = 1)
. . .
Database Description (Seq = y+1 , I = 0, M = 0, MS = 0)
Exchange TDB: LSA loading
(can be interleaved with DD exchange)
LS Ack (acked LSA headers)
LS Request (IDs of requested LSAs)
LS Update (requested LSAs)
LS Ack (acked LSA headers)
TDBs are now synchronized.
Adjacency setup is finished
Router ID: R3
172.16.1.0/24
172.16.1.3
LS Request/Update
packets are used to
request/deliver the
LSAs missing from a
router’s TDB.
LSA loading may be
interleaved with the DD
exchange.
Each router checks the
received LSA headers
against its own TDB to
determine which LSAs
have to be loaded from
its peer.
The 2 routers have the
same “network maps”.
- 41. © Octavian Catrina 41
Topology update examples (1)
Adjacencies on multi-access network N3
Area 1 N3
N4
R1
R2
R4, elected
DR for N3
R3
N2
N1
All routers also set up
adjacencies with the BDR.
New network N5 attached to R2
Area 1 N3
N4
R1
R2
R4, elected
DR for N3
R3
N2
N1
DR delivers the LS Update (LSU)
using multicast, if available
N5
LS Update
New LS Update received by R4 from another router
Area 1 N3
N4
R1
R2
R4, elected
DR for N3
R3
N2
N1
DR uses multicast,
if available
N5
LS Update
New LS Update received by R3 from another router
Area 1 N3
N4
R1
R2
R4, elected
DR for N3
R3
N2
N1
DR uses multicast,
if available
N5
LS Update
LS Update
LS Ack
- 42. © Octavian Catrina 42
Topology update examples (2)
Area 1
N3
R1
R2
R4
R3
R5
R6
DR for N3
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.
● Rhe area's ABRs send in the other areas LS Update containing a Summary LSA
announcing the route to N1.
1
1
1
1
2
N2
N1
8
6
6
7
6
7
N4 N6
N5
3
3
LS Update
LS Ack
LS Update
After receiving LS Update
from R3, R6 suppresses
the copy from R5
(same sequence #)
- 43. © Octavian Catrina 43
LS Update processing
Yes
No
Send LS Update
with newer LSA
to source
No
Yes
Is seq.
the same?
Yes
No
Run SPF to build
new routing table
Add to DB
Flood the LSA
within the area
Send LS Ack
to source
Received
LS Update
(LSA)
Is LSA in
DB?
End
End
Simplified!
Implicit Ack
Send LS Ack
to source
Ignore LSA
Is seq.
higher?
End
- 44. Final example: Network and TDB
© Octavian Catrina 44
N1: 172.16.1.0/24
N7: 172.17.1.0/24
N9: 172.18.2.0/24
Area 0
Area 1 Area 2
e1/0
RC RD
RE
N3: 172.16.2.0/24
N5: 172.16.3.0/24
N11: 172.18.1.0/24
e0/0 e0/0
s0/0
e0/1 e0/0
s1/0 s1/0
s0/0
e1/0
.1
.1
.2
.1 .2 .2
.2
.1
.1
.1
ABR ABR
N6: Lo 0:
172.17.100.1/32
N8: Lo 0:
172.17.100.2/32
N4: Lo 0:
172.16.100.2/32
N2: Lo 0:
172.16.100.1/32
N10: Lo 0:
172.18.100.1/32
RB
RA
N4
RA
RB
N3
N2
N1
1
10
64
64
64
64
1
N8
N9
N10
N11
84
11
74
75
N5
N6
1
10
0
0
10
N7
10
RC
Topology of Area 1.
Router LSAs (RA, RB, RC)
and Network LSAs (RC for N5).
Inter-area routes.
Summary LSAs (RC
for N6, N7, … N11).
TDB for Area 1
(no auto-summary)
Lo = Loopback interface. Its IP address
is used as OSPF Router ID, to obtain a
more stable router ID than for a
physical interface.
Link costs are based on link bandwidth.
C = 10 for Ethernet (10 Mbps), C = 64
for 2 Mbps Serial, C = 1 for Fast
Ethernet (100 Mbps) or (in this
example) for Loopback interfaces
- 45. Link-State Advertisements
© Octavian Catrina 45
172.16.1.0/24
172.17.1.0/24
172.18.2.0/24
Area 0
Area 1 Area 2
e1/0
RC RD
RE
172.16.2.0/24
172.16.3.0/24
172.18.1.0/24
e0/0 e0/0
s0/0
e0/1 e0/0
s1/0 s1/0
s0/0
e1/0
.1
.1
.2
.1 .2 .2
.2
.1
.1
.1
ABR ABR
Lo 0:
172.17.100.1/32
Lo 0:
172.17.100.2/32
Lo 0:
172.16.100.2/32
Lo 0:
172.16.100.1/32
Lo 0:
172.18.100.1/32
RB
RA
- RC is the DR for the transit multi-access
network 172.16.3.0/24, hence it sends the
Network-LSA for 172.16.3.0/24.
- Also, since RC is ABR, it sends in Area 1
Summary-LSAs with routes to destinations
(networks) in the other areas.
LSAs advertised by the router RC in Area 1
84
- 48. © Octavian Catrina 48
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 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Link State Advertisement (LSA) 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LS age | Options | LS type |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Link State (LS) ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Advertising Router |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LS sequence number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LS checksum | length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Five LSA types.
An LSA consists
of a header with
common format
followed by link
description data
specific for each
LSA type.
- 49. © Octavian Catrina 49
OSPF packet formats (2)
Hello packet: OSPF Header +
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Network Mask |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| HelloInterval | Options |Router Priority|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| RouterDeadInterval |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Designated Router |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Backup Designated Router |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Neighbors |
+- +-+
| ... |
Database Description (DD) packet: OSPF Header +
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Interface MTU | Options |0|0|0|0|0|I|M|MS|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| DD sequence number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| LSA Headers |
| |
+- +-+
| ... |
I = Init bit = 1 in
first packet in DB
synchronization.
M = More bit = 1 if
more DD packets
follow.
MS = Master (1)
or Slave (0) bit.
- 50. © Octavian Catrina 50
OSPF packet formats (3)
Link State (LS) Request packet: OSPF Header +
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LS type |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Link State ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Advertising Router |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ... |
Link State (LS) Update packet: OSPF Header +
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| # LSAs |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+- +-+
| LSAs |
+- +-+
| ... |
Link State (LS) Ack packet: OSPF Header +
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+- +-+
| LSA Headers |
+- +-+
| ... |