BGP Multi Exit Discriminator (MED)
Multi Exit Discriminator (MED) also called metric. MED is optional and non transitive attribute, MED allows an autonomous system to tell a neighboring autonomous system the best way to forward packets into the first autonomous system. MED is used to advertise by one autonomous system into another, propagated inside the autonomous system, but not sent to any other autonomous systems. A smaller MED value means more preferred, by default 0 and range is 0 through 4,294,967,295. MED originally worked for a dual-homed design.
MED is used in the route selection process only if all the paths come the same Autonomous system. BGP use the bgp always-compare-med command to force the router to compare the MED even if the paths come from different autonomous systems. If you are enabling this option then enable it entire autonomous system otherwise loops can be occur.
Topology: