设为首页 收藏本站
查看: 2196|回复: 0

[经验分享] CCNP路由实验之十 组播(多播)

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2014-11-5 11:13:57 | 显示全部楼层 |阅读模式
单播(Unicast):网络节点之间的通信通讯的模式是“一对一”的,此时信息的接收和传递只在两个节点之间进行。例如,你在收发电子邮件、浏览网页时,必须与邮件服务器、Web服务器建立连接,此时使用的就是单播数据传输方式。网络中的交换机和路由器对数据只进行转发不进行复制。如果10个客户机需要相同的数据,则服务器需要逐一传送,重复10次相同的工作。但由于其能够针对每个客户的及时响应,所以现在的网页浏览全部都是采用IP单播协议。网络中的路由器和交换机根据其目标地址选择传输路径,将IP单播数据传送到其指定的目的地。单播应用于TCP,而TCP是一个面向连接的协议,它意味着分别运行于两主机(由IP地址确定)内的两进程(由端口号确定)间存在一条连接。考虑包含多个主机的共享信道网络如以太网。每个以太网帧包含源主机和目的主机的以太网地址(48 bit)。通常每个以太网帧仅发往单个目的主机,目的地址指明单个接收接口,因而称为单播(unicast)。在这种方式下,任意两个主机的通信不会干扰网内其他主机(可能引起争夺共享信道的情况除外)
  • 单播的优点:
    1)服务器及时响应客户机的请求
    2)服务器针对每个客户不同的请求发送不同的数据,容易实现个性化服务。
  • 单播的缺点:
    1)服务器针对每个客户机发送数据流,在客户数量大、每个客户机流量大的流媒体应用中服务器不堪重负。
    2)大量佔用网络带宽

    广播(Broadcast):主机之间“一对所有”的通讯模式(UDP),网络对其中每一台主机发出的信号都进行无条件复制并转发,所有主机都可以接收到所有信息(不管你是否需要),如客户机通过DHCP自动获得IP地址的过程就是通过广播来实现的,由于其不用路径选择,所以其网络成本可以很低廉。有线电视网就是典型的广播型网络,我们的电视机实际上是接受到所有频道的信号,但只将一个频道的信号还原成画面。在数据网络中也允许广播的存在,但是同单播和多播相比,广播几乎占用了子网内网络的所有带宽,因此其被限制在二层交换机的局域网范围内,禁止广播数据穿过路由器,防止广播数据(广播风暴)影响大面积的主机。集线器由于其工作原理决定了不可能过滤广播风暴,一般的交换机也没有这一功能,不过现在有的网络交换机(如全向的QS系列交换机)也有过滤广播风暴功能了,路由器本身就有隔离广播风暴的作用。 广播风暴不能完全杜绝,但是只能在同一子网内传播,就好像喇叭的声音只能在同一会场内传播一样,因此在由几百台甚至上千台电脑构成的大中型局域网中,一般进行子网划分,就像将一个大厅用墙壁隔离成许多小厅一样,以达到隔离广播风暴的目的。 在IP网络中,广播地址用IP地址“255.255.255.255”来表示,这个IP地址代表同一子网内所有的IP地址。
    广播分为第2层广播和第3层广播。第2层广播也称硬件广播,用于在局域网内向所有的结点发送数据,通常不会穿过局域网的边界(路由器),除非它变成一个单播。广播是一个二进制的全1或者十六进制全F的地址。  第3层广播用于在这个网络内向所有的结点发送数据。第3层广播也支持平面的老式广播。广播信息是指以某个广播域所有主机为目的的信息。这些被称为网络广播,它们是所有的主机位均为ON。
    广播的优点:
    1)网络设备简单,维护简单,布网成本低廉
    2)由于服务器不用向每个客户机单独发送数据,所以服务器流量负载极低。
    广播的缺点:
    1)无法针对每个客户的要求和时间及时提供个性化服务。
    2)网络允许服务器提供数据的带宽有限,客户端的最大带宽=服务总带宽。例如有线电视的客户端的线路支持100个频道(如果采用数字压缩技术,理论上可以提供500个频道),即使服务商有更大的财力配置更多的发送设备、改成光纤主干,也无法超过此极限。也就是说无法向众多客户提供更多样化、更加个性化的服务。
    3)广播禁止允许在Internet宽带网上传输。

    泛洪,是交换机和网桥使用的一种数据流传递技术,交换机根据收到数据帧中的源MAC地址建立该地址同交换机端口的映射,并将其写 入MAC地址表(CAM表)中。交换机将数据帧中的目的MAC地址同已建立的MAC地址表进行比较,以决定由哪个端口进行转发。如数据帧中的目的MAC地址不在MAC地址表中,则向所有端口转发。泛洪操作广播的是普通数据帧而不是广播帧 (FF.FF.FF.FF.FF.FF).,广播是向同一子网内所有的端口(包括自己的那个端口)发送消息; 泛洪只是在所有的端口中不包括发送消息的(自己的)那个端口发送消息.
    洪水攻击包含MAC泛洪、网络泛洪、TCP SYN泛洪、应用程序泛洪、DHCP报文泛洪攻击、ARP报文泛洪攻击


    • MAC泛洪:生在OSI第二层,攻击者进入LAN内,将假冒源MAC地址和目的MAC地址将数据帧发送到以太网上导致交换机的内容可寻址存储器(CAM)满掉,然后交换机失去转发功能,导致攻击者可以像在共享式以太网上对某些帧进行嗅探,如果发生了mac地址泛洪攻击,那么你所处的局域网会出现网络缓慢或者断网现象,可以用wireshark等抓包软件抓包分析,能够发现大量的数据包,其mac地址均为随机伪造,且数据内容也为随机伪造。这种攻击可以通过端口安全技术方式防御,比如端口和MAC地址绑定。
    • 网络泛洪Smurf:发生在OSI第三层,就是假冒ICMP广播ping,如果路由器没有关闭定向广播,那攻击者就可以在某个网络内对其它网络发送定向广播 ping,那个网络中的主机越是多,造成的结果越是严重,因为每个主机默认都会响应这个ping,导致链路流量过大而拒绝服务,所以属于增幅泛洪攻击,当然也可以对本 网络发送广播ping。
    • 网络泛洪DDos:发生在OSI第三、四层,攻击侵入许多因特网上的系统,将DDos控制软件安装进去,然后这些系统再去感染其它系统,通过这些代理,攻击者将攻击指令发送给DDos控制软件,然后这个系统就去控制下面的代理系统去对某个IP地址发送大量假冒的网络流量,然后受攻击者的网络将被这些假的流量所占据就无法为他们的正常用户提供服务了。
    • TCP SYN泛洪发生在OSI第四层,这种方式利用TCP协议的特性,就是三次握手。攻击者发送TCP SYN,SYN是TCP三次握手中的第一个数据包,而当服务器返回ACK后,改攻击者就不对之进行再确认,那这个TCP连接就处于挂起状态,也就是所谓的半连接状态,服务器收不到再确认的话,还会重复发送ACK给攻击者。这样更加会浪费服务器的资源。攻击者就对服务器发送非常大量的这种TCP连接,由于每一个都没法完成三次握手,所以在服务器上,这些TCP连接会因为挂起状态而消耗CPU和内存,最后服务器可能死机,就无法为正常用户提供服务了。
    • 应用程序泛洪发生在OSI第七层,目的是消耗应用程序或系统资源,比较常见的应用程序泛洪就是垃圾邮件,但一般无法产生严重的结果。其它类型的应用程序泛洪可能是在服务器上持续运行高CPU消耗的程序或者用持续不断的认证请求对服务器进行泛洪攻击,意思就是当TCP连接完成后,在服务器提示输入密码的时候停止响应。
    • DHCP报文泛洪攻击是指:恶意用户利用工具伪造大量DHCP报文发送到服务器,一方面恶意耗尽了IP资源,使得合法用户无法获得IP资源;另一方面,如果交换机上开启了DHCPSnooping功能,会将接收到的DHCP报文上送到CPU。因此大量的DHCP报文攻击设备会使DHCP服务器高负荷运行,甚至会导致设备瘫痪。
    • ARP报文泛洪类似DHCP泛洪,同样是恶意用户发出大量的ARP报文,造成L3设备的ARP表项溢出,影响正常用户的转发。


