SlideShare a Scribd company logo
2
Most read
4
Most read
6
Most read
BGP (Border Gateway Routing Protocol)
BGP (Border Gateway Routing Protocol) is a standardized exterior gateway protocol designed to
exchange routing and reachability information between autonomous systems (AS) on the Internet. The
Border Gateway Protocol makes routing decisions based on paths, network policies or rule-sets
configured by a network administrator, and are involved in making core routing decisions.
BGP is a very robust and scalable routing protocol, as evidenced by the fact that BGP is the routing
protocol employed on the Internet.
Basics of BGP
1. BGP is the path-vector protocol that provides routing information for autonomous systems on
the Internet via its AS-Path attribute.
2. BGP is a Layer 4 protocol that sits on top of TCP. It is much simpler than OSPF, because it doesn’t
have to worry about the things TCP will handle.
3. Peers that have been manually configured to exchange routing information will form a TCP
connection and begin speaking BGP. There is no discovery in BGP.
4. Medium-sized businesses usually get into BGP for the purpose of true multi-homing for their
entire network.
Figure 1 Basic Topology of BGP
BGP (Border Gateway Routing Protocol)
5. An important aspect of BGP is that the AS-Path itself is an anti-loop mechanism. Routers will not
import any routes that contain themselves in the AS-Path.
Current Version
The current version of BGP is version 4 (BGP4) codified in RFC 4271 since 2006. Early versions of the
protocol are widely considered obsolete and are rarely supported.
Types of BGP
There are different terms used when describing BGP. These including:
1. Internal BGP (iBGP) operates inside an autonomous System (AS).
2. External BGP (eBGP), which is also known as an interdomain routing protocol, operates outside
an AS and connects one AS to another. These terms are just used to describe the same protocol
just the area of operation is what differs.
Figure 2 Types of BGP
BGP (Border Gateway Routing Protocol)
Uses
Most Internet service providers must use BGP to establish routing between one another (especially if
they are multihomed). Compare this with Signaling System 7 (SS7), which is the inter-provider core call
setup protocol on the PSTN.
Very large private IP networks use BGP internally. An example would be the joining of a number of large
OSPF (Open Shortest Path First) networks where OSPF by itself would not scale to size. Another reason
to use BGP is multihoming a network for better redundancy, either to multiple access points of a single
ISP or to multiple ISPs.
BGP AD
 EBGP-20
 IBGP-200
Characteristics of BGP-4
The key features of BGP-4 include and not limited to these:
1. It is an advanced distance-vector protocol.
2. BGP sends full routing updates at the start of the session, trigger updates are sent afterward.
3. BGP maintains connection by sending periodic keepalives.
4. It creates and maintains connections between peers, using TCP port 179.
5. BGP sends a triggered update when a keepalive, an update, or a notification is not received
6. It has its own routing table, although it is capable of both sharing and inquiring of the interior IP
routing table.
7. BGP uses a very complex metric, and is the source of its strength. The metric, referred to as
attributes, allows great flexibility in path selection.
8. It selects the route based on the AS Path.
9. It selects that route, which provides a network with least AS.
10. Max AS length 65535
11. 1 to 64511 Public
12. 64512 to 65535 Private
13. BGP doesn’t discover neighbour automatically. In BGP we have to define neighbours. They are
called BGP peers.
14. BGP supports only one type of authentication that is MD-5
BGP (Border Gateway Routing Protocol)
How to advertise Routes in BGP?
Using two ways
 Using Network Command
 Redistribution
