帧中继上的OSPF
NBMA

Non Broadcact Multicast Access)
OSPF运行时,
路由器之间需建立邻接关系.而邻接关系是通过发送HELLO包建立的.通常HELLO包是以组播来发送的.为了建立起邻接关系.每个
路由器发送HELLO的时间是要一样的,也就是说建立邻接关系的两个
路由器的HELLO时间和Dead时间要一样.
Point-to-point Hello IOS Dead 4os
BMA (Ethernet) Hello IOS Dead 4os
点对点
网络中不需要选举 DR/BDR
以太网络中需要选举DR /BDR
帧中继链路是典型的非广播式多路访问网络.帧中继链路之所以称为非广播式网络.并不是说F-R链路上不能传播广播包,而是其广播的特殊性!
如图topoly1当R2
路由器在帧中继链路上发送广播或组播包时,数据包沿DLCI=201的PVC发送到
路由器R1上.当
路由器R1在帧中继链路上发送广播或组播包时,数据包将沿DLCI=102和DLCI=103的PVC各发送一次,数据包最终会发送到
路由器R2,R3上.也就是说R1发送广播包时,R2,R3都可以接收到;R2发送广播包时,只有R1可以接收到;R3发送广播包时,也只有R1可以接收到.很明显帧中继上的广播和以太网上的广播有着重大差别!
Hub ----and ---spoke 网络
Hub ----and ---spoke 网络拓扑在实际中有着广泛的实例.中心端路由器R1有到各个远端路由器R2,R3都只有到中心端路由器R1的PVC.R1称为HUB端.R2,R4称为spoke端!如果有数据要从R2传输到R3上,则数据实际上先到R1,再到R3.
1.OSPF 的NBMA 模式(topoly1)
HUB端的配置。
R1(config)#int s0/0
R1(config-if)#encapsulation frame-Relay
R1(config-if)#ip add 10.123.0.1 255.255.0.0
R1(config-if)#router ospf 10
R1(config-if)#net 10.1.0.0 0.0.255.255 area 0
R1(config-if)#net 10.123.0.0 0.0.255.255 area 0
R2(config)#int s0/0
R2(config-if)#encapsulation frame-Relay
R2(config-if)# router ospf 11
R2(config-if)#net 10.2.0.0 0.0.255.255 area 0
R2(config-if)#net 10.123.0.0 0.0.255.255 area 0
R3(config)#int s0/0
R3(config-if)#encapsulation frame-Relay
R3(config-if)#IP ADD 10.123.0.3 255.255.0.0
R3(config)#router ospf 13
R3(config-router)#net 10.3.0.0 0.0.255.255 area 0
R3(config-router)#net 10.123.0.0 0.0.255.255 area 0
OSPF默认的网络类型(模式)为Non Broadcast这时OSPF并不会在帧中继接口上发送HELLO包.邻接关系也就无从谈起了!可以手工使用neighbor 命令配置邻居,这时OSPF将在帧中继接口上以单播的形式发送HELLO 包!
R1(config)#router ospf 10
R1(config-router)#neighbor 10.123.0.2
R1(config-router)#neighbor 10.123.0.3
R2(config)#router ospf 11
R2(config-router)#neighbor 10.123..0.1
R3(config)#router ospf 13
R3(config-router)#neighbor 10.123..0.1
NBMA属于多路访问网络,所以要进行DR选举.由于HELLO包只能传1跳,所以在HUB-AND-SPOKE结构中,必须控制处于“HUB“锻自然成为DR.否则会遭成路由学习不完整!
分析:R1认为R3为DR,自己是BDR;
R1#SH IP OSPF NEIGHBOR
10.3.0.1 Full/DR ………………..s0/0
R2#sh ip ospf neighbor
同样R3认为自己是DR,R1是BDR;
R1#sh ip router
发现路由也不完全
R2(config)#int s0/0
R2(config-if)#ip ospf priority 0
R3(config)#int s0/0
R3(config-if)#ip ospf priority 0
这时路由正常了!呵呵!
R3# sh ip route
0 10.2.0.0 /16[110/64]via 10.123.0.2 s0/0
些时R3#ping 10.2.0.1网络主机平不通?why?
仔细查看R3上的路由表,有到达10.2.0.0/16路由存在,可下一跳是10.123.0.2然而在R3并没有10.123.0.2帧中继映射,同样R2上存在同样问题.解决可以手工添加!
R3(config)#int s0/0
R3(config-if)#frame-relay map ip 10.123.0.2 301
R2(config)#int s0/0
R2(config-if)#frame-relay mao ip 10.123.0.3 201
注意:Map在spoke端配置,因为下一跳不是真实下一跳!明白了吗?
总结:OSPF在帧中继的NBMA特点如下:
(1)帧中继接口IP地址都在同一子网上;
(2)要手工配置OSPF邻居;
(3)需选举DR,要手工控制DR在HUB端;
(4)要手工进行帧中继的映射.
NBMA模式,由于OSPF 在帧中继的接口上不发送HELLO包,所以使用neighbor命令让OSPF发送HELLO包,也可以使用ip ospf neighbor命令改变OSPF的网络类型,让OSPF在串口接口上发送HELLO包!
2.广播模式(topoly2)
(1)HUB-and-spoke上的广播模式:
router(config-if)#Ip ospf network 命令格式如下
router(config-if)#Ip spf network{broadcast|nonbraclcast|point-to-point |point-to-multipoint|point-to-multipointnonbroadcast}
Broadcast把OSPF网络类型改为广播类型,每10秒通过组播发送一次HELLO包.
HUB-AND-SPOKE广播模式配置:
R1(config)int lo0
R1(config-if)#ip add 10.1.0.1 255.255.0.0
R1(config)#int s0/0
R1(config-if)# encapsulation frame-Relay
R1(config-if)#IP ADD 10.123.0.1 255.255.255.0
R1(config-if)#FRAME-RELAY INTF-TYPE DTE
R1(config-if)#no shut
R1(config-if)#router ospf 11
R1(config-if)#net 10.1.0.0 0.0.255.255 area 0
R1(config-if)#net 10.123.0.0 0.0.0.255 area 0
R1(config)#int s0/0
R1(config-if)#ip ospf network broadcast
R2(config )int lo0
R2(config-if)#ip add10.2.0.1 255.255.0.0
R2(config-if)#INT S0/1
R2(config-if)#encapsulation frame-Relay
R2(config-if)#FRAME-RELAY INTF-TYPE DTE
R2(config-if)#IP ADD 10.123.0.2 255.255.255.0
R2(config-if)#no shut
R2(config)#router ospf 12
R2(config-router)#net 10.2.0.0 0.0.255.255 area0
R2(config-router)#net 10.123.0.0 0.0.0.2555 area 0
R2(config)int S0/1
R2(config-if)#IP Ospf network broadcast
R2(config-if)#ip spf priority 0
R2(config-if)#frame-relay map 10.123.0.2 201
R3(config )int lo0
R3(config-if)#ip add 10.3.0.1 255.255.0.0
R3(config)#int s0/1
R3(config-if)#ip ospf network broadcast
R3(config-if)#ip add priority 0
R3(config-if)#frame-relay map ip 10.123.0.2 301
R3(config)#irouter ospf 13
R3(config-router)#net 10.3.0.0 0.0.255.255 area 0
R3(config-router)#net10.123.0.0 0.0.0.255 area 0
总结:HUB-AND-SPOKE广播模式特点:
<1>帧中继接口IP地址都在同一子网上;
<2>需选举DR,不需要手工控制DR;
<3>HELLO包组播发送,无需手工配OSPF邻居;
<4>

