My personal study notes for BGP. I do this so that I can quickly reference and update them and hopefully others might find them useful.
BGP – Path vector based EGP, providing routing between autonomous systems.
Private AS range: 64512-65534
Public AS’s are assigned by RIR (regional internet registries) ex. ARIN / RIPE / APNIC
Uses TCP port 179
EBGP – Uses interface IP, 1 hop away only by default.
IBGP – Usually uses loopback IP, no hop limit and utilizing an IGP adds aditional reliability.
BGP Neighbor states:
- Idle – Initializing BGP
- Connect – Waiting for TCP
- Active – Initiating session
- Open Sent – BGP Open
- Open Confirm – Wait
- Established – Ready
BGP Messages:
- Open – Router / Capabilities
- Update – AS-Path / Attributes, NLRIs for Destinations
- KeepAlive – Maintain Session (don’t include any data following the header)
- Notification – Somethings wrong
- Refresh – Soft Clear Session, resent previously acknowledged routes
BGP Path Selection:
- Local-Preference (Highest)
- AS-Path (Shortest)
- Orgin (I>E>?)
- MED (Lowest)
- Prefer EBGP to IBGP
- IBGP – Lowest IGP Cost, EBGP – Active Route
- Peer Router ID (Lowest)
- Cluster-List (Shortest)
- Peer IP (Lowest)
BGP Communities – 32 bit number that can traverse from AS to AS, doesn’t effect path selection directly, but can be used in policy that would then change metrics on path selection items.
Juniper BGP default route import / export:
Export:
- EBGP: Export all active EBGP & IBGP routes
- IBGP: Active EBGP Routes, no IBGP routes
Import:
- Accept BGP Routes
BGP Attributes:
Attributes types:
- Well-Known Mandatory – Must be supported by all BGP implementations and must be included in every BGP update.
- Well-known Discretionary – Must be supported in all BGP implementations, but doesn’t have to be included in every BGP update.
- Optional Transitive – Not required to be supported by all BGP implementations, but if they are, they should be passed along, unchanged to other BGP peers.
- Optional Non-transitive – Not required to be supported by all BGP implementations, if not recognized it is ignored and not passed to other peers.
Attributes:
Name | Type |
AS Path | Well-Known Mandatory |
Local Preference | Well-Known Discretionary |
MED | Optional Non-transitive |
Orgin | Well-Known Mandatory |
Next Hop | Well-Known Mandatory |
Community | Optional Transitive |
Aggregator | Optional Transitive |
Atomic Aggregator | Well-Known Discretionary |
Cluster List | Optional Non-transitive |
Originator ID | Optional Non-transitive |