【思唯网络学院】组播路由管理(IPv4)理论知识详解(一)
首页 > >   作者:浙江思唯网络  2020年2月13日 18:12 星期四  字号:   评论:0 条
时间:2020-2-13 18:12   评论:0 条 
<p class="MsoNormal">
六、组播路由管理(IPv4)
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
组播路由管理(<span>Multicast
Route Management</span>)主要介绍如何创建或更改组播路由来控制组播报文的转发,以及组播转发路径的检测和维护。
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
组播路由和转发与单播路由和转发类似,首先每个组播路由协议都各自建立并维护了一张协议路由表。各组播路由协议的组播路由信息经过综合形成一个总的组播路由表(<span>Multicast Routing-Table</span>)。
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
最后,路由器根据组播路由和转发策略,从组播路由表中选出最优的组播路由,并下发到组播转发表(<span>Multicast Forwarding-Table</span>),直接用于控制组播数据的转发。
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
通过组播转发表,整个网络建立了一条以组播源为根,组成员为叶子的一点到多点的转发路径。
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
为了实现转发路径的控制与维护,组播路由管理提供了一系列如下表<span>1</span>所示的特性。
</p>
<table class="MsoNormalTable" border="1" cellspacing="0" cellpadding="0" width="86%" style="width:86.68%;">
<tbody>
<tr>
<td width="100%" colspan="2" style="border:none;">
<p class="MsoNormal">
<a name="dc_fd_mrm_0002_1__tab_01"></a><span style="font-family:宋体;">表</span><span>1&nbsp;</span><span style="font-family:宋体;">组播路由管理特性</span>
</p>
</td>
</tr>
<tr>
<td width="37%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">特性</span><span></span>
</p>
</td>
<td width="62%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">功能</span><span></span>
</p>
</td>
</tr>
</tbody>
<tbody>
<tr>
<td width="37%" valign="top">
<p class="MsoNormal">
<span>RPF</span><span style="font-family:宋体;">(</span><span>Reverse Path
  Forwarding</span><span style="font-family:宋体;">)检查</span>
