0% found this document useful (0 votes)
36 views17 pages

Lesson 5 BGP

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views17 pages

Lesson 5 BGP

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

BGP

CCNP Enterprise: Core Networking


Content

This chapter covers the following content:


• BGP Fundamentals - This section provides an overview of the
fundamentals of the BGP routing protocol.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 2
BGP Fundamentals
• Border Gateway Protocol (BGP) is an EGP standardized path vector routing protocol
that provides scalability, flexibility, and network stability. When BGP was created, the
primary design consideration was for IPv4 inter-organization connectivity on public
networks like the Internet and on private dedicated networks.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 3
BGP Fundamentals
Autonomous System Numbers
From the perspective of BGP, an autonomous system (AS) is a collection of
routers under a single organization’s control, using one or more IGPs and
common metrics.
• An organization requiring connectivity to the internet must obtain an autonomous
system number (ASN) from the Internet Assigned Numbers Authority (IANA).
• RFC 4893 expanded the ASN field from 2 bytes to accommodate 4 bytes (32-bit
range). This allows for 4,294,967,295 unique ASNs, providing quite an increase from
the original 65,535 ASNs.
• The IANA requires organizations or individuals requesting AS numbers to meet the
following conditions:
• Proof of a publicly allocated network range
• Proof that Internet connectivity is provided through multiple connections
• Demonstrated need for a unique routing policy from their providers.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 4
BGP Fundamentals
Autonomous System Numbers (Cont.)
Similar to IP Addresses, the AS number assignments include private address
ranges that cannot be used for Internet traffic. These ranges are:
• ASNs 64,512–65,535 are private ASNs in the 16-bit ASN range.

• ASNs 4,200,000,000–4,294,967,294 are private ASNs within the extended


32-bit range.
• Use only the ASN assigned by IANA, the ASN assigned by your service
provider, or a private ASN. Using another organization’s ASN without
permission could result in traffic loss and cause havoc on the internet.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 5
BGP Fundamentals
Path Attributes
BGP uses path attributes (PAs) associated with each network path. The
PAs provide BGP with granularity and control of routing policies within
BGP. The BGP prefix PAs are classified as follows:
• Well-known mandatory
• Well-known discretionary
• Optional transitive
• Optional non-transitive
Per RFC 4271, well-known attributes must be recognized by all BGP
implementations. Well-known mandatory attributes must be included
with every prefix advertisement; well-known discretionary attributes may
or may not be included with a prefix advertisement.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 6
BGP Fundamentals
Loop Prevention
BGP is a path vector routing protocol and does not contain a complete
topology of the network, as link-state routing protocols do. BGP behaves
like distance vector protocols, ensuring that a path is loop free.

The Loop Prevention Mechanism:


• AS 100 advertises the 172.16.1.0/24
prefix to AS 200.
• AS 200 advertises the prefix to AS 400,
which then advertises the prefix to AS
300.
• AS 300 advertises the prefix back to AS
100 with an AS_Path of 300 400 200 100.
AS 100 sees itself in the AS_Path variable
and discards the prefix.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 7
BGP Fundamentals
Address Families
• RFC 2858 added Multi-Protocol BGP (MP-BGP) capability by adding an extension called the
address family identifier (AFI).
• An address family correlates to a specific network protocol, such as IPv4 or IPv6, and additional
granularity is provided through a subsequent address-family identifier (SAFI) such as unicast or
multicast.
• MBGP achieves this separation by using the BGP path attributes (PAs) MP_REACH_NLRI and
MP_UNREACH_NLRI to carry different reachability information for the different address families.
• Every address family maintains a separate database and configuration for each protocol
(address family + sub-address family) in BGP.
• Some network engineers refer to Multiprotocol BGP as MP-BGP, and other network engineers
use the term MBGP. Both terms refer to the same thing.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 8
BGP Fundamentals
Inter-Router Communication
• BGP does not use hello packets to discover neighbors, as do IGP protocols, and it
cannot discover neighbors dynamically. BGP neighbors are defined by IP address.
• BGP uses TCP port 179 to communicate with other routers.
• Most recent implementations of BGP set the do-not-fragment (DF) bit to prevent
fragmentation and rely on path MTU discovery.
• BGP uses TCP, so unlike IGPs, it can form adjacencies with routers that are multiple
hops away.
• A BGP session refers to the established adjacency between two BGP routers. Multi-
hop sessions require that the router use an underlying route installed in the RIB
(static or from any routing protocol) to establish the TCP session with the remote
endpoint.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 9
BGP Fundamentals
Inter-Router Communication (Cont.)
BGP can be thought of as a control plane routing protocol or as an application
because it allows for the exchange of routes with a peer that is multiple hops
away.

• A BGP session refers to the established


adjacency between two BGP routers.
• BGP neighbors connected to the same
network use the ARP table to locate the
IP address of the peer. Multi-hop BGP
sessions require routing table
information for finding the IP address of
the peer.
• A default route is not sufficient to
establish a multi-hop BGP session.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 10
BGP Fundamentals
BGP Session Types
BGP sessions are categorized into two types:
Internal BGP (iBGP) - Sessions established with an iBGP router that are in the
same AS or that participate in the same BGP confederation. iBGP prefixes are
assigned an administrative distance (AD) of 200 upon installation in the router’s
RIB.
External BGP (eBGP) - Sessions established with a BGP router that are in a
different AS. eBGP prefixes are assigned an AD of 20 upon installation in the
router’s RIB.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 11
BGP Fundamentals
BGP Session Types (Cont.)
iBGP
Service providers provide transit connectivity. Enterprises should not.
Preventing an AS from becoming a transit AS by redistributing BGP
routes into the IGP is not a viable solution for the following reasons:
• Scalability - The internet has over 780,000 IPv4 network prefixes, IGPs
cannot scale to that level of routes.
• Custom routing - IGPs use metrics as the primary method of route
selection. BGP uses multiple steps to identify the best path or to
manipulate the path for a specific network prefix.
• Path attributes - All of the BGP path attributes cannot be maintained
within IGP protocols.
Establishing iBGP sessions between IGP routers in a full mesh
allows for proper forwarding between autonomous systems.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 12
BGP Fundamentals
BGP Session Types (Cont.)
eBGP
eBGP is the core component of BGP on the internet. The difference in behavior
for eBGP sessions and iBGP sessions are:
■ iBGP allows for multi-hop sessions. eBGP packets set the TTL to
one, so packets are dropped if multi-hop connections are
attempted.
■ The advertising router modifies the BGP next-hop address to the
IP address sourcing the BGP connection.
■ The advertising router prepends its ASN to the existing AS_Path variable.
■ The receiving router verifies that the AS_Path variable does not
contain an ASN that matches the local routers. BGP discards
the NLRI if it fails the AS_Path loop prevention check.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 13
BGP Fundamentals
BGP Messages
Table 11-2 BGP Packet Types
TYPE NAME FUNCTIONAL OVERVIEW

1 OPEN Sets up and establishes BGP adjacency


2 UPDATE Advertises, updates, or withdraws routes
3 NOTIFICATION Indicates an error condition to a BGP neighbor
4 KEEPALIVE Ensures that BGP neighbors are still alive

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 14
BGP Fundamentals
BGP Neighbor States

The BGP session may report the


following states:
• Idle
• Connect
• Active
• OpenSent
• OpenConfirm
• Established

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 15
BGP Fundamentals
BGP Neighbor States (Cont.)
BGP forms a TCP session with neighbor routers called peers. BGP uses the finite-state
machine (FSM) to maintain a table of all BGP peers and their operational status.

• Idle - The first stage of the BGP FSM. BGP detects a start event and attempts to
initiate a TCP session with the BGP peer.
• Connect - BGP initiates the TCP connection. When the TCP handshake is completed,
the ConnectRetryTimer is reset, an Open message is sent to the neighbor, and the state
changes to OpenSent. During this stage, the router with the higher IP address manages
the connection.
• Active - BGP starts another TCP three-way handshake. If the connection is established
an Open message is sent and the state moves to OpenSent.
• OpenSent - If the OPEN message that is received by the originating router contains no
errors, the connection state moves to OpenConfirm
• OpenConfirm - In the OpenConfirm state, BGP waits for KEEPALIVE or
NOTIFICATION messages. Upon receipt of a neighbor’s KEEPALIVE message, the
state is moved to Established.
• Established - BGP neighbors exchange routes using UPDATE messages.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 16

You might also like