OSPF Neighbor States

OSPF Neighbor States

Document ID: 13685


Author: Syed Faraz Shamim

Contents

Introduction
Prerequisites
      Requirements
     
Components Used
     
Conventions
Down
Attempt
Init
2-Way
Exstart
Exchange
Loading
Full
NetPro Discussion Forums - Featured Conversations
Related Information

Introduction

When OSPF adjacency is formed, a router goes through several state changes before it becomes fully adjacent with its neighbor. Those states are defined in the OSPF RFC 2328 leavingcisco.com, section 10.1. The states are Down, Attempt, Init, 2-Way, Exstart, Exchange, Loading, and Full. This document describes each state in detail.
13a.gif

Prerequisites

Requirements

There are no specific requirements for this document.

Components Used

This document is not restricted to specific software and hardware versions.

Conventions

For more information on document conventions, refer to Cisco Technical Tips Conventions.

Down

This is the first OSPF neighbor state. It means that no information (hellos) has been received from this neighbor, but hello packets can still be sent to the neighbor in this state.
During the fully adjacent neighbor state, if a router doesn't receive hello packet from a neighbor within the RouterDeadInterval time (RouterDeadInterval = 4*HelloInterval by default) or if the manually configured neighbor is being removed from the configuration, then the neighbor state changes from Full to Down.

Attempt

This state is only valid for manually configured neighbors in an NBMA environment. In Attempt state, the router sends unicast hello packets every poll interval to the neighbor, from which hellos have not been received within the dead interval.

Init

This state specifies that the router has received a hello packet from its neighbor, but the receiving router's ID was not included in the hello packet. When a router receives a hello packet from a neighbor, it should list the sender's router ID in its hello packet as an acknowledgment that it received a valid hello packet.

2-Way

This state designates that bi-directional communication has been established between two routers. Bi-directional means that each router has seen the other's hello packet. This state is attained when the router receiving the hello packet sees its own Router ID within the received hello packet's neighbor field. At this state, a router decides whether to become adjacent with this neighbor. On broadcast media and non-broadcast multiaccess networks, a router becomes full only with the designated router (DR) and the backup designated router (BDR); it stays in the 2-way state with all other neighbors. On Point-to-point and Point-to-multipoint networks, a router becomes full with all connected routers.
At the end of this stage, the DR and BDR for broadcast and non-broadcast multiacess networks are elected. For more information on the DR election process, refer to DR Election.
Note: Receiving a Database Descriptor (DBD) packet from a neighbor in the init state will also a cause a transition to 2-way state.

Exstart

Once the DR and BDR are elected, the actual process of exchanging link state information can start between the routers and their DR and BDR.
In this state, the routers and their DR and BDR establish a master-slave relationship and choose the initial sequence number for adjacency formation. The router with the higher router ID becomes the master and starts the exchange, and as such, is the only router that can increment the sequence number. Note that one would logically conclude that the DR/BDR with the highest router ID will become the master during this process of master-slave relation. Remember that the DR/BDR election might be purely by virtue of a higher priority configured on the router instead of highest router ID. Thus, it is possible that a DR plays the role of slave. And also note that master/slave election is on a per-neighbor basis.

Exchange

In the exchange state, OSPF routers exchange database descriptor (DBD) packets. Database descriptors contain link-state advertisement (LSA) headers only and describe the contents of the entire link-state database. Each DBD packet has a sequence number which can be incremented only by master which is explicitly acknowledged by slave. Routers also send link-state request packets and link-state update packets (which contain the entire LSA) in this state. The contents of the DBD received are compared to the information contained in the routers link-state database to check if new or more current link-state information is available with the neighbor.

Loading

In this state, the actual exchange of link state information occurs. Based on the information provided by the DBDs, routers send link-state request packets. The neighbor then provides the requested link-state information in link-state update packets. During the adjacency, if a router receives an outdated or missing LSA, it requests that LSA by sending a link-state request packet. All link-state update packets are acknowledged.

Full

In this state, routers are fully adjacent with each other. All the router and network LSAs are exchanged and the routers' databases are fully synchronized.
Full is the normal state for an OSPF router. If a router is stuck in another state, it's an indication that there are problems in forming adjacencies. The only exception to this is the 2-way state, which is normal in a broadcast network. Routers achieve the full state with their DR and BDR only. Neighbors always see each other as 2-way.
上面简单把你的问题解答一下.不是很详细,具体内容可以去我的BLOG看看吧.我把OSPF的邻居关系的建立总结了一下贴在那里.地址:
[url=http://thinkpad.blog.ccidnet.com/blog/ccid/do_showone/tid_122413.html]http://thinkpad.blog.ccidnet.com ... one/tid_122413.html[/url]
下面是一些简要内容:
对于广播多路访问网络,路由器在启动OSPF进程,到整个OSPF域形成相同的拓扑数据库,这中间一般来说,每台路由器会经历八个状态:

1、失效状态(down):新路由器处于失效状态。路由器尝试发送Hello分组,向网段中的其他路由器介绍自己,并试图发现其他的OSPF路由器。该Hello分组使用多播地址224.0.0.5(所有SPF路由器),其DR,BDR字段都设置为0。0。0。0

2、初始化状态(init):新路由器发送出hello分组等待应答状态。通常等待时间为hello时间的4倍。在这段时间内,新路由器从其他路由器那里收到Hello分组,并获悉谁是DR,BDR。如果收到的hello分组没有指出谁是DR,BDR,则开始选举。

3、双向状态(two--way):在其他路由器A收到来自路由器B的hello分组后,将hello分组中的路由器ID加入到拓扑数据库中,并用多播地址224.0.0.5发送一个HELLO分组,其中包含自己的ID和一个由所有邻居组成的列表。当B收到该HELLO分组后,如果发现自己的ID在这个来自A的HELLO分组里的邻居列表中,那么B将认为和A已经形成了双向的通信状态。

4、预启动状态(exstart):互为邻居的两台路由器A,B。它们根据直连的接口IP选出较大IP那台路由器做为主(master)路由器,这就是预启动状态。两个邻居是根据接口的IP大小来确定主/从关系:谁主谁次并不重要,它们主要是决定由谁来发起通信。

5、交换状态(exchange):两台路由器都发送数据库描述分组(DDP),并切换到交换状态。路由器从邻居路由器那里收到DDP后,将其同自己的拓扑表进行比较。DDP里面只包含拓扑数据库的摘要信息。

6、加载状态(loading):当一台路由器收到了来自邻居的DDP分组,经过比较后发现自己的拓扑数据库信息和DDP中包含的摘要信息存在差异,,这时该接收路由器需要更详细的信息,它将使用LSR分组请求有关特定链路的详细信息。

7、完全邻接(full):当A路由器收到来自B的LSR时,它将返回一种LSU分组(就是指收到LSR分组后发送的一种LSA分组)。然后B收到该LSU后,将返回一种LSACK(链路状态确认)分组。同时B和A的拓扑数据库达到了同步,此时,邻居关系就变成了邻接状态。(loading to full)

(Attempt 只有在NBMA网络里才有,手工进行Neighbor的指定。)

这中间主要出现了四种分组:

1、HELLO分组:用于发现邻居和选举DR,BDR。路由器不断的发送HELLO分组,以确保它始终出现在收到了这些分组的路由器的拓扑数据库中。

2、数据库描述分组(DD):用于向邻居发送摘要信息以同步拓扑数据库。

3、LSR:用于请求更详细的信息,路由器收到包含新信息的数据库描述分组后发送的一种分组

4、链路状态确认(LSACK):确认已经收到了LSU



A——————————hello——————————>B

A<——————————hello——————————B

A——————————DDP——————————>B

A<——————————DDP——————————B

A——————————LSR——————————>B

A<——————————LSU——————————B

A——————————LSACK——————————>B
刚想了想,觉得有个更简单的例子来说明问题:
比如说借书问题.
A有一本教科书,B需要借来参阅其中的部分章节,但是书A现在急用,不能借给B.而且A和B现在不在同一个地方,那么A和B需要用某种方式来联系上才能开始下一步借书的动作.
假如他们用QQ及传真两种方式来联系和传送文件.(找寻对方,利用某种动作,类似于HELLO)

双方都联系到后(two-way),(exstart,这里既然是B向A借东西,那么当然以A为主了,master)A就想知道B需要哪些章节的内容,于是,A把这本书的目录复印了一份发给B(传送DBD报文,描述整个链路状态数据库信息)

B收到目录后,发现目录中有自己需要的内容,那么就把想看的目录打上标记回传给A(LSR,链路状态请求)
A收到B需要的章节目录后,就把目录对应的章节复印一份交给B(LSU,链路状态更新信息).(公家的东东呗.不怕浪费)

B收到需要的章节后,当然要向A表示感谢,顺便告知"我收到了!谢谢!"(LSACK)
如果A发到B后,B一直没收到,那么B就会催一下A"漏漏,你发了没有啊?我没收到啊!"
那么A就会"重传"
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章