Pages

BGP notes

Neighbor states:

Idle: all connections are refused
Connect: wait for TCP to establish
Active: initiates the TCP connections
OpenSent: Local waits for Open message from peer. After receiving open, if no errors BGP sends keepalive
OpenConfirm: BGP waits for keepalive or notification
Established: Can exchange update, notification and keepalive

Message types:

Open: sent when TCP 3way is complete. Initiates the BGP session and contains details about BGP neighbor and supported and negotiated potions
Update: Transports routing information between BGP peers
Keepalive: On BGP level. Contains the BGP header and has no data.
Notification: sent when something is wrong (eg. unsupported options in the open message, hold time expires)
Refresh: BGP does not readvertise sent routes by default. Route refresh supports soft clearing of BGP sessions by allowing routes already sent to be re-advertised

BGP attributes:

- contained in the Update message, describes the prefixes in the message
- used to influence route selection and select best path

Local preference:
- exchanged by IBGP peers only
- used to set the exit path from the local AS

- can be changed by local policy

NextHop:
- for EBGP is the neighbor address announcing the route
- for IBGP:
   - for routes originating in the local AS (via IGP for example) with a forwarding next hop, the NextHop attribute is set to the forwarding next hop address (3rd party)
   - for routes originating in the local AS without a forwarding next hop, the NextHop is set to the IP address associated with the BGP session
   - for routes injected into the AS via EBGP the NextHop is unchanged
- can be changed by local policy

Origin:
- I (IGP - OSPF, ISIS, static, etc)
- E (EGP External GW protocol) - not really in use at the moment
- ? - unknown (not I or E)
- can be changed by local policy

MED:
- optional, non-transitive attribute
- informs neighboring AS which ingress to use in the local AS (if many ingress paths exist)
- only exchanged between peers of directly connected ASs
- options to always comapre MED (from different ASs)
- can be changed by local policy

AS Path:
- well known mandatory attribute
- each EBGP prepends local as to AS Path attribute
- routes received with local AS in AS Path attribute are considered looped and not further advertised
- can be changed by local policy (by prepending local AS)

Communities:
- optional transitive attribute
- helps with BGP policy simplification
- used with other attributes to prefer, accept or advertise routes
- one route can belong to many communities
- format is [2 byte] AS: [2 byte] number

(RouteReflector) ClusterList:
- used to prevent loops (the RouteReflector drops routes already transited through the cluster)
- cluster ID is added to ClusterList when a route reflector touches a route
- cluster ID represents an individual RouteReflector cluster

(RouteReflector) Originator ID:
- identifies the firts roter to inject a route in the AS

Path selection:

- highest local preference
- shortest AS Path
- lowest Origin (I < E < ?)
- lowest MED
- EBGP route prefered over IBGP
- lowest IGP metric
- use routes from neighbor with lowest RouterID
- shortest Cluster length (RouteReflector)
- peer with lowest IP address

Default advertisement rules:
- IBGP advertises routes received from EBGP to other IBGP peers
- EBGP advertises routes learned from IBGP or EBGP to other EBGP peers
- IBGP does not advertise routes received from IBGP peers (AS Path attribute is not updated on IBGP sessions, thus routing loops cannot be prevented)
- for IBGP to be consistent full mesh IBGP sessions are required
- BGP advertises a single best path to its peers
- IBGP implements split horizon (does not advertise the same route to a IBGP peer from which the route is received)

Route Reflectors (RR):

- alleviate the need for IBGP full mesh
- new BGP attributes:
   - ClusterList
   - originator ID
- reflection:
   - client -> RR -> clients and non-clients of RR
   - non-client -> RR -> clients of RR

Confederations:

- divides an AS into more sub-ASs
- full mesh IBGP is required within sub-AS (RR can be used also)
- changes AS Path attribute between sub-ASs (for loop prevention)
- AS confederation sequence is not counted as hops in AS Path length comparison

Route dampening:

- controls route flapping effects
- no dampening for IBGP
- new route gets 0 points
- 1000 points for route withdrawn  
- 1000 points for route re-advertisement
- 500 points when AS Path attribute changes
- points reduce at a certain rate: half-time (after half time 1/2 points are decayed)
- if the number of points is greater than suppress value, the route is suppressed
- if the number of points is smaller than the reuse value, the route is used again
- there is a parameter for maximum suppress time

No comments: