Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Basic knowledge of OSPF routing protocol

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Overview

Open shortest path first (Open Shortest Path First,OSPF) is a widely used dynamic routing protocol, which belongs to link-state routing protocol. It has the advantages of fast convergence of routing changes, no routing loop, support for variable length subnet mask (VLSM) and aggregation, hierarchical area division and so on. After using the OSPF protocol in the network, most of the routes will be calculated and generated by the OSPF protocol without manual configuration by the network administrator. When the network topology changes, the protocol can automatically calculate and correct the route, which greatly facilitates the network management. However, if the use is not combined with the specific network application environment, without detailed planning, the effect of OSPF protocol will be greatly reduced, and even lead to failure.

OSPF protocol is a link-state protocol. Each router is responsible for discovering and maintaining the relationship with its neighbors, describing the known neighbor list and link cost LSU (Link State Update) messages, learning the network topology of the whole autonomous system through reliable flooding and periodic interaction with other routers in the autonomous system AS (Autonomous System), and injecting routing information of other AS through the routers at the boundary of the autonomous system to get the routing information of the whole Internet. Every other specific time or when the link state changes, the LSA is regenerated, and the router advertises the new LSA through the flooding mechanism in order to achieve real-time routing updates.

One or four routing types

DR designator

When the multiaccess network changes, DR is responsible for updating all other routers.

BDR backup designated router

BDR monitors the status of the DR and takes over its role if the current DR fails.

ABR area Border Router

ABR is used to connect backbone areas and non-backbone areas, and the connection between it and backbone areas can be either physical or logical.

ASBR Autonomous system Border Router

ASBR routers are used to inject routes learned by other routing protocols into the OSPF domain by route selection redistribution.

Two and five regions

1. Backbone area (Area0)

two。 Non-backbone areas-distinguished according to the types of roads that can be learned

(1) Standard area

(2) Terminal area (stub)

(3) complete stubs (Totally stubbby)

(4) impure terminal region (NSSA)

Third, fifth big data bag type

Hello package

It is sent periodically (directly connected network segment), and the packet has router ID, holding time 40s, priority of router, neighbor information, area ID,DR, BDR, password,stub area marks; (that is, send to see if the other party is dead)

Database description package (DBD)

This package is actually a summary of LSA and is used for comparison (like a book catalog)

Link-state request packet (LSR)

After DBD comparison, I find that I have less lsa in DBD and will send the package (the directories of the two books are different, less to more)

Link-state update package (LSU)

After receiving the LSR, send your lsa to the few routers. (give him more directories and let him ask for more from less than mine.)

Link-state acknowledgement packet (LSAck)

Send a confirmation after receiving the LSA, (I got it! Thank you! )

IV. OSPF link state

1. Composition of link-state database

(1) each router creates a database of each interface, corresponding neighboring nodes and interface speed.

(2) each entry in the link-state database is called LSA (link-state advertisement), and there are six common LSA types.

two。 Link-State advertisement (LSA) Typ

Type1 router LSA issued by routers in the area (all routes)

Type2 network LSA issued by DR in the area (announcing network status information)

Type3 network summary link advertisements issued by LSA ABR in other areas (summary switching)

Type4 ASBR summarizes the messages sent by LSA ABR to advertise ASBR information (tell ASBR location)

Issued by Type5 AS external LSA ABR to advertise external routes (diplomat)

External routes sent by ASBR within the external LSA NSSA area of the Type6 NSSA for local area connections

Fifth, the establishment of OSPF adjacency (seven states)

The first stage of 1.OSPF startup is the process of establishing two-way communication using hello messages.

The second stage of 2.OSPF startup is to establish a full adjacency.

Down

In the Down state, the OSPF process has not exchanged information with any neighbors. OSPF is waiting to enter the Init state.

Init OSPF routers send type 1 (Hello) packets at regular intervals (the default is 10s) to establish a special relationship with neighboring routers.

2-Way

Each OSPF router uses packets to attempt to establish two-way state or two-way communication with all neighboring routers in the same IP network. The Hello packet contains a list of OSPF neighbors known to the sender. When a router sees itself in an Hello packet of a neighboring router, it enters a two-way state.

ExStart

Each OSPF router uses packets to attempt to establish two-way state or two-way communication with all neighboring routers in the same IP network. The Hello packet contains a list of OSPF neighbors known to the sender. When a router sees itself in an Hello packet of a neighboring router, it enters a two-way state.

Exchange

