BGP is a routing protocol that exchanges routing information between autonomous systems to enable traffic routing between networks. It uses TCP to communicate between routers within and outside autonomous systems. BGP maintains two routing tables, one for the interior gateway protocol within an autonomous system and another for external BGP routes. It selects the best path among potentially multiple paths to a destination and installs that in the IP forwarding table.