- [Instructor] Let's begin our look at BGP
with an overview of the fundamental principles
and operation.
BGP or Border Gateway Protocol is considered
to be an Exterior Gateway Protocol, an EGP.
This is in contrast to Interior Gateway Protocols
or IGPs such as OSPF
and EIGRP.
EGPs route between autonomous systems.
Whereas IGPs will route within a single autonomous system.
So that's an important distinction.
We often hear BGP referred to as
the protocol of the internet.
And that's true
because this is essentially what makes
the internet work by routing data
between various autonomous systems
or in other words
between individual networks all over the world.
So autonomous system numbers are the necessary way
that these networks are identified,
so that communication can take place between them.
Autonomous System Numbers are provided to organizations
from the IANA, the Internet Assigned Numbers Authority.
These are typically assigned
to large organizations such as ISPs, universities,
government agencies, and so on.
So if you work for an ISP for example
and you want to connect to the internet.
You would have an assigned Autonomous System Number
from the IANA in order to exchange routes
in this manner through BGP.
There's a designated 32-bit range
of Autonomous System Numbers available
for unique assignments.
Meaning that
there are roughly 4.3 billion unique ASNs available.
And currently we have around a 100,000
of those in use by organizations.
In order to have the ability to exchange routes
between BGP enabled peers,
there must be an adjacency formation
which works similar to what you're likely familiar
to seeing with OSPF or EIGRP.
A neighbor adjacency must form between the BGP routers
before they're able to exchange their routes.
And there's a specific process that happens
which we'll look at more closely later in this module.
The thing I'll point out here
is that this adjacency does not have
to be directly connected.
It can be from a router that is several hops away.
When an adjacency is established
between two BGP peers,
we refer to this as a BGP session.
Another important point about BGP
in contrast to IGP protocols, such as OSPF or EIGRP
is that we do not dynamically learn any neighbor addressing
through multicast.
Instead we have to explicitly configure
a neighbor's IP address.
Now we do have the possibility of dynamic neighbor support,
where we define a range of IP addresses
but we typically think
a BGP with very explicit neighbor commands
that's going to point to neighbor addressing.
Once we've done that
and a BGP session is established,
this is done as a TCP session between neighbors.
So it makes a TCP connection.
When BGP advertisements are sent within a session,
BGP advertises the address prefix
and the link,
or in other words, sub-net information.
In BGP there's a term for these advertisements
which is NLRI, Network Layer Reachability Information.
In addition to network prefix
and length information NLRI updates also advertise
what are called path attributes or PAs.
These can be used to influence the BGP path selection.
In the same way that you're probably used to doing
with the metric within the EIGRP for example.
But with BGP we don't have a single metric
to influence our path.
We have multiple attributes
that we can use to do that.
So we have much more granular control.
So you want to know that NLRI updates will consist
of network and prefix length
as well as any path attributes
for that specific BGP route.
As far as categorizing BGP into a type of routing protocol,
BGP is a path vector routing protocol.
This is similar to distance vector routing protocols
in that BGP knows about the availability
of a network in a specific direction.
And it knows how many hops away that is.
The difference is
that instead of counting the individual router hops
in the way that distance vector routing protocols do,
BGP instead counts the number of autonomous system hops.
So that's the difference.
There are two main categories of BGP sessions
which are internal BGP or iBGP
and external BGP or eBGP.
You can probably make a good guess
as to what these flavors of BGP do.
IGP is used to communicate between routers
that are within the same Autonomous System.
And that provides information to these internal routers.
While eBGP communicates between routers
that are in different Autonomous Systems.
Sometimes you'll see IGP used with ISPs
so that there's no need to redistribute routes
from one routing protocol to another.
That way it's just BGP everywhere throughout the network.
Also IGP can handle much larger numbers of network prefixes
than I GPS like OSPF or EIGRP.
So iBGP may be required in some cases
just in order to handle the full routing table.
Especially if you have a really really large environment.
As we've mentioned BGP
does not dynamically discover neighbors as IGPs do.
BGP neighbors must be manually defined either specifically
to the IP address or within a range.
And when we do that BGP will use
TCP port 179 to communicate with neighbors.
TCP is what allows BGP to form neighbor adjacencies
that are multiple hops away
by establishing a session.
A multi-hop session, such as this will require the router
to use an underlying route
that is installed in the rib.
The routing information base
in order to establish the TCP session with a remote router.
And that can be from any dynamic routing protocol
or from a static route.
BGP communication uses four message types
which are OPEN, UPDATE, NOTIFICATION and KEEPALIVE.
And OPEN message is used to establish
the initial BGP adjacency.
These messages will contain
the BGP version number,
the autonomous system number of the originating router,
the BGP identifier, the hold time
and other optional parameters.
To break that down further the BGP identifier
is a 32-bit unique number called the BGP router ID.
Or sometimes we refer to that as the RID.
This identifies the BGP router in the prefixes
that are being advertised.
And this can be set either manually
or dynamically.
The hold time determines when a BGP session
is torn down.
So this sets how long a router will wait
for incoming BGP messages
before that neighbor is assumed to be down.
If the hold time expires,
the BGP session is going to be terminated.
By default on Cisco router the value is 180 seconds
but we want to set that to at least three seconds.
The KEEPALIVE message is the heartbeat
that makes sure the hold time does not expire.
These messages are exchanged at a rate of one third
of the hold time.
That's the recommended value to set that out.
We want to set it at a one third ratio.
So by default, as we said, the hold time is 180 seconds.
And that means the default KEEPALIVE message interval
is set to 60 seconds.
The UPDATE message takes care of updating
the known routes both advertising feasible routes
and removing previously advertised routes
that are no longer valid.
This is where the NLRI
that we previously discussed is included.
So NLRI information is exchanged within the UPDATE message.
When no UPDATE messages are available to send from a router
that's when the KEEPALIVE messages
will be sent out periodically.
So these UPDATE messages are another way
that we can keep the BGP session alive.
And we have NOTIFICATION messages
which are used to alert about error detection
within a BGP session.
This can include expired hold timers, neighbor changes
or the receipt of a request for a BGP session reset,
which would close a BGP connection.