07-06-2023 10:43 AM - edited 07-06-2023 10:45 AM
Hello, everyone!
I am currently studying about the BGP path selection process and I came across MED and AS Path Prepending which can both be used to affect how traffic enters our network.
When would I want to use one over another? I know that MED cannot be used in multi-homed designs as AS Path is the deciding factor for the best path there, therefore that's where'd we configure AS Path Prepending.
To be honest, I see AS PP as the way to go for pretty much everything since it can propagate to further autonomous systems and it works where MED doesn't (Multi-Homed connections). I know that MED can be used when we have more than a single connection to the same AS, but AS Path Prepending could be used there as well.
So are there any situations where MED would be more preferred than AS PP? Are there any scenarios where AS Path Prepending might have a disadvantage?
Thank you in advance for your help.
Kind regards,
David
Solved! Go to Solution.
07-06-2023
12:44 PM
- last edited on
07-06-2023
09:52 PM
by
Translator
Hello,
BGP is a bear, good luck. As far as your question here are a few points. Some you mention and others are for thought.
BGP is very versatile in its NLRI and attributes you can modify. You mention
@Mitrixsen wrote:
When would I want to use one over another? I know that MED cannot be used in multi-homed designs as AS Path is the deciding factor for the best path there, therefore that's where'd we configure AS Path Prepending.
1. You can modify this behavior with the
bgp always-compare-med
command. This will compare the MED even if AS path is not the same.
2. Some vendors handle MED differently. I.E if none is sent the path will be considered as a worse path whereas CISCO will handle no MED sent as a better path.
3.MED is sent to the eBGP neighbor but that's it (non-transitive) - so its not propagated across the network like you mention as AS path is. So while the AS path has the capability of affecting further routing decisions while the MED is less likely to. Its contained within the area.
4. The receiving side has the option to modify or remove the MED attribute as well as AS path
BGP was built for flexibility so there are so many ways to modify a route because so many entities and vendors use it you have to haver several options for doing very similar things. It boils down to the requirement of the test or organization.
Hope that helps
-David
07-06-2023 10:50 AM - edited 07-06-2023 10:51 AM
Hello @Mitrixsen,
Both MED and AS Path Prepending are BGP attributes used for influencing the BGP path selection process and traffic routing. While they can serve similar purposes, there are certain scenarios where one may be preferred over the other.
MED: In multi-homed designs, where you have multiple connections to different ISPs, AS Path is typically the deciding factor for the best path. MED can be used to influence inbound traffic from different ISPs. Each ISP can advertise a different MED value, and your network can use the lowest MED value to determine the preferred path.
AS Path Prepending: In multi-homed designs, AS Path Prepending can also be used to influence inbound traffic. By adding additional AS hops to the AS Path for certain routes, you can make your network appear less preferable, thus potentially reducing inbound traffic from a specific ISP.
Single-Connection Scenarios:
AS Path Prepending: In scenarios where you have a single connection to a remote AS, AS Path Prepending can be a useful technique to influence outbound traffic. By adding additional AS hops to the AS Path for certain routes, you can make your network appear less preferable to your upstream neighbor, potentially shifting outbound traffic to other paths.
Preference and Reachability:
MED: MED is an attribute exchanged between neighboring ASes to indicate the preferred exit point from the neighboring AS. It is primarily used for influencing inbound traffic. However, not all ISPs honor or propagate MED values, so its effectiveness may vary depending on the ISPs involved.
AS Path Prepending: AS Path Prepending is more widely supported and propagated among ISPs. It allows you to influence both inbound and outbound traffic more reliably.
MED is typically used in multi-homed designs to influence inbound traffic from different ISPs, while AS Path Prepending can be used in both multi-homed and single-connection scenarios to influence inbound or outbound traffic. AS Path Prepending is more versatile and widely supported, but it can result in increased AS Path lengths and potential suboptimal routing if not carefully implemented.
Ultimately, the selection of MED or AS Path Prepending depends on the specific network requirements, the behavior of upstream ISPs, and the desired traffic engineering goals.
07-06-2023 10:57 AM
sorry my answer is small but that my nature
simple answer
MED is one way AS
AS-PATH can pass many AS except case there is some filter to remove private AS.
that the different
07-06-2023 10:59 AM - edited 07-06-2023 10:59 AM
Hello! Thank you for answering my question.
I understand the difference between the two and their propagation, but when would MED be more useful than AS Path Prepending? Since AS Path Prepending can be used anywhere, with a single peer AS, with multiple peer ASes, etc.
07-06-2023 11:02 AM
as I mention if SP remove the private AS (with it as-prepend) then you need other way to control path and this way the best is MED
07-06-2023 12:07 PM
In certain cases, ISPs may agree to exchange and honor specific MED values based on a peering agreement or traffic engineering arrangement. This allows you to influence inbound traffic without affecting the AS Path length or potentially causing suboptimal routing due to AS Path Prepending. When such agreements exist, using MED can be more effective and predictable.
It's recommended to consider factors such as the ISP's support for MED, peering agreements, potential impact on routing stability, and your network's traffic engineering objectives when deciding between the two techniques.
07-06-2023
12:44 PM
- last edited on
07-06-2023
09:52 PM
by
Translator
Hello,
BGP is a bear, good luck. As far as your question here are a few points. Some you mention and others are for thought.
BGP is very versatile in its NLRI and attributes you can modify. You mention
@Mitrixsen wrote:
When would I want to use one over another? I know that MED cannot be used in multi-homed designs as AS Path is the deciding factor for the best path there, therefore that's where'd we configure AS Path Prepending.
1. You can modify this behavior with the
bgp always-compare-med
command. This will compare the MED even if AS path is not the same.
2. Some vendors handle MED differently. I.E if none is sent the path will be considered as a worse path whereas CISCO will handle no MED sent as a better path.
3.MED is sent to the eBGP neighbor but that's it (non-transitive) - so its not propagated across the network like you mention as AS path is. So while the AS path has the capability of affecting further routing decisions while the MED is less likely to. Its contained within the area.
4. The receiving side has the option to modify or remove the MED attribute as well as AS path
BGP was built for flexibility so there are so many ways to modify a route because so many entities and vendors use it you have to haver several options for doing very similar things. It boils down to the requirement of the test or organization.
Hope that helps
-David
07-06-2023 01:23 PM
Of course, AS prepending widely used.
I would almost question whether anyone bothers using MED.
When doing cooperative traffic engineering with ISPs, while using BGP, my experience is you get into discussions using BGP community strings.
Be interesting to see, when doing Internet "traffic engineering", between ASs, whether others' experience mirrors mine, i.e. using BGP community strings vs. MED.
07-06-2023 01:50 PM
You ask about different between as prepend and MED and select answer talking about MED feature!!!!!
Really' I dont know
Good luck in your studying
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide