BGP is an exterior gateway protocol used to exchange routing information between autonomous systems. It allows routers running BGP to establish peering sessions through TCP connections and exchange routing updates. There are several BGP message types including Open, Update, Keepalive, and Notification. The BGP states include Idle, Connect, Active, OpenSent, OpenConfirm, and Established through which the peering sessions progress as messages are exchanged and acknowledged between peers.