How mtcp-stack/mtcp works
mTCP is a user-level TCP stack for multicore systems, with packet-I/O backends and ported applications. The main workflow is an application using the mTCP socket/event API; the stack processes TCP and packet I/O, then returns data or events to the application. The README documents DPDK, PSIO, and netmap as I/O choices and describes a ported lighttpd and Apache benchmark. Some subsystem paths and relationships below rely on README statements or SOURCE INDEX references; unsampled implementation details are not inferred.
Main entry points: core.c Stack core · server.c Ported lighttpd · api.c mTCP API · client.c Perf client
Components 16
Applications
- Ported lighttpd
apps/lighttpd-1.4.32/src/server.c - HTTP authentication
apps/lighttpd-1.4.32/src/http_auth.c - SSI expression parser
apps/lighttpd-1.4.32/src/mod_ssi_exprparser.c - Apache benchmark
apps/apache_benchmark/support/ab-multiple-files.c - Perf client
apps/perf/client.c
TCP stack
- mTCP API
mtcp/src/api.c - Stack core
mtcp/src/core.c - TCP input
mtcp/src/tcp_in.c - TCP output
mtcp/src/tcp_out.c - Fragment queue
mtcp/src/tcp_rb_frag_queue.c - TCP ring buffer
mtcp/src/include/tcp_ring_buffer.h
Packet I/O
- PSIO library
io_engine/lib/pslib.c - PSIO NIC driver
io_engine/driver/ixgbe_main.c - Other I/O backends
mtcp/src
Runtime support
- Network utilities
util/netlib.c
Other components
- Application user
Connections 17
- Application user → Ported lighttpd: configures
README - Application user → Apache benchmark: runs benchmark
README - Application user → Perf client: runs client
apps/perf/client.c - Ported lighttpd → mTCP API: uses sockets
apps/lighttpd-1.4.32/src/server.c - Apache benchmark → mTCP API: uses TCP
- Perf client → mTCP API: calls API
apps/perf/client.c - Ported lighttpd → HTTP authentication: delegates auth
apps/lighttpd-1.4.32/src/http_auth.c - Ported lighttpd → SSI expression parser: parses SSI
- mTCP API → Stack core: dispatches
mtcp/src/core.c - Stack core → TCP input: processes input
mtcp/src/core.c - Stack core → TCP output: processes output
mtcp/src/core.c - TCP input → TCP ring buffer: buffers data
- TCP input → Fragment queue: queues fragments
- Stack core → PSIO library: receives packets
mtcp/src/core.c - PSIO library → PSIO NIC driver: accesses driver
io_engine/driver/ixgbe_main.c - Stack core → Other I/O backends: selects backend
README - Perf client → Network utilities: uses helpers
apps/perf/client.c