Академический Документы
Профессиональный Документы
Культура Документы
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.
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-
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.
T
h
e
2.
Load sharing for different destination networks between ISPs, based on the network
3.
proximity
4.
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.
Autonomous systems can use more than one IGP, potentially with several
sets of metrics. From the BGP point of view, the most important
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.
Multihoming is when an autonomous system has more than one connection to the Internet.
Two typical reasons for multihoming are as follows:
1.
2.
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.
2.
3.
4.
A multihomed autonomous system can run EBGP with its external neighbors and
might also run IBGP internally.
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 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.
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.
Any two routers that have formed a TCP connection to exchange BGP
routing information are called BGP peers or BGP neighbors.
When BGP is running between neighbors within the same AS, it is called
IBGP.
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
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.
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.
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.
Order
Attribute
Preference
De
Next Hop
Reachable?
True
If no route to
be used.
Weight
Highest
Administrative
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
EBGP Peering
Oldest
Prefer stabilit
10
RID
Lowest
Chose lowest B