cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
11019
Views
5
Helpful
4
Replies

Forward Metric in OSPF

Lijesh NC
Level 1
Level 1

HI All,

I am confused with Forward metric in OSPF. I have seen forward metric when i redistributed other routing protocol in to ospf but not sure about the concept.

Can some one help me in understanding this better.

Thanks in advance.

Lijesh

2 Accepted Solutions

Accepted Solutions

lgijssel
Level 9
Level 9

The internal metric for ospf uses cost. Within an area, cost determines which path a packet is forwarded to.

Cost are accumulated for every outgoing interface in the path towards the destination.

When redistributing into ospf, there are two methods:

External type 2 metric;  assigns a fixed cost to a path. This one is the default for ospf.

External type 1 metric; this type utilizes a cost which behaves similar to the internal cost.

Without overriding parameters, a route is redistributed as E2 with a default cost assigned to it.

The default cost  for E2 is routes based on the originating protocol.

For EGP's (i.e. eBGP) this is 1, for IGP's its 20.

regards,

Leo

View solution in original post

i have created a test scenario to understand this better

R1-->(eigrp)<----R2----->ospf<---R3

E1:

R2 config

router ospf 100

log-adjacency-changes

redistribute eigrp 100 metric 1000 metric-type 1 subnets

network 10.1.23.0 0.0.0.255 area 0

result (R3):

O E1    10.1.12.0 [110/1064] via 10.1.23.1, 00:38:23, Serial1/0   <----metric was specified as 1000 in the command...the cost is increasing as it is traversing the routers.

O E1    10.1.3.0 [110/1064] via 10.1.23.1, 00:38:23, Serial1/0

O E1    10.1.2.0 [110/1064] via 10.1.23.1, 00:38:23, Serial1/0

O E1    10.1.1.0 [110/1064] via 10.1.23.1, 00:38:23, Serial1/0

O E1    10.1.6.0 [110/1064] via 10.1.23.1, 00:38:23, Serial1/0

O E1    10.1.5.0 [110/1064] via 10.1.23.1, 00:38:23, Serial1/0

O E1    10.1.4.0 [110/1064] via 10.1.23.1, 00:38:23, Serial1/0

now lets consider

E2:

router ospf 100

log-adjacency-changes

redistribute eigrp 100 metric 1000 subnets  (since E2 is default when we redistribute it will not be shown in the sh run command metric-type 2)

network 10.1.23.0 0.0.0.255 area 0

now lets check the output on R3 again

O E2    10.1.12.0 [110/1000] via 10.1.23.1, 00:01:42, Serial1/0--->metric remains the same

O E2    10.1.3.0 [110/1000] via 10.1.23.1, 00:01:42, Serial1/0

O E2    10.1.2.0 [110/1000] via 10.1.23.1, 00:01:42, Serial1/0

O E2    10.1.1.0 [110/1000] via 10.1.23.1, 00:01:42, Serial1/0

O E2    10.1.6.0 [110/1000] via 10.1.23.1, 00:01:42, Serial1/0

O E2    10.1.5.0 [110/1000] via 10.1.23.1, 00:01:42, Serial1/0

O E2    10.1.4.0 [110/1000] via 10.1.23.1, 00:01:42, Serial1/0

so E2 the metric remains the same and in E1 the cost of the path increases.

and always remember the lower the cost of the path better is the link in ospf   cost=100/BW

View solution in original post

4 Replies 4

lgijssel
Level 9
Level 9

The internal metric for ospf uses cost. Within an area, cost determines which path a packet is forwarded to.

Cost are accumulated for every outgoing interface in the path towards the destination.

When redistributing into ospf, there are two methods:

External type 2 metric;  assigns a fixed cost to a path. This one is the default for ospf.

External type 1 metric; this type utilizes a cost which behaves similar to the internal cost.

Without overriding parameters, a route is redistributed as E2 with a default cost assigned to it.

The default cost  for E2 is routes based on the originating protocol.

For EGP's (i.e. eBGP) this is 1, for IGP's its 20.

regards,

Leo

Hi Leo,

That make more sense to me.I have tried to Execute the same find the attached file Need your observation on this.

So my understanding is  like this ...when redistributing in to ospf by default (E2 routes )  Metric from R3 to ASBR (R2) is treated as forward metric (64)???

And when changing the metric type to E1  metric to destination (10.10.10.0 network ,,ie forward metric) would be the cost from

R1+R2+R3 .....ie 20+64=84..???

Need some clarification in below out put.

In below out put Metric 20 is the IGP for redistributed route (10.10.10.0) metric right  and 64 is forward metric ie cost from R3 to R2 am i right.(This is in the case of E2 routes)

R3#s ip rou 10.10.10.0

