Sessions and PeersWhen two routers communicate using the BGP protocol, a BGP session is started. The two end-points of thatsession are Peers. A Peer is also called a Neighbor.Establish a SessionInformation exchange between peers is driven by events and timers. The focus in BGP is on the traffic routingpolicies.In order to make decisions in its operations with other BGP peers, a BGP process uses a simple finite statemachine that consists of six states: Idle, Connect, Active, OpenSent, OpenConfirm, and Established. For eachpeer-to-peer session, a BGP implementation tracks which of these six states the session is in. The BGPprotocol defines the messages that each peer should exchange in order to change the session from one stateto another.State DescriptionIdle BGP initializes all resources, refuses all inbound BGP connection attempts, and initiatesa TCP connection to the peer.Connect In this state the router waits for the TCP connection to complete, transitioning to theOpenSent state if successful.If that transition is not successful, BGP resets the ConnectRetry timer and transitions tothe Active state when the timer expires.Active The router resets the ConnectRetry timer to zero and returns to the Connect state.OpenSent After successful OpenSent transition, the router sends an Open message and waits forone in return.OpenConfirm After the Open message parameters are agreed between peers, the neighbor relation isestablished and is in the OpenConfirm state. This is when the router receives andchecks for agreement on the parameters of open messages to establish a session.Established Keepalive messages are exchanged next, and after successful receipt, the router isplaced in the Established state. Keepalive messages continue to be sent at regularperiods (established by the Keepalive timer) to verify connections.After the connection is established, the router can now send/receive Keepalive, Update, and Notificationmessages to/from its peer.Peer GroupsPeer groups are neighbors grouped according to common routing policies. They enable easier systemconfiguration and management by allowing groups of routers to share and inherit policies.Peer groups also aid in convergence speed. When a BGP process needs to send the same information to alarge number of peers, the BGP process needs to set up a long output queue to get that information to all theBorder Gateway Protocol IPv4 (BGPv4) 194