SlideShare a Scribd company logo
Presentation on
BGP Path Selection & Attributes
BGP Weight
&
BGP AS-Path Prepending
Prsented By
• Shawan Roy
• Mobile: 01933827475
BGP Path Selection &
Attributes
Difference Between BGP & IGP Path Selection
• BGP (Border Gateway Protocol)
routers usually receive multiple
paths to the same destination.
• BGP however, selects the best
path based on a set of
attributes.
• IGPs select the path with the
lowest metric. For example:
• RIP selects the path with the
lowest hop count.
• OSPF selects the path with the
lowest cost.
• EIGRP selects the path with the
highest bandwidth and lowest
delay (unless you change the K
values).
How to know about best path in BGP?
Path is selected based on the following attributes
Priority Attribute
1 Weight
2 Local Preference
3 Originate
4 AS path length
5 Origin code
6 MED (MULTI_EXIT_DISC)
7 eBGP path over iBGP path
8 Shortest IGP path to BGP next hop
9 Oldest path
10 Router ID
11 Neighbor IP address
Quick overview of Each Attribute (1 of 3)
• Weight: Prefer the path with the highest weight. This is a value that is local to the router
and it’s Cisco proprietary. The default value is 0 for all routes that are not originated by
the local router.
• Local Preference: The local preference is used within an autonomous system and
exchanged between iBGP routers. We prefer the path with the highest local preference.
The default value is 100.
• Originate: Prefer the path that the local router originated. In the BGP table, you will see
next hop 0.0.0.0. You can get a path in the BGP table through the BGP network
command, aggregation, or redistribution. A BGP router will prefer routes that it installed
into BGP itself over a route that another router installed in BGP.
• AS path length: Prefer the path with the shortest AS path length. For example, AS path 1
2 3 is preferred over AS path 1 2 3 4 5.
Quick overview of Each Attribute (2 of 3)
• Origin code: Prefer the lowest origin code. There are three origin
codes: IGP, EGP, INCOMPLETE. IGP is lower than EGP and EGP is lower
than INCOMPLETE.
• MED (MULTI_EXIT_DISC): Prefer the path with the lowest MED. The
MED is exchanged between autonomous systems.
• eBGP path over iBGP path: Prefer eBGP (external BGP) over iBGP
(internal BGP) paths.
• Shortest IGP path to BGP next hop: Prefer the path within the
autonomous system with the lowest IGP metric to the BGP next hop.
Quick overview of Each Attribute (3 of 3)
• Oldest Path: Prefer the path that we received first, in other words, the
oldest path.
• Router ID: Prefer the path with the lowest BGP neighbor router ID.
The router ID is based on the highest IP address. If you have a
loopback interface, then the IP address on the loopback will be used.
The router ID can also be manually configured.
• Neighbor IP address: Prefer the path with the lowest neighbor IP
address. If you have two eBGP routers and two links in between then
the router ID will be the same. In this case, the neighbor IP address is
the tiebreaker.
BGP Weight Attribute
About BGP Weight Attribute (1 of 2)
• BGP weight attribute is a Cisco proprietary path attribute that is local
to the router and is used to influence local path selection on a certain
router.
• BGP weight is the first tie breaker for best path selection on a Cisco
router, the attribute is not propagated to other routers in the BGP
updates and only found on Cisco routers.
• The path with the highest weight is selected as the best toward a
destination.
About BGP Weight Attribute (2 of 2)
• The weight can be a number from 0 to 65,535. Paths that the router
originates have a weight of 32,768 by default, and other paths have a
weight of 0. As we mentioned earlier the path with the highest weight
value wins.
• BGP weight can be set using three ways on a Cisco router. Those are:
assigned per neighbor, using AS-Path access lists, using route-maps
(complex).
• BGP weight is the easiest way to manipulate the BGP path selection
on a single Cisco router for outbound traffic. The attribute is local and
will not be propagated to other routers in the network within the BGP
update messages.
BGP Weight Attribute Assigned per neighbor (1 of
4)
• R1 to get to R6 it has chosen the path through
R4-
When both paths are external prefer the oldest one –
This is the tiebreaker!
BGP Weight Attribute Assigned per neighbor (2 of
4)
• To prove that we can restart the bgp process on R4 to
make R5 the oldest route. On R4 I have done a clear ip
bgp * This now makes the route through R5 the oldest
one and is preferred.
BGP Weight Attribute Assigned per neighbor (3 of
4)
• Under BGP enter the following command – neighbor
10.0.14.4 weight 100
BGP Weight Attribute Assigned per neighbor (4 of
4)
• You will also notice that all prefixes received from R4 have
also had their weight changed to 100
BGP Weight Attribute Using AS-Path access lists (1
of 2)
• For this example we only want to set the weight for the
6.6.6.6/32 prefix. First we need to match this prefix in an
access list
This is now applied to the neighbor statement for R4 – we also need to remove the previous
weight attribute
BGP Weight Attribute Using AS-Path access lists (1
of 2)
• You can see now that we have changed the weight
attribute for the 6.6.6.6/32 prefix only. All other routes
have the default weight of 0.
BGP AS-Path Prepending
About BGP AS-Path Prepending
• AS-Path prepending is a way to manipulate the AS-Path attribute of a
BGP route.
• It allows prepending multiple entries of AS to a BGP route.
• This can come as a workaround if a specific path is required to be
followed, and other means like Multi-Exit Discriminator (MED) is not
supported.
• AS-Path prepending can be applied to inbound and outbound
direction using route-maps.
Outbound AS-Path Prepending (1 of 2)
• AS-Path prepending can be
applied to outbound direction
on R3 router as below-
• Outbound AS-Path prepending on
R3-
Outbound AS-Path Prepending (2 of 2)
• When R3 router advertises its 10.1.1.0/24 network
to R2 router, it prepends its own AS 200 multiple
times. However, R1 router receives the original
BGP route with a single AS-path entry.
• BGP tables on R1 and R2-
R2 router has two paths to 10.1.1.0/24. However, it
chooses the path through R1 since that path has
shortest AS-Path (indicated by a > sign, meaning best
route). Hence, the direct path through R3 router can
act as a backup path.
Inbound AS-Path Prepending (1 of 2)
• Inbound AS-Path prepending is configured using
set as-path prepend last-as command under route-
map which is then applied in inbound direction.
The last-as keyword copies the AS number of the
neighbor advertising the BGP route that matches
the route-map.
• Inbound AS-Path prepending on R1-
Inbound AS-Path Prepending (2 of 2)
• This configuration causes R1 to prepend the AS
number of R3 twice before installing in the BGP
table. As seen below, R3 does not prepend any AS
number by itself.
• BGP tables on R1 and R3-
References
• https://networklessons.com/bgp/bgp-attributes-and-path-selection
• http://www.networkers-online.com/blog/2012/05/bgp-weight/
• https://www.rogerperkin.co.uk/bgp/bgp-weight-attribute/
• https://sites.google.com/site/amitsciscozone/home/bgp/bgp-as-
path-prepending-and-as-path-filters
Thank You!

More Related Content

PPTX
Border Gateway Protocol
PDF
How BGP Works
PPT
PPTX
Bgp protocol
PDF
Bgp tutorial for ISP
PPT
BGP protocol presentation
PPTX
Cisco Live Milan 2015 - BGP advance
PPTX
IP Multicasting
Border Gateway Protocol
How BGP Works
Bgp protocol
Bgp tutorial for ISP
BGP protocol presentation
Cisco Live Milan 2015 - BGP advance
IP Multicasting

What's hot (20)

PDF
MPLS Traffic Engineering
PPT
PPTX
EIGRP (Enhanced Interior Gateway Routing Protocol)
PPTX
EIGRP Overview
PPT
Mpls L3_vpn
PPT
Static Routing
PPTX
Open shortest path first (ospf)
PPTX
Border Gatway Protocol
PDF
Implementing cisco mpls
PDF
VXLAN BGP EVPN: Technology Building Blocks
PDF
Segment Routing Lab
PDF
Deploy MPLS Traffic Engineering
PPTX
Routing protocols
PPTX
MPLS L3 VPN Tutorial, by Nurul Islam Roman [APNIC 38]
PPT
PDF
MPLS L3 VPN Deployment
PPT
MPLS & BASIC LDP
PPTX
PPTX
Open Shortest Path First
MPLS Traffic Engineering
EIGRP (Enhanced Interior Gateway Routing Protocol)
EIGRP Overview
Mpls L3_vpn
Static Routing
Open shortest path first (ospf)
Border Gatway Protocol
Implementing cisco mpls
VXLAN BGP EVPN: Technology Building Blocks
Segment Routing Lab
Deploy MPLS Traffic Engineering
Routing protocols
MPLS L3 VPN Tutorial, by Nurul Islam Roman [APNIC 38]
MPLS L3 VPN Deployment
MPLS & BASIC LDP
Open Shortest Path First
Ad

Similar to BGP Path Selection & Attributes BGP Weight & BGP AS-Path Prepending (20)

PPT
Bgp training
PDF
BGP (border gateway routing protocol)
PPT
bgp1 cryptogrphy and network security.ppt
PPT
B G P Part2
PPT
B G P Part2
DOCX
Cisco BGP Exam 642-661 Review Notes
PDF
Bgp Toc
PDF
Apnic_bgp_training_cisco_ciscosaicoc.pdf
PDF
A Deep Dive into BAsic and Design Best PRactices fr BGP and L3VPN
PPT
BSCI30S06 border gateway protocol BG ppt
PDF
Bgp
PDF
DOC
Study Notes BGP Exam
PDF
PLNOG15: BGP New Advanced Features - Piotr Wojciechowski
PDF
BGP Techniques for Network Operators
PDF
bgp_attributes_202uyuyuyuyuyuyuyu00124.pdf
DOCX
Describe the different metrics that BGP can use in building a routing.docx
Bgp training
BGP (border gateway routing protocol)
bgp1 cryptogrphy and network security.ppt
B G P Part2
B G P Part2
Cisco BGP Exam 642-661 Review Notes
Bgp Toc
Apnic_bgp_training_cisco_ciscosaicoc.pdf
A Deep Dive into BAsic and Design Best PRactices fr BGP and L3VPN
BSCI30S06 border gateway protocol BG ppt
Bgp
Study Notes BGP Exam
PLNOG15: BGP New Advanced Features - Piotr Wojciechowski
BGP Techniques for Network Operators
bgp_attributes_202uyuyuyuyuyuyuyu00124.pdf
Describe the different metrics that BGP can use in building a routing.docx
Ad

More from Shawan Roy (15)

PPTX
Presentation on Pretreatment (Scouring & Bleaching)
PPTX
Presentation on Smart Textile
PDF
Assignment on Camouflage Fabric
PPTX
Presentation on Camouflage Fabric
PDF
Calculation of rf for maddar & turmeric
PDF
Assignment on latest development on dyeing technique
DOCX
Astm standard on apparel (Source Copy)
PPTX
ASTM Standard on Apparel
PPTX
Weft knit fabric geometry
PPTX
Presentation on Weft Knitting Machine (Single Jersey, Rib & Interlock)
PPSX
Presentation on children's wear
PPTX
Method for measuring or investigation of fiber structure
PPTX
RN cleaner
PPTX
Method for measuring or investigation of fiber structure
PPTX
Electromagnetic field (emf)
Presentation on Pretreatment (Scouring & Bleaching)
Presentation on Smart Textile
Assignment on Camouflage Fabric
Presentation on Camouflage Fabric
Calculation of rf for maddar & turmeric
Assignment on latest development on dyeing technique
Astm standard on apparel (Source Copy)
ASTM Standard on Apparel
Weft knit fabric geometry
Presentation on Weft Knitting Machine (Single Jersey, Rib & Interlock)
Presentation on children's wear
Method for measuring or investigation of fiber structure
RN cleaner
Method for measuring or investigation of fiber structure
Electromagnetic field (emf)

Recently uploaded (20)

PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
01-Introduction-to-Information-Management.pdf
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
Classroom Observation Tools for Teachers
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
master seminar digital applications in india
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
RMMM.pdf make it easy to upload and study
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Insiders guide to clinical Medicine.pdf
PPTX
Cell Structure & Organelles in detailed.
PDF
Complications of Minimal Access Surgery at WLH
PPTX
Pharma ospi slides which help in ospi learning
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
VCE English Exam - Section C Student Revision Booklet
01-Introduction-to-Information-Management.pdf
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Classroom Observation Tools for Teachers
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
master seminar digital applications in india
102 student loan defaulters named and shamed – Is someone you know on the list?
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
TR - Agricultural Crops Production NC III.pdf
RMMM.pdf make it easy to upload and study
Final Presentation General Medicine 03-08-2024.pptx
Insiders guide to clinical Medicine.pdf
Cell Structure & Organelles in detailed.
Complications of Minimal Access Surgery at WLH
Pharma ospi slides which help in ospi learning

BGP Path Selection & Attributes BGP Weight & BGP AS-Path Prepending

  • 1. Presentation on BGP Path Selection & Attributes BGP Weight & BGP AS-Path Prepending
  • 2. Prsented By • Shawan Roy • Mobile: 01933827475
  • 3. BGP Path Selection & Attributes
  • 4. Difference Between BGP & IGP Path Selection • BGP (Border Gateway Protocol) routers usually receive multiple paths to the same destination. • BGP however, selects the best path based on a set of attributes. • IGPs select the path with the lowest metric. For example: • RIP selects the path with the lowest hop count. • OSPF selects the path with the lowest cost. • EIGRP selects the path with the highest bandwidth and lowest delay (unless you change the K values).
  • 5. How to know about best path in BGP?
  • 6. Path is selected based on the following attributes Priority Attribute 1 Weight 2 Local Preference 3 Originate 4 AS path length 5 Origin code 6 MED (MULTI_EXIT_DISC) 7 eBGP path over iBGP path 8 Shortest IGP path to BGP next hop 9 Oldest path 10 Router ID 11 Neighbor IP address
  • 7. Quick overview of Each Attribute (1 of 3) • Weight: Prefer the path with the highest weight. This is a value that is local to the router and it’s Cisco proprietary. The default value is 0 for all routes that are not originated by the local router. • Local Preference: The local preference is used within an autonomous system and exchanged between iBGP routers. We prefer the path with the highest local preference. The default value is 100. • Originate: Prefer the path that the local router originated. In the BGP table, you will see next hop 0.0.0.0. You can get a path in the BGP table through the BGP network command, aggregation, or redistribution. A BGP router will prefer routes that it installed into BGP itself over a route that another router installed in BGP. • AS path length: Prefer the path with the shortest AS path length. For example, AS path 1 2 3 is preferred over AS path 1 2 3 4 5.
  • 8. Quick overview of Each Attribute (2 of 3) • Origin code: Prefer the lowest origin code. There are three origin codes: IGP, EGP, INCOMPLETE. IGP is lower than EGP and EGP is lower than INCOMPLETE. • MED (MULTI_EXIT_DISC): Prefer the path with the lowest MED. The MED is exchanged between autonomous systems. • eBGP path over iBGP path: Prefer eBGP (external BGP) over iBGP (internal BGP) paths. • Shortest IGP path to BGP next hop: Prefer the path within the autonomous system with the lowest IGP metric to the BGP next hop.
  • 9. Quick overview of Each Attribute (3 of 3) • Oldest Path: Prefer the path that we received first, in other words, the oldest path. • Router ID: Prefer the path with the lowest BGP neighbor router ID. The router ID is based on the highest IP address. If you have a loopback interface, then the IP address on the loopback will be used. The router ID can also be manually configured. • Neighbor IP address: Prefer the path with the lowest neighbor IP address. If you have two eBGP routers and two links in between then the router ID will be the same. In this case, the neighbor IP address is the tiebreaker.
  • 11. About BGP Weight Attribute (1 of 2) • BGP weight attribute is a Cisco proprietary path attribute that is local to the router and is used to influence local path selection on a certain router. • BGP weight is the first tie breaker for best path selection on a Cisco router, the attribute is not propagated to other routers in the BGP updates and only found on Cisco routers. • The path with the highest weight is selected as the best toward a destination.
  • 12. About BGP Weight Attribute (2 of 2) • The weight can be a number from 0 to 65,535. Paths that the router originates have a weight of 32,768 by default, and other paths have a weight of 0. As we mentioned earlier the path with the highest weight value wins. • BGP weight can be set using three ways on a Cisco router. Those are: assigned per neighbor, using AS-Path access lists, using route-maps (complex). • BGP weight is the easiest way to manipulate the BGP path selection on a single Cisco router for outbound traffic. The attribute is local and will not be propagated to other routers in the network within the BGP update messages.
  • 13. BGP Weight Attribute Assigned per neighbor (1 of 4) • R1 to get to R6 it has chosen the path through R4- When both paths are external prefer the oldest one – This is the tiebreaker!
  • 14. BGP Weight Attribute Assigned per neighbor (2 of 4) • To prove that we can restart the bgp process on R4 to make R5 the oldest route. On R4 I have done a clear ip bgp * This now makes the route through R5 the oldest one and is preferred.
  • 15. BGP Weight Attribute Assigned per neighbor (3 of 4) • Under BGP enter the following command – neighbor 10.0.14.4 weight 100
  • 16. BGP Weight Attribute Assigned per neighbor (4 of 4) • You will also notice that all prefixes received from R4 have also had their weight changed to 100
  • 17. BGP Weight Attribute Using AS-Path access lists (1 of 2) • For this example we only want to set the weight for the 6.6.6.6/32 prefix. First we need to match this prefix in an access list This is now applied to the neighbor statement for R4 – we also need to remove the previous weight attribute
  • 18. BGP Weight Attribute Using AS-Path access lists (1 of 2) • You can see now that we have changed the weight attribute for the 6.6.6.6/32 prefix only. All other routes have the default weight of 0.
  • 20. About BGP AS-Path Prepending • AS-Path prepending is a way to manipulate the AS-Path attribute of a BGP route. • It allows prepending multiple entries of AS to a BGP route. • This can come as a workaround if a specific path is required to be followed, and other means like Multi-Exit Discriminator (MED) is not supported. • AS-Path prepending can be applied to inbound and outbound direction using route-maps.
  • 21. Outbound AS-Path Prepending (1 of 2) • AS-Path prepending can be applied to outbound direction on R3 router as below- • Outbound AS-Path prepending on R3-
  • 22. Outbound AS-Path Prepending (2 of 2) • When R3 router advertises its 10.1.1.0/24 network to R2 router, it prepends its own AS 200 multiple times. However, R1 router receives the original BGP route with a single AS-path entry. • BGP tables on R1 and R2- R2 router has two paths to 10.1.1.0/24. However, it chooses the path through R1 since that path has shortest AS-Path (indicated by a > sign, meaning best route). Hence, the direct path through R3 router can act as a backup path.
  • 23. Inbound AS-Path Prepending (1 of 2) • Inbound AS-Path prepending is configured using set as-path prepend last-as command under route- map which is then applied in inbound direction. The last-as keyword copies the AS number of the neighbor advertising the BGP route that matches the route-map. • Inbound AS-Path prepending on R1-
  • 24. Inbound AS-Path Prepending (2 of 2) • This configuration causes R1 to prepend the AS number of R3 twice before installing in the BGP table. As seen below, R3 does not prepend any AS number by itself. • BGP tables on R1 and R3-
  • 25. References • https://networklessons.com/bgp/bgp-attributes-and-path-selection • http://www.networkers-online.com/blog/2012/05/bgp-weight/ • https://www.rogerperkin.co.uk/bgp/bgp-weight-attribute/ • https://sites.google.com/site/amitsciscozone/home/bgp/bgp-as- path-prepending-and-as-path-filters