BGP was originally intended just for IPv4 support. Multi Protocol BGP, or MP-BGP, was introduced in RFC 2858 with an extension called the address family identifier.
The address family identifier allows multiple specific network protocols in BGP to be supported, such as IPv4 and IPv6. Each address family maintains its own database and configuration information in the router. This permits different routing policies whilst maintaining the same BGP session with other routers.
Further granularity can be added with the use of subsequent family identifiers in these protocols to support additional protocols such as multicast.
Multiprotocol BGP seperates the protocols via the use of path attributes MP_REACH_NLRI and MP_UNREACH_NLRI. They are carried inside BGP update messages and contain information of network reachability of different address families.