Escolar Documentos
Profissional Documentos
Cultura Documentos
TECH-BLOG
This time, we will discuss how routers discover IP network topologies and build shortest path trees by using
OSPF protocols.
Certainly, routing protocols like OSPF are based on operating principles that are hard to understand if you are
not a routing expert. Many people are quite good at routing configuration using Command Line Interface (CLI),
but only a few fully understand the operating principles of the protocols. To help you, routing novices,
understand OSPF better, below we have provided lots of easy-to-understand illustrations.
R4
1.1.3.0/30, (10)
.2
.2
10.1.0.2/32
.1
.1
.2
R2
1.1.1.0/30, (10)
1.1.1.0/30, (10)
1.1.5.0/30, (10)
Link IP Network
.1
.1
10.1.0.5/32
1.1.4.0/30, (20)
.2
.2
10.1.0.3/32
1.1.6.0/30, (20)
R5
Link Cost
10.1.0.1/32
.1
.1
.2
R3
1.1.2.0/30, (10)
R1
.2
1.1.1.0/30, (10)
R2
1.1.1.2/30
.1
R1
1.1.1.1/30
In the figure, there are five OSPF routers (R1 ~ R5), along with their respective interface IP address, OSPF cost
and loopback address (e.g. 10.1.0.1 for R1).
Here OSPF cost means cost needed to deliver a packet to each link. From OSPF's perspective, a least
cost path is the shortest path. In general, the cost of a link is determined based on its bandwidth. For
example, the cost of 100Mbps link is greater than that of 1GE link, and the cost of 1GE of greater
than that of 10GE (The system operator of a network configures link costs for each interface in a
router, by using CLI)
In order for routers to exchange OSPF messages with each other, IP addresses for identifying routers
(OSPF RID (Router ID)) are required. For the purpose, loopback addresses are usually used. IP
addresses of physical links can also be used, but loopback addresses are preferred for the following
reasons:
If a physical link IP address is used: The IP address disappears when the physical link is
down. That is, an OSPF router that uses this address as OSPF RID can no longer
Netmanias Tech-Blog: Quick Guide to OSPF: Part 1. Building Shortest Path Tree Topology
If a loopback IP address is used: The IP address remains valid even when the physical link is
down because loopback addresses are logical addresses that are not bound to a certain
physical link.
R4
t=2
.2
.2
LSA Message
10.1.0.2/32
.1
.1
.2
R2
...
t=1
10.1.0.3/32
t=2
.1
.1
R5
.1
.1
R1
.2
R3
Each OSPF router builds LSDB after receiving Router-LSA originated from R1
...
10.1.0.1/32
t=2
.2
.2
...
LSA
Identifier
t=1
t=2
10.1.0.5/32
...
R2
1.1.1.1, (10)
R1
1.1.2.1, (10)
R3
R1 floods its link (interface) address and loopback address to R2 and R3, through Router-LSA message [t=1].
Upon receiving the message, R2 and R3 flood it through all the links except the one that the message was sent
through, having both R4 and R5 receive the same Router-LSA message twice [t=2]. At this time, if the two
messages have the same LSA identifiers, {LS Type, Link State ID, Advertising Router}, the one that arrived later
is discarded.
Link State ID: Same as Advertising Router value (10.1.0.1) in case of Router-LSA
Advertising Router: ID of the router that originated generated Router-LSA (OSPF RID, i.e. loopback
address = 10.1.0.1)
The Router-LSA message sent by R1 includes (see the table in the upper right corner of the figure above):
Link Type: Identifies link types. Values for Link ID and Link Data are determined according to this
value.
Link Type = 1: Point-to-point connection (all the routers in the figure have this type of
connection)
Netmanias Tech-Blog: Quick Guide to OSPF: Part 1. Building Shortest Path Tree Topology
Link ID
In case of Link Type = 1, Link ID is the Router ID of the OSPF Neighbor connected to R1
(Neighbor RIDs are known to each other while OSPF Neighbors exchange Hello message)
Link Data
In case of Link Type = 3, Link Data is the subnet mask of R1's loopback address (/32 =
255.255.255.255)
Upon arrival of the Router-LSA message sent by R1, the receiving routers (i.e. R2 ~R5 here) store the
information in their respective OSPF Link State DataBase (LSDB), and build an OSPF topology based on the
information. With the information available so far, the routers now know:
R4
t=1
.2
.2
LSA Message
10.1.0.2/32
.1
.1
.2
...
R2
10.1.0.1/32
.1
.1
t=2
.2
.2
t=2
10.1.0.3/32
.1
.1
R5
t=2
R1
.2
R3
Each OSPF router builds LSDB after receiving Router-LSA originated from R2
...
LSA
Identifier
...
t=1
t=1
10.1.0.5/32
...
1.1.3.1, (10)
1.1.5.1, (10)
1.1.1.2, (10)
R2
R4
R1
R5
R2 floods its link (interface) address and loopback address to R1, R4 and R5, through Router-LSA message [t=1].
Upon receiving the message, R1, R4 and R5 flood it through all the links except the one that the message was
sent through [t=2].
R1, R3, R4 and R5 store the information (Router-LSA) in their respective LSDB. Now another "OSPF network
topology" is obtained as seen in the figure above.
Netmanias Tech-Blog: Quick Guide to OSPF: Part 1. Building Shortest Path Tree Topology
3 R3 floods Router-LSA
10.1.0.4/32
R4
.2
.2
.1
.1
t=2
LSA Message
10.1.0.2/32
.2
...
R2
t=1
.1
.1
10.1.0.3/32
.1
.1
R5
t=1
R1
.2
R3
Each OSPF router builds LSDB after receiving Router-LSA originated from R3
...
10.1.0.1/32
t=1
.2
.2
...
LSA
Identifier
t=2
t=2
10.1.0.5/32
...
1.1.2.2, (10)
1.1.4.1, (20)
1.1.6.1, (20)
Again, R3 floods its link (interface) address and loopback address to R1, R4 and R5, through Router-LSA
message [t=1]. Upon receiving the message, R1, R4 and R5 flood it through all the links except the one that the
message was sent through [t=2].
R1, R2, R4 and R5 store the information (Router-LSA) in their respective LSDB. Now again another "OSPF
network topology" is obtained as seen in the figure above.
R4
.2
.2
t=1
.1
.1
.2
...
t=2
R2
t=2
10.1.0.5/32
.2
.2
LSA Message
10.1.0.2/32
10.1.0.1/32
.1
.1
t=1
t=2
10.1.0.3/32
.1
.1
R5
t=2
R1
.2
R3
Each OSPF router builds LSDB after receiving Router-LSA originated from R4
...
...
LSA
Identifier
...
R2
R4
R3
R4 floods its link (interface) address and loopback address to R2 and R3, through Router-LSA message [t=1].
Netmanias Tech-Blog: Quick Guide to OSPF: Part 1. Building Shortest Path Tree Topology
Upon receiving the message, R2 and R3 flood it through all the links except the one that the message was sent
through [t=2].
R1, R2, R3 and R5 store the information (Router-LSA) in their respective LSDB. Now again, another "OSPF
network topology" is obtained as seen in the figure above.
R4
.2
.2
t=2
.1
.1
.2
...
t=2
R2
t=1
10.1.0.5/32
.2
.2
LSA Message
10.1.0.2/32
...
t=1
10.1.0.3/32
.1
.1
.1
.1
R5
t=2
R1
.2
R3
Each OSPF router builds LSDB after receiving Router-LSA originated from R5
...
LSA
Identifier
...
10.1.0.1/32
t=2
R2
R5
1.1.5.2, (10)
R3
1.1.6.2, (20)
Same thing again. R5 floods its link (interface) address and loopback address to R2, and R3, through RouterLSA message [t=1]. Upon receiving the message, R2 and R3 flood it through all the links except the one that
the message was sent through [t=2].
R1 ~ R4 store the information (Router-LSA) in their respective LSDB. Now another "OSPF network topology" is
obtained as seen in the figure above.
Note 1: In real networks, all routers flood their Router-LSA to their neighbor OSPFs all at the same time. In this
post, however, we assumed all the flooding are sequential, for easier understanding.
Note 2: In order for routers to send Router-LSA, their link types should be configured as point-to-point. If
configured otherwise (e.g. broadcast), Network-LSA is sent instead. Most of link connections among routers
are of point-to-point type. So, we will not further discuss other types of link connections than point-to-point as
this particular post is for routing novices like you.
Netmanias Tech-Blog: Quick Guide to OSPF: Part 1. Building Shortest Path Tree Topology
R2
1.1.1.1, (10)
R1
1.1.2.1, (10)
R3
1.1.3.1, (10)
1.1.5.1, (10)
1.1.1.2, (10)
R2
R4
R1
R4
R1
R5
R5
R4
R3
1.1.6.2, (20)
1.1.3.1, (10)
1.1.5.1, (10)
1.1.1.2, (10)
R2
OSPF LSDB
1.1.3.2, (10)
1.1.1.1, (10)
R4
R1
1.1.2.1, (10)
R5
1.1.5.2, (10)
R5
1.1.5.2, (10)
R3
1.1.4.2, (20)
R2
R2
1.1.2.2, (10)
1.1.4.1, (20)
1.1.6.1, (20)
1.1.3.2, (10)
1.1.4.2, (20)
R3
R3
1.1.2.2, (10)
1.1.4.1, (20)
1.1.6.1, (20)
1.1.6.2, (20)
As a result of exchanging Router-LSA messages with each other, all the five OSPF routers end up having the
same LSDB, and thus the same OSPF topology map built based on the LSDB as seen above.
Netmanias Tech-Blog: Quick Guide to OSPF: Part 1. Building Shortest Path Tree Topology
R4
R5
10
R2
10
10
R1
20
20
10
R3
R4
R5
10
10
R1
20
20
10
R3
R4
R5
10
10
R1
20
20
10
R3
R4
R5
10
10
R1
20
20
10
R3
R4
R5
10
10
R1
20
20
10
R3
R3
R1
10
R2
10
R4
R1
10
R2
10
R5
R2
10
R1
R2
10
R1
R2
10
R4
R2
10
R5
10
R3
10
R1
R3
10
R1
R3
20
R4
R3
20
R5
10
Destination Network
10.1.0.1/32 (R1)
10.1.0.3/32 (R3)
10.1.0.4/32 (R4)
10.1.0.5/32 (R5)
10
R2
R4
10
R2
10
R1
R4
10
R2
10
R5
R4
20
R3
R5
10
R2
R5
10
R2
10
R1
R5
10
R2
10
R4
R5
20
R3
Next Hop
1.1.1.1 (R1)
1.1.1.1 (R1)
1.1.3.2 (R4)
1.1.5.2 (R5)
R3 RIB/FIB
Destination Network
10.1.0.1/32 (R1)
10.1.0.2/32 (R2)
10.1.0.4/32 (R4)
10.1.0.5/32 (R5)
R2
R4
Next Hop
1.1.1.2 (R2)
1.1.2.2 (R3)
1.1.1.2 (R2)
1.1.1.2 (R2)
R2 RIB/FIB
R3
R2
10
10
R2
10
R1
R1 RIB/FIB
Destination Network
10.1.0.2/32 (R2)
10.1.0.3/32 (R3)
10.1.0.4/32 (R4)
10.1.0.5/32 (R5)
R2
10
R2
R2
10
R1
10
Next Hop
1.1.2.1 (R1)
1.1.2.1 (R1)
1.1.4.2 (R4)
1.1.6.2 (R5)
R4 RIB/FIB
Destination Network
10.1.0.2/32 (R2)
10.1.0.1/32 (R1)
10.1.0.5/32 (R5)
10.1.0.3/32 (R3)
Next Hop
1.1.3.1 (R2)
1.1.3.1 (R2)
1.1.3.1 (R2)
1.1.4.1 (R3)
R5 RIB/FIB
Destination Network
10.1.0.2/32 (R2)
10.1.0.1/32 (R1)
10.1.0.4/32 (R4)
10.1.0.3/32 (R3)
Next Hop
1.1.5.1 (R2)
1.1.5.1 (R2)
1.1.5.1 (R2)
1.1.6.1 (R3)
Using the OSPF topology generated above, each router calculates the shortest path tree, i.e. the shortest path
to their respective destinations. The shortest path information is installed at the Routing Information Base
(RIB) and Forwarding Information Base (FIB) of each router (Note: RIB is a routing table managed in the
control plane where routing protocols like OSPF are used while FIB is a routing table located in the data plane
where wire-speed packet forwarding by packet processors takes place).
can have more than one SSIDs, and each SSID may provide different authentication/encryption methods (e.g.
In SK Telecom networks, an AP has 2 SSIDs - T wifi zone_secure and T wifi zone).
00
01
02
03
04
05
06
07
08
09
10
11
12
13
eMBMS/Mobile IPTV
CDN/Mobile CDN
Transparent Caching
BSS/OSS
Services
Cable TPS
Voice/Video Quality
IMS
Policy Control/PCRF
IPTV/TPS
LTE
Mobile
Network
Mobile WiMAX
Carrier WiFi
LTE Backaul
Data Center Migration
Carrier Ethernet
FTTH
Wireline
Network
Data Center
Metro Ethernet
MPLS
IP Routing
CDN
Transparent
Caching
Analysis
Networks
eMBMS
LTE
IMS
Infrastructure Services
Concept Design
DRM
POC
Training
Wi-Fi
protocols
IP/MPLS
Carrier Ethernet
Consulting
Future