In the switched state, neighboring routers use type 2 DBD packets to send their link-state information to each other, that is, routers describe their link-state databases to each other. Routers compare what they have learned with their existing link-state database and individually acknowledge each DBD packet. If any router receives link information that is not in its database, the router requests complete update information about the link from its neighbors. The complete routing information is exchanged in the "Loading" state.

Loading

In the switched state, neighboring routers use type 2 DBD packets to send their link-state information to each other, that is, routers describe their link-state databases to each other. Routers compare what they have learned with their existing link-state database and individually acknowledge each DBD packet. If any router receives link information that is not in its database, the router requests complete update information about the link from its neighbors. The complete routing information is exchanged in the "Loading" state.

Full

When the loading state is over, the router enters the full adjacency state. Each router keeps a list of neighboring routers, which is called an adjacent database.

VI. OSPF working process

VII. Internal Gateway Protocol and external Gateway Protocol

(1) Autonomous system (AS)

(2) Interior Gateway Protocol (IGP), such as RIP, OSPF, ISIS, etc.

(3) external Gateway Protocol (EGP), such as BGP, etc.

VIII. The basic concept of OSPF

1.OSPF region

(1) in order to adapt to large networks, OSPF divides multiple areas within the AS.

(2) each OSPF router only maintains complete link-state information in its area.

two。 Regional ID

(1) the region ID can be expressed as a decimal number

(2) it can also be expressed as an IP

3. Backbone area Area 0

(1) responsible for the dissemination of routing information between regions

4.Router ID

(1) the IP address that uniquely identifies the router in the OSPF area

5.Router ID selection rules

(1) Select the IP address with the highest value on the router loopback interface (recommended)

(2) if there is no loopback interface, select the one with the highest IP address in the house port (not recommended)

(3) you can also use the router-id command to specify Router ID

The election method of 6.DR and BDR

Automatic election:

The largest router of Router ID on the network segment will be elected as DR, and the second largest will be elected as BDR.

Manual elections:

(1) priority ranges from 0 to 255. The higher the value, the higher the priority. Default is 1.

(2) if the priority is the same, Router ID needs to be compared.

(3) if the priority of the router is set to 0, it will not participate in the election of DR and BDR.

The election process of 7.DR and BDR

(1) the priority of a router can affect an election process, but it cannot force the replacement of an existing DR or BDR router

Multicast address of 8.OSPF

(1) 224.0.0.5

(2) 224.0.0.6

The metric COST of 9.OSPF

(1) COST= 10 ^ 8 / BW cost (the smaller the value, the better)

(2) the shortest path is calculated based on the cost specified by the interface (cost)

10.OSPF packet

(1) it is carried in an IP packet using the protocol number 89.

Network type of 11.OSPF

(1) Point to point

(2) broadcast multiple access network

(3) non-broadcast multiaccess network

(4) Point to multipoint

IX. Configuration commands for OSPF

Start the OSPF routing process rout ospf process-id

Specify the interface and area network addresss invers-mask area area-ad on which the OSPF protocol runs

View routing table information (directly connected / learning) show ip route

View only the routing show ip route ospf learned by OSPF

View OSPF protocol configuration information show ip protocol

View how OSPF is configured and ABR information show ip ospf

View all LSA data information show ip ospf database in LSDB

View OSPF configuration information on an interface

Show ip ospf interface

View the status of OSPF neighbors and adjacencies show ip ospf neighbor

View details of OSPF neighbors (including DR/BDR) show ip ospf neighbor detail

View the whole process of router "adjacency" debug ip ospf adj

View the information of each OSPF packet debug ip ospf packet

Clear the routing table clear ip route

Example of inverse mask:

10. Three kinds of traffic of OSPF

(1) intra-domain traffic

Traffic formed by the exchange of packets between routers in a single area

(2) Inter-domain traffic (ABR)

Traffic formed by exchanging packets between routers in different areas

(3) external traffic (ASBR)

Traffic formed by the exchange of packets between a router in an OSPFR domain and a router outside the DSPF area or within another autonomous system

11. Application environment of OSPF

1. Consider the use of OSPF from the following aspects

(1) Network size

(2) Network topology

(3) other special requirements

(4) requirements of the router itself

Characteristics of 2.OSPF

(1) adaptable to large-scale networks

(2) the convergence speed of route change is fast.

(3) No routing ring

(4) support variable length subnet mask VLSM

(5) support regional division

(6) support sending protocol packets with multicast addresses.

12. The reasons for the generation of OSPF multi-regions

