What is BGP and How Does Border Gateway Protocol Work? (2024)

What is BGP and How Does Border Gateway Protocol Work? (1)

By

  • John Burke,Nemertes Research

What is BGP (Border Gateway Protocol)?

BGP (Border Gateway Protocol) is the protocol that enables the global routing system of the internet. It manages how packets get routed from network to network by exchanging routing and reachability information among edge routers.

BGP enables peering to send packets between autonomous systems (ASes), which are networks managed by a single enterprise or service provider. Together, these ASes make up the public internet.

BGP creates network stability by guaranteeing that routers can adapt to route failures. When one path goes down, BGP quickly finds a new path. BGP makes routing decisions based on paths, defined by rules or network policies set by network administrators.

How does BGP work?

Each router maintains a routing table that controls how packets are directed. The BGP process on the router generates routing table information, which is based on the following factors:

  • Incoming information from other routers.
  • Information in the BGP routing information base (RIB), which is a data table stored on a server on the BGP router.

The RIB contains information both from directly connected external peers and internal peers. The RIB contains policies for what routes should be used and what information should be published, and it continually updates the routing table as changes occur.

What is BGP used for?

BGP helps provide redundancy by enabling routers to quickly adapt and send packets through another connection if one internet path goes down. It is often used in large networks, such as internet service provider networks, wide area networks and infrastructure-as-a-service environments.

BGP is an exterior gateway protocol, which means it is designed to share routing information between different ASes. Alternatively, an interior gateway protocol sends information within a single AS. However, Internal BGP (iBGP) is available to send reachability information within an organization's network.

Each BGP router maintains a standard routing table used to direct packets in transit. BGP uses client-server topology to communicate routing information, with the client initiating a BGP session by sending a request to the server.

BGP routing basics

BGP sends updated router table information only when something changes, and it sends only the affected information. BGP has no automatic discovery mechanism, which means network admins must manually set up connections between peers, with peer addresses programmed in at both ends.

BGP makes best-path decisions based on attributes that include the following:

  • Highest weight.
  • Current reachability.
  • Hop counts.
  • Local preference.
  • Oldest path.

In situations where multiple paths are available -- as within a major hosting facility -- BGP policies communicate an organization's preferences for what path traffic should follow in and out. BGP community tags can control route advertisem*nt behavior among peers.

BGP in networking is based on the TCP/IP model. It operates on the Open Systems Interconnection transport layer (Layer 4) to control the network layer (Layer 3).

As described in RFC 4271 and ratified in 2006, the current version of BGP-4 supports both IPv6 and Classless Inter-Domain Routing (CIDR), which enables the continued viability of IPv4. Using CIDR enables a network to have more network addresses than with the current IP address assignment scheme.

What is BGP and How Does Border Gateway Protocol Work? (2)

Common BGP issues

Common issues with BGP include information exchange failures. Information exchanges don't always succeed as information can be improperly formatted or contain incorrect data.

Routers can also run out of memory or storage or be too slow to respond to updates. Routers send error codes and subcodes to communicate problems, including timeouts, malformed requests and processing problems.

Facebook outage

On Oct. 4, 2021, social media applications Facebook, Instagram and WhatsApp went offline for six hours. The outage was reportedly due to there being no working BGP routes into the social media sites and the domain name servers going offline. This essentially disconnected the social media apps from the internet.

BGP security

BGP is also vulnerable to attacks based on misinformation. Malicious actors can flood a router with bad packets in a denial-of-service attack, for example. They can also claim to be the source of routing information for an AS and temporarily control where traffic headed from that AS goes, a practice known as BGP hijacking.

Difference between internal and external BGP, OSPF

BGP that is used to route within a single AS is iBGP. When BGP is used to connect one AS to others, it is called External BGP, or eBGP.

The Open Shortest Path First (OSPF) protocol is used only in internal networks. OSPF focuses on finding the shortest route available between nodes and on failing over to that shortest route as quickly as possible.

What is BGP and How Does Border Gateway Protocol Work? (3)