冲突域(Collision Domain):一组与同一条物理介质相连的设备,其中任何两台设备同时访问该介质都将导致冲突,冲突域中同一时间内只有一台机器能够发送数据。第一层设备如集线器,与之连接的所有设备都属于同一个冲突域和同一个广播域;第二层设备如交换机和网桥,将网络划分成多个网段,每个网段是一个独立的冲突域,但是相连的所有设备是一个广播域,交换机的每个端口就是一个冲突域;
广播域(Broadcast Domain):网络中一组相互接收广播消息的设备。第三层设备如路由器,将网络划分为多个冲突域和广播域。
以太网使用载波侦听多路访问/冲突检测(Carrier SenseMulti-Access/Collision Detectio
技术以减少冲突的发生。即,二层广播帧覆盖的范围就是广播域;二层单播帧覆盖的范
围就是冲突域。

多播(Multicast):“多播”也可以称为“组播”, 主机之间一对一组的通讯模式(UDP),也就是加入了同一个组的主机可以接受到此组内的所有数据,网络中的交换机和路由器只向有需求者复制并转发其所需数据。主机可以向路由器请求加入或退出某个组,网络中的路由器和交换机有选择的复制并传输数据,即只将组内数据传输给那些加入组的主机(组播组)。这样既能一次将数据传输给多个有需要的主机,又能保证不影响其他不需要(未加入组)的主机的其他通讯。例如网上视频会议、网上视频点播特别适合采用多播方式。IP网络的多播一般通过多播IP地址来实现。多播IP地址就是D类IP地址,即224.0.0.0至239.255.255.255之间的IP地址。多播处于单播和广播之间,帧仅传送给属于多播组的多个主机。
组播组可以是永久的也可以是临时的。组播组地址中,有一部分由官方分配的,称为永久组播组。永久组播组保持不变的是它的ip地址,组中的成员构成可以发生变化。永久组播组中成员的数量都可以是任意的,甚至可以为零。那些没有保留下来供永久组播组使用的ip组播地址,可以被临时组播组利用。
224.0.0.0~224.0.0.255为预留的组播地址(永久组地址),地址224.0.0.0保留不做分配,其它地址供路由协议使用; 224.0.1.0~238.255.255.255为用户可用的组播地址(临时组地址),全网范围内有效;239.0.0.0~239.255.255.255为本地管理组播地址,仅在特定的本地范围内有效。常用的预留组播地址列表如下:
224.0.0.0基准地址(保留)
224.0.0.1 所有主机和路由器地址,广播域内  
224.0.0.2所有组播路由器的地址
224.0.0.3不分配
224.0.0.4dvmrp 路由器
224.0.0.5ospf 路由器
224.0.0.6ospf dr
224.0.0.7st 路由器
224.0.0.8st 主机
224.0.0.9rip-2 路由器
224.0.0.10Eigrp 路由器
224.0.0.11活动代理
224.0.0.12dhcp 服务器/中继代理
224.0.0.13所有pim 路由器
224.0.0.14rsvp 封装
224.0.0.15所有cbt 路由器
224.0.0.16指定sbm
224.0.0.17所有sbms
224.0.0.18vrrp
224.0.0.40cisco路由器用于发现auto-rp

多播基本原理
Multicast 应用在一点对多点、多点对多点的网络传输中,可以大大的减少网络的负载。 因此,Multicast 广泛地应用在流媒体的传输、远程教学、视频/音频会议等网络应用方面。 Multicast 采用 D 类 IP 地址,即 224.0.0.0~239.255.255.255。其中 224.0.0.0~224.0.0.255 是保留地址,239.0.0.0~239.255.255.255 是私有地址,类似于 unicast 的私有地址。 Multicast的 IP 地址与 MAC地址的映射:MAC 地址有 48 位,前面 24 位规定为 01-00-5E, 接着一位为 0,后面 23 位是 IP 地址的后 23 位。 路由器间要通过组播协议(如 DVMRP、MOSPF、PIM)来建立组播树和转发组播数据 包。组播树有两类:源树和共享树。 多播时,路由器采用组管理协议 IGMP 来管理和维护主机参与组播。IGMP 协议 v1 中, 主机发送 report 包来加入组;路由器发送 query 包来查询主机(地址是 224.0.0.1),同一个 组的同一个子网的主机只有一台主机成员响应,其它主机成员抑制响应。一般路由器要发送 3 次 query 包,如果 3 次都没响应,才认为组超时(约 3 分钟)。IGMPv2 中,主机可以发送 1 leave 信息给路由器(地址 224.0.0.2);路由器收到信息后,发送一个特别的 query 包,在 3 秒内没收到组成员响应,就认为组超时。 由于组播的 MAC 不是具体某台主机的 MAC,根据交换机的工作原理,交换机会对组播数据包进行广播。因此,对某些不参加组播的主机而言,这些都是不必要的流。为了解决这个问题,cisco 公司开发了 CGMP 协议。该协议用于管理参与组播的主机。每当有主机加入或离开某个组时,路由器就会把该主机的多播 IP 地址(转换成组播 MAC 地址)、主机的 MAC 地址以及消息类型(加入或离开)以 CGMP 消息告知交换机。交换机根据这些信息就 可以建立起组播转发表。  
Cisco 的路由器只支持 PIM 组播协议。PIM 是一种可利用多种单播路由表(如 EIGRP、 OSPF、BGP 和静态路由等)的组播路由协议,它根据这些路由表实现组播数据的转发。尽 管它是组播路由协议,然而它实际上只是使用单播路由表来完成 RPF 检验功能,并没有重 新建立组播路由表。不像其他的路由协议,PIM 并不会在路由之间收发路由更新信息。 PIM分为Dense-mode(PIM-DM)与Sparse-mode(PIM-SM)两种。
  • 密集模式的PIM(PIM-DM)使用“推”的方 式,把组播流向网络的各个地方转发,从而把流“推”给不同接收者。这种方式适用于网络 中的各个子网都有接收者(即接收者密集)的情况。PIM-DM一开始向网络中的各处发组播流,路由器每隔3分钟检查一次自己是否还存在“下游”的邻居,如果没有(即它无需转发组播流),就把这个流“剪”掉(即不再转发)。路由器会积累数据流所带有的源和组的信 息,使得“下游”的路由器可以建立它们的组播转发表。PIM-DM只支持源树,而无法使用 共享树。 密集模式工作过程:

  • 邻居发现:使用hello数据包发现邻居并维护邻居关系,在多点访问的网络中使用hello包选举DR,DR选举依据IP地址大少比较,大的成为DR。注意DR在PIM-SM模式下才有意义
  • 建立SPT树:当某组播源S开始向组播组G发送数据时,首先根据单播路由表进行RPF检查,如果通过了RPF检查,则创建(S,G)表项,并同时产生(*,G)表项,然后将数据包向下游网络中的PIM-DM节点进行转发。注意在PIM-DM模式中使用(S,G)表项进行数据转发
  • RPF检查:用来确保组播数据流能够沿组播分发树(路径)正确的传输,同时可以避免转发路径上环路的产生。当路由器收到组播数据报文时,通过已有的单播路由信息判断此报文是否在最短返回源路径的接口上。如果不是,则丢弃该报文;如果是,则转发报文到接口或者路由器。缺省情况下,如果存在多条到达源的等价路由,设备在进行RPF检查时,针对不同的情况会有不同的选路规则:
    如果这几条等价路由都是来自同一张路由表项,比如单播路由表、组播静态路由表或者MBGP路由表中的一种,则选取下一跳地址最大的路由作为RPF路由。
    如果这几条等价路由来自不同的路由表,首先会比较路由优先级,再比较掩码长度。如果上述都相同,则设备会根据一定的函数计算选取出一条路由作为RPF路由。 无论上述何种情况,根据RPF检查规则,设备只会选取一条路由作为RPF路由。但是如果配置了组播负载分担之后,当存在多条等价的最优路由时,组播数据将不会按照RPF检查规则只选一条路由作为RPF路由进行转发,而是在这多条路径上按照一定的策略进行分流转发。这样,在一定程度上优化了组播数据在网络上的传输质量。
  • 剪枝:当没有接收者的叶节点的路由器向着组播组地址224.0.0.13发送prune消息时进行剪枝。有接收者的叶节点路由器保留SPT,保留接口为转发状态。被prune剪掉的接口处于prune状态,并保持三分钟,超出三分钟后又会变成转发状态。注意prune消息是不可靠的,不会收到回复。
  • 当处于prune状态的路由器下游接入了接收者,此时接收者通过IGMP协议向最后一跳路由器发送report消息,最后一跳路由器马上向上一级邻居路由器发送单播的Graft消息,并且收到上一级邻居路由器的Graft ACK确认消息。这样一直发送到根,此时路由器的prune接口变为forward状态. 注意graft消息是可靠的机制,必须要收到Graft ACK,如果没有收到默认3s重发。


  • 松散模式的PIM(PIM-SM)使用“拉”的方式,只有存在接收者的网段才会接收到数据流(即接收者把流“拉”出来)。主要用于组成员分布相对分散、范围较广、大规模网络中。松散模式默认所有主机不需要接收组播包,只向明确需要组播包的主机转发。PIM-SM模型实现转发的核心任务是构造并维护一颗单向共享树,共享树选择PIM中某一个路由器作为公用根节点,即汇聚点RP(Rendesvous Point)。组播数据通过RP沿共享树向接受者转发。引入RP进行组播转发,减少数据报文和控制报文占用的网络带宽,降低路由器的处理开销。在接收的一方,链接信息接收者的路由器向该组播组对应的RP发送组加入信息,加入消息经过一个个路由器后到达根部(即汇聚点),所经过的路径变成了此共享树的RPT分支,发送端如果想要往某组播组发送数据包,首先由第一跳路由器向RP汇聚点注册,注册消息到达RP后触发源树建立,之后组播源把数据发向RP汇聚点,当数据到达RP汇聚点后,组播数据包被复制并沿着RPT树传给接受者。复制仅仅发生在分法树的分支处,这个过程能自动重复直到数据包最终到达接收者。PIM-SM的工作过程:邻居发现,DR选举、RP发现、RPT共享树生成、组播源注册、RPT向SPT切换。

  • 邻居发现:通过各路由器之间发送hello包实现的
  • DR选举:借助hello消息可以为共享网络(如以太网)选举DR,DR作为本网段中的组播信息唯一转发者。无论是和组播源链接的网络,还是和接收者链接的网络,只要网络为共享媒介则需要选举DR。接收者一方的DR发送Join加入信息到RP,组播源一方的DR向RP发送Register注册信息。Hello消息携带DR优先级选项,拥有高优先级的被选为本网段的DR。假如不支持在Hello包中携带优先级,则拥有最大IP地址的路由器被选举为DR,当DR出现故障时,接受Hello消息将会超时,邻居路由器之间触发新的DR选举。
  • RP发现:RP是PIM-SM域中心的核心路由器,全网的信息转发都依靠它。此时RP就是工作量最大,发负载最大的,为了缓解RP的压力,就需要自举机制来选举RP,此时需要配置自举路由器BSR(Bootstrap Router),BSR是PIM-SM网络的管理核心,负责收集网络中的Candidate-RP(C-RP)发来的Advertisment宣告信息,然后将为每个组播组选择部分C-RP信息以组成RP-Set集(即组播组和RP的映射库),并发布到整个PIM-SM网络,从而网络内所有的路由器都知道RP和BSR位置。一个网络的内部只能选举出一个BSR,但可以配置多个Candidate-BSR(C-BSR),这样一旦BSR发生故障,其余C-BSR能够自动选举出新的BSR。同样一个PIM-SM域内可以有多个C-RP,由BSR机制计算出每个组播组对应的RP。
  • RPT生成:当接收者路由一端向RP发送jion加入信息所经过的每一个路由节点时,都会向转发表中加入(*,G)表项,这些沿途经过的路由器就形成了RP的共享树(RPT)的一个分支。其中(*,G)表示从任意源来的消息去往组播组G。RPT共享树以RP为根,接收者为叶子。当从组播源发往组播组G的报文流经RP时,报文就会沿着已经建立好的RPT共享树路径到达叶子路由器,进而到达接受者。当某个接受者退出组播组G时,接收者一方的DR会逆着RPT树,朝RP方向逐跳发送Prune剪枝消息。第一个上游路由器接收到该剪枝消息,在其出接口列表中删除链接此下游路由器的接口,并检查下游是否还存在组播组G成员,如果没有则继续向上游转发该剪枝消息。
  • 组播源注册:为了向RP通知组播源S的存在,当组播源S向组播组G发送的一个组播组报文时,与组播源S直接相连的路由器收到该报文后,就将该报文封装成Register注册报文,并单播发送给对应的RP。当RP收到来自组播组的注册消息后,一方面解除封装注册消息并将组播消息沿着RPT树发到接收者,另一方面朝组播源逐跳发送(S,G)加入消息,从而让RP和组播组S之间的所有路由器都生成(S,G)表项,这些沿途经过的路由就形成了SPT树的一个根,以RP为目的地。组播源S发出的组播信息沿着已经建立好的SPT树到达RP,然后由RP将信息沿着RPT共享树进行转发。当RP收到沿着SPT树转发的组播流量后,向从与组播源的S直连路由器的单播发送注册停止报文。组播源注册过程结束。
  • RPT向SPT切换:PIM-SM通过指定一个利用带宽的SPT阈值可以实现将最后一跳路由器(即离接收者近的DR)从RPT切换为SPT。当最后一跳路由器发现从RP发往组播组G的组播报文速率超过了阈值时,就向单播路由器表中到组播源S的下一跳路由器发送(S,G)加入消息,加入消息经过一个个路由器后到达第一跳路由器(即离组播源最近的DR),沿途经过的所有路由器都拥有了(S,G)表项,从而建立SPT树分支。随后,最后一跳路由器向RP逐跳发送包含RP为的Prune剪枝消息,RP收到消息后向组播源反向转发Prune剪枝消息。从而实现组播信息流从RPT切换到SPT。切换到SPT后,组播源S直接发送信息到接收者。


  • 组播和单播的区别: 为了让网络中的多个主机可以同时接受到相同的报文,如果采用单播的方式,那么源主机必须不停的产生多个相同的报文来进行发送,对于一些对时延很敏感的数据,在源主机要产生多个相同的数据报文后,在产生第二个数据报文,这通常是无法容忍的。而且对于。一台主机来说,同时不停的产生一个报文来说也是一个很大的负担。如果采用组播的方式,源主机可以只需要发送一个报文就可以到达每个需要接受的主机上,这中间还要取决于路由器对组员和组关系的维护和选择。
  • 组播和广播的区别:当有多台主机想要接收相同的报文,广播采用的方式是把报文传送到局域网内每个主机上,不管这个主机是否对报文感兴趣。这样做就会造成了带宽的浪费和主机的资源浪费。而组播有一套对组员和组之间关系维护的机制,可以明确的知道在某个子网中,是否有主机对这类组播报文感兴趣,如果没有就不会把报文进行转发,并会通知上游路由器不要再转发这类报文到下游路由器上。
  • 组播的优点:

  • 需要相同数据流的客户端加入相同的组共享一条数据流,节省了服务器的负载。具备广播所具备的优点。
  • 由于组播协议是根据接受者的需要对数据流进行复制转发,所以服务端的服务总带宽不受客户接入端带宽的限制。IP协议允许有2亿6千多万个组播,所以其提供的服务可以非常丰富。
  • 此协议和单播协议一样允许在Internet宽带网上传输。

  • 组播的缺点:

  • 与单播协议相比没有纠错机制,发生丢包错包后难以弥补,但可以通过一定的容错机制和QOS加以弥补。
  • 现行网络虽然都支持组播的传输,但在客户认证、QOS等方面还需要完善,这些缺点在理论上都有成熟的解决方案,只是需要逐步推广应用到现存网络当中。




实验一、组播中的IGMP

Center.jpg
PC1配置
Router>en
Router#conf t
PC2(config)#no ip routing //禁止路由功能,让路由器作为主机
Router#hostname PC1
PC1(config)#ip default-gateway192.168.1.1 //指定网关
PC1(config)#int fa0/0
PC1(config-if)#ip add 192.168.1.3255.255.255.0
PC1(config-if)#ip igmp join-group224.1.1.1 //利用IGMP协议指定加入组播组的地址
PC1(config-if)#no sh
PC1(config-if)#exit

PC2配置:
Router>en
Router#conf t
Router(config)#hostname PC2
PC2(config)#no ip routing
PC2(config)#ip default-gateway192.168.1.1
PC2(config)#int fa0/0
PC2(config-if)#ip add 192.168.1.2255.255.255.0
PC2(config-if)#ip igmp join-group224.1.1.1  
PC2(config-if)#no sh
PC2(config-if)#exit


PC3配置:
Router>en
Router#conf t
Router(config)#hostname PC3
PC3(config)#no ip routing
PC3(config)#ip default-gateway192.168.1.1
PC3(config)#int fa0/0
PC3(config-if)#ip add 192.168.1.4 255.255.255.0
PC3(config-if)#ip igmp join-group224.1.1.1
PC3(config-if)#no sh
PC3(config-if)#exit

SW配置:


R4配置:
Router>en
Router#conf t
Router(config)#hostname R4
R4(config)#ip multicast-routing //开启组播路由协议
R4(config)#int fa0/0
R4(config-if)#ip add 192.168.1.1255.255.255.0
R4(config-if)#ip pim sparse-mode //端口下指定组播路由协议的模式为密集型
R4(config-if)#no sh   

R5配置:
Router>en
Router#conf t
Router(config)#hostname R5
R5(config)#ip multicast-routing
R5(config)#int fa0/0
R5(config-if)#ip add 192.168.1.5255.255.255.0
R5(config-if)#ip pim sparse-mode
R5(config-if)#no sh

第一完成配置后查看,主机是否加入了组播组,路由器是否正常
R4#sh ip igmp groups    //R4查看组播组
IGMP Connected Group Membership
Group Address    Interface                Uptime    Expires  Last Reporter   Group Accounted
224.1.1.1        FastEthernet0/0          00:02:06  00:02:51 192.168.1.3     
224.0.1.40       FastEthernet0/0          00:14:31  00:02:52 192.168.1.5     

R4#sh ip igmp interface  //查看谁是查询器,谁是DR。IP地址小的成为DR
FastEthernet0/0 is up, line protocol isup
Internet address is 192.168.1.1/24
IGMP is enabled on interface
Current IGMP host version is 2
  Current IGMP router version is 2
  IGMP query interval is 60 seconds
  IGMP querier timeout is 120 seconds
  IGMP max query response time is 10 seconds
  Last member query count is 2
Last member query response interval is 1000 ms
Inbound IGMP access group is not set
IGMP activity: 2 joins, 0 leaves
Multicast routing is enabled on interface
Multicast TTL threshold is 0
  Multicast designatedrouter (DR) is 192.168.1.5   //R5是D5
  IGMP querying routeris 192.168.1.1 (this system)     //R4是查询器发送查询报文
Multicast groups joined by this system (number of users):
     224.0.1.40(1)

R4#debug ip igmp//调试IGMP报文
IGMP debugging is on
*Mar  1 00:22:00.683: IGMP(0): Send v2 generalQuery on FastEthernet0/0 // 发送查询报文
*Mar 1 00:22:00.683: IGMP(0): Set report delay time to 9.8 seconds for224.0.1.40 on FastEthernet0/0
*Mar  1 00:22:03.663: IGMP(0): Received v2 Reporton FastEthernet0/0 from 192.168.1.3 for 224.1.1.1 //主机发送加入组播组的报文
*Mar 1 00:22:03.667: IGMP(0): Received Group record for group 224.1.1.1, mode2 from 192.168.1.3 for 0 sources
*Mar  100:22:03.667: IGMP(0): Updating EXCLUDE group timer for 224.1.1.1
*Mar 1 00:22:03.671: IGMP(0): MRT Add/Update FastEthernet0/0 for(*,224.1.1.1) by 0
*Mar 1 00:22:09.403: IGMP(0): Received v2 Report on FastEthernet0/0 from192.168.1.5 for 224.0.1.40
*Mar 1 00:22:09.403: IGMP(0): Received Group record for group 224.0.1.40,mode 2 from 192.168.1.5 for 0 sources
*Mar 1 00:22:09.403: IGMP(0): Cancel report for 224.0.1.40 on FastEthernet0/0
*Mar 1 00:22:09.403: IGMP(0): Updating EXCLUDE group timer for 224.0.1.40
*Mar 1 00:22:09.403: IGMP(0): MRT Add/Update FastEthernet0/0 for(*,224.0.1.40) by 0

第二先把PC3离开组播组,观察R4变化
PC3#conf t
PC3(config)#int fa0/0
PC3(config-if)#no ip igmp join-group224.1.1.1 //PC3离开组播组224.1.1.1

R4#conf t
R4#debug ip igmp //调试R4的IGMP包
IGMP debugging is on
*Mar  1 01:27:24.091: IGMP(0): Received Leave from192.168.1.4 (FastEthernet0/0) for 224.1.1.1//PC3发给R4离开组播组的报文
*Mar 1 01:27:24.095: IGMP(0): Received Group record for group 224.1.1.1, mode3 from 192.168.1.4 for 0 sources
*Mar  1 01:27:24.095: IGMP(0): Lower expirationtimer to 2000 msec for 224.1.1.1 on FastEthernet0/0//将组播组224.1.1.1的超时时间设置为2000msec,
*Mar  1 01:27:24.095: IGMP(0): Send v2 Query onFastEthernet0/0 for group 224.1.1.1
*Mar  1 01:27:25.099: IGMP(0): Send v2 Query onFastEthernet0/0 for group 224.1.1.1
*Mar  1 01:27:26.099: IGMP(0): Switching to INCLUDEmode for 224.1.1.1 on FastEthernet0/0
//R4连续发了两个特定组查询消息(Group-Specific Query),试图通过这种方式确认224.1.1.1组中是否有其他组员了,并且将组播组转换到收录模式
*Mar  1 01:27:26.575: IGMP(0): Received v2 Reporton FastEthernet0/0 from 192.168.1.3 for 224.1.1.1
*Mar  1 01:27:26.575: IGMP(0): Received Grouprecord for group 224.1.1.1, mode 2 from 192.168.1.3 for 0 sources
*Mar  1 01:27:26.579: IGMP(0): WAVL Insert group:224.1.1.1 interface: FastEthernet0/0Successful
*Mar  1 01:27:26.579: IGMP(0): Switching to EXCLUDEmode for 224.1.1.1 on FastEthernet0/0
*Mar  1 01:27:26.583: IGMP(0): Updating EXCLUDEgroup timer for 224.1.1.1
*Mar  1 01:27:26.583: IGMP(0): MRT Add/UpdateFastEthernet0/0 for (*,224.1.1.1) by 0
//一个成员回复了查询以便通告自己的存在。R4知道组224.1.1.1里仍有组成员存在,马上回复组播组到正常状态。

第三IGMPSnooping限制交换机网络中多播的流量。对交换机的工作模式是它会学习接收到的所有帧的源MAC地址,并存入交换机的MAC地址表,而多播MAC地址永远不会作为一个数据包的源MAC地址(一般都是作为目的MAC地址)所以交换机永远不会将多播MAC地址存入MAC地址表中,所以,每次收到的多播流量都会以泛洪的形式发送出去。由于默认情况下,局域网交换机会在广播域中泛洪多播流量,这会消耗大量的带宽。Cisco Group Management Protocol (CGMP)和 Internet GroupManagement Protocol (IGMP) snooping 主要是用来限制交换机网络中多播的流量。
解决交换机的带宽问题有3种方法:
  • 在交换机上配置静态的多播MAC地址到用户接口的映射
  • 使用CGMP,运行CGMP的多播路由器能够将用户发送给自己的IGMP报文再通知给交换机
  • 使用IGMPSnooping,在这种模式下交换机会自己截取客户发送的IGMP消息,并根据IGMP消息更新自己的MAC地址表
  • 使用IGMPproxy的二层网络设备,对用户侧承担Server的角色,定期查询用户信息,对于网络路由侧又承担Client的角色,在需要时将当前的用户信息发送给网络.不仅能够达到抑制二层组播泛滥的目的更能有效地获取和控制用户信息,同时在减少网络侧协议消息以降低网络负荷方面起到一定作用。

IGMP运行于主机和与主机直连的路由器之间,其实现的功能是双向的:一方面,主机通过IGMP通知路由器希望接收某个特定组播组的信息;另一方面,路由器通过IGMP周期性地查询局域网内的组播组成员是否处于活动状态,实现所连网段组成员关系的收集与维护。总之:IGMP是TCP/IP协议族中负责IP组播组成员管理的协议,用来在IP主机和与其直接相邻的组播路由器之间建立、维护组播组成员关系。
IGMP Snooping是运行在二层设备上的组播约束机制,用于管理和控制组播组。运行IGMP Snooping的二层设备通过对收到的IGMP报文进行分析,为二层端口和组播MAC地址建立起映射关系,并根据这个映射关系转发组播数据。
在传统的组播点播方式下,当连接在二层设备上、属于不同VLAN的用户分别进行组播点播时,三层组播设备需要向该二层设备的每个VLAN分别发送一份组播数据;而当二层设备运行了组播VLAN之后,三层组播设备只需向该二层设备的组播VLAN发送一份组播数据即可,从而既避免了带宽的浪费,也减轻了三层组播设备的负担。



实验二、组播的PIM-DM模式(Dense-mode)

Center.jpg
Server配置:
Server#conf t
Server(config)#no ip routing
Server(config)#ip default-gateway 192.168.5.1
Server(config)#int e0/0
Server(config-if)#ip add 192.168.5.2255.255.255.0
Server(config-if)#no sh
Server(config-if)#exit

R5配置:
R5#conf t
R5(config)#ip multicast-routing
R5(config)#int e0/0
R5(config-if)#ip add 12.168.5.1 255.255.255.0
R5(config-if)#ippim dense-mode                                
R5(config-if)#no sh
R5(config-if)#exit
R5(config)#int e0/1
R5(config-if)#ip add 192.168.51.5255.255.255.0
tR5(config-if)#ip pim dense-mode
R5(config-if)#no sh
R5(config-if)#exit
R5(config)#int e0/2
R5(config-if)#ip add 192.168.52.5255.255.255.0
R5(config-if)#ip pim dense-mode
R5(config-if)#no sh
R5(config-if)#exit
R5(config)#router ospf 1
R5(config-router)#net 0.0.0.0 0.0.0.0 area 0
R5(config-router)#exit

R1配置:
R1#conf t
R1(config)#ip multicast-routing
R1(config)#int e0/0
R1(config-if)#ip add 192.168.51.1255.255.255.0
R1(config-if)#ip pim dens
R1(config-if)#ip pim dense-mode
R1(config-if)#no sh
R1(config-if)#exit
R1(config)#int e0/1
R1(config-if)#ip add 192.168.13.1255.255.255.0
R1(config-if)#ip pim den
R1(config-if)#ip pim dense-mode
R1(config-if)#no sh
R1(config-if)#exit
R1(config)#router ospf 1
R1(config-router)#net 0.0.0.0 0.0.0.0 area 0
R1(config-router)#exit

R2配置:
R2#conf t
R2(config)#ip multicast-routing
R2(config)#int e0/0
R2(config-if)#ip add 192.168.52.2255.255.255.0
R2(config-if)#ip pim den
R2(config-if)#ip pim dense-mode
R2(config-if)#no sh
R2(config-if)#exit
R2(config)#int e0/1
R2(config-if)#ip add 192.168.24.2255.255.255.0
R2(config-if)#ip pim dense-mode
R2(config-if)#no sh
R2(config-if)#exit
R2(config)#router ospf 1
R2(config-router)#net 0.0.0.0 0.0.0.0 area 0
R2(config-router)#exit

R3配置:
R3#conf t
R3(config)#ip multicast-routing
R3(config)#int e0/1
R3(config-if)#ip add 192.168.13.3255.255.255.0
R3(config-if)#ip pim dense-mode
R3(config-if)#no sh
R3(config-if)#exit
R3(config)#int e0/0
R3(config-if)#ip add 192.168.0.1255.255.255.0
R3(config-if)#ip pim dense-mode
R3(config-if)#no sh
R3(config-if)#exit
R3(config)#router ospf 1
R3(config-router)#net 0.0.0.0 0.0.0.0 area 0
R3(config-router)#exit

配置R4
R4#conf t
R4(config)#ip multicast-routing
R4(config)#int e0/0
R4(config-if)#ip add 192.168.0.2255.255.255.0
R4(config-if)#ip pim dense-mode
R4(config-if)#no sh
R4(config-if)#exit
R4(config)#int e0/1
R4(config-if)#ip add 192.168.24.4255.255.255.0
R4(config-if)#ip pim den
R4(config-if)#ip pim dense-mode
R4(config-if)#no sh
R4(config-if)#exit
R4(config)#int e0/2
R4(config-if)#ip add 192.168.46.4255.255.255.0
R4(config-if)#ip pim dense-mode
R4(config-if)#no sh
R4(config-if)#exit
R4(config)#router ospf 1
R4(config-router)#net 0.0.0.0 0.0.0.0 area 0
R4(config-router)#exit

配置R6
R6#conf t
R6(config)#ip multicast-routing
R6(config)#int e0/0
R6(config-if)#ip add 192.168.46.6255.255.255.0
R6(config-if)#ip pim dense-mode
R6(config-if)#no sh
R6(config-if)#exit
R6(config)#router ospf 1
R6(config-router)#net 0.0.0.0 0.0.0.0 area 0
R6(config-router)#exit

PC1配置:
PC1#conf t
PC1(config)#no ip routing
PC1(config)#ip default-gateway 192.168.0.1
PC1(config)#int e0/0
PC1(config-if)#ip add 192.168.0.5255.255.255.0
PC1(config-if)#ip igmp join-group 224.1.1.1
PC1(config-if)#no sh
PC1(config-if)#exit

完成以上配置后:所有路由器的多播路由表如下:
R2#sh ip mroute //PIM-DM需要有组播流才形成树
IP Multicast Routing Table
Flags: D - Dense, S - Sparse, B - BidirGroup, s - SSM Group, C - Connected,
      L - Local, P - Pruned, R - RP-bit set, F - Register flag,
      T - SPT-bit set, J - Join SPT, M - MSDP created entry,
       X - Proxy Join Timer Running, A - Candidatefor MSDP Advertisement,
      U - URD, I - Received Source Specific Host Report,
      Z - Multicast Tunnel, z - MDT-data group sender,
      Y - Joined MDT-data group, y - Sending to MDT-data group
Outgoing interface flags: H - Hardwareswitched, A - Assert winner
Timers: Uptime/Expires
Interface state: Interface, Next-Hop or VCD,State/Mode
(*, 224.0.1.40), 00:33:39/00:02:51, RP0.0.0.0, flags: DCL
Incoming interface: Null, RPF nbr 0.0.0.0
  Outgoinginterface list:
   Ethernet0/1, Forward/Dense, 00:27:46/00:00:00
   Ethernet0/0, Forward/Dense, 00:33:39/00:00:00

接着在Server端Ping 224.1.1.1  组播组,发现变化
Server#ping224.1.1.1 repeat 100 //注意有了组播源才有路,ping结束后路也消失

Type escapesequence to abort.
Sending 100,100-byte ICMP Echos to 224.1.1.1, timeout is 2 seconds:
.............................................
Reply torequest 45 from 192.168.0.5, 264 ms
Reply torequest 46 from 192.168.0.5, 248 ms
Reply torequest 47 from 192.168.0.5, 204 ms

R1#sh ipmroute //R1没有SPT
IP MulticastRouting Table
Flags: D -Dense, S - Sparse, B - Bidir Group, s - SSM Group, C - Connected,
       L - Local, P - Pruned, R - RP-bit set, F- Register flag,
       T - SPT-bit set, J - Join SPT, M - MSDPcreated entry,
       X - Proxy Join Timer Running, A -Candidate for MSDP Advertisement,
       U - URD, I - Received Source SpecificHost Report,
       Z - Multicast Tunnel, z - MDT-data groupsender,
       Y - Joined MDT-data group, y - Sendingto MDT-data group
Outgoinginterface flags: H - Hardware switched, A - Assert winner
Timers: Uptime/Expires
Interface state: Interface, Next-Hop or VCD,State/Mode
(*,224.0.1.40), 00:39:13/00:02:24, RP 0.0.0.0, flags: DCL
  Incoming interface: Null, RPF nbr 0.0.0.0
  Outgoing interface list:
    Ethernet0/1, Forward/Dense,00:33:20/00:00:00
Ethernet0/0,Forward/Dense, 00:39:13/00:00:00

R2#sh ipmroute //R2生成了SPT
IP MulticastRouting Table
Flags: D -Dense, S - Sparse, B - Bidir Group, s - SSM Group, C - Connected,
       L - Local, P - Pruned, R - RP-bit set, F- Register flag,
       T - SPT-bit set, J - Join SPT, M - MSDPcreated entry,
       X - Proxy Join Timer Running, A -Candidate for MSDP Advertisement,
       U - URD, I - Received Source SpecificHost Report,
       Z- Multicast Tunnel, z - MDT-data group sender,
       Y - Joined MDT-data group, y - Sendingto MDT-data group
Outgoinginterface flags: H - Hardware switched, A - Assert winner
Timers: Uptime/Expires
Interface state: Interface, Next-Hop or VCD,State/Mode
(*, 224.1.1.1), 00:06:24/stopped,RP 0.0.0.0, flags: D
Incoming interface: Null, RPF nbr 0.0.0.0
Outgoing interface list:
   Ethernet0/1, Forward/Dense, 00:06:24/00:00:00
Ethernet0/0,Forward/Dense, 00:06:24/00:00:00

(192.168.5.2, 224.1.1.1), 00:06:24/00:00:09,flags: T
Incoming interface: Ethernet0/0, RPF nbr 192.168.52.5
Outgoing interface list:
   Ethernet0/1, Forward/Dense, 00:06:27/00:00:00

(*,224.0.1.40), 00:32:25/00:02:34, RP 0.0.0.0, flags: DCL
  Incoming interface: Null, RPF nbr 0.0.0.0
  Outgoing interface list:
    Ethernet0/1, Forward/Dense,00:25:04/00:00:00
Ethernet0/0,
Forward/Dense, 00:32:25/00:00:00

R4#sh ipmroute //R4链接R6的接口会剪枝
IP MulticastRouting Table
Flags: D -Dense, S - Sparse, B - Bidir Group, s - SSM Group, C - Connected,
       L - Local, P - Pruned, R - RP-bit set, F- Register flag,
       T - SPT-bit set, J - Join SPT, M - MSDPcreated entry,
       X - Proxy Join Timer Running, A -Candidate for MSDP Advertisement,
       U - URD, I - Received Source SpecificHost Report,
       Z - Multicast Tunnel, z - MDT-data groupsender,
       Y - Joined MDT-data group, y - Sendingto MDT-data group
Outgoinginterface flags: H - Hardware switched, A - Assert winner
Timers: Uptime/Expires
Interface state: Interface, Next-Hop or VCD,State/Mode

(*,224.1.1.1), 01:25:39/stopped, RP 0.0.0.0, flags: D
  Incoming interface: Null, RPF nbr 0.0.0.0
  Outgoing interface list:
    Ethernet0/2, Forward/Dense,01:25:39/00:00:00
    Ethernet0/1, Forward/Dense,01:25:39/00:00:00
    Ethernet0/0, Forward/Dense,01:25:39/00:00:00

(192.168.5.2,224.1.1.1), 00:00:04/00:02:55, flags: T
  Incoming interface: Ethernet0/1, RPF nbr192.168.24.2
  Outgoing interface list:
    Ethernet0/0, Forward/Dense,00:00:08/00:00:00
    Ethernet0/2, Prune/Dense, 00:00:08/00:02:54

(*,224.0.1.40), 01:32:39/00:02:37, RP 0.0.0.0, flags: DCL
  Incoming interface: Null, RPF nbr 0.0.0.0
  Outgoing interface list:
    Ethernet0/2, Forward/Dense,01:28:28/00:00:00
    Ethernet0/1, Forward/Dense,01:32:08/00:00:00
    Ethernet0/0, Forward/Dense,01:32:39/00:00:00



实验三、组播PIM-SM(静态RP、SPT自动切换RPT)
Center.jpg

Server配置:
Server#conft
Server(config)#noip routing
Server(config)#ipdefault-gateway 192.168.0.1
Server(config)#inte0/0
Server(config-if)#ipadd 192.168.0.2 255.255.255.0
Server(config-if)#nosh
Server(config-if)#exit

R2配置:
R2#conf t
R2(config)#ipmulticast-routing
R2(config)#ippim rp-address 3.3.3.3
R2(config)#inte0/0
R2(config-if)#ipadd 192.168.0.1 255.255.255.0
R2(config-if)#ippim sparse-mode
R2(config-if)#nosh
R2(config-if)#exit
R2(config)#inte0/1
R2(config-if)#ipadd 192.168.23.2 255.255.255.0
R2(config-if)#ippim sparse-mode
R2(config-if)#nosh
R2(config-if)#exit
R2(config)#inte0/2
R2(config-if)#ipadd 192.168.25.2 255.255.255.0
R2(config-if)#nosh
R2(config-if)#exit
R2(config)#routerospf 1
R2(config-router)#net0.0.0.0 0.0.0.0 area 0
R2(config-router)#exit

R3配置:
R3#conf t
R3(config)#ipmulticast-routing
R3(config)#ippim rp-address 3.3.3.3
R3(config)#intlo0
R3(config-if)#ipadd 3.3.3.3 255.255.255.0
R3(config-if)#ippim sparse-mode
R3(config-if)#exit
R3(config)#inte0/0
R3(config-if)#ipadd 192.168.23.3 255.255.255.0
R3(config-if)#ippim sparse-mode
R3(config-if)#nosh
R3(config-if)#exit
R3(config)#inte0/1
R3(config-if)#ipadd 192.168.34.3 255.255.255.0
R3(config-if)#ippim sparse-mode
R3(config-if)#nosh
R3(config-if)#exit
R3(config)#routerospf 1
R3(config-router)#net0.0.0.0 0.0.0.0 area 0
R3(config-router)#exit

R4配置:
R4#conf t
R4(config)#ipmulticast-routing
R4(config)#ippim rp-address 3.3.3.3
R4(config)#inte0/0
R4(config-if)#ipadd 192.168.34.4 255.255.255.0
R4(config-if)#ippim sparse-mode
R4(config-if)#nosh
R4(config-if)#exit
R4(config)#inte0/1
R4(config-if)#ipadd 192.168.46.4 255.255.255.0
R4(config-if)#ippim sparse-mode
R4(config-if)#nosh
R4(config-if)#exit
R4(config)#routerospf 1
R4(config-router)#net0.0.0.0 0.0.0.0 area 0
R4(config-router)#exit

R5配置:
R5#conf t
R5(config)#ipmulticast-routing
R5(config)#ippim rp-address 3.3.3.3
R5(config)#inte0/0
R5(config-if)#ipadd 192.168.25.5 255.255.255.0
R5(config-if)#nosh
R5(config-if)#exit
R5(config)#inte0/1
R5(config-if)#ipadd 192.168.56.5 255.255.255.0
R5(config-if)#nosh
R5(config-if)#exit
R5(config)#routerospf 1
R5(config-router)#net0.0.0.0 0.0.0.0 area 0
R5(config-router)#exit


R6配置:
R6#conf t
R6(config)#ipmulticast-routing
R6(config)#ippim rp-address 3.3.3.3
R6(config)#inte0/1
R6(config-if)#ipadd 192.168.56.6 255.255.255.0
R6(config-if)#nosh
R6(config-if)#exit
R6(config)#inte0/0
R6(config-if)#ipadd 192.168.46.6 255.255.255.0
R6(config-if)#ippim sparse-mode
R6(config-if)#nosh
R6(config-if)#exit
R6(config)#inte0/1
R6(config-if)#exit
R6(config)#inte0/2
R6(config-if)#ipadd 192.168.2.1 255.255.255.0
R6(config-if)#ippim sparse-mode
R6(config-if)#nosh
R6(config-if)#exit
R6(config)#routerospf 1
R6(config-router)#net0.0.0.0 0.0.0.0 area 0
R6(config-router)#exit

PC配置:
PC#conf t
PC(config)#noip routing
PC(config)#ipdefault-gateway 192.168.2.1
PC(config)#inte0/0
PC(config-if)#ipadd 192.168.2.2 255.255.255.0
PC(config-if)#ipigmp join-group 224.1.1.1
PC(config-if)#nosh
PC(config-if)#

完成以上配置后,在Server端ping 224.1.1.1的组播组地址,进行RP注册,然后查看R3与R6的多播路由:
Server#ping224.1.1.1 repeat  100
Type escapesequence to abort.
Sending 100,100-byte ICMP Echos to 224.1.1.1, timeout is 2 seconds:
Reply torequest 0 from 192.168.2.2, 168 ms
Reply torequest 1 from 192.168.2.2, 180 ms

R3#sh ip mr //RP中的注册信息
IP MulticastRouting Table
Flags: D -Dense, S - Sparse, B - Bidir Group, s - SSM Group, C - Connected,
       L - Local, P - Pruned, R - RP-bit set, F- Register flag,
       T - SPT-bit set, J - Join SPT, M - MSDPcreated entry,
       X - Proxy Join Timer Running, A -Candidate for MSDP Advertisement,
       U - URD, I - Received Source SpecificHost Report,
       Z - Multicast Tunnel, z - MDT-data groupsender,
       Y - Joined MDT-data group, y - Sendingto MDT-data group
Outgoinginterface flags: H - Hardware switched, A - Assert winner
Timers: Uptime/Expires
Interface state: Interface, Next-Hop or VCD,State/Mode
(*, 224.1.1.1), 00:17:50/stopped,RP 3.3.3.3, flags: S
Incoming interface: Null, RPF nbr 0.0.0.0
Outgoing interface list:
   Ethernet0/1, Forward/Sparse, 00:06:51/00:02:35
(192.168.0.2, 224.1.1.1),00:17:50/00:03:24, flags: T
Incoming interface: Ethernet0/0, RPF nbr 192.168.23.2
Outgoing interface list:
   Ethernet0/1, Forward/Sparse, 00:06:51/00:02:35
(192.168.46.6, 224.1.1.1),00:00:37/00:02:52, flags: PTX
Incoming interface: Ethernet0/1, RPF nbr 192.168.34.4
Outgoing interface list: Null
(*,224.0.1.40), 00:55:31/00:02:46, RP 3.3.3.3, flags: SJCL
  Incoming interface: Null, RPF nbr 0.0.0.0
  Outgoing interface list:
    Ethernet0/1, Forward/Sparse,00:06:53/00:02:55
    Ethernet0/0, Forward/Sparse,00:31:20/00:02:43
Loopback0,Forward/Sparse, 00:55:33/00:02:44
R6#sh ip mroute //得到RPT表项,收到第一个组播数据后,就切换了自动切换到SPT
IP MulticastRouting Table
Flags: D -Dense, S - Sparse, B - Bidir Group, s - SSM Group, C - Connected,
       L - Local, P - Pruned, R - RP-bit set, F- Register flag,
       T - SPT-bit set, J - Join SPT, M - MSDPcreated entry,
       X - Proxy Join Timer Running, A -Candidate for MSDP Advertisement,
       U - URD, I - Received Source SpecificHost Report,
       Z - Multicast Tunnel, z - MDT-data groupsender,
       Y - Joined MDT-data group, y - Sendingto MDT-data group
Outgoinginterface flags: H - Hardware switched, A - Assert winner
Timers: Uptime/Expires
Interface state: Interface, Next-Hop or VCD,State/Mode
(*, 224.1.1.1), 00:44:24/stopped,RP 3.3.3.3, flags: SJCF   //RPT 次优路径
Incoming interface: Ethernet0/0, RPF nbr 192.168.46.4
Outgoing interface list:
Ethernet0/2, Forward/Sparse,00:01:30/00:02:30

(192.168.0.2, 224.1.1.1),00:02:45/00:00:14, flags: J   //SPT 最优路径
Incoming interface: Null, RPF nbr 192.168.56.5
Outgoing interface list:
   Ethernet0/2, Forward/Sparse, 00:01:30/00:02:30
(*,224.0.1.40), 00:51:02/00:02:41, RP 3.3.3.3, flags: SJPCL
  Incoming interface: Ethernet0/0, RPF nbr192.168.46.4
  Outgoing interface list: Null

  RP认为是共享树的根,这和有源树不同,有源树的根一般是组播源所在。在稀疏模式下,所有的组播源数据都会通过Register消息向RP注册,注册后,所有该组播源的数据都发给RP;然后,所有接收者都会发送Join消息到RP,来选择加入哪个组播组接收组播数据。另外PIM-SM还可以在以RP为root建立共享树的同时,每一台PIM-SM路由器都会在自己和组播源之间建立一个SPT,最短路径树,也就是我们在show ip mroute里看到的(S,G)表项。但是静态RP需要在每台PIM路由器上配置,RP也需要配置,因为要让每台路由器都知道谁是RP,但是这种方式不能提供冗余功能的RP,当配置的RP失效后,必须手工更改,否则组播将不能通信。




实验四、思科私有协议PIM-Spare-Dense-Mode(动态Auto-RP)
Center.jpg
CISCO Auto-RP可以解决静态RP选择不灵活且没有冗余的问题(有备份RP)。要配置Auto-RP的有需要两个角色:candidate RP(RP候选者)、mapping agents收集RP地址信息并向外发送。 RP候选者以224.0.0.39的多播地址向外宣告自己为RP。mapping agents监听这个地址。mapping agents以224.0.0.40向外宣告究竟谁是RP。在3分钟之内如果没有收到任何 rp announce,则认为这个网络没有RP或者RP不可用。过程:
  • candidate rp 宣告自己要做某个组的rp,通告出去采用的ip地址224.0.1.39(默认每60s泛洪一次)(只有MA监听224.0.1.39这个组播地址)
  • MA (mapping agents) 它去决定那个做那个组的rp(看ip地址那个大,但是MA本身没有选举机制,可以存在多个,因为他们选出的RP是一致的,不会影响。),再 以224.0.1.40 的多播组地址通告候选 RP 的信息。末端路由器接收到这个 224.0.1.40 多播组的信息后就可以知道有哪些 RP,并且这些 RP 对应哪些多播组,从而可以自动发现 RP。 (所有运行组播的路由器都监听224.0.1.40这个组,默认每60S一次, holdtime=3x interval)
  • 候选 RP 和 RP 映射代理可以相互独立,不一定属于同一台路由器。但为了可靠起见,而通常将它们合为一体。
  • Auto-rp中没有对丢失数据包的检测和重传机制,所以auto-rp发现消息的传输是不可靠的。所以一般可以使用多个MA来提供冗余。
    RP的选举规则

  • 如果RP服务的组播地址完全冲突,(不同RP服务的组播地址范围完全一样)选举ip地址大的为RP。
  • 如果RP服务的组播地址不完全冲突,(不同RP服务的组播地址范围不完全一样)此时acl定义的服务范围小的RP 优先。
  • 对于多个RP MA,不用选举主MA,对于普通路由器,来自MA的消息可以相互覆盖。反正都是一样的。
  • auto rp 必须运行在sparse-dense-mode模式下,这是cisco的私有标准,如果运行在sparse-mode需要配置ip pim autorp listener。


Server配置:
Server#conft
Server(config)#noip routing
Server(config)#ipdefault-gateway 192.168.1.1
Server(config)#inte0/0
Server(config-if)#ipadd 192.168.1.2 255.255.255.0
Server(config-if)#nosh
Server(config-if)#exit

R1配置:
R1#conf t
R1(config)#int e0/0
R1(config-if)#exit
R1(config)#ip multicast-routing
R1(config)#int e0/0
R1(config-if)#ip add 192.168.1.1 255.255.255.0
R1(config-if)#ip pim sparse-dense-mode
R1(config-if)#no sh
R1(config-if)#exit
R1(config)#int e0/1
R1(config-if)#ip add 192.168.12.1 255.255.255.0
R1(config-if)#ip pim sparse-dense-mode
R1(config-if)#no sh
R1(config-if)#exit
R1(config)#int e0/2
R1(config-if)#ip add 192.168.13.1 255.255.255.0
R1(config-if)#ip pim sparse-dense-mode
R1(config-if)#no sh
R1(config-if)#exit
R1(config)#router ospf 1
R1(config-router)#net 0.0.0.0 0.0.0.0 area 0
R1(config-router)#exit

R2配置:
R2#conf t
R2(config)#ip multicast-routing
R2(config)#int e0/0
R2(config-if)#ip add 192.168.12.2 255.255.255.0
R2(config-if)#ip pim sparse-dense-mode
R2(config-if)#no sh
R2(config-if)#exit
R2(config)#int e0/1
R2(config-if)#ip add 192.168.24.2 255.255.255.0
R2(config-if)#ip pim sparse-dense-mode
R2(config-if)#no sh
R2(config-if)#exit
R2(config)#int lo0
R2(config-if)#ip add 2.2.2.2 255.255.255.0
R2(config-if)#ip pim sparse-dense-mode
R2(config-if)#exit
R2(config)#ip pim send-rp-announce loopback 0scope 20
R2(config)#ip pim send-rp-discovery loopback 0scope 20
R2(config)#router ospf 1
R2(config-router)#net 0.0.0.0 0.0.0.0 area 0
R2(config-router)#exit

R3配置:
R3#conf t
R3(config)#ip multicast-routing
R3(config)#int e0/0
R3(config-if)#ip add 192.168.13.3 255.255.255.0
R3(config-if)#ip pim sparse-dense-mode
R3(config-if)#no sh
R3(config-if)#exit
R3(config)#int e0/1
R3(config-if)#ip add 192.168.34.3 255.255.255.0
R3(config-if)#ip pim sparse-dense-mode
R3(config-if)#no sh
R3(config-if)#exit
R3(config-if)#ip add 3.3.3.3 255.255.255.0
R3(config-if)#ip pim sparse-dense-mode
R3(config-if)#exit
R3(config)#ip pim send-rp-announce loopback 0scope 20
R3(config)#ip pim send-rp-discovery loopback 0scope 20
R3(config)#router ospf 1
R3(config-router)#net 0.0.0.0 0.0.0.0 area 0
R3(config-router)#exit

R4配置:
R4#conf t
R4(config)#ip multicast-routing
R4(config)#int e0/0
R4(config-if)#ip add 192.168.24.4 255.255.255.0
R4(config-if)#ip pim sparse-dense-mode
R4(config-if)#no sh
R4(config-if)#exit
R4(config)#int e0/1
R4(config-if)#ip add 192.168.34.4 255.255.255.0
R4(config-if)#ip pim sparse-dense-mode
R4(config-if)#no sh
R4(config-if)#exit
R4(config)#int e0/2
R4(config-if)#ip add 192.168.0.1 255.255.255.0
R4(config-if)#ip pim sparse-dense-mode
R4(config-if)#no sh
R4(config-if)#exit
R4(config)#router ospf 1
R4(config-router)#net 0.0.0.0 0.0.0.0 area 0
R4(config-router)#exit

PC配置:
PC#conf t
PC(config)#no ip routing
PC(config)#ip default-gateway 192.168.0.1
PC(config)#int e0/0
PC(config-if)#ip add 192.168.0.2 255.255.255.0
PC(config-if)#ip igmp join-
PC(config-if)#ip igmp join-group 224.1.1.1
PC(config-if)#no sh

配置完成检查全网互通,查看R2、R3、R4
R2#sh ip mr //RP与MA同体
IP Multicast Routing Table
Flags: D - Dense, S - Sparse, B - Bidir Group, s- SSM Group, C - Connected,
       L -Local, P - Pruned, R - RP-bit set, F - Register flag,
       T -SPT-bit set, J - Join SPT, M - MSDP created entry,
       X -Proxy Join Timer Running, A - Candidate for MSDP Advertisement,
       U -URD, I - Received Source Specific Host Report,
       Z -Multicast Tunnel, z - MDT-data group sender,
       Y -Joined MDT-data group, y - Sending to MDT-data group
Outgoing interface flags: H - Hardware switched,A - Assert winner
Timers:Uptime/Expires
Interfacestate: Interface, Next-Hop or VCD, State/Mode
(*, 224.0.1.39), 00:24:12/stopped, RP 0.0.0.0,flags: DCL
  Incominginterface: Null, RPF nbr 0.0.0.0
  Outgoinginterface list:
   Loopback0, Forward/Sparse-Dense, 00:23:37/00:00:00
   Ethernet0/1, Forward/Sparse-Dense, 00:23:37/00:00:00
   Ethernet0/0, Forward/Sparse-Dense, 00:24:12/00:00:00
(2.2.2.2, 224.0.1.39), 00:24:12/00:01:59, flags:LT
  Incominginterface: Loopback0, RPF nbr 0.0.0.0
  Outgoinginterface list:
   Ethernet0/1, Forward/Sparse-Dense, 00:23:38/00:00:00
    Ethernet0/0, Forward/Sparse-Dense,00:24:14/00:00:00
(3.3.3.3, 224.0.1.39), 00:10:15/00:02:30, flags:LT
  Incominginterface: Ethernet0/1, RPF nbr 192.168.24.4
  Outgoinginterface list:
   Ethernet0/0, Forward/Sparse-Dense, 00:10:15/00:00:00
   Loopback0, Forward/Sparse-Dense, 00:10:15/00:00:00
(*, 224.0.1.40), 00:26:14/stopped, RP 0.0.0.0,flags: DCL
  Incominginterface: Null, RPF nbr 0.0.0.0
  Outgoinginterface list:
   Ethernet0/1, Forward/Sparse-Dense, 00:11:50/00:00:00
   Loopback0, Forward/Sparse-Dense, 00:23:40/00:00:00
   Ethernet0/0, Forward/Sparse-Dense, 00:26:14/00:00:00
(2.2.2.2, 224.0.1.40), 00:23:14/00:02:11, flags:LT
  Incominginterface: Loopback0, RPF nbr 0.0.0.0
  Outgoinginterface list:
   Ethernet0/1, Forward/Sparse-Dense, 00:11:50/00:00:00
   Ethernet0/0, Forward/Sparse-Dense, 00:23:14/00:00:00
(3.3.3.3, 224.0.1.40), 00:10:17/00:02:09, flags:LT
  Incominginterface: Ethernet0/1, RPF nbr 192.168.24.4
  Outgoinginterface list:
   Ethernet0/0, Forward/Sparse-Dense, 00:10:17/00:00:00
   Loopback0, Forward/Sparse-Dense, 00:10:17/00:00:00

R3#sh ip mroute //RP与MA同体,同时是组播组224.1.1.1的RP,收到的注册信息
IP Multicast Routing Table
Flags: D - Dense, S - Sparse, B - Bidir Group, s- SSM Group, C - Connected,
       L -Local, P - Pruned, R - RP-bit set, F - Register flag,
       T -SPT-bit set, J - Join SPT, M - MSDP created entry,
       X -Proxy Join Timer Running, A - Candidate for MSDP Advertisement,
       U -URD, I - Received Source Specific Host Report,
       Z -Multicast Tunnel, z - MDT-data group sender,
       Y -Joined MDT-data group, y - Sending to MDT-data group
Outgoing interface flags: H - Hardware switched,A - Assert winner
Timers:Uptime/Expires
Interfacestate: Interface, Next-Hop or VCD, State/Mode
(*, 224.1.1.1), 00:10:07/00:03:13, RP3.3.3.3, flags: S
Incoming interface: Null, RPF nbr 0.0.0.0
Outgoing interface list:
   Ethernet0/1, Forward/Sparse-Dense, 00:10:07/00:03:13
(*, 224.0.1.39), 00:18:46/stopped, RP 0.0.0.0,flags: DCL
  Incominginterface: Null, RPF nbr 0.0.0.0
  Outgoinginterface list:
   Loopback0, Forward/Sparse-Dense, 00:18:13/00:00:00
   Ethernet0/1, Forward/Sparse-Dense, 00:18:15/00:00:00
   Ethernet0/0, Forward/Sparse-Dense, 00:18:47/00:00:00
(2.2.2.2, 224.0.1.39), 00:12:45/00:02:33, flags:LT
  Incominginterface: Ethernet0/1, RPF nbr 192.168.34.4
  Outgoinginterface list:
   Ethernet0/0, Prune/Sparse-Dense, 00:02:35/00:00:24
   Loopback0, Forward/Sparse-Dense, 00:12:45/00:00:00
(3.3.3.3, 224.0.1.39), 00:18:26/00:02:51, flags:LT
  Incominginterface: Loopback0, RPF nbr 0.0.0.0
  Outgoinginterface list:
   Ethernet0/1, Forward/Sparse-Dense, 00:18:16/00:00:00
   Ethernet0/0, Forward/Sparse-Dense, 00:18:26/00:00:00, A
(*, 224.0.1.40), 00:19:40/stopped, RP 0.0.0.0,flags: DCL
  Incominginterface: Null, RPF nbr 0.0.0.0
  Outgoinginterface list:
   Ethernet0/1, Forward/Sparse-Dense, 00:13:57/00:00:00
   Loopback0, Forward/Sparse-Dense, 00:18:16/00:00:00
   Ethernet0/0, Forward/Sparse-Dense, 00:19:40/00:00:00
(2.2.2.2, 224.0.1.40), 00:14:52/00:02:42, flags:LT
  Incominginterface: Ethernet0/1, RPF nbr 192.168.34.4
  Outgoinginterface list:
   Ethernet0/0, Prune/Sparse-Dense, 00:00:25/00:02:34
   Loopback0, Forward/Sparse-Dense, 00:14:52/00:00:00
(3.3.3.3, 224.0.1.40), 00:17:25/00:02:26, flags:LT
  Incominginterface: Loopback0, RPF nbr 0.0.0.0
  Outgoinginterface list:
   Ethernet0/1, Forward/Sparse-Dense, 00:13:57/00:00:00
Ethernet0/0,Prune/Sparse-Dense, 00:00:33/00:02:26, A

R4#sh ip pim rp //R3为RP
Group: 224.1.1.1, RP: 3.3.3.3, v2, v1, uptime00:15:13, expires 00:02:42

R4#sh ip mroute //查看R4组播路由表
IP Multicast Routing Table
Flags: D - Dense, S - Sparse, B - Bidir Group, s- SSM Group, C - Connected,
       L -Local, P - Pruned, R - RP-bit set, F - Register flag,
       T -SPT-bit set, J - Join SPT, M - MSDP created entry,
       X -Proxy Join Timer Running, A - Candidate for MSDP Advertisement,
       U -URD, I - Received Source Specific Host Report,
       Z -Multicast Tunnel, z - MDT-data group sender,
       Y -Joined MDT-data group, y - Sending to MDT-data group
Outgoing interface flags: H - Hardware switched,A - Assert winner
Timers:Uptime/Expires
Interfacestate: Interface, Next-Hop or VCD, State/Mode
(*, 224.1.1.1), 00:28:35/stopped, RP3.3.3.3, flags: SJC  //RPT树,RP为R3
Incoming interface: Ethernet0/1, RPF nbr 192.168.34.3
Outgoing interface list:
   Ethernet0/2, Forward/Sparse-Dense, 00:28:35/00:02:26

(192.168.1.2, 224.1.1.1),00:04:16/00:02:08, flags: T  //SPT树
Incoming interface: Ethernet0/0, RPF nbr 192.168.24.2
Outgoing interface list:
Ethernet0/2,Forward/Sparse-Dense, 00:04:16/00:02:26

(*, 224.0.1.39), 00:32:51/stopped, RP 0.0.0.0,flags: DC
  Incominginterface: Null, RPF nbr 0.0.0.0
  Outgoinginterface list:
   Ethernet0/1, Forward/Sparse-Dense, 00:03:58/00:00:00
   Ethernet0/0, Forward/Sparse-Dense, 00:32:51/00:00:00
(2.2.2.2, 224.0.1.39), 00:03:51/00:02:17, flags:T
  Incominginterface: Ethernet0/0, RPF nbr 192.168.24.2
  Outgoinginterface list:
   Ethernet0/1, Forward/Sparse-Dense, 00:03:58/00:00:00
(3.3.3.3, 224.0.1.39), 00:03:30/00:02:40, flags:T
  Incominginterface: Ethernet0/1, RPF nbr 192.168.34.3
  Outgoinginterface list:
   Ethernet0/0, Forward/Sparse-Dense, 00:03:30/00:00:00
(*, 224.0.1.40), 00:33:00/stopped, RP 0.0.0.0,flags: DCL
  Incominginterface: Null, RPF nbr 0.0.0.0
  Outgoinginterface list:
   Ethernet0/1, Forward/Sparse-Dense, 00:04:05/00:00:00
   Ethernet0/0, Forward/Sparse-Dense, 00:33:00/00:00:00
(2.2.2.2, 224.0.1.40), 00:32:27/00:02:30, flags:LT
  Incominginterface: Ethernet0/0, RPF nbr 192.168.24.2
  Outgoinginterface list:
   Ethernet0/1, Forward/Sparse-Dense, 00:04:05/00:00:00
(3.3.3.3, 224.0.1.40), 00:04:04/00:02:53, flags:LT
  Incominginterface: Ethernet0/1, RPF nbr 192.168.34.3
  Outgoinginterface list:
   Ethernet0/0, Forward/Sparse-Dense, 00:04:04/00:00:00

然后把R3的物理接口都关闭,等收敛完成后查看RP有没有自动切换到R2
R3#conf t //关闭端口
R3(config)#int e0/0
R3(config-if)#shu
R3(config-if)#shutdown
R3(config-if)#exit
R3(config)#int e0/1
R3(config-if)#shutdown
R3(config-if)#exit

R4#sh ip pim rp //注册到R2
Group: 224.1.1.1, RP: 2.2.2.2, v2, v1, uptime00:00:13, expires 00:02:46

R2#sh ip mr //成为RP
IP Multicast Routing Table
Flags: D - Dense, S - Sparse, B - Bidir Group, s- SSM Group, C - Connected,
       L -Local, P - Pruned, R - RP-bit set, F - Register flag,
       T -SPT-bit set, J - Join SPT, M - MSDP created entry,
       X -Proxy Join Timer Running, A - Candidate for MSDP Advertisement,
       U -URD, I - Received Source Specific Host Report,
       Z -Multicast Tunnel, z - MDT-data group sender,
       Y -Joined MDT-data group, y - Sending to MDT-data group
Outgoing interface flags: H - Hardware switched,A - Assert winner
Timers: Uptime/Expires
Interfacestate: Interface, Next-Hop or VCD, State/Mode

(*, 224.1.1.1), 00:05:36/00:03:28, RP2.2.2.2, flags: S  //RPT树,RP为R2
Incoming interface: Null, RPF nbr 0.0.0.0
Outgoing interface list:
   Ethernet0/1, Forward/Sparse-Dense, 00:00:01/00:03:28
(192.168.1.2, 224.1.1.1), 00:05:36/00:01:14,flags: T
  Incominginterface: Ethernet0/0, RPF nbr 192.168.12.1
  Outgoinginterface list:
   Ethernet0/1, Forward/Sparse-Dense, 00:05:36/00:03:28
(*, 224.0.1.39), 00:37:52/stopped, RP 0.0.0.0,flags: DCL
  Incominginterface: Null, RPF nbr 0.0.0.0
  Outgoinginterface list:
   Loopback0, Forward/Sparse-Dense, 00:37:16/00:00:00
   Ethernet0/1, Forward/Sparse-Dense, 00:37:16/00:00:00
   Ethernet0/0, Forward/Sparse-Dense, 00:37:52/00:00:00
(2.2.2.2, 224.0.1.39), 00:37:52/00:02:32, flags:LT
  Incominginterface: Loopback0, RPF nbr 0.0.0.0
  Outgoinginterface list:
   Ethernet0/1, Forward/Sparse-Dense, 00:37:54/00:00:00
   Ethernet0/0, Forward/Sparse-Dense, 00:38:29/00:00:00
(*, 224.0.1.40), 00:40:28/stopped, RP 0.0.0.0,flags: DCL
  Incominginterface: Null, RPF nbr 0.0.0.0
  Outgoinginterface list:
   Ethernet0/1, Forward/Sparse-Dense, 00:26:04/00:00:00
   Loopback0, Forward/Sparse-Dense, 00:37:54/00:00:00
   Ethernet0/0, Forward/Sparse-Dense, 00:40:28/00:00:00
(2.2.2.2, 224.0.1.40), 00:37:28/00:02:19, flags:LT
  Incominginterface: Loopback0, RPF nbr 0.0.0.0
  Outgoinginterface list:
   Ethernet0/1, Forward/Sparse-Dense, 00:26:04/00:00:00
   Ethernet0/0, Forward/Sparse-Dense, 00:37:28/00:00:00



实验五、Bootstrap Router  (BSR业界标准协议)
Center.jpg
在采用自举路由器(BootStrap Router)方式配置汇集点(Rendezvous Point)的方法中,一组路由器被配置为候选自举路由器(C-BSRs),一组路由器被配置为候选汇集点(C-RPs),通常建议这两组路由器是同样的路由器。候选汇集点会定期把候选汇集点通告消息(C-RP-Advs)以单播的形式发送到自举路由器;汇集点通告消息是一种PIM消息,它包括通告候选汇集点的地址、可选的组播组地址和一个掩码长度域(组的前缀);
自举路由器收集这些通告消息并产生相应的自举消息,自举消息也是一种PIM消息,它包括候选RP和相应的组前缀(ip为224.0.0.13即所有使能pim的路由器,每60s泛洪一次。让其他路由器知道 BSR的位置。 同时也是通过这样的方式把RP信息发送出去),自举消息主要用于自举路由器的选择和分发RP点信息。自举消息支持一个简单的机制以便于侯选自举路由器之间选择出活跃的自举路由器,一般是优先级最高的自举路由器被选择为活跃的自举路由器。BSR不决定RP,只是收集RP候选信息并通告这些信息。多个BSR存在选举原则
  • 优先级默认为0,值越小越优先,越有可能成为Active BSR
  • 优先级相同(默认0),ip地址值越大越优,越可能成为active BSR
    为获得RP信息,所有普通路由器都要收集自举(Bootstrap)消息,即普通路由器接收并保存由自举路由器发送来的自举消息,它采用在自举消息中发布的一组可用汇集点来获得合适的组播组到汇集点的映射。所有路由器采用散列函数来计算组播组和汇集点的映射关系,散列函数的算法是把组播组地址和候选汇集点的地址作为输入值,从而得到一个组播组的实际RP地址。 其他路由器收到信息后会选择自己的RP,依据原则选择RP为:


    • 最长匹配组(acl覆盖的范围小的优先)
    • RP优先级数值低的
    • bsr的哈希值,可以做到冗余处理
    • ip地址大的


      Server配置:
      Server#conft
      Server(config)#noip routing
      Server(config)#ipdefault-gateway 192.168.1.1
      Server(config)#inte0/0
      Server(config-if)#ipadd 192.168.1.2 255.255.255.0
      Server(config-if)#nosh
      Server(config-if)#exit

      R1配置:
      R1#conf t
      R1(config)#ip multicast-routing
      R1(config)#int e0/0
      R1(config-if)#ip add 192.168.1.1255.255.255.0
      R1(config-if)#ip pim sparse-mode
      R1(config-if)#no sh
      R1(config-if)#exit
      R1(config)#int e0/1
      R1(config-if)#ip add 192.168.12.1255.255.255.0
      R1(config-if)#ip pim sparse-mode
      R1(config-if)#no sh
      R1(config-if)#exit
      R1(config)#int e0/2
      R1(config-if)#ip add 192.168.13.1255.255.255.0
      R1(config-if)#ip pim sparse-mode
      R1(config-if)#no sh
      R1(config-if)#exit
      R1(config)#router ospf 1
      R1(config-router)#net 0.0.0.0 0.0.0.0area 0
      R1(config-router)#exit

      R2配置:
      R2#conf t
      R2(config)#ip multicast-routing
      R2(config)#int e0/0
      R2(config-if)#ip add 192.168.12.2255.255.255.0
      R2(config-if)#ip pim sparse-mode
      R2(config-if)#no sh
      R2(config-if)#exit
      R2(config)#int e0/1
      R2(config-if)#ip add 192.168.25.2255.255.255.0
      R2(config-if)#ip pim sparse-mode
      R2(config-if)#no sh
      R2(config-if)#exit
      R2(config)#int lo0
      R2(config-if)#ip add 2.2.2.2255.255.255.255
      R2(config-if)#ip pim sparse-mode
      R2(config-if)#exit
      R2(config)#ip pim bsr-candidate loopback0
      R2(config)#ip pim rp-candidate loopback0
      R2(config)#router ospf 1
      R2(config-router)#net 0.0.0.0 0.0.0.0area 0
      R2(config-router)#exit

      R3配置:
      R3#conf t
      R3(config)#ip multi
      R3(config)#ip multicast-routing
      R3(config)#int e0/0
      R3(config-if)#ip add 192.168.13.3255.255.255.0
      R3(config-if)#ip pim sparse-mode
      R3(config-if)#no sh
      R3(config-if)#exit
      R3(config)#int e0/1
      R3(config-if)#ip add 192.168.34.3255.255.255.0
      R3(config-if)#ip pim sparse-mode
      R3(config-if)#no sh
      R3(config-if)#exit
      R3(config)#router ospf 1
      R3(config-router)#net 0.0.0.0 0.0.0.0area 0
      R3(config-router)#exit

      R4配置;
      R4#conf t
      R4(config)#ip multicast-routing
      R4(config)#int e0/0
      R4(config-if)#ip add 192.168.34.4255.255.255.0
      R4(config-if)#ip pim sparse-mode
      R4(config-if)#no sh
      R4(config-if)#exit
      R4(config)#int e0/1
      R4(config-if)#ip add 192.168.45.4255.255.255.0
      R4(config-if)#ip pim sparse-mode
      R4(config-if)#no sh
      R4(config-if)#exit
      R4(config)#int lo0
      R4(config-if)#ip add 4.4.4.4255.255.255.255
      R4(config-if)#ip pim sparse-mode
      R4(config-if)#exit
      R4(config)#ip pim bsr-candidate loopback0
      R4(config)#ip pim rp-candidate loopback0
      R4(config)#router ospf 1
      R4(config-router)#net 0.0.0.0 0.0.0.0area 0
      R4(config-router)#exit

      R5配置:
      R5#conf t
      R5(config)#ip multicast-routing
      R5(config)#int e0/0
      R5(config-if)#ip add 192.168.25.5255.255.255.0
      R5(config-if)#ip pim sparse-mode
      R5(config-if)#no sh
      R5(config-if)#exit
      R5(config)#int e0/1
      R5(config-if)#ip add 192.168.45.5255.255.255.0
      R5(config-if)#ip pim sparse-mode
      R5(config-if)#no sh
      R5(config-if)#exit
      R5(config-if)#exit
      R5(config)#int e0/2
      R5(config-if)#ip add 192.168.0.1255.255.255.0
      R5(config-if)#ip pim sparse-mode
      R5(config-if)#no sh
      R5(config-if)#exit
      R5(config)#router ospf 1
      R5(config-router)#net 0.0.0.0 0.0.0.0area 0
      R5(config-router)#exit

      PC配置:
      PC#conf t
      PC(config)#no ip routing
      PC(config)#ip default-gateway192.168.0.1
      PC(config)#int e0/0
      PC(config-if)#ip add 192.168.0.2255.255.255.0
      PC(config-if)#ip igmp join-group224.1.1.1
      PC(config-if)#no sh
      PC(config-if)#exit


      完成以上配置查看R5、R2、R4
      R5#sh ip pim bsr-router //活动BSR为R4
      PIMv2 Bootstrap information
      BSR address: 4.4.4.4 (?)
      Uptime:      00:00:32, BSRPriority: 0, Hash mask length: 0
      Expires:     00:01:37

      R2#sh ip mroute //R2不是RP没有收到注册信息
      IP Multicast Routing Table
      Flags: D - Dense, S - Sparse, B - BidirGroup, s - SSM Group, C - Connected,
            L - Local, P - Pruned, R - RP-bit set, F - Register flag,
            T - SPT-bit set, J - Join SPT, M - MSDP created entry,
            X - Proxy Join Timer Running, A - Candidate for MSDP Advertisement,
            U - URD, I - Received Source Specific Host Report,
            Z - Multicast Tunnel, z - MDT-data group sender,
            Y - Joined MDT-data group, y - Sending to MDT-data group
      Outgoing interface flags: H - Hardwareswitched, A - Assert winner
      Timers: Uptime/Expires
      Interface state: Interface, Next-Hop or VCD,State/Mode
      (*, 224.0.1.40), 00:27:56/00:02:40, RP0.0.0.0, flags: DCL
      Incoming interface: Null, RPF nbr 0.0.0.0
      Outgoing interface list:
      Ethernet0/0,Forward/Sparse, 00:27:56/00:02:40

      R4#sh ip mroute //R4有注册信息,说明它被选为RP
      IP Multicast Routing Table
      Flags: D - Dense, S - Sparse, B - BidirGroup, s - SSM Group, C - Connected,
            L - Local, P - Pruned, R - RP-bit set, F - Register flag,
            T - SPT-bit set, J - Join SPT, M - MSDP created entry,
            X - Proxy Join Timer Running, A - Candidate for MSDP Advertisement,
            U - URD, I - Received Source Specific Host Report,
            Z - Multicast Tunnel, z - MDT-data group sender,
            Y - Joined MDT-data group, y - Sending to MDT-data group
      Outgoing interface flags: H - Hardware switched,A - Assert winner
      Timers: Uptime/Expires
      Interface state: Interface, Next-Hop or VCD,State/Mode
      (*, 224.1.1.1),00:12:29/00:02:49, RP 4.4.4.4, flags: S
        Incoming interface: Null, RPF nbr 0.0.0.0
        Outgoing interface list:
         Ethernet0/1, Forward/Sparse, 00:12:29/00:02:49

      (*, 224.0.1.40), 00:22:23/00:02:35, RP0.0.0.0, flags: DCL
      Incoming interface: Null, RPF nbr 0.0.0.0
      Outgoing interface list:
         Ethernet0/0, Forward/Sparse, 00:22:23/00:02:35

      从Server端ping 224.1.1.1,检查变化:
      Server#ping 224.1.1.1 repeat 100
      Type escape sequence to abort.
      Sending 100, 100-byte ICMP Echos to224.1.1.1, timeout is 2 seconds:
      ..
      Reply to request 2 from 192.168.0.2, 112ms
      Reply to request 3 from 192.168.0.2, 96ms

      R4#sh ip mroute
      IP Multicast Routing Table
      Flags: D - Dense, S - Sparse, B - BidirGroup, s - SSM Group, C - Connected,
            L - Local, P - Pruned, R - RP-bit set, F - Register flag,
            T - SPT-bit set, J - Join SPT, M - MSDP created entry,
            X - Proxy Join Timer Running, A - Candidate for MSDP Advertisement,
            U - URD, I - Received Source Specific Host Report,
            Z - Multicast Tunnel, z - MDT-data group sender,
            Y - Joined MDT-data group, y - Sending to MDT-data group
      Outgoing interface flags: H - Hardwareswitched, A - Assert winner
      Timers: Uptime/Expires
      Interface state: Interface, Next-Hop or VCD,State/Mode

      (*, 224.1.1.1),00:14:59/stopped, RP 4.4.4.4, flags: S //RPT树
        Incoming interface: Null, RPF nbr 0.0.0.0
        Outgoing interface list:
          Ethernet0/1, Forward/Sparse,00:14:59/00:03:17

      (192.168.1.2,224.1.1.1), 00:00:04/00:02:59, flags: PTX //切换到SPT树
        Incoming interface: Ethernet0/1, RPF nbr192.168.45.5
        Outgoing interface list: Null

      (*, 224.0.1.40), 00:24:53/00:02:03, RP0.0.0.0, flags: DCL
      Incoming interface: Null, RPF nbr 0.0.0.0
      Outgoing interface list:
         Ethernet0/0, Forward/Sparse, 00:24:55/00:02:01

      关闭R4的两个物理端口,查看RP是否会自动切换到2.2.2.2
      R4#conf t //关闭R4端口
      R4(config)#int e0/0
      R4(config-if)#shutdown
      R4(config-if)#int e0/1
      R4(config-if)#shutdown

      R5#sh ip pim bsr //活动BSR变为R2
      R5#sh ip pim bsr-router
      PIMv2 Bootstrap information
      BSR address: 2.2.2.2 (?)
      Uptime:      00:03:17, BSRPriority: 0, Hash mask length: 0
      Expires:     00:01:52

      R5#sh ip mroute //RP切换到R2上
      IP Multicast Routing Table
      Flags: D - Dense, S - Sparse, B - BidirGroup, s - SSM Group, C - Connected,
            L - Local, P - Pruned, R - RP-bit set, F - Register flag,
            T - SPT-bit set, J - Join SPT, M - MSDP created entry,
            X - Proxy Join Timer Running, A - Candidate for MSDP Advertisement,
            U - URD, I - Received Source Specific Host Report,
            Z - Multicast Tunnel, z - MDT-data group sender,
            Y - Joined MDT-data group, y - Sending to MDT-data group
      Outgoing interface flags: H - Hardwareswitched, A - Assert winner
      Timers: Uptime/Expires
      Interface state: Interface, Next-Hop or VCD,State/Mode

      (*, 224.1.1.1),00:23:01/00:02:57, RP 2.2.2.2, flags: SJC
        Incoming interface: Ethernet0/0, RPF nbr192.168.25.2
        Outgoing interface list:
          Ethernet0/2, Forward/Sparse,00:23:01/00:02:57

      (*, 224.0.1.40), 00:27:21/00:02:30, RP0.0.0.0, flags: DCL
      Incoming interface: Null, RPF nbr 0.0.0.0
      Outgoing interface list:
         Ethernet0/0, Forward/Sparse, 00:27:21/00:02:30



      实验六、组播双向树
      Center.jpg
    • PIM Sparse-Mode (PIM-SM)是单向树的转发,初始组播流量从源发送到RP,然后由RP使用共享树转发给接收者;如果RP不在最短路径树上,会发生自动的从源到接受者的最短路径树的计算,进而生成源树路由条目(S,G);这样的行为可能导致路由器维护比较多的源树路由条目(S,G),造成一定的系统和网络资源的占用。Bidirectional PIM (Bidir-PIM)即双向PIM属于PIM-SM的一个分支和扩展技术,能够优化PIM-SM单向树所导致的资源占用问题。

      在Bidir-PIM运行模式下,无需建立任何源树条目(S,G),所有的组播流量都使用共享树转发(*,G),在该模式下,没有任何源注册消息,组播源和接收者都加入到同一棵共享树。 Bidir-PI基本術語




    • MulticastRouting Information Base (MRIB)pim协议根据单播路由表计算的到RP的组播共享树路径。
    • RendezvousPoint Address (RPA)
    • RendezvousPoint Link (RPL),即RP的直连链路
    • DesignatedForwarder (DF)   替代了DR,同时也是一种防环机制 除了RPL外(RPL不选举DF),在组播域中的每条链路都会自动选举一个唯一的DF路由器,选举原则为对比同一条链路的每个接口到RP的单播路径, 具有最佳路径的接口的路由器被选为DF。DF负责转发该链路 的组播流量,也负责处理来自下游路由器的共享树加入消息
    • RPFInterface  :每个路由器去往RP的最佳路径的接口,是与DF直连的接口。
      Bidir-PIM组播路由的状态对于每个特定的组和RP,在每个路由器建立以下的组播转发路径:


    • 从组播源到RP的转发路径,沿着RPF接口转发到RP。
    • 从RP到组播接收者的转发路径,或者从组播源直接转发到接收者的路径
      按照以上方法建立转发路径,组播路由表项:

  • 仅仅有(*,G),falg为B
  • 没有入接口,只有Bidir-Upstream,去往RP
  • 出站接口列表:forward代表把流量转发给接收者;Bidir-Upstream代表拷贝自上行流量接口。
    Bidir-PIM的对组播包的转发


    • 仅仅当一个数据包是来自RPF接口(从源到RP方向),或者来自DF路由器的接口(从RP到接收者方向);路由器才会接收该数据包。
    • 路由器开始构建数据包的转发出口,从所有的出站接口列表中删除入站接口,如果出站接口列表不为空,将数据包转发给其它所有的出站接口。
    • 如果源与RP在同一侧,直接发送给接受者


      Server1配置:
      Server#conf t
      Server(config)#no ip routiiing
      Server(config)#ip default-gateway 192.168.1.1
      Server(config)#int e0/0
      Server(config-if)#ip add 192.168.1.2 255.255.255.0
      Server(config-if)#no sh
      Server(config-if)#exit

      R1配置:
      R1#conf t
      R1(config)#ip multicast-routing
      R1(config)#ip pim bidir-enable
      R1(config)#ip pim rp-address 3.3.3.3 bidir
      R1(config)#int e0/0
      R1(config-if)#ip add 192.168.1.1255.255.255.0
      R1(config-if)#ip pim sparse-mode
      R1(config-if)#no sh
      R1(config-if)#exitp
      R1(config)#int e0/1
      R1(config-if)#ip add 192.168.12.1255.255.255.0
      R1(config-if)#ip pim sparse-mode
      R1(config-if)#no sh
      R1(config-if)#exit
      R1(config)#int e0/2
      R1(config-if)#ip add 192.168.13.1255.255.255.0
      R1(config-if)#ip pim sparse-mode
      R1(config-if)#no sh
      R1(config-if)#exit
      R1(config)#router ospf 1
      R1(config-router)#net 0.0.0.0 0.0.0.0 area 0
      R1(config-router)#exit

      R2配置:
      R2#conf t
      R2(config)#ip multicast-routing
      R2(config)#ip pim bidir-enable
      R2(config)#ip pim rp-address 3.3.3.3 bidir
      R2(config)#int e0/0
      R2(config-if)#ip add 192.168.12.2255.255.255.0
      R2(config-if)#ip pim sparse-mode
      R2(config-if)#no sh
      R2(config-if)#exit
      R2(config)#int e0/1
      R2(config-if)#ip add 192.168.24.2 255.255.255.0
      R2(config-if)#ip pim sparse-mode
      R2(config-if)#no sh
      R2(config-if)#exit
      R2(config)#router ospf 1
      R2(config-router)#net 0.0.0.0 0.0.0.0 area 0
      R2(config-router)#exit

      R3配置:
      R3#conf t
      R3(config)#ip multicast-routing
      R3(config)#ip pim bidir-enable
      R3(config)#ip pim rp-address 3.3.3.3 bidir
      R3(config)#int e0/0
      R3(config-if)#ip add 192.168.13.3255.255.255.0
      R3(config-if)#ip pim sparse-mode
      R3(config-if)#no sh
      R3(config-if)#exit
      R3(config)#int e0/1
      R3(config-if)#ip add 192.168.34.3255.255.255.0
      R3(config-if)#ip pim sparse-mode
      R3(config-if)#no sh
      R3(config-if)#exit
      R3(config)#int lo0
      R3(config-if)#ip add 3.3.3.3 255.255.255.255
      R3(config-if)#ip pim sparse-mode
      R3(config-if)#exit
      R3(config)#router ospf 1
      R3(config-router)#net 0.0.0.0 0.0.0.0 area 0
      R3(config-router)#exit

      R4配置:
      R4#conf t
      R4(config)#ip multicast-routing
      R4(config)#ip pim bidir-enable
      R4(config)#ip pim rp-address 3.3.3.3 bidir
      R4(config)#int e0/0
      R4(config-if)#ip add 192.168.24.4255.255.255.0
      R4(config-if)#ip pim sparse-mode
      R4(config-if)#no sh
      R4(config-if)#exit
      R4(config)#int e0/1
      R4(config-if)#ip add 192.168.34.4255.255.255.0
      R4(config-if)#ip pim sparse-mode
      R4(config-if)#no sh
      R4(config-if)#exit
      R4(config)#int e0/2
      R4(config-if)#ip add 192.168.0.1255.255.255.0
      R4(config-if)#ip pim sparse-mode
      R4(config-if)#no sh
      R4(config-if)#exit
      R4(config)#router ospf 1
      R4(config-router)#net 0.0.0.0 0.0.0.0 area 0
      R4(config-router)#exit

      PC配置:
      PC#conf t
      PC(config)#no ip routing
      PC(config)#ip default-gateway 192.168.0.1
      PC(config)#int e0/0
      PC(config-if)#ip add 192.168.0.2255.255.255.0
      PC(config-if)#ip igmp join-group 224.1.1.1
      PC(config-if)#no sh
      PC(config-if)#exit

配置完成后观察R3
R3# debug ip pim
*Mar 1 00:09:36.027: PIM(0): Join-list: (*, 224.1.1.1), RPT-bit set, WC-bitset
*Mar 1 00:09:36.031: PIM(0): Check RP 3.3.3.3 into the (*, 224.1.1.1) entry
*Mar 1 00:09:36.031: PIM(0): Add Ethernet0/1/192.168.34.4 to (*, 224.1.1.1),Forward state, by PIM *G Join
*Mar 1 00:12:38.171: PIM(0): Received v2 Join/Prune on Ethernet0/0 from192.168.13.1, to us
*Mar 1 00:12:38.171: PIM(0): Join-list: (*, 224.0.1.40), RPT-bit set, WC-bitset, S-bit set
*Mar 1 00:12:38.171: PIM(0): Update Ethernet0/0/192.168.13.1 to (*,224.0.1.40), Forward state, by PIM *G Join
*Mar 1 00:10:34.471: PIM(0): Received v2 Join/Prune on Ethernet0/1 from192.168.34.4, to us
*Mar 1 00:10:34.471: PIM(0): Join-list: (*, 224.1.1.1), RPT-bit set, WC-bitset, S-bit set
*Mar 1 00:10:34.475: PIM(0): Update Ethernet0/1/192.168.34.4 to (*,224.1.1.1), Forward state, by PIM *G Join
*Mar 1 00:10:34.795: PIM(0): Building Periodic Join/Prune message for224.1.1.1

R3#ship mroute
IPMulticast Routing Table
Flags:D - Dense, S - Sparse, B - Bidir Group, s - SSM Group, C - Connected,
       L - Local, P - Pruned, R - RP-bit set, F- Register flag,
       T - SPT-bit set, J - Join SPT, M - MSDPcreated entry,
       X - Proxy Join Timer Running, A -Candidate for MSDP Advertisement,
       U - URD, I - Received Source SpecificHost Report,
       Z - Multicast Tunnel, z - MDT-data groupsender,
       Y - Joined MDT-data group, y - Sendingto MDT-data group
Outgoinginterface flags: H - Hardware switched, A - Assert winner
Timers: Uptime/Expires
Interface state: Interface, Next-Hop or VCD,State/Mode
(*, 224.1.1.1),00:05:49/00:02:35, RP 3.3.3.3, flags: B
  Bidir-Upstream: Null, RPF nbr 0.0.0.0
  Outgoing interface list:
    Ethernet0/1, Forward/Sparse,00:05:49/00:02:35
(*,224.0.1.40), 00:14:17/00:02:41, RP 3.3.3.3, flags: BCL
  Bidir-Upstream: Null, RPF nbr 0.0.0.0
  Outgoing interface list:
    Ethernet0/1, Forward/Sparse,00:09:11/00:02:41
Ethernet0/0, Forward/Sparse,00:13:16/00:02:38

R4#ship mroute
IPMulticast Routing Table
Flags:D - Dense, S - Sparse, B - Bidir Group, s - SSM Group, C - Connected,
       L - Local, P - Pruned, R - RP-bit set, F- Register flag,
       T - SPT-bit set, J - Join SPT, M - MSDPcreated entry,
       X - Proxy Join Timer Running, A -Candidate for MSDP Advertisement,
       U - URD, I - Received Source SpecificHost Report,
       Z - Multicast Tunnel, z - MDT-data groupsender,
       Y - Joined MDT-data group, y - Sendingto MDT-data group
Outgoinginterface flags: H - Hardware switched, A - Assert winner
Timers: Uptime/Expires
Interface state: Interface, Next-Hop or VCD,State/Mode
(*, 224.1.1.1),00:07:23/00:02:35, RP 3.3.3.3, flags: BC
  Bidir-Upstream: Ethernet0/1, RPF nbr192.168.34.3
  Outgoing interface list:
    Ethernet0/2, Forward/Sparse,00:07:23/00:02:35
    Ethernet0/1, Bidir-Upstream/Sparse,00:07:23/00:00:00
(*,224.0.1.40), 00:12:13/00:02:25, RP 3.3.3.3, flags: BCL
  Bidir-Upstream: Ethernet0/1, RPF nbr192.168.34.3
  Outgoing interface list:
    Ethernet0/0, Forward/Sparse,00:10:48/00:02:22
Ethernet0/1, Bidir-Upstream/Sparse,00:10:49/00:00:00

Server#ping224.1.1.1 repeat 100
Typeescape sequence to abort.
Sending100, 100-byte ICMP Echos to 224.1.1.1, timeout is 2 seconds:
..
Replyto request 2 from 192.168.0.2, 104 ms
Replyto request 3 from 192.168.0.2, 144 ms
Replyto request 4 from 192.168.0.2, 164 ms
Replyto request 5 from 192.168.0.2, 128 ms
在Bidir-PIM模式下,所有的组播路由器首先以RP为根构建一棵共享树,连接组播接收者的路由器动态的沿着RPF路径向RP发送加入或修剪消息,将动态的生成一个用于流量转发的子树(是共享树的一个子集),任何的组播源都可以直接将流量转发给RP,或者一个下游邻居(下游邻居必须先加入到共享树),除了RP路由器外,其它路由器都在每条链路上选举DF路由器,最终每个路由器都根据流量的入站接口,动态计算一个出站接口列表,实现准确的组播数据包的转发。 在所有的组播路由器上,不使用也不建立任何的源树转发条目(S,G),减少了组播路由协议对系统和网络资源的占用。



实验七、PIM-SSM(指定信源组播)
Center.jpg
SSM(Source-Specific Multicast,指定信源组播)模型和ASM(Any-Source Multicast,任意信源组播)模型是两个完全对等的模型。目前,ASM模型包括PIM-DM和PIM-SM两种模式;SSM模型能够借助PIM-SM的部分技术来实现。SSM模型为指定源组播提供了解决方案,通过IGMPv3来维护主机与路由器之间的关系。鉴于PIM-DM模式以扩散/剪枝方式构建以组播源为根的SPT,虽然SPT的路径最短,但是分发树的建立过程效率较低,不适合大中型网络。在实际应用中,通常采用PIM-SM模式的一部分技术来实现SSM模型。由于接收者已经通过其它渠道(如广告咨询等)知道了组播源的具体位置,因此在SSM模型中无需RP,无需构建RPT,无需源注册过程,也无需通过MSDP(Multicast Source Discovery Protocol,组播源发现协议)来发现其它PIM域内的组播源。因此PIM-SSM适合于点到多点的服务
与ASM模型相比,SSM模型仅需要IGMPv3和PIM-SM部分子集的支持。构建为PIM-SM服务的RPT,还是构建为PIM-SSM服务的SPT,关键在于接收者准备加入的组播组是否属于SSM组地址范围(默认为232.0.0.0~232.255.255.255)。如果用户对组播源S的信息感兴趣,则借助IGMPv3的报告报文向最近的DR路由器报告自己对特定源S的信息感兴趣,标记为(include S,G);或报告对除特定源S外的其它组播源的信息感兴趣,则标记为(exclude S,G)。无论如何描述,都表示特定源S的位置对接收者是明确指定的。接收到该报文的DR先判断该报文中的组地址是否在SSM组地址范围内:如果在范围内则构建PIM-SSM,并向特定源S逐跳发送通道的订阅报文。沿途所有路由器上都创建(Include S,G)或(ExcludeS,G)表项,从而在网络内构建了一棵以指定组播源S为根,以接收者为叶子节点的SPT,该树就是PIM-SSM中的传输通道;如果不在范围内,则仍旧按照PIM-SM的流程进行后续处理,此时DR需要向RP发送(*,G)加入报文,同时需要进行组播源的注册。在配置过程中,请注意以下几点:
  • 如果没有配置SSM的组地址,默认为232.0.0.0~232.255.255.255;
  • 必须使用IGMPv3指定源加入;
  • 目前不支持以exclude模式加入组


    Server1配置:
    Server1#conf t
    Server1(config)#no ip routing
    Server1(config)#int e0/0
    Server1(config-if)#ip add 192.168.1.2255.255.255.0
    Server1(config-if)#no sh
    Server1(config-if)#exit
    Server1(config)#ip default-gateway192.168.1.1

    Server2配置:
    Server2#conf
    Server2(config)#no ip routing
    Server2(config)#ip default-gateway192.168.2.1
    Server2(config)#int e0/0
    Server2(config-if)#ip add 192.168.2.2255.255.255.0
    Server2(config-if)#no sh
    Server2(config-if)#exit

    R3配置:
    R3#conf t
    R3(config)#ip multicast-routing
    R3(config)#ip pim ssm default
    R3(config)#int e0/0
    R3(config-if)#ip add 192.168.1.1255.255.255.0
    R3(config-if)#ip pim sparse-mode
    R3(config-if)#ip igmp version 3
    R3(config-if)#no sh
    R3(config-if)#exit
    R3(config)#int e0/1
    R3(config-if)#ip add 192.168.2.1255.255.255.0
    R3(config-if)#ip pim sparse-mode
    R3(config-if)#ip igmp ver 3
    R3(config-if)#no sh
    R3(config-if)#exit
    R3(config)#int e0/2
    R3(config-if)#ip add 192.168.34.1255.255.255.0
    R3(config-if)#ip pim sparse-mode
    R3(config-if)#ip igmp ver 3
    R3(config-if)#no sh
    R3(config-if)#exit
    R3(config)#router ospf 1
    R3(config-router)#net 0.0.0.0 0.0.0.0area 0
    R3(config-router)#exit

    R4配置:
    R4#conf t
    R4(config)#ip multicast-routing
    R4(config)#ip pim ssm default //开启指定信源组播模式
    R4(config)#access-list 1 permit232.1.1.1 //标记组播组地址
    R4(config)#ip igmp ssm-map enable //开启SSM映射功能
    R4(config)#ip igmp ssm-map static 1192.168.1.2//建立组播组与信源的映射
    R4(config-if)#ip add 192.168.34.4255.255.255.0
    R4(config-if)#ip pim sparse-mode
    R4(config-if)#ip igmp ver 3
    R4(config-if)#no sh
    R4(config-if)#exit
    R4(config)#int e0/1
    R4(config-if)#ip add 192.168.0.1255.255.255.0
    R4(config-if)#ip pim sparse-moder
    R4(config-if)#ip igmp ver 3
    R4(config-if)#no sh
    R4(config-if)#exit
    R4(config)#router ospf 1
    R4(config-router)#net 0.0.0.0 0.0.0.0area 0
    R4(config-router)#exit

    PC配置:
    PC#conf t
    PC(config)#no ip routing
    PC(config)#ip default-gateway192.168.0.1
    PC(config)#int e0/0
    PC(config-if)#ip add 192.168.0.2255.255.255.0
    PC(config-if)#ip igmp join-group232.1.1.1 source 192.168.1.2 //加入组播组,并指定组播信源
    PC(config-if)#no sh
    PC(config-if)#exit

    检查网络联通性,然后观察R4
    R4#sh ip mroute
    IP Multicast Routing Table
    Flags: D - Dense, S - Sparse, B - BidirGroup, s - SSM Group, C - Connected,
          L - Local, P - Pruned, R - RP-bit set, F - Register flag,
          T - SPT-bit set, J - Join SPT, M - MSDP created entry,
          X - Proxy Join Timer Running, A - Candidate for MSDP Advertisement,
          U - URD, I - Received Source Specific Host Report,
          Z - Multicast Tunnel, z - MDT-data group sender,
          Y - Joined MDT-data group, y - Sending to MDT-data group
    Outgoing interface flags: H - Hardwareswitched, A - Assert winner
    Timers: Uptime/Expires
    Interface state: Interface, Next-Hop or VCD,State/Mode

    (192.168.1.2,232.1.1.1), 00:04:04/00:02:57, flags: sTI
      Incoming interface: Ethernet0/0, RPF nbr192.168.34.1
      Outgoing interface list:
        Ethernet0/1, Forward/Sparse,00:04:04/00:02:57

    (*, 224.0.1.40), 00:16:11/00:02:28, RP0.0.0.0, flags: DCL
    Incoming interface: Null, RPF nbr 0.0.0.0
    Outgoing interface list:
       Ethernet0/0, Forward/Sparse, 00:16:11/00:02:28

    R4#sh ip igmp groups
    IGMP Connected Group Membership
    Group Address    Interface                Uptime    Expires  Last Reporter   Group Accounted
    232.1.1.1        Ethernet0/1              00:03:04  00:02:03 192.168.0.2
    224.0.1.40       Ethernet0/0              00:09:16  00:02:31 192.168.34.4




    接着在Server1 和Server2分别ping 232.1.1.1组播组地址观察结果:
    Server1#ping 232.1.1.1 repeat 100 //Server1 可以通信
    Type escape sequence to abort.
    Sending 100, 100-byte ICMP Echos to232.1.1.1, timeout is 2 seconds:
    Reply to request 0 from 192.168.0.2, 76ms
    Reply to request 1 from 192.168.0.2, 56ms


    Server2#ping 232.1.1.1 repeat 100 //Server2不可以
    Type escape sequence to abort.
    Sending 100, 100-byte ICMP Echos to232.1.1.1, timeout is 2 seconds:
    ..................................................



    实验八、域间组播PIM-SM结合MSDP与MBGP

      当网络跨越了公网,或者网络需要各自独立时,如果每个独立的网络,或者是每个AS之间都需要组播通信的情况下,我们需要在不影响网络独立的前提下连通网络间的组播。各个独立的网络中,又希望自己的组播路由器可以由自己完全控制,那么就需要将各个网络配置成独立的PIM-SM域。要将不同的PIM-SM域之间连通组播,就必须先有正常的组播树,而PIM-SM组播树的建立,必须了解到网络中的RP信息,以及组播源的位置。   此时MSDP出现了,MSDP组播源发现协议(MulticastSourceDiscoveryProtocol)描述了一种连接多PIM-SM(PIM-SM:PIMSparseMode)域的机制。每种PIM-SM域都使用自己独立的RP,它并不依赖于其它域内的RP。PIM-SM域内的MSDP发话路由器与其它域内的MSDP对等设备之间存在一种MSDP对等关系,这种关系通过TCP连接形成,在其中控制信息进行交换。每个域都有一个或多个连接到这个虚拟拓扑结构。这种拓朴结构使得域能从其它域发现组播源。如果组播源想知道含有接收端的域,那么PIM-SM中的标准源树建立机制就会被用于在域内分配树上传送组播数据。MSDP使用TCP639端口建立对等连接(高ip侦听,低ip连接),和BGP一样,对等间连接必须明确配置,当PIMDR在RP注册源时,RP向所有的MSDP对等体发送源激活消息,然后其他MSDP路由器将SA泛洪。域内的组播路由和组播源信息收集工作由 PIM-SM 完成, MBGP  负责域间传播具有组播拓扑的信息,MSDP 负责传播组播源信息。这种方案要求所有的自治域都支持  PIM-SM、MBGP和MSDP。在PIM-SM  /  MBGP  /  MSDP  组合方案中,自治域边界路由器之间配置外部  MBGP 对等,RP 之间配置外部 MSDP 对等;自治域内部路由器之间根据需要配置内部 MBGP 对等;内部 RP之间配置内部  MSDP  对等,实现Anycast  RP。该优点在於
  • 不存在第三方(Third-party)资源依赖域内RP。 msdp使得一个pim-sm域不需要依赖另一个pim-sm域内的rp,因为在得到另一个pim-sm域内的组播源信息之后,一个pim-sm域里的接收者可以不通过另一pim-sm域里的rp而直接加入到这个域内组播源的spt上。
  • PIM-SM域只依靠本身的RP。  
  • 接收端域:只带接受端的域可以获取数据而不用全局通告组成员。MSDP可以和其它非PIM-SM协议一起使用。
    在不同的PIM-SM域之间建立MSDP连接时,是使用TCP 639, IP地址高的初始化TCP连接,60秒一次keepalive,75秒后没数据或keepalive则重建TCP。建立连接的双方均是各自区域的RP,组播源向RP注册之后,那么RP将这些源信息通过在MSDP连接上发送Source-Active (SA)到远程RP,以提供组播源的信息。因为RP收到Source-Active (SA)后,也是要做RPF检测的,检测是根据BGP来做的,在这里,需要使用MBGP之组播协议,组成员的网络信息和建立MSDP连接的peer地址理论上都需要在MBGP中进行通告,一是防止RPF检测失败,二是由此来决定组播数据的传递,所以十分重要。MBGP(多协议边界网关协议)增加了 BGP 的性能,使其能在整个因特网上组播路由策略,并能够在 BGP 自治系统内或之间连接组播拓朴。换句话说, MBGP 可以说是增强版的携带 IP 组播路由的 BGP(不仅限于此)。BGP 携带了两组路由,一组是提供单播路由,另一组是提供组播路由。协议独立组播(PIM)使用连接组播路由的路由器建立数据分配树。当需要链接仅用于组播通信,或限制通信的资源使用时;也可能当网络访问点需要交换所有的组播通信时,MBGP 都是非常有用的。MBGP 允许单播路由拓朴不同于组播路由拓朴。
    但是在PIM-SM域之间没有开启MBGP,就会有RPF检测失败的危险,失败后,Source-Active (SA)将被丢弃,所以要想在不开启MBGP的情况下,又要接收所有的Source-Active (SA),则将接收端配置成default MSDP,那么该域将接收任何SA信息。在配置default MSDP时,需要指定从何处接收SA,就需要指定对端MSDP peer,使用ip msdp default-peer指定,之后从对端过来的SA将不做RPF检测而完全被接收。
    在配置MSDP peer时,可以指定originator-id,此ID即在SA中写出RP的地址,也可以不配。必须的配置只是msdp peer,且 MSDP对等体的接口地址与建立MBGP对等体的接口地址相同。MSDP只能在PIM-SM下使用,并且域间建立peer的RP应该是直连的。当两个远程网络需要使用组播时,由于中间可以隔了多个网络,也可以利用MSDP连接在不需要中间网络支持组播的情况下,连通远程网络的组播,所以MSDP类似于组播VPN。但需要解决直连问题,解决的方法可以配置tunnel。
         在不同的域中配置的RP,被称为LogicalRP ,但在网络中也可以配置多个RP,如果将多个RP配置成同一个地址时,那么多个具有相同地址的RP被称为Anycast RP,而且Anycast RP必须是32位掩码的地址,且需要在单播里通告,各个源和组成员均选用离自己最近的RP, 从而提供冗余功能。所有Anycast RP都要配置成MSDP peers,每个注册的消息,都传给所有RP
    msdp另一个应用是anycast rp。在一个域内,用同一个ip地址配置不同的路由器上的某一接口(通常是loopback接口),同时,配置这些路由器上这个接口为候选rp,并在这些rp之间建立msdp对等体关系。单播路由收敛后,组播源可以选择最近的rp注册,接收者也可以选择最近的rp加入其rpt。这些rp之间通过msdp对等体了解对方的注册源信息,最终每个rp了解到整个域内的所有组播源,这样,每个rp上的接收者就可以接收到整个域内的所有组播源发出的组播数据。通过向就近的rp发起注册和rpt加入,实现rp的负载分担;一个rp失效后,其原来注册的源和加入者,又会选择另一个就近的rp注册和加入,实现了rp的冗余备份。另外,msdp通过rpf检查机制,只接受从正确路径上接收到的sa消息,避免接受冗余的sa消息;可以通过配置mesh全连接组来避免sa消息在msdp对等体之间泛滥。
    在Anycast RP中,2个或多个RP在其Loopback接口上配置相同的IP地址。Anycast RP Loopback地址应该配置为32位掩码,其他路由器必须“知道”这个Anycast RP Loopback地址是它们的RP。当然在一台路由器上,IP路由协议将会自动选择离它最近的RP;假设网络中的组播源是均匀分布的,那么这些组播源也将均匀地注册到每个RP上。由于组播源可能注册到一个RP,而接收方却注册到另一个RP,我们就需要使用MSDP在RP之间交换活动组播源的信息。在Anycast RP中,所有RP之间必须配置为MSDP对等体。当一个组播源向某个RP注册时,该RP将通过MSDP的SA消息通告给其他RP,从而使得其他的RP都知道这个组播源的信息。若某个RP故障,当IP路由协议收敛后,其他RP将会成为该区域新的RP。而新的组播源将会将会注册到备份RP(即新的RP);同样地,接收方也将使用新的RP,从而保证连通性。
    单个域内的PIM-SM要通信,是建立的(*,G)条目,如果PIM-SM域之间要通信,建立的是(S,G)条目,相当于是距离矢量的路径方式
  • Center.jpg
















                     Server配置:

    • Server#conf t
      Server(config)#no ip routing
      Server(config)#ip default-gateway192.168.1.1
      Server(config)#int e0/0
      Server(config-if)#ip add 192.168.1.2255.255.255.0
      Server(config-if)#no sh
      Server(config-if)#exit

      R1配置:
      R1#conf t
      R1(config)#ip multicast-routing
      R1(config)#int e0/0
      R1(config-if)#ip add 192.168.1.1255.255.255.0
      R1(config-if)#ip pim sparse-mode
      R1(config-if)#no sh
      R1(config-if)#exit
      R1(config)#int e0/1
      R1(config-if)#ip add 192.168.12.1255.255.255.0
      R1(config-if)#ip pim sparse-mode
      R1(config-if)#no sh
      R1(config-if)#exit
      R1(config)#int lo 0
      R1(config-if)#ip add 1.1.1.1255.255.255.255
      R1(config-if)#ip pim sparse-mode
      R1(config-if)#exit
      R1(config)#int lo 10
      R1(config-if)#ip add 10.10.10.10255.255.255.255
      R1(config-if)#ip pim sparse-mode
      R1(config-if)#exit
      R1(config)#router ospf 1
      R1(config-router)#router-id 1.1.1.1
      R1(config-router)#net 1.1.1.1 0.0.0.0area 0
      R1(config-router)# network 10.10.10.100.0.0.0 area 0
      R1(config-router)#net 192.168.12.0255.255.255.0 area 0
      R1(config-router)#net 192.168.1.0255.255.255.0 area 0
      R1(config-router)#exit
      R1(config)#router bgp 65501
      R1(config-router)#bgp router-id 1.1.1.1
      R1(config-router)#net 192.168.1.0 mask255.255.255.0
      R1(config-router)#net 192.168.12.0 mask255.255.255.0
      R1(config-router)#neighbor 2.2.2.2remote-as 65501 nlri unicast multicast
      R1(config-router)#neighbor 2.2.2.2update-source loopback 0
      R1(config-router)#neighbor 3.3.3.3remote-as 65501 nlri unicast multicast
      R1(config-router)#neighbor 3.3.3.3update-source loopback 0
      R1(config-router)#exit
      R1(config)#ip pim bsr-candidate loopback10
      R1(config)#ip pim rp-candidate loopback10
      R1(config)#ip msdp peer 2.2.2.2connect-source loopback 0
      R1(config)#ip msdp peer 3.3.3.3connect-source loopback 0
      R1(config)#ip msdp mesh-group anycast-rp2.2.2.2
      R1(config)#ip msdp mesh-group anycast-rp3.3.3.3
      R1(config)#ip msdp originator-idloopback 0

      R2配置:
      R2#conf t
      R2(config)#ip multicast-routing
      R2(config)#int e0/0
      R2(config-if)#ip add 192.168.12.2255.255.255.0
      R2(config-if)#ip pim sparse-mode
      R2(config-if)#no sh
      R2(config-if)#exit
      R2(config)#int e0/1
      R2(config-if)#ip add 192.168.23.2255.255.255.0
      R2(config-if)#ip pim sparse-mode
      R2(config-if)#no sh
      R2(config-if)#exit
      R2(config)#int lo 0
      R2(config-if)#ip add 2.2.2.2255.255.255.255
      R2(config-if)#ip pim sparse-mode
      R2(config-if)#exit
      R2(config)#in lo 10
      R2(config-if)#ip add 10.10.10.10255.255.255.255
      R2(config-if)#ip pim sparse-mode
      R2(config-if)#exit
      R2(config)#router ospf 1
      R2(config-router)#router-id 2.2.2.2
      R2(config-router)#net 2.2.2.2 0.0.0.0area 0
      R2(config-router)#net 10.10.10.100.0.0.0 area 0
      R2(config-router)#net 192.168.12.0255.255.255.0 area 0
      R2(config-router)#net 192.168.23.0255.255.255.0 area 0
      R2(config-router)#exit
      R2(config)#router bgp 65501
      R2(config-router)#bgp router-id 2.2.2.2
      R2(config-router)#net 192.168.12.0 mask255.255.255.0
      R2(config-router)#net 192.168.23.0 mask255.255.255.0
      R2(config-router)#nei 1.1.1.1 remote-as65501 nlri unicast multicast
      R2(config-router)#nei 1.1.1.1update-source loopback 0
      R2(config-router)#nei 3.3.3.3 remote-as65501 nlri unicast multicast
      R2(config-router)#nei 3.3.3.3update-source loopback 0
      R2(config-router)#exit
      R2(config)# ip pim bsr-candidateloopback 10
      R2(config)#ip pim rp-candidate loopback10
      R2(config)#ip msdp peer 1.1.1.1connect-source loopback 0
      R2(config)#ip msdp peer 3.3.3.3 connect-sourceloopback 0
      R2(config)#ip msdp mesh-group anycast-rp1.1.1.1
      R2(config)#ip msdp mesh-group anycast-rp3.3.3.3
      R2(config)#ip msdp originator-idloopback 0

      R3配置:
      R3#conf t
      R3(config)#ip multicast-routing
      R3(config)#int e0/0
      R3(config-if)#ip add 192.168.23.3255.255.255.0
      R3(config-if)#ip pim sparse-mode
      R3(config-if)#no sh
      R3(config-if)#exit
      R3(config)#int e0/1
      R3(config-if)#ip add 192.168.34.3255.255.255.0
      R3(config-if)#ip pim sparse-mode
      R3(config-if)#no sh
      R3(config-if)#exit
      R3(config)#int lo 0
      R3(config-if)#ip add 3.3.3.3255.255.255.255
      R3(config-if)#ip pim sparse-mode
      R3(config-if)#exit
      R3(config)#int lo 10
      R3(config-if)#ip add 10.10.10.10255.255.255.255
      R3(config-if)#ip pim sparse-mode
      R3(config-if)#exit
      R3(config)#router ospf 1
      R3(config-router)#router-id 3.3.3.3
      R3(config-router)#net 3.3.3.3 0.0.0.0 area0
      R3(config-router)#net 10.10.10.100.0.0.0 area 0
      R3(config-router)#net 192.168.23.0255.255.255.0 area 0
      R3(config-router)#net 192.168.34.0255.255.255.0 area 0
      R3(config-router)#exit
      R3(config)#router bgp 65501
      R3(config-router)#bgp router-id 3.3.3.3
      R3(config-router)#net 192.168.23.0 mask255.255.255.0
      R3(config-router)#net 192.168.34.0 mask255.255.255.0
      R3(config-router)#net 10.10.10.10 mask255.255.255.255
      R3(config-router)#nei 1.1.1.1 remote-as65501 nlri unicast multicast
      R3(config-router)#nei 1.1.1.1update-source loopback 0
      R3(config-router)#nei 2.2.2.2 remote-as65501 nlri unicast multicast
      R3(config-router)#nei 2.2.2.2update-source loopback 0
      R3(config-router)#nei 192.168.34.4remote-as 65502 nlri unicast multicast
      R3(config-router)#exit
      R3(config)#ip pim bsr-candidate loopback10
      R3(config)#ip pim rp-candidate loopback10
      R3(config)#ip msdp peer 1.1.1.1connect-source loopback 0
      R3(config)#ip msdp peer 2.2.2.2 connect-sourceloopback 0
      R3(config)# ip msdp peer 192.168.34.4connect-source ethernet 0/1 remote-as 65502
      R3(config)#ip msdp mesh-group anycast-rp1.1.1.1
      R3(config)#ip msdp mesh-group anycast-rp2.2.2.2
      R3(config)#ip msdp originator-idloopback 0

      R4配置:
      R4#conf t
      R4(config)#ip multicast-routing
      R4(config)#int e0/0
      R4(config-if)#ip add 192.168.34.4255.255.255.0
      R4(config-if)#ip pim sparse-mode
      R4(config-if)#no sh
      R4(config-if)#exit
      R4(config)#int e0/1
      R4(config-if)#ip add 192.168.45.4255.255.255.0
      R4(config-if)#ip pim sparse-mode
      R4(config-if)#no sh
      R4(config-if)#exit
      R4(config)#int lo 0
      R4(config-if)#ip add 4.4.4.4255.255.255.255
      R4(config-if)#ip pim sparse-mode
      R4(config-if)#exit
      R4(config)#int lo 20
      R4(config-if)#ip add 20.20.20.20255.255.255.255
      R4(config-if)#ip pim sparse-mode
      R4(config-if)#exit
      R4(config)#router eigrp 1
      R4(config-router)#no au
      R4(config-router)#net 0.0.0.0 0.0.0.0
      R4(config-router)#exit
      R4(config)#router bgp 65502
      R4(config-router)#bgp router-id 4.4.4.4
      R4(config-router)#net 192.168.34.0 mask255.255.255.0
      R4(config-router)#net 192.168.45.0 mask255.255.255.0
      R4(config-router)#net 20.20.20.20 mask255.255.255.255
      R4(config-router)#nei 192.168.34.3remote-as 65501 nlri unicast multicast
      R4(config-router)#nei 5.5.5.5 remote-as65502 nlri unicast multicast
      R4(config-router)#nei 5.5.5.5update-source loopback 0
      R4(config-router)#exit
      R4(config)#ip pim rp-address 20.20.20.20
      R4(config)# ip msdp peer 192.168.34.3connect-source Ethernet 0/0 remote-as 65501
      R4(config)#ip msdp peer 5.5.5.5connect-source loopback 0
      R4(config)#ip msdp originator-idloopback 0


      R5配置:
      R5#conf t
      R5(config)#ip multicast-routing
      R5(config)#int e0/0
      R5(config-if)#ip add 192.168.45.5255.255.255.0
      R5(config-if)#ip pim sparse-mode
      R5(config-if)#no sh
      R5(config-if)#exit
      R5(config)#int e0/1
      R5(config-if)#ip add 192.168.0.1255.255.255.0
      R5(config-if)#ip pim sparse-mode
      R5(config-if)#no sh
      R5(config-if)#exit
      R5(config)#int lo 0
      R5(config-if)#ip add 5.5.5.5255.255.255.255
      R5(config-if)#ip pim sparse-mode
      R5(config-if)#exit
      R5(config)#int lo 20
      R5(config-if)#ip add 20.20.20.20255.255.255.255
      R5(config-if)#ip pim sparse-mode
      R5(config-if)#exit
      R5(config)#router eigrp 1
      R5(config-router)#no au
      R5(config-router)#net 0.0.0.0 0.0.0.0
      R5(config-router)#exit
      R5(config)#router bgp 65502
      R5(config-router)#bgp router-id 5.5.5.5
      R5(config-router)#net 192.168.45.0 mask255.255.255.0
      R5(config-router)#net 192.168.0.0 mask255.255.255.0
      R5(config-router)#nei 4.4.4.4 remote-as65502 nlri unicast multicast
      R5(config-router)#nei 4.4.4.4update-source loopback 0
      R5(config-router)#exit
      R5(config)#ip pim rp-address 20.20.20.20
      R5(config)#ip msdp peer 4.4.4.4connect-source loopback 0
      R5(config)#ip msdp originator-idloopback 0

      PC配置:
      PC#conf t
      PC(config)#no ip routing
      PC(config)#ip default-gateway192.168.0.1
      PC(config)#int e0/0
      PC(config-if)#ip add 192.168.0.2255.255.255.0
      PC(config-if)#ip igmp join-group224.1.1.1
      PC(config-if)#no sh

      此时在Server端ping 224.1.1.1 ,并调试R3和R4 变化:
      Server#ping 224.1.1.1 repeat 100

      Type escape sequence to abort.
      Sending 100, 100-byte ICMP Echos to224.1.1.1, timeout is 2 seconds:
      .
      Reply to request 1 from 192.168.0.2, 184ms
      Reply to request 2 from 192.168.0.2, 188ms
      Reply to request 3 from 192.168.0.2, 184ms


      R3#debug ip msdp  detail
      MSDP Detail debugging is on
      *Mar 1 00:02:30.503: %PIM-5-NBRCHG: neighbor 192.168.34.4 UP on interfaceEthernet0/1
      *Mar 1 00:02:30.519: %PIM-5-DRCHG: DR change from neighbor 192.168.34.3 to192.168.34.4 on interface Ethernet0/1
      *Mar 1 00:03:01.683: %BGP-5-ADJCHANGE: neighbor 192.168.34.4 Up
      *Mar 1 00:03:05.383: %MSDP-5-PEER_UPDOWN: Session to peer 192.168.34.4 goingup
      *Mar 1 00:03:07.327: MSDP(0): start_index = 0, sa_cache_index = 0, Qlen = 0
      *Mar 1 00:03:07.327: MSDP(0): Sent entire sa-cache, sa_cache_index = 0, Qlen= 0
      *Mar 1 00:03:31.071: MSDP(0): Received 3-byte TCP segment from 192.168.34.4
      *Mar 1 00:03:31.071: MSDP(0): Append 3 bytes to 0-byte msg 0 from192.168.34.4, qs 1
      *Mar 1 00:03:48.295: %PIM-5-NBRCHG: neighbor 192.168.23.2 UP on interface Ethernet0/0
      *Mar 1 00:03:56.027: %OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.2 on Ethernet0/0from LOADING to FULL, Loading Done
      *Mar 1 00:04:00.331: MSDP(0): start_index = 0, sa_cache_index = 0, Qlen = 0
      *Mar 1 00:04:00.331: MSDP(0): Sent entire sa-cache, sa_cache_index = 0, Qlen= 0
      *Mar 1 00:04:22.979: %BGP-5-ADJCHANGE: neighbor 2.2.2.2 Up
      *Mar 1 00:04:31.067: MSDP(0): Received 3-byte TCP segment from 192.168.34.4
      *Mar 1 00:04:31.067: MSDP(0): Append 3 bytes to 0-byte msg 1 from192.168.34.4, qs 1
      *Mar 1 00:04:46.851: %MSDP-5-PEER_UPDOWN: Session to peer 1.1.1.1 going up
      *Mar 1 00:04:47.715: MSDP(0): Received 3-byte TCP segment from 1.1.1.1
      *Mar 1 00:04:47.715: MSDP(0): Append 3 bytes to 0-byte msg 2 from 1.1.1.1, qs1
      *Mar 1 00:04:47.779: %MSDP-5-PEER_UPDOWN: Session to peer 2.2.2.2 going up
      *Mar 1 00:04:48.335: MSDP(0): start_index = 0, sa_cache_index = 0, Qlen = 0
      *Mar 1 00:04:48.339: MSDP(0): Sent entire sa-cache, sa_cache_index = 0, Qlen= 0
      *Mar 1 00:04:48.943: MSDP(0): Received 3-byte TCP segment from 2.2.2.2
      *Mar 1 00:04:48.947: MSDP(0): Append 3 bytes to 0-byte msg 3 from 2.2.2.2, qs1
      *Mar 1 00:04:49.343: MSDP(0): start_index = 0, sa_cache_index = 0, Qlen = 0
      *Mar 1 00:04:49.343: MSDP(0): Sent entire sa-cache, sa_cache_index = 0, Qlen= 0
      *Mar 1 00:04:51.763: %BGP-5-ADJCHANGE: neighbor 1.1.1.1 Up
      *Mar 1 00:05:00.343: MSDP(0): start_index = 0, sa_cache_index = 0, Qlen = 0
      *Mar 1 00:05:00.343: MSDP(0): Sent entire sa-cache, sa_cache_index = 0, Qlen= 0
      *Mar  1 00:05:39.539: MSDP(0): Received 120-byteTCP segment from 1.1.1.1
      *Mar  1 00:05:39.539: MSDP(0): Append 120 bytes to0-byte msg 5 from 1.1.1.1, qs 1
      *Mar  1 00:05:39.539: MSDP(0): WAVL Insert SASource 192.168.1.2 Group 224.1.1.1 RP 1.1.1.1 Successful

      R4#debugip msdp de
      MSDPDetail debugging is on
      *Mar  1 00:00:33.651: %PIM-5-NBRCHG: neighbor192.168.34.3 UP on interface Ethernet0/0
      *Mar  1 00:00:35.487: %BGP-5-ADJCHANGE: neighbor192.168.34.3 Up
      *Mar  1 00:00:39.235: %MSDP-5-PEER_UPDOWN: Sessionto peer 192.168.34.3 going up
      *Mar  1 00:00:40.175: MSDP(0): Received 3-byte TCPsegment from 192.168.34.3
      *Mar  1 00:00:40.175: MSDP(0): Append 3 bytes to0-byte msg 0 from 192.168.34.3, qs 1
      *Mar  1 00:00:40.871: MSDP(0): start_index = 0,sa_cache_index = 0, Qlen = 0
      *Mar  1 00:00:40.871: MSDP(0): Sent entiresa-cache, sa_cache_index = 0, Qlen = 0
      *Mar  1 00:01:24.255: %PIM-5-NBRCHG: neighbor192.168.45.5 UP on interface Ethernet0/1
      *Mar  1 00:01:24.271: %PIM-5-DRCHG: DR change fromneighbor 192.168.45.4 to 192.168.45.5 on interface Ethernet0/1
      *Mar  1 00:01:25.887: %DUAL-5-NBRCHANGE:IP-EIGRP(0) 1: Neighbor 192.168.45.5 (Ethernet0/1) is up: new adjacency
      *Mar  1 00:01:34.947: %MSDP-5-PEER_UPDOWN: Sessionto peer 5.5.5.5 going up
      *Mar  1 00:01:36.879: MSDP(0): start_index = 0,sa_cache_index = 0, Qlen = 0
      *Mar  1 00:01:36.879: MSDP(0): Sent entiresa-cache, sa_cache_index = 0, Qlen = 0
      *Mar  1 00:01:38.883: MSDP(0): start_index = 0,sa_cache_index = 0, Qlen = 0
      *Mar  1 00:01:38.883: MSDP(0): Sent entiresa-cache, sa_cache_index = 0, Qlen = 0
      *Mar  1 00:01:39.251: %BGP-5-ADJCHANGE: neighbor5.5.5.5 Up
      *Mar  1 00:01:40.183: MSDP(0): Received 3-byte TCPsegment from 192.168.34.3
      *Mar  1 00:01:40.183: MSDP(0): Append 3 bytes to0-byte msg 1 from 192.168.34.3, qs 1
      *Mar  1 00:02:25.027: MSDP(0): Received 3-byte TCPsegment from 5.5.5.5
      *Mar  1 00:02:25.031: MSDP(0): Append 3 bytes to0-byte msg 2 from 5.5.5.5, qs 1
      *Mar  1 00:02:29.883: MSDP(0): start_index = 0,sa_cache_index = 0, Qlen = 0
      *Mar  1 00:02:29.883: MSDP(0): Sent entiresa-cache, sa_cache_index = 0, Qlen = 0
      *Mar  1 00:02:38.883: MSDP(0): start_index = 0,sa_cache_index = 0, Qlen = 0
      *Mar  1 00:02:38.883: MSDP(0): Sent entiresa-cache, sa_cache_index = 0, Qlen = 0
      *Mar  1 00:02:40.183: MSDP(0): Received 3-byte TCPsegment from 192.168.34.3
      *Mar  1 00:02:40.183: MSDP(0): Append 3 bytes to0-byte msg 3 from 192.168.34.3, qs 1
      *Mar  1 00:03:13.379: MSDP(0): Received 120-byteTCP segment from 192.168.34.3
      *Mar  1 00:03:13.379: MSDP(0): Append 120 bytes to0-byte msg 4 from 192.168.34.3, qs 1
      *Mar  1 00:03:24.883: MSDP(0): start_index = 0,sa_cache_index = 0, Qlen = 0
      *Mar  1 00:03:24.883: MSDP(0): Sent entiresa-cache, sa_cache_index = 0, Qlen = 0
      *Mar  1 00:03:25.015: MSDP(0): Received 3-byte TCPsegment from 5.5.5.5
      *Mar  1 00:03:25.015: MSDP(0): Append 3 bytes to0-byte msg 5 from 5.5.5.5, qs 1
      *Mar  1 00:03:30.887: MSDP(0): start_index = 0,sa_cache_index = 0, Qlen = 0
      *Mar  1 00:03:30.887: MSDP(0): Sent entiresa-cache, sa_cache_index = 0, Qlen = 0
      *Mar  1 00:03:32.159: MSDP(0): Received 20-byte TCPsegment from 192.168.34.3
      *Mar  1 00:03:32.163: MSDP(0): Append 20 bytes to0-byte msg 6 from 192.168.34.3, qs 1
      *Mar  1 00:04:20.895: MSDP(0): start_index = 0,sa_cache_index = 0, Qlen = 0
      *Mar  1 00:04:25.027: MSDP(0): Received 3-byte TCPsegment from 5.5.5.5
      *Mar  1 00:04:25.031: MSDP(0): Append 3 bytes to0-byte msg 7 from 5.5.5.5, qs 1
      *Mar  1 00:04:25.899: MSDP(0): start_index = 0,sa_cache_index = 0, Qlen = 0
      *Mar  1 00:04:25.899: MSDP(0): Sent entiresa-cache, sa_cache_index = 0, Qlen = 0
      *Mar  1 00:04:29.183: MSDP(0): Received 20-byte TCPsegment from 192.168.34.3
      *Mar  1 00:04:29.187: MSDP(0): Append 20 bytes to0-byte msg 8 from 192.168.34.3, qs 1


      R4#debugip msdp de
      MSDPDetail debugging is on
      *Mar  1 00:00:33.651: %PIM-5-NBRCHG: neighbor192.168.34.3 UP on interface Ethernet0/0
      *Mar  1 00:00:35.487: %BGP-5-ADJCHANGE: neighbor192.168.34.3 Up
      *Mar  1 00:00:39.235: %MSDP-5-PEER_UPDOWN: Sessionto peer 192.168.34.3 going up
      *Mar  1 00:00:40.175: MSDP(0): Received 3-byte TCPsegment from 192.168.34.3
      *Mar  1 00:00:40.175: MSDP(0): Append 3 bytes to0-byte msg 0 from 192.168.34.3, qs 1
      *Mar  1 00:00:40.871: MSDP(0): start_index = 0,sa_cache_index = 0, Qlen = 0
      *Mar  1 00:00:40.871: MSDP(0): Sent entiresa-cache, sa_cache_index = 0, Qlen = 0
      *Mar  1 00:01:24.255: %PIM-5-NBRCHG: neighbor192.168.45.5 UP on interface Ethernet0/1
      *Mar  1 00:01:24.271: %PIM-5-DRCHG: DR change fromneighbor 192.168.45.4 to 192.168.45.5 on interface Ethernet0/1
      *Mar  1 00:01:25.887: %DUAL-5-NBRCHANGE: IP-EIGRP(0)1: Neighbor 192.168.45.5 (Ethernet0/1) is up: new adjacency
      *Mar  1 00:01:34.947: %MSDP-5-PEER_UPDOWN: Sessionto peer 5.5.5.5 going up
      *Mar  1 00:01:36.879: MSDP(0): start_index = 0,sa_cache_index = 0, Qlen = 0
      *Mar  1 00:01:36.879: MSDP(0): Sent entiresa-cache, sa_cache_index = 0, Qlen = 0
      *Mar  1 00:01:38.883: MSDP(0): start_index = 0,sa_cache_index = 0, Qlen = 0
      *Mar  1 00:01:38.883: MSDP(0): Sent entiresa-cache, sa_cache_index = 0, Qlen = 0
      *Mar  1 00:01:39.251: %BGP-5-ADJCHANGE: neighbor 5.5.5.5Up
      *Mar  1 00:01:40.183: MSDP(0): Received 3-byte TCPsegment from 192.168.34.3
      *Mar  1 00:01:40.183: MSDP(0): Append 3 bytes to0-byte msg 1 from 192.168.34.3, qs 1
      *Mar  1 00:02:25.027: MSDP(0): Received 3-byte TCPsegment from 5.5.5.5
      *Mar  1 00:02:25.031: MSDP(0): Append 3 bytes to0-byte msg 2 from 5.5.5.5, qs 1
      *Mar  1 00:02:29.883: MSDP(0): start_index = 0,sa_cache_index = 0, Qlen = 0
      *Mar  1 00:02:29.883: MSDP(0): Sent entiresa-cache, sa_cache_index = 0, Qlen = 0
      *Mar  1 00:02:38.883: MSDP(0): start_index = 0,sa_cache_index = 0, Qlen = 0
      *Mar  1 00:02:38.883: MSDP(0): Sent entiresa-cache, sa_cache_index = 0, Qlen = 0
      *Mar  1 00:02:40.183: MSDP(0): Received 3-byte TCPsegment from 192.168.34.3
      *Mar  1 00:02:40.183: MSDP(0): Append 3 bytes to0-byte msg 3 from 192.168.34.3, qs 1
      *Mar  1 00:03:13.379: MSDP(0): Received 120-byteTCP segment from 192.168.34.3
      *Mar  1 00:03:13.379: MSDP(0): Append 120 bytes to0-byte msg 4 from 192.168.34.3, qs 1
      *Mar  1 00:03:24.883: MSDP(0): start_index = 0, sa_cache_index= 0, Qlen = 0
      *Mar  1 00:03:24.883: MSDP(0): Sent entiresa-cache, sa_cache_index = 0, Qlen = 0
      *Mar  1 00:03:25.015: MSDP(0): Received 3-byte TCPsegment from 5.5.5.5
      *Mar  1 00:03:25.015: MSDP(0): Append 3 bytes to0-byte msg 5 from 5.5.5.5, qs 1
      *Mar  1 00:03:30.887: MSDP(0): start_index = 0,sa_cache_index = 0, Qlen = 0
      *Mar  1 00:03:30.887: MSDP(0): Sent entiresa-cache, sa_cache_index = 0, Qlen = 0
      *Mar  1 00:03:32.159: MSDP(0): Received 20-byte TCPsegment from 192.168.34.3
      *Mar  1 00:03:32.163: MSDP(0): Append 20 bytes to0-byte msg 6 from 192.168.34.3, qs 1
      *Mar  1 00:04:20.895: MSDP(0): start_index = 0,sa_cache_index = 0, Qlen = 0
      *Mar  1 00:04:20.895: MSDP(0): Sent entiresa-cache, sa_cache_index = 0, Qlen = 0
      *Mar  1 00:04:25.027: MSDP(0): Received 3-byte TCPsegment from 5.5.5.5
      *Mar  1 00:04:25.031: MSDP(0): Append 3 bytes to0-byte msg 7 from 5.5.5.5, qs 1
      *Mar  1 00:04:25.899: MSDP(0): start_index = 0,sa_cache_index = 0, Qlen = 0
      *Mar  1 00:04:25.899: MSDP(0): Sent entire sa-cache,sa_cache_index = 0, Qlen = 0
      *Mar  1 00:04:29.183: MSDP(0): Received 20-byte TCPsegment from 192.168.34.3
      *Mar  1 00:04:29.187: MSDP(0): Append 20 bytes to0-byte msg 8 from 192.168.34.3, qs 1
      *Mar  1 00:05:20.903: MSDP(0): start_index = 0,sa_cache_index = 0, Qlen = 0
      *Mar  1 00:05:20.903: MSDP(0): Sent entiresa-cache, sa_cache_index = 0, Qlen = 0
      *Mar  1 00:05:23.903: MSDP(0): start_index = 0,sa_cache_index = 0, Qlen = 0
      *Mar  1 00:05:23.903: MSDP(0): Sent entiresa-cache, sa_cache_index = 0, Qlen = 0
      *Mar  1 00:05:24.999: MSDP(0): Received 3-byte TCPsegment from 5.5.5.5
      *Mar  1 00:05:25.003: MSDP(0): Append 3 bytes to0-byte msg 9 from 5.5.5.5, qs 1
      *Mar  1 00:05:28.207: MSDP(0): Received 20-byte TCPsegment from 192.168.34.3
      *Mar  1 00:05:28.207: MSDP(0): Append 20 bytes to0-byte msg 10 from 192.168.34.3, qs 1

      查看R3和R4的多播路由表
      R3#sh ip mroute
      IP Multicast Routing Table
      Flags: D - Dense, S - Sparse, B - BidirGroup, s - SSM Group, C - Connected,
            L - Local, P - Pruned, R - RP-bit set, F - Register flag,
            T - SPT-bit set, J - Join SPT, M - MSDP created entry,
            X - Proxy Join Timer Running, A - Candidate for MSDP Advertisement,
            U - URD, I - Received Source Specific Host Report,
            Z - Multicast Tunnel, z - MDT-data group sender,
            Y - Joined MDT-data group, y - Sending to MDT-data group
      Outgoing interface flags: H - Hardwareswitched, A - Assert winner
      Timers: Uptime/Expires
      Interface state: Interface, Next-Hop or VCD,State/Mode

      (*, 224.1.1.1),00:07:34/00:02:46, RP 10.10.10.10, flags: S
        Incoming interface: Ethernet0/0, RPF nbr192.168.23.2
        Outgoing interface list:
          Ethernet0/1, Forward/Sparse,00:07:34/00:02:46

      (192.168.1.2,224.1.1.1), 00:06:45/00:00:09, flags: T
        Incoming interface: Ethernet0/0, RPF nbr192.168.23.2
        Outgoing interface list:
          Ethernet0/1, Forward/Sparse,00:06:45/00:02:46

      (*, 224.0.1.40), 00:12:22/00:02:37, RP0.0.0.0, flags: DCL
      Incoming interface: Null, RPF nbr 0.0.0.0
      Outgoing interface list:
         Loopback0, Forward/Sparse, 00:12:22/00:02:37


      R4#sh ip mroute
      IP Multicast Routing Table
      Flags: D - Dense, S - Sparse, B - BidirGroup, s - SSM Group, C - Connected,
            L - Local, P - Pruned, R - RP-bit set, F - Register flag,
            T - SPT-bit set, J - Join SPT, M - MSDP created entry,
            X - Proxy Join Timer Running, A - Candidate for MSDP Advertisement,
            U - URD, I - Received Source Specific Host Report,
            Z - Multicast Tunnel, z - MDT-data group sender,
            Y - Joined MDT-data group, y - Sending to MDT-data group
      Outgoing interface flags: H - Hardwareswitched, A - Assert winner
      Timers: Uptime/Expires
      Interface state: Interface, Next-Hop or VCD,State/Mode

      (*, 224.1.1.1),00:08:08/00:03:15, RP 10.10.10.10, flags: S
        Incoming interface: Ethernet0/0, RPF nbr192.168.34.3
        Outgoing interface list:
          Ethernet0/1, Forward/Sparse,00:08:08/00:03:15

      (*, 224.0.1.40), 00:10:28/00:02:35, RP0.0.0.0, flags: DCL
      Incoming interface: Null, RPF nbr 0.0.0.0
      Outgoing interface list:
         Loopback0, Forward/Sparse, 00:10:28/00:02:35



运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-27136-1-1.html 上篇帖子: CCNP路由实验之九 路由策略 下篇帖子: CCNP路由实验之十一 IPv6 CCNP
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表