CCNP技术文档之OSPF全解析(上)

思科认证是由网络领域著名的厂商—Cisco公司推出的,是互联网领域的国际权威认证。 

CCNP(Cisco Certified Network Professional)是Cisco 职业认证体系中的中级认证获得CCNP认证的专业人员可以为具有100到500多个节点的大型企业网络安装、配置和运行LAN、WAN和拨号访问业务。

CCNP认证表示网络人士具有对从100个节点到超过500个节点的融合式局域网和广域网进行安装、配置和排障能力。获得CCNP认证资格的网络人士拥有丰富的知识和技能,能够管理构成网络核心的路由器和交换机,以及将语音、无线和安全集成到网络之中的边缘应用。

SPOTO CCNP指导教材紧跟Cisco最新认证教材,它是由SPOTO TS团队为广大学员精心设计的一本辅导教材,它以CCNP知识点为基础,经过缜密的思考,大量的实践,多轮讨论,最终撰写完成。 

CCNP:路由、交换、排错 

路由重点知识点:EIGRP、OSPF、路由操纵、BGP、IPv6、OSPF

本文OSPF主要内容:

  • OSPF简介  

  • OSPF报文类型  

  • 配置OSPF  

  • OSPF网络类型  

  • Link-State Advertisements  

  • OSPF路由汇总  

  • 配置OSPF特殊区域  

  • 配置OSPF认证  

  • OSPF知识点总结  

  • OSPF综合实验

01▶

OSPF简介

  • 链路状态路由协议

  • 链路状态数据结构

  • 网络层次结构

  • SPF计算

链路状态路由协议:

  • 运行链路状态路由协议的路由器比运行距离矢量路由协议的路由器识别更多的网络信息 

  • 每一台路由器拥有整个拓扑结构 

  • 能够根据准确的网络拓扑信息独立地作出决策 

链路状态路由协议:

链路状态数据结构

邻居表:也被称为邻接数据库,包含邻居列表

拓扑表: 

  • 通常被称为链路状态数据库(LSDB)

  • 包含该区域或网络中的所有路由器及其连接链路

  • 区域内的所有路由器有相同的LSDB

路由表:

通常称为转发数据库(forwarding database)!

包含到目的地的最佳路径!

网络层次结构

链路状态路由协议通过OSPF协议执行具有层次网络结构。

两层的层次结构由以下部分组成:

中转区域 (骨干区域0)

常规区域 (非骨干区域)!

OSPF区域

OSPF区域特点:  

1、最大限度地减少路由表条目

2、本地区域内拓扑变化的影响

3、在区域边界阻止LSA的泛洪

4、需要分层网络设计

5、路由器A和B都是骨干路由器

6、骨干路由器属于区域0

7、路由器C,D和E被称为区域边界路由器

8、ABR连接着骨干区域和非骨干区域

SPF计算

02▶

OSPF报文类型

· OSPF报文类型 

· OSPF报文头格式 

· OSPF邻居建立过程 

· LSA 序列编号

· LSA 操作

OSPF报文类型

OSPF报文头格式

邻居关系: Hello包

建立双向通信

发现网络路由

添加链路状态条目⽬

OSPF建立邻接关系的过程详细描述(补充)

(1) OSPF路由器接口up,发送Hello包,(NBMA模式时将进入Attempt状态)

(2) OSPF路由器接口收到Hello包,进入Init状态;并将该Hello包的发送者的Router ID,添加到Hello包(自己将要从该接口发送出去的Hello包)的邻居列表中。!

(3) OSPF路由器接口收到邻居列表中含有自己Router ID的Hello包,进入Two-way状态,形成OSPF邻居关系,并把该路由器的Router ID添加到自己的OSPF邻居表中。

(4) 在进入Two-way状态后,广播、非广播网络类型的链路,在DR选举等待时间内进行DR选举。点对点没有这个过程。

(5) 在DR选举完成或跳过DR选举后,建立OSPF邻接关系,进入exstart(准启动)状态;并选举DBD交换主从路由器,以及由主路由器定义DBD序列号,Router ID大的为主路由器。目的是为了解决DBD自身的可靠性。

(6) 主从路由器选举完成后,进入Exchange(交换)状态,交换DBD信息。

(7) DBD交换完成后,进入Loading状态,对链路状态数据库和收到的DBD的LSA头部进行比较,发现自己数据库中没有的LSA就发送LSR,向邻居请求该LSA;邻居收到LSR后,回应LSU;收到邻居发来的LSU,存储这些LSA到自己的链路状态数据库,并发送LSAck确认。

(8) LSA交换完成后,进入FULL状态,所有形成邻居的OSPF路由器都拥有相同链路状态数据库。

(9) 定期发送Hello包,维护邻居关系。

维护路由信息

LSA序列编号

· 在LSDB中每一条LSA维护一个序列号.

· 序列号的长度为4个字节,范围是0x80000001 ~ 0x7FFFFFFF.

· OSPF每隔30分钟泛洪每一条LSA以保持适当的数据库同步。

· 每次LSA泛洪,序列号被加1

· 最终,一个LSA序列号将返回到0x80000001的。当发生这种情况时,现有的LSA达到最大老化时间,重新刷新LSA时间。

· 当路由器遇到一个LSA的两个实例,它必须确定哪个更新。具有较新的(更高)的LSA的LS序列号是更一些。

LSA操作

LSA序列号和最大年龄

· Every OSPF router announces a router LSA for those interfaces

that it owns in that area.

· Router with link ID 192.168.1.67 has been updated eight times;

the last update was 48 seconds ago.

03▶

配置OSPF

· 配置OSPF

· OSPF Router-id

Configuring  Basic OSPF

OSPF Router ID

  • 在OSPF网络内通过OSPF router ID标识路由器。

  • LSDBs 使用OSPF的 Router ID 区分不同的路由器。

  • 默认情况下, Router ID在OSPF进程启动时选择活动接口中最⼤大的IP地址。

  • 环回接口可以参与OSPF路由器ID的选举,如果存在Loopback接口,路由器ID是在任何活动的loopback接口中最大的IP地址。

  • OSPF的Router-id命令可以用来覆盖OSPF路由器ID。

  • 使用Loopback接口或一个Router-id命令用于保持Router-ID稳定

  • If the OSPF process is already running, the router must be

  • reloaded or the OSPF process must be removed and

  • reconfigured before the new loopback address will take effect

OSPF router-id Command

04▶

OSPF Network Types

  • Point-to-Point 

  • Broadcast 

  • Nonbroadcast 

  • OSPF over  NBMA  Topology Modes

OSPF Network Types

The three types of networks defined by OSPF are:

· Point-to-point: A network that joins a single pair of routers.

· Broadcast: A multiaccess broadcast network, such as Ethernet.

· Nonbroadcast multiaccess (also called NBMA): A network that interconnects more than two routers but that has no broadcast capability. Frame Relay, ATM, and X.25 are examples of NBMA networks.

Five modes of OSPF operation are available for NBMA networks.

Point-to-Point Links

  • Usually a serial interface running either PPP or HDLC.

  • May also be a point-to-point subinterface running Frame Relay or ATM.

  • No DR or BDR election required.

  • OSPF auto detects this interface type.

  • OSPF packets are sent using multicast 224.0.0.5.

Multiaccess Broadcast Network

  • Generally these are, LAN technologies like Ethernet and Token Ring.

  • 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.

Electing the DR and BDR

  • Hello packets are exchanged via IP multicast.

  • The router with the highest OSPF priority is selected as the DR. The router with the second-highest priority value is the BDR.

  • Use the OSPF router ID as the tiebreaker.

  • The DR election is nonpreemptive.

Setting Priority for DR Election

  • This interface configuration command assigns the OSPF priority to an interface.

  • Different interfaces on a router may be assigned different values.

  • The default priority is 1. The range is from 0 to 255.

  • 0 means the router cannot be the DR or BDR.

  • A router 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.

  • OSPF considers NBMA to be like other broadcast media.

  • 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 need a list of neighbors.

  • OSPF neighbors are not automatically discovered by the router.

Frame Relay Topologies

OSPF over NBMA Topology Modes of Operation

RFC 2328-compliant modes are as follows:

Nonbroadcast (NBMA)

Point-to-multipoint

Additional modes from Cisco are as follows (Cisco私有):

Point-to-multipoint nonbroadcast

Broadcast

Point-to-point

Selecting the OSPF Network Type for NBMA Networks

1-Nonbroadcast Mode (NBMA Mode)

neighbor Command Example

2-Point-to-Multipoint Mode

  • The point-to-multipoint mode allows for NBMA networking.

  •  The point-to-multipoint mode fixes partial-mesh and star topologies.

  • No DR is required and only a single subnet is used.

  • A 30-second hello is used.

  • This mode is RFC 2328-compliant.

3-Point-to-Multipoint Nonbroadcast

· Cisco extension to RFC-compliant point-to-multipoint mode.

· Must statically define neighbors, like nonbroadcast mode.

· Like point-to-multipoint mode, DR and BDR not elected.

· Used in special cases where neighbors cannot be automatically discovered

4-Point-to-Point Subinterfaces

· Each PVC and SVC gets its own subinterface.

· Default OSPF Type:point-to-point. 

· OSPF point-to-point mode is the default on point-to-point

Frame Relay subinterfaces.

− No DR/BDR 

− Do not need to configure neighbors 

5-Multipoint Subinterfaces

Single interface serial 0/0/0 has been logically separated into two subinterfaces: one point-to-point (S0/0/0.1) and one point-to-multipoint (S0/0/0.2).

  • Each subinterface requires a subnet.

  • OSPF defaults to point-to-point mode on point-to-point subinterfaces.

  • OSPF defaults to nonbroadcast mode on point-to-multipoint subinterfaces.

OSPF over NBMA Topology Summary

(0)

相关推荐