How tbarbette/fastclick works
Project Type and Purpose
– FastClick is a high-performance, modular packet-processing framework (an extended fork of the Click Modular Router).
– It is not a web or mobile app but a “full-stack” networking system: a core engine, a library of packet‐processing “elements,” pluggable I/O backends (DPDK, Netmap, user-level sockets, kernel modules), configuration scripts, and client apps/tools.
Key Architectural Areas from File Tree & README
• Core engine & library
– include/click/… and lib/… hold the core C++ classes: packets, schedulers, pipelines, thread vectors, annotations.
• Element repositories
– elements/{ethernet,ip,ip6,tcpudp,flow,analysis,…} each group one domain’s building blocks.
– OS‐specific elements in linuxmodule/, bsdmodule/, userlevel/, minios/, ns/, etc.
• I/O backends
– FromDPDKDevice/ToDPDKDevice (DPDK), FromNetmapDevice, FromSocket, kernel proxy elements, etc.
• Flow subsystem (MiddleClick)
– flow/* and ctx/* implement session/flow tracking on top of packets.
• Specialized subprojects
– RSS++ (auto‐core scaling), PacketMill (binary specialization), PacketMill/README.packetmill.md, DPDK glue, Netmap glue.
• Tools & apps
– tools/ contains command‐line helpers (click-build, pretty, flatten, combine, etc.).
– apps/ contains GUIs (ClickController, clicky) and sample clients.
• Configuration & examples
– conf/ contains hundreds of .click pipeline examples organized by use case (nat, vpn, grid, ids, etc.).
– mininet/ Vagrant+Python topologies.
1. User Interfaces
– CLI (fastclick binary), clicksh, click-controller GUI, clicky GUI
– Configuration files under conf/ and .click syntax
2. Core Engine & Scheduler
– Packet parser, dispatcher, thread‐vector scheduler, pipeline builder
3. Element Library (cluster by package)
– elements/{ethernet,ip,ip6,tcpudp,analysis,flow,ids,aqm,…}
– OS‐specific elements: linuxmodule/, bsdmodule/, userlevel/, minios/
4. Flow Management (MiddleClick)
– flow/* + ctx/* subsystems for keeping stateful flows/sessions
5. I/O Backends
– DPDK glue: FromDPDKDevice/ToDPDKDevice
– Netmap: FromNetmapDevice/ToNetmapDevice
– Raw sockets, kernel proxies (kernelmodule elements), userlevel socket element
6. Support Libraries
– lib/ (compiled core code), include/click/ (headers), dpdk_glue, netmap glue
7. External Dependencies
– DPDK, Netmap, Kernel modules, OS, libnuma, python (for scripts), Meson/Ninja
8. Utilities & Tools
– tools/click-* command-line utilities
– click-buildtool.in, click-compile.in, scripts in etc/
B. Relationships & Data Flows
– Configuration (.click) flows into the Core Engine
– Core Engine instantiates a linear pipeline of Elements
– At pipeline ends, I/O Backends talk to hardware or kernel (DPDK/Netmap → NIC)
– Flow subsystem hooks into Element pipeline to maintain state and perform classification
– Scheduler dispatches in-kernel threads or user-level threads via thread vectors
– Tools & Apps invoke the Core Engine or drive pipelines via the CLI API
C. Architectural Patterns & Principles
– Modular Pipeline (Chain of Responsibility): each Element performs one task
– Plugin architecture: many categories of Elements discovered at build time
– Strategy pattern for I/O backends: abstract QueueDevice with multiple concrete subclasses
– Thread-vector scheduler: abstract thread management allowing user‐level or kernel threads
– Feature toggles at build time via configure flags (–enable-dpdk, –enable-flow, –disable-clone, etc.)
D. Key Technologies & Frameworks
– C++11 for core code
– DPDK (user‐level high-speed I/O)
– Netmap (alternative fast I/O)
– libnuma, python3, meson/ninja, autotools (configure, Makefile.in)
– Mininet/Vagrant for network emulation
Detail Requirements
– Annotate build-time options (–enable-flow, –enable-dpdk) near relevant modules
– Show how PacketMill specializes a pipeline into a standalone binary
– Include small callouts for RSS++ scaling integration at FromDPDKDevice