Telecom Glossary

What Is BGP (Border Gateway Protocol)?

A plain-English guide to the protocol that holds internet routing together: autonomous systems, prefixes, peers, how a path is chosen and what happens when routing goes wrong.

BGP (Border Gateway Protocol) is the routing protocol that independent networks on the internet use to tell each other which blocks of IP addresses they can reach and by which path. Every internet provider, cloud platform and large enterprise network that connects to more than one other network runs it, so BGP is the system that decides how traffic finds its way across the internet as a whole.

Most businesses never touch BGP. Their carrier runs it on their behalf and simply sends all of the office's outbound traffic toward the internet. BGP becomes a business question when a company wants its own IP addresses to stay reachable through two or more carriers at once. Our guide to static IPs and BGP covers when that is worth the effort. This page explains how the protocol itself works, so the terms on a quote or in a design make sense.

The building blocks: autonomous systems, prefixes and peers

  • Autonomous system (AS). A network, or group of networks, run by one organization under one routing policy. A carrier is an AS. So is a cloud provider, a university, or a business that runs its own routing.
  • AS number (ASN). The number that identifies an autonomous system. Public ASNs are assigned by the regional internet registries, which is ARIN in the United States and Canada. ASNs were originally 16-bit numbers; 32-bit ASNs were added later because the supply was running out. Ranges are also set aside for private use, the way private IP addresses are.
  • Prefix. A block of IP addresses written in slash notation, such as 203.0.113.0/24. A network "announces" the prefixes it holds, which tells the rest of the internet to send traffic for those addresses its way.
  • Peer, or neighbor. Two routers configured to exchange BGP routes with each other. The session runs over TCP port 179.
  • AS path. The list of AS numbers a route announcement has passed through. It records the route's history and is used both to choose between paths and to stop routing loops, because a router rejects any route that already contains its own ASN.

How BGP works, step by step

  1. The session opens. Two routers connect over TCP and exchange an OPEN message stating their AS numbers and the timers they will use.
  2. Routes are exchanged. Each router sends UPDATE messages listing the prefixes it can reach, with attributes such as the AS path and the next hop to use. The same messages withdraw prefixes that are no longer reachable.
  3. Each router chooses. A router may learn several paths to the same prefix from different peers. It picks one best path per prefix, installs it in its routing table and, if its policy allows, passes that path on to its other peers.
  4. The session is watched. Peers send small KEEPALIVE messages. If they stop arriving for longer than the agreed hold time, the router declares the session down and withdraws every route it learned through it. Many networks add BFD (Bidirectional Forwarding Detection) to spot a dead link much faster than the BGP timers alone.

BGP is described as a path-vector protocol: it shares whole paths between networks. It does not test speed, latency or congestion. It chooses routes by policy and by path attributes, which is why traffic on the internet sometimes takes a longer route than a map would suggest.

eBGP and iBGP compared

The same protocol is used in two settings, with slightly different rules.

eBGP (external)iBGP (internal)
Who the peers areRouters in different autonomous systems, such as your router and a carrier'sRouters inside the same autonomous system
AS pathEach network adds its own ASN when it passes a route onUnchanged inside the network
Passing routes onRoutes learned are passed to other peers, subject to policyRoutes learned from one iBGP peer are not passed to another, so networks use a full mesh of sessions or route reflectors
Typical peersUsually directly connectedOften several hops apart, using the internal routing protocol to reach each other
Where a business sees itIts sessions with each carrierOnly when it has two or more of its own border routers that need to share what each carrier sends

How BGP chooses a path

When a router holds several paths to the same prefix, it compares them in a fixed order and stops at the first difference. Router vendors vary the details and some add their own first step, but the broad sequence is this:

  1. Highest local preference. Your own policy, such as "prefer carrier A for everything".
  2. Shortest AS path. Fewer networks in the path wins, whatever their speed.
  3. Origin type. A technical attribute that rarely decides anything in practice.
  4. Lowest MED. A hint from a neighboring network about which of its entry points it would like you to use.
  5. eBGP over iBGP. A route learned directly from another network beats one passed along internally.
  6. Nearest exit. The path whose next hop is closest inside your own network.
  7. Tie-breakers. The oldest route or the lowest router ID.

Two tools follow from this list. To steer your outbound traffic, you set local preference on your own routers. To influence how the rest of the internet reaches you, which you cannot control directly, you can make one path look longer by repeating your ASN in it (called AS path prepending), or use BGP communities, which are tags that ask a carrier to treat your routes a certain way. Each carrier publishes its own community values, so check its documentation.

Worked illustration: one business, two carriers

Illustration only; the numbers are made up. The AS numbers and prefix come from ranges reserved for documentation.

A business holds the prefix 203.0.113.0/24 and ASN 64500. It announces the prefix to Carrier A (AS 64501) and Carrier B (AS 64502). A network on the other side of the internet receives two paths:

Path receivedAS pathLengthResult
Through Carrier A64501 645002Chosen: shortest path
Through Carrier B64510 64511 64502 645004Kept as a backup
Through Carrier A, after prepending64501 64500 64500 645004Now ties with B, so later steps decide

