OSPF 的流量使用IP 协议号89。没有自动汇总功能,但可以手工在任意比特位汇总
采用增量更新,OSPF 路由的定期更新周期默认为30 分钟。OSPF 所有路由的管理距离(Ddministrative Distance)为110,OSPF 只支持等价负载均衡
OE 1:到达外部路由的Metric 值为到达ASBR 的Metric 值再加上进入OSPF 域之前的Metric 值之
O E2:默认Metric 值为20,所有OSPF 路由器看到关于该路由的Metric 值全部相同,不会再为该路由增加任何Metric 值
best route selection:
1.select the route with the most specific match to the destination address,the longest prefix match .
2.path type priority: intra-area path > inter-area path > E1 external path > E2 external path
if everything above are the same , will use load balancing.
OSPF packet formats:
Hello(used for neighbor discover and DR/BDR selection) : lists of neighbors
DBD(used to select master and slave ,configure SN for master):list of LSA headers
LSR:series of fileds describing the requested LSAs
LSU:list of LSAs, only carry the LSAs only one hop further from their originating ruter, the receiving neighbor is responsible for re-encapsulating the appropriate LSAs in new LSU for further flooding.
LSAck: lists of LSA header ,used to make flood of the LSA reliable ,multiple LSAs may be acked in a single packet.
LSA header :
command :
查看R1的OSPF邻居:
r1#sh ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
22.2.2.2 1 FULL/BDR 00:00:30 12.1.1.2 FastEthernet0/0
查看R1的OSPF接口:
r1#sh ip ospf interface
查看R2的LSA 数据库:
r2#sh ip ospf database
查看 R1到达 ASBR(R2)和(R3)distance
r1#sh ip ospf border-routers
Codes: i - Intra-area route, I - Inter-area route
i 2.2.2.2 [65] via 12.1.1.2, FastEthernet0/0, ASBR, Area 0, SPF 10
Router-ID 不会跨区域传递,只要同区域所有路由器可达,那么不同区域自然就是可达的,理由是,不同区域是通过ABR 相连的,因为ABR 连接着不同区域,所以只要各个区域路由器和ABR 是通的,那么不同区域当然可以实现网络连通,所以,ABR 在将一个区域的LSA 转发至另一个区域时,产生该LSA 的Router-ID会被修改为ABR 的Router-ID,这样一来,和ABR 相通的路由器只要到达ABR,就能到达其它区域.
执行重分布的路由器同样需要在LSA 中写上自己的Router-ID,其实就是ASBR 的Router-ID,因为外部路由会在多个OSPF 区域之间传递,所以会被多个ABR 转发,而ABR 在转发外部路由的LSA 时,是没有权限修改LSA 的Router-ID,这样一来,外部路由的Router-ID 在所有OSPF 路由器上都不会改变,永远是ASBR 的Router-ID,最终造成的结果是只有与ASBR 同在一个区域的路由
器才能到达外部路由;为了能够让OSPF 所有区域都能与外部路由连通,在ABR 将外部路由从ASBR 所在的区域转发至其它区域时,需要发送单独的LSA 来告知如何到达ASBR 的Router-ID,因为ABR 将外部路由的LSA 告诉了其它区域,是有义务让它们与外部路由可达的,所以额外发送了单独的LSA 来告知如何到达ASBR 的Router-ID;从这里也可以看出,任何一个ASBR 所在区域外的其它区域,都必须靠ABR 通告一条通往ASBR 的Router-ID的LSA,此LSA 就是后面将会详细解释的LSA 类型的第4 类
外部LSA 的Forward Address 是一个其它LSA 没有的特征,每一条外部LSA 都带有一个Forward Address,该地址是用来告诉收到此LSA 的路由器如何到达外部路由
在上图中,当R5(ASBR)将外部路由EIGRP 重分布进OSPF 时,因为R5 到达外部路由的下一跳地址是56.1.1.6,如果该地址的网段被通告进OSPF 进程,那么此时外部路由的Forward Address 就是56.1.1.6,所有OSPF 路由器通过去往地址56.1.1.6 来去往外部路由;但如果该地址并不在OSPF 进程中,那么外部路由的Forward Address 就是0.0.0.0,则所有OSPF 路由器通过去往ASBR(R5)的Router-ID 去往外部路由。
area :
why area :
foolding can place an unacceptable burden on the data link of a large internetwork. router within an area will hava no detailed knowledge of the topology outside of the area . smaller LSDB means fewer LSAs to process and therefore less impact on the CPU.
area 0 : backbone area ; summary the informations of each area to every other area.
Router Types:
Internal routers
ABR(area border routers):
ASBR ( autonomous system boundary routers)
virtual Link :
a link to the backbone through a non-backbone area .
rules:
- must be configured between two ABRs.
- the area through which the virtual link is configured ,known as the transit area, must have fulling routing information.
- the transit area connot be a stub area.