ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • OSPF metric/cost
    Protocols/BGP_OSPF_MPLS_VPN 2021. 2. 16. 23:20

     

     

    <OSPF cost calculation>

    Why 31 cost for R5 on R1?

    R1#show ip route ospf
    Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
           D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
           N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
           E1 - OSPF external type 1, E2 - OSPF external type 2
           i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
           ia - IS-IS inter area, * - candidate default, U - per-user static route
           o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
           a - application route
           + - replicated route, % - next hop override

    Gateway of last resort is not set

          1.0.0.0/8 is variably subnetted, 11 subnets, 2 masks
    O IA     1.1.2.0/24 [110/11] via 1.1.123.2, 00:07:23, Ethernet0/0.123
    O IA     1.1.3.0/24 [110/11] via 1.1.123.3, 00:07:00, Ethernet0/0.123
    O IA     1.1.4.0/24 [110/21] via 1.1.123.2, 00:06:32, Ethernet0/0.123
    O IA     1.1.5.0/24 [110/31] via 1.1.123.2, 00:06:08, Ethernet0/0.123
    O IA     1.1.24.0/24 [110/20] via 1.1.123.2, 06:21:22, Ethernet0/0.123
    O IA     1.1.34.0/24 [110/74] via 1.1.123.3, 06:06:00, Ethernet0/0.123
    O IA     1.1.45.0/24 [110/30] via 1.1.123.2, 06:21:22, Ethernet0/0.123

    Cost = reference bandwidth(10*8) / interface bandwidth(x)

     

    Ethernet is 10 cost because (10*8) / (10*7) = 10

    FastEthernet is 1 cost because (10*8) / (10*8) = 1

     

    R1#show int e 0/0.123
    Ethernet0/0.123 is up, line protocol is up
      Hardware is AmdP2, address is aabb.cc00.1000 (bia aabb.cc00.1000)
      Internet address is 1.1.123.1/24
      MTU 1500 bytes, BW 10,000 Kbit/sec, DLY 1000 usec,
         reliability 255/255, txload 1/255, rxload 1/255
      Encapsulation 802.1Q Virtual LAN, Vlan ID  123.
      ARP type: ARPA, ARP Timeout 04:00:00
      Keepalive set (10 sec)
      Last clearing of "show interface" counters never
    R2>show int e 0/0.24
    Ethernet0/0.24 is up, line protocol is up
      Hardware is AmdP2, address is aabb.cc00.2000 (bia aabb.cc00.2000)
      Internet address is 1.1.24.2/24
      MTU 1500 bytes, BW 10000 Kbit/sec, DLY 1000 usec,
         reliability 255/255, txload 1/255, rxload 1/255
      Encapsulation 802.1Q Virtual LAN, Vlan ID  24.
      ARP type: ARPA, ARP Timeout 04:00:00
      Keepalive set (10 sec)
      Last clearing of "show interface" counters never
    R4>show int e 0/0.45
    Ethernet0/0.45 is up, line protocol is up
      Hardware is AmdP2, address is aabb.cc00.4000 (bia aabb.cc00.4000)
      Internet address is 1.1.45.4/24
      MTU 1500 bytes, BW 10000 Kbit/sec, DLY 1000 usec,
         reliability 255/255, txload 1/255, rxload 1/255
      Encapsulation 802.1Q Virtual LAN, Vlan ID  45.
      ARP type: ARPA, ARP Timeout 04:00:00
      Keepalive set (10 sec)
      Last clearing of "show interface" counters never
    R5>show int lo 0
    Loopback0 is up, line protocol is up
      Hardware is Loopback
      Internet address is 1.1.5.5/24
      MTU 1514 bytes, BW 8,000,000 Kbit/sec, DLY 5000 usec,
         reliability 255/255, txload 1/255, rxload 1/255
      Encapsulation LOOPBACK, loopback not set

    The interface BW between R1 and R2 is 10*7. so the cost is 10.

    The interface BW between R2 and R4 is 10*7. so the cost is 10.

    The interface BW between R4 and R5 is 10*7. so the cost is 10.

    The loopback 0 BW is 8G. 100,000,000(10*8) / 8,000,000,000 = 0.0125. This number below one(1) is considered as 1.

    As the result, 10 + 10 + 10 + 1 = 31

     

    So why 31 costs for R5 on R1?

    the cost is the sum of costs of all interfaces for a destination.

    10 + 10 + 10 + 1 = 31

     

     

     

    <OSPF cost calculation>

    FastEthernet, GigaEthernet, 10GEthernet, and loopback interface are all just 1 because the cost number below 1 is considered as 1. If you use interfaces faster than FE such as GE, 10G, 100G, all costs will be 1. it will not be efficient. In this case, you need to modify the reference BW value.

    R1(config)#router ospf 1
    R1(config-router)#auto-cost reference-bandwidth ?
      <1-4294967>  The reference bandwidth in terms of Mbits per second

    R1(config-router)#auto-cost reference-bandwidth 1000000

    'Protocols > BGP_OSPF_MPLS_VPN' 카테고리의 다른 글

    [MPLS] OSPF Super Backbone Area (1)  (0) 2021.06.23
    [MPLS] IP/MPLS Basics  (0) 2021.06.08
    OSPF Link-state/Adjacency changes  (0) 2021.02.16
    The OSPF Packet Types and Flow  (0) 2021.02.11
    Building OSPF network with EVE-NG (2)  (0) 2021.02.11

    댓글

Designed by Tistory.