|
The Multiple-exit-discriminator (MED)
attribute is an optional nontransitive attribute (type code 4). It
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 passes on the routing
update to another AS, the MED is reset to zero (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 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 you have 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 AS as shown in the
Figure.
XNET is receiving routing updates
about 128.213.0.0/16 from three different sources: San Jose (metric
120), Los Angeles (metric 200), and New York (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 metric 120
with metric 50 coming from New York and will prefer New York to
reach 128.213.0.0/16. Note 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 each
other's outbound traffic, leading to better load balancing.
|