OSPF routing protocol
- OSPF routing protocol
- Route redistribution
OSPF routing protocol
Interior Gateway Protocol and Exterior Gateway Protocol
Autonomous system (AS): the area that uses the same protocol.
Interior Gateway Protocol (IGP): the gateway protocol that works in the autonomous system.
Exterior Gateway Protocol (EGP): works between ASs, allowing two independent ASs to connect , Enable communication between them.
AS refers to a collection of routers that are managed by the same technical management organization and use a unified routing strategy.
OSPF is a link state routing protocol
OSPF working process
·Neighbor list
·Link state database
·Routing table
Establish adjacency relationship———>Link state database——>Shortest path tree———>Routing table Use
yourself as the root to calculate the optimal path.
OSPF area
In order to adapt to large-scale networks, OSPF divides multiple areas within the AS.
Each OSPF router only maintains the complete link state information of the area in which it is located.
Area ID
The area ID can be expressed as a decimal number
or as an IP
Backbone area
Responsible for routing information dissemination between
areas Non-backbone areas
Router ID
The IP address that uniquely identifies the router in the OSPF area
Router ID selection rules
Select the IP address with the highest value on the router loopback interface (the loopback network port is equivalent to inside the router).
If there is no loopback interface, select the highest IP address among the physical ports.
You can also use the router-id command to specify the Router ID (the highest priority)
DR and BDR
Establish adjacency relationships in the broadcast network to
form n(n-2)/2 adjacency relationships
Designated Router (DR)
It is to solve the problem of excessive link connections. BDR is equivalent to the meaning of a deputy captain. After DR hangs up, BDR will be used. Other routers can only form adjacency with DR and BDR.
DR and BDR election methods
Automatic election of DR and BDR: The router with the largest router ID on the network segment will be elected as the DR, and the second one will be elected as the BDR.
Manually select DR and BDR: the priority range is 0~255, the larger the value, the higher the priority, the default is 1.
If the priority is the same, you need to compare the Router ID, if the priority of the router is 0, it will not participate DR and BDR elections.
In a live environment, generally speaking, the DR is turned on first, and the BDR is turned on second. Because the election can be completed in about ten seconds, the election may be successful before the second router is turned on. The priority of the router can affect an election process, but it cannot force the DR and BDR that are already in charge to be in the lower position. Only when they are not working can the DR and BDR be replaced.
OSPF multicast address
224.0.0.5 Send Hello packets to each other for election. DR and BDR send messages to DRother
224.0.0.6 DRother sends DR and BDR
OSTF metric value cost
cost=10^8/BW
shortest path is based on the cost specified by the interface (cost) computational
Interface Type | Cost (10^8/BW) |
---|---|
Fast Ethernet | 1 |
Ethernet | 10 |
56K | 1785 |
The smaller the cost value, the better.
OSPF packets are
carried in IP packets, using protocol number 89
OSPF packet type
OSPF packet type | description |
---|---|
Hello bag | Used to discover and maintain neighbor relationships, elect DR and BDR. |
Database Description Package (DBD) | Used to send summary information to neighbors to synchronize the link state database |
Link State Request Packet (LSR) | After the router receives the DBD containing new information, it is sent to request more detailed information |
Link State Update Package (LSU) | Send link state advertisement (LSA) after receiving LSR, one LSU packet may contain several LSAs |
Link status acknowledgement packet (LSACK) | Confirm that DBD/LSU has been received, each LSA needs to be confirmed separately |
OSPF start
Including Down state, Lnit state, 2-Way state, Exstart state, Exchange state, Loading state, Full state.
OSPF network type
OSPF divides the network into four types
Point-to-point network (Point-to-point)
-automatically discover neighbors without DR/BDR, multicast 224.0.0.5
Broadcast MultiAccess (BMA)-automatically
discover neighbors, select DR/BDR, multicast 224.0.0.5, 224.0.0.6None
Broadcast MultiAccess NBMA
-Manually specify neighbors, select DR/BDR, unicast
Point-to-Multipoint network (Point-to-Multipoint)-automatically
discover neighbors , No need for DR/BDR, multicast 224.0.0.5
Features of OSPF
Adaptable to large-scale networks,
routing changes and convergence are fast,
no routing loops,
variable length subnet masks, VLSM,
region division, and
protocol reports sent by multicast addresses
Principle and configuration of OSPF multi-area
Reasons for generating OSPF multi-area
·Improve the scalability of the network
·Quick convergence
Three kinds of traffic of OSPF
Intra- domain traffic The traffic constituted by the exchange of data packets between routers in a single area.
Inter-domain traffic The traffic
constituted by the exchange of data packets between routers in different areas. The
external traffic between
the routers in the OSPF domain and outside the OSPF area or another autonomous system The traffic constituted by the exchange of data packets between routers within.
OSPF router type
Area Border Router (ABR): used to connect area 0 and other areas (used in the division of different areas of the internal protocol)
Autonomous System Border Router (ASBR): used to connect OSPF AS and other external routes (connect external protocols)
OSPF area type
·Backbone area Area0
·Non-backbone area-distinguished according to the type of routing that can be learned
··Standard area
··Stub
area
·· Totally stubby area ··Non-pure stubby area (NSSN)
Peripheral area and complete peripheral area
Areas that meet the following conditions
There is only one default route as the exit
of its area . The area cannot be used as the traversal area
of virtual links. There is no autonomous system border router ASBR in the stub area. It
is not the backbone area Area0
Peripheral area
· No LSA 4.5.7 notification
Complete peripheral area
· Except for an LSA3 default router advertisement, there is no LSA3.4.5.7 advertisement
Router's selection of routing entries
The router only adds the optimal routing directory to the routing table
The basis for selecting routing entries
·Management distance
·Metric value The main purpose of the
stub area and the complete stub area
is to reduce the LSA entries and routing entries in the area, and reduce the occupation of device cpu and memory; the ABR in the stub area and the complete stub area will automatically generate a default route Publish to the peripheral area or completely peripheral area.
OSPF link state database
· Composition of link state database
· Each router has created a database composed of each interface, corresponding adjacent nodes and interface speed.
·· Each entry in the link state database is called LSA (link state communication). There are six common types.
Type code | description | use |
---|---|---|
Type1 | Router LSA | Sent by routers in the area, describing the link status and cost of the router, and transmitted to the entire area |
Type2 | Network LSA | Issued by the DR in the area, describing the change information in the area, and transmitted to the entire area |
Type3 | Network summary LSA | The summary link announcement issued by ABR in other areas, describing the route of a certain network segment in other areas, and transferring between areas |
Type4 | ASBR summary LSA | Issued by ABR, used to advertise ASBR information, determine the location of ASBR, and will not appear in the area where the ASBR belongs |
Type5 | AS external LSA | Issued by ASBR, used to advertise external routes, tell routers in the same AS the path to the external AS, and flood the entire AS |
Type7 | NSSA external LSA | The ASBR in the NSSA area is used to advertise the external routes connected to the area. Similar to Type 5, it is only flooded in the non-pure stub area and will be converted to LSA5 by ABR during delivery. |
Route redistribution
A single IP routing protocol is the preferred solution for IP routing in the management network.
Cisco lOS can execute multiple routing protocols. Each routing protocol and the network served by the routing protocol belong to the same autonomous system.
Cisco lOS uses route redistribution features to exchange routes. Routing information created by different protocols
Route redistribution considerations
Measurement value
Management distance
OSPF redistributes routes
Type 1 external path (Type 1 external path, E1) to redistribute to the route in the OSPF domain , mainly considering the overall cost.
Type 2 external path (Type 2 external path, E2) mainly considers external costs.
OSPF virtual link
Virtual link
Refers to a link connected to the backbone area through a non-backbone area
The purpose of the virtual link
Connecting an area to the backbone area
through a non-backbone area Connecting part of the area on both sides of a segmented backbone area through a non-backbone area
Rules and characteristics of configuring virtual links
The virtual link must be configured between two ABR routers. The
transmission area cannot be a peripheral area
. The stability of the virtual link depends on the stability of the area it passes through. The
virtual link helps provide logical redundancy.