BGP is a very robust routing protocol that is used to exchange routing information between multiple Autonomous Systems (AS). This brings up the question of what an AS is. An AS is a collection of IP prefixes (read IP networks) that are maintained by a network operator. This network operator could be an enterprise or an ISP.
Each AS has a number assigned to it called ASN (Autonomous System Number). Public AS numbers are assigned by the IANA (Internet Assigned Numbers Authority) to the RIRs (Regional Internet Registries). These RIRs, in turn, assign them to individual enterprises or ISPs.
Configuration of BGP largely depends on how an organization is connected to an ISP. There are four possible ways in which this can be done: