当前位置:网站首页>OSPF summary
OSPF summary
2022-07-04 10:20:00 【Attiude】
OSPF summary
OSPF(open shortest pass first Open shortest path first )
Attached is the mind map
Basic concepts
characteristic
- 1、OSPF It is a classless link state routing protocol , Cross layer packaging to three layers , Agreement No 89;
- 2、 Multicast address :224.0.0.5(BDR Multicast address ) and 224.0.0.6(DR The multicast address of );
- 3、 Work based on Topology , A lot of updates —— Need structured deployment —— Zoning 、 Address partition ;
- 4、 The convergence rate is very fast , But large network configurations are complex .
- 5、OSPF Measure : Metrics for all outgoing interfaces from source to destination , It's inversely proportional to the interface bandwidth (10^8/ bandwidth )
ospf Five data packets
1、hello package – Multicast sending and receiving , For neighbors 、 The discovery of adjacency 、 establish 、 Life cycle
2、DBD – Database description package -- Local LSDB( Link state database ) Catalog
3、LSR— Link status request – It is used to query the local unknown of the opposite end LSA Information
4、LSU-- Link status update – For sharing every specific LSA Information
- LSA– Link status notification – Specific one by one Routing or topology information , Not a packet , be-all LSA It's using LSU This kind of packet is forwarded ;
5、LSack Link status confirmation – Confirmation package
ospf7 Class state machine
1、Down: Once it's sent out locally hello The package goes to the next state ;
2、Init initialization : Received locally hello There are local RID Go to the next state ;
3、Two-way Two-way communication : A sign of neighborhood building ;
Condition matching from neighbor to adjacency : Point to point networks go straight to the next state ;MA The Internet is going to be DR/BDR The election of (40s), Not DR/BDR Don't go to the next state ;
Between neighbors hello Some parameters in the package must be completely consistent , Otherwise, you can't establish a neighbor relationship ;
Hello and dead time 、 Area ID、 Certification parameters 、 Terminal area markers ; In addition, in Huawei's equipment OSPF The interface between neighbors is required to be configured ip Address , The mask length must be consistent ;MA In the network DR and BDR Comparison order of election information
- First, compare the manually set RID– If none or equal -> Loopback interface IP– If none or equal -> Interface number
4、Exstart Pre start : Use similar hello Of DBD Conduct a master-slave election ,RID Major , The Lord has priority to enter the next state ;
5、Exchange Quasi exchange : Use real DBD Package for database directory sharing , need ack;
6、Loading load : Use LSR/LSU/LSack Get unknown LSA Information ;
7、Full forward : A sign of the establishment of adjacency .
ospf Routing table synchronization process
- After the adjacency relationship is established , Meet the conditions and enter the next state , adopt DBD/LSR/LSU/LSAck To synchronize information .
- After the database table synchronization is completed , The interaction between neighbors is completed , only hello Bao Huo Bao ; Then local based database tables ;
- Convert to directed graph , Then it is transformed into a tree structure , Finally, the shortest local path to all unknown network segments , Loaded in the local routing table
ospf Three tables
Link state database table
- List information about other routers in the network , This shows the network topology of the whole network
Neighborhood watch
- List all neighbor routers that have established adjacency relationship for each router
Routing table
- List through SPF The algorithm calculates the best path to each connected network
OSPF The interface network type of
1、 Point to point : DA 224. 0. 0. 5( Even if the setting nei ghbor Also multicast updates ), A pair of routers form an adjacency relationship . nothing DR, Each subinterface belongs to a different IP subnet .
2、 Point to point : DA: 224. 0.0. 5 ( Even if the setting neighbor Also multicast updates ), nothing DR, The same IP subnet .Ptp and ptmp Can't form neighbors ( stay PTMP in hello-interval 30 dead -interval 120)
MGRE You can build different topologies :
- 1、 Star type – Center to site – Radial The central site is DR, Cancel BDR
- 2、 The whole company — No more attention is needed DR
- 3、 Partially reticulated — Based on the normal sharing in the whole network segment LSA To consider the best DR Location
3、 Point to multipoint non broadcast : DA: unicast , nothing DR, same IP subnet .
4、 NBMA: DA: unicast , choose DR (DR and BDR Must be directly connected to all other routers ), Same as - -IP subnet . Fully or partially interconnected .
5、 radio broadcast : The election DR, All routers send messages to 224.0.0.6 (DR Listen to this address ), then DR Send a message to 224.0.0.5,DR Establish adjacency with all routers , Between all routers to 2way state ( Even if the setting neighbor Also multicast updates ). same IP subnet , Fully or partially interconnected .
6、 Feature summary :
- You don't have to vote for a family DR and BDR
- Multiple access requires elections DR and BDR
- If you are not broadcasting, you have to specify your neighbors manually , All non broadcast updates are unicast
- neighbor Designated after the order cost It works only if it's not broadcast
OSPF Irregular region problem
Non backbone and discontinuous backbone far away from the backbone
1、tunnel In the backbone area and illegal ABR Build a tunnel between , The tunnel link is then declared to OSPF Agreement
- 1) Periodic hello And update , Including triggering updates , The middle crossing area will be occupied uniformly ;
- 2) Poor route selection
2、OSPF Virtual link of
By illegal ABR equipment , Through the legal of the direct connection area ABR To authorize , To forward the route , Because there are no new links , Therefore, there is no problem of poor route selection
- shortcoming : Two on the virtual chain ABR The problem of periodic resource occupation between ;
- 1) In Cisco , Cancel the cycle behavior of two devices ,hello、 Updates are sent and received once ;-- unreliable
- 2) In Huawei , Retention period -- Take up resources
- Multi process bidirectional republication
- ospf Multi process : Multiple processes on a router , Each process has its own database , Calculate routing entries independently , And calculate all that are not shared ; Finally, all the best paths are loaded into the same routing table ;
- An interface of a router can only work in one process ;
- It can be used to solve irregular areas , Work irregular locations in different processes , Realize separation , Then we use the republishing technology to share the routing table ; It solves the problems of poor route selection and resource occupation
7 class LSA
- LSA Type1:router LSA Generated by each router for its region LSA, Describe the status and cost of the router link in this area . A border router may generate multiple LSA TYPE1.
- LSA Type2: from DR produce . It contains all link status and cost information connected to a regional router . Only DR This information can be monitored .
- LSA Type3: from ABR produce , contain ABR Connection information with local internal router , Can describe this area to area0 Link information . It usually summarizes the default routes instead of transmitting the summarized OSPF Information to other networks .
- LSA Type4: from ABR produce , Sent from the trunk area to other areas ABR, contain ASBR Link information , And LSA TYPE 3 The difference is that TYPE 4 Describe to OSPF External routing of the network , and TYPE 3 Then describe the route in the region .
- LSA Type5: from ASBR produce , Contains information about links outside the autonomous region . Except for stub area and full stub area ,LSA TYPE 5 Send throughout the network .
- LSA Type7: from ASBR About NSSA Information about .LSA TYPE 7 Can be converted to LSA TYPE 5.
OSPF Optimize – Reduce LSA Update quantity of
1、 Summary — Reduce the number of routing entries in the backbone area
OSPF The protocol does not support interface summary , In an area , Topological information is transmitted between adjacency , Cannot summarize ; Therefore, it can only be summarized at the boundary equipment of interactive routing
- 1) Inter domain routing summary – Between regions ABR On , Perform summary configuration when interacting with inter area routing entries
- 2) Extraterritorial routing summary —ASBR The external routing entries are passed through the republication protocol , Share to OSPF In the agreement , You can summarize
2、 Special area -- Reduce the number of routing entries in non backbone areas
non-existent ASBR situation
- The terminal area – Refuse 4/5 Class LSA; The backbone area is connected by this area ABR Post a message to this area 3 Class
- 2) Completely peripheral area Based on the peripheral region , Further reject 3 Class LSA; Keep only one 3 Class
First, configure all routers in the whole area as the end area ; Then only in the area connecting the backbone ABR Complete configuration on the
There is ASBR situation
NSSA Incomplete ending area
- 1) The area rejects 4/5 class LSA, The backbone area is connected by this area ABR Send a message to the area 7 Class ; When importing an extraterritorial route, the ASBR be based on 7 Class import , Connect the backbone through this area ABR When passing to the backbone area , Convert to 5 Class enters the backbone area ;
Completely NSSA
- stay NSSA On the basis of , Further reject 3 class LSA, The backbone area is connected by this area ABR Post a message to this area 3 Class ,
- First, configure the area as NSSA Area , After that, only the backbone is connected in this area ABR Complete configuration on the
ospf Extended configuration
1) authentication
effect : Between directly connected neighbors or neighbors , Configure an identity verification key to protect neighbors 、 Security of data communication between neighbors
1) Interface authentication
Configure... On the interface of direct connection
Patterns at both ends 、 Number 、 The secret key must be completely once- ospf authentication-mode md5 1 cipher 123456
2) Regional certification
Connect the router R1, All belong to area 1 All interfaces shall be certified
- authentication-mode md5 1 cipher 123456
3) Virtual link authentication
- vlink-peer 9.9.9.9 md5 1 cipher 123456
2) Silent interface
Definition and function
- Router connection PC Interface of terminal equipment , These interfaces are accessible to the whole network , Will be declared in the routing protocol ; Therefore, these interfaces will also periodically send routing protocol information to the terminal below , Cause resource occupation , And safety issues ; Therefore, these interfaces need to turn off sending RIP/OSPF Wait for protocol packet behavior
- Remember not to configure the backbone interface between the router and the router , It will cause neighbors to be unable to send and receive routing information , Unable to establish neighbor relationship
Configuration information
- [r2]ospf 1
- [r2-ospf-1]silent-interface GigabitEthernet 0/0/2
3) Speed up convergence
- By modifying the relationship between neighbors hello and dead time, Can achieve faster convergence , But if the frequency is too high, it will occupy more hardware resources ; so hello time by 10s when , It's not recommended to speed up ; hello time by 30s It can be modified as appropriate ;
- Between neighbors hello time and dead time Must complete consistent , Otherwise, you can't establish a neighbor relationship ;
- Modify the local hello time, Local dead time Automatically 4 Matched by relationships ; The end-to-end time remains the same , The configuration of both ends needs to be completely consistent manually ;
- [r2-GigabitEthernet0/0/0]ospf timer hello 10
4、 Default route
1)3 Class default
- Special areas are automatically generated : Peripheral 、 Complete endings 、NSSA、 Completely NSSA
- Peripheral 、 Complete endings 、 Completely NSSA this 3 Special areas in , After the configuration is completed , The backbone area is connected by this area ABR Send... To the inside of the area ;
- In Huawei equipment ,NSSA And completely NSSA, After the configuration is completed , The backbone area is connected by this area ABR Release internally 7 Class ;
- So completely NSSA Will have 3 Classes and 7 There are two default classes , Internal is better than external , So trust 3 class ;
2)5 Class default -- External routing , Republished
In the routing table of the local router , After there is a default route generated in any way , By special instructions , Republish it to OSPF Agreement ;
[r9-ospf-1]default-route-advertise
- The default route obtained by other means in the local route table , Republish to internal OSPF Agreement Default import type 2 route
[r9-ospf-1]default-route-advertise always
- Force republication of default routes – Even if there is no default route in the local route table , It also forces a default route to be published internally Default import type 2 route
[r9-ospf-2]default-route-advertise type 1
- Change to type 1;
3)7 Class default
NSSA Or completely NSSA, Automatically connect the backbone from this area ABR issue , But in complete NSSA There will also be 3 Class default , So completely NSSA in 7 Class defaults to meaningless ; Default 5 Class is also a type 2;
[r6-ospf-1-area-0.0.0.3]nssa default-route-advertise
- By hand 7 Class default , The premise is NSSA In the region
Priority of route selection
- Internal is better than external so 3 Class is better than 5/7
- If both are 5 class Or both 7 class type 1 Better than type 2 The same type , Compare priorities , Same priority comparison cost value , Fully consistent load balancing ;
- if 5、7 Class encounter , type 1 Better than type 2; The same type , Compare priorities , Same priority comparison cost value , Exactly the same 5 Class is better than 7 class ;
边栏推荐
- Hands on deep learning (35) -- text preprocessing (NLP)
- 直方图均衡化
- Dos:disk operating system, including core startup program and command program
- 智慧路灯杆水库区安全监测应用
- Safety reinforcement learning based on linear function approximation safe RL with linear function approximation translation 1
- Architecture introduction
- The time difference between the past time and the present time of uniapp processing, such as just, a few minutes ago, a few hours ago, a few months ago
- Matlab tips (25) competitive neural network and SOM neural network
- Idea SSH channel configuration
- 入职中国平安三周年的一些总结
猜你喜欢
Dynamic address book
Some summaries of the third anniversary of joining Ping An in China
Summary of reasons for web side automation test failure
MongoDB数据日期显示相差8小时 原因和解决方案
PHP代码审计3—系统重装漏洞
技术管理进阶——如何设计并跟进不同层级同学的绩效
Normal vector point cloud rotation
Number of relationship models
For programmers, if it hurts the most...
Intelligent gateway helps improve industrial data acquisition and utilization
随机推荐
Exercise 7-3 store the numbers in the array in reverse order (20 points)
Reprint: summation formula of proportional series and its derivation process
PHP代码审计3—系统重装漏洞
Dynamic address book
Today's sleep quality record 78 points
Qtreeview+ custom model implementation example
libmysqlclient. so. 20: cannot open shared object file: No such file or directory
Rhcsa - day 13
Hands on deep learning (40) -- short and long term memory network (LSTM)
What is devsecops? Definitions, processes, frameworks and best practices for 2022
华为联机对战如何提升玩家匹配成功几率
直方图均衡化
Normal vector point cloud rotation
System. Currenttimemillis() and system Nanotime (), which is faster? Don't use it wrong!
Latex error: missing delimiter (. Inserted) {\xi \left( {p,{p_q}} \right)} \right|}}
Leetcode48. Rotate image
Hands on deep learning (46) -- attention mechanism
If the uniapp is less than 1000, it will be displayed according to the original number. If the number exceeds 1000, it will be converted into 10w+ 1.3k+ display
六月份阶段性大总结之Doris/Clickhouse/Hudi一网打尽
Hands on deep learning (45) -- bundle search