When we use a Dynamic routing protocol, there is one condition where more than one path to reach a network. So router will select the best path toward one network from the some available route path. To specify a bestpath from a few route path is use a paramenter called as metric and OSPF use Cost as a metric.
Path route with lowest cost will be best path. The Following is Cost value for each interface type :
Interface Type | Interface bandwidth | Cost |
10 GigabitEthernet | 10000 Mb | 1 |
GigabitEthernet | 1000 Mb | 1 |
FastEthernet | 100 Mb | 1 |
Ethernet | 10 Mb | 10 |
If you’re using the mikrotik with ROSv6, default cost is 10. in OSPF you can set cost as default and you also can set the ospf cost value manually.
As you can see above, from R1 to network 192.168.100.0/24 there are 2 paths via R2 and R3. so that R1 will select the best path towards network 192.168.100.0/24. Cost calculation by output interface so from to 192.168.100.0/24 via R2, total path cost is 3 while if via R3 path cost is 2. so the best path is via R3 and route path via R2 will be backup route and active if the primary route is down.