Border Gateway Protocol (BGP)

BGP4 Protocol | Tutorials | IANA Codes | RFCs | Internet Drafts | Source Code | Cisco BGP | Test Tools | Test SuitesRouter Stats | Mailing Lists | Links | Books

BGP Introduction

Internet is a network of interconnected networks. A network or a set of networks under a single authority is called an Autonomous System (AS). Border Gateway Protocol (BGP) version 4 (RFC 1771) is the de facto routing protocol that is used currently to maintain connectivity between ASs. BGP is a path vector protocol, a modified form of distance vector protocol. BGP relies on Transmission Control Protocol (TCP) for reliable transport. Inside an AS, Interior Gateway Protocols (IGPs) like RIP, OSPF and IS-IS are used to provide connectivity. Along with an IGP, BGP can also be used inside an AS, mainly to propagate the BGP information learned from other ASs. The term "Internal BGP " (IBGP) is used in this context. All IBGP speakers must be fully meshed. Route reflection and AS confederations solves the scalability issue because of the full mesh requirement. Some of the advanced BGP features include route flap dampening, route refresh and graceful restart. BGP multiprotocol extensions support carrying IPv6 prefixes, MPLS labels and IP multicast in addition to IPv4 prefixes.

BGP4 Protocol

BGP Message Formats
BGP Path Attributes
BGP Error Handling
BGP Finite State Machine (FSM)
BGP Timers
BGP Implementation Recommendations
BGP Cheat Sheet (download)
BGP Cheat Sheet - RIPE


BGP Introduction - Cisco
BGP Fundamentals
Recent Developments in BGP-4 - Jarkko Ilomaki, HUT
BGP : The Next Best thing since Sliced Bread - Petri Miettinen, HUT
Philip Smith's BGP Techniques for Service Providers   Part 1   Part 2
Philip Smith's BGP Troubleshooting Techniques   Part 1   Part 2
North American Network Operators' Group (NANOG) - Archive Search "BGP"
Avi Freedman's   BGP 101   BGP 102   Multihoming
Multihoming With BGP4 - Network Computing
FAQ on Multi-homing and BGP - Connect
Applications of BGP communities - Cisco IP Journal
Analyzing the Internet BGP Routing Table - Cisco IP Journal
BGP/MPLS VPN Fundamentals - Juniper
Comparing BGP/MPLS and IPSec VPNs - SANS
BGP Cheat Sheet - Ripe NCC
BGP Security
A Survey of BGP Security - Kevin Butler et al
A Survey of BGP Security Issues and Solutions
Selected Papers on BGP Security
BGP Security Requirements (Draft expired)
Secure Inter-Domain Routing (sidr) IETF Charter
BGP Routing Security Resources - Dan Wendlandt
Securing the Border Gateway Protocol (SBGP) - Cisco IP Journal
Securing BGP (soBGP) - Cisco IP Journal
Protecting Border Gateway Protocol for the Enterprise - Cisco
Load Balancing
How Does Load Balancing Work? - Cisco
RFC 2991 Multipath Issues in Unicast and Multicast Next-Hop Selection
RFC 2992 Analysis of an Equal-Cost Multi-Path Algorithm
Load Sharing with BGP in Single and Multihomed Environments: Sample Configurations
BGP Best Path Selection Algorithm    with multipath
Juniper - BGP Best Path Selection Algorithm

IANA Codes

BGP Parameters       BGP uses TCP port 179
IANA Numbers

RFCs        IDR IETF Charter

IETF - For RFCS & Drafts
RFC 4271 A Border Gateway Protocol 4 (BGP-4)                 Old RFC 1771
RFC 4273 Definitions of Managed Objects for the BGP-4      Old RFC 1657
RFC 1997 BGP Communities Attribute
RFC 5925 The TCP Authentication Option       Old RFC 2385
RFC 2439 BGP Route Flap Damping
RFC 4456 BGP Route Reflection      Old RFC 2796
RFC 3065 Autonomous System Confederations for BGP
RFC 4893 BGP Support for Four-octet AS Number Space
RFC 5492 Capabilities Advertisement with BGP4
RFC 4360 BGP Extended Communities Attribute
RFC 4486 Subcodes for BGP Cease Notification Message
RFC 2918 Route Refresh Capability for BGP-4
RFC 4760 Multiprotocol Extensions for BGP-4
RFC 5396 Textual Representation of AS Numbers
RFC 2545 Use of BGP-4 Multiprotocol Extensions for IPv6
RFC 3107 Carrying Label Information in BGP-4
RFC 4274 BGP4 Protocol Analysis
RFC 4272 BGP Security Vulnerabilities Analysis
RFC 4724 Graceful Restart Mechanism for BGP
RFC 5292 Address-Prefix-Based Outbound Route Filter for BGP-4
RFC 4098 Terminology for Benchmarking BGP Device Convergence in the Control Plane
RFC 4577 OSPF as the PE/CE Protocol for BGP/MPLS IP VPNs
RFC 4684 Constrained Route Distribution for BGP/MPLS IP VPNs

