Quick Guide to OSPF
1. Building Shortest Path Tree Topology
► 2. Redistributing External Network Routes into OSPF Network
In the previous post, we explained the procedure of how routers create their network topology maps using Router-LSA messages in an OSPF network, and build the shortest path trees based on link costs.
Below, we will see how OSPF routers learn the routing information of an external network, and build the shortest path to it in case the external network is connected to the OSPF topology discussed in the previous post.
OSPF External Network
The routing information of OSPF-enabled routers is exchanged through Router-LSA (as explained in the previous post), Network-LSA, etc. On the contrary, non OSPF-enabled networks are considered as external networks, and thus their routing information (i.e. external routes), including the followings, can be obtained through AS-External-LSA:
These types of OSPF routers that are connected to external networks "at the borders of an OSPF network" are called Autonomous System Border Routers (ASBR). And they are in charge of injecting the external networks into the OSPF network.
OSPF Network Topology
The figure above shows five OSPF routers (R1 ~ R5), along with their respective interface IP address, OSPF cost and loopback address (i.e. OSPF Router ID, e.g. 10.1.0.1 for R1).
ASBR Advertising External Routing Information to OSPF Internal Routers
1. R1 floods external network (connected network) information
According to its configurations (i.e. redistribute connected subnets in the figure), R1 floods the information of external network 100.1.1.0/24 to R2 and R3 through AS-External-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 AS-External-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.
The AS-External-LSA message sent by R1 includes (see the table in the upper right corner of the figure above):
Upon arrival of the AS-External-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 the shortest path tree connected to the external network, in the OSPF network topology (see the figure in the bottom).
2. R2 floods external network (static route) information
According to its configurations (i.e. static route and redistribute static subnets for connecting to 200.1.1.0/24), R2 floods the information of external network 200.1.1.0/24 to R1, R4 and R5 through AS-External-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.
The receiving routers (i.e. R1, R3, R4 and R5) store the information in their respective OSPF Link State DataBase (LSDB), and build the shortest path tree connected to the external network, in the OSPF network topology (see the figure in the bottom).
Note: There are two options available when flooding external routes to an OSPF network: External Type 1 (E1) and External Type 2 (E2). In the figure above, the E1 (metric-type 1 on CLI) was used.
If more than one E2 route has the same cost and destination, the one with the lowest cost to the ASBR will be used.
R1~R5: Building Shortest Path Trees
For the two external networks (100.1.1.0/24 and 200.1.1.0/24) discussed above, each router builds the shortest path trees, i.e. the shortest path to their destinations. The shortest path information - external network prefixes and next hop for the shortest path - is installed at the Routing Information Base (RIB) and Forwarding Information Base (FIB) of each router (For example, for R5, the next hops for the shortest path to both external networks 200.1.1.0/24 and 100.1.1.0/24 is R2 (1.1.5.1)).
Hello Netmanias.
Nice flowing information station you havev provided here. This I would consider to be a useful reminder for anyone at any level in the industry.
Nice conprehensive diagrams. Great effort. Much appreciated.