Beruflich Dokumente
Kultur Dokumente
information.
Internal (IBGP) neighbor: A pair of BGP speakers within the same AS.
BGP session: A TCP session connecting two BGP neighbors. The session is
used to exchange routing information. The neighbors monitor the state of the
Transit: Any traffic that is not local traffic is transit traffic. One of the goals of BGP is to minimize the
Stub: A stub AS has a single connection to one other AS. A stub AS carries only local traffic.
multihomed AS has been configured so that it does not forward transit traffic.
Transit: A transit AS has connections to two or more autonomous systems and carries both local and
transit traffic. The AS can impose policy restrictions on the types of transit traffic that will be forwarded.
AS number: A 16-bit number uniquely identifying an AS.
AS path: A list of AS numbers describing a route through the network. A BGP neighbor communicates
Routing policy: A set of rules constraining the flow of data packets through the network. Routing
policies are not defined in the BGP protocol. Rather, they are used to configure a BGP device. For
A multihomed AS can perform transit AS routing for a restricted set of adjacent autonomous
systems. It does this by tailoring the routing advertisements sent to EBGP peers.
An AS can optimize traffic to use a specific AS path for certain categories of traffic.
Network layer reachability information (NLRI): NLRI is used by BGP to advertise routes. It consists of
a set of networks represented by the tuple <length,prefix>. For example, the tuple <14,220.24.106.0>
http://wiki.nil.com/%28Non
%29Transit_Autonomous_System
The AS-path attribute is the list of AS numbers that a
route has traversed to reach a destination, with the
number of the AS that originate the route at the end of
the list.
The AS-Path attribute avoids routing loops by the local
AS simply rejecting any route object that contains its
own AS in the AS_PATH attribute.
The BGP system prefers the route object with the
shortest AS_PATH attribute length.
In the above figure, AS1 originates a network 10.0.0.0/8 and advertises it to AS2 and AS3. AS1 adds its
own AS number to the AS_PATH.
AS2 and AS3 learns of the route with an associated path vector of <AS1>.
AS2 advertises the route to its neighbor AS 4. AS2 prepends its own AS number to the AS_PATH.
AS3 advertises the route it learns from AS1 to AS5. AS3 prepends its own AS to the AS_PATH.
AS4 learns of the route from AS2 with an associated path vector of <AS2, AS1>.
AS 5 eventually learns two paths to 10.0.0.0/8.
One with a path vector of <AS3, AS1>
Another with path vector of <AS4, AS2, AS1>
AS5 will select the shortest path to reach 10.0.0.0/8. This path is the one that goes though AS3 > AS1.
This path that AS5 chose will also be advertised to its adjacent AS peers.
Loop prevention mechanism on BGP will not allow AS5 to advertise the same path to AS1 because AS1
is already in the path vector.
Next-Hop Attribute
The next-hop attribute indicates the next-hop IP address to reach a destination.
The next-hop IP address is not always the address of a neighboring router.
For EBGP, the next-hop is the IP address of the neighbor that sent the update.
For IBGP, it stipulates that the next hop advertised by EBGP should be carried into IBGP.
It is not necessarily the connected IGP neighbor that is advertised as the BGP next hop
address.
Consider the diagram above, Router B learns the network 172.16.0.0 from Router A, with the next-
hop IP address of 10.10.10.3. Likewise, A uses 10.10.10.1 as the next hop IP address to get to
172.20.0.0.
Because the rule for IBGP states that the next hop advertised by EBGP should be carried into IBGP,
Router B advertises to its IBGP peer Router C the network 172.16.0.0, with the next hop of
10.10.10.3 (not 172.20.10.1 as were accustomed to seeing in the IGP world).
It is important that Router C knows how to reach the 10.10.10.0 subnet, otherwise packets destined
for 172.16.0.0 could be dropped.
Router C can learn about network 10.10.10.0 by IGP or static route.
An IGP uses the IP address of a routing update (route source) as the next-hop address.
BGP uses a separate field for each network to record the next-hop address.
IBGP neighbors use recursive lookup to reach BGP next-hop address by using its IGP entries in
the routing table.
Router C learns about 172.16.0.0 from Router B (route source 172.20.10.1) with Router A
(10.10.10.3) as the next hop.
Router C, therefore, installs the route to 172.16.0.0/16 in the routing table with a next hop of
10.10.10.3
With Router B using an IGP to announce network 10.10.10.0/24 to Router C, Router C also
installs 10.10.10.0/24 in its routing table with a next hop of 172.20.10.1.
When Router C sends a packet to a destination in the 172.16.0.0. network, it looks up the
network in the routing table and finds a BGP route with a next hop of 10.10.10.3.
Because it is a BGP entry, Router C completes a recursive lookup in the routing table for a
path to network 10.10.10.3.
There is an IGP route to network 10.10.10.0 in the routing table with a nesxt hop of
172.20.10.1.
Router C then forwards the packet destined for the network 172.16.0.0 to 172.20.10.1.
http://routemyworld.com/2008/12/18/bsci-
bgp-attributes-ii/
http://netcerts.net/bgp-path-attributes-and-
the-decision-process/
http://www.hill2dot0.com/wiki/index.php?
title=Border_Gateway_Protocol
http://www2.ensc.sfu.ca/~ljilja/cnl/presentat
ions/tony/BGP_in_ns/sld021.htm
https://networklessons.com/ccnp-route-
lessons/
Border Gateway Protocol (BGP)
Border Gateway Protocol is an Exterior Gateway Protocol (EGP) used for routing between the autonomous systems.
It is the protocol which is used to to make core routing decisions on the internet.
BGP has two flavours, eBGP and iBGP. eBGP is routing between the autonomous systems and iBGP is routing within
an autonomous systems. BGP is a path-vector routing protocol and has following features:
Reliable updaes (TCP -based, port 179)
Triggered updates only
Rich metric
Scalable to massive networks
Specifications
Protocol Type Path-vector
eBGP AD 20
iBGP AD 200
Update Mode Triggered only
Transport TCP/179
Authentication None, md5
RFC RFC 4271
Default Timers
Holddown time 180 seconds
Keepalive interval 60 seconds
Advertisement interval (iBGP) 5 seconds
Advertisement interval (eBGP) 30 seconds
If an error occurs at any state of the process, the BGP session is terminated immediately and
returned to the Idle state. Some of the reasons why a router does not progress from the Idle state
are:
BGP does not spend much time in this state if the TCP session has been successfully
established.
If an error occurs, BGP moves to the Active state. Some reasons for the error are:
If the router was unable to establish a successful TCP session, then it ends up in the Active
state.
BGP tries to restart another TCP session with the peer and, if successful, then it sends an Open
Repeated failures may result in a router cycling between the Idle and Active states. Some of the
Network congestion.
Once the message has been received, the router checks the validity of the Open message.
If there is an error it is because one of the fields in the Open message does not match between the
peers, e.g., BGP version mismatch, MD5 password mismatch, the peering router expects a different My
AS, etc. The router then sends a Notification message to the peer indicating why the error occurred.
If there is no error, a Keepalive message is sent, various timers are set and the state is changed to
OpenConfirm.
OpenConfirm State:
If a Keepalive message is received and no timer has expired before reception of the Keepalive, BGP
If a timer expires before a Keepalive message is received, or if an error condition occurs, the router
In this state, the peers send Update messages to exchange information about each route being
If there is any error in the Update message then a Notification message is sent to the peer, and BGP
If a timer expires before a Keepalive message is received, or if an error condition occurs, the router
BGP Peers Will Initially Exchange Their Full BGP Routing Tables. From Then On Incremental
Updates Are Sent As The Routing Table Changes. BGP Keeps A Version Number Of The BGP
Table And It Should Be The Same For All Of Its BGP Peers. The Version Number Will
Change Whenever BGP Updates The Table Due To Some Routing Information Changes.
Keepalive Packets Are Sent To Ensure That The Connection Is Alive Between The BGP
Peers And Notification Packets Are Sent In Response To Errors Or Special Conditions. If Any
State Other Than Established Is An Indication That The Two Routers Did Not Become
Neighbors And Hence The BGP Updates Will Not Be Exchanged.
BGP MESSAGE TYPES (BGP PEERS MESSAGES):
There Are Four Types Of Messages That Can Be Exchanged
Between Two BGP Peers:
Hold Time :Is The Maximum Number Of Seconds That Can Elapse Before
Receiving A Keepalive Or An Update Message. Hold Time Values Must Match
Between Both The BGP Speakers, If The Hold Time Values Differ Then The Lower
Value Is Selected As Hold Time For The Connection. If The Hold Time Is Set To
Zero Then No Keepalives Are Sent. If Keeplaives Are Needed Then The Lowest
BGP Identifier It Is A 32-Bit Value That Uniquely Identifies The Sender. It Is The IP Address
And The Router Must Choose One Of Its IP Addresses To Use With All The BGP Peers. Is The
IP Address That Identifies A BGP Speaker. If BGP Identifier Is Not Manually Set Then Cisco
Defaults To Use The BGP Identifier As Numerically Highest Loopback Address And If No
Loopback Address Is Configured On The Router Then Numerically Highest IP Address On A
Physical Interface Is Used.
This Is The Highest Loopback Address Configured On The Router And Serves To
UNIQUELY IDENTIFY THE SENDER OF THE OPEN MESSAGE.
Parameter Length: If Optional Parameters Are Specified Then This Fields Contains The
Length Of Optional Parameters, In Octets.
BGP Peers May Authenticate Each Other Using The MD-5 Algorithm, Whose Message
Digest May Be Placed In The Open Message As An Optional Parameter. A New Optional
Parameter Called Capability Permits BGP Peers To Evaluate Each Others Capabilities For
The Support Of New Network-Layer Protocols Such As IP Multicast And IP Version 6. This
New ParameterCapabilityIs Backward Compatible, Allowing A Peer That Does Not
Support The Parameter To Maintain A Session With A Peer That Does Support The
Parameter.
UPDATE MESSAGE:
Reachability Information Is Exchanged Between Peers In UPDATE
Messages. Once BGP Speakers Have Made Contact And A Session
Has Been Established Using Open Messages, The Peers Begin The
Actual Process Of Exchanging Routing Information. Each BGP Router
Uses Its BGP Decision Process To Select Certain Routes To Be
Advertised To Its Peer. This Information Is Then Placed Into BGP
Update Messages, Which Are Sent To Every BGP Peer For Which A
Session Has Been Established. These Messages Are The Way That
Network Reachability Knowledge Is Propagated Around The
Internetwork, Includes New Routes, Withdrawn Routes, And Path
Update Messages Are Used To Update The BGP Neighbor About The
Network Layer Reachability Information (NLRI) And The Path
Attributes Associated With That NLRI. NLRI Is Simply The
Combination Of IP Address Prefix And Length (Subnet Mask) In The
Format X.X.X.X /Mask For IPv4 Addresses.
.
NOTIFICATION OF ERROR CONDITIONS : A BGP Device Can
Observe Error Conditions Impacting The Connection To A Peer.
Notification Messages Are Sent To The Neighbor When These
Conditions Are Detected. After The Message Is Sent, The BGP
Transport Connection Is Closed.
This Means That All Resources For The BGP Connection Are
Deallocated. The Routing Table Entries Associated With The Remote
Peer Are Marked As Invalid. Finally, Other Peers Are Notified That
Notification
These Routes Are Invalid Messages Include An
Error Code And An Error Sub
Code. THE ERROR CODES
PROVIDED BY BGP INCLUDE:
Message Header Error
OPEN Message Error
UPDATE Message Error
Hold Timer Expired
Finite State Machine Error
Cease
Error Code Error Subcode
1 Connection Not Synchronized
1 Message Header Error 2 Bad Message Length
3 Bad Message Type