BGP Peers, BGP Sessions
and BGP Messages
What is BGP peer?
To use BGP, the neighbourship between the BGP routers must be established. You can use the statement BGP neighbour or BGP peer for this establishment.
There are two types of BGP peer. These are iBGP(interior BGP) peer and eBGP(exterior BGP) peer. iBGP peer is the neighbour within the same AS. eBGP peer is the neighbour within another AS.
BGP Session Establishment and Session States
Without any connection attemp, the session is firstly in the idle state. With the first TCP message, the state changes to connect.
After TCP connection, one peer send Open Message and the other peer respond with another Open Message. During this process the state become OpenSent .
Upon receipt of Open Messages, neighbours generates Keepalive Messages. The name of this state which one peer waiting the other for reply keepalive is OpenConfirm.
Lastly, after the receiving response keepalive, point-to-point connection is established.And the name of this last state is Established.
During this processes, if any IP connectivity problem occurs or any neighbour missconfiguraion or any other problem occurs, the state become Active. Do not think that this word is good for BGP. In BGP world, Active means there is a problem on connection.
BGP keeps a version number of the BGP table. The version number changes whenever BGP updates the table with routing information changes.
BGP maintains a separate routing table based on shortest AS Path and various other Path Attributes, as opposed to IGP metrics like distance or cost. We will discuss these Path Attributes in the following posts.
BGP has four types of message if we do not include TCP messages. These messages are:
• Open messages
• Update messages
• Keepaliev messages
• Notification messages
Let’s check these messages briefly.
Open Messages are used to create BGP connection. With the Open messages the following values exchanged:
– AS Number
– BGP Version
– BGP Router ID
– Hold Time
Update Messages are used to send routing updates to peers. After the BGP session start, update messages are sent until the complete BGP table has been exchanged. After that at every update message, the BGP route table is updated and the BGP route table version number is incremented by one.
Keepalive Messages are to check the availability of the link. This also prevents hold time expire. This message has only BGP header. Keepalive messages are sent every 60 seconds. If no response during 3 keepalive time(hold time), 180 seconds, then it is realized that the connection is lost.
Notification Messages are used when an error detected. After receiving this messages, BGP and TCP connection is closed. Notification messages consist of the BGP header, error code, subcode and the data that describes the error.
BGP – Part 1
BGP – Part 2 (BGP Peers, BGP Sessions, BGP Messages)
BGP – Part 3 (IBGP, IBGP Topologies and EBGP)
BGP – Part 4 (BGP Administrative Distance and BGP Path Attributes)
BGP – Part 5 (Packet Tracer BGP Configuration Example)