Title: What is a BGP Path Attribute
1Lecture 3
2What is a BGP Path Attribute?
- BGP uses a set of parameters known as path
attributes to characterize a route. - BGP path attributes are similar in nature to the
IGP metrics. - BGP Update message contains variable number of
path attributes.
3BGP Path Attributes
Attribute Name
Attribute Type Code
Category
4BGP Path Attributes (Well-known)
- Each Path Attribute belongs to one of following
four categories - Well-known Mandatory
- Attribute is recognized by all BGP
implementations - Included in each Update message
- Well-known Discretionary
- Attribute is recognized by all BGP
implementations - It may or may not be present in an Update message
5BGP Path Attributes (Optional)
- Well-known attributes are always transitive
(i.e., to be propagated to peers). The Optional
attributes can be transitive or non-transitive. - Optional Transitive
- Attribute is not recognized by all BGP
implementations - It may or may not be present in an Update message
- If present and transitive flag is set, the
receiving BGP speaker should pass it on to other
peers - Optional Non-transitive
- Attribute is not recognized by all BGP
implementations - It may or may not be present in an Update message
- If present and the non-transitive flag is set,
the BGP speaker should NOT pass it on to other
peers
6Path Attributes Encoding
- Each Path Attribute is encoded as a triple
lttype(T), length(L),value(V)gt or TLV format. - Attribute Type field (2 byte)
- Contains subfields (1 byte each) namely Attribute
Flags and Attribute Type Code - The attribute Flags field is used for
categorization of the attribute (e.g., Well-known
Mandatory, Well-known Discretionary, ) - The attribute type code value is used to identify
a particular Path Attribute (e.g., type code 1
means Origin, type code 2 means AS_Path, )
7Path Attribute Encoding
- Origin (Attribute Type Code 1)
- AS_Path (Attribute Type Code 2)
- Next_Hop (Attribute Type Code 3)
b0 0 means Well-known attribute b0 1 means
Optional attributed b1 0 means the Optional
attribute is non-transitive b1 1 means the
Optional attribute is transitive
8Routing Information Bases (RIBs)
- BGP stores its routes in RIB. BGP routing
information bases can be further categorized as - Adj-RIBs-In
- Stores the routes learned via Update messages
from peers - Adj-RIBs-Out
- Stores the routes selected for advertisement to
peers - Loc-RIB
- Stores routes that have been selected by the
decision process - BGP keeps its forwarding state in forwarding
information base (FIB). - FIB is the routing information that is used for
forwarding.
9BGP Decision Process
- BGP takes Adj-RIBs-In as input and carries out a
three phase decision function for selecting and
advertising the best routes. - Phase I determine a degree of preference (e.g.,
using Local_Pref path attribute or preconfigured
local policy) for each route learned from
neighbors - Phase II select the best route out of all
available routes for each destination and install
it in the Loc-Rib. All routes with unfeasible BGP
next hop addresses (i.e., Next_Hop address) are
excluded from the second phase decision function. - Phase III take Loc-RIB as input, processes it
(e.g., filter, manipulate path attributes) to
influence routing behavior, generate a
corresponding entry in the Adj-RIBs-Out.
10(No Transcript)
11Update (NLRI, attributes)
12BGP Route Selection
- BGP uses path attributes to select best routes
and influence decision process of peers. The
selection of a most preferable route is performed
as follows - From the routes available in Adj-RIBs-In,
exclude routes with inaccessible next hop
address. - Select the routes with largest local preference.
- If local preference is same, select a locally
(by the router) originated route. - If still multiple candidates, select the route
with the shortest AS_Path. - If the AS_Path is same, select the route with
lowest value of origin type (0IGP, 1EGP,
2Incomplete). - If origin type same, select the route with
lowest MED. - ..
13Origin Attribute
- Origin (Attribute Type Code 1) is a Well-Known
path attribute that defines the origin of the
routing information contained in the Update
message. - Origin attribute is created by the AS that
originates routing information (i.e., NLRI) - The receiving speakers pass along the Origin
parameter in their UPDATE messages when
advertising corresponding routing information to
other speakers. - BGP considers following origin types
- (0)IGP - Network Layer Reachability Information
(NLRI) is internal to the originating AS - (1)EGP - NLRI is learned via EGP (e.g., BGP) in
the originating AS - (2)INCOMPLETE NLRI is learned by some other
means in the originating AS.
14(No Transcript)
15AS_Path Attribute
- AS_Path attribute is a Well-known mandatory
attribute - AS_Path attribute identifies the ASs traversed
by the NLRI contained in the Update message - The traversed ASs are recorded in two ways
- Ordered sequence of AS numbers (i.e., AS_Sequence
list), or - Unordered sequence of AS numbers (i.e., AS_Set
list) - When an iBGP speaker originates a route, it
includes an empty AS_Path attribute list. - A BGP speaker includes its AS number in the
AS_Path attribute when advertising or originating
a route to an eBGP peer. - When a BGP speaker advertises a route received
from an eBGP peer to an iBGP peer, it does not
modify the AS_Path attribute.
16(No Transcript)
17AS_Path Attribute
- BGP uses AS_Path attribute to construct a
loop-free AS topology graph. - For instance, BGP does not accept an Update
message if its own AS number is included in the
AS_Path attribute. - BGP also uses the AS_Path attribute in its
decision process for selecting a best route. - For example, when there are several routes to
chose from, BGP selects the route with the
shortest AS_Path attribute. - AS_Path attribute is also used identify routes
for applying input/output route filtering. - In summary, manipulation of AS_Path attribute
enable BGP to influence certain inter-AS routing
behavior.
18(No Transcript)
19AS_Path and Routing Behavior
- We know that in case of a tie, a route with
shorter AS_Path length is preferred. - Thus AS_Path attribute can be used to influence
inter-AS routing behavior. - For example, BGP speaker can insert dummy AS
numbers in the AS_Path attribute to increase its
length to make it less preferable during the BGP
decision process.
20(No Transcript)
21Update (NLRI 172.64.16.0/16, AS_PathAS100,AS100,
AS100, AS00,AS200)
Update (NLRI 172.64.16.0/16, AS_PathAS100,AS100,
AS100)
AS100 inserts dummy AS numbers
Traffic Flow
Update (NLRI 172.64.16.0/16, AS_PathAS100,AS300,
As400)