OKE端要手工进行帧中继映射.
(2)FULL-Mesh上的广播模式:
增加R2到R3的PVC(当然,是要挣钱购买这个PVC的,呵),则构成了全网状(FULL-MESH)结构。
在全网状结构中,任一个路由器发送Hello包,将会被其他路由器接收到,因此DR的选举不会出现问题,无须控制DR的选举!
FULL-Mesh上广播模式配置:
R1(config)#int lo0
R1(config-if)#ip add 10.1.0.1 255.255.0.0
R1(config-if)#int s0/0
R1(config-if)#encapsulation frame-relay
R1(config-if)#ip add 10.123.0.1 255.255.255.0
R1(config-if)#no shut
R1(config)#router ospf 11
R1(config-router)#net 10.1.0.0 0.0.255.255 area 0
R1(config-router)#net 10.123.0.0 0.0.0.255 area 0
R1(config)#int s0/0
R1(config-if)#ip ospf network broadcast
R2(config)#int lo0
R2(config-if)#ip add 10.2.0.2 255.255.0.0
R2(config-if)#int s0/1
R2(config-if)#encapsulation frame-relay
R2(config-if)#frame-relay intf-type dte
R2(config-if)#no shut
R2(config-if)#ip add 10.123.0.2 255.255.255.0
R2(config-if)#no shut
R2(config)#router ospf 12
R2(config-router)#net 10.2.0.0 0.0.255.255 area 0
R2(config-router)#net 10.123.0.0 0.0.0.255 area 0
R2(config)#int s0/1
R2(config-if)#ip ospf network broadcast
R1(config)#int lo0
R1(config-if)#ip add 10.3.0.1 255.255.0.0
R1(config-if)#int s0/1
R1(config-if)#encapsulation frame-relay
R2(config-if)#frame-relay intf-type dte
R1(config-if)#ip add 10.123.0.3 255.255.255.0
R1(config-if)#no shut
R1(config)#router ospf 13
R1(config-router)#net 10.3.0.0 0.0.255.255 area 0
R1(config-router)#net 10.123.0.0 0.0.0.255 area 0
R1(config)#int s0/1
R1(config-if)#ip ospf network broadcast
R1#sh ip ospf neighor
R1#sh ip route
R2#sh ip ospf neighbor
R2#sh ip route
R3#…………
R3#…………
总结:FULL-Mesh上的广播模式特点:
<1>帧中继接口IP地址都在同一网段;
<2>Hello包组播传送,无须手工配OSPF邻居;
<3>需选举DR,无需手工控制DR;
<4>不需手工进行帧中继映射.
3.点到点模式(topoly3)
点到点(point-to-point)模式,在这种模式中需创建子接口,每个子接口都象一个物理的点到点网络.在点到点模式中,OSPF每10秒发送一次hello包,不选举DR/BDR,无须手工配置OSPF邻居.
R1(config)#int s0/0
R1(config-if)#no ip address
R1(config-if)#no frame-relay inverse-arp
R1(config)#int s0/0.1 point-to-point
R1(config-subif)#ip add 10.12.0.1 255.255.0.0
R1(config-subif)#frame-relay interface-dlci 102
R1(config)#int s0/0.2 point-to-point
R1(config-subif)#ip add 10.12.0.0 255.255.0.0
R1(config-subif)#frame-relay interface-dlci 103
R1(config)#irouter ospf 11
R1(config-router)#inet 10.1.0.0 0.0.255.255 area 0
R1(config-router)#net 10.12.0.0 0.0.255.255 area 0
R1(config-router)#net 10.13.0.0 0.0.255.255 area 0
R2(config)#int s0/0
R2(config-if)#ip add 10.12.0.2 255.255.0.0
R2(config-if)#frame-relay map ip 10.12.0.1 201 broadcast
R2(config-if)#ip ospf network point-to-point
R2(config)#router ospf 12
R2(config-router)#net 10.2.0.0 0.0.255.255 area 0
R2(config-router)#net 10.12.0.0 0.0.255.255 area 0
R3(config)#int s0/0
R3(config-if)#ip add 10.13.0.3 255.255.0.0
R3(config-if)#frame-relay map ip 10.13.0.1 301 broadcast
R3(config-if)#ip ospf network point-to-point
R3(config)#router ospf 13
R3(config-router)#net 10.3.0.0 0.0.255.255 area 0
R3(config-router)#net 10.13.0.0 0.0.255.255 area 0
4.点到多点广播模式
点到多点(point-to-multipoint)广播模式可以被看成多个点到点接口的集合,点到多点帧中继接口在同一子网上,在点到多点模式中,同样不需选举DR/BDR,Hello以组播方式发送,也无须手工配置邻居.
R1(config)#int s0/0
R1(config-if)#ip ospf network point-to-multipoint
R1(config)#router ospf 11
R1(config-router)#net 10.1.0.0 0.0.255.255 area 0
R1(config-router)#net 10.123.0.0 0.0.0.255 area 0
R2(config)#int s0/0
R2(config-if)#ip ospf network point-to-multipoint
R2(config)#router ospf 12
R2(config-router)#net 10.2.0.0 0.0.255.255 area 0
R2(config-router)#net 10.123.0.0 0.0.0.255 area 0
R3(config)#int s0/0
R3(config-if)#ip ospf network point-to-multipoint
R3(config)#router ospf 13
R3(config-router)#net 10.3.0.0 0.0.255.255 area 0
R3(config-router)#net 10.123.0.0 0.0.0.255 area 0
R2#sh ip route
O 10.3.0.0/16 [110/1563] via 10.123.0.1 ……S0/0
下一跳为10.123.0.1,因此无须静态映射!
总结:点到多点广播模式特点:
<1>帧中继接口在同一个子网;
<2>Hello包组播发送,无须手工配OSPF邻居;
<3>不选举DR;
<4>不需要手工进行帧中继映射.
5.点到多点非广播模式
(point-to multipoint nonbroadcast)模式与点到多点广播模式差别在于:OSPF不自动以组播形式发送HELLO包,所以需配置OSPF邻居.
R1(config)#int s0/0
R1(config-if)#ip ospf network point-to-multipoit non-broadcast
R1(config)#router ospf 11
R1(config-router)#net 10.1.0.0 0.0.255.255 area 0
R1(config-router)#net 10.123.0.0 0.0.0.255 area 0
R1(config-router)#neighbor 10.123.0.2
R1(config-router)#neighbor 10.123.0.3
R2(config)#int s0/0
R2(config-if)#ip ospf network point-to-multipoit non-broadcast
R2(config)#router ospf 12
R2(config-router)#net 10.2.0.0 0.0.255.255 area 0
R2(config-router)#net 10.123.0.0 0.0.0.255 area 0
R2(config-router)#neighbor 10.123.0.1
R3(config)#int s0/0
R3(config-if)#ip ospf network point-to-multipoit non-broadcast
R3(config)#router ospf 13
R3(config-router)#net 10.3.0.0 0.0.255.255 area 0
R3(config-router)#net 10.123.0.0 0.0.0.255 area 0
R3(config-router)#neighbor 10.123.0.1
6.点到多点子接口
该子接口默认OSPF网络类型是NBMA,和帧中继主接口是一样的,在R1上创建点到多点子接口,并且在子接口下把OSPF网络类型改为point-to-multipoint.
R1(config)#int s0/0
R1(config-if)#no ip address
R1(config-if)#encapsulation frame-relay
R1(config-if)#no frame-relay inverse-arp
R1(config-if)#int s0/0.100 nultipoint
R1(config-subif)#ip add 10.123.0.1 255.255.0.0
R1(config-subif)#frame-relay map ip 10.123.0.2 102.broadcast
R1(config-subif)#frame-relay map ip 10.123.0.3 103 broadcast
R1(config-subif)#ip ospf network point-to-multipoint
R1(config)#router ospf 11
R1(config-router)#net 10.1.0.0 0.0.255.255 area 0
R1(config-router)#net 10.123.0.0 0.0.0.255 area 0
R2(config)#int s0/0
R2(config-if)#no frame-relay inverse-arp
R2(config-if)#frame-relay map ip 10.123.0.1 201.broadcast
R2(config-subif)#ip ospf network point-to-multipoint
R2(config)#router ospf 12
R2(config-router)#net 10.2.0.0 0.0.255.255 area 0
R2(config-router)#net 10.123.0.0 0.0.0.255 area 0
R3(config)#int s0/0
R3(config-if)#no frame-relay inverse-arp
R3(config-if)#frame-relay map ip 10.123.0.1 301.broadcast
R3(config-subif)#ip ospf network point-to-multipoint
R3(config)#router ospf 13
R3(config-router)#net 10.3.0.0 0.0.255.255 area 0
R3(config-router)#net 10.123.0.0 0.0.0.255 area 0
关于帧中继就告一段落了!
Thanks!