Routing entry for 10.10.10.0/30

  Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 64  <===Metric 20 and forward metric

--------------------------------

In the below Case E1 Routes  Metric is showing as 84 is this the cost from R3 to final destination ie R3+R2+R1 ie 20+64 ....R3 to R2 is =20 (IGP)

and 64 (This is the metric from R2 to R1 right...)

R3#s ip rou 10.10.10.0

Routing entry for 10.10.10.0/30

  Known via "ospf 1", distance 110, metric 84, type extern 1 <===Forward Metric 84  (E1 Routes)

  Last update from 1.1.1.1 on Serial0/0, 00:00:23 ago

------------------------------------------------------------------------------------

R3#s ip rou

     1.0.0.0/30 is subnetted, 1 subnets

C       1.1.1.0 is directly connected, Serial0/0

     10.0.0.0/30 is subnetted, 1 subnets

O E2    10.10.10.0 [110/20] via 1.1.1.1, 00:00:00, Serial0/0 <== E2 Routes

R3#

R3#s ip rou 10.10.10.0

Routing entry for 10.10.10.0/30

  Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 64  <===Forward metric 64

  Last update from 1.1.1.1 on Serial0/0, 00:00:08 ago

  Routing Descriptor Blocks:

  * 1.1.1.1, from 10.10.10.2, 00:00:08 ago, via Serial0/0

      Route metric is 20, traffic share count is 1

==================================================================

R3#s ip rou

     1.0.0.0/30 is subnetted, 1 subnets

C       1.1.1.0 is directly connected, Serial0/0

     10.0.0.0/30 is subnetted, 1 subnets

O E1    10.10.10.0 [110/84] via 1.1.1.1, 00:00:20, Serial0/0

R3#

R3#s ip rou 10.10.10.0

Routing entry for 10.10.10.0/30

  Known via "ospf 1", distance 110, metric 84, type extern 1 <===Forward Metric 84

  Last update from 1.1.1.1 on Serial0/0, 00:00:23 ago

  Routing Descriptor Blocks:

  * 1.1.1.1, from 10.10.10.2, 00:00:23 ago, via Serial0/0

      Route metric is 84, traffic share count is 1

Regards

Lijesh

i have created a test scenario to understand this better

R1-->(eigrp)<----R2----->ospf<---R3

E1:

R2 config

router ospf 100

log-adjacency-changes

redistribute eigrp 100 metric 1000 metric-type 1 subnets

network 10.1.23.0 0.0.0.255 area 0

result (R3):

O E1    10.1.12.0 [110/1064] via 10.1.23.1, 00:38:23, Serial1/0   <----metric was specified as 1000 in the command...the cost is increasing as it is traversing the routers.

O E1    10.1.3.0 [110/1064] via 10.1.23.1, 00:38:23, Serial1/0

O E1    10.1.2.0 [110/1064] via 10.1.23.1, 00:38:23, Serial1/0

O E1    10.1.1.0 [110/1064] via 10.1.23.1, 00:38:23, Serial1/0

O E1    10.1.6.0 [110/1064] via 10.1.23.1, 00:38:23, Serial1/0

O E1    10.1.5.0 [110/1064] via 10.1.23.1, 00:38:23, Serial1/0

O E1    10.1.4.0 [110/1064] via 10.1.23.1, 00:38:23, Serial1/0

now lets consider

E2:

router ospf 100

log-adjacency-changes

redistribute eigrp 100 metric 1000 subnets  (since E2 is default when we redistribute it will not be shown in the sh run command metric-type 2)

network 10.1.23.0 0.0.0.255 area 0

now lets check the output on R3 again

O E2    10.1.12.0 [110/1000] via 10.1.23.1, 00:01:42, Serial1/0--->metric remains the same

O E2    10.1.3.0 [110/1000] via 10.1.23.1, 00:01:42, Serial1/0

O E2    10.1.2.0 [110/1000] via 10.1.23.1, 00:01:42, Serial1/0

O E2    10.1.1.0 [110/1000] via 10.1.23.1, 00:01:42, Serial1/0

O E2    10.1.6.0 [110/1000] via 10.1.23.1, 00:01:42, Serial1/0

O E2    10.1.5.0 [110/1000] via 10.1.23.1, 00:01:42, Serial1/0

O E2    10.1.4.0 [110/1000] via 10.1.23.1, 00:01:42, Serial1/0

so E2 the metric remains the same and in E1 the cost of the path increases.

and always remember the lower the cost of the path better is the link in ospf   cost=100/BW

Hi Ravindra,

Thank you so much for your effort ...i tried with RIP cz i always confuse with eigrp redistribution.

I think i got some idea about forward metric...little more clarification needed.

Please review my update and let me know your observation...

Regards

Lijesh

Review Cisco Networking for a $25 gift card