For routers to route to a system not within its autonomous system (AS), an inter-AS routing protocol is needed.
- Need to combine ASes together by providing reachability information of internet addresses beyond the scope of the current AS
- Need to advertise IP addresses beyond AS and broadcast best route
BGP (Border Gateway Protocol) is the de facto inter-domain routing protocol.
- Provides each autonomous system (AS) a means to:
- eBGP - obtain subnet reachability from neighboring ASes
- iBGP - propgate reachability information to all AS-internal routers
- Determine “good” routes to other networks based on reachability information and policy
- BGP does not advertise IPs internal to system (part of intra-routing protocol)

Observe theere are 2 kinds of BGP connectivities/sessions - eBGP (between ASes), logical iBGP (within AS).
In a BGP session, 2 BGP routers (”peers”) exchange BGP messages over a semi-permanent TCP connection
- Paths for different destination network prefixes are advertised
- BGP - “path vector” protocol
- e.g. Consider the following set of ASes
- WHen AS3 gateway 3a advertises path AS3,X to AS2 gateway 2c:
- AS3 promises to AS2 that it will forward datagrams toward X

- BGP route advertisement contains:
- Prefix
- Corresponds to destination being advertised
- Attributes
- AS-PATH - list of ASes through which prefix advertisement has passed
- NEXT-HOP - indicates specific internal-AS router to next-hop AS
- Policy-based routing
- Gateway receiving route advertisement uses import policy to accept/decline a path (e.g. never to route through AS Y)
- AS policy determines whether to advertise path to other neighboring ASes
- e.g. BGP path advertisement
-
AS2 router 2c receives path advertisement AS3,X via eBGP from AS3 router a3
-
Based on AS2 policy:
- AS2 router 2c accepts path AS3,X and propagates this message via iBGP to all AS2 routers
- AS2 router 2a advertises via eBGP path AS2,AS3,X to AS1 router 1c

-
A gateway router can learn about multiple paths to a destination
- AS1 gateway router 1clearns about the paths to X:
- AS2,AS3,X from 2a
- AS3,X from 3a
- Based on policy, AS1 will choose AS3,X and advertise path within AS1 via iBGP
- BGP message types include:
- OPEN - open TCP connection to remoge BGP peer, authenticate sending bGP peer
- UPDATE - advertise new path or withdraw old
- KEEPALIVE - keep connection alive in absence of UPDATES, ACK open request
- NOTIFICATION - report errors in previous message + close connection
- BGP is an application-level protocol to maintain routing tables
- e.g. IBGP - inform routers in AS1 to use a particular interface to get to gateway
