This section describes BGP concepts to help you better understand BGP functions.
An Autonomous System (AS) is a group of Internet Protocol (IP) networks that are controlled by one entity, typically an Internet service provider (ISP), and have the same routing policy. Each AS is assigned a unique AS number, which identifies an AS on a BGP network. Two types of AS numbers are available: 2-byte AS numbers and 4-byte AS numbers. A 2-byte AS number ranges from 1 to 65535, and a 4-byte AS number ranges from 1 to 4294967295. Devices supporting 4-byte AS numbers are compatible with devices supporting 2-byte AS numbers.
In Figure 1, BGP is classified into two types according to where it runs: Internal BGP (IBGP) and External BGP (EBGP).
EBGP
EBGP runs between ASs. To prevent routing loops between ASs, a BGP device discards the routes with the local AS number when receiving the routes from EBGP peers.
IBGP
IBGP runs within an AS. To prevent routing loops within an AS, a BGP device does not advertise the routes learned from an IBGP peer to the other IBGP peers and establishes full-mesh connections with all IBGP peers. To address the problem of too many IBGP connections between IBGP peers, BGP uses Route Reflector and BGP Confederation.
There are two device roles in BGP message exchange:
Speaker
The device that sends BGP messages is a BGP speaker. A BGP speaker receives and generates new routes, and advertises the routes to other BGP speakers.
Peer
BGP speakers that exchange messages with each other are BGP peers. A group of BGP peers sharing the same policies can form a peer group.
The BGP router ID is a 32-bit value that is often represented by an IPv4 address to identify a BGP device. It is carried in the Open message sent during the establishment of a BGP session. When two BGP peers need to establish a BGP session, they each require a unique router ID. Otherwise, the two peers cannot establish a BGP session.