描述OSPF将网络分成哪些类型,每一种类型是不是需要选择DR和BDR,如果需要如何选择?
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了描述OSPF将网络分成哪些类型,每一种类型是不是需要选择DR和BDR,如果需要如何选择?相关的知识,希望对你有一定的参考价值。
OSPF的网络类型广播、NBMA(非广播多点可达)、P2MP、P2P广播、NBMA需要选举DR、BDR。
P2MP、P2P不需要选举DR、BDR。
广播、NBMA中DR的选举:
首先两台设备交互hello报文,比较Hello报文中的如下参数,如果参数相同才进行DR/BDR的选举,否则不能正常通讯。
1、Area ID
2、Hello/Dead 时间间隔
3、认证类型和认证密钥
4、特 殊区域类型Stub Flag
5、子网掩码
如果上面的参数都一样了,首先比较端口优先级,端口优先级最大的将选为DR,第二大的将选为BDR。如果优先级相同,则需要比较Router ID,Router ID最大将选为DR、第二大的将选为BDR,如果优先级为0,则不参与DR、BDR的选举。这样查看设备OSPF状态就会进入2-way状态。
上面只限于第一次DR、BDR的选举。如果后来有优先级更高的加入到现有的网络中,出于安全稳定的考虑,新加入的设备不会参加DR、BDR的选举,知道DR、BDR出现故障时才会参与选举。
选举出DR、BDR的原因是为了防止设备之间相互发送OSPF交互报文,如果每台设备都交互OSPF报文,网络中的带宽会很快被消耗掉。都与DR、BDR交互报文,然后由DR下发,这样减少了OSPF报文的交互,提高了网络带宽的利用率。
P2MP、P2P不需要选举DR、BDR,是使用组播地址224.0.0.5 224.0.0.6直接交互OSPF报文。 但是有些厂商(H3C)没有按照RFC文档制作OSPF协议,debug查看OSPF交互报文时,只使用组播224.0.0.5。. 参考技术A 广播,NBMA需要选就DR BDR 根据优先级选举,优先级相同选举ROUTER ID大的
P2P P2MP 不需要选举
OSPF NBMA实验(单播广播)
在帧中继下ospf网络类型默认为NBMA,不支持广播(其实指的是组播,因为ospf是通过组播来发送数据的),只支持单播。
以下实验是在帧中继下既能使ospf网络类型支持默认单播,又通过修改网络类型手段支持广播(其实指的组播,因为ospf是通过组播来发送报文的)。
以下我们第一种方式使用默认单播方式做的实验,第二种实验采用广播方式(既然你不支持广播,那么我让你支持广播【其实指的组播,因为ospf是通过组播来发送报文的】不就行了?)
(两个实验帧中继map表相同)
第一种,采用默认单播方式,需要手动指定peer
R1
[Huawei]dis cur conf ospf
[V200R003C00]
#
ospf 1
peer 10.1.123.2
peer 10.1.123.3
area 0.0.0.0
network 10.1.123.0 0.0.0.255
network 11.1.1.1 0.0.0.0
#
return
[Huawei]dis cur inter
[Huawei]dis cur interface s 1/0/0
[V200R003C00]
#
interface Serial1/0/0
link-protocol fr (s口默认为ppp,也就是p2p网络类型。因此需要修改成fr)
fr map ip 10.1.123.2 102
fr map ip 10.1.123.3 103
ip address 10.1.123.1 255.255.255.0
[Huawei]dis ospf inter s 1/0/0
OSPF Process 1 with Router ID 11.1.1.1
Interfaces
Interface: 10.1.123.1 (Serial1/0/0)(要选择DR、BDR、DROther)
Cost: 48 State: DROther Type: NBMA MTU: 1500
Priority: 1
Designated Router: 10.1.123.3
Backup Designated Router: 10.1.123.2
Timers: Hello 30 , Dead 120 , Poll 120 , Retransmit 5 , Transmit Delay 1
[Huawei]dis ospf peer bri
OSPF Process 1 with Router ID 11.1.1.1
Peer Statistic Information
----------------------------------------------------------------------------
Area Id Interface Neighbor id State
0.0.0.0 Serial1/0/0 22.1.1.1 Full
0.0.0.0 Serial1/0/0 33.1.1.1 Full
----------------------------------------------------------------------------
R2
[Huawei]dis cu conf ospf
[V200R003C00]
#
ospf 1
peer 10.1.123.1
peer 10.1.123.3
area 0.0.0.0
network 10.1.123.0 0.0.0.255
network 22.1.1.1 0.0.0.0
#
return
[Huawei]dis cu inter s 1/0/0
[V200R003C00]
#
interface Serial1/0/0
link-protocol fr
fr map ip 10.1.123.1 201
fr map ip 10.1.123.3 203
ip address 10.1.123.2 255.255.255.0
[Huawei]dis ospf inter s 1/0/0
OSPF Process 1 with Router ID 22.1.1.1
Interfaces
Interface: 10.1.123.2 (Serial1/0/0)
Cost: 48 State: BDR Type: NBMA MTU: 1500
Priority: 1
Designated Router: 10.1.123.3
Backup Designated Router: 10.1.123.2
Timers: Hello 30 , Dead 120 , Poll 120 , Retransmit 5 , Transmit Delay 1
[Huawei]
[Huawei]
[Huawei]dis ospf peer bri
OSPF Process 1 with Router ID 22.1.1.1
Peer Statistic Information
----------------------------------------------------------------------------
Area Id Interface Neighbor id State
0.0.0.0 Serial1/0/0 11.1.1.1 Full
0.0.0.0 Serial1/0/0 33.1.1.1 Full
----------------------------------------------------------------------------
R3
[Huawei-ospf-1]dis cu conf ospf
[V200R003C00]
#
ospf 1
peer 10.1.123.1
peer 10.1.123.2
area 0.0.0.0
network 10.1.123.0 0.0.0.255
network 33.1.1.1 0.0.0.0
#
return
[Huawei-ospf-1]dis cu int s 1/0/0
[V200R003C00]
#
interface Serial1/0/0
link-protocol fr
fr map ip 10.1.123.1 301
fr map ip 10.1.123.2 302
ip address 10.1.123.3 255.255.255.0
#
[Huawei]dis ospf inter s 1/0/0
OSPF Process 1 with Router ID 33.1.1.1
Interfaces
Interface: 10.1.123.3 (Serial1/0/0)
Cost: 48 State: DR Type: NBMA MTU: 1500
Priority: 1
Designated Router: 10.1.123.3
Backup Designated Router: 10.1.123.2
Timers: Hello 30 , Dead 120 , Poll 120 , Retransmit 5 , Transmit Delay 1
[Huawei]dis ospf peer bri
OSPF Process 1 with Router ID 33.1.1.1
Peer Statistic Information
----------------------------------------------------------------------------
Area Id Interface Neighbor id State
0.0.0.0 Serial1/0/0 11.1.1.1 Full
0.0.0.0 Serial1/0/0 22.1.1.1 Full
----------------------------------------------------------------------------
第二种,NBMA默认不支持广播(其实指的是组播),那么我就要让你支持广播方式(均不需指定peer),具体实验如下:
R1:
[Huawei]dis cur conf ospf
[V200R003C00]
#
ospf 1
area 0.0.0.0
network 10.1.123.0 0.0.0.255
network 11.1.1.1 0.0.0.0
#
return
[Huawei]dis current-configuration interface s1/0/0
[V200R003C00]
#
interface Serial1/0/0
link-protocol fr
fr map ip 10.1.123.2 102 broadcast (建立帧中继map支持广播表?)
fr map ip 10.1.123.3 103 broadcast
ip address 10.1.123.1 255.255.255.0
ospf network-type broadcast (网络类型修改)
#
return
[Huawei]dis ospf interface Serial 1/0/0
OSPF Process 1 with Router ID 11.1.1.1
Interfaces
Interface: 10.1.123.1 (Serial1/0/0)
Cost: 48 State: BDR Type: Broadcast MTU: 1500
Priority: 1
Designated Router: 10.1.123.3
Backup Designated Router: 10.1.123.1
Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1
[Huawei]dis ospf peer bri
OSPF Process 1 with Router ID 11.1.1.1
Peer Statistic Information
----------------------------------------------------------------------------
Area Id Interface Neighbor id State
0.0.0.0 Serial1/0/0 22.1.1.1 Full
0.0.0.0 Serial1/0/0 33.1.1.1 Full
----------------------------------------------------------------------------
R2:
[Huawei]dis cu conf ospf
[V200R003C00]
#
ospf 1
area 0.0.0.0
network 10.1.123.0 0.0.0.255
network 22.1.1.1 0.0.0.0
#
return
[Huawei]dis cu interface s 1/0/0
[V200R003C00]
#
interface Serial1/0/0
link-protocol fr
fr map ip 10.1.123.1 201 broadcast
fr map ip 10.1.123.3 203 broadcast
ip address 10.1.123.2 255.255.255.0
ospf network-type broadcast
#
return
[Huawei]dis ospf inter
[Huawei]dis ospf interface s1/0/0
OSPF Process 1 with Router ID 22.1.1.1
Interfaces
Interface: 10.1.123.2 (Serial1/0/0)
Cost: 48 State: DROther Type: Broadcast MTU: 1500
Priority: 1
Designated Router: 10.1.123.3
Backup Designated Router: 10.1.123.1
Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1
[Huawei]dis ospf peer bri
OSPF Process 1 with Router ID 22.1.1.1
Peer Statistic Information
----------------------------------------------------------------------------
Area Id Interface Neighbor id State
0.0.0.0 Serial1/0/0 11.1.1.1 Full
0.0.0.0 Serial1/0/0 33.1.1.1 Full
----------------------------------------------------------------------------
[Huawei]
R3:
[Huawei]dis cu config ospf
[V200R003C00]
#
ospf 1
area 0.0.0.0
network 10.1.123.0 0.0.0.255
network 33.1.1.1 0.0.0.0
#
return
[Huawei]dis cu inter s 1/0/0
[V200R003C00]
#
interface Serial1/0/0
link-protocol fr
fr map ip 10.1.123.1 301 broadcast
fr map ip 10.1.123.2 302 broadcast
ip address 10.1.123.3 255.255.255.0
ospf network-type broadcast
#
return
[Huawei]dis ospf inter s 1/0/0
OSPF Process 1 with Router ID 33.1.1.1
Interfaces
Interface: 10.1.123.3 (Serial1/0/0)
Cost: 48 State: DR Type: Broadcast MTU: 1500
Priority: 1
Designated Router: 10.1.123.3
Backup Designated Router: 10.1.123.1
Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1
[Huawei]dis ospf peer bri
OSPF Process 1 with Router ID 33.1.1.1
Peer Statistic Information
----------------------------------------------------------------------------
Area Id Interface Neighbor id State
0.0.0.0 Serial1/0/0 11.1.1.1 Full
0.0.0.0 Serial1/0/0 22.1.1.1 Full
----------------------------------------------------------------------------
本文出自 “五片棱角” 博客,请务必保留此出处http://hi289.blog.51cto.com/4513812/1795376
以上是关于描述OSPF将网络分成哪些类型,每一种类型是不是需要选择DR和BDR,如果需要如何选择?的主要内容,如果未能解决你的问题,请参考以下文章