Dynamic routing --OSPF theoretical papers (b)

OSPF routing protocol

OSPF Routing Protocol Overview

And Interior Gateway Protocol Exterior Gateway Protocol

  • Autonomous systems ( AS): each region is an autonomous system
  • Interior Gateway Protocol ( IGP): protocol within each region called Interior Gateway Protocol
  • Exterior Gateway Protocol ( EGP): network connection protocol between the region is called exterior gateway protocol

OSPF(Open Shortest Path First) is an interior gateway protocol (referred to IGP), for (a single autonomous systems AS) routing the decision. It is a link state routing protocol implemented under the Interior Gateway Protocol ( IGP), so that the internal operation of the autonomous system.

OSPF working process

  • Neighbor List
  • Link state data table
  • Routing Table

Establishes adjacencies link state database (learning link status information) shortest path tree ( Dijkstraalgorithm) routing table

OSPF area

  • To accommodate large networks OSPFin ASthe plurality of divided regions
  • Each OSPFroute is only maintains a complete link-state information in your area

Area ID

  • Region IDcan be expressed as a decimal number
  • It can also be expressed as aIP

AREA 0 (backbone area)

  • Area 0 Belong to the core (backbone area), the backbone area and only one, each region and connected to the backbone area

  • Responsible for routing information dissemination between regions

Router ID

  • OSPFUniquely identifying the region router IPaddress

Router ID selection rule

  • Select router loopbackhighest value on the interface IPaddress
  • If there is no loopbackinterface to select the physical ports kinds IPhighest address
  • You can also use router-idthe command to specifyRouter ID

DR and BDR

  • DR: Responsible for sending information to all other OSPFrouters

  • BDR: Responsible for monitoring the status of the backup DR, and the current DRtake over its role in the event of failure
  • DRFailure BDRto replaceDR

  • Other routers ( DRothers) only with DR, and BDRadjacent with

DR and BDR election method

  • Automatic election DRandBDR
    • On the segment Router ID's largest router will be elected as DRthe second largest will be electedBDR
  • Manually select DRandBDR
    • Priority range 0~255, the larger the number, the higher priority, the default is me
    • If the priorities are the same, you need to compareRouter ID
    • If the router priority is set 0, it will not participate DRand DBRelections

DR and BDR election process

  • Router priority can affect an election process, but it can not force the replacement of existing DRor BDRrouter

OSPF multicast address

  • 224.0.0.5: responsible for sending information to the following router
  • 224.0.0.6: responsible for receiving information on the following routes

OSRF metric value COST

  • COST=10的8次方/BW(100M / bandwidth)
  • The shortest path is based on the cost assigned to the interface ( cost) calculated

OSPF datagram type

OSPF packet

  • Carried in IPthe packet, a protocol ID89

OSPF packet types

OSPFThe packet type description
Hellopackage It used to discover and maintain neighbor relations, elections DRandBDR
Database description packets DBD( ) For transmitting the summary information to the neighbor link state database synchronization
Link state request packet LSR( ) The router receives the information containing the new DBDinformation transmission, a request for more detailed
Link state update packets LSU( ) After receiving LSR sends a link state advertisement ( LAS), a LSUpacket may contain severalLSA
Link state acknowledgment packet LSAck( ) Confirmation has been received LSU, each LSAneeds to be confirmed separately

The first stage is to start using OSPF Hello packets to establish two-way communication process

DownStatus: inactive status, information exchange, activated

InitStatus: initialization state, the transmission information is exchanged

2-WayStatus: information exchange, and to elect DRand BDRsingle not confirmed DRandBDR

The second stage of the boot is built entirely adjacency

ExStartStatus: Start quasi-state, and confirmed DRand BDR;

ExchangeStatus: the status switching, transmission DBD, and LSAckpackets

LoadingStatus: transport LSR, LSU(LSA), LSAckpacket

FullStatus: steady state convergence

OSPF network is divided into four types

  • Point to point network Point-to-Point( )
  • Broadcast multi-access network ( Broadcast Multiaccess,BMA)
  • Non-Broadcast Multiple Access Network ( None Broadcast Multiaccess,NBMA)
  • Multipoint networks Point-to-Multipoint( )

