OSPF Cost.

satishtechsatishtech Posts: 243Member
is the
# ip ospf cost
command applied only for outgoing interfaces.
Meaning examples :

R1----R2
R3
R4
R1 trying to get to R3 has two paths.
Via R2
Via R4
If I wish to cancel out one path I tweak/increase the cost
on one interface.
Now should the cost be applied only on outgoing interfaces
from R1 towards R3.In packet tracer Cost varied on
incoming interfaces had no significance , for example
varying the incoming interface of R2 had no significance
on path selection.

Hope it is not a silly question.
Thank You all.

Comments

  • volfkhatvolfkhat Posts: 944Member ■■■■■■■□□□
    Great question Satistech :]
    (keep them coming)

    My 2 cents:
    I'm going to assume that the 'cost configuration' has to be applied on BOTH ends of the segment.
    So,
    set the Cost-value on the desired Int on R1,
    and set that same Cost-value on the INT on R2 (for example).

    i believe that's the theory....
  • daniel280187daniel280187 Posts: 37Member ■■□□□□□□□□
    Hi Satishtech ,
    there are two ways to modify the path packets are taking using OSPF. It is important to know the formula that OSPF uses to calculate the cost, which is, cost = bandwdith / 10 Mbps

    1 - Modify the bandwidth of an interface using the bandwidth command under an interface configuration. This will modify the cost of the interface as per the OSPF formula.
    2 - Directly modifying the cost with the ip ospf cost as you said. This will overwrite any cost calculated by OSPF using the original formula.

    You need to think from the perspective of the source Router, so for example if you want to send a packet from R1 to R3 via R4 you will have to set the cost in the outgoing interfaces of R1 and R4 respectively. In the same way, lets say you want R3 to reach R1 but this time via R2, you will then have to configure the outgoing interfaces in R3 and R2 with a lesser cost.

    Have a look at the image attached for a clear explanation on how you can modify the cost to set the path that packages take.



    In this case, looking from London's Router perspective when trying to sned a packet to Manchester it has been configured to be sent via Newcastle. issuing show ip ospf interface brief you can see the current cost of interfaces as OSPF sees it so you can confirm that the direct path using Serial 0/2 has a cost of 64 while the path via Newcastle, it has London's Serial 0/1 cost (2) + Newcastle's Serial 0/0 (2) which add just 4 instead of 64. That will result in London sending the package via Newcastle as can be seen with Show ip route .

    Hope this can shed some light, if not let me know.

    If you want to read a bit on OSPF in general these are 2 good sources to use:
    http://www.cisco.com/c/en/us/support/docs/ip/open-shortest-path-first-ospf/7039-1.html#t28
    http://docwiki.cisco.com/wiki/Internetwork_Design_Guide_--_Designing_Large-Scale_IP_Internetworks#OSPF_Internetwork_Design_Guidelines
Sign In or Register to comment.