</p>
</td>
<td width="62%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">用于保证组播数据沿正确的转发路径进行传输。</span>
</p>
</td>
</tr>
<tr>
<td width="37%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">组播静态路由</span>
</p>
</td>
<td width="62%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">用于改变或衔接组播</span><span>RPF</span><span style="font-family:宋体;">路由。</span>
</p>
</td>
</tr>
<tr>
<td width="37%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">组播负载分担</span>
</p>
</td>
<td width="62%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">用于选取不同的等价路由进行组播数据转发,分流组播数据。</span>
</p>
</td>
</tr>
<tr>
<td width="37%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">组播</span><span>Ping</span>
</p>
</td>
<td width="62%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">用于检测网络中的保留组成员。</span>
</p>
</td>
</tr>
<tr>
<td width="37%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">组播</span><span>Tracert</span>
</p>
</td>
<td width="62%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">用于沿着组播转发树追踪某一接收者。</span>
</p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal">
<b><span>&nbsp;</span></b>
</p>
<p class="MsoNormal" style="text-indent:20.6pt;">
组播网络中设备根据扮演的不同角色,分别需要维护<span>5</span>种不同类型的表项:<span>IGMP</span>组表项、<span>IGMP</span>路由表、组播协议路由表、组播路由表、组播转发表。下面介绍各表项信息在实现组播路由和转发中所起的作用。
</p>
<p class="MsoNormal">
<b><span>&nbsp; &nbsp; &nbsp; &nbsp;1</span></b><b>、组播<span>IGMP</span></b><b>组和路由表<span></span></b>
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
<span>IGMP</span>组表项是由用户主机发送的<span>IGMP</span>加入报文触发创建的,用于维护组加入信息并通知组播路由协议(通常所说的为<span>PIM</span>协议)创建相应<span>(*,G)</span>表项。只要设备接口使能了<span>IGMP</span>并收到组加入报文就会为每个接口维护一个组加入信息表项,组表项形式如下所示:
</p>
<p class="MsoNormal">
<span>&lt;HUAWEI&gt; <b>display igmp group</b></span>
</p>
<p class="MsoNormal">
<span>Interface group report information of
VPN-Instance: public net</span>
</p>
<p class="MsoNormal">
<span>&nbsp;Vlanif100(10.1.6.2):</span>
</p>
<p class="MsoNormal">
<span>&nbsp;
Total 1 IGMP Group reported</span>
</p>
<p class="MsoNormal">
<span>&nbsp;&nbsp;
Group Address&nbsp;&nbsp; Last Reporter&nbsp;&nbsp; Uptime&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Expires</span>
</p>
<p class="MsoNormal">
<span>&nbsp;&nbsp;
225.1.1.2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 10.1.6.10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 00:02:04&nbsp;&nbsp;&nbsp; 00:01:17</span>
</p>
<p class="MsoNormal">
<span>IGMP</span>组表项中主要字段含义如下表<span>1</span>所示:
</p>
<table class="MsoNormalTable" border="1" cellspacing="0" cellpadding="0" width="53%" style="width:53.56%;">
<tbody>
<tr>
<td width="100%" colspan="2" style="border:none;">
<p class="MsoNormal">
<a name="dc_fd_mrm_0010_1__tab_01"></a><span style="font-family:宋体;">表</span><span>1&nbsp;</span><span>IGMP</span><span style="font-family:宋体;">组表项主要字段含义</span>
</p>
</td>
</tr>
<tr>
<td width="28%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">字段</span><span></span>
</p>
</td>
<td width="71%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">含义</span><span></span>
</p>
</td>
</tr>
</tbody>
<tbody>
<tr>
<td width="28%" valign="top">
<p class="MsoNormal">
<span>Group Address</span>
</p>
</td>
<td width="71%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">加入的组地址。</span>
</p>
</td>
</tr>
<tr>
<td width="28%" valign="top">
<p class="MsoNormal">
<span>Last Reporter</span>
</p>
</td>
<td width="71%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">最后发送组加入用户的地址。</span>
</p>
</td>
</tr>
<tr>
<td width="28%" valign="top">
<p class="MsoNormal">
<span>Uptime</span>
</p>
</td>
<td width="71%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">组更新时间,表示组已经创建了多长时间。</span>
</p>
</td>
</tr>
<tr>
<td width="28%" valign="top">
<p class="MsoNormal">
<span>Expires</span>
</p>
</td>
<td width="71%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">组老化时间,表示组老化的时间。</span>
</p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="text-indent:21.0pt;">
而<span>IGMP</span>路由表也是由<span>IGMP</span>协议维护的,但它只有在接口没有使能<span>PIM</span>协议才会存在。它的作用主要是用来扩展组播路由表项的出接口。<span>IGMP</span>路由表项形式如下:
</p>
<p class="MsoNormal">
<span>&lt;HUAWEI&gt; <b>display igmp
routing-table</b></span>
</p>
<p class="MsoNormal">
<span>Routing table of VPN-Instance: public
net&nbsp; </span>
</p>
<p class="MsoNormal">
<span>&nbsp;Total 1 entries&nbsp;&nbsp;&nbsp; </span>
</p>
<p class="MsoNormal">
<span>&nbsp;&nbsp;&nbsp;&nbsp; </span>
</p>
<p class="MsoNormal">
<span>&nbsp;00001. (*, 225.1.1.1)&nbsp; </span>
</p>
<p class="MsoNormal">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
List of 1 downstream interface&nbsp;&nbsp; </span>
</p>
<p class="MsoNormal">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Vlanif100 (10.20.20.1)&nbsp;&nbsp; </span>
</p>
<p class="MsoNormal">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Protocol: IGMP&nbsp; </span>
</p>
<p class="MsoNormal">
<span>IGMP</span>路由表项中主要字段含义如下表<span>2</span>所示:
</p>
<table class="MsoNormalTable" border="1" cellspacing="0" cellpadding="0" width="54%" style="width:54.88%;">
<tbody>
<tr>
<td width="100%" colspan="2" style="border:none;">
<p class="MsoNormal">
<a name="dc_fd_mrm_0010_1__tab_02"></a><span style="font-family:宋体;">表</span><span>2&nbsp;</span><span>IGMP</span><span style="font-family:宋体;">路由表项主要字段含义</span>
</p>
</td>
</tr>
<tr>
<td width="46%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">字段</span><span></span>
</p>
</td>
<td width="53%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">含义</span><span></span>
</p>
</td>
</tr>
</tbody>
<tbody>
<tr>
<td width="46%" valign="top">
<p class="MsoNormal">
<span>00001. (*, 225.1.1.1)</span>
</p>
</td>
<td width="53%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">第</span><span>00001</span><span style="font-family:宋体;">号表项,是</span><span>(*, G)</span><span style="font-family:宋体;">形式。</span>
</p>
</td>
</tr>
<tr>
<td width="46%" valign="top">
<p class="MsoNormal">
<span>List of 1 downstream interface</span>
</p>
</td>
<td width="53%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">下游接口列表。</span>
</p>
</td>
</tr>
<tr>
<td width="46%" valign="top">
<p class="MsoNormal">
<span>Protocol: IGMP</span>
</p>
</td>
<td width="53%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">生成下游接口的协议类型。</span>
</p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="text-indent:21.0pt;">
从上面可以看出,生成出接口的协议类型为<span>IGMP</span>,表明当前接口没有使能<span>PIM</span>协议。如果使能了<span>PIM</span>协议,则以<span>PIM</span>协议优先。
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
<span>&nbsp;</span>
</p>
<p class="MsoNormal">
<b><span>&nbsp; &nbsp; &nbsp; &nbsp;2</span></b><b>、组播协议路由表<span></span></b>
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
组播协议路由表是运行各种组播路由协议时由各个协议自己维护的表项,是组播路由和转发的基础。现在应用最广泛的组播路由协议为<span>PIM</span>协议。<span>PIM</span>路由表项信息如下:
</p>
<p class="MsoNormal">
<span>&lt;HUAWEI&gt; <b>display pim routing-table</b></span>
</p>
<p class="MsoNormal">
<span>&nbsp;VPN-Instance: public net</span>
</p>
<p class="MsoNormal">
<span>&nbsp;Total 0 (*, G) entry; 1 (S, G) entry</span>
</p>
<p class="MsoNormal">
<span>&nbsp;</span>
</p>
<p class="MsoNormal">
<span>&nbsp;(192.168.0.12, 227.0.0.1)</span>
</p>
<p class="MsoNormal">
<span>&nbsp;&nbsp;&nbsp;&nbsp;
RP: 10.2.2.2</span>
</p>
<p class="MsoNormal">
<span>&nbsp;&nbsp;&nbsp;&nbsp;
Protocol: pim-sm, Flag: SPT LOC ACT</span>
</p>
<p class="MsoNormal">
<span>&nbsp;&nbsp;&nbsp;&nbsp;
UpTime: 02:54:43</span>
</p>
<p class="MsoNormal">
<span>&nbsp;&nbsp;&nbsp;&nbsp;
Upstream interface: Vlanif 10</span>
</p>
<p class="MsoNormal">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Upstream neighbor: NULL</span>
</p>
<p class="MsoNormal">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
RPF prime neighbor: NULL</span>
</p>
<p class="MsoNormal">
<span>&nbsp;&nbsp;&nbsp;&nbsp;
Downstream interface(s) information:</span>
</p>
<p class="MsoNormal">
<span>&nbsp;&nbsp;&nbsp;&nbsp;
Total number of downstreams: 1</span>
</p>
<p class="MsoNormal">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1: Vlanif 20</span>
</p>
<p class="MsoNormal">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Protocol: pim-sm, UpTime: 02:54:43, Expires: 00:02:47</span>
</p>
<p class="MsoNormal">
<span>PIM</span>路由表项中主要字段含义如下表<span>3</span>所示:
</p>
<table class="MsoNormalTable" border="1" cellspacing="0" cellpadding="0" width="100%" style="width:100.0%;">
<tbody>
<tr>
<td width="100%" colspan="2" style="border:none;">
<p class="MsoNormal">
<a name="dc_fd_mrm_0010_1__tab_03"></a><a name="tab_03"></a><span style="font-family:宋体;">表</span><span>3&nbsp;</span><span>PIM</span><span style="font-family:宋体;">路由表项主要字段含义</span>
</p>
</td>
</tr>
<tr>
<td width="25%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">字段</span><span></span>
</p>
</td>
<td width="74%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">含义</span><span></span>
</p>
</td>
</tr>
</tbody>
<tbody>
<tr>
<td width="25%" valign="top">
<p class="MsoNormal">
<span>(192.168.0.12, 227.0.0.1)</span>
</p>
</td>
<td width="74%" valign="top">
<p class="MsoNormal">
<span>(S, G)</span><span style="font-family:宋体;">表项。</span>
</p>
</td>
</tr>
<tr>
<td width="25%" valign="top">
<p class="MsoNormal">
<span>RP: 10.2.2.2</span>
</p>
</td>
<td width="74%" valign="top">
<p class="MsoNormal">
<span>RP</span><span style="font-family:宋体;">地址,只有协议类型为</span><span>PIM-SM</span><span style="font-family:宋体;">时才会有此显示信息。</span>
</p>
</td>
</tr>
<tr>
<td width="25%" valign="top">
<p class="MsoNormal">
<span>Protocol: pim-sm</span>
</p>
</td>
<td width="74%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">协议类型。</span>
</p>
<p class="MsoNormal">
<span style="font-family:宋体;">第一个</span><span>Protocol</span><span style="font-family:宋体;">表示生成表项的协议类型,第二个</span><span>Protocol</span><span style="font-family:宋体;">表示生成下游接口的协议类型。</span>
</p>
</td>
</tr>
<tr>
<td width="25%" valign="top">
<p class="MsoNormal">
<span>Flag: SPT LOC ACT</span>
</p>
</td>
<td width="74%" valign="top">
<p class="MsoNormal">
<span>PIM</span><span style="font-family:宋体;">路由表项的标志。</span>
</p>
</td>
</tr>
<tr>
<td width="25%" valign="top">
<p class="MsoNormal">
<span>UpTime: 02:54:43</span>
</p>
</td>
<td width="74%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">存在时间。</span>
</p>
<p class="MsoNormal">
<span style="font-family:宋体;">第一个</span><span>UpTime</span><span style="font-family:宋体;">表示表项已存在的时间,第二个</span><span>UpTime</span><span style="font-family:宋体;">表示下游接口已存在的时间。</span>
</p>
</td>
</tr>
<tr>
<td width="25%" valign="top">
<p class="MsoNormal">
<span>Upstream interface:&nbsp;Vlanif 10</span>
</p>
</td>
<td width="74%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">上游接口。</span>
</p>
</td>
</tr>
<tr>
<td width="25%" valign="top">
<p class="MsoNormal">
<span>Upstream neighbor: NULL</span>
</p>
</td>
<td width="74%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">上游邻居。</span>
</p>
<p class="MsoNormal">
<span>NULL</span><span style="font-family:宋体;">表示不存在上游邻居。</span>
</p>
</td>
</tr>
<tr>
<td width="25%" valign="top">
<p class="MsoNormal">
<span>RPF prime neighbor: NULL</span>
</p>
</td>
<td width="74%" valign="top">
<p class="MsoNormal">
<span>RPF</span><span style="font-family:宋体;">邻居。</span>
</p>
<p class="MsoNormal">
<span>NULL</span><span style="font-family:宋体;">表示不存在</span><span>RPF</span><span style="font-family:宋体;">邻居。</span>
</p>
</td>
</tr>
<tr>
<td width="25%" valign="top">
<p class="MsoNormal">
<span>Downstream interface(s) information:</span>
</p>
</td>
<td width="74%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">下游接口信息。</span>
</p>
</td>
</tr>
<tr>
<td width="25%" valign="top">
<p class="MsoNormal">
<span>Total number of downstreams: 1</span>
</p>
</td>
<td width="74%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">下游接口数量。</span>
</p>
</td>
</tr>
<tr>
<td width="25%" valign="top">
<p class="MsoNormal">
<span>Expires: 00:02:47</span>
</p>
</td>
<td width="74%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">下游接口老化时间。</span>
</p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal">
<span>&nbsp;</span>
</p>
<p class="MsoNormal">
<span>&nbsp; &nbsp; &nbsp; &nbsp;3</span>、<b>组播路由表</b><b><span></span></b>
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
组播路由表是组播路由管理模块生成的路由表。如果组播路由管理支持多种组播协议,那这里应该能看到多种协议生成的优选出的路由信息。比较类似于单播中同时运行<span>OSPF</span>、<span>RIP</span>、<span>BGP</span>多种路由协议时,然后汇总形成的<span>IP</span>路由表。组播路由表的主要功能就是下刷创建组播转发表。组播路由表项信息如下:
</p>
<p class="MsoNormal">
<span>&lt;HUAWEI&gt; <b>display multicast
routing-table</b></span>
</p>
<p class="MsoNormal">
<span>Multicast routing table of VPN-Instance:
public net</span>
</p>
<p class="MsoNormal">
<span>&nbsp;Total 1 entry</span>
</p>
<p class="MsoNormal">
<span>&nbsp;00001. (192.168.0.2, 227.0.0.1)</span>
</p>
<p class="MsoNormal">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Uptime: 00:00:28</span>
</p>
<p class="MsoNormal">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Upstream Interface: Vlanif10</span>
</p>
<p class="MsoNormal">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
List of 2 downstream interfaces</span>
</p>
<p class="MsoNormal">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1:&nbsp; Vlanif20</span>
</p>
<p class="MsoNormal">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
2:&nbsp; Vlanif30</span>
</p>
<p class="MsoNormal">
组播路由表项中主要字段含义如下表<span>4</span>所示:
</p>
<table class="MsoNormalTable" border="1" cellspacing="0" cellpadding="0" width="57%" style="width:57.54%;">
<tbody>
<tr>
<td width="100%" colspan="2" style="border:none;">
<p class="MsoNormal">
<a name="dc_fd_mrm_0010_1__tab_04"></a><a name="tab_04"></a><span style="font-family:宋体;">表</span><span>4&nbsp;</span><span style="font-family:宋体;">组播路由表项主要字段含义</span>
</p>
</td>
</tr>
<tr>
<td width="49%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">字段</span><span></span>
</p>
</td>
<td width="50%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">含义</span><span></span>
</p>
</td>
</tr>
</tbody>
<tbody>
<tr>
<td width="49%" valign="top">
<p class="MsoNormal">
<span>00001.(192.168.0.2, 227.0.0.1)</span>
</p>
</td>
<td width="50%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">第</span><span>00001</span><span style="font-family:宋体;">号表项,是</span><span>(S, G)</span><span style="font-family:宋体;">形式。</span>
</p>
</td>
</tr>
<tr>
<td width="49%" valign="top">
<p class="MsoNormal">
<span>Uptime: 00:00:28</span>
</p>
</td>
<td width="50%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">组播路由表项更新时间。</span>
</p>
</td>
</tr>
<tr>
<td width="49%" valign="top">
<p class="MsoNormal">
<span>Upstream Interface:&nbsp;Vlanif10</span>
</p>
</td>
<td width="50%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">上游接口。</span>
</p>
</td>
</tr>
<tr>
<td width="49%" valign="top">
<p class="MsoNormal">
<span>List of 2 downstream interfaces</span>
</p>
</td>
<td width="50%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">下游接口列表。</span>
</p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal">
<b><span>&nbsp;</span></b>
</p>
<p class="MsoNormal">
<b><span>&nbsp; &nbsp; &nbsp; &nbsp;4</span></b><b>、组播转发表<span></span></b>
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
组播转发表是路由管理模块依据组播路由表信息生成的用于指导组播数据实际转发的表项,通常称为<span>MFIB</span>,通过<b><span>display multicast forwarding-table</span></b>可以查看到这类表项信息。这张表项与单播中<span>FIB</span>表的功能是一样的,用于指导组播数据转发。组播转发表项信息如下:
</p>
<p class="MsoNormal">
<span>&lt;HUAWEI&gt; <b>display multicast
forwarding-table</b></span>
</p>
<p class="MsoNormal">
<span>Multicast Forwarding Table of VPN-Instance:
public net</span>
</p>
<p class="MsoNormal">
<span>Total 1 entry, 1 matched</span>
</p>
<p class="MsoNormal">
<span>&nbsp;</span>
</p>
<p class="MsoNormal">
<span>00001. (10.10.10.2, 225.0.0.1)</span>
</p>
<p class="MsoNormal">
<span>&nbsp;&nbsp;&nbsp;&nbsp;
MID: 10, Flags: ACT</span>
</p>
<p class="MsoNormal">
<span>&nbsp;&nbsp;&nbsp;&nbsp;
Uptime: 00:08:32, Timeout in: 00:03:26</span>
</p>
<p class="MsoNormal">
<span>&nbsp;&nbsp;&nbsp;&nbsp;
Incoming interface: Vlanif10</span>
</p>
<p class="MsoNormal">
<span>&nbsp;&nbsp;&nbsp;&nbsp;
List of 1 outgoing interfaces:</span>
</p>
<p class="MsoNormal">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1:&nbsp; Vlanif20</span>
</p>
<p class="MsoNormal">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Activetime: 00:23:15</span>
</p>
<p class="MsoNormal">
<span>&nbsp;&nbsp;&nbsp;&nbsp;
Matched 38264 packets(1071392 bytes), Wrong If 0 packets</span>
</p>
<p class="MsoNormal">
<span>&nbsp;&nbsp;&nbsp;&nbsp;
Forwarded 38264 packets(1071392 bytes)</span>
</p>
<p class="MsoNormal">
组播转发表项中主要字段含义如下表<span>5</span>所示:
</p>
<table class="MsoNormalTable" border="1" cellspacing="0" cellpadding="0" width="93%" style="width:93.3%;">
<tbody>
<tr>
<td width="100%" colspan="2" style="border:none;">
<p class="MsoNormal">
<a name="dc_fd_mrm_0010_1__tab_05"></a><a name="tab_05"></a><span style="font-family:宋体;">表</span><span>5&nbsp;</span><span style="font-family:宋体;">组播转发表项主要字段含义</span>
</p>
</td>
</tr>
<tr>
<td width="37%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">字段</span><span></span>
</p>
</td>
<td width="62%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">含义</span><span></span>
</p>
</td>
</tr>
</tbody>
<tbody>
<tr>
<td width="37%" valign="top">
<p class="MsoNormal">
<span>00001. (10.10.10.2, 225.0.0.1)</span>
</p>
</td>
<td width="62%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">第</span><span>00001</span><span style="font-family:宋体;">号表项,是</span><span>(S, G)</span><span style="font-family:宋体;">形式。</span>
</p>
</td>
</tr>
<tr>
<td width="37%" valign="top">
<p class="MsoNormal">
<span>MID: 10</span>
</p>
</td>
<td width="62%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">组播转发表项在</span><span>MFIB</span><span style="font-family:宋体;">表中的唯一标识,用于快速检索组播转发表。</span>
</p>
</td>
</tr>
<tr>
<td width="37%" valign="top">
<p class="MsoNormal">
<span>Flags: ACT</span>
</p>
</td>
<td width="62%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">组播转发表项的标志。</span>
</p>
</td>
</tr>
<tr>
<td width="37%" valign="top">
<p class="MsoNormal">
<span>Uptime: 00:08:32</span>
</p>
</td>
<td width="62%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">组播转发表项已存在的时间。</span>
</p>
</td>
</tr>
<tr>
<td width="37%" valign="top">
<p class="MsoNormal">
<span>Timeout in: 00:03:26</span>
</p>
</td>
<td width="62%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">组播转发表项超时时间。</span>
</p>
</td>
</tr>
<tr>
<td width="37%" valign="top">
<p class="MsoNormal">
<span>Incoming interface:&nbsp;Vlanif10</span>
</p>
</td>
<td width="62%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">表项入接口。</span>
</p>
</td>
</tr>
<tr>
<td width="37%" valign="top">
<p class="MsoNormal">
<span>List of 1 outgoing interfaces:</span>
</p>
</td>
<td width="62%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">表项出接口列表。</span>
</p>
</td>
</tr>
<tr>
<td width="37%" valign="top">
<p class="MsoNormal">
<span>Activetime: 00:23:15</span>
</p>
</td>
<td width="62%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">出接口已存在时间。</span>
</p>
</td>
</tr>
<tr>
<td width="37%" valign="top">
<p class="MsoNormal">
<span>Matched 38264 packets(1071392 bytes)</span>
</p>
</td>
<td width="62%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">匹配该表项的报文数目。</span>
</p>
</td>
</tr>
<tr>
<td width="37%" valign="top">
<p class="MsoNormal">
<span>Wrong If 0 packets</span>
</p>
</td>
<td width="62%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">从错误接口进入的报文数目。</span>
</p>
</td>
</tr>
<tr>
<td width="37%" valign="top">
<p class="MsoNormal">
<span>Forwarded 38264 packets(1071392 bytes)</span>
</p>
</td>
<td width="62%" valign="top">
<p class="MsoNormal">
<span style="font-family:宋体;">已转发的报文数目。</span>
</p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="text-indent:21.0pt;">
从上面可以看出,真正指导组播数据转发的是组播转发表,转发表项中概括性记录了报文转发的统计信息。
</p>
<p class="MsoNormal">
<span>&nbsp;</span>
</p>
<p class="MsoNormal">
<b><span>&nbsp; &nbsp; &nbsp; &nbsp;5</span></b><b>、组播<span>RPF</span></b><b>检查<span></span></b>
</p>
<p class="MsoNormal" style="text-indent:20.6pt;">
<span>1</span>、<span>RPF</span>基本原理<span></span>
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
在单播路由与转发中,单播报文沿着一条单点到单点的路径传输,路由器只需要考虑报文“需要到达的位置”,即目的地址,就知道从哪个接口转发出去。
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
组播路由与转发则不同。由于组播报文的目的地址为组播地址,只是标识了一组接收者,无法通过目的地址来找到接收者的位置,但是组播报文的“来源位置”,即源地址是确定的。
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
所以组播报文的转发主要是根据其源地址来保证转发路径正确性。
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
路由器收到一份组播报文后,会根据报文的源地址通过单播路由表查找到达“报文源”的路由,查看到“报文源”的路由表项的出接口是否与收到组播报文的入接口一致。如果一致,则认为该组播报文从正确的接口到达,从而保证了整个转发路径的正确性和唯一性。
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
这个过程就被称为<span>RPF</span>检查。
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
这里“正确的接口”通常被称为<span>RPF</span>接口,即<span>RPF</span>检查通过的接口。
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
<span>&nbsp;</span>
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
<span>2</span>、<span>RPF</span>检查过程<span></span>
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
除单播路由外,<span>MBGP</span>路由、组播静态路由也是<span>RPF</span>检查的依据。当路由器收到一份组播报文后,如果这三种路由表都存在,具体检查过程如下:
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
首先,通过报文源地址,分别从单播路由表、<span>MBGP</span>路由表和组播静态路由表中各选出一条最优路由。单播路由、<span>MBGP</span>路由的出接口为<span>RPF</span>接口,下一跳为<span>RPF</span>邻居。需要注意的是,组播静态路由实际上属于手工配置的组播路由,已经明确指定了<span>RPF</span>接口与<span>RPF</span>邻居。
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
然后,根据以下原则从这三条最优路由中选择一条作为<span>RPF</span>路由。
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
如果配置了按照最长匹配选择路由,则从这三条路由中选出最长匹配的那条路由;如果这三条路由的掩码一样,则选择优先级最高的那条路由;如果它们的优先级也相同,则按照组播静态路由、<span>MBGP</span>路由、单播路由的顺序进行选择。
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
如果没有配置按照最长匹配选择路由,则从这三条路由中选出优先级最高的那条路由;如果它们的优先级相同,则按照组播静态路由、<span>MBGP</span>路由、单播路由的顺序进行选择。
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
最后,路由器会将报文的入接口与<span>RPF</span>路由的<span>RPF</span>接口进行比较。如果一致则<span>RPF</span>检查通过,表明该报文来源路径正确,会将其向下游转发;如果不一致即<span>RPF</span>检查失败,表明该报文来源路径错误,就将其丢弃。
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
<a target="_blank" href="http://www.023wg.com/content/uploadfile/201603/c19b1459224802.png" id="ematt:456"><img src="http://www.023wg.com/content/uploadfile/201603/c19b1459224802.png" title="点击查看原图" alt="RPF检查失败示例.png" border="0" width="326" height="179" /></a>
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
<p class="MsoNormal" style="text-indent:52.5pt;">
图<span>1 RPF</span>检查失败示例
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
如上图<span>1</span>所示,来自组播源<span>10.10.2.2</span>的组播流从<span>Int1</span>口到达路由器,路由器检查路由表,发现可以转发该组播流的端口为<span>Int0</span>,<span>RPF</span>检查失败。因此达到<span>Int1</span>口的数据流被丢弃。
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
<a target="_blank" href="http://www.023wg.com/content/uploadfile/201603/c3f31459224802.png" id="ematt:455"><img src="http://www.023wg.com/content/uploadfile/201603/c3f31459224802.png" title="点击查看原图" alt="RPF检查成功示例.png" border="0" width="322" height="179" /></a>
</p>
<p class="MsoNormal" style="text-indent:63.0pt;">
图<span>2 RPF</span>检查成功示例
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
<a name="dc_fd_mrm_0005_1__fig_dc_fd_mrm_000501"></a><a name="fig_dc_fd_mrm_000501"></a>上图<span>2</span>中,来自组播源<span>10.10.2.2</span>的组播流从<span>Int0</span>口达到路由器,检查路由表发现入接口与接收该组播流的接口<span>Int0</span>一致,<span>RPF</span>检查成功。因此组播流将被正确的转发。
</p>
<p class="MsoNormal">
<a name="dc_fd_mrm_0005_1__fig_dc_fd_mrm_000502"></a><a name="fig_dc_fd_mrm_000502"></a><span>&nbsp;</span>
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
<span>3</span>、<span>RPF</span>检查在组播数据转发中的应用<span></span>
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
组播路由协议通过已有的单播路由、<span>MBGP</span>路由或组播静态路由信息来确定上、下游邻居设备,创建组播路由表项。
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
运用<span>RPF</span>检查机制,来确保组播数据流能够沿组播分发树(路径)正确的传输,同时可以避免转发路径上环路的产生。
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
在实际组播数据转发过程中,如果对每一份接收到的组播数据报文都通过单播路由表进行<span>RPF</span>检查,会给路由器带来很大负担。
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
因此,路由器在收到一份来自源<span>S</span>发往组<span>G</span>的组播数据报文之后,首先会在组播转发表中查找有无相应的(<span>S</span>,<span>G</span>)组播转发表项:
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
如果不存在(<span>S</span>,<span>G</span>)转发表项,则对该报文执行<span>RPF</span>检查,将检查到的<span>RPF</span>接口作为入接口,创建组播路由表项,下发到组播转发表中。
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
其中,对<span>RPF</span>检查结果的处理方式为:如果检查通过,表明接收接口为<span>RPF</span>接口,向转发表项的所有出接口转发;如果检查失败,表明报文来源路径错误,丢弃该报文。
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
如果存在(<span>S</span>,<span>G</span>)转发表项,并且接收该报文的接口与转发表项的入接口一致,则向所有的出接口转发该报文。
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
如果存在(<span>S</span>,<span>G</span>)转发表项,但是接收该报文的接口与转发表项的入接口不一致,则对此报文进行<span>RPF</span>检查。对<span>RPF</span>检查结果的处理方式为:
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
若<span>RPF</span>检查选取出的<span>RPF</span>接口与入接口一致,则说明(<span>S</span>,<span>G</span>)表项正确,报文来源路径错误,将其丢弃。
</p>
<p class="MsoNormal" style="text-indent:21.0pt;">
若<span>RPF</span>检查选取出的<span>RPF</span>接口与入接口不符,则说明(<span>S</span>,<span>G</span>)表项已过时,于是把表项中的入接口更新为<span>RPF</span>接口。然后再根据<span>RPF</span>检查规则进行判断:如果接收该报文的接口正是其<span>RPF</span>接口,则向转发表项的所有出接口转发该报文,否则将其丢弃。
</p>

</p>


了解之前的PASS情况和咨询考试情况
请加QQ: 839898248  VX:Ciscolnfinity  关注微信公众号:思唯网络学院

 您阅读这篇文章共花了: 
 本文无需标签!
二维码加载中...
技术交流:欢迎在本文下方留言或加入QQ群:859273036 互相学习。     
本文地址:http://www.023wg.com/781.html
版权声明:若无注明,本文皆为“思唯网络学院博客”原创,转载请保留文章出处。

返回顶部    首页   
版权所有:思唯网络学院博客    浙江思唯网络