BGP MED Attribute

October 30, 2022
8 min read

StanleyArvey

Table of Contents

Quick navigation6 sections

In networking, the BGP MED attribute is an important part of the routing process. But what is it, and why is it important? This post will explain the purpose of the MED attribute, compare it with Local Preference and BGP Weight, and we'll also take a look at some common use cases for this powerful feature.

So if you're looking to learn more about BGP MED, you've come to the right place!

What is BGP MED Attribute?

The BGP MED attribute, also known as the Multi-Exit Discriminator, is a metric used by Border Gateway Protocol (BGP) to determine the best path for routing traffic between autonomous systems.

The value of the MED attribute can be set by network administrators, allowing for the customization of routing decisions. In addition to manually setting a value for the MED attribute, it can also be automatically propagated from one autonomous system to another. This allows for greater flexibility and adaptability in BGP routing decisions. Overall, the BGP MED attribute plays an important role in optimizing network traffic flow across multiple autonomous systems.

MED is used to convey the preferred path for traffic entering an autonomous system when multiple entry points exist. MED values are exchanged between autonomous systems, acting as a suggestion rather than a directive: the lower the MED value, the more preferable the path. This makes MED highly effective in multi-homed network environments where differential routing is necessary between various external links.

How is a MED Metric Advertised?

There are several rules to consider when a MED metric is advertised:

  • First and foremost, a more specific metric will cancel out a less specific one. For example, if you have two metrics of different groups, the group-specific metric takes precedence over the global BGP metric. Likewise, if you have peer-specific and other global metrics, the peer-specific metrics override both others.
  • A routing policy's metric definition takes priority over a metric-out statement.
  • Any defined metric will take precedence over a metric received from a route.
  • If a MED metric is not associated with a received route, and if a metric value is not configured, no metric is advertised. If you do not set a metric value, it will be automatically set to zero when advertising an active route.

BGP MED vs Local Preference

As we mentioned before, BGP MED, or Multi-exit Discriminator, is a BGP attribute that allows a network to inform its BGP neighbors about preferred entry points into the network.

Local Preference, on the other hand, is an attribute used to influence routes within a single BGP autonomous system. In other words, BGP MED influences which BGP neighbor a network will use to reach a destination, while Local Preference influences the choice of exit point within a particular network.

BGP MED can also be considered a more globally significant attribute, as it can influence routing decisions for all BGP neighbors, while Local Preference only affects choices made within one autonomous system. Both attributes are important in determining BGP routing decisions, but they serve different purposes and should not be confused with one another.

BGP MED vs BGP Weight

Another attribute that is often compared with MED is BGP Weight. BGP Weight is a Cisco proprietary attribute that plays a pivotal role in route selection within a single router. It is locally significant, meaning its value doesn't get advertised to other routers, even within the same autonomous system (AS). The higher the weight, the higher the priority of the route: if multiple paths are available to the same destination, the path with the highest weight will be chosen.

One of the main advantages of using BGP Weight is its simplicity and local effect, which ensures that changes don't ripple through the network and affect other routers. This makes it an ideal tool for scenarios where local preferences need urgent adjustments without impacting the broader network.

The key differences between BGP Weight and MED can be summarized as follows:

  • Scope: Weight is local to the router, while MED is exchanged between autonomous systems.
  • Standardization: Weight is Cisco proprietary, while MED is standardized in BGP.
  • Value impact: With Weight, the higher value is preferred; with MED, the lower value is preferred.
  • Preference control: Weight controls route selection within a router, while MED is used to influence incoming traffic from other autonomous systems.
  • Usability: Weight is suitable for intra-AS route management, while MED is ideal for multi-homed network scenarios across autonomous systems.

Despite their differences, BGP Weight and MED share some common ground. Both are key in making strategic routing decisions and achieving optimal pathway selections—crucial for enhancing network reliability and performance. Additionally, they are both configurable attributes within BGP, allowing network administrators to tweak routing policies according to specific requirements and objectives. Whereas BGP Weight is oriented towards managing internal router decisions without influencing neighbor routers, MED shines in scenarios where the interaction between different autonomous systems forms a critical part of the network strategy.

