您的位置:首页 > 其它

OSPF(三):邻居

2015-06-22 17:36 281 查看
1、 成功建立一个邻接关系需要4个阶段

(1)邻居路由器发现阶段

(2)双向通信阶段(Bidirectional communication)——两台互为邻居的路由器在各自Hello报文中都列出对方路由器的Route ID时候

(3)数据库同步阶段(Database Synchronization)——通过交换数据库描述(Database Description)、链路状态请求和链路状态更新报文信息,确保邻居路由器的链路状态数据库中包含相同的数据库信息。其中一台路由器成为Master,控制DD报文的信息交换

(4)完全邻接阶段(Full adjacency)

2、在NBMA中,Router 每经过PollInterval 给它的邻居状态为down的邻居发送一次Hello报文;在其他网络中,Router 每经过HelloInterval 的时间给邻居发送一次Hello报文。

3、邻居数据结构(Neighbor Data Structure)

(1)通过show ip ospf neighbor可以看到一部分信息:Neighbor ID、Neighbor IP Address、Area ID、Interface、Neighbor Priority、State、PollInterval(只用于NMBA)、Neighbor Options、Inactivity Timer

(2)其他信息:DR、BDR、Master / Slave、DD Sequence Number、Last Received Database Desciption Packet(最后收到的数据库描述报文。可用来确定下一个DD是否是重复的)、Link State Retransmission List(链路状态重传列表:在邻接关系建立后OSPF已经进行了flood但还没有得到确认的LSA的列表)、Database Summary List、Link
State Request List(链路状态请求列表:记录了来自邻居路由器的DD报文的LSA通告)

4、邻居状态机(Neighbor State Machine)

(1)失效状态(Down):在最近一个RouterDeadInterval 的时间内还没有收到来自邻居路由器的Hello报文。Hello报文将不再发送给处于Down的邻居路由器。除了NBMA网络(Hello报文每隔PoolInterval 发送一次)。并清空链路状态重传列表、数据库摘要列表和链路状态请求列表;

(2)尝试状态(Attempt):仅适用于NBMA网络上的邻居。当接口Active,或者路由器成为DR&BDR的时候,将会把邻居路由器的状态转换成Attempt,并使用HelloInterval 代替PollInterval 作为发送Hello报文的时间间隔;

(3)初始状态(Init):在最近的RouterDeadInterval 时间里路由器收到了邻居的Hello报文,但仍无法建立双向(2-Way)通信,在这种状态下若从邻居收到一个DD,也可以引起邻居状态直接转换到2-Way状态;

(4)双向通信状态(2-Way):本地路由器已经在来自邻居的Hello报文中的邻居字段看到了自己的Router ID。在多址网络中,必须在这个或者更高状态的邻居路由器才有自己进行DR和BDR的选举;

(5)信息交换初始状态(ExStart):和邻居建立Master / Slave关系(根据接口地址判断,高地址为Master),确定DD Sequence Number;

(6)信息交换状态(Exchange):向邻居路由器发送数据库描述报文,同时发送链路状态请求报文,向邻居请求最新的LSA 通告;

(7)信息加载状态(Loading):在该状态下向邻居发送链路状态请求报文,请求最新的LSA 通告。

(8)完全邻接状态(Full):完全建立了邻接关系,这种邻接关系出现在路由器LSA 和网络LSA 中

 
Input Event
Description
IE1
This event occurs only for NBMA-connected neighbors. The input event will be triggered under either of the following conditions:

The interface to the NBMA network first becomes active, and the neighbor is eligible for DR election.

The router becomes either DR or BDR, and the neighbor is not eligible for DR election.

IE2
A valid Hello packet has been received from the neighbor.
IE3
The neighbor is no longer reachable, as determined by the lower level protocols, by an explicit instruction from the OSPF process itself, or by the expiration of the inactivity timer.
IE4
The router first sees its own Router ID listed in the Neighbor field of the neighbor's Hello packet or receives a Database Description packet from the neighbor.
IE5
The neighbor should not become adjacent.
IE6
This input event occurs under either of the following conditions:
(1) The neighbor state first transitions to 2-Way.
(2) The interface state changes.
IE7
An adjacency should be formed with this neighbor.
IE8
The master/slave relationship has been established and DD sequence numbers have been exchanged.
IE9
The exchange of Database Description packets has been completed.
IE10
Entries exist in the Link State Request list.
IE11
The Link State Request list is empty.
IE12
The adjacency should be broken and then restarted. This input event might be triggered by any of the following:
(1) The reception of a Database Description packet with an unexpected DD sequence number
(2) The reception of a Database Description packet with the Options field set differently than the Options field of the last DD packet
(3) The reception of a Database Description packet, other than the first packet, in which the Init bit is set
(4) The reception of a Link State Request packet for an LSA that is not in the database
IE13
A Hello packet has been received from the neighbor in which the receiving router's Router ID is not listed in the Neighbor field.
IE14
This event occurs when the interface state changes.
IE15
The existing or forming adjacency with this neighbor should continue.
IE16
The existing or forming adjacency with this neighbor should not continue.
 

Decision
Description
DP1
Should an adjacency be established with the neighbor? An adjacency should be formed if one or more of the following conditions is true:
(1) The network type is point-to-point.
(2) The network type is point-to-multipoint.
(3) The network type is virtual link.
(4) The router is the DR for the network on which the neighbor is located.
(5) The router is the BDR for the network on which the neighbor is located.
(6) The neighbor is the DR.
(7) The neighbor is the BDR.
DP2
Is the Link State Request list for this neighbor empty?
DP3
Should the existing or forming adjacency with the neighbor continue?
5、建立一个邻接关系,使用三种报文格式:数据库描述报文(Type2)、链路状态请求报文(Type3)、链路状态更新报文(Type4)

(1)数据库描述报文:LSA通告的头部信息。I位(Initial bit)、M位(More bit)、MS位(Master / Slave bit)

(2)建立邻接关系的过程

 
6、泛洪(Flooding):使用链路状态更新报文(Type4)&链路状态确认报文(Type5)

(1)LSA确认:确认之后将链路状态重传列表中的LSA拷贝删除

a、显式确认(Explicit Acknowledgment):发送一个链路状态确认报文来确认;

b、隐式确认(Implicit Acknowledgment):回送包含LSA复制信息的更新报文进行确认。

(2)序列号、校验和、老化时间

a、使用线性序列号空间和32位有符号的序列号,范围从0x80000001(InitialSequenceNumber)到0x7fffffff(MaxSequeneNumber)

b、老化时间age范围0s~3600s。每经过一台路由器增加InfTransDelay 设定的秒数。当Age达到最大值的时候,LSa将被重新泛洪并从路由器的数据库移除

(3)确定最新的LSA实例(instance)

a、比较序列号。拥有最大序列号的LSA为最新;

b、若序列号相同,则比较校验和。拥有最大无符号校验和的LSA为最新;

c、若校验和也相同,比较老化时间。如果只有一条LSA拥有大小为最大生存时间的老化时间,则认为是最新;若老化时间都不为最大生存时间:

d、若LSA的老化时间差(MaxAgeDiff)多于15min,则拥有较小老化时间的LSA为最新;

e、若上述条件都无法区分,则两个LSA为相同的实例
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: