Establish TCP Transport – you need to have IP reachibility between BGP peers. You need to think about BGP more as an application. It uses TCP port 179, unlike OSPF or EIGRP you dont enable the BGP on link level, you define the static peers that establish the TCP transport under the BGP process configuration. From the service provider scope the IBGP and EBGP the peers can be directly connected and you dont need to run any IGP, or in case of IBGP you run the IGP or for multihop BGP peers you run Label Switch Path transport (LSP). You need to consider also TTL of actual BGP packets beside the success ping between neighbors. iBGP peers have TTL 255 but EBGP peers have TTL1, so if EBGP peers are not directly connected you need to make sure to tell them there are multi-hop peers and increase the TTL value in the packet.
Establish BGP Peering – thats the neighbor command settings. The BGP peers must agree upon the AS numbers, Update source (loopack is MPLS tunnel source and destination, if it is not the traffic will be blackholed in the MPLS CORE network), address families, others (authentication, TTL security, etc.)
Negotiate Address Families – IPv4 Unicast for regular global routing, VPNv4 Unicast for MPLS L3 VPN. It is important to realize that bgp address family information is independed of BGP transport = the BGP transport is independed of NLRI. You can establish a BGP transport over TCP over IPv4 and advertise the VPNv6 routes. AFI(Address Family Identifier)/SAFIs(Sub Address Family Identifier) define which NLRI is exchanged. NLRIs are the actual BGP routes. This is important because if you have the bgp sessions established betweeen peers but you dont aggree on address families you cannot exchange the routes. All of the features of these AFI/SAFIs are independent of each other. For example I can be a route-reflector for IPv4 unicast and someone else is for VPNv4 unicast. NOTE ALSO that in IOS the IPv4 Unicast is negiotated by default however in IOS XR AFI/SAFIs must be explicitly defined. You need to first allow the address family under bgp, that way you active the address family and then you need to specify under the neighbor also the address family – that way you gonna include in send open in the optional parameter that address family or AFI/SAFI otherwise your open will not match with neighbor and the bgp session will not be established.
Advertise NLRI – once peering is established and AFI/SAFIs are negotiated, BGP updates are exchanged. Updates (NLRI) can be generated by multiple ways. It can be Network statement, Redistribute, Conditional advertisement, Conditional Route Injection, etc. but ultimately the main goal is to get the prefix into the BGP table as a best route and then we can advertise it to our peers. In SP networks the key NLRI attributes are Prefix/len (the actual route), Next-HOP (very important for VPNv4), VPN Route Distinguisher (RD), VPN Route Target (RT)
Apply BGP Policy – In IOS XR the RPL is required between EBGP neighbors.