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
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

Low-Code Development: Leverage low and no code to streamline your workflow so that you can focus on higher priorities.

DZone Security Research: Tell us your top security strategies in 2024, influence our research, and enter for a chance to win $!

Launch your software development career: Dive head first into the SDLC and learn how to build high-quality software and teams.

Open Source Migration Practices and Patterns: Explore key traits of migrating open-source software and its impact on software development.

Related

  • Mastering BGP Neighborship: Effective Troubleshooting Strategies
  • What Is IoT Gateway? Is It Important
  • Cache Wisely: How You Can Prevent Distributed System Failures
  • Essential Monitoring Tools, Troubleshooting Techniques, and Best Practices for Atlassian Tools Administrators

Trending

  • Build Your Business App With BPMN 2.0
  • Theme-Based Front-End Architecture Leveraging Tailwind CSS for White-Label Systems
  • Next-Gen Lie Detector: Stack Selection
  • Outsmarting Cyber Threats: How Large Language Models Can Revolutionize Email Security
  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
Like (2)
Save
Tweet
Share
2.7K 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
  • What Is IoT Gateway? Is It Important
  • Cache Wisely: How You Can Prevent Distributed System Failures
  • Essential Monitoring Tools, Troubleshooting Techniques, and Best Practices for Atlassian Tools Administrators

Partner Resources


Comments

ABOUT US

  • About DZone
  • Send 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: