Inter-Domain Routing & BGP

the multi-exit discriminator

Suppose two networks connect to each other in more than one place — say a link in New York and another in Los Angeles. When the first network has traffic for the second, which link should it use? The multi-exit discriminator, or MED, is how the second network politely suggests an answer: "if you're sending us traffic for this prefix, please prefer the entry point with the lower MED." It is a hint about which of several shared doors to use.

Concretely, MED is a numeric attribute a network attaches to the routes it advertises across MULTIPLE links to the SAME neighbour. Lower MED is preferred. A common use is to keep traffic on the receiver's own backbone as little as possible (so-called cold-potato routing): the receiving network advertises a low MED at the entry point closest to the actual destination, asking the sender to carry the traffic across the sender's network and hand it off near where it needs to go. In the BGP decision process, MED is compared LATE — after local preference and AS path length — and, by default, only between routes learned from the SAME neighbouring AS.

MED is the weakest of the common levers because it is merely a suggestion the sender is free to ignore. Unlike local preference (which a network controls absolutely for its own outbound traffic), MED tries to influence ANOTHER network's behaviour, and that other network's own policy — especially its local preference — comes first and can override the hint entirely. So MED works mainly between cooperating partners who both agree to honour it; across adversarial or indifferent boundaries it often does nothing.

Network B connects to network A in two cities. B wants A's traffic for B's eastern customers to enter at the New York link. So B advertises those prefixes to A with MED 10 at New York and MED 50 at Los Angeles. If A honours MED (and its own local preference is equal on both), A will send that traffic in via New York. If A's policy ranks the LA link higher for its own reasons, it can ignore B's MED entirely.

MED is a low-priority hint to a neighbour about which of several shared links to use; lower is preferred, and it can be ignored.

MED only suggests how a neighbour should send traffic INTO you, and it is easily overridden by that neighbour's local preference — so never rely on MED alone to control your inbound traffic.

Also called
MEDMULTI_EXIT_DISCmetric多出口判別值