Most inbound traffic arrives through Carrier A because its path is shorter. If the business wants more traffic through Carrier B, it prepends its ASN on the announcement to Carrier A. If the Carrier A circuit fails, the session drops, Carrier A withdraws the route, and the remote network switches to the path through Carrier B. The business keeps the same addresses throughout. How fast the rest of the internet catches up varies, typically from seconds to a few minutes.

This only protects the business if the two circuits do not share a conduit, a building entrance or a last-mile provider. Our guide to route diversity and redundancy explains how to check.

When routing goes wrong: leaks, hijacks and RPKI

BGP was designed for a small group of networks that trusted each other, and by default a router believes what its peers announce. Two kinds of failure follow.

  • Route hijack. A network announces a prefix it does not hold, by mistake or on purpose. Routers prefer the most specific match, so announcing part of someone else's block can pull its traffic away even when the real holder is still announcing the whole block.
  • Route leak. A network passes routes it learned from one provider or peer on to another, against the usual policy. Traffic can then flow through a network that was never meant to carry it, and outages or slowdowns spread well beyond the network that made the mistake.

The defenses are layered. Carriers filter what their customers may announce, cap the number of prefixes a session can send and check routing registries. RPKI (Resource Public Key Infrastructure) adds cryptographic proof of who may originate a prefix: the address holder publishes a signed Route Origin Authorization (ROA) through its registry, naming the ASN allowed to announce the prefix. Networks that perform origin validation mark routes as valid, invalid or not found, and many drop the invalid ones. RPKI checks only the origin of a route; work on checking every hop of the path is under way but not yet widely deployed.

For a business, the practical steps are simple: if you hold your own addresses, publish ROAs for them, and ask each carrier whether it validates routes and filters customer announcements.

BGP terms you may see on a quote

TermWhat it means for you
BGP session or BGP supportThe carrier will run BGP with your router on this circuit
Default routeThe carrier sends one route meaning "everything else goes this way"; light on your router
Full routes or full tableThe carrier sends its view of the whole internet; your router needs the memory and processing for a very large and growing table
Partial routesOnly the carrier's own and its customers' prefixes, plus a default
Customer ASNWhether you use your own public ASN or one the carrier assigns for the session
Prefix limitThe maximum number of prefixes you may announce before the session is shut down
IRR or ROA requiredThe carrier will only accept your prefixes if they are registered in a routing registry or covered by RPKI

Static IPs assigned by a carrier usually belong to that carrier and cannot simply move with you; our page on what a static IP address is covers the difference. At the top of the internet, a small group of networks reach every destination through peering alone, which is what makes a Tier 1 network. Many of those networks meet in shared interconnection buildings, described in our guide to what a carrier hotel is. Businesses that run their own routing usually buy IP transit or dedicated internet access with BGP enabled.

How FiberX helps

When a design needs BGP, FiberX gets quotes from several carriers for your address and checks the detail that matters: whether each carrier supports BGP on the circuit, which routes it will send, what it requires for your prefixes and how its circuit reaches your building. The carrier pays us, so there is no markup. Request a quote, or call or text 478-758-8091.

// QUESTIONS

Frequently Asked Questions

01What is an ASN?

An ASN (autonomous system number) is the unique number that identifies a network in BGP. Public ASNs are issued by regional internet registries such as ARIN, and private ranges exist for internal use.

02Does my business need BGP?

Most businesses do not. BGP is worth running when you need your own IP addresses to stay reachable through two or more carriers at once and you have staff who can manage routing; otherwise failover across two circuits with a firewall or SD-WAN is usually enough.

03What port does BGP use?

BGP runs over TCP port 179. Firewalls between two BGP peers must allow that port for the session to come up.

04Is BGP a layer 3 or layer 4 protocol?

BGP itself is an application that runs on top of TCP, but the information it carries is layer 3 routing information: which IP prefixes are reachable and through which next hop.

05What is BGP multihoming?

BGP multihoming means announcing your own IP prefix to two or more carriers, so the internet can reach you through any of them. If one carrier or circuit fails, its routes are withdrawn and traffic arrives through the others.

06How fast does BGP fail over?

Your own router can detect a failed link in well under a second when BFD is used, or within the BGP hold time without it. The rest of the internet then has to learn about the change, which typically takes from seconds to a few minutes.

// FREE · NO OBLIGATION · SAME-DAY RESPONSE

Want This Priced for Your Address?

Reading is cheap; a real number for your building is better. Pick a time below, or call and we will talk it through.

EMAIL INFO@FIBERXINTERNET.COM · TEXT (478) 758-8091

FIBERX · APPOINTMENT CONSOLE
Book an Appointment

Talk to Phil. Pick a Time.

A quick call with your dedicated agent — internet quotes, AI automation, or both. No obligation, same-day response.

Pick your 30-minute slot ALL TIMES ET
or call 478-758-8091

REQUEST GOES STRAIGHT TO PHIL · SAME-DAY CONFIRMATION

Call now · same-day478-758-8091