Consider using OSPF from the following aspects

  • Network size
  • Network topology
  • Other special requirements
  • Routers own requirements

OSPF features

  • Can accommodate large-scale network
  • Routing convergence speed change block
  • No routing loop
  • Support for variable length subnet mask VLSM
  • Support zoning
  • Support protocol packets sent to a multicast address

Comparison of OSPF and RIP's

OSPF RIP v1 RIP v2
Link-state routing protocol Distance vector routing protocol Distance vector routing protocol
There is no limit on the number of hops RIPThe 15hop limit, than 15jump The route is considered unreachable
Support for variable length subnet mask(VLSM) It does not support variable length subnet mask(VLSM) Support for variable length subnet mask(VLSM)
Convergence speed block Slow convergence Slow convergence
Multicast transmission link state update Updating the entire routing table periodically broadcasted Updating the entire routing table periodically broadcasted

OSPF configuration commands

Start OSPF routing process

router ospf process-id

Interface and the area where the specified OSPF protocol runs

network address inverse-mask area area-id (Inverted)

Priority modify the interface

ip ospf priority priority

Cost modified values ​​interface

ip ospf cost cpst

View the routing table

show ip route

View a list of neighbors and their status

show ip ospf neighbor

View OSPF configuration

show ip ospf

View the data structure of the OSPF interface

show ip ospf interface type number

Which reality scene which first started doing DR

OSPF multi-zone principle and configuration

The Reasons for multiple OSPF areas

  • Improve network scalability
  • Fast Convergence

Three traffic OSPF

Zone traffic

  • Exchange of traffic between the packets constituting a single routing area

Inter-domain traffic ( ABRrouting)

  • Exchanging packets constituting traffic router between different regions

External traffic ( ASBRrouting)

  • OSPFDomain router and OSPFan outer region between the other routers in the autonomous system to exchange data or packet traffic constituted

OSPF routing type

  • Area Border Router ABR
  • Autonomous system boundary router ASBR

OSPF area types

  • Backbone areaArea 0
  • Non-backbone area - depending on the type of routing can learn to distinguish

    • Standard area
    • Peripheral region(stub)
    • Totally peripheral (Totally stubby)area
    • Non-stubby area(NSSA)
  • Different regions of the tip is run except thatLSA

Composition OSPF link-state database

  • Each router creates a database by each interface corresponding to adjacent nodes and interfaces consisting of speed
  • No link state database entries called LSA(LSA), there are six common LSAtypes

Link state advertisement (LSA) type

Type Code description use
Type 1 routerLSA Issued by the routers in the area (all routers are emitted) (interactive link status)
Type 2 The internetLSA (Declared network state information) is sent from the DR in the region (12, and each region has a)
Type 3 Network SummaryLSA ABRIssued aggregated link advertised other regions (inter-area routing information collection, transmission across the area)
Type 4 ASBRGatherLSA ABRIssued for an ASBR information (tell other routing ASBRposition)
Type 5 ASOutsideLSA ASBRIssued to advertise external route (advertise external route information network, the external network to collect information)
Type 7 NSSAOutsideLSA NSSAIn the region ASBRemitted from, for external routes advertised in the region of the connection (only in the NSSAmemory region)

Each region types allowed LSA flooding

Area Type 1&2 3 4&5 7
The backbone area (area 0) allow allow allow Not allowed
Non-backbone area, the non-peripheral region allow allow allow Not allowed
Peripheral region allow allow Not allowed Not allowed
Totally peripheral area allow Not allowed* Not allowed Not allowed
NSSA allow allow Not allowed allow

OSPF common view commands

command Features
show ip route Check the routing table (direct / learning)
show ip route ospf View only OSPFlearned routes
show ip protocol View OSPFprotocol configuration information
show ip ospf To see OSPFhow it is configured and ABRinformation
show ip ospf database View LSDBall within the LSAdata
show ip ospf interface View on the interface OSPFinformation configuration
show ip ospf neighbor View OSPFneighbors and adjoining states
show ip ospf neighbor detail View OSPFdetailed neighbor information (including DR/BDR)
debug ip ospf adj View Router "adjacency" of the entire process
debug ip ospf packet View each OSPFinformation packet
clear ip route Empty routing table

