DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workkloads.

Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Mastering BGP Neighborship: Effective Troubleshooting Strategies
  • How Large Tech Companies Architect Resilient Systems for Millions of Users
  • Upcoming DZone Events
  • Microservice Proliferation: Too Many Microservices

Trending

  • While Performing Dependency Selection, I Avoid the Loss Of Sleep From Node.js Libraries' Dangers
  • Transforming AI-Driven Data Analytics with DeepSeek: A New Era of Intelligent Insights
  • A Modern Stack for Building Scalable Systems
  • Apache Doris vs Elasticsearch: An In-Depth Comparative Analysis
  1. DZone
  2. Software Design and Architecture
  3. Performance
  4. Navigating the Border Gateway Protocol: Understanding BGP Neighborship States

Navigating the Border Gateway Protocol: Understanding BGP Neighborship States

Border Gateway Protocol is a routing protocol used to form communication between different Autonomous Systems on the internet.

By 
Sanjay Poddar user avatar
Sanjay Poddar
·
Jun. 14, 24 · Tutorial
Likes (2)
Comment
Save
Tweet
Share
3.1K Views

Join the DZone community and get the full member experience.

Join For Free

Border Gateway Protocol is a routing protocol used to form communication between different Autonomous Systems on the internet. BGP works over a TCP connection and goes through multiple steps to establish and maintain a session. Let's dive in to understand it.

Topology:

topology

Detailed BGP neighborship states:

Detailed BGP neighborship states

Idle

This is the initial stage of the BGP process, in Idle state the BGP process anticipates a start event. BGP is not proactively looking to connect with its BGP neighbor. The BGP process is also checking for any errors or misconfiguration which could prevent it from forming a neighborship with its peer. Once checks are completed, BGP progresses to the Connect state. The router now attempts to establish a TCP connection, if established, it transitions to the next stage which is the Open Sent state, where BGP messages are exchanged. Once open messages are exchanged, the session transitions to the Open Confirm state and then finally to the Established state, where BGP routes are exchanged. Remember, if any errors get identified the BGP session falls back to the Idle state.

Connect

BGP process when it transitions from Idle to Connect state, its attempts to establish a TCP connection with its neighbor. A ConnectRetry timer is configured for connection attempts. If a TCP connection is not established before the timer expires, the session transitions to an Active state. When established, an Open message is sent, transitioning the session to OpenSent. If it fails, the router might attempt again, revert to Idle, or switch to Active based on the retry policy.

Active

In the Active state, the BGP process actively keeps trying to form a TCP connection in this state. The router might go back and forth between Connect and Active state all the while trying to establish a connection. Once the connection is established, the router sends an Open message and transitions to OpenSent. Repeated failures can lead the router to return to Idle to avoid excessive retries.

OpenSent

When the transition to the OpenSent state is completed, the router sends an Open message to its peer which contains BGP-related info such as BGP version, AS number, hold timer, BGP identifier, and optional parameters. The open messages are exchanged. The received open messages are validated, essentially checking for compatible BGP versions, and acceptable AS numbers, and verifying the configuration for errors. If the parameters in the Open message are accepted, the router sends a Keepalive message and moves on to the OpenConfirm state.

OpenConfirm

In the Open Confirm state, the router is on standby, waiting for a Keepalive message from its peer. This message confirms that the session parameters are all good and the peer is ready to continue. The router has a hold timer running, and if it doesn’t get the Keepalive message within this period, it will send a Notification message and revert to the Idle state. A BGP hold timer is a mechanism that monitors how long it's been since a router received a successful keepalive message. However, if the Keepalive message does come through on time, the router responds with its own Keepalive message and then transitions to the Established state.

Established

Once the BGP session hits the Established state, it's fully up and running. The routers will swap Update, Keepalive, and Notification messages as necessary. Update messages handle the exchange of routing information, announcing new routes and withdrawing old ones that are no longer valid. Keepalive messages are sent regularly to make sure the session stays active, with the timing based on the agreed-upon hold time. If something goes wrong, like invalid route info or if the peer stops responding, a Notification message is sent, and the session might drop back to the Idle state. As long as everything is running smoothly and no errors pop up, the routers will keep exchanging routing info in the Established state.

Border Gateway Protocol Protocol (object-oriented programming) systems Performance

Opinions expressed by DZone contributors are their own.

Related

  • Mastering BGP Neighborship: Effective Troubleshooting Strategies
  • How Large Tech Companies Architect Resilient Systems for Millions of Users
  • Upcoming DZone Events
  • Microservice Proliferation: Too Many Microservices

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!