Professional Documents
Culture Documents
BGP 4
BGP 4
• Scaling BGP
Confederations
Route Reflectors
Peer-groups
• Conclusion
I prepend my AS AS 4
321
to outgoing
421
updates
21
PATH
AS 3
1
21
AS 1 AS 2
168.1.1.0 /24
iBGP iBGP
iBGP eBGP
iBGP
• Rules of propagation:
eBGP learned -> propagate to iBGP, eBGP
iBGP learned -> propagate to eBGP
• iBGP peers:
Can be any number of hops away
TTL=255 in BGP packets header
• eBGP peers: (default)
According to rfc, it must be 1 hop away
TTL=1 in BGP packets header
neighbor {neighbor}
ebgp-multihop [maximum-hop-count]
.1 192.0.1.0/24
router bgp B
neighbor 1.1.1.2 remote-as A
neighbor 1.1.1.2 update-source LoopBack0
Juniper Business Use
BGP Training © 2002, Cisco Systems, Inc. Only 21
Finite State Machine (III)
• Everything happens between each pair of neighbors
• Debugs: debug ip bgp
• Idle—The router is searching the routing table to see whether a route
exists to reach the neighbor.
• Connect—The router found a route to the neighbor and has
completed the three-way TCP handshake.
• Active- If the router is in the active state, this means that it has found
the IP address in the neighbor statement and has created and sent
out a BGP open packet but has not received a response (open
confirm packet) back from the neighbor.
• Open sent—An open message was sent, with the parameters for the
BGP session.
• Open confirm—The router received agreement on the parameters for
establishing a session. Alternatively, the router goes into Active state
if there is no response to the open message.
• Established—Peering is established and routing begins.
Juniper Business Use
BGP Training © 2002, Cisco Systems, Inc. Only 22
Finite State Machine
Active State Timers
Closing
*Mar 24 18:49:48.907: BGP: 14.1.1.2 went from Established to Idle
Wait 20 seconds
*Mar 24 18:50:09.503: BGP: 14.1.1.2 went from Idle to Active
*Mar 24 18:50:09.515: BGP: 14.1.1.2 open active, delay 23712ms
Wait 23712 ms (30 secs – 50% jitter)
*Mar 24 18:50:33.255: BGP: 14.1.1.2 open active, local address 14.1.1.1
*Mar 24 18:51:03.347: BGP: 14.1.1.2 open failed: Connection timed out; remote host not responding
TCP session failed. Wait ConnectRetry timer (120 seconds)
*Mar 24 18:53:03.367: BGP: 14.1.1.2 open active, local address 14.1.1.1
*Mar 24 18:53:33.455: BGP: 14.1.1.2 open failed: Connection timed out; remote host not responding
TCP session failed. Wait ConnectRetry timer (120 seconds)
*Mar 24 18:55:33.479: BGP: 14.1.1.2 open active, local address 14.1.1.1
*Mar 24 18:56:03.567: BGP: 14.1.1.2 open failed: Connection timed out; remote host not responding
TCP session failed. Wait ConnectRetry timer (120 seconds)
TCP session is finally successful an BGP peer comes up
*Mar 24 18:58:03.591: BGP: 14.1.1.2 open active, local address 14.1.1.1
*Mar 24 18:58:03.631: BGP: 14.1.1.2 went from Active to OpenSent
*Mar 24 18:58:03.767: BGP: 14.1.1.2 went from OpenSent to OpenConfirm
*Mar 24 18:58:03.839: BGP: 14.1.1.2 went from OpenConfirm to Established
*Mar 24 18:58:03.839: %BGP-5-ADJCHANGE: neighbor 14.1.1.2 Up
PASSIVE SIDE
16:06:31: BGP: 7.75.7.1 passive open
16:06:31: BGP: 7.75.7.1 OPEN rcvd, version 4
16:06:31: BGP: 7.75.7.1 sending OPEN, version 4
16:06:31: BGP: 7.75.7.1 rcv OPEN w/ OPTION parameter len: 12
16:06:31: BGP: 7.75.7.1 rcv OPEN w/ option parameter type 2 (Capability) len 6
16:06:31: BGP: 7.75.7.1 OPEN has CAPABILITY code: 1, length 4
16:06:31: BGP: 7.75.7.1 OPEN has MP_EXT CAP for afi/safi: 1/1
16:06:31: BGP: 7.75.7.1 rcv OPEN w/ option parameter type 2 (Capability) len 2
16:06:31: BGP: 7.75.7.1 OPEN has CAPABILITY code: 128, length 0
• Well known-mandatory
• Information of all the ASes the route
traversed
• It is a sequence of AS path segments:
0 1 2
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--------------
| Path Seg Type |Path Seg Length| Path Seg Value (...)
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--------------
• Well-known mandatory
• It is an IP address
• Propagates only inside the AS
• It is the next-hop where to send the
packets that match this prefix
It does not need to be directly connected!
We will do a recursive lookup for the next-hop
Typically, the next-hop is known via the IGP
Juniper Business Use
BGP Training © 2002, Cisco Systems, Inc. Only 30
NEXT_HOP (type code 3) (II)
180.0.0.1
NEXT_HOP: 170.0.0.1
NEXT_HOP: 170.0.0.1
192.0.1.0 /24
MED = 10
MED 20
Route with
lowest MED
wins!!
Juniper Business Use
BGP Training © 2002, Cisco Systems, Inc. Only 34
LOCAL_PREF (MED)
(type code 5) (I)
LOC_PREF = 100
Route with
highest
LOC_PREF wins!!
Juniper Business Use
BGP Training © 2002, Cisco Systems, Inc. Only 37
ATOMIC_AGGREGATE
(type code 6)
• rfc1997
• Optional transitive
• Community: a 4 octet tag (color) to
identify the route
• A route may have multiple
communities
The attribute is a set of 4 byte values
• Facilitates the use of policies
Juniper Business Use
BGP Training © 2002, Cisco Systems, Inc. Only 40
COMMUNITY (type code 8) (II)
• Especial communities:
0xFFFFFF01: NO_EXPORT
Do not advertise the route outside the AS
0xFFFFFF02: NO_ADVERTISE
Do not advertise the route to any peer
0xFFFFFF03: LOCAL_AS (or NO_EXPORT_SUBCONFED)
Do not advertise outside the Local-AS (Local-AS is a
sub-AS if you are using confederations)
0x0: INTERNET
“Represents” all routes
• Cisco configuration:
neighbor x.x.x.x send-community
To send already existing communities
To allow sending policy set communities
Otherwise, you never send any community
• Cisco implementation:
We show and propagate communities in order (lower to
higher) and eliminating repetitions
draft-ietf-idr-bgp-ext-communities
rfc4360
• Differences with COMMUNITY:
8 octets
2 fields: type + value
• Comparison
When comparing extended communities, all 8 bytes must
be compared
The type, the subtype does ALWAYS differentiate the
extended communities
• Cisco implementation:
We show and propagate extended communities in order
(lower to higher) and eliminating repetitions
When it’s a well known community, we show the name,
otherwise we show the numerical value
• Cisco specific
• Pseudo-attribute
Never propagates out of the router
• Value: 0 - 65535
• Default:
originated locally: WEIGHT= 32768
other: WEIGHT= 0
Juniper Business Use
BGP Training © 2002, Cisco Systems, Inc. Only 51
Show ip bgp
• AFI (rfc1700)
1 IPv4
2 IPv6
3 CLNS
8 E.164
3. Highest WEIGHT
Local to the router
4. Highest LOCAL_PREF
Local to the AS
AS 2
AS 100
AS 3
iBGP update
eBGP eBGP update
iBGP
Physical link
Juniper Business Use
BGP Training © 2002, Cisco Systems, Inc. Only 75
Full Mesh (III)
[no] synchronization
AS 880
Synchronization:
IGP -> BGP
AS 209
BGP session
iBGP route propagation B does not
eBGP route propagation Redistribution:
run BGP
eBGP-> IGP
IGP route propagation
192.0.1.1,
advertised AS 209
to AS 880 LABEL= 1
IGP LABEL=3
A game of mirrors
• Scalability
• rfc4456, rfc2796, rfc1996
• Reduce the number of BGP peering
sessions in an AS
• How?
Change the rules of propagation for iBGP
routes
AS 2 AS 2
AS 1 AS 1
Learned by Propagated to
• Cluster:
set of route-reflectors + its clients
In our definition, we assume that any router (route-reflector or
client) can belong to only one cluster as a route-reflector or as a
client.
In an unorthodox configuration, the cluster definition would
loose meaning.
• CLUSTER-ID
ROUTER-ID by default
or cluster-id <cluster-id >
Only route-reflectors in a cluster know what is the cluster-id
• Objective:
Avoid loops of routing information
(it would happen in a miss-configuration)
Avoid useless replication of updates
• Two new attributes:
ORIGINATOR (type code 9)
CLUSTER_LIST (type code 10)
(both are optional non-transitive)
Juniper Business Use
BGP Training © 2002, Cisco Systems, Inc. Only 93
Route Reflectors Caveats