您的位置:首页 > 其它

OSPF分解试验部分-LAB1:OSPF DR选举测试试验

2010-10-13 13:47 369 查看
LAB1:OSPF DR选举测试试验




使用场合:
在以太网络中,如果OSPF路由器很多,那么他们更新LSA的次数要达到n(n-1)/2次数,很明显,这样一个更新的次数浪费带宽,消耗路由器的开销,所以为了提高效率,我们要在整个ethernet网络中选择出一个DR,所有路由器向DR更新,提高效率。BDR作为DR备份的路由器。
试验需求:
测试DR选举,DR的选举规则如下:
Wait-time
优先级
Router-ID

基本配置:
R1
router ospf 1
router-id 1.1.1.1
log-adjacency-changes
network 123.1.1.1 0.0.0.0 area 0
R2
router ospf 1
router-id 2.2.2.2
log-adjacency-changes
network 123.1.1.2 0.0.0.0 area 0
R3
router ospf 1
router-id 3.3.3.3
log-adjacency-changes
network 123.1.1.3 0.0.0.0 area 0

查看DR,从下面信息中我们看到DRR3
R3#show ip os int e0/0
Ethernet0/0 is up, line protocol is up
Internet Address 123.1.1.3/24, Area 0
Process ID 1, Router ID 3.3.3.3, Network Type BROADCAST, Cost: 10
Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 3.3.3.3, Interface address 123.1.1.3
Backup Designated router (ID) 2.2.2.2, Interface address 123.1.1.2
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:09
Supports Link-local Signaling (LLS)
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 2
Last flood scan time is 0 msec, maximum is 4 msec
Neighbor Count is 2, Adjacent neighbor count is 2
Adjacent with neighbor 1.1.1.1
Adjacent with neighbor 2.2.2.2 (Backup Designated Router)
Suppress hello for 0 neighbor(s)

那么我们测试是否是选择Router-ID最大的作为DR

接下来我们清除R3 OSPF邻居,让它重新收敛。发现DR变为R2

R3clear ip ospf process
R3#show ip os int e0/0
Ethernet0/0 is up, line protocol is up
Internet Address 123.1.1.3/24, Area 0
Process ID 1, Router ID 3.3.3.3, Network Type BROADCAST, Cost: 10
Transmit Delay is 1 sec, State BDR, Priority 1
Designated Router (ID) 2.2.2.2, Interface address 123.1.1.2
Backup Designated router (ID) 3.3.3.3, Interface address 123.1.1.3
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:06
Supports Link-local Signaling (LLS)
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 0, maximum is 2
Last flood scan time is 4 msec, maximum is 4 msec
Neighbor Count is 2, Adjacent neighbor count is 2
Adjacent with neighbor 1.1.1.1
Adjacent with neighbor 2.2.2.2 (Designated Router)
Suppress hello for 0 neighbor(s)
那么是否是先启动OSPF的路由器作为DR
结论:
并不是先启动OSPF进程的路由器就是DR,而是有一个时间间隔让路由器来等待其他路由器,在这个时间间隔内,路由器相互监听Hello包中的DR和DBR字段中的信息,并且服从优先级原则。这个时间间隔和dead interval时间是相同的40S。
但是在实际的网络中,即使是40秒内同时起进程的情况也少见;实际情况下是率先启用ospf进程的路由器就很有可能成为DR,第二个启动的就很有可能成为BDR,所以这个地方可能很多人误解为先启动OSPF进程的路由器作为DR
总结:
如果wait-time时间内没有收到HELLO包,那么肯定是先配置的OSPFDRDR不抢占,所以不一定就是router-id大的是DR
如果在40S时间内大家OSPF都起来了,那么一般就是ROUTER-ID大的是DR

接下来,更改优先级,R1255R2100R3默认1
R1
interface Ethernet0/0
ip address 123.1.1.1 255.255.255.0
ip ospf priority 255
R2
R2(config-router)#int e0/0
R2(config-if)#ip os priority 100
查看R1现在是否为DR
R1#show ip os int e0/0
Ethernet0/0 is up, line protocol is up
Internet Address 123.1.1.1/24, Area 0
Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 10
Transmit Delay is 1 sec, State DR, Priority 255
Designated Router (ID) 1.1.1.1, Interface address 123.1.1.1
Backup Designated router (ID) 2.2.2.2, Interface address 123.1.1.2
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:02
Supports Link-local Signaling (LLS)
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 2
Last flood scan time is 0 msec, maximum is 4 msec
Neighbor Count is 2, Adjacent neighbor count is 2
Adjacent with neighbor 2.2.2.2 (Backup Designated Router)
Adjacent with neighbor 3.3.3.3
Suppress hello for 0 neighbor(s)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: