OSPF Day

Huawei configure DHCP pond:
dhcp enable to enable DHCP service
ip pool a pond created A
Gateway-List specifies the gateway 192.168.1.1
Network mask 255.255.255.0 192.168.1.0
dns-List 8.8.8.8
and then turn on the need to address the issue under the router interface function
[R1] interface of GigabitEthernet 0/0/0
[R1-the GigabitEthernet0 / 0/0] Global DHCP SELECT

Dynamic routing protocol : Construction direct neighbor relationship between routers communicate with each other to share information, to acquire the unknown routing information; after calculating algorithms based on different local best path of all known networks, then load it to the routing table.
Classification:
1. AS-based routing protocol is divided into two kinds of IGP and EGP
AS- autonomous system number 0-65535 extended standard two-byte AS Number 4 bytes;
1-64511 64512-65535 public private
within an AS using / OSPF / EIGRP / ISIS IGP- interior gateway routing protocol -RIP
use EGP- exterior gateway routing protocol between AS -EGP / BGP

2.IGP
1) whether carry the mask-based update - there are categories (no carry), Classless (carry - can be subnetting, summary)
2) Based on the characteristics of the work - the distance vector type RIP / EIGRP- neighbors direct inter share routing table - routing entry based on the convergence
link state type OSPF / ISIS- shared topology - based convergence LSA

Two, Open Shortest Path First OSPF protocol
is currently the most widely used IGP protocol; Classless link state routing protocol;
biggest drawback OSPF protocol, wherein an enormous amount of convergence based on the topology update;
so designers in the design process of OSPF protocol , using a number of mechanisms to reduce the amount of update deployment configuration ------
1. zoning - a single pass for each router topology local area arrival so calculated shortest path between the unknown area of the network after the completion of the calculation is transmitted routing entry information
2. reasonable IP address planning - an area can be aggregated into a single network segment as the best
3. special area
4.30min cycle update

1.OSPF five packets
Hello packets found, establish, keep alive cycle neighbor, adjacency
DBD package - Database description packets local database directory (Summary)
LSR package - link status query query based on information unknown DBD package
LSU for reply link state update peer LSR, carrying various LSA
confirmed LSACK link state acknowledgment packets, reliability guarantee

OSPF packets encapsulated in the cross-layer layer header 3
Here Insert Picture Description

2.OSPF的状态机
1)Down:一旦进行hello的收发,进入下一状态
2)init初始化:接收到的hello包中存在本地的route-id,进入下一状态
3)two-way双向通信:邻居关系建立的标志;
条件匹配:匹配失败保持邻居关系,仅hello包周期保活即可
匹配成功进入下一状态机;
4)exstart预启动:使用类似hello的DBD进行主从关系选举,route-id数值大为主;优先进 入下一状态;类hello的DBD包:不携带拓扑信息
5)exchange准交换:使用真正的DBD包进行数据库目录的共享;
6)loading加载:使用LSR/LSU/LSACK来获取未知的LSA信息;
7)full转发:邻接关系建立的标志;

3.OSPF的工作过程
启动配置完成后,路由器开始组播(224.0.0.5)收发OSPF的hello包;若接收到的hello包中存在本地的route-id,建立邻居关系,生成邻居表;
之后基于表格中所有的邻居进行条件匹配,匹配失败将维持邻居关系,仅hello包周期保活即可;
匹配成功者间可以建立邻接关系;邻居间使用DBD进行数据库目录的比对;之后使用LSR查询目录中未知的LSA信息,对端使用LSU来携带传递LSA,最终需要LSACK进行接受确认;
当本地收集到区域内的所有设备的LSA后,生成LSDB----链路状态数据库表;
本地基于LSDB启用SPF算法,计算到达所有未知网段的最短路径,然后将其加载到路由表内;
收敛完成,仅hello包周期保活所有的邻居和邻接关系;每30min周期进行DBD包的收发来进行纠错;

