So OSPF calculates and adds the best route to its routing table. The best route is the one with the smallest metric - cost.

However, how does an OSPF enabled router know the cost of the interfaces that are between it and some destination?

enter image description here In this case, how would R1 know what cost do routers R2 and R3 have associated with their interfaces?

I thought, at first, that its because of the Shortest Path First algorithm that it uses to calculate the routes based on the received LSA's, however, then why is there a "metric" field in a LSU message? Can someone give me some clarity on this? Thank you in advance.

enter image description here


1 Answer 1


The LSAs exchanged by OSPF neighbors include a metric field that describes the cost or distance.

Each link cost is calculated by dividing a reference bandwidth like 200 Gbit/s (the default is 100 Mbit/s) by the interface link speed. The path cost is the sum of all used link costs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.