BGP Messages
1. Open- BGP sends Open message using TCP Port no 179.
Content of Open Message
Version – 4 (Right now we are using BGP V4)
MY-AS – Itself AS number
Router ID
Hold Time – 180 sec (Default)
2. Keep alive- BGP sends periodic keep alive. Default time 60 sec.
3. Update- When two routers become BGP neighbour they send update message.
Contents of update
a) Routes
b) Route Attributes- These are those criteria’s which are used to select the best path.
4. Notification- When a neighbour is reset then it sends notification message. It contains the
cause of resetting.
BGP Tables
1. Neighbour
2. BGP Table
3. Routing Table
BGP States
1. Idle- Searching for Neighbour.
2. Connect- TCP three way handshake done.
3. Open sent- Open message has been sent.
4. Open confirm- Open message has been received.
BGP (Border Gateway Routing Protocol)
5. Established- Connection Done.
BGP Terminology
1. Next Hop Self- When a BGP edge router learns the external routes then it advertise those
routes with default next hop to IBGP neighbour.
To solve this drawback we have a solution that is called next hop self.
This command tells a router give your own IP address as a next hop to your IBGP neighbor.
(Note: Always applied on edge routers.)
2. Route Reflector Client- Normally an IBGP neighbour never exchanges the routes of one
neighbour with another neighbour.
To solve this problem we have a solution that is called route reflector client.
This command tells a router do exchange the routes of one neighbor with another neighbor.
Figure 3 BGP States
BGP (Border Gateway Routing Protocol)
3. EBGP-Multihop- When a BGP router wants to establish EBGP neighbourship then it set TTL
value 1 in open message. If your neighbour is not directly connected, then you have to change
the TTL Value using EBGP Multihop command.
4. Max-Path- By default BGP selects one best path using route attributes. If you want to
implement load balancing then you have to change max path value.
5. BGP- By default, the redistribution of iBGP into IGP isn’t allowed on Cisco IOS.
6. Update Source- When we want to establish neighbourship via loopback then we have to use
update source command.
7. Aggregation- In BGP Summarization is called Aggregation.
BGP Attributes/Rich Metric/Path Attributes
1. Weight- Cisco Proprietary Attributes.
Directly Connected – 32768
Indirectly Connected – 0
Preferred – Directly Connected.
2. Local Preference
Default 100 < 4.2 billion
Preferred – Higher
3. Self-Originate- a router gives preference to self-originate routes.
4. AS-Path- Lowest Path will be Preferred.
5. Origin- ebgp >ibgp >Redistributed
6. MED- Multi Exit Discriminator
By default – 0
Lowest will be preferred.
7. eBGP > iBGP- eBGP will be preferred.
8. IGP Cost- Select Lowest Cost
BGP (Border Gateway Routing Protocol)
9. Ebgp Peer- Old neighbour will be preferred.
10. Router ID- Lower Router ID will be preferred.
By default BGP selects single path, for load balancing we use maximum path command.
BGP Path Selection
BGP could possibly receive multiple advertisements for the same route from multiple sources. BGP
selects only one path as the best path. When the path is selected, BGP puts the selected path in the IP
routing table and propagates the path to its neighbours. BGP uses the following criteria, in the order
presented, to select a path for a destination:
1. If the path specifies a next hop that is inaccessible, drop the update.
2. Prefer the path with the largest weight.
3. If the weights are the same, prefer the path with the largest local preference.
4. If the local preferences are the same, prefer the path that was originated by BGP running on this
router.
5. If no route was originated, prefer the route that has the shortest AS_path.
6. If all paths have the same AS_path length, prefer the path with the lowest origin type (where IGP
is lower than EGP, and EGP is lower than incomplete).
7. If the origin codes are the same, prefer the path with the lowest MED attribute.
8. If the paths have the same MED, prefer the external path over the internal path.
9. If the paths are still the same, prefer the path through the closest IGP neighbour.
10. Prefer the path with the lowest IP address, as specified by the BGP router ID.
Message Header Format
1. Marker- Included for compatibility, must be set to all ones.
2. Length- Total length of the message in octets, including the header.
3. Type- Type of BGP message. The following values are defined:
a) Open (1)
b) Update (2)
c) Notification (3)
Figure 4 Message Header Format
BGP (Border Gateway Routing Protocol)
d) KeepAlive (4)
e) Route-Refresh (5)
BGP Example
R1 (config) #int fa0/0
R1 (config-if) #ip add 172.168.101.1 255.255.255.0
R1 (config-if) #no shut
R1 (config-if) #int s0/0
R1 (config-if) #ip add 192.168.1.1 255.255.255.0
R1 (config-if) #no shut
R1 (config-if) #int s0/1
R1 (config-if) #ip add 192.168.4.2 255.255.255.0
R1 (config-if) #no shut
R1 (config-if) #do sh ip int br
Figure 5 BGP Example Topology
BGP (Border Gateway Routing Protocol)
R2 (config) #int fa0/0
R2 (config-if) #ip add 172.168.102.1 255.255.255.0
R2 (config-if) #no shut
R2 (config-if) #int s0/0
R2 (config-if) #ip add 192.168.1.2 255.255.255.0
R2 (config-if) #no shut
R2 (config-if) #int s0/1
R2 (config-if) #ip add 192.168.2.1 255.255.255.0
R2 (config-if) #no shut
R2 (config-if) #do sh ip int br
R3 (config) #int fa0/0
R3 (config-if) #int 172.168.103.1 255.255.2550
R3 (config-if) #no shut
R3 (config-if) #int s0/0
R3 (config-if) #ip add 192.168.2.2 255.255.255.0
R3 (config-if) #no shut
R3 (config-if) #int s0/1
R3 (config-if) #ip add 192.168.3.1 255.255.255.0
R3 (config-if) #no shut
On Router 3, we will create some loopback also
R3 (config-if) #int lo 1
R3 (config-if) #ip add 172.30.1.1 255.255.255.0
R3 (config-if) #int lo 2
R3 (config-if) #ip add 172.30.2.1 255.255.255.0
R3 (config-if) #int lo 3
R3 (config-if) #ip add 172.30.3.1 255.255.255.0
R3 (config-if) #int lo 4
R3 (config-if) #ip add 172.30.4.1 255.255.255.0
R3 (config-if) #int lo 5
R3 (config-if) #ip add 172.30.5.1 255.255.255.0
R3 (config-if) #do sh ip int br
R4 (config) #int fa0/0
R4 (config-if) #ip add 172.168.104.1 255.255.255.0
R4 (config-if) #no shut
R4 (config-if) #int s0/0
R4 (config-if) #ip add 192.168.3.2 255.255.255.0
R4 (config-if) #no shut
R4 (config-if) #int s0/1
BGP (Border Gateway Routing Protocol)
R4 (config-if) #ip add 192.168.4.1 255.255.255.0
R4 (config-if) #no shut
R4 (config-if) #do sh ip int br
Here we will Perform BGP Routing
R1 (config) #router bgp 100
R1 (config-router) #network 192.168.1.0
R1 (config-router) #network 192.168.4.0
R1 (config-router) #network 172.168.101.0 mask 255.255.255.0
R1 (config-router) #neighbour 192.168.1.2 remote-as 100
R1 (config-router) #neighbour 192.168.4.1 remote-as 100
R2 (config) #router bgp 100
R2 (config-router) #network 192.168.1.0
R2 (config-router) #network 192.68.2.0
R2 (config-router) #network 172.168.102.0 mask 255.255.255.0
R2 (config-router) #neighbour 192.168.1.1 remote-as 100
R2 (config-router) #neighbour 192.168.2.2 remote-as 200
R3 (config) #router bgp 200
R3 (config-router) #network 192.168.2.0
R3 (config-router) #network 192.68.3.0
R3 (config-router) #network 172.168.103.0 mask 255.255.255.0
R3 (config-router) #network 172.30.1.0 mask 255.255.255.0
R3 (config-router) #network 172.30.2.0 mask 255.255.255.0
R3 (config-router) #network 172.30.3.0 mask 255.255.255.0
R3 (config-router) #network 172.30.4.0 mask 255.255.255.0
R3 (config-router) #network 172.30.5.0 mask 255.255.255.0
R3 (config-router) #neighbour 192.168.2.1 remote-as 100
R3 (config-router) #neighbour 192.168.3.2 remote-as 100
R4 (config) #router bgp 100
R4 (config-router) #network 192.168.3.0
R4 (config-router) #network 192.68.4.0
R4 (config-router) #network 172.168.104.0 mask 255.255.255.0
R4 (config-router) #neighbour 192.168.3.1 remote-as 200
R4 (config-router) #neighbour 192.168.4.2 remote-as 100
BGP Creates Three Tables
 Neighbour Table
BGP (Border Gateway Routing Protocol)
R1#sh ip bgp neighbours
R1#sh ip bgp neighbours 192.68.1.2
R1#sh ip bgp neighbours 192.68.4.1
 BGP Table
R1#sh ip bgp
 Routing Table
R1#sh ip route bgp
Now if we talk about the network 172.30.0.0, we can see this network on R1 via 2.2. Because it
advertises routes with default next hop which is 2.2. Now on edge router we run a command next hop
self.
Here edge router is R2 & R4.
R2 (config) #router bgp 100
R2 (config-router) #neighbour 192.168.1.1 next-hop-self
R4 (config) #router bgp 100
R4 (config-router) #neighbour 192.168.4.2 next-hop-self
Here we tell router, provide your own IP add as a next hop.
In BGP a router will share the information with the directly connected router only. Router 1 would not
share the information with the Router 3. For that here we will run route reflector client command.
R2 #sh ip route bgp
We won’t see any routes of 104 networks.
R4 #sh ip route bgp
We won’t see any routes of 102 networks.
R1 (config) #router bgp 100
R1 (config-router) #neighbour 192.168.1.2 rout-reflector-client
R1 (config-router) #neighbour 192.168.4.1 rout-reflector-client
R4#sh ip route bgp
Now we can see here 102 routes.
R2#sh ip route bgp
BGP (Border Gateway Routing Protocol)
We can see 104 routes here.
R1#sh ip bgp
First rich metric is weight
For indirectly connected 0
Next local preference 100. Always prefer higher
Next AS path 200
Next self-originate
MED is by default 0
We have two ID 4.1 & 1.2. 1.2 will prefer (lower will prefer)
R1#sh ip route bgp
Here we can see 172.30.0.0 route learn via 192.168.1.2
R1#traceroute 172.30.1.1 via 1.2
R1#sh ip protocols
By default it selects only one path.
If we want to implement load balance then we need to change max path value.
R1 (Config) #router bgp 100
R1 (config-router) #maximum-paths?
1 to 16

More Related Content

PPT
BGP protocol presentation
PPTX
Border Gateway Protocol (BGP)
PPT
PDF
How BGP Works
PPTX
Bgp protocol
PPTX
Border Gateway Protocol
PPTX
OPEN SHORTEST PATH FIRST (OSPF)
BGP protocol presentation
Border Gateway Protocol (BGP)
How BGP Works
Bgp protocol
Border Gateway Protocol
OPEN SHORTEST PATH FIRST (OSPF)

What's hot (20)

PPTX
Border Gatway Protocol
PPT
PPTX
An Overview of Border Gateway Protocol (BGP)
PPT
PPT
MPLS & BASIC LDP
PPTX
Open Shortest Path First
PPT
PPTX
EIGRP (Enhanced Interior Gateway Routing Protocol)
PDF
Layer 3 redundancy hsrp
PDF
Day 3 ENHANCED IGRP (EIGRP) AND OPEN SHORTEST PATH FIRST (OSPF)
PDF
Segment Routing Lab
PDF
Lte epc kp is and signalling (sf)
PPTX
JUNOS: OSPF and BGP
PPTX
ccna networking ppt
PPT
CCNA SUMMER TRAINNING PPT
PPTX
BGP Path Selection & Attributes BGP Weight & BGP AS-Path Prepending
PDF
MPLS Concepts and Fundamentals
PDF
PPTX
IS-IS Protocol
Border Gatway Protocol
An Overview of Border Gateway Protocol (BGP)
MPLS & BASIC LDP
Open Shortest Path First
EIGRP (Enhanced Interior Gateway Routing Protocol)
Layer 3 redundancy hsrp
Day 3 ENHANCED IGRP (EIGRP) AND OPEN SHORTEST PATH FIRST (OSPF)
Segment Routing Lab
Lte epc kp is and signalling (sf)
JUNOS: OSPF and BGP
ccna networking ppt
CCNA SUMMER TRAINNING PPT
BGP Path Selection & Attributes BGP Weight & BGP AS-Path Prepending
MPLS Concepts and Fundamentals
IS-IS Protocol
Ad

Viewers also liked (20)

PPTX
Osi model
PPT
osi model
PPTX
OSI REFRENCE MODEL by- Mujmmil Shaikh
DOCX
7 Layers OSI model description with 3 unofficial Layers.
PPT
Osi model in networking
PPTX
Osi models
PPT
Computer Network - OSI model
PPT
PPSX
Osi model
PPT
Computer networks--osi model
PPT
Osi model(open system interconnection)
DOCX
Subnetting class C
PPTX
Osi model
PPTX
OSI Reference Model and TCP/IP (Lecture #3 ET3003 Sem1 2014/2015)
PPTX
Physical Layer of ISO-OSI model and Devices
PDF
Eincop Netwax Lab: EIGRP iii
PDF
OSPF (open shortest path first) part ii
PDF
Wireless Technology
PDF
OSPF (open shortest path first) part iii
PDF
VRF Configuration
Osi model
osi model
OSI REFRENCE MODEL by- Mujmmil Shaikh
7 Layers OSI model description with 3 unofficial Layers.
Osi model in networking
Osi models
Computer Network - OSI model
Osi model
Computer networks--osi model
Osi model(open system interconnection)
Subnetting class C
Osi model
OSI Reference Model and TCP/IP (Lecture #3 ET3003 Sem1 2014/2015)
Physical Layer of ISO-OSI model and Devices
Eincop Netwax Lab: EIGRP iii
OSPF (open shortest path first) part ii
Wireless Technology
OSPF (open shortest path first) part iii
VRF Configuration
Ad

Similar to BGP (border gateway routing protocol) (20)

PDF
U5CSS2 (1).pdf
PPTX
Border gateway protocol
PDF
BGP.pdf
PPTX
bgp protocol
PDF
Bgp Toc
PPT
Bgp training
DOCX
CCNP Route 642 902 BGP
PPT
BSCI30S06 border gateway protocol BG ppt
PPTX
ENCOR_Chapter_11 - ‌BGP implementation.pptx
PDF
Redes Avanzado Sdwan proyecto autoestudio
PDF
Cisco ccnp 642-902 practice tests for quick preparation
DOCX
Cisco BGP Exam 642-661 Review Notes
PDF
bgp features presentation routing protocle
PDF
Bgpeuro
PPTX
15 coms 525 tcpip - border gateway protocols
PDF
Halabi Bgp4 Case Studies Tutorial
PDF
Border Gateway Protocol BGP Info abot dynamic
U5CSS2 (1).pdf
Border gateway protocol
BGP.pdf
bgp protocol
Bgp Toc
Bgp training
CCNP Route 642 902 BGP
BSCI30S06 border gateway protocol BG ppt
ENCOR_Chapter_11 - ‌BGP implementation.pptx
Redes Avanzado Sdwan proyecto autoestudio
Cisco ccnp 642-902 practice tests for quick preparation
Cisco BGP Exam 642-661 Review Notes
bgp features presentation routing protocle
Bgpeuro
15 coms 525 tcpip - border gateway protocols
Halabi Bgp4 Case Studies Tutorial
Border Gateway Protocol BGP Info abot dynamic

More from Netwax Lab (20)

PDF
Eincop Netwax Lab: Lab 1 static route
PDF
Eincop Netwax Lab: HSRP (Hot Standby Router Protocol)
PDF
Eincop Netwax Lab: Redistribution
PDF
Eincop Netwax Lab: Route Redistribution
PDF
Nxll12 zone based firewall
PDF
Nxll11 bgp
PDF
Nxll09 access list
PDF
Nxll21 ospf filtering & summarization
PDF
Nxll10 v lan and trunking
PDF
Nxll16 basic asa v8.2
PDF
Nxll20 na ting
PDF
Nxll14 cut through-proxy on asa
PDF
Nxll17 dynamic routing with asa
PDF
Nxll18 vpn (s2 s gre & dmvpn)
PDF
Nxll19 vrrp (virtual router redundancy protocol)
PDF
Nxll22 role based cli
PDF
Nxll25 hsrp with failover
PDF
Nxll26 bgp ii
PDF
Nxll28 ospf iii
PDF
Nxll23 i pv6
Eincop Netwax Lab: Lab 1 static route
Eincop Netwax Lab: HSRP (Hot Standby Router Protocol)
Eincop Netwax Lab: Redistribution
Eincop Netwax Lab: Route Redistribution
Nxll12 zone based firewall
Nxll11 bgp
Nxll09 access list
Nxll21 ospf filtering & summarization
Nxll10 v lan and trunking
Nxll16 basic asa v8.2
Nxll20 na ting
Nxll14 cut through-proxy on asa
Nxll17 dynamic routing with asa
Nxll18 vpn (s2 s gre & dmvpn)
Nxll19 vrrp (virtual router redundancy protocol)
Nxll22 role based cli
Nxll25 hsrp with failover
Nxll26 bgp ii
Nxll28 ospf iii
Nxll23 i pv6

Recently uploaded (20)

PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Cloud computing and distributed systems.
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
cuic standard and advanced reporting.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
MYSQL Presentation for SQL database connectivity
PDF
NewMind AI Monthly Chronicles - July 2025
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Approach and Philosophy of On baking technology
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Encapsulation theory and applications.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Machine learning based COVID-19 study performance prediction
PPT
Teaching material agriculture food technology
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Understanding_Digital_Forensics_Presentation.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Cloud computing and distributed systems.
Dropbox Q2 2025 Financial Results & Investor Presentation
cuic standard and advanced reporting.pdf
Empathic Computing: Creating Shared Understanding
Mobile App Security Testing_ A Comprehensive Guide.pdf
The AUB Centre for AI in Media Proposal.docx
MYSQL Presentation for SQL database connectivity
NewMind AI Monthly Chronicles - July 2025
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Approach and Philosophy of On baking technology
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Encapsulation theory and applications.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
Machine learning based COVID-19 study performance prediction
Teaching material agriculture food technology
Unlocking AI with Model Context Protocol (MCP)
Understanding_Digital_Forensics_Presentation.pptx

BGP (border gateway routing protocol)

  • 1. BGP (Border Gateway Routing Protocol) BGP (Border Gateway Routing Protocol) is a standardized exterior gateway protocol designed to exchange routing and reachability information between autonomous systems (AS) on the Internet. The Border Gateway Protocol makes routing decisions based on paths, network policies or rule-sets configured by a network administrator, and are involved in making core routing decisions. BGP is a very robust and scalable routing protocol, as evidenced by the fact that BGP is the routing protocol employed on the Internet. Basics of BGP 1. BGP is the path-vector protocol that provides routing information for autonomous systems on the Internet via its AS-Path attribute. 2. BGP is a Layer 4 protocol that sits on top of TCP. It is much simpler than OSPF, because it doesn’t have to worry about the things TCP will handle. 3. Peers that have been manually configured to exchange routing information will form a TCP connection and begin speaking BGP. There is no discovery in BGP. 4. Medium-sized businesses usually get into BGP for the purpose of true multi-homing for their entire network. Figure 1 Basic Topology of BGP
  • 2. BGP (Border Gateway Routing Protocol) 5. An important aspect of BGP is that the AS-Path itself is an anti-loop mechanism. Routers will not import any routes that contain themselves in the AS-Path. Current Version The current version of BGP is version 4 (BGP4) codified in RFC 4271 since 2006. Early versions of the protocol are widely considered obsolete and are rarely supported. Types of BGP There are different terms used when describing BGP. These including: 1. Internal BGP (iBGP) operates inside an autonomous System (AS). 2. External BGP (eBGP), which is also known as an interdomain routing protocol, operates outside an AS and connects one AS to another. These terms are just used to describe the same protocol just the area of operation is what differs. Figure 2 Types of BGP
  • 3. BGP (Border Gateway Routing Protocol) Uses Most Internet service providers must use BGP to establish routing between one another (especially if they are multihomed). Compare this with Signaling System 7 (SS7), which is the inter-provider core call setup protocol on the PSTN. Very large private IP networks use BGP internally. An example would be the joining of a number of large OSPF (Open Shortest Path First) networks where OSPF by itself would not scale to size. Another reason to use BGP is multihoming a network for better redundancy, either to multiple access points of a single ISP or to multiple ISPs. BGP AD  EBGP-20  IBGP-200 Characteristics of BGP-4 The key features of BGP-4 include and not limited to these: 1. It is an advanced distance-vector protocol. 2. BGP sends full routing updates at the start of the session, trigger updates are sent afterward. 3. BGP maintains connection by sending periodic keepalives. 4. It creates and maintains connections between peers, using TCP port 179. 5. BGP sends a triggered update when a keepalive, an update, or a notification is not received 6. It has its own routing table, although it is capable of both sharing and inquiring of the interior IP routing table. 7. BGP uses a very complex metric, and is the source of its strength. The metric, referred to as attributes, allows great flexibility in path selection. 8. It selects the route based on the AS Path. 9. It selects that route, which provides a network with least AS. 10. Max AS length 65535 11. 1 to 64511 Public 12. 64512 to 65535 Private 13. BGP doesn’t discover neighbour automatically. In BGP we have to define neighbours. They are called BGP peers. 14. BGP supports only one type of authentication that is MD-5
  • 4. BGP (Border Gateway Routing Protocol) How to advertise Routes in BGP? Using two ways  Using Network Command  Redistribution BGP Messages 1. Open- BGP sends Open message using TCP Port no 179. Content of Open Message Version – 4 (Right now we are using BGP V4) MY-AS – Itself AS number Router ID Hold Time – 180 sec (Default) 2. Keep alive- BGP sends periodic keep alive. Default time 60 sec. 3. Update- When two routers become BGP neighbour they send update message. Contents of update a) Routes b) Route Attributes- These are those criteria’s which are used to select the best path. 4. Notification- When a neighbour is reset then it sends notification message. It contains the cause of resetting. BGP Tables 1. Neighbour 2. BGP Table 3. Routing Table BGP States 1. Idle- Searching for Neighbour. 2. Connect- TCP three way handshake done. 3. Open sent- Open message has been sent. 4. Open confirm- Open message has been received.
  • 5. BGP (Border Gateway Routing Protocol) 5. Established- Connection Done. BGP Terminology 1. Next Hop Self- When a BGP edge router learns the external routes then it advertise those routes with default next hop to IBGP neighbour. To solve this drawback we have a solution that is called next hop self. This command tells a router give your own IP address as a next hop to your IBGP neighbor. (Note: Always applied on edge routers.) 2. Route Reflector Client- Normally an IBGP neighbour never exchanges the routes of one neighbour with another neighbour. To solve this problem we have a solution that is called route reflector client. This command tells a router do exchange the routes of one neighbor with another neighbor. Figure 3 BGP States
  • 6. BGP (Border Gateway Routing Protocol) 3. EBGP-Multihop- When a BGP router wants to establish EBGP neighbourship then it set TTL value 1 in open message. If your neighbour is not directly connected, then you have to change the TTL Value using EBGP Multihop command. 4. Max-Path- By default BGP selects one best path using route attributes. If you want to implement load balancing then you have to change max path value. 5. BGP- By default, the redistribution of iBGP into IGP isn’t allowed on Cisco IOS. 6. Update Source- When we want to establish neighbourship via loopback then we have to use update source command. 7. Aggregation- In BGP Summarization is called Aggregation. BGP Attributes/Rich Metric/Path Attributes 1. Weight- Cisco Proprietary Attributes. Directly Connected – 32768 Indirectly Connected – 0 Preferred – Directly Connected. 2. Local Preference Default 100 < 4.2 billion Preferred – Higher 3. Self-Originate- a router gives preference to self-originate routes. 4. AS-Path- Lowest Path will be Preferred. 5. Origin- ebgp >ibgp >Redistributed 6. MED- Multi Exit Discriminator By default – 0 Lowest will be preferred. 7. eBGP > iBGP- eBGP will be preferred. 8. IGP Cost- Select Lowest Cost
  • 7. BGP (Border Gateway Routing Protocol) 9. Ebgp Peer- Old neighbour will be preferred. 10. Router ID- Lower Router ID will be preferred. By default BGP selects single path, for load balancing we use maximum path command. BGP Path Selection BGP could possibly receive multiple advertisements for the same route from multiple sources. BGP selects only one path as the best path. When the path is selected, BGP puts the selected path in the IP routing table and propagates the path to its neighbours. BGP uses the following criteria, in the order presented, to select a path for a destination: 1. If the path specifies a next hop that is inaccessible, drop the update. 2. Prefer the path with the largest weight. 3. If the weights are the same, prefer the path with the largest local preference. 4. If the local preferences are the same, prefer the path that was originated by BGP running on this router. 5. If no route was originated, prefer the route that has the shortest AS_path. 6. If all paths have the same AS_path length, prefer the path with the lowest origin type (where IGP is lower than EGP, and EGP is lower than incomplete). 7. If the origin codes are the same, prefer the path with the lowest MED attribute. 8. If the paths have the same MED, prefer the external path over the internal path. 9. If the paths are still the same, prefer the path through the closest IGP neighbour. 10. Prefer the path with the lowest IP address, as specified by the BGP router ID. Message Header Format 1. Marker- Included for compatibility, must be set to all ones. 2. Length- Total length of the message in octets, including the header. 3. Type- Type of BGP message. The following values are defined: a) Open (1) b) Update (2) c) Notification (3) Figure 4 Message Header Format
  • 8. BGP (Border Gateway Routing Protocol) d) KeepAlive (4) e) Route-Refresh (5) BGP Example R1 (config) #int fa0/0 R1 (config-if) #ip add 172.168.101.1 255.255.255.0 R1 (config-if) #no shut R1 (config-if) #int s0/0 R1 (config-if) #ip add 192.168.1.1 255.255.255.0 R1 (config-if) #no shut R1 (config-if) #int s0/1 R1 (config-if) #ip add 192.168.4.2 255.255.255.0 R1 (config-if) #no shut R1 (config-if) #do sh ip int br Figure 5 BGP Example Topology
  • 9. BGP (Border Gateway Routing Protocol) R2 (config) #int fa0/0 R2 (config-if) #ip add 172.168.102.1 255.255.255.0 R2 (config-if) #no shut R2 (config-if) #int s0/0 R2 (config-if) #ip add 192.168.1.2 255.255.255.0 R2 (config-if) #no shut R2 (config-if) #int s0/1 R2 (config-if) #ip add 192.168.2.1 255.255.255.0 R2 (config-if) #no shut R2 (config-if) #do sh ip int br R3 (config) #int fa0/0 R3 (config-if) #int 172.168.103.1 255.255.2550 R3 (config-if) #no shut R3 (config-if) #int s0/0 R3 (config-if) #ip add 192.168.2.2 255.255.255.0 R3 (config-if) #no shut R3 (config-if) #int s0/1 R3 (config-if) #ip add 192.168.3.1 255.255.255.0 R3 (config-if) #no shut On Router 3, we will create some loopback also R3 (config-if) #int lo 1 R3 (config-if) #ip add 172.30.1.1 255.255.255.0 R3 (config-if) #int lo 2 R3 (config-if) #ip add 172.30.2.1 255.255.255.0 R3 (config-if) #int lo 3 R3 (config-if) #ip add 172.30.3.1 255.255.255.0 R3 (config-if) #int lo 4 R3 (config-if) #ip add 172.30.4.1 255.255.255.0 R3 (config-if) #int lo 5 R3 (config-if) #ip add 172.30.5.1 255.255.255.0 R3 (config-if) #do sh ip int br R4 (config) #int fa0/0 R4 (config-if) #ip add 172.168.104.1 255.255.255.0 R4 (config-if) #no shut R4 (config-if) #int s0/0 R4 (config-if) #ip add 192.168.3.2 255.255.255.0 R4 (config-if) #no shut R4 (config-if) #int s0/1
  • 10. BGP (Border Gateway Routing Protocol) R4 (config-if) #ip add 192.168.4.1 255.255.255.0 R4 (config-if) #no shut R4 (config-if) #do sh ip int br Here we will Perform BGP Routing R1 (config) #router bgp 100 R1 (config-router) #network 192.168.1.0 R1 (config-router) #network 192.168.4.0 R1 (config-router) #network 172.168.101.0 mask 255.255.255.0 R1 (config-router) #neighbour 192.168.1.2 remote-as 100 R1 (config-router) #neighbour 192.168.4.1 remote-as 100 R2 (config) #router bgp 100 R2 (config-router) #network 192.168.1.0 R2 (config-router) #network 192.68.2.0 R2 (config-router) #network 172.168.102.0 mask 255.255.255.0 R2 (config-router) #neighbour 192.168.1.1 remote-as 100 R2 (config-router) #neighbour 192.168.2.2 remote-as 200 R3 (config) #router bgp 200 R3 (config-router) #network 192.168.2.0 R3 (config-router) #network 192.68.3.0 R3 (config-router) #network 172.168.103.0 mask 255.255.255.0 R3 (config-router) #network 172.30.1.0 mask 255.255.255.0 R3 (config-router) #network 172.30.2.0 mask 255.255.255.0 R3 (config-router) #network 172.30.3.0 mask 255.255.255.0 R3 (config-router) #network 172.30.4.0 mask 255.255.255.0 R3 (config-router) #network 172.30.5.0 mask 255.255.255.0 R3 (config-router) #neighbour 192.168.2.1 remote-as 100 R3 (config-router) #neighbour 192.168.3.2 remote-as 100 R4 (config) #router bgp 100 R4 (config-router) #network 192.168.3.0 R4 (config-router) #network 192.68.4.0 R4 (config-router) #network 172.168.104.0 mask 255.255.255.0 R4 (config-router) #neighbour 192.168.3.1 remote-as 200 R4 (config-router) #neighbour 192.168.4.2 remote-as 100 BGP Creates Three Tables  Neighbour Table
  • 11. BGP (Border Gateway Routing Protocol) R1#sh ip bgp neighbours R1#sh ip bgp neighbours 192.68.1.2 R1#sh ip bgp neighbours 192.68.4.1  BGP Table R1#sh ip bgp  Routing Table R1#sh ip route bgp Now if we talk about the network 172.30.0.0, we can see this network on R1 via 2.2. Because it advertises routes with default next hop which is 2.2. Now on edge router we run a command next hop self. Here edge router is R2 & R4. R2 (config) #router bgp 100 R2 (config-router) #neighbour 192.168.1.1 next-hop-self R4 (config) #router bgp 100 R4 (config-router) #neighbour 192.168.4.2 next-hop-self Here we tell router, provide your own IP add as a next hop. In BGP a router will share the information with the directly connected router only. Router 1 would not share the information with the Router 3. For that here we will run route reflector client command. R2 #sh ip route bgp We won’t see any routes of 104 networks. R4 #sh ip route bgp We won’t see any routes of 102 networks. R1 (config) #router bgp 100 R1 (config-router) #neighbour 192.168.1.2 rout-reflector-client R1 (config-router) #neighbour 192.168.4.1 rout-reflector-client R4#sh ip route bgp Now we can see here 102 routes. R2#sh ip route bgp
  • 12. BGP (Border Gateway Routing Protocol) We can see 104 routes here. R1#sh ip bgp First rich metric is weight For indirectly connected 0 Next local preference 100. Always prefer higher Next AS path 200 Next self-originate MED is by default 0 We have two ID 4.1 & 1.2. 1.2 will prefer (lower will prefer) R1#sh ip route bgp Here we can see 172.30.0.0 route learn via 192.168.1.2 R1#traceroute 172.30.1.1 via 1.2 R1#sh ip protocols By default it selects only one path. If we want to implement load balance then we need to change max path value. R1 (Config) #router bgp 100 R1 (config-router) #maximum-paths? 1 to 16