Border Gateway Protocol
- AS – Routers run by an operator under a single administration
- IGP – use common metrics to determine how to route packets within the AS
- BGP – Inter-Autonomous System routing protocol, the main routing protocol of the internet
BGP
- TCP port 179
• Connection oriented
• Direct IP connection required - Establishes Peers
- "selective" protocol, it only shares the prefixes we instruct it to share
- scalable, it hides other information that could have an impact on the overall performance of BGP worldwide
port flapping
changes in the network topology and new users
- only be one or two routers running BGP in AS, on the edge of an IGP network and connect to other autonomous systems
- BGP router will also be running IGP routing but it will keep separate routing tables for both
- The BGP router will advertise a route to it’s BGP peer only if told to do so
-Path vector Protocol
Type of protocol
- IGP: OSPF+ISIS, Link State protocol,not maintain the path traversed to each prefix, just the next hop
- BGP: Path Vector Protocol , maintain the path to the destination prefix
Different types of BGP
- i-BGP – BGP can run internally within an AS – known as internal BGP or i-BGP, used when creating a transit Autonomous System,allow traffic from one autonomous system to another to flow through it.
- e-BGP – external BGP, externally between AS’s
Peering
- before BGP routers will communicate with each other they have to become peers
- BGP uses Finite State Machine to make decisions when establishing peers
- IDLE: initiates all BGP resources with it’s configured peer
- CONNECT: waits for the TCP connection to complete
- OPENSENT: negotiation of a TCP connection successful
- ACTIVE: negotiation of a TCP connection not successful due to TCP port 179 closed or bad peer configed. The router will try to restart another TCP session with the peer, if success then change to OPENSENT otherwise reset yo IDLE
- OPENCONFIRM: OPEN message was sent successfully
- ESTABLISHED: If a KEEPALIVE message is received from the peer in the allowed time, this is final state, routers can send and receive update messages between each other to exchange routing information; any error in the UPDATE message then a NOTIFICATION message is sent to the peer, and BGP state transitions back to the IDLE
BGP share prefix
BGP routers need to announce any prefix that has to be reached from outside it’s own autonomous system
How BGP share prefix
two ways of configuring BGP to share prefixes:
1) use BGP network statements
-effectively permit statements, BGP checks if the prefix is available within the AS before announcing it. It does it by checking it’s routing table
-also used to advertise static routes
2) redistribute the IGP routes into BGP
insert all of the IGP routing table entries into the BGP routing table, combined with a filter list to filter
out any IP prefixes we do not want to share outside of our Autonomous System and allows the IP prefixes that we do want to share
BGP attributes
– Next Hop
– MED – Multi Exit Discriminator
– Local Preference
– Weight
– AS Path
– Origin (i,e,?)
BGP path selection
1) consider if the next hop is inaccessible
2) BGP will pick the path with the largest weight and chose this as the path to send the packet
3) If weights are equal, prefer largest local preference, highest value will be chosen
4) If LocPref are the same, favor route originated by this router – Network command is preferred over aggregate command
5) Prefer shorter AS_PATH if none of the paths is local
6) Favor lower origin if all previous attributes are the same
7) Select path with lowest MED
8) Favor external over internal paths
9) Prefer path via closest IGP neighbor
10) Select a path with the lowest router ID
BGP route Summarization
- It slows down the internet table growth and it generates less update messages as it is now only advertising
one prefix - hides any link failures as a summary prefix is always available