TL;DR
The Shifting Bloom Filter (ShBF) framework encodes auxiliary information—such as an element's frequency or its set identity—directly into a bit-location offset rather than dedicating extra memory to store counters or tags. By constraining offsets to fit within a single machine word access, ShBF cuts memory fetches and hash calculations nearly in half, delivering roughly a $2\times$ speedup over standard Bloom filters with virtually identical error rates.
What Problem Does This Paper Address?
High-speed networking systems must process set operations (e.g., membership testing, set association, and flow size tracking) at wire speed. Traditional Bloom Filters (BF) and Counting Bloom Filters (CBF) face two key bottlenecks:
- Computational overhead: Calculating $k$ independent hash functions per item is computationally heavy.
- Memory latency: Probing $k$ scattered bit locations across memory leads to multiple slow memory fetches.
When handling auxiliary metadata—such as tracking multiset element counts or distinguishing which set an element belongs to—standard extensions (like Spectral Bloom Filters, Count-Min sketches, or maintaining multiple individual filters) either consume excessive memory or degrade lookup throughput. The authors set out to design a unified, probabilistic data structure that supports membership, association, and multiplicity queries quickly while fitting comfortably within fast on-chip SRAM.
Methods
Instead of setting $k$ independent bits at locations $h_1(e)\%m, \dots, h_k(e)\%m$, the ShBF framework stores existence in the base hash positions and encodes auxiliary metadata as an offset $o(e)$:
- Bit Positioning: Bits are written to shifted locations $(h_i(e) + o(e))\%m$.
- Word-Aligned Probing: By bounding the maximum offset $\overline{w} \le w - 7$ (where $w$ is the machine word size, e.g., 32 or 64 bits), the base bit and the shifted bit can both be inspected in a single memory read.
The authors tailor this mechanism to three core queries:
- Membership Queries ($\text{ShBF}_M$): Splitting $k$ operations into $k/2$ base hashes and $k/2$ paired bits shifted by $o(e) = h_{k/2+1}(e)\%(\overline{w}-1) + 1$. A single memory access fetches two verification bits simultaneously, requiring only $k/2 + 1$ hash computations and $k/2$ memory accesses.
- Association Queries ($\text{ShBF}_A$): Determines membership across two overlapping sets ($S_1, S_2$). Elements in $S_1 - S_2$ use offset $0$, elements in $S_1 \cap S_2$ use offset $o_1(e)$, and elements in $S_2 - S_1$ use offset $o_2(e)$.
- Multiplicity Queries ($\text{ShBF}_\times$): For an element with occurrence count $c(e)$, the offset is set to $o(e) = c(e) - 1$. The query reads a contiguous window of $c$ bits across $k$ locations and reports the maximum matching candidate count.
- Hierarchical Updates: To support dynamic updates, the authors pair the SRAM bit array with a DRAM-based Counting Shifting Bloom Filter (CShBF), updating the fast SRAM filter only when counters transition to or from zero.
Base Position: h_i(e)%m
│
▼
Bit Array: [1] ... [ ] ... [1] ... [ ]
└─── o(e) ──────┘
Offset Position: (h_i(e) + o(e))%m
(Both checked in 1 word-aligned access)
Datasets
- Real-World Network Traces: 10 million 5-tuple flow records (source/destination IP, source/destination port, protocol) collected from a 10 Gbps backbone router link using
netmap, containing 8 million unique flow IDs formatted as 13-byte strings. - Synthetic Datasets: Generated data used to validate theoretical false positive formulas and stress-test performance across varying set sizes ($n$), filter lengths ($m$), and hash numbers ($k$).
Key Insights and Ideas
- Offsets as an Information Channel: Spatial distance between bits functions as a compact storage channel. Storing auxiliary values in location offsets eliminates the need for separate metadata fields.
- Exploiting CPU Memory Word Boundaries: Fetching multiple bits within a single machine word incurs no extra memory cycles on modern hardware (e.g., x86). Coupling base and offset bits reduces cache misses by up to 50%.
- Near-Zero Accuracy Trade-off: While shifting introduces slight correlations between bit positions, theoretical derivation and simulations prove that when $\overline{w} > 20$, the false positive rate (FPR) degradation compared to an idealized standard Bloom filter is negligible ($f_{\text{ShBF}_M}^{\min} \approx 0.6204^{m/n}$ vs. $f_{\text{BF}}^{\min} \approx 0.6185^{m/n}$).
Key Results
- Membership Testing ($\text{ShBF}_M$):
- Matches standard BF false positive rates while performing $\sim 2\times$ faster due to halving hash evaluations and memory accesses.
- Achieves 10%–19% lower FPR and $1.27\times$–$1.44\times$ higher throughput compared to 1MemBF.
- Association Queries ($\text{ShBF}_A$):
- Eliminates false positives when identifying elements in $S_1 \cap S_2$ (which standard individual Bloom filters suffer from).
- Attains a 99% probability of a clear answer at $k=8$ (compared to 66% for individual Bloom filters) while executing $1.4\times$ faster using $1/7$ less memory.
- Multiplicity Queries ($\text{ShBF}_\times$):
- Provides a $1.45\times$–$1.62\times$ higher correctness rate than Spectral Bloom Filters and Count-Min Sketches, sustaining over 3 million queries per second (Mqps) for $k > 11$.
Limitations and Future Work
- Offset Range Constraints: Auxiliary metadata is fundamentally constrained by machine word width ($w$). High multiplicity bounds ($c$) or associations across many sets require wider bit-probe spans, eventually requiring multiple memory accesses and eroding the speed advantage.
- Two-Set Boundary for Associations: The theoretical models and structures for association queries are explicitly analyzed for pairs of sets ($S_1, S_2$) with overlap; extending beyond two overlapping sets is not explored.
- Update Overhead for Multiplicity: Updating counts without introducing false negatives requires maintaining an auxiliary off-chip hash table and counting structure in DRAM, adding operational complexity compared to pure in-memory sketch updates.
Summary updated