OSPF theory

1. OSPF theory

insert image description here
1. OSPF is the most commonly used IGP interior gateway protocol, and it is the only link state-based dynamic protocol introduced in CCNA.
IS-IS is a link-state-based dynamic protocol introduced in CCIE. Campus Network, Advanced Distance Vector (EIGRP), Distance Vector (RIP).
o:open SPF (SHORTEST PATH FIRST) is its algorithm. The shortest path is first, which depends on the COST value, and the COST value is obtained according to the bandwidth. The higher the bandwidth, the smaller the COST value, and the higher the priority of the path.
Why use COST instead of bandwidth to calculate the shortest path?
Because the bandwidth of a link can only reflect the minimum link status, the entire link will be limited by the minimum bandwidth 10. If the bandwidth is used, it cannot reflect the overall status of the link.
The COST is the accumulation of the bandwidth of each link (10^8/interface bandwidth), which can reflect the comprehensive status of the link, so the COST is used instead of the bandwidth to calculate the shortest path. The shorter the shortest path, the better.
insert image description here
GP routing protocol can only be used in the same autonomous system. The routing protocol of different autonomous systems should use BGP (CCIE)
CIDR: no classification;
VLSM: variable subnet mask;
OSPF distinguishes priority through the Code in the routing entry:
O: routing entry in the area (CCNA)
O IA inter-area routing entries (extended knowledge)
OE route redistribution routing entries (extended knowledge)
ON special area routing entries.
Fast convergence: the routing information can be recalculated soon. Triggered
update: the routing information is updated only when there is a change, and only the changed routing entries (incremental update) are updated.
Multicast update (224.0.0.5DR other and 224.0.0.6 (DR and BDR))
insert image description here
The picture on the left tells us the general operating principle of OSPF:
1. After configuring OSPF, each routing device will send an LSA (Link State Advertisement packet) to the neighbor router
. Information, that is, which links the router can reach, is sent to neighboring routers, and the information contained mainly includes information such as my network type and COST value. Routers send LSAs to each other, for example, R1 sends to R2, R2 directly copies a copy to R3, sends it back and forwards, COPY to copy, and finally all routers R1, R2, and R3 will receive the same number of LSAs, and all The LSAs are summed together to form the LSADATABASE (link state database). In principle, if everyone sends LSAs to each other, the final LSDB is the same. In order to ensure that everyone is the same, LSDB has a synchronization mechanism. The LSDB of each router will be flooded every 30 minutes, so as to ensure that my neighbor router and my LSDB are consistent. If the LSA information is not resent, the entry is aged (dead). Next, according to the COST information of each link in the link state database, use the SPF algorithm to calculate the best Path (the path with the smallest COST value), put this shortest path into the routing table.
Summary: Everyone sends LSA to each other to form an LSDB. After the LSDB is synchronized in the area, the SPF algorithm is used to obtain the shortest path and form the routing table of each router.
insert image description here
There are two paths from R1 to R4 that can be selected, but in the end there is only the path R1-R2-R4 in the routing table, because the cost value of this path is 30, and the cost value of R1-R3-R4 is 40, so choose the cost value The smallest one is taken as the shortest path and put into the routing table of R1.
The area is the most important manifestation of OSPF hierarchy, and is the core of OSPF. When the network is relatively large, we need to divide the network into different levels, namely the backbone area (the area number is 0) and the non-backbone area (not 0, There is no priority distinction between area 1, area 2...) All non-0 areas are attached to area 0 through the area border router (ABR), and only the routers attached to the backbone area 0 can communicate. C, The three routers D and E are ABRs.
insert image description here
In OSPF, the boundary of the area is on the router, while the boundary of IS-IS is on the link.
The three routers C, D, and E are ABRs. The area border router is in the middle of two areas. For example, router C belongs to area 0 and area 1 and is the connection point of the two areas. A and B are backbone routers, and F, G, and H are intra-area routers.

insert image description here
Router A is also connected to an external routing area (this area does not run OSPF, such as running other protocols such as RIPv2 or EIGRP), and router A is also called an autonomous system router (ASBR). What is the advantage of dividing the area
?
Everyone is in the same area, that is, single-area OSPF, and there must be area 0, so we generally refer to single area as area 0, which is also the focus of CCNA courses.
But if everyone is in area 0, it doesn't matter if the network is small, what problems will there be when the network is large? For example, if there are 10 routers, and each router has 100 LSAs, the 10 routers will have 1000 LSAs. In the end, everyone needs to synchronize. Whether it is overhead or efficiency will be adversely affected. It can be divided from a certain router.
The routers in the left and right areas only need to calculate 500 LSAs, and the middle router summarizes the LSAs of the left and right routers to form an LSDB, that is, calculates 1000 LSAs, thereby reducing the LSDB of the left and right routers.

Reduce routing entries

You can summarize inter-area and external routes to reduce routing entries.

Limit topology changes to a specific range

insert image description here

Various changes in the area will not affect other areas, so the jitter of OSPF will be reduced. Changes in Area 1 only need to be known by Router C.

All non-zero areas must be connected to area 0 if they want to communicate. If an area 4 is attached to area 1, communication between area 1 and area 4 is impossible, and area 4 and areas 0, 1, 2, and 3 cannot communication.

insert image description here

2. Regional examples

insert image description here
Two situations cause the area to be linked to area 0. One is that the router ports in area 0 are exhausted, and the other is that area 4 is too far away from area 0. At this time, a virtual link (VL) can be built to implement the area. 4 Communication with area 0.
There is also a need to build a virtual link (VL), that is, to build a backup virtual link between area 1 and area 15, so that when area 1 goes down, the backup virtual link can be used.
insert image description here
There can only be one area 0 in the network, which acts as an anti-loop function. The loops in areas 1, 2, and 3 are detected by area 0. Because area 0 is unique, it will not cause loops. Area 0 It is responsible for the transmission between regions and plays a ring-proof function.

Guess you like

Origin blog.csdn.net/weixin_68310290/article/details/124916761