您好,欢迎访问三七文档
当前位置:首页 > 临时分类 > 有类无类路由协议的区别
有类路由协议与无类路由协议(一)有类路由协议代表:RIPv1、IGRP===RIPv1和IGRP都是距离矢量有类别的路由选择协议特点:1、在发送的update包中不携带子网掩码信息2、在主类边界路由器执行自动汇总,并且该自动汇总无法人工关闭3、不支持VLSM,即同一个主网络下的子网若掩码长度不一致则会出现子网丢弃的情况主类边界路由器:如果某台Router上配置了多个网段,其中某些网段的信息必段通过某一个特定的网段向其它Router进行通告,而这个特定的网段与其它网段分属于不同的主类网络,那么这台Router就是主类边界路由器实验:图1-13分析:R1#debugiprip*Jul2920:25:54.239:RIP:sendingv1updateto255.255.255.255viaSerial1/0(10.0.0.1)*Jul2920:25:54.239:RIP:buildupdateentries*Jul2920:25:54.239:subnet10.0.1.0metric1*Jul2920:25:54.239:network11.0.0.0metric1当RIP把R1的路由表中的条目封装到update包中,并且从S1/0接口发出去时RIP要对路由表中的条目进行筛选汇总,此筛选汇总的规则如下:检查条目是否与发送端口属于同一主网1).若否,则该条目自动被汇总成主类网络,然后封装到update包中(不带掩码)2).若是,继续检查条目是否与发送接口的掩码长度一致a.是,发送该条目(不汇总,不带掩码)b.否,直接忽略R2#debugiprip*Jul2920:27:31.151:RIP:receivedv1updatefrom10.0.0.1onSerial1/1*Jul2920:27:31.151:10.0.1.0in1hops*Jul2920:27:31.155:11.0.0.0in1hopsR2#shiprouteGatewayoflastresortisnotset172.16.0.0/24issubnetted,1subnetsC172.16.0.0isdirectlyconnected,Serial1/010.0.0.0/24issubnetted,2subnetsC10.0.0.0isdirectlyconnected,Serial1/1R10.0.1.0[120/1]via10.0.0.1,00:00:08,Serial1/1R11.0.0.0/8[120/1]via10.0.0.1,00:00:08,Serial1/1可以看到R2己经通过RIPv1从R1哪里学习到了两条路由条目,并且还有掩码,该掩码信息是如何产生的?当R2接受到从R1哪里传来的两条路由更新(这两条路由更新是不携带子网掩码这点已经毋庸置疑)并把它放到路由表中之前要做一些处理,该处理的规则如下:将接收到的路由条目和接收接口的网络地址进行比较,判断是否处于同一主网络1).处于同一主网络,直接将接收接口的掩码赋予该条目2).不处于同一主类网络,首先查看路由表中是否存在该主网络的任一子网a.不存在,赋予该条目一个有类掩码,同时写入路由表b.存在,忽略该路由条目,直接丢弃R2#debugiprip*Jul2921:21:53.771:RIP:sendingv1updateto255.255.255.255viaSerial1/0(172.16.0.1)*Jul2921:21:53.771:RIP:buildupdateentries*Jul2921:21:53.771:network10.0.0.0metric1*Jul2921:21:53.775:network11.0.0.0metric2R3#shiprouteGatewayoflastresortisnotset172.16.0.0/24issubnetted,1subnetsC172.16.0.0isdirectlyconnected,Serial1/1R10.0.0.0/8[120/1]via172.16.0.1,00:00:25,Serial1/1R11.0.0.0/8[120/2]via172.16.0.1,00:00:25,Serial1/1R2#ping10.0.2.1Typeescapesequencetoabort.Sending5,100-byteICMPEchosto10.0.2.1,timeoutis2seconds:.....Successrateis0percent(0/5)R3#ping10.0.2.1Typeescapesequencetoabort.Sending5,100-byteICMPEchosto10.0.2.1,timeoutis2seconds:U.U.UR2给R3返回的目标不可达消息Successrateis0percent(0/5)现在我们在R2增加一个LOOPBACK0:11.11.11.11/24R2#shiprouteGatewayoflastresortisnotset172.16.0.0/24issubnetted,1subnetsC172.16.0.0isdirectlyconnected,Serial1/010.0.0.0/24issubnetted,2subnetsC10.0.0.0isdirectlyconnected,Serial1/1R10.0.1.0[120/1]via10.0.0.1,00:00:01,Serial1/111.0.0.0/8isvariablysubnetted,2subnets,2masksC11.11.11.0/24isdirectlyconnected,Loopback0R11.0.0.0/8[120/1]via10.0.0.1,00:00:44,Serial1/1当R2从R1哪里接受到该路由条目时会直接丢弃,原因关于接受条目更新规则中有阐述当我们等到00:03:05时R11.0.0.0/8ispossiblydown,routingvia10.0.0.1,Serial1/1当我们等到00:04:00时直接从路由表中被删除0-30s:更新计时器31-180s:无效计时器180s-240s:保持失效计时器240s之后:刷新计时器当然我们可以直接用R2#cleariproute*会让RIP产生触发式的更新重新计算路由表R3#shiprouteGatewayoflastresortisnotset172.16.0.0/24issubnetted,1subnetsC172.16.0.0isdirectlyconnected,Serial1/1R10.0.0.0/8[120/1]via172.16.0.1,00:00:00,Serial1/1R2(config)#routerripR2(config-router)#net11.0.0.0R3#shiprouteGatewayoflastresortisnotset172.16.0.0/24issubnetted,1subnetsC172.16.0.0isdirectlyconnected,Serial1/1R10.0.0.0/8[120/1]via172.16.0.1,00:00:12,Serial1/1R11.0.0.0/8[120/1]via172.16.0.1,00:00:03,Serial1/1(二)无类路由协议代表:RIPV2EIGRPOSPFISISBGPV4特点:1、在发送的update包中携带子网掩码信息2、部分无类协议(如:RIPV2EIGRP)在主类边界路由器执行自动汇总功能是打开的,并且该自动汇总可以人工关闭3、支持VLSM,即同一个主网络下的子网若掩码长度不一致不会出现子网丢弃实验:图1-14先shut掉R2的lo0,全局配置RIPV1,R2路由表显示如下:R2#shiprouteGatewayoflastresortisnotsetC192.168.12.0/24isdirectlyconnected,Serial1/1R172.16.0.0/16[120/1]via192.168.23.2,00:00:26,Serial1/0[120/1]via192.168.12.1,00:00:15,Serial1/1==此时R2对左右两边“半信半疑”C192.168.23.0/24isdirectlyconnected,Serial1/0然后,激活R2的lo0,R2路由表如下:R2#shiprouteGatewayoflastresortisnotsetC192.168.12.0/24isdirectlyconnected,Serial1/1172.16.0.0/24issubnetted,1subnetsC172.16.20.0isdirectlyconnected,Loopback0===此时R2“只信自己”C192.168.23.0/24isdirectlyconnected,Serial1/0接着,把RIPV1升级到V2R2#shiprouteGatewayoflastresortisnotsetC192.168.12.0/24isdirectlyconnected,Serial1/1172.16.0.0/16isvariablysubnetted,2subnets,2masksC172.16.20.0/24isdirectlyconnected,Loopback0R172.16.0.0/16[120/1]via192.168.23.2,00:00:02,Serial1/0[120/1]via192.168.12.1,00:00:02,Serial1/1===此时R2“集思广益”C192.168.23.0/24isdirectlyconnected,Serial1/0最后,noauto-summaryR2#cleariproute*R2#shiprouteGatewayoflastresortisnotsetC192.168.12.0/24isdirectlyconnected,Serial1/1172.16.0.0/24issubnetted,3subnetsR172.16.30.0[120/1]via192.168.23.2,00:00:01,Serial1/0C172.16.20.0isdirectlyconnected,Loopback0R172.16.10.0[120/1]via192.168.12.1,00:00:01,Serial1/1C192.168.23.0/24isdirectlyconnected,Serial1/0此时R2“拨云见日”
本文标题:有类无类路由协议的区别
链接地址:https://www.777doc.com/doc-2375597 .html