Content

| 9.6 |  | BGP Attributes |
| 9.6.12 |  | The Multiple Exit Discriminator attribute |

The Multiple-exit-discriminator (MED) attribute is an optional nontransitive attribute, type code 4. MED informs external neighbors about the preferred path into an AS that has multiple entry points. A lower MED is preferred over a higher MED.

Unlike Local Preference, the MED attribute is exchanged between autonomous systems, but a MED attribute that comes into an AS does not leave the AS. When an update enters the AS with a certain MED value, that value is used for decision making within the AS. When BGP forwards the routing update to another AS, the MED is reset to zero. This is true unless the outgoing MED is set to a specific value.

When the route is originated by the AS itself, the MED value typically follows the internal IGP metric of the route. This becomes useful when a customer has multiple connections to the same provider. The IGP metric reflects how close or how far a network is to a certain exit point. A network that is closer to exit point A than to exit point B will have a lower IGP metric in the border router connected to A. When the IGP metric translates to MED, traffic coming into the AS can enter from the link closer to the destination. This is because a lower MED is preferred for the same destination. This can be used by both providers and customers to balance the traffic over multiple links between two autonomous systems.

Unless otherwise specified, the router compares MED attributes for paths from external neighbors that are in the same AS. MEDs from different autonomous systems are not comparable because the MED associated with a route usually gives some indication of the AS internal topology. Comparing MEDs from different autonomous systems would be like comparing apples and oranges. Still, if there is a reason to do so, the Cisco IOS offers the

bgp always-compare-med router command.

The MED can be used by an AS to influence the outbound decision of another Autonomous System.

XNET is receiving routing updates about 128.213.0.0/16 from three different sources. They are, San Jose as metric 120, Los Angeles as metric 200, and New York as metric 50. San Francisco will compare the two metric values coming from ANET and will prefer the San Jose router because it is advertising a lower metric, 120. When the

bgp always-compare-med command is used on the San Francisco router, it will then compare metrics. It compares metric 120 with metric 50 coming from New York and will prefer New York to reach 128.213.0.0/16. Notice that San Francisco could have influenced its decision by using Local Preference inside XNET to override the metrics coming from outside autonomous systems. Nevertheless, MED is still useful in case XNET prefers to base its BGP decisions on outside factors to simplify router configuration on its end. Customers who connect to the same provider in multiple locations could exchange metrics with their providers to influence the outbound traffic for each router. This leads to better load balancing.

| Web Links Configuring BGP http://www.cisco.com/univercd/cc/td/doc/product/ software/ios122/122cgcr/fipr_c/ipcprt2/1cfbgp.htm