Leanpub Header

Skip to main content

BGP Security for Software Engineers and Network Operators

Architecture, Implementation, and Operations at Production Scale

BGP Security for Software Engineers and Network Operators
This book is 100% completeLast updated on 2026-09-29

BGP security is more than a set of filters and policies. This book takes a practical, systems-level look at securing routing infrastructure, from RPKI and route filtering to monitoring, automation and incident response, with real configurations, code examples and lessons from incidents that have shaped how the Internet is secured.

Minimum price

$25.00

$35.00

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

PDF
EPUB
WEB
APP
181
Pages
About

About

About the Book

This book treats BGP security as a serious systems-engineering discipline rather than an introductory networking tutorial. It explains not only what BGP security technologies do but why they exist, how they work internally, how their components interact, how to design secure routing architectures around them, and how to implement and operate them reliably at production scale. The reader will learn the BGP threat landscape from first principles, the full RPKI stack including ROV and ASPA, prefix and AS-path filtering, route dampening, blackholing, monitoring and anomaly detection, incident response, and the operational lifecycle of routing security at Internet scale. The material is organized as a progressive reference: from foundational concepts and threat modeling through security architecture, individual technologies, end-to-end implementation with real router platforms and open-source daemons, automation and observability, and finally production hardening. Each chapter is built on primary sources, RFCs, operator experience, and real incidents, with working code examples in Go, Python, and Rust, complete configuration examples across FRRouting, BIRD, GoBGP, Cisco IOS-XR, Juniper Junos, and other widely deployed platforms, and realistic case studies of actual routing incidents.

Author

About the Author

Steve Publications

Steve is a technology professional with more than 20 years of experience in software development, server infrastructure, cybersecurity, vulnerability research and reverse engineering. Throughout his career, he has designed, secured, analyzed and tested complex software and infrastructure, with a particular focus on understanding how systems fail and how they can be made more secure.

Outside of work, Steve enjoys sharing knowledge with the technology community. He collaborates with researchers, industry experts and technology professionals to write practical books covering software development, cybersecurity, cloud computing, networking, DevOps, artificial intelligence and enterprise technologies. His books focus on practical learning through clear explanations, real-world examples and hands-on exercises. With more than two decades of industry experience, his goal is to help IT professionals, students and technology enthusiasts build useful skills and stay current in a rapidly changing industry.

We believe readers deserve to know how our books are created. Most of our authors are not native English speakers, so we use AI to help translate, proofread manuscripts, fix grammar, improve sentence structure and make technical explanations easier to read. AI is used as an editing tool only. It does not replace the research, technical knowledge or hands-on experience behind our books. Some of our authors also prefer to remain anonymous for privacy or professional reasons. In those cases, we publish their work under a different name. The author's name may be different, but the quality of the content and our review process remain the same.

Every book is written, reviewed and maintained by experienced technology professionals, with contributions from our private technical community of more than 420 engineers and researchers. We spend far more time validating technical accuracy and keeping our content up to date than generating text. We are always interested in working with experienced professionals who have deep expertise in a particular technology or domain. If you would like to publish a book with us or help review an existing manuscript, we'd love to hear from you. Send us a message describing your area of expertise. We are especially interested in niche technologies, specialized skills and emerging topics that are underrepresented in existing technical literature.

If you look through the contents of our books, you'll see practical examples, detailed explanations and material that is regularly updated. Our goal is to publish books that professionals can actually rely on, not low-effort AI-generated content. If you ever feel that one of our books does not meet that standard, Leanpub offers a 60-day money-back guarantee. Feel free to request a refund if you are not satisfied with your purchase.

Contents

Table of Contents

Architecture, Implementation, and Operations at Production Scale

Introduction: Why BGP Security Is a Systems Problem

Chapter 1: The Internet Routing System and the Security Problem Space

  1. The Routing Table: Scale, Structure, and Daily Churn
  2. How a Packet Travels: From Source to Destination Through Autonomous Systems
  3. The Economic and Political Architecture of the Internet: Customers, Peers, and Transit Providers
  4. Why BGP Inherently Lacks Security: Design Trade-offs of the 1990s
  5. Real-World Consequences: A Brief History of Major Routing Incidents

Chapter 2: BGP Protocol Mechanics Relevant to Security

  1. The BGP Finite State Machine and Session Establishment
  2. BGP Message Types: Open, Update, Notification, Keepalive
  3. Path Attributes and Their Security-Relevant Properties
  4. Route Selection and Path Preference Logic
  5. IBGP, EBGP, Confederations, and Route Reflectors

Chapter 3: The BGP Threat Landscape

  1. Prefix Hijacking: Origin Attacks and Traffic Redirection
  2. Route Leaks: Accidental and Intentional Violation of Routing Policy
  3. AS-Path Manipulation: Injection, Shortening, and Splicing
  4. Maximal Prefix Announcements and Exhaustion Attacks
  5. DoS Against the Routing Control Plane
  6. BGP Session Hijacking and TCP Exploitation
  7. Malformed Updates, Route Flapping, and Churn Attacks
  8. Attribute Manipulation: MED, Local Preference, Communities
  9. Real-World Incident Anatomy: A Detailed Case Study

Chapter 4: Routing Trust Architecture and Design Principles

  1. The Routing Trust Problem: What Can We Verify and What Must We Trust?
  2. Defense in Depth for Internet Routing
  3. The Validity Spectrum: From Open to Cryptographically Verified
  4. Least Privilege for Prefix Announcements
  5. Trust Boundaries Across Organizational Perimeters
  6. Balancing Security, Availability, and Operational Complexity

Chapter 5: RPKI Cryptographic Architecture

  1. The RPKI Hierarchy: RIRs, LIRs, and End Entities
  2. Resource Certificates: Binding Cryptography to IP Addresses and AS Numbers
  3. Cryptographic Algorithms and Key Management in RPKI
  4. Route Origin Authorizations: Structure, Semantics, and Max-Length Semantics
  5. ROA Validation Logic: What “Valid” Actually Means
  6. Revocation, CRLs, and Manifest Files

Chapter 6: RPKI Repositories, Validators, and RTR Protocol

  1. RPKI Repositories: RIR Architecture and Availability
  2. RPKI Validators: How They Build the Trust Anchored View
  3. The RTR Protocol: Format, Flow, and Behavior
  4. Running a Validator in Production: Resilience and Redundancy
  5. Validator Comparison: Routinator, Falcon, BGP Tools RPKI Server
  6. RTR Client Integration in Major Router Platforms

Chapter 7: Route Origin Validation: Design, States, and Deployment

  1. ROV State Machine: Valid, Invalid, Not-Found Defined
  2. Making Routing Decisions Based on ROV State
  3. ROV Migration Strategies: From Passive Validation to Enforcement
  4. Handling Not-Found: Policy Choices and Operational Realities
  5. ROA Coverage Gaps and Their Practical Implications
  6. Multi-Validator Architectures for ROV Resilience

Chapter 8: IRR, RPSL, and Legacy Route Object Systems

  1. The Internet Routing Registry History and Purpose
  2. RPSL Data Model: Routes, Route-Origins, and Route-Set Objects
  3. Querying IRRs: Whois Protocol, Query APIs, and Batch Retrieval
  4. IRR-Derived Filtering: How to Use IRR Data for Prefix Filters
  5. IRR vs RPKI: Complementary Roles in Modern Architectures
  6. Common IRR Data Quality Problems and Mitigation Strategies

Chapter 9: ASPA: Autonomous System Provider Authorization

  1. The Problem ASPA Solves: Relationship Validation
  2. ASPA Data Model: Provider Authorization Records
  3. ASPA Cryptographic Structure and RPKI Integration
  4. AS-Path Validation with ASPA
  5. Deployment Status and Timeline
  6. Limitations and Remaining Gaps

Chapter 10: BGPsec: Architectural Vision and Practical Reality

  1. The BGPsec Problem Statement: Securing the AS Path
  2. BGPsec Protocol: Signed Path Attributes and Key Hierarchies
  3. BGPsec vs RPKI/ROV: Different Guarantees, Different Trade-offs
  4. Operational Barriers to BGPsec Adoption
  5. BGPsec Deployment Status and Pilot Networks
  6. BGPsec as a Long-Term Goal vs Short-Term Tool

Chapter 11: BGP Communities and Route Attribute Security

  1. BGP Communities: Standard, Extended, and Large Communities
  2. Using Communities for Policy Enforcement
  3. Security Implications of Community-Based Routing
  4. Community Manipulation: Threats and Defenses
  5. Vendor-Specific Community Implementations
  6. Automating Community-Based Policies

Chapter 12: Prefix Filtering, AS-Path Filtering, and Bogon Defense

  1. Inbound Prefix Filtering: Customer, Peer, and Transit Policies
  2. Outbound Prefix Filtering and Advertisement Control
  3. AS-Path Filtering and Regular Expressions
  4. Bogon Filtering: Reserved, Documentation, and Private Ranges
  5. Building Filtering Tables from IRR and RPKI Data
  6. Policy Design Patterns: Safe Defaults and Least Privilege

Chapter 13: Route Stability Controls: Dampening, Max-Prefix, and Limits

  1. BGP Route Dampening: Mechanism, Parameters, and Trade-offs
  2. Max-Prefix Limits: Protecting Router Resources
  3. Rate Limiting BGP Updates
  4. Per-Peer and Per-Customer Quotas
  5. Tuning for Stability vs Responsiveness

Chapter 14: Blackholing and Remote-Triggered Blackholing

  1. Blackhole Routing: Basic Mechanics
  2. Remote-Triggered Blackholing: Design and Operation
  3. Standard RTBH: Discard Communities and Null Routes
  4. Per-Prefix RTBH and Next-Hop Based Blackholing
  5. Integration with DDoS Mitigation Systems
  6. Safety and Recovery: Avoiding Accidental Blackholes

Chapter 15: Reference Architectures for Production Environments

  1. Transit Provider Architecture: Tier 1, Tier 2, and Regional ISPs
  2. Enterprise Multi-Homing with Dual Transit
  3. SaaS and Content Provider Architectures
  4. Cloud and Data Center Routing Security
  5. IXP Route Server Security
  6. Managed Service Provider Architectures

Chapter 16: Implementing BGP Security: End-to-End Configurations

  1. FRRouting: Complete BGP Security Configuration
  2. BIRD: Security-Focused BGP Daemon Setup
  3. GoBGP: Programmatic BGP Security
  4. Cisco IOS-XR: Production BGP Security
  5. Juniper Junos: Enterprise-Grade BGP Security
  6. OpenBGPD and Lightweight Deployments

Chapter 17: Automation and Infrastructure-as-Code for Routing Security

  1. Configuration Management for BGP Policies
  2. Generating Filters from RPKI and IRR Data
  3. GitOps for Routing Security
  4. Safe Deployment: Testing and Rollback Strategies
  5. Automation with Ansible, Terraform, and Custom Tools
  6. Preventing Configuration Drift and Unsafe Changes

Chapter 18: Routing Telemetry, Monitoring, and Anomaly Detection

  1. Monitoring the Global Routing Table
  2. BGP Telemetry: Streaming Updates and Table Dumps
  3. Anomaly Detection: Statistical Methods and ML Approaches
  4. Route Origin Monitoring and Alerting
  5. Building a Routing Security Dashboard
  6. Integration with SIEM and SOAR Platforms

Chapter 19: Incident Response: Detecting, Investigating, and Mitigating Routing Attacks

  1. Detecting a Routing Incident: Early Warning Signals
  2. Investigation Workflow: Tools, Queries, and Data Sources
  3. Case Study: Responding to a Prefix Hijack
  4. Case Study: Diagnosing a Route Leak
  5. Case Study: Invalid ROA Incident Response
  6. Communication, Coordination, and Escalation

Chapter 20: Operational Lifecycle and Production Hardening

  1. ROA Lifecycle Management at Scale
  2. Key and Certificate Rotation for RPKI
  3. Change Management for BGP Security Policies
  4. Testing and Validation Procedures
  5. Capacity Planning for Routing Infrastructure
  6. Disasters, Failures, and Recovery Plans
  7. Auditing, Compliance, and Security Reviews

Conclusion: Building Routing Security That Works

References

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $15 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub