Dynamic routing protocol --ospf

Content structure:

image.png

OSPF routing protocol:

Open Shortest Path First (Open Shortest Path First, OSPF) is a dynamic routing protocol is widely used as a link-state routing protocol, the route change fast convergence, no routing loops, supports variable length subnet advantage (VLSM) and aggregated level zoning and so on. The OSPF protocol used in the network, most of the route calculated by the OSPF protocol and self-generating, without the network administrator manually configured, when the network topology changes, the protocol can be automatically calculated, the route correction, which greatly facilitates network management.

Routes into types : DR BDR ABR ASBR

Five regions: the backbone area, the standard area, peripheral area, the peripheral area of deposit, non-deposit peripheral region

Five Packet Type : Hello packet, the DBD packet, the LSR , the LSU (the LSA) , LSAck

Six kinds lLSA :

image.png

Seven states:

image.png

image.png


basic concept:


OSPF area

  • To accommodate large networks, OSPF plurality of divided regions in the AS

  • Each OSPF router maintains a complete link-state information in your area

Area ID

  • Region ID can be expressed as - a decimal number

  • IP can also be expressed as a

The backbone area Area 0

  • Responsible for routing information dissemination between regions

Non-backbone area

Router ID

  • IP addresses that uniquely identifies the OSPF area router

Router ID selection rule

  • Select router loopback interface. Numerically highest IP address

  • If no loopback interface, select the highest IP address in the physical port

  • Router ID can also be specified using the router-id command

DR and the BDR (designated router)

image.png

Other routers (DRothers) and DR and BDR only adjacency relationship

image.png

DR and BDR election method

Automatic DR and BDR election

  • 网段上Router ID最大的路由器将被选举为DR,第二大的将被选举为BDR

手工选择DR和BDR

  • 优先级范围是0~255,数值越大,优先级越高,默认为1

  • 如果优先级相同,则需要比较Router ID

  • 如果路由器的优先级被设置为0,它将不参与DR和DBR的选举

DR和BDR的选举过程

  • 路由器的优先级可以影响-个选举过程,但是它不能强制更换已经存在的DR或BDR路由器,

 Ospf的组播地址

  • 224.0.0.5

  • 224.0.0.6

OSPF的度量值为COST_

  • COST= 10的8次方/BW

  • 最短路径是基于接口指定的代价(cost) 计算的

image.png

OSPF数据包

  • 承载在IP数据包内,使用协议号89

OSPF的包类型

OSPF的包类型

         描述

Hello包 用于发现和维持邻居关系,选举DR和BDR
数据库描述包(DBD) 用于向邻居发送摘要信息以同步链路状态数据库
链路状态请求包(LSR) 在路由器收到包含新信息的DBD后发送,用于请求更详细的信息
链路状态更新包(LSU)

收到LSR后发送链路状态通告(LSA) ,一个LSU数据包可能包含几个LSA

链路状态确认包(LSAck) 确认已经收到LSU, 每个LSA需要被分别确认

OSPF邻接关系的建立(也就是七种状态)

  • OSPF启动的第一个阶段是使用Hello报文建立双向通信的过程

  • OSPF启动的第个阶段是建立完全邻接关系

OSPF将网络划分为四种类型

  • 点到点网络(Point-to-Point)

  • 广播多路访问网络(Broadcast MultiAccess, BMA)

  • 非广播多路访问网络(None Broadcast MultiAccess,NBMA)

  • 点到多点网络(Point-to-Multipoint)

OSPF的应用环境

从以下几方面考虑OSPF的使用

  • 网络规模

  • 网络拓扑

  • 其他特殊要求

  • 路由器自身要求

OSPF的特点

  • 可适应大规模网络

  • 路由变化收敛速度快

  • 无路由环

  • 支持变长子网掩码VLSM

  • 支持区域划分

  • 支持以组播地址发送协议报

OSPF与RIP的比较

image.png

OSPF的配置命令

启动OSPF路由进程

Router(config)# router ospf process-id

Interface and the area where the specified OSPF protocol runs

Router(config-router)# network address inverse-mask area area-id

Priority modify the interface

Router(config-if)#ip ospf priority priority

Cost modified values ​​interface

Router(config-if)#ip ospf cost cost

View the routing table

Router#show ip route

View a list of neighbors and their status

Router#show ip ospf neighbor

View OSPF configuration

Router#show ip ospf

View the data structure of the OSPF interface

Router#show ip ospf interface type number


Guess you like

Origin blog.51cto.com/14475876/2437602