← Back
Home › Systems › Networking and edge

stateful-firewall

stateful packet firewall

nftables, pf

SystemTechniques · 1Primitives · 17 stateful-firewall Packet classificationnetworking · medium: Multi-field rule matching (tuple space search, decision trees) and flow cachesBytecode interpretercompilers · low: Register/stack VM dispatch loop for executing compiled plans or rules (SQLite VDBE, nftables)RCU (read-copy-update)concurrency · low: Readers access shared data with no locks or atomic writes; writers publish a new copy and free the old one after a grace period.›Connection trackingnetworking · low: Per-flow state table (5-tuple, TCP state, timeouts) for stateful packet handlingEbpf xdpnetworking · low: EBPF programs at the XDP/tc hooks for in-kernel packet processing at line rateInternet checksumnetworking · low: Ones-complement IP/TCP/UDP checksum, incremental update (RFC 1624) and offloadIp fragment reassemblynetworking · low: Reassemble IP fragments with timeouts and overlap/DoS protectionLongest prefix matchnetworking · low: IP prefix lookup structures (DIR-24-8, Poptrie, LC-trie) for routes, ACLs and geo-IPNetwork address translationnetworking · low: NAT mapping tables, endpoint-independent mapping/filtering, hairpinning and port allocationSyn cookiesnetworking · low: Stateless SYN handling that encodes connection state in the initial sequence numberHierarchical timing wheelsystems · low: Timers bucketed by expiry into wheels of slots, coarser wheels for far deadlines: O(1) insert and cancel for millions of timeouts.›Interval treedata-structures · low: Index of ranges that answers "which intervals overlap this point or range?" in O(log n + k); static sorted-array form is the compact, cache-friendly choice.›Swiss tabledata-structures · low: Open-addressing hash table that filters 8-16 slots at once with 1-byte hash tags and SIMD, giving fast lookups at 87.5 % load.›Packet header parsingnetworking · low: Parse graph state machines for Ethernet, IP, TCP and UDP headers in hardware and softwareTcam ternary matchingnetworking · low: TCAM ternary match tables: priorities, range expansion, power and capacity trade-offsLRU and CLOCKsystems · low: LRU evicts the least recently used entry via hash map plus linked list; CLOCK approximates it with a reference bit, so hits take no lock.›Memory orderingconcurrency · low: What Relaxed, Acquire, Release and SeqCst atomics actually guarantee, what they cost on x86 and ARM, and which one each pattern needs.›+ 1 more primitives

Similar systems

Share the most building blocks with this one.