Internet Drafts

Search for the keyword "bgp" in IETF

Source Code Distributions

Quagga Routing Suite
XORP (eXtensible Open Router Platform)
GNU Zebra
Java Implementation
BGP Daemon in Perl
IP Infusion (commercial)
Metaswitch (commercial)
Vyatta (commercial)

Cisco BGP         Juniper 

Cisco BGP Path Selection Algorithm
Cisco BGP Load Balancing
Using the BGP for Interdomain Routing - Cisco
BGP Case Studies - Cisco
configuring BGP - 12.4 IOS
BGP Commands A-B C-I  M-N S  N T-S B  S I-T

Test Tools

IXIA - ANVL - Conformance
IXIA- Router Testing
SmartBits - Spirent
BGP View
CAIDA Tool Links

Test Suites

UNH IOL BGP Test Suite

Router Stats

BGP Table Statistics - Telstra
Looking Glass - Qwest
Looking Glass - XO
Looking Glass - Level3
Looking Glass - BT
Data Telecom Looking Glass IPv4/IPv6
Route Server

Mailing Lists

ISP BGP Mailing List
APNIC bgp-stats


Network Sorcery
BGP Expert


1. BGP4 Inter-Domain Routing in the Internet by John W. Stewart
2. Practical BGP by Russ White, Danny McPherson, Srihari Sangli
3. BGP Design and Implementation by Randy Zhang, Micah Bartell
4. Internet Routing Architectures by Bassam Halabi

Maintained by Anil Edathara

Last Modified: October 06, 2010

BGP4 Inter-Domain Routing in the Internet by John W. Stewart   Practical BGP by Russ White, Danny McPherson, Srihari Sangli   BGP Design and Implementation by Randy Zhang, Micah Bartell   Internet Routing Architectures by Bassam Halabi

BGP - Commonly used terms

Autonomous System (AS)  Set of routers under a single technical administration.

BGP speaker  A router that implements BGP.

EBGP  External BGP (BGP connection between external peers).

External peer  Peer that is in a different AS than the local system.

IBGP  Internal BGP (BGP connection between internal peers).

Internal peer  Peer that is in the same AS as the local system.

IGP  Interior Gateway Protocol - a routing protocol used to exchange routing information among routers within a single AS.

RIB  Routing Information Base.

Aggregation  Process of combining the characteristics of several different routes in such a way that a single route can be advertised. Aggregation reduces the amount of information that a BGP speaker must store and exchange with other BGP speakers.

Route Reflection BGP speakers within a single AS must be fully meshed. Route Reflection is an alternative in alleviating the need for a "full mesh" and allows a BGP speaker (known as "Route Reflector") to advertise IBGP learned routes to certain IBGP peers.

AS Confederations A collection of autonomous systems advertised as a single AS number to BGP speakers that are not members of the confederation. Another alternative to the "full mesh" requirement.

BGP - Attributes

ORIGIN  A well-known mandatory attribute generated by the speaker that originates the associated routing information. Its value should not be changed by any other speaker. Can be IGP or EGP or INCOMPLETE

AS_PATH  A well-known mandatory attribute which identifies the ASs through which routing information carried in this update message has passed. Can be AS_SETs or AS_SEQUENCEs.

NEXT_HOP  A well-known mandatory attribute that defines the IP address of the router that should be used as the next hop to the destinations listed in the update message.

MULTI_EXIT_DISC  An optional non-transitive attribute which is intended to be used on external (inter-AS) links to discriminate among multiple exit or entry points to the same neighboring AS. All other factors being equal, the exit point with LOWER value should be preferred. If received over EBGP, this attribute may be propagated to internal peers but not to external peers.

LOCAL_PREF  A well-known attribute that shall be included in all update messages to the other internal peers. A BGP speaker shall calculate the degree of preference for each external route based on the locally configured policy, and include the degree of preference when advertising a route to its internal peers. The HIGHER degree of preference must be preferred. 

ATOMIC_AGGREGATE  A well-known discretionary attribute.

AGGREGATOR  An optional transitive attribute which may be included in updates which are formed by aggregation. A BGP speaker which performs route aggregation may add this attribute which shall contain its own AS number and BGP Identifier.

COMMUNITIES  An optional transitive attribute which specifies a community. All routes with this attribute belong to the communities listed in the attribute. Well known communities are NO_EXPORT, NO_ADVERTISE and NO_EXPORT_SUBCONFED.