Вы находитесь на странице: 1из 14

BGP & Autonomous Systems

The main goal of BGP is to provide an inter-domain routing system (IDRS)


that guarantees the loop-free exchange of routing information between
autonomous systems.

BGP routers exchange information about paths to destination networks.

BGP-4 has many enhancements over earlier protocols. It is used


extensively on the Internet today to connect ISPs and to interconnect
enterprises to ISPs.

BGP-4 carries a network mask for each advertised network and supports
both variable-length subnet mask (VLSM) and classless inter-domain
routing (CIDR).

BGP version 4 (BGP-4) is the latest version of BGP. It is defined in Requests for Comments
(RFC) 4271, A Border Gateway Protocol (BGP-4). As noted in this RFC, the classic definition
of an AS is a set of routers under a single technical administration, using an Interior

Gateway Protocol (IGP) and common metrics to determine how to route packets within the
AS, and using an inter-AS routing protocol to determine how to route packets to other
autonomous systems.

Note: BGP is a successor to Exterior Gateway Protocol (EGP) - dual use of the EGP
acronym. The EGP protocol was developed to isolate networks from each other at the early
stages of the Internet.

BGP-4 has many enhancements over earlier protocols. It is used extensively on the Internet
today to connect ISPs and to interconnect enterprises to ISPs. BGP-4 and its extensions are
the only acceptable version of BGP available for use on the public Internet. BGP-4 carries a
network mask for each advertised network and supports both variable-length subnet mask
(VLSM) and classless inter-domain routing (CIDR).

BGP-4 predecessors did not support these capabilities, which are currently mandatory on
the Internet. When CIDR is used on a core router for a major ISP, the IP routing table, which
is composed mostly of BGP routes, has more than 300,000 CIDR blocks; not using CIDR at
the Internet level would cause the IP routing table to have more than 2,000,000 entries.
Using CIDR, and, therefore, BGP-4, prevents the Internet routing table from becoming too
large for interconnecting millions of users.

BGP works differently than IGPs. Internal routing protocols look at the path cost to get
somewhere and choose the best path from one point in a corporate network to another
based upon certain metrics. RIP uses hop count and looks to cross the fewest Layer 3
devices to reach the destination network. OSPF uses cost, which on Cisco routers is based
on bandwidth, as its metric. The IS-IS metric is typically based on bandwidth (but it defaults
to 10 on all interfaces on Cisco routers). EIGRP uses a composite metric, with bandwidth
and accumulated delay considered by default.

In contrast, BGP does not look at speed for the best path. Rather, BGP is a policy-based
routing protocol that allows an AS to control traffic flow using multiple BGP attributes.
Routers running BGP exchange network reachability information, called path vectors or
attributes, including a list of the full path of BGP AS numbers that a router should take to
reach a destination network. BGP allows an organization to fully use all of its bandwidth by
manipulating these path attributes.

ISP Connection Redundancy Single Homed

Single-homed Internet access does not require BGP. Rather, static routes are
typically used, with a static default route from the Enterprise to the ISP, and
static routes in the ISP pointing towards customer networks.
If BGP is used , the customer uses BGP to dynamically announce its public
networks to the ISP and the ISP announces only a default route to the Enterprise.

In this case, the customer uses a single connection to a single ISP. The connection type
depends on the ISP offering, and can be for example, a leased line, xDSL, or Ethernet. A
failure of the link results in a no Internet connectivity.

As shown, a single-homed Internet access does not require BGP. Rather, static routes are
typically used, with a static default route from the customer to the ISP, and static routes in
the ISP pointing towards customer networks.

If BGP is used , the customer uses BGP to dynamically announce its public networks to the
ISP and the ISP announces only a default route to the customer, since that is sufficient to
provide connectivity.

Both options (static defaults and BGP learnt defaults) have some negatives. Some packets
for truly non-existent destinations flow through the Enterprise to R1 and over the link to the
internet, before being discarded for lack of a matching route. For example, the Enterprise is
using private address range 10.0.0.0/8, so packets destined for addresses in 10.0.0.0/8 that
have not been deployed will match the default route and be routed to the Internet.

To avoid wasting this bandwidth by sending packets unnecessarily, a static route for
10.0.0.0/8, destination null0 could be added to R1, but not advertised to the rest of the
Enterprise (a discard route). This route would prevent R1 from forwarding packets destined
for network 10.0.0.0/8 into the Internet.

D
ua
l-

multi-homed connectivity includes all the benefits of multi-homed


connectivity, with enhanced resiliency.

The single multi-homed design acts like the single-homed design for
default routes in the enterprise. This design can flood a default route
throughout the Enterprise, drawing traffic to R1, which is the only router
connected to the ISPs.

The dual-multi-homed design provides abundant redundancy. This


redundancy can be used for backup, but most often, BGP would be used to
make decisions about the best path to reach various destinations.

T
h
e

benefits of dual-homing include the following:


1.

Resistance to a failure beyond a directly connected link to a single ISP.

2.

Load sharing for different destination networks between ISPs, based on the network

3.

proximity

4.

Scalability of the solution, beyond two ISPs

5.

Achieving an ISP independent solution. For example, while an ISP change would require an
update to the routing and link configuration, and changing the link, the public IP address
space used would remain the same.

There are various options for dual-homing, when a customer has two connections to a
single ISP, as shown above. In all cases, routing must be properly configured to allow both
links to be used.

Depending on the SLA signed with the ISP, the routing deployed could achieve either of the
following:

1.

Primary and backup link functionality where a single primary link is used o forward and
receive traffic to and from ISP, and the secondary link is used only when the first one fails.
Floating static routes can be used to set primary and back-up routes over the separate
links, as well as by adjusting the metrics of dynamic routing protocols.

2.

Load sharing between the links (achieved with Cisco Express Forwarding [CEF] switching).
In both cases, routing can be either static or dynamic.

3.

BGP could be utilised if different networks were to be accessed over different links.

The Internet is a collection of autonomous systems that are


interconnected to allow communication among them. BGP provides the
routing between these autonomous systems.

Enterprises that want to connect to the Internet do so through one or more


ISPs. If your organization has only one connection to one ISP, then you
probably do not need to use BGP; instead you would use a default route.
However, if you have multiple connections to one or to multiple ISPs, then
BGP might be appropriate because it allows manipulation of path
attributes, so that the optimal path can be selected.

To understand BGP, you first need to understand how it is different than


the other protocols discussed so far in this course. One way to categorize
routing protocols is by whether they are interior or exterior as follows:

IGP: A routing protocol that exchanges routing information within an


autonomous system. RIP, IGRP, OSPF, IS-IS, and EIGRP are examples of
IGPs.

EGP: A routing protocol that exchanges routing information between


different autonomous systems. BGP is an example of an EGP.

BGP is an Interdomain Routing Protocol (IDRP), also known as an EGP. BGP


version 4 (BGP4) is the latest version of BGP and is defined in RFC 4271.
As noted in this RFC, the classic definition of an autonomous system is a
set of routers under a single technical administration, using an IGP and
common metrics to route packets within the autonomous system, and
using an inter-autonomous system routing protocol (also called an EGP) to
determine how to route packets to other autonomous systems.

Autonomous systems can use more than one IGP, potentially with several
sets of metrics. From the BGP point of view, the most important

characteristic of an autonomous system is that it appears to other


autonomous systems to have a single coherent interior routing plan and
presents a consistent picture of reachable destinations. All parts of an
autonomous system must connect to each other.

When BGP is running between routers in different autonomous systems, it


is called External BGP (EBGP). When BGP is running between routers in the
same autonomous system, it is called Internal BGP (IBGP). BGP allows the
path that packets take to be manipulated by the autonomous system, as
described in this module. It is important to understand how BGP works to
avoid creating problems for your autonomous system as a result of
running BGP.

For example, enterprise AS 65500 in the above figure is learning routes


from both ISP-A and ISP-B via EBGP and is also running IBGP on all of its
routers. AS 65500 learns about routes and chooses the best way to each
one based on the configuration of the routers in the autonomous system
and the BGP routes passed from the ISPs. If one of the connections to the
ISPs goes down, traffic will be sent through the other ISP.

One of the routes that AS 65500 learns from ISP-A is the route to
172.18.0.0/16. If that route is passed through AS 65500 using IBGP and is
mistakenly announced to ISP-B, then ISP-B may decide that the best way
to get to 172.18.0.0/16 is through AS 65500, instead of through the
Internet. AS 65500 would then be considered a transit autonomous
system, which is a very undesirable situation. AS 65500 wants to have a
redundant Internet connection, but does not want to act as a transit
autonomous system between the two ISPs. Careful BGP configuration is
required to avoid this situation.

BGP Multi-Homing Options


If an organization wants to perform multi-homing with BGP, there are three
common ways to do this:
1. Each ISP passes only a default route to the autonomous
system: The default route is passed to the internal routers.
2. Each ISP passes only a default route and provider-owned
specific routes to the autonomous system: These routes may
be passed to internal routers, or all internal routers in the transit
path can run BGP and pass these routes between them.
3. Each ISP passes all routes to the autonomous system: All
internal routers in the transit path run BGP and pass these routes
between them.

Multihoming is when an autonomous system has more than one connection to the Internet.
Two typical reasons for multihoming are as follows:
1.

To increase the reliability of the connection to the Internet: If one


connection fails, the other connection remains available.

2.

To increase the performance of the connection: Better paths can be used to


certain destinations.

3.

The benefits of BGP are apparent when an autonomous system has multiple EBGP
connections to either single or multiple autonomous systems. Multiple connections
allows an organization to have redundant connections to the Internet so that
connectivity can still be maintained if a single path becomes unavailable.

An organization can be multihomed to either a single ISP or to multiple ISPs. A drawback to


having all of your connections to a single ISP is that connectivity issues in that single ISP
can cause your autonomous system to lose connectivity to the Internet. By having
connections to multiple ISPs, an organization gains the following benefits:
1.

Redundancy with the multiple connections

2.

Not tied into the routing policy of a single ISP

3.

More paths to the same networks for better policy manipulation

4.

A multihomed autonomous system can run EBGP with its external neighbors and
might also run IBGP internally.

When to Use BGP


1. The AS allows packets to transit through it to reach other
autonomous systems (for example, it is a service provider).
2. The AS has multiple connections to other autonomous systems.
3. Routing policy and route selection for traffic entering and leaving
the AS must be manipulated.
When not to use BGP
1. A single connection to the Internet or another AS.
2. Lack of memory or processor power on edge routers to handle constant
BGP updates.
3. You have a limited understanding of route filtering and the BGP pathselection process - use static or default routes instead.

BGP Path Vector Characteristics

The collection of path information is expressed as a sequence of


autonomous system numbers called the AS path, which forms a route to
reach a specific destination.

The AS path is always loop-free. A router running BGP does not accept a
routing update that already includes the router autonomous system
number in the path list, as accepting it again would result in a routing
loop.

Internal routing protocols announce a list of networks and the metrics to get to each
network. In contrast, BGP routers exchange network reachability information, called path
vectors, made up of path attributes. The path-vector information includes a list of the full
path of BGP autonomous system numbers (hop by hop) necessary to reach a destination
network and the networks that are reachable at the end of the path.

Other attributes include the IP address to get to the next autonomous system (the next-hop
attribute) and an indication of how the networks at the end of the path were introduced
into BGP (the origin code attribute). This autonomous system path information is useful to
construct a graph of autonomous systems based on the information exchanged between
BGP neighbors.

BGP views the whole internetwork as a graph, or tree, of autonomous systems. The
connection between any two systems forms a path. The collection of path information is
expressed as a sequence of autonomous system numbers called the AS path. This
sequence forms a route to reach a specific destination.

The AS path is always loop-free. A router running BGP does not accept a routing update
that already includes the router autonomous system number in the path list, because the
update has already passed through its autonomous system, and accepting it again would
result in a routing loop.

BGP Features

BGP is used by ISPs so that they can communicate and exchange packets.
The ISPs have multiple connections to each other and agreements to
exchange updates.

BGP is categorized as an advanced distance vector protocol, but it is


actually a path-vector protocol. BGP is very different from standard
distance vector protocols, such as RIP.

BGP uses TCP (port 179) as its transport protocol, which provides
connection-oriented reliable delivery.

Two routers using BGP form a TCP connection with one another and
exchange messages to open and confirm the connection parameters.
These two BGP routers are called peer routers, or neighbours.

After the connection is made, BGP peers exchange full routing tables.
However, since the connection is reliable, BGP peers subsequently send
only changes (incremental or triggered updates) after that.

Reliable links do not require periodic routing updates; therefore, routers


use triggered updates instead. BGP sends keepalive messages, similar to
the hello messages sent by OSPF, IS-IS, and EIGRP.

