Subject: [Idr] MED in iBGP -> eBGP advertisement

From: Pekka Savola <[email-masked]>
Date: Thu, 2 Apr 2009 08:34:53 +0300 (EEST)

Hello,

There doesn't appear to be any specification whether MED should be 
propagated from iBGP to eBGP on routes originated within the AS, 
except that about MED transitivity between ASs [1] (RFC 4271 S 5.1.4). 
See more about this below.

How should the implementation behave in this case?

This area of spec seems to be undefined, and the way MED transitivity 
is specified, it has implementation consequences.  Is this a problem?

FWIW, at least on Juniper, locally originated iBGP route MEDs are not 
propagated to eBGP unless you touch the MED explicitly in eBGP policy 
(e.g. 'metric add 0').

[1] RFC4271 S 5.1.4 says:

    "The
    MULTI_EXIT_DISC attribute received from a neighboring AS MUST NOT be
    propagated to other neighboring ASes."

This does not seem to be implementable exactly as narrowly as written. 
Consider a route 1.0.0.0/8 from AS1.  Router A at AS2 with eBGP 
session to adds MED=100.  The route is advertised to router B at AS2. 
Router B has no way of knowing whether MED attribute was added at AS2 
or AS1, and the only alternative for routes originated outside its own 
AS is to not propagate the metric.  For consistency, one could argue 
that locally origianted routes should also by default propagate the 
metric but that seems unspecified.

-- 
Pekka Savola                 "You each name yourselves king, yet the
Netcore Oy                    kingdom bleeds."
Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings

---

From: Pekka Savola <[email-masked]>
Date: Thu, 2 Apr 2009 09:06:32 +0300 (EEST)

On Wed, 1 Apr 2009, Jakob Heitz wrote:
> Now: The purpose of the MED is for the receiving AS to make
> a routing decision based upon it. Therefore, to be useful, the MED
> must be a DIFFERENT value at each point you export the route
> to the other guy. For the pedants: not the same at every point
> all the time.

That's right, but one possible way to make it different is to set a 
different MED towards different iBGP peers and as a result the 
external MED would be different.

---

From: Jakob Heitz <[email-masked]>
Date: Wed, 01 Apr 2009 23:06:36 -0700

You have two choices:
A) MED is generated at the point where a route enters the AS,
    That is either where it is originated or where it is received
    by EBGP.
B) MED is generated by each router that exports the route to a
    neighboring AS: The EBGP exit point.

That's only going to happen with choice B.
I vote for choice B.

 From this, it follows that if a router receives a MED on IBGP,
that the MED was generated in the neighboring AS.

--
Jakob Heitz.

Pekka Savola wrote:
> propagated from iBGP to eBGP on routes originated within the AS, except 
> that about MED transitivity between ASs [1] (RFC 4271 S 5.1.4). See more 
> about this below.
> 
> This area of spec seems to be undefined, and the way MED transitivity is 
> specified, it has implementation consequences.  Is this a problem?
> 
> Consider a route 1.0.0.0/8 from AS1.  Router A at AS2 with eBGP session 
> to adds MED=100.  The route is advertised to router B at AS2. Router B 
> has no way of knowing whether MED attribute was added at AS2 or AS1, and 
> the only alternative for routes originated outside its own AS is to not 
> propagate the metric.  For consistency, one could argue that locally 
> origianted routes should also by default propagate the metric but that 
> seems unspecified.
>

---

From: Jakob Heitz <[email-masked]>
Date: Wed, 01 Apr 2009 23:36:33 -0700

Pekka Savola wrote:
> different MED towards different iBGP peers and as a result the external 
> MED would be different.

Then the MED you propagate around your own AS is your own.
That means you erased the MED your upstream sent you and
you can not make routing decisions based upon it. I guess this
is ok if you ignore received MEDs.

I can see nothing stopping you from doing it. Seems like a
simple knob to add. You would have to make sure every router
in your AS is doing it the same way though.

-- 
Jakob Heitz.

---

From: Danny McPherson <[email-masked]>
Date: Thu, 2 Apr 2009 08:36:26 -0600

On Apr 1, 2009, at 11:34 PM, Pekka Savola wrote:
>
> This does not seem to be implementable exactly as narrowly as  
> written. Consider a route 1.0.0.0/8 from AS1.  Router A at AS2 with  
> eBGP session to adds MED=100.  The route is advertised to router B  
> at AS2. Router B has no way of knowing whether MED attribute was  
> added at AS2 or AS1, and the only alternative for routes originated  
> outside its own AS is to not propagate the metric.  For consistency,  
> one could argue that locally origianted routes should also by  
> default propagate the metric but that seems unspecified.

In reality, externally announced prefixes for locally
routes are often aggregated and announced from multiple
locations in the network.  This is the "aggregation
breaks MEDs" argument and makes a case that an AS may
not want to accept MEDs from an adjacent AS for routes
that they originate, but only for routes from downstream
ASes.

This and other MEDS issues are discussed in more detail
in RFC 4451.

I would be opposed to deriving MEDs from IGP metrics as
a default behavior.

-danny