关于OSPF的数据结构
Link-State Protocol Data Structures
链路状态路由器与距离矢量路由器,可以知道关于整个网络的更多信息
Neighbor table:also known as the adjacency database
邻居表:也正如我们知道的 邻接关系数据库
Topology table:referred as the LSDB
拓扑表:指的就是 链路状态数据库
Routing table:also knowns as the forwarding database
路由表:也正如我们知道的转发数据库。
Each router has a full picture of the topology.
每一个路由器都有完整的拓扑信息。
Link-state routers tend to make more accurate decisions.
运行链路状态路由选择协议的路由器可以做出更加准确的决策。

OSPF Areas
Link-state routing requires a hierarchical network structure.
链路状态的路由协议 需要一个层次化的网络结构
This two-level hierarchy consists of the following:
这种两层的层次架构包括下面的:
Transit area (backbone or area 0)
穿越区域,或者说传输区域, 又称为:骨干区域。 在多区域的ospf中,必须有0区域,其他的区域连接

到ospf的骨干区域上。当然对于网络规模不是太大的,也可以只有0区域。
对于单区域 来说, 区域号 可以用1 ,也可以用 10 etc。 当然 区域号必须一致。
区域号:为32位的二进制数。
Normal areas(non-backbone areas)
普通区域 (非骨干区域)

区域边界在路由器上。

ABR:Area border Router :区域边界路由器,用来连接不同区域的路由器。

ASBR:Autonomous System Boundary Router 自治系统边界路由器。:用来连接不同的自治系统,比如在

rip和ospf相连的网络,必须进行重分布。

Internal routers:所有的接口都在同一个区域之中。

Backbone routers:只要有一个接口在骨干区域之内即可。 例如:ABR ASBR 都算是骨干区域路由器。

Routing updates and topology information are passed only between adjacent routers.
路由更新和拓扑信息只在建立邻接关系的路由器之间传递。
Forming OSPF adjacencies on point-to-point WAN links.
在点到点的WAN链路上,形成ospf 邻接关系。
Forming OSPF adjacencies on LAN links is different than forming them on point-to-point links
在LAN链路上建立邻接关系是不同于WAN链路的。

Routers find the best paths to destinations by applying Dijkstra's SPF algorithm to the LSDB
根据链路状态数据库运用dijkstra's SPF 算法,路由器可以发现到达目的地的最佳路径。
The best path is calculated based on the lowest total cost and sent to the routing table.
最佳路径是基于最小的总的cost值计算出来的,然后被送往路由表中。

OSPF 的度量值是 cost
cost=10的8次方 除以带宽。 即cost=100,000,000 / bandwidth [b/s]

Defined per interface,but may be altered.
确定每一个接口的配置,但是可以改变。
Inversely proportional to the bandwidth of that interface.
度量值和 接口的带宽成反比。

Buliding the LSDB
The Hello protocol is used to define neighbors
Hello包用来确定邻居。
Adjacency is established
邻接关系建立
Adjacent routers exchanges LSAs
建立邻接关系的路由器交换LSAs
Each router build an LSDB using LSAs.
每一个路由器都是用LSAs,建立 LSDB,链路状态数据库。
也就是 构筑 自己的 关于整个网络的拓扑。

如何来查看LSA是否是最新的。
An LSA is more rencent if it has:
A higher sequence number 序列号
A higher checksum number 校验和
An age equal to the maximum age(poisoning)寿命时间
A  significantly smaller link-state age (the LSA is significantly younger)

Each LSA in the LSDB maintains a sequence number
4-byte number
begins with 0x80000001;ends with 0x7FFFFFFF

OSPF floods each LSA every 30 minutes.
OSPF每隔30分钟泛洪LSA
Each time,the sequence number is incermented by one.
每一次,序列号会增加一。
The LSA with the higher(newer)sequence number is more recent.
拥有最高序列号的LSA是最新的。

Ultimately,a sequence number will wrap around to 0x80000001
The exsting LSA was prematurely aged to the maximum age (one hour)and fulshed.
现存的LSA过早的达到最大的值之后,一个小时,把它刷新掉,然后,重置为0x80000001,这样子,

0x80000001 就成为最新的了。
Every OSPF router announces a router LSA for those interfaces that is owns in that area.

命令:show run |sec router ospf
显示 ospf的相关配置。
包括 重新发布的路由。

命令:show run |sec router rip
显示rip 的相关配置。
包括重新发布进入rip的路由。

High-level functions of OSPF include the following:

Discover neighbors and form adjacencies
Flood link-state database(LSDB)information
Compute the shortest path
Install routers in the route-forwarding table

Additional functions of OSPF include the following:
Detect changes in the link state 自动检测链路状态
Propagate changes to maintain link-state database synchronization

Several OSPF packet types are involved

OSPF uses five types of routing protocol packets.
1.Hello包
2.Database Description  数据库描述包即DBD包
3.Link-State Request    链路状态请求包
4.Link-state Update     链路状态更新包
5.Link-state Acknowledment 链路状态确认包

使用 debug ip ospf packet 命令,查看 运行ospf 的路由器,收发的ospf数据包。
This debug output shows the fields in the OSPF header.
这个debug命令输出显示了在ospf报头中的字段。

Neighbor Relationship : The Hello Packet
邻居关系在two-way状态形成,邻居之间互相发送hello包。
*Entries must match on neighboring routers.
要形成邻接关系必须匹配的条目
Hello包的内容如下:
Router ID
Hello and dead intervals*
Neighbors
Area ID*
Router priority
DR IP address*
BDR IP address
Authentication password*
Stub area flag*
其中 要形成邻居 关系, Hello and dead intervals  Area ID*  DR IP address*  Authentication

password*   Stub area flag*  这些必须匹配。

Use of Multicast and unicast IP address
point-to-point:224.0.0.5     组播地址224.0.0.5 代表所有ospf路由器。
broadcast:DRother 监听:224.0.0.5     DR/BDR 监听:224.0.0.6
Four types of update packets

LSDB synchronization process
Discover neighbor 发现ospf 邻居。
Establish bidriectional communication 建立双向的联系。
Elect a designated router,if desired 如果需要协商,选举DR
Form an adjacency  形成邻接关系。
Discover the network routers 发现 网络上的其他路由器。
Update and synchronize link-state databases.  更新和同步链路状态数据库。

OSPF  Establishing Bidirectional communication
 建立双向通信状态。

1.Down state  Down 状态。路由器之间没有进行任何的数据交换与传输。
发送 hello 包,携带必要的信息,去建立邻居关系。
2.Init state  初始化状态。
3.Two-way state Two-way 状态。
如果 network-type:broadcast ,那么需要在two-way状态 进行DR与BDR 的选举。
4.Exstar State :信息交换初始状态——确定“主路由器”与“从路由器”。谁的路由器ID越高,谁将

成为“主路由器”。信息交换,由 “主路由器” 首先 发送 给 “从路由器”。
5.Exchange State 交换信息 状态
发送 汇总的LSDB信息。 summary of my LSDB.收到之后,要发送相应的ACK包确认。
6.Loading State 载入状态。
发送LSR,即链路状态请求包。请求邻居有,而自己没有的相关的路由条目。
7.Full State 状态。
完全邻接状态。

OSPF Neighbor States  OSPF邻居的状态
OSPF routers progress through seven states:OSPF完成整个收敛所要经历的七个状态。
1.Down:no active neighbor detected
2.INIt:hello packet received
3.Two-way:own router ID in received hello
4.Exstart:master and slave roles determined
5.Exchange:database description packets sent
6.Loading:exchange of LSRs and LSUs
7.Full:neighbors fully adjacent

OSPF Network Types
OSPF 网络类型:
Point-to-point:A network taht joins a single pair of routers.
Broadcast:A multiaccess broadcast network, such as Ethernet.
Nonbroadcast multiaccess(NBMA):A network that interconnects more than two routers but that
has no broadcast capability.
-Examples:Frame Relay, ATM,and X.25
-Five modes of OSPF operation are available for NBMA networks.

Point-to-Point Links
Usually a serial interfce running either PPP or HDLC
通常 是 串口 封装ppp 或者 HDLC 协议。
May also be a point-to-point subinterface running Frame Relay or ATM
也可能是点到点的子接口欲行 帧中继或者ATM
Does not require DR or BDR election
不需要DR和BDR 的选举。
Is automatically detected by OSPF
可以被OSPF自动识别。
Sends OSPF packets using multicast 224.0.0.5
发送OSPF包使用多播地址:224.0.0.5

Multiaccess Broadcast Network
This generally applies to LAN technologies like Ethernet.
DR and BDR selection are required.
All neighbor routers form full adjacencies with the DR and BDR only.
Packets to the DR and the BDR use 224.0.0.6
Packets from DR to all other routers use 224.0.0.5

DR的选举:
Hello packets are exchanged via IP multicast
DR: The router with the highest OSPF priority
BDR:The router with the second-highest priority value
The OSPF router ID is used as the tiebreaker  OSPF 的RID用来 决胜DR 和BDR
The DR election is nonpreemptive

1.只要配置的换回口的IP被通告进入了ospf网络,那么它的掩码就是32位的。不管你配置的掩码是多少。
这是ospf 的默认配置。

2.如何还原ospf中loopback接口的默认掩码呢?

ip ospf network point-to-point
如果使用了这一条命令,那么相当于还原了ospf的loopback接口的真实掩码,而并不是ospf默认的32位。

DR 的第一个特点:

1.不抢占。
clear ip ospf process *

清除之后,然后再看。

ip ospf priority

数值越大,优先级越高。比如 2 的优先级就 比 1 要高。

2.当DR down掉以后,BDR直接升为DR,而在整个区域中,重新选举BDR。

3.DR BDR DRother 是 接口概念 。

4.不同网段,分别选DR ,BDR。

1.在广播和NBMA网络中需要选举
2.优先级最高,优先级取值0-255
3.默认优先级1,如果是0表示无资格选举
4.如果优先级相同,选择路由器ID值最大的
5.如果网络中已存在DR,后加入的路由器即使优先级更高也不会改变现有DR,因为DR是非抢占的。
6.如果DR出现故障,BDR直接接替DR角色,再从网络中选出新的BDR
7.DR/BDR 从接口级别选举。

命令 ip ospf priority “value”
可以修改优先级。
1.This interface configuration command assigns the OSPF priority to an interface
2.Different interfaces on a router may be assigned different values.
3.The default priority is 1. The range is from  0 to 255.
4.“0” means the router cannot be the DR and BDR
5.A rotuer that is not the DR or  BDR is DROTHER。

NBMA Topology
A single interface interconnects multiple sites
NBMA topologies support multiple routers,but without broadcasting capabilities.
Five modes of OSPF operation are available.

DR Election in NBMA Topology
1.OSPF considers NBMA to be like other broadcast media.
2.The DR and BDR need to have fully meshed connectivity with all other routers,but NBMA

networks are not always fully meshed.
—The DR and BDR each need a list of neighbors.
OSPF neighbors are not automatically discovered by the router.

There are five modes of OSPF operation.
RFC 2328-compliant modes are as follows:
-Nonbroadcast (NBMA)
-Point-to-multipoint
Additional modes from Cisco are as follows:
-Point-to-multipoint nonbroadcast
-Broadcast
-Point-to-point

OSPF 原理的更多相关文章

  1. OSPF多区域原理与配置

    OSPF多区域原理与配置 目录 一.OSPF多区域生成 1.1.生成OSPF多区域的原因 二.OSPF的三种通信量 2.1.域内通信量 2.2.域间通信量 2.3.外部通信量 三.OSPF的路由器类型 ...

  2. OSPF的基本工作原理

    OSPF的基本工作原理 1.定义 2.特点 3.基本概念 4.OSPF五种分组类型 5.DR/BDR 6.区域 1.定义 开放最短路径优先OSPF,是为了克服RIP的缺点在1989年开发出来的. &q ...

  3. OSPF协议原理及配置5-LSA分析

    OSPF协议原理及配置5-LSA分析   前面,已经介绍了邻接关系的建立和LSDB的同步.通过同步过程的介绍,我们可以了解LSDB的同步是通过交互LSA实现的. 不同角色的路由器发出的LSA的内容是不 ...

  4. OSPF协议原理及配置3-邻居关系的建立

    OSPF协议原理及配置3-邻居关系的建立   OSPF协议的邻居关系是通过交换Hello报文建立的,所以我们先对OSPF的报文的种类,及Hello报文的结构做一了解. 1 OSPF协议有5种协议报文( ...

  5. OSPF协议原理及配置4-邻接关系的建立和LSDB同步

    OSPF协议原理及配置4-邻接关系的建立和LSDB同步   进入ExStart状态后,广播和NBMA型网络要等待4倍的Hello时间,确定DR和BDR.然后建立邻接关系,并交互链路状态通告,以使用LS ...

  6. 网络初级篇之OSPF(一)原理

    一.OSPF是什么 Open Shortest Path First, 开放最短路径优先协议,是一种开源的使用最短路径优先(SPF)算法的内部网关协议(IGP).常用于路由器的动态选路. 二.OSPF ...

  7. OSPF协议——原理及实验

    首先命令部分: ospf 1 进入ospf协议 area 0 划定自治区域 因为实验只用了1个区域所以参数就为0 也就是骨干区域 network +网段+反写掩码(0.0.0.255)指定运行OSPF ...

  8. OSPF协议原理及配置2-理解邻居和邻接关系

    OSPF是一个动态路由协议,运行OSPF的路由器之间需要交换链路状态信息和路由信息,在交换这些信息之前首先需要建立邻接关系.邻接关系用来交换链路状态及路由信息. 注意:并非所有的邻居关系都可以成为邻接 ...

  9. OSPF协议详解

    CCNP OSPF协议详解 2010-02-24 20:30:22 标签:CCNP 职场 OSPF 休闲 OSPF(Open Shortest Path Fitst,ospf)开放最短路径优先协议,是 ...

随机推荐

  1. ensp实战之防火墙安全转发策略

    本次实验用防火墙是USG6000V,拓扑图如下: 步骤一: 按上面配好PC1.2.3以及WWW服务器的IP地址.子网掩码以及网关: 步骤二: 进入防火墙的CLI命令模式下,按一下命令配置: 配置各个接 ...

  2. Hadoop查看目录文件大小的脚本

    hadoop fs -du / | awk '{ sum=$1 ;dir2=$3 ; hum[1024**3]="Gb";hum[1024**2]="Mb";h ...

  3. java中三大修饰符

    一.static 1.属性:类变量 定义在类以内,方法以外,全类有效,全类公共一个属性 类变量与创建对象无关,有默认值0 使用方式  类名.类变量     System.out.println(); ...

  4. onS 记录

    1.用户的解锁                                                         用户因多次登录失败而被锁的情况下,可用faillog命令来解锁.具体如下 ...

  5. bzoj2052: Pku1777 Vivian

    题目链接:http://www.lydsy.com/JudgeOnline/problem.php?id=2052 2052: Pku1777 Vivian Time Limit: 10 Sec  M ...

  6. [SOJ]1753 解码

    1753. 解码 Constraints Time Limit: 1 secs, Memory Limit: 32 MB Description ZX是另一头04级的牛,他现在在UPen.他跟LLK经 ...

  7. 一个简单的Servlet工具

    以前老师在项目中用过一个Sevlet的工具,就是在请求Servlet的时候带一个参数,该参数决定要执行Servlet中的方法, public class ServletUtils extends Ht ...

  8. 朱丽叶—Cuda+OSG

    #include <cuda_runtime.h> #include <osg/Image> ; typedef struct cuComplex { float r; flo ...

  9. Smarty 注册变量

    关于smarty类的一些解析 特别注意左右分隔符<{}>,display------显示模板的内容(里面是.html文件),assign-------注册变量 <?php //是一个 ...

  10. MVC view视图获取Html.RenderAction方式带来的参数

    通过Html.RenderAction这种方式传递的参数,在view视图中获取要使用viewContext上下文来获取:Html.ViewContext.RouteData.Values[" ...