BGP is slower to fail to a new route but more scalable than OSPF. As such, OSPF is better suited for corporate local area networks and private data centers. OSPF is essentially hierarchical in structure, while BGP is a mesh. Some networks are replacing OSPF with iBGP.

Editor's note: This definition was updated to add BGP information and improve the reader experience.

This was last updated in June 2023

Continue Reading About BGP (Border Gateway Protocol)

  • BGP tutorial: How the routing protocol works
  • A quick guide to BGP best practices
  • BGP vs. EIGRP: What's the difference?

Related Terms

What is a personal area network (PAN)?
A personal area network (PAN) is a small network that interconnects technology devices within a limited range of just a few ...Seecompletedefinition
What is a unique identifier (UID)?
A unique identifier (UID) is a numeric or alphanumeric string that is associated with a single entity within a given system.Seecompletedefinition
What is asynchronous?
In general, asynchronous -- from Greek asyn- ('not with/together') and chronos ('time') -- describes objects or events not ...Seecompletedefinition

Dig Deeper on Network infrastructure

  • routerBy: AlissaIrei
  • Open Shortest Path First (OSPF)By: RahulAwati
  • data planeBy: RahulAwati
  • network fabricBy: GavinWright
What is BGP and How Does Border Gateway Protocol Work? (2024)

FAQs

What is BGP and How Does Border Gateway Protocol Work? ›

Border Gateway Protocol (BGP) refers to a gateway protocol that enables the internet to exchange routing information between autonomous systems (AS). As networks interact with each other, they need a way to communicate. This is accomplished through peering. BGP makes peering possible.

What is the BGP protocol and how does it work? ›

Border Gateway Protocol (BGP) is a set of rules that determine the best network routes for data transmission on the internet. The internet consists of thousands of private, public, corporate, and government networks linked together through standardized protocols, devices, and communication technologies.

What is the BGP border gateway protocol based on? ›

BGP is classified as a path-vector routing protocol, and it makes routing decisions based on paths, network policies, or rule-sets configured by a network administrator.

How does a BGP session work? ›

BGP enables peering to send packets between autonomous systems (ASes), which are networks managed by a single enterprise or service provider. Together, these ASes make up the public internet. BGP creates network stability by guaranteeing that routers can adapt to route failures.

How do you explain BGP in an interview? ›

Ans: Border Gateway Protocol (BGP) is a standardised exterior gateway protocol that allows autonomous systems (AS) on the Internet to share routing and accessibility information. It is classified as a Path vector Protocol. The Border Gateway Protocol is engaged in core routing decisions.

What is the BGP in nutshell? ›

Border Gateway Protocol (BGP) is the routing protocol for the Internet. Much like the post office processing mail, BGP picks the most efficient routes for delivering Internet traffic.

What is the gateway protocol? ›

Protocol gateways, also known as protocol translators, are small non-descript devices that mainly function as translators for various protocols and physical layers (i.e., Transmission Control Protocol (TCP) and serial lines).

What is needed for BGP to work? ›

To run BGP you are required to have the following:
  • An AS Number.
  • Multi-homed to the Internet.
  • BGP4 Capable Router.
  • Sufficient Router Memory.
  • Fully Functional IGP.
  • Qualified Internet Engineer.
May 19, 2018

What is an example of a BGP? ›

Every time a route is advertised by one BGP router to another over a peering session, the receiving router prepends the remote ASN to this attribute. For example, when Verizon hears a route from NTT America, Verizon “stamps” the incoming route with NTT's ASN, thereby building the route in AS_PATH.

How can I tell if BGP is working? ›

If a BGP session is down and does not come up, issue the show ip bgp all summary command. Here you can find the current status of the session: If the session is not up state, it can vary between IDLE and ACTIVE (depends on the Finite State Machine process). If session is up, you see the number of prefixes received.

What is BGP summary? ›

Route Aggregation (RA) also known as BGP Route Summarization is a method to minimize the size of the routing table, announcing the whole address block received from the Regional Internet Registry (RIR) to other ASes.

How does BGP select the best path? ›

