How rtbrick/bngblaster works
Project type and purpose
• This is an open-source network testing tool (Routing Protocol and BNG Blaster) written in C/C++ using CMake.
• Purpose: simulate large numbers of access (PPPoE, DHCP/IPoE, L2TP) and routing (ISIS, OSPF, LDP, BGP) sessions; generate and verify traffic; measure QoS and convergence.
File structure
• Top-level:
• code/ – all source subprojects:
– bngblaster – main application (src, CLI, interactive, stats, config)
– bgpupdate, ldpupdate, lspgen, ldpupdate – helper tools
– common – shared utilities (logging, timer, checksum)
– lwip – bundled TCP/IP stack (core, netif, ports, apps, tests)
• docs/, docsrc/ – Sphinx documentation source and output
• examples/ – JSON config examples
• wireshark/ – dissector plugin
• CI: .github/workflows/*.yml
• Build: CMakeLists.txt, shell.nix, flake.nix
README
• Confirms the project simulates millions of flows, supports protocol fuzzing, interactive mode, integrates with external libs (lwIP), and is used via CLI.
a. Main components
• User Interface Layer
– CLI Front-end (bngblaster-cli)
– Interactive Shell (bbl_interactive)
• Configuration & Control
– Config Parser (bbl_config)
– Session Manager (bbl_ctx, bbl_session)
• Protocol Engines
– Access Protocol Modules (PPPoE, DHCPv4/v6, L2TP, PPP)
– Routing Protocol Modules (ISIS, OSPF, LDP, BGP)
• Traffic Generator
– Flow Tracker & Stats Collector (bbl_stream, bbl_stats)
• I/O Abstraction Layer
– io_socket, io_raw, io_dpdk, io_pcap, io_thread
• Embedded TCP/IP Stack
– lwIP core (ip, tcp, udp) + netif ports
• Common Utilities
– Logging, checksums, timers (common/src)
• External Tools
– Fuzzing (code/bngblaster/fuzzing)
– Helper tools (bgpupdate, ldpupdate, lspgen)
– Wireshark dissector plugin
b. Relationships & interactions
• User → CLI → Config Parser → Session Manager
• Session Manager instantiates Protocol Engines + Traffic Generator
• Protocol Engines and Traffic Generator issue/send packets via I/O Abstraction → network interface
• I/O Abstraction may invoke lwIP or raw socket/DPDK drivers → actual NIC or pcap
• Stats Collector gathers metrics, feeds back to CLI/interactive shell
• Fuzzing harness sits alongside Protocol Engines, injecting malformed packets via I/O layer
• Helper tools (bgpupdate, etc.) operate in sequence for specific protocol test flows
c. Architectural patterns / design principles
• Modular plugin-style protocol implementation
• Clear separation of concerns: UI / control / protocol / I/O / utilities
• Abstraction of transport (raw/DPDK/pcap) behind a unified I/O interface
• Usage of an embedded stack (lwIP) to simulate protocol behavior where beneficial
• Extensive test and fuzzing harness integrated in same codebase
d. Key technologies, frameworks, libraries
• CMake build system
• lwIP (MIT-style TCP/IP stack)
• DPDK (if built via io_dpdk)
• libpcap (via io_pcap)
• GitHub Actions (CI/CD)
• Sphinx (documentation)
• Wireshark Lua (packet dissector plugin)
• shell.nix / flake.nix (reproducible dev environment)
Detail
• Break out each protocol (ISIS, OSPF, etc.) only if space allows; otherwise group under “Routing Protocols”.
• Optional paths (fuzzing injection versus normal run).
• Build & CI pipeline as an auxiliary flow if desired (CMake → GitHub Actions).