BGP is the only IP routing protocol to use TCP as its transport layer. OSPF
and EIGRP reside directly above the IP layer, and RIPv1 and RIPv2 use User
Datagram Protocol (UDP) for their transport layer.

BGP Peers = BGP Neighbors

A BGP peer, also known as a BGP neighbor, is a specific term that is


used for BGP speakers that have established a neighbor relationship.

Any two routers that have formed a TCP connection to exchange BGP
routing information are called BGP peers or BGP neighbors.

Internal & External BGP

When BGP is running between neighbors that belong to different


autonomous systems, it is called EBGP.

EBGP neighbors, by default, need to be directly connected

When BGP is running between neighbors within the same AS, it is called
IBGP.

The neighbors do not have to be directly connected


Avoiding Routing loops

A typical Enterprise network design uses default routes inside the Enterprise, as
advertised by the IGP, to draw all Internet traffic towards one or more Internet
connected routers (R1 and R2), which forward the traffic to the Internet.

Routing loops can occur when R1 and R2 do not have a direct connection to each
other they may be physically located within different branch offices.

R1s best root to 192.135.10.0/24 is via R2, therefore R1s best route points back
into the enterprise network. However, all of the routers internal to the enterprise
are configured with default routes that point towards R1. Thus the following
events happen for a packet destined for 192.135.10.1:
1. The core L3 switches send the packet to its default route to R1.
2. R1 matches its BGP route for 192.135.10.0/24, with next-hop R2; the
recursive lookup on R1 matches a route to R2 so R1 forwards the packet
back into the core.

These steps repeat until the packets TTL mechanism causes one of the routers to
discard the packet.

The lack of knowledge about the best route for subnet 192.135.10/24, particularly
on the routers internal to the Enterprise, causes this routing loop. To avoid this
problem, internal routers need to know the best BGP routes using either of the
following methods:
1. Run BGP on at least some of the routers internal to the Enterprise.
2. Redistribute BGP routes into the IGP (not recommended).

BGP Attributes

BGP routers send BGP update messages about destination networks to


other BGP routers. The update messages contain one or more routes and a
set of BGP metrics, which are called path attributes, attached to the
routes.

An attribute is either:
1. Well-known mandatory
2. Well-known discretionary
3. Optional transitive
4. Optional non-transitive

All BGP routers must recognize a well-known attribute and propagate it to the other BGP
neighbors.

Well-known attributes are either mandatory or discretionary. A well-known mandatory


attribute must be present in all BGP updates. A well-known discretionary attribute does not
have to be present in all BGP updates.

Attributes that are not well-known are called optional. BGP routers do not have to support
an optional attribute. Optional attributes are either transitive or non-transitive.

The following statements apply to optional attributes:


1.

BGP routers that implement the optional attribute may propagate it to the other
BGP neighbors, based on its meaning.

2.

BGP routers that do not implement an optional transitive attribute should pass it to
other BGP routers untouched and mark the attribute as partial.

3.

BGP routers that do not implement an optional non-transitive attribute must delete
the attribute and must not pass it to other BGP routers.

AS-Path / Next-Hop Attributes

The AS path is a well-known mandatory attribute. Whenever a route


update passes through an autonomous system, the autonomous system
number is prepended (added) to that update when it is advertised to the
next EBGP neighbor.

BGP routes autonomous system by autonomous system, not router by


router. The next-hop is a well-known mandatory attribute. For EBGP, the
next hop is the IP address of the neighbor that sent the update. For IBGP,
the protocol states that the next hop that is advertised by EBGP should be
carried into IBGP.

Next-Hop Attribute in a Multi-accessNetwork

When running BGP over a multi-access network such as Ethernet, a BGP


router uses the appropriate address as the next-hop address (by changing
the next-hop attribute) to avoid inserting additional hops into the path.

This feature is sometimes called a third-party next hop.

Order

Attribute

Preference

De

Next Hop
Reachable?

True

If no route to
be used.

Weight

Highest

Administrative

Local Preference Highest

Used internall

Locally Injected

True

Used to prefe
this router

AS-Path

Shortest

Minimise AS-h

Origin

i<?

Prefer stabilit

MED

Lowest

Used external

Neighbour Type

EBGP<IBGP

Prefer I over

IGP Metric

Lowest

Look for more

EBGP Peering

Oldest

Prefer stabilit

10

RID

Lowest

Chose lowest B

Вам также может понравиться