Router route selection entry

  • Routers only the best route to add entries to the routing table
  • Routing entries based on

    • Administrative distance
    • metric
  • Load balancing routing entries

Peripheral areas and complete peripheral region

  • Region satisfies the following conditions

    • Only as a default route to export their area
    • As the area can not cross the region virtual link
    • StubNo area in the autonomous system boundary routerASBR
    • Not the backbone areaArea 0
  • Peripheral region

    • No LSA4、5、7notice
  • Totally peripheral area
    • In addition to the default route advertised a LSA3, without LSA3、4、5、7notice

OSPF advanced configuration

Understand routing redistribution

  • A single IProuting protocol is to manage the network IPof choice for routing scheme
  • Cisco IOSCapable of performing a plurality of routing protocols, each routing protocol and the routing protocols and services belong to the same autonomous system
  • Cisco IOSUse redistribution routing features to exchange routing information created by different protocols

Routing redistribution considerations

  • Metric (bandwidth)
  • Administrative distance

Redistributed into the OSPF domain route path type

  • The type of external path 1 ( Type 1 external path, E1)
  • Type external path 2 ( Type 2 external path, E2)

A router has two paths to the exterior of the destination network 10.1.2.0

  • E1 type

    • 路径A-B-D的代价是25(20+5) (优先)
    • 路径A-C-D代价为48(18+30)
  • E2类型
    • 路径A-B-D的代价是20
    • 路径A-C-D的代价为18 (优先)

动态路由——OSPF  理论篇 (二)

路由重分发配置命令

  • redistribute protocol [metric metric-value] [metric-type type-value] [subnets]

NSSA区域

NSSA区域是OSPF RFC的补遗

  • 定义了特殊的LSA类型7
  • 提供类似stub areatotally stubby area的优点
  • 可以包含ASBR

OSPF链路状态通告

  • LSA(NSSA EXternal LSA,NSSA外部LSA)

NSSA区域重分发路由类型

  • N1N2
  • 经过NSSA区域ABR后转换为E1E2(7变成5)

配置NSSA区域命令

  • area area-id nssa [no-summary]

OSPF的路径类型

  • 区域内路径
  • 区域外路径
  • 类型1的外部路径
  • 类型2的外部路径

OSPF的路径类型的优先级

  • 区域内路径: 优先级1
  • 区域间路径: 优先级2
  • E1外部路径: 优先级3
  • E2外部路径: 优先级4
  • 1表示最高的优先级,4表示最低的优先级

OSPF虚链路

  • 虚链路

    • 值一条通过一个非骨干区域连接到骨干区域的链路
  • 虚链路的目的

    • 通过一个非骨干区域连接一个区域到骨干区域
    • 通过一个非骨干区域连接一个分段的骨干区域
  • 配置虚链路的规则及特点

    • 虚链路必须配置在两台ABR路由器之间
    • 传送区域不能是一个末梢区域
    • 虚链路的稳定性取决于其经过的区域的稳定性
    • 虚链路有助于提供逻辑冗余
  • 虚链路的配置命令
    • area area-id vrtual-link router-id

总结:

OSPF域中路由的路径类型

  • E1(N1)
  • E2(N2)

OSPF的四种路由类型

  • DR
  • BDR
  • ABR
  • ASBR

OSPF的五大区域

  • 骨干区域
  • 标准区域
  • 末梢区域
  • 存末梢区域
  • 非存末梢区域

OSPF的五大数据包类型

  • hello
  • DBD
  • LSR
  • LSU(LSA)
  • LSACK

OSPF的六种LSA

  • 路由器LSA
  • 网络LSA
  • 网络汇总LSA
  • ASBR汇总LSA
  • AS外部LSA
  • NSSA外部LSA

OSPF的七种状态

  • Down
  • init
  • 2-Way
  • Exstart
  • Exchange
  • loading
  • ful

Guess you like

Origin blog.51cto.com/14473285/2438367