(1) improve the scalability of the network

(2) Fast convergence

XIII. Router types of OSPF

According to their location in AS, OSPF routers can be divided into the following four categories:

Area Router (Internal Routers)

All interfaces of this type of router belong to the same OSPF area.

Area Border Router ABR (Area Border Routers)

Such routers can belong to more than two areas at the same time, but one of them must be a backbone area. ABR is used to connect backbone areas and non-backbone areas, and the connection between it and backbone areas can be either physical or logical.

Backbone router (Backbone Routers)

At least one interface of this type of router belongs to the backbone area. Therefore, all ABR and internal routers located in Area0 are backbone routers.

Autonomous system Border Router ASBR (AS Boundary Routers)

The router that exchanges routing information with other AS is called ASBR. ASBR is not necessarily located at the boundary of AS, it may be the router in the area, or it may be ABR. As long as an OSPF router introduces information about external routes, it becomes an ASBR.

XIV. Router's selection of routing entries

1. The router only adds the optimal routing entries to the routing table

two。 Basis for selecting route entries

(1) Pipeline distance

(2) Measurement

3. Routing entries for load balancer

15. Stub area and complete stub area

1. Areas where the following conditions are met

(1) there is only one default route as the exit of its area

(2) the area cannot be used as the crossing area of the virtual link.

(3) Stub area boundary router without autonomous system ASBR

(4) Area 0 is not a backbone region.

two。 Terminal area

(1) No LSA4, 5, 7 notices

3. Complete stub area

(1) except for LSA3 default route advertisements, there are no LSA3, 4, 5, 7 advertisements

XVI. Route redistribution

1. Understand routing redistribution

(1) A single IP routing protocol is the preferred scheme for managing IP routing in a network.

(2) Cisco IOS can execute multiple routing protocols, each of which belongs to the same homemade system as the network served by the routing protocol.

(3) Cisco IOS uses the route redistribution feature to exchange routing information created by different protocols

two。 Consideration of route redistribution

(1) Measurement

(2) Pipeline distance

3. Path types redistributed to the OSPF domain

(1) external path of type 1 (Type 1 external path,E1)

(2) external path of type 2 (Type 2 external path,E1)

4. Router A has two paths to the external destination network 10.1.2.0

(1) E1 type

The cost of path A-B-D is 25 (20 / 5)-priority

The cost of path A-C-D is 48 (1830)

(2) E2 type

The cost of path A-B-D is 20.

The cost of path A-C-D is 18p / m-priority

5. Route redistribution configuration

(1) grammar:

Redistribute protocol [metric metric-value] [metric-type type-value] [subnets]

(2) example

Router rip

Redistribute ospf 1 metric 10

Router ospf 1

Redistribute metric 200 subnets

XVII. NSSA region

The 1.NSSA area is an addendum to 0OSPF RFC

(1) Special LSA type 7 is defined.

(2) provide advantages similar to stub area and totally stibby area

(3) can include ASBR

2.OSPF link-state advertisement

(1) LSA7 (NSSA External LSA,NSSA external LSA)

3.NSSA area redistribution route type

(1) N1, N2

(2) convert to E1 and E2 after ABR in NSSA region

4. Configure NSSA area command

(1) grammar

Area area-id nssa [no-summmary]

XVIII. Summary

1. Six kinds of common LSA

LSA1 、 LSA2 、 LSA3 、 LSA4 、 LSA5 、 LSA7

Path type of 2.OSPF

Intra-area path, out-of-area path, external path of type 1, and external path of type 2

19. Summary of OSPF addresses

1. Action

(1) Save resources by reducing the number of LSA flooded

(2) Resources can be saved by shielding some details of network instability.

(3) reduce the route entries in the routing table

two。 Interarea route summary configuration

(1) grammar

Area area-id range ip address mask

3. External route summary configuration

(1) grammar

Summary-address ip adress mask

20. OSPF virtual link

1. Virtual link

(1) A link connected to a backbone area through a non-backbone area

two。 The purpose of the virtual link

(1) connect to a region to a backbone area through a non-backbone area

(2) connect to a segmented backbone area through a non-backbone area.

3. Rules and characteristics of configuring virtual links

(1) the virtual link must be configured between two ABR routers

(2) the transmission area cannot be a stub area.

(3) the stability of the virtual link depends on the stability of the area it passes through.

(4) Virtual links help to provide Logitech redundancy.

4. Virtual link configuration command

(1) grammar

Area area-id vritual-link router-id

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report