Routers must do a best matching pre x lookup for every packet solutions for Gigabit speeds are well known. As Internet link speeds higher, we seek a scalable solution whose speed scales with memory speeds while allowing large prex databases. In this paper we show that providing such a solution requires careful attention to memory allocation and pipelining. This is because fast lookups require on-chip or o -chip SRAM which is limited by either expense or manufacturing process. We show that doing so while providing guarantees on the numberof pre xes supported requires new ms and the breaking down of traditional abstraction boundaries between hardware and software. We introduce new problem-speci c memory allocators that have provable memory utilization guarantees that can reach 100% this is contrast to all standard allocators that can only guarantee 20% utilization when the requests can come in the range 1: : : 32]. An optimal version of our algorithm requires a new (but feasible) SRAM m...