Saturday, August 3, 2013

Non-transitive Path Attributes BGP

A lot of confusion exists on  the BGP Path-Attribute  known as  MEDs. And one of the main issues that one needs to be aware of is ; " that this metric is non transitive"

What that means, a provider router does not send this the path_attribute outside of it's AS. Take this  simple BGP  topology

R1 = AS1
R2 = AS2
R3 = AS3

R1 is announcing the prefix 10.10.10.0/24 & sourced from it's  loopback interface,  with a metric value of 200.

"What would  R2 see ?"  and  "What would R3 see ?"


Okay let's see the cfg of the 3 players;


1st

R1:




R2:



R3:



Okay now let's look at the bgp table for 10.10.10.0/24;


1st

 R1;



I want to point out the following; the R1 is the source of the advertisement and the metric are only adjusted via the route-map applied on towards neighbor 1.1.1.2.


Now let's look at R2  bgp table;




Notice the metric it received from 1.1.1.1 ( R1 @ AS1 )   equals  200 ? Okay that's was because of the  applied  route-map called  bgp-med ; and with the  set metric 200  statement.


Now moving on to R3.

It's bgp table will not reflect this same metric as seen via R2. And that's the point of this blog and the title "Non-transitive attributes"




You notice we are metric free on R3 for advertisement received from  2.2.2.1 ( R2  @ AS2 ) for the  prefix 10.10.10.0/24.  R2 drop that attribute, &  from it's advertisements towards R3.



I hope this give you an ideal and better understanding on path attributes and how some things are not included in bgp announcements.


Here's some of the common  path_attributes that  you might run across ;

ORIGIN ( mandatory well known      how the route was originated  network statement, redistribute, etc.... )
AS_PATH  ( mandatory well known  changes each time we cross a AS boundary known simple as bgp path or AS hops towards the origination, as we cross AS, we add the AS# to this path_attribute  )
AS4_PATH  ( mandatory well known  4 byte AS same concept as the above )
NEXT_HOP  ( mandatory well known changes,  per each AS router  )

ATOMIC_AGGREGATOR ( discretionary well-known   provides information that part of the attribute might be lost during summarizations )
Local-Preference ( discretionary well-known   local within that AS locally )

AGGREGATOR  (optional transitive )
AS4_AGGREGATOR  (optional transitive )
COMMUNITIES  (optional transitive     used to enforce bgp policies , 32bit value  )
EXTEND_COMMUNITIES  (optional transitive     used to enforce bgp policies , extended and increase bit size  typically represented as AS:VALUE   i.e  7018:65001   )


Multiprotocol  UN/Reachable  (  optional non-transitive )
Multi_Exit_Discriminator  (  optional non-transitive )

Cluster_ID  (  optional non-transitive    using primary by  BGP router reflectors )


Now go out and do some BGP :)



Ken Felix
Freelance Network / Security Engineer
kfelix  ----a----t----socpuppets ---d---o---t---com


   ^      ^
=( *    * )=
        @
      /     \


No comments:

Post a Comment