Border Gateway Protocol IPv4 (BGPv4) | 209In order to make decisions in its operations with other BGP peers, a BGP peer uses a simple finite statemachine that consists of six states: Idle, Connect, Active, OpenSent, OpenConfirm, and Established. Foreach peer-to-peer session, a BGP implementation tracks which of these six states the session is in. TheBGP protocol defines the messages that each peer should exchange in order to change the session from onestate to another.The first state is the Idle mode. BGP initializes all resources, refuses all inbound BGP connection attempts,and initiates a TCP connection to the peer.The next state is Connect. In this state the router waits for the TCP connection to complete, transitioningto the OpenSent state if successful.If that transition is not successful, BGP resets the ConnectRetry timer and transitions to the Active statewhen the timer expires.In the Active state, the router resets the ConnectRetry timer to zero, and returns to the Connect state.Upon successful OpenSent transition, the router sends an Open message and waits for one in return.Keepalive messages are exchanged next, and upon successful receipt, the router is placed in theEstablished state. Keepalive messages continue to be sent at regular periods (established by the Keepalivetimer) to verify connections.Once established, the router can now send/receive Keepalive, Update, and Notification messages to/fromits 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, it needs to set up a long output queue to get that information to all the proper peers.If they are members of a peer group, however, the information can be sent to one place then passed ontothe peers within the group.Route ReflectorsRoute Reflectors reorganize the iBGP core into a hierarchy and allows some route advertisement rules.Route reflection divides iBGP peers into two groups: client peers and nonclient peers. A route reflector andits client peers form a route reflection cluster. Since BGP speakers announce only the best route for a givenprefix, route reflector rules are applied after the router makes its best path decision.• If a route was received from a nonclient peer, reflect the route to all client peers.• If the route was received from a client peer, reflect the route to all nonclient and all client peers.