OSPF EIGRP COST
发布时间:2012-01-16 11:10:34
发布时间:2012-01-16 11:10:34
ospf:R1#show int s0/0Serial0/0 is up, line protocol is up Hardware is M4T Internet address is 10.1.1.1/24 MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec, reliability 255/255, txload 1/255, rxload 1/255 ......ospf的cost计算公式 Metric=100000000/(带宽*1000)计算实例:Metric=100000000/(1544*1000)=64 (串口)eigrp:Metric = [K1 * bandwidth + ((K2 * bandwidth) / (256 – load)) + K3 * delay]*[K5 / (reliability + K4)]default K values :K1 = 1, K2 = 0, K3 = 1, K4 = 0, K5 = 0When k4 and k5 are 0, the [K5 / (reliability + K4)] portion of the equation is n0t factored in to the metric. Therefore, with the default constant values, the metric equation is as follows: Metric=Bandwidth + DelayBandwidth = 256 X 10,000,000/bandwidth in kbpsDelay = 256 X delay/10 (delay的单位为us[微秒])Metric的结果由以下几部分相加后乘以256:1.10的7次方/该路由所经(发送数据的)接口中带宽值最小的那个值2.该路由所经(发送数据的)接口所有的时延相加后除以10Metric=(1+2)*256可以在接口模式下手动指定delay:delay 2000 (将延迟指定为20000微秒)可以在接口模式下手动指定bandwidth:bandwidth 10000 (将延迟指定为10000kbit,也就是10M)
ms(毫秒)、μs(微秒)、ns(纳秒),其中:1s=1000ms,1ms=1000μs,1μs=1000ns。其中μs和延迟的关系才是10倍的关系. 所以Delay=2ms=2000us 2000us/10=200http://edwinzw.blog.sohu.com/http://edwinzw.blog.sohu.com/65967241.html计算实例:R1#show int fa0/1FastEthernet0/1 is up, line protocol is up Internet address is 10.1.1.1/24 MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec-----------------------------------------------R2#show int e1/0Ethernet1/0 is up, line protocol is up Internet address is 10.1.1.2/24 MTU 1500 bytes, BW 10000 Kbit, DLY 1000 usecR2#show int e1/1Ethernet1/1 is up, line protocol is up Internet address is 10.1.2.1/24 MTU 1500 bytes, BW 10000 Kbit, DLY 1000 usec-----------------------------------------------R3#show int e1/0Ethernet1/0 is up, line protocol is up Internet address is 10.1.2.2/24 MTU 1500 bytes, BW 1000(这里手动改过) Kbit, DLY 1000 usecR3#show int e1/1Ethernet1/1 is up, line protocol is up Internet address is 10.1.3.1/24 MTU 1500 bytes, BW 10000 Kbit, DLY 1000 usec-----------------------------------------------R4#show int fa0/0FastEthernet0/0 is up, line protocol is up Hardware is AmdFE, address is c803.0a7c.0000 (bia c803.0a7c.0000) Internet address is 10.1.3.2/24 MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec-----------------------------------------------
R1#show ip route 10.0.0.0/24 is subnetted, 3 subnetsD 10.1.3.0 [90/309760] via 10.1.1.2, 00:12:48, FastEthernet0/1D 10.1.2.0 [90/284160] via 10.1.1.2, 00:43:09, FastEthernet0/1C 10.1.1.0 is directly connected, FastEthernet0/1284160=((10000000/10000|最低BW|)+(100|fa0/1的时延|+1000|R2 E1/1的时延|)/10)*256 =(1000+1100/10)*256309760=((10000000/10000|最低BW|)+(100|fa0/1的时延|+1000|R2 E1/1的时延|+1000|R3 E1/1的时延|/10))*256=(1000+2100/10)*256
R2#show ip route 10.0.0.0/24 is subnetted, 3 subnetsD 10.1.3.0 [90/307200] via 10.1.2.2, 00:42:38, Ethernet1/1C 10.1.2.0 is directly connected, Ethernet1/1C 10.1.1.0 is directly connected, Ethernet1/0307200=(1000+2000/10)*256
R3#show ip route 10.0.0.0/24 is subnetted, 3 subnetsC 10.1.3.0 is directly connected, Ethernet1/1C 10.1.2.0 is directly connected, Ethernet1/0D 10.1.1.0 [90/2611200] via 10.1.2.1, 01:49:25, Ethernet1/02611200=((10000000/1000|手动改的那个最低BW|)+(1000|e1/0的时延|+1000|R2 E1/0的时延|/10))*256=(10000+2000/10)*256R4#show ip route 10.0.0.0/24 is subnetted, 3 subnetsC 10.1.3.0 is directly connected, FastEthernet0/0D 10.1.2.0 [90/2588160] via 10.1.3.1, 00:47:53, FastEthernet0/0D 10.1.1.0 [90/2613760] via 10.1.3.1, 00:47:53, FastEthernet0/02588160==((10000000/1000|手动改的那个最低BW|)+(100|fa0/0的时延|+1000|R3 e1/0的时延|/10))*256=(10000+1100/10)*2562613760=((10000000/1000|手动改的那个最低BW|)+(100|fa0/0的时延|+1000|R3 e1/0的时延|+1000|R2 E1/0的时延|/10))*256=(10000+2100/10)*256注:igrp的算法和eigrp类似,只是不用乘以256以上为个人理解,有错误的地方还请告知!