BGP assigns the first valid path as the current best path. BGP then compares the best path with the next path in the list, until BGP reaches the end of the list of valid paths. This list provides the rules that are used in order to determine the best path: Prefer the path with the highest WEIGHT.

What TCP port does BGP use? ›

Among routing protocols, BGP is unique in using TCP as its transport protocol. BGP peers are established by manual configuration between routing devices to create a TCP session on port 179.

Is BGP layer 3 or 4? ›

BGP's purpose is for routing (layer 3); exchanging layer 3 information. It's a routing protocol. BGP uses TCP port 179 (layer 4: transport), but the application is what does the processing of the logic (routing policy).

What are the three types of routing performed by BGP? ›

Types of BGP and uses
  • Exterior BGP. Exterior BGP is used for exchanging routing information between autonomous systems. ...
  • Interior BGP. Internal BGP, or IBGP, is used when there are multiple paths egressing EGBP. ...
  • MP-BGP. Multiprotocol BGP is an IBGP that enables the distribution of address families.

What is the primary function of BGP? ›

The primary functions of BGP are multifaceted, encompassing the advertisem*nt of reachability information, path selection, policy enforcement, and maintaining a loop-free inter-domain routing environment.

Why is BGP a layer 7 protocol? ›

BGP operates at the application layer (Layer 7) of the OSI model because it involves complex routing decisions and policy-based interactions between different autonomous systems.

Top Articles
Gen Z is Tightening its Belt, with 73% Modifying Lifestyles Due to Inflation
Brokerage cash sweep program interest rate (APY) | Robinhood
Woodward Avenue (M-1) - Automotive Heritage Trail - National Scenic Byway Foundation
Gamevault Agent
Retro Ride Teardrop
Poplar | Genus, Description, Major Species, & Facts
Owatc Canvas
Www Movieswood Com
What Was D-Day Weegy
Little Rock Arkansas Craigslist
Cincinnati Bearcats roll to 66-13 win over Eastern Kentucky in season-opener
Winterset Rants And Raves
Keniakoop
Dumb Money
Colts seventh rotation of thin secondary raises concerns on roster evaluation
Fairy Liquid Near Me
R Cwbt
U Break It Near Me
/Www.usps.com/International/Passports.htm
How many days until 12 December - Calendarr
Evil Dead Rise Showtimes Near Pelican Cinemas
THE FINALS Best Settings and Options Guide
Craigslist Dubuque Iowa Pets
Blackboard Login Pjc
Unable to receive sms verification codes
Cable Cove Whale Watching
Giantbodybuilder.com
Section 408 Allegiant Stadium
Sandals Travel Agent Login
Best Town Hall 11
Tu Housing Portal
Blush Bootcamp Olathe
Mark Ronchetti Daughters
RUB MASSAGE AUSTIN
Aliciabibs
The Best Restaurants in Dublin - The MICHELIN Guide
Sukihana Backshots
Armageddon Time Showtimes Near Cmx Daytona 12
Sand Castle Parents Guide
Anderson Tribute Center Hood River
Florida Lottery Claim Appointment
Shell Gas Stations Prices
Breaking down the Stafford trade
Interminable Rooms
Euro area international trade in goods surplus €21.2 bn
300+ Unique Hair Salon Names 2024
Blog Pch
Wrentham Outlets Hours Sunday
Renfield Showtimes Near Regal The Loop & Rpx
Jesus Calling Oct 6
Latest Posts
Article information

Author: Clemencia Bogisich Ret

Last Updated:

Views: 6035

Rating: 5 / 5 (80 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Clemencia Bogisich Ret

Birthday: 2001-07-17

Address: Suite 794 53887 Geri Spring, West Cristentown, KY 54855

Phone: +5934435460663

Job: Central Hospitality Director

Hobby: Yoga, Electronics, Rafting, Lockpicking, Inline skating, Puzzles, scrapbook

Introduction: My name is Clemencia Bogisich Ret, I am a super, outstanding, graceful, friendly, vast, comfortable, agreeable person who loves writing and wants to share my knowledge and understanding with you.