OSPF interface cost calculator
Uses the common Cisco auto-cost model: reference bandwidth divided by interface bandwidth, with minimum cost 1.
OSPF itself does not mandate the bandwidth formula
RFC 2328 defines the interface output cost as a positive link-state metric advertised for the interface. The familiar reference-bandwidth divided by interface-bandwidth formula is an implementation convention, notably used by Cisco auto-cost, rather than a formula required by the OSPFv2 standard itself.
Cisco uses a 100 Mbps default reference
On Cisco IOS and IOS XE, OSPF auto-cost uses reference bandwidth divided by interface bandwidth. The default reference is 100 Mbps, which makes 100 Mbps, 1 Gbps, 10 Gbps and faster interfaces all collapse to cost 1 unless the reference bandwidth is increased.
Cisco also allows an explicit interface cost, which overrides the automatically calculated cost.
RouterOS does not require Cisco-style auto-cost behavior
MikroTik RouterOS exposes interface cost directly in the OSPF interface template. Its documentation shows the 100,000,000 divided by bandwidth-in-bps formula only as a way to obtain Cisco-like costs when similar behavior is desired.
Path metric is cumulative
For a path modeled as a sequence of OSPF links, the simulator adds the cost of each link. OSPF SPF then prefers the lower cumulative metric, subject to the route type and other OSPF rules involved in the route being compared.