A cache architecture for counting Bloom filters: Theory and application