1.5.a IBGP and EBGP peer relationships
BGP is an exterior gateway protocol, that is intended to be used between different autonomous systems. BGP is a path-vector protocol meaning it’s routes are composed of a list of AS’ on the path to any given destination. Routers running BGP are known as BGP ‘speakers’ and BGP neighbours are known as ‘peers’. If a routers peers are in the same AS, the relationship is internal BGP (iBGP). If a routers peers are in a different AS, the relationship is external BGP (eBGP). Unlike with IGP’s such as EIGRP and OSPF, BGP peers do not need to be on the same subnet. Due to this fact, BGP uses a TCP connection between peers on port 179 for communication, allowing peers to exchange incremental, triggered route updates and keepalives.
eBGP Neighbor Requirements
- The local routers ASN must match the peer routers neighbor command.
- The BGP router ID’s must not be the same
- Authentication must pass, if configured
- Routers must complete a TCP connection
- The source address to reach the peer must match
- The peer must be reachable via a route (IGP, static, connected).
iBGP Neighbor Requirements
- Requirements are largely the same as eBGP, but peers must be on the same AS.
- TTL value for iBGP neighbors is 255 by default.
- iBGP defaults to multihop.
BGP Packet Types
| Open | Sets up and establishes BGP adjacency |
| Update | Advertises, updates or withdraws routes |
| Notification | Indicates an error condition to a BGP neighbor |
| Keepalive | Ensures that BGP neighbors are still alive |
BGP Neighbor States
| Idle | BGP detects a start event and tries to initiate a TCP connection to the BGP peer and listens for a new connection. |
| Connect | BGP initiates TCP connection. Neighbour with the higher IP manages the connection. |
| Active | BGP starts a new 3-way handshake. If established, an Open message is sent. |
| OpenSent | Open message has been sent and is awaiting Open message from peer. Both Open messages are examined for: BGP versions must match, Source IP of open message must match configured neighbor IP, AS number in Open message must match configured neighbor, RID’s must be unique, Security check (passwords and TTL) must pass. |
| OpenConfirm | BGp waits for a Keepalive message from the peer. |
| Established | BGP session is established, neighbors are exchanging routes using Update messages. |
1.5a i Peer Group/Update Group, Template
A BGP router may have many neighbors that require the same BGP policies. In this case you can use peer groups, which is a group of peers in which, the same outbound policies apply. In order to make further efficiencies in configuring BGP networks, the Template feature allows you to configure parameters one or more routers, and then on remaining peer routers, allow you to inherit those parameters.
1.5a ii Active, Passive
In BGP, Active and Passive states effectively refer to the process of BGP speaking or listening. Active refers to speaking, passive refers to listening. If two speakers contend for the same medium, the speaker with the higher router ID wins.
1.5a iii Timers
By default, BGP uses default values for Keepalive of 60s and Hold-Down of 180s (3 x keepalive). One the relationship between two peers is ‘up’, each router will start a hold-down timer. For every keepalive packet received, the hold-down timer will reset back to 0. Timers are configurable, using the command (under BGP): neighbor <IP address> timers <keepalive value> <hold-down value>. This can be verified using the command show ip bgp neighbor.
ISPs can protect their routers from aggressive timers by configuring a minimum hold-down that will be in use with the command: neighbor <ip address> timers <keepalive value> <hold-down value> <minimum hold-down value>.
BGP also uses the Advertisement Timer which sets a minimum delay between updates for any given neighbor relationship. The default advertisement interval is 30s for eBGP and 0s for iBGP.
The BGP Scan-Timer scans the BGP prefix-tables every 60s by default and validates if you know an IGP route to the next-hop router, or compare the BGP prefix table for better routes.
1.5a iv Dynamic Neighbors
Since Cisco IOS 12.2(33)SXH on the Catalyst 6K platform, BGP supports peering to a group of remote neighbours that are defined by a range of IP addresses. Each range can be configured as a subnet IP address using the command: bgp listen [limit <max number>] range <network address/prefix length> peer-group <peer group name>.
1.5a v 4-Byte AS Numbers
Prior to January 2009, BGP only supported 2-byte AS numbers allowing for 65535 AS’. This has been increased to 4-bytes now allowing for up to 4,294,967,295 AS’! There are three ways of expressing a 4-byte AS number:
- Asplain
- The most simple method, and is a simple decimal number.
- Asdot
- Represents AS numbers 1-65535 in decimal and uses Asdot+ for numbers greater than this.
- Asdot+
- Breaks the AS number into two 16-bit parts, a high-order value and a low-order value separated by a dot.
- E.g. 2-byte AS’:
- AS 123 becomes 0.123
- AS 10013 becomes 0.10013
- AS 65535 becomes 0.65535
- And for > 65535:
- AS 65536 becomes 1.0
- AS 65537 becomes 1.1
To calculate Asdot+ notation:
Integer (high order value) = asplain / 65536
Remainder (low order value) = asplain – (integer * 65536)
Asdot+ = integer.remainder
E.g for AS 70000
- Integer = 70000 / 65536 = 1
- Remainder = 70000 – (1 * 65536) = 4464
- So the Asdot+ notation for AS 70000 is 1.4464.
1.5a vi Private AS
AS numbers are allocated as follows:
| AS | Use | Reference |
| 0 | Reserved | RFC1930, 7607 |
| 1-64495 | Public AS numbers | |
| 64496-64511 | Reserved for documentation | RFC5398 |
| 64512-65534 | Private AS numbers | RFC1930, 6996 |
| 65535 | Reserved | RFC7300 |
| 65536-65551 | Reserved for documentation | RFC4893, 5398 |
| 65552-131071 | Reserved | |
| 131072-4199999999 | Public 4-byte AS numbers | |
| 4200000000-4294967294 | Private 4-byte AS numbers | RFC6996 |
| 4294967295 | Reserved | RFC7300 |
Comments
So empty here ... leave a comment!