结构突变:
1、新增网段—直连新增网段设备使用DBD来告知所有邻居,邻居进行LSR/LSU/LSACK收敛
2、断开网段—断开新增网段设备使用DBD来告知所有邻居,邻居进行LSR/LSU/LSACK收敛
3、无法沟通—dead time和最大老化来解决
正常邻居间存在hello包,若超过dead time依然没有hello包,断开邻居关系,删除从该邻居处学习到的所有信息
若邻居关系依然正常,但每30min的周期没有正常进行,每条LSA后方存在一个老化时间,默认最大为3609s;到达最大老化时间时删除LSA信息即可;

名词:
LSA:链路状态通告;在不同条件下存在不同类别的LSA,用于携带拓扑或路由
LSDB:链路状态数据库;所有LSA的集合
OSPF的收敛行为----OSPF的LSA洪泛
OSPF的LSDB同步

四、OSPF的基本配置
[r1]ospf 1 router-id 1.1.1.1 启动时需要定义进程号,仅具有本地意义; 建议同时配置ROUTER-ID;
(手工—环回最大数值IP地址—物理接口最大数值IP地址)

宣告:
[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 12.1.1.2 0.0.0.0
[r2-ospf-1-area-0.0.0.0]network 2.2.2.0 0.0.0.255
[r2-ospf-1-area-0.0.0.0]q
[r2-ospf-1]area 1
[r2-ospf-1-area-0.0.0.1]network 23.1.1.1 0.0.0.0

OSPF的区域划分规则:
1、 星型结构—所有的非骨干区域必须连接到骨干区域,否则不能进行区域间路由共享
2、 ABR—区域边界路由器 同时工作在多个区域间;合法ABR必须同时工作在骨干区域,否则不能进行区域间的路由共享;

启动配置完成后,路由器间使用hello包收发建立邻居关系,生成邻居表:
[r2]display ospf peer
Area 0.0.0.0 interface 12.1.1.2(GigabitEthernet0/0/0)'s neighbors
Router ID: 1.1.1.1 Address: 12.1.1.1
State: Full Mode:Nbr is Slave Priority: 1
DR: 12.1.1.1 BDR: 12.1.1.2 MTU: 0
Dead timer due in 35 sec
Retrans timer interval: 5
Neighbor is up for 00:18:48
Authentication Sequence: [ 0 ]

邻居关系建立后,邻居间进行条件的匹配;匹配成功建立邻接关系,同步LSDB完成后,本地生成LSDB—数据库表;
[r2]display ospf lsdb 查看数据库的目录;内部存在各种类别的信息,需要具体查看

LSDB同步完成后,本地基于SFP算法,计算到达所有未知网段的最短路径,然后将其加载到路由表中;
[r3]display ip routing-table 查看路由表
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.1/32 OSPF 10 2 D 23.1.1.1 GigabitEthernet0/0/0 2.2.2.2/32 OSPF 10 1 D 23.1.1.1 GigabitEthernet0/0/0
[r3]display ip routing-table protocol ospf 查看本地所有通过OSPF协议学习到的路由 [r1]display ospf routing 查看本地工作OSPF的直连,及本地通过OSPF学习到的路由Destination Cost Type NextHop AdvRouter Area
1.1.1.1/32 0 Stub 1.1.1.1 1.1.1.1 0.0.0.0
12.1.1.0/24 1 Transit 12.1.1.1 1.1.1.1 0.0.0.0
2.2.2.2/32 1 Stub 12.1.1.2 2.2.2.2 0.0.0.0
3.3.3.3/32 2 Inter-area 12.1.1.2 2.2.2.2 0.0.0.0
23.1.1.0/24 2 Inter-area 12.1.1.2 2.2.2.2 0.0.0.0
类型标记为Inter-area 代表其他区域产生的路由条目
OSPF的度量值为cost=开销值=参考带宽/接口带宽
Default reference bandwidth 100M; OSPF default path cost of the whole, and preferably the minimum;
if the interface bandwidth is greater than the reference bandwidth, cost is 1; may result in poor routing, it is recommended to change the default reference bandwidth;
[R1] OSPF . 1
[R1--OSPF. 1] Reference bandwidth-1000
Important: Once modified, the entire network need to be modified to be consistent for all devices

Published 18 original articles · won praise 7 · views 534

Guess you like

Origin blog.csdn.net/weixin_44029504/article/details/104109838