What are some common uses for BGP MED?

One common use case for BGP MED is when different ISPs connect to a provider through different points of presence with varying levels of available bandwidth. In this scenario, the provider could assign a higher BGP MED value to the slower PoPs to influence external peers to primarily use the higher bandwidth connections.

Another potential use case is for directing traffic towards specific data centers in cases where there are multiple options available within a geographical region. By assigning a lower BGP MED value to the preferred data center, external peers may be more likely to route traffic toward it. BGP MED should be used carefully, as it can lead to unbalanced traffic distribution and potential network congestion if not implemented properly.

In multi-homed scenarios, a corporation may also use MED to control how traffic from various global regions enters its network through different ISP links. By selectively setting MED values, the corporation can reduce latency and manage traffic loads more effectively during peak usage times. This topic is covered in depth in our self-paced BGP training.

Final Words

The BGP MED attribute is a useful tool for networking. By setting the MED value on your border gateway protocol (BGP) advertisements, you can tell other networks how highly you think they should route traffic to your network.

This could be helpful if you have multiple connections to different providers and want to make sure that traffic from one provider is routed through another provider's network as efficiently as possible.

Understanding attributes like MED, Local Preference, and Weight thoroughly provides a robust toolkit for managing and manipulating network routes. Each attribute serves unique scenarios, and knowing when to apply each one can significantly enhance the operational efficiency of a network.

Have you tried using the BGP MED attribute in your own networking?

Before you do, make sure to check our CCIE Enterprise Infrastructure course about BGP MED.

Related Courses

Enhance your knowledge with these recommended courses

CCIE Enterprise Infrastructure Course by Orhan Ergun

CCIE Enterprise Infrastructure Course by Orhan Ergun

The most Updated CCIE Enterprise v1.1 Course that comes with the most study materials in the world taught by world-famous Network Design Instructor Orhan Ergun

Become an Instructor

Share your knowledge and expertise. Join our community of instructors and help others learn.

Apply Now
StanleyArvey

About the Author

StanleyArvey

Stanley Arvey, the dynamic world of Information Technology's intricacies and nuances, has been navigating for over a decade. With a keen eye for detail and a passion for simplifying complex tech concepts, Stanley has become a sought-after voice in the IT blogging community. Through his contributions to OrhanErgun.net, he provides insights, analyses, and thought leadership that keep readers both informed and engaged.

Share this Article

Related Articles

BGPJuly 18, 2026

What Is BGP? Border Gateway Protocol — The Complete Guide

Border Gateway Protocol (BGP) is the routing protocol that holds the Internet together. Every time a packet crosses from one provider's network to another — from your ISP to a...

Read Article
BGPOctober 15, 2024

Top 30 BGP Interview Questions You Need to Know in Networking

Border Gateway Protocol (BGP) is a fundamental subject for anyone diving into the networking sector, especially for those preparing for job interviews. Whether you are aiming for a role in...

Read Article
BGPOctober 15, 2024

BGP Fundamentals Explained: What You Should Understand Before Your Interview

BGP Fundamentals Explained: What You Should Understand Before Your Interview Heading into a job interview that involves discussing network technologies can be daunting. Among the various protocols you need to...

Read Article
BGPSeptember 7, 2024

Understanding BGP: What Port Does it Use and Why?

Ever wondered how the colossal network of the internet is managed? Or how data finds its way across complex networks reliably and efficiently? A significant part of the answer lies...

Read Article
BGPSeptember 7, 2024

Choosing the Right BGP Router ID: Best Practices

When managing complex network topologies, the selection of an efficient Border Gateway Protocol (BGP) Router ID becomes imperative. This decision can significantly impact the stability and performance of your network....

Read Article
BGPSeptember 7, 2024

BGP Split Horizon vs Route Poisoning: What's the Difference?

In the robust universe of network routing, understanding the mechanisms that prevent routing loops is crucial for maintaining network reliability and efficiency. Two prominent techniques used in Border Gateway Protocol...

Read Article

Subscribe for Exclusive Deals & Promotions

Stay informed about special discounts, limited-time offers, and promotional campaigns. Be the first to know when we launch new deals!