Professional Documents
Culture Documents
Idle State:
If an error occurs at any state of the FSM 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:
Connect is the next state. If the TCP connection completes, BGP will move to the OpenSent stage if the
connection does not complete, BGP goes to Active.
Connect State:
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:
Active indicates that the BGP speaker is continuing to create a peer relationship with the remote router.
If this is successful, the BGP state goes to OpenSent. You'll occasionally see a BGP connection flap
between Active and Connect. This indicates an issue with the physical cable itself, or with the
configuration.
Active State:
If the router was unable to establish a successful TCP session, then it ends up in the Active
state.
BGP FSM tries to restart another TCP session with the peer and, if successful, then it sends
an Open message to the peer.
Repeated failures may result in a router cycling between the Idle and Active states. Some of
the reasons for this include:
Network congestion.
OpenSent indicates that the BGP speaker has received an Open message from the peer. BGP will
determine whether the peer is in the same AS (iBGP) or a different AS (eBGP) in this state.
OpenSent State:
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 doesnt 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.
In OpenConfirm state, the BGP speaker is waiting for a keepalive message. If one is received, the state
moves to Established, and the neighbor relationship is complete. It is in the Established state that
update packets are actually exchanged.
OpenConfirm State:
If a Keepalive message is received and no timer has expired before reception of the
Keepalive, BGP transitions to the Established state.
If a timer expires before a Keepalive message is received, or if an error condition occurs, the
router transitions back to the Idle state.
In Established state, if one of keepalive message is received, the state moves to Established, and the
neighbor relationship is complete. It is in the Established state that update packets are actually
exchanged.
Established State:
In this state, the peers send Update messages to exchange information about each route
being advertised to the BGP peer.
If there is any error in the Update message then a Notification message is sent to the peer,
and BGP transitions back to the idle state.
If a timer expires before a Keepalive message is received, or if an error condition occurs, the
router transitions back to the Idle state.
Keep in Mind the "Weight" attributes is locally significant and is Cisco proprietary, the default value for
locally originated routes are 32678.
The default Local preference attribute value for all learned routes is 100 "IF is not modified"
The default Origin Code is "IGP" if learned and advertised by Network Statement, while "Incomplete" If
the route is redistributed into BGP.
The default MED value for all learned route is 0 "Unless modified", bear in mind MED is compared by
default from routed learned from the Same AS number.
http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a0080094431.shtml
BGP Attributes
Attribute
Meaning
AS path
An ordered list of all the autonomous systems through which this update has
passed. Well-known, mandatory.
Origin
Local Preference
A value telling IBGP peers which path to select for traffic leaving the AS. Default
value is 100. Well-known, discretionary.
Multi-Exit
Discriminator (MED)
Weight
Cisco proprietary, to tell a router which of multiple local paths to select for traffic
leaving the AS. Highest weight is preferred. Only has local significance.
http://www.ciscopress.com/articles/article.asp?p=1565538&seqNum=4
IGPs, such as EIGRP or OSPF, choose routes based on lowest metric. They attempt to find the shortest,
fastest way to get traffic to its destination. BGP, however, has a different way of route selection. It
assigns various attributes to each path; these attributes can be administratively manipulated to control
the path that is selected. It then examines the value of these attributes in an ordered fashion until it can
narrow all the possible routes down to one path.
BGP chooses a route to a network based on the attributes of its path. Four categories of attributes exist
as follows:
Well-known mandatory: Must be recognized by all BGP routers, present in all BGP updates, and passed
on to other BGP routers. For example, AS path, origin, and next hop
Well-known discretionary: Must be recognized by all BGP routers and passed on to other BGP routers
but need not be present in an update, for example, local preference.
Optional transitive: Might or might not be recognized by a BGP router but is passed on to other BGP
routers. If not recognized, it is marked as partial, for example, aggregator, community.
Optional non-transitive: Might or might not be recognized by a BGP router and is not passed on to
other routers, for example, Multi-Exit Discriminator (MED), originator ID.
AS Override
The AS override feature allows a provider edge (PE) router to change the private autonomous
system (AS) number used by a customer edge (CE) device on an external BGP (EBGP) session running on
a VPN routing and forwarding (VRF) access link. The private AS number is changed to the PE AS number.
Another CE device connected to another PE device sees the EBGP route coming from the first site with
an AS path of provider-ASN provider-ASN, instead of provider-ASN site1-ASN. This allows enterprise
networks to use the same private ASN on all sites.
The AS override feature offers a clear management advantage to the service provider because
BGP by default does not accept BGP routes with an AS path attribute that contains the local AS number.
In an enterprise network with multiple sites, you might wish to use a single AS number across sites.
Suppose, for example that two CE devices are in AS 64512 and that the provider network is in AS 65534.
When the service provider configures a Layer 3 VPN with this setup, even if the MPLS network
has routes towards Device CE1 and Device CE2, Device CE1 and Device CE2 do not have routes to each
other because the AS path attribute would appear as 64512 65534 64512. BGP uses the AS path
attribute as its loop avoidance mechanism. If a site sees its own AS number more than once in the AS
path, the route is considered invalid.
One way to overcome this difficulty is with the as-override statement, which is applied to the PE
devices. The as-override statement replaces the CE device's AS number with that of the PE device, thus
preventing the customer AS number from appearing more than once in the AS path attribute.
If a customer uses AS path prepending to make certain paths less desirable and the service
provider uses AS override, each CE AS number occurrence in the AS-path is changed to the service
provider AS number. For example, suppose that all customer sites use the same AS number, say 64512.
If the ISP uses AS number 65534, one customer site sees the path to another site as 65534 65534. If the
customer prepends 64512 on a particular path to make it less desirable, another customer site sees that
path as 65534 65534 65534.
State/PfxRcd
Idle
2
Active
1
To check what the received routes from this neighbor are, following command is used. This command
shows the network which is received from the neighbor. Metric of the receiving route along with local
preference, next hop, and origin and AS path can be viewed through this command. For redistributed
routes origin will be incomplete and showed by ? Sign
LDN-KHISTT-C3845>sh ip bgp neighbors 172.22.15.250 received-routes
BGP table version is 4117396, local router ID is 210.2.130.207
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network
Next Hop
* 172.22.0.0/20
172.22.15.250
Total number of prefixes 1
Metric
0
LocPrf Weight
0
Path
64594 65501 ?
To check what the advertised routes from this neighbor are, following command is used. This
command shows the network which is received from the neighbor. Metric of the receiving route along
with local preference, next hop, and origin and AS path can be viewed through this command. For
redistributed routes origin will be incomplete and showed by ? Sign
LDN-KHISTT-C3845>sh ip bgp neighbors 172.22.15.250 advertised-routes
BGP table version is 4117479, local router ID is 210.2.130.207
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network
Next Hop
*> 172.22.0.8/30
202.147.184.213
*> 210.2.181.16/28
202.147.184.213
Total number of prefixes 2
Path
?
?
Provider Edge end BGP show Commands output for VPNv4 unicast Neighborship
To Checked the bgp vpnv4 vrf neighbor status on cisco router below is the command. It shows the
local Router ID and AS number, Neighbor IP, Neighbor AS, Neighbor state and receive prefix numbers.
LDN-KHISTT-C3845>sh ip bgp vpnv4 vrf VPN_LDNVOICE summary
BGP router identifier 210.2.130.207, local AS number 23966
Neighbor
10.0.7.226
10.0.22.146
10.0.122.70
10.5.24.78
10.5.24.194
10.5.26.78
V AS
4 64612
4 64599
4 64599
4 64639
4 64652
4 64773
Up/Down
never
never
2w1d
5d10h
01:42:54
00:46:05
State/PfxRcd
Idle (Admin)
Idle
1
1
1
1
In above show command output, 1 of the neighbor status is Never and state is Idle (Admin). Admin
means neighbor is shutdown administratively by NOC.
To check what the received routes from this neighbor are, following command is used. This command
shows the network which is received from the neighbor. Metric of the receiving route along with local
preference, next hop, and origin and AS path can be viewed through this command. For redistributed
routes origin will be incomplete and showed by ? Sign
LDN-KHISTT-C3845> sh ip bgp vpnv4 vrf VPN_LDNVOICE neighbors 10.5.24.194 received-routes
BGP table version is 2629953, local router ID is 210.2.130.207
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network
Next Hop
Metric LocPrf
Weight
Path
119.30.126.48/29
192.168.0.24/29
192.168.1.0
192.168.6.0
10.5.24.194
10.5.24.194
10.5.24.194
10.5.24.194
10
10
10
10
0
0
0
0
64652 i
64652 i
64652 i
64652 i
To check what the advertised routes from this neighbor are, following command is used. This
command shows the network which is received from the neighbor. Metric of the receiving route along
with local preference, next hop, and origin and AS path can be viewed through this command. For
redistributed routes origin will be incomplete and showed by ? Sign
LDN-KHISTT-C3845> sh ip bgp vpnv4 vrf VPN_LDNVOICE neighbors 10.5.24.194 advertised-routes
BGP table version is 2629985, local router ID is 210.2.130.207
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Originating default network 0.0.0.0
Network
Next Hop
Neighbor
10.0.7.110
10.0.8.210
10.0.8.238
10.0.22.122
10.0.42.14
Messages
AS
State
Up/down time Sent
64609 Active 294d 00:33:56 620128
64581 Established 1d 13:13:47 1663950
64608 Connect
01:05:22
130923
64556 Established 4d 12:26:32 26613827
64533 Connect 587d 16:03:03
0
Messages
Received
465199
885726
71387
24539043
0
Prefixes
Received
0
1
0
1
0
a auto-summarized
Provider Edge end BGP show Commands output for VPNv4 unicast Neighborship
LDN-KHIMRD-BRAS1440>sh ip bgp vpnv4 vrf VPN_MAKRO summary
Local router ID 202.147.184.251, local AS 23966
BGP Operational state is Up
Default local preference is 100
Default originate is disabled
Auto summary is disabled
Log neighbor changes is enabled
BGP administrative distances are 20 (ext), 200 (int), and 200 (local)
Graceful restart is globally disabled
Global graceful-restart restart time is 120 seconds
Global graceful-restart stale paths time is 360 seconds
Graceful-restart path selection defer time is 360 seconds
Graceful-restart is ready to switch to the standby SRP
The last restart was graceful
Route Distinguisher: 23966:2122
Messages Messages
Neighbor
AS State
Up/down time Sent Received
10.0.7.174 64534 Established 16:35:27 3540341 11712586
10.0.115.126 64534 Active 587d 16:10:38
0
0
Prefixes
Received
2
0
Peer
10.0.7.174
10.0.7.174
Next-hop
10.0.7.174
10.0.7.174
Origin
IGP
IGP
Provider Edge end BGP show Commands output for VPNv4 unicast Neighborship
usman.ahmed@LDN-KHINTO-M10i> show bgp neighbor instance VPN_GROUPM
Peer: 192.168.1.2+17688 AS 64616 Local: 192.168.1.1+179 AS 23966
Type: External State: Established Flags: <Sync>
Last State: OpenConfirm Last Event: RecvKeepAlive
Last Error: Hold Timer Expired Error
Export: [ pl-GROUPM-Export ] Import: [ pl-GROUPM-Import ]
Options: <Preference Localpref PeerAS Refresh>
Holdtime: 90 Preference: 20 Localpref: 20
Number of flaps: 223
Last flap event: HoldTime
Error: 'Hold Timer Expired Error' Sent: 136 Recv: 16
Error: 'Cease' Sent: 26 Recv: 48
Local Interface: ge-0/0/0.26
Send state: in sync
Active prefixes:
0
Received prefixes:
2
Accepted prefixes:
1
Suppressed due to damping: 0
Advertised prefixes:
1
Last traffic (seconds): Received 1 Sent 7 Checked 32
Input messages: Total 8187 Updates 13 Refreshes 0 Octets 156073
Output messages: Total 8740 Updates 1
Refreshes 0 Octets 166138
Output Queue[46]: 0
usman.ahmed@LDN-KHINTO-M10i> show route advertising-protocol bgp 192.168.1.2
VPN_GROUPM.inet.0: 29 destinations, 30 routes (28 active, 0 holddown, 1 hidden)
Prefix
Nexthop
MED Lclpref
AS path
* 10.10.10.10/32
Self
?
usman.ahmed@LDN-KHINTO-M10i> show route receive-protocol bgp 192.168.1.2
VPN_GROUPM.inet.0: 29 destinations, 30 routes (28 active, 0 holddown, 1 hidden)
Prefix
Nexthop
MED Lclpref
AS path
11.11.11.11/32
192.168.1.2
10
64616 I
Up/Down State/PfxRcd
10.0.57.105
1w4d
10.0.57.109
03:44:44
ISM_HO#sh ip bgp
22
23