Skip to main content

BGP notes

Characteristics:

  • use TCP 179 port
  • use triggered update
  • periodically sends keepalive
  • abundant metric for path selection

Timer:

  • keeplive: 60
  • timeout: 180

BGP Synchronization:

  • routes learnt from IBGP will be advertizd to ebgp neighbors only they are in the IGP too

Attribute:

  • well-known mandatory(公认必尊,必须看到,必须传递): as-path, next-hop, origin
  • well-known discretionary(公认自觉,必须看到,可以不传递): local-preference, atomic_aggregate
  • Optional transitive: Community, Aggregator
  • Optional non-transitive: MED, Originator_ID, Cluster_list, weight

Community attribute:

  • public attributes:
    • no_advertise: don’t send to any bgp peer
    • no_export: don’t send to any ebgp peer
    • internet: send to all bgp peer
    • local-as: don’t send to other AS peers
  • private: format in aa:nn

Path selection:

  1. weight
  2. local-preference
  3. (routes from local first)
  4. as-path
  5. origin: IGP > EGP > Incomplete
  6. MED (smaller is better)
  7. EBGP (AD 20) first > IBGP (AD 200)
  8. next-hop has smaller metric in IGP
  9. local balancing
  10. oldest EBGP route
  11. Router ID (smaller is better) (usually stop here at a symmetric network)
  12. cluster-id (shortest first)
  13. IP address (smaller is better)

aggreation:

  • summary-only: suppress detail routes, only summarized route will be sent (at least one detail route in the summarized route exists, or nothing will be sent)

packets:

  • open packets
    • create connections
    • sender's AS
    • identifier
    • capabilities
  • keepalive packets
    • maintain neighborhood
  • update
    • path information and metrics
  • notification.
  • route-refresh.

tables:

  • neighbor table. show ip bgp summary
  • forwarding table. show ip bgp
  • route table. show ip route

state machine:

  • Idle. search route for neighbors
  • Connect. handshaking. authentication is done during this state
  • active. a router send open packet and wait for response
  • Open sent. send Open packet.
  • Open confirm. received open packet and matched. send keepalive and wait for the open confirm from the other end.
  • Established. both side confirmed

troubleshooting:

  • stuck in Idle: no route to the neighbor
  • stuck in active: a router send open packet and wait for response. the state may swing between Idle and active, this may be because:
    • the neighbor doesn't have the route for response (the neighbor will be in the idle state)
    • neighbor configed wrong IP
    • AS doesn't match
    • the neighbor doesn't have a neighbor statement for this router (the neighbor will be in the idle state)