NXLD41 BGP (Border Gateway Routing Protocol)
NXLD41 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.
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:
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:
BGP Messages
1. Open- BGP sends Open message using TCP Port no 179.
Router ID
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)
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.
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.
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.
Indirectly Connected – 0
2. Local Preference
Preferred – Higher
By default – 0
By default BGP selects single path, for load balancing we use maximum path command.
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.
d) KeepAlive (4)
e) Route-Refresh (5)
BGP Example
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
Neighbour Table
BGP (Border Gateway Routing Protocol)
BGP Table
R1#sh ip bgp
Routing Table
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.
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.
R1#sh ip bgp
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 protocols
If we want to implement load balance then we need to change max path value.