How kioubit/flapalerted works
Main Components
a) Core BGP Processing Layer:
• BGP listener component (port 1790)
• Main BGP message types (Open, Update, KeepAlive) processing
• Path change detection system
b) Monitoring and Analysis Layer:
• Route change counter
• Path analysis component
• Flap detection logic
• State management for prefix tracking
c) Module System:
• HTTP API Module (default enabled)
• Logging Module (default enabled)
• ROA Filter Module (optional)
Component Relationships
External BGP Peer -> BGP Listener -> Message Processing -> Analysis Engine -> Modules
Specific Implementation Details
• BGP Session Handler (port 1790)
• Message Parser (showing Open/Update/KeepAlive flows)
• Route Change Analyzer
• State Manager
• Module System
Important Elements to Highlight
a) Data Flows:
• BGP message flow
• Route update processing
• Flap detection pipeline
• Module communication
b) External Interfaces:
• BGP peer connection (port 1790)
• HTTP API endpoints (port 8699)
• Web Dashboard
• Metrics endpoints
Technical Details
Key configurations:
• ASN handling
• AddPath support
• Route change counter
• Minimum age tracking
• Period window
Architectural Patterns
Emphasize:
• Modular design pattern
• Event-driven architecture
• Pipeline processing
• State management
[External Layer]
BGP Peers -> BGP Daemon Connection
[Core Processing Layer]
BGP Session Handler -> Message Parser -> Route Processor
[Analysis Layer]
Path Analyzer -> Flap Detector -> State Manager
[Module Layer]
HTTP API -> Logging -> ROA Filter
[External Interfaces]
Web Dashboard -> Metrics Endpoints -> API Endpoints