260 likes | 432 Vues
Fast Routing Table Lookup Based on Deterministic Multi-hashing. Zhuo Huang , David Lin, Jih-Kwon Peir, Shigang Chen, S. M. Iftekharul Alam Department of Computer and Information Science and Engineering University of Florida. Outline. Hash-based routing table lookup
E N D
Fast Routing Table Lookup Based on Deterministic Multi-hashing Zhuo Huang, David Lin, Jih-Kwon Peir, Shigang Chen, S. M. Iftekharul Alam Department of Computer and Information Science and Engineering University of Florida 1
Outline • Hash-based routing table lookup • Challenges and current approaches • Our solution: DM-Hash • Related works • Performance results • Conclusion
Routing Table Lookup • Find the Next Hop info for each incoming packet based on its destination address and the Routing Table. 01000000 Routing Table Port A Port B Port C 01000000 -> Port B 01000000
Three main approaches • T-CAM based approaches • Low latency • high hardware and power cost • Trie based approaches • Low power, less storage space • Long lookup latency • Hash based approaches • Power efficient, good for large table • Collision issues, special support for LPM
Hash-based IP Lookup • The prefixes are stored in off-chip SRAM; • Organized as buckets; • Each bucket stores several prefixes; • One bucket, one memory access.
IP-lookup Procedure for Length k Destination Address Hash Unit Use the first k bits Match? Fetch from SRAM Matched Prefix and Routing Information
Two Major Problems • Determine the prefix length • Variable lengths in the routing table • Bloom Filters, Prefix Expansion… • Fetch the bucket(s) from the off-chip SRAM • Bottleneck of the routing throughput • Our target
Routing Throughput • n prefixes, m buckets • Memory Bandwidth is B (bits/sec) • Bucket size (bits) s • If the largest bucket has Ω prefixes • each prefix takes l bits • S= Ω * l • Needs to fetch t buckets • The maximum routing throughput is B/(t*s) = B/ (t* Ω * l)
Challenge • A good hash function for hash-based routing table lookup should be: • Optimal or nearly optimal bucket size; (Ω =n/m) • 1 bucket access; (t=1)
Existing Approaches • Single Hash: • Easy to implement; 1-bucket access • Large bucket size • Non-deterministicMultiple Hash: • Nearly optimal bucket size • Need to access multiple buckets • Only achieve 1/k of the optimal throughput, if using k hash functions
Deterministic Multi-hashing • When placing a prefix, it can be placed to multiple buckets • Reduce bucket size • When searching a prefix, only one bucket needs to be searched; • Reduce the number of fetched buckets • Use an index table to record where each prefix goes • Nearly optimal routing throughputs
Index Table • Simplest way: • Record the choice for each prefix • Need a table at least as large as the routing table • A small table: • Suitable to be placed on chip • Different prefixes share the same entry • Each prefix is hashed to multiple entries in the table
DM-Hash Multiple hash functions How to setup it? Xor all the values to determine the bucket On-chip Index table. Each entry stores a value
Index Table Setup • Each prefix is associated to multiple entries; • Each entry is associated to multiple prefixes; • The location of a prefix is determined as long as all the entries in the index table that it hashed to is assigned; • The order matters!
Order Example • Four Prefixes P0, P1, P2, P3; • Index table: 4 entries: E0, E1, E2, E3; • Hash to the index table: • P0: -> E0, E3 • P1: -> E1, E3 • P2: -> E2, E3 • P3: -> E0, E2 • Order: E0, E1, E2, E3; • Order: E3, E2, E1, E0; • E3, E2, E1, E0 is better!
Progressive Order • Find a order to determine the entries • Key idea • Balance the number of prefixes decided by each entry during the setup
Assign Values for the Index Table • Try all the possible m values of the entry E • Get m different ways to place the prefixes whose locations are determined by the value of E • Find the most balanced one among the m possible choices
Results for Random Prefixes • Put 1,000,000 Prefixes to 300,000 buckets:
Analysis • How large the index table should be? • Let x be the index table size • For m=300,000 n=1000,000, we get x>67180
Related Works (1) • Hashing Approaches: • Multiple Hashing: Broder 2001; • D-left Hashing: Bonomi 2006 • Cockoo Hashing: Demetriades 2008 • Peacock Hashing: Kumar 2008 • Perfect Hashing: Lu 2007
Related Works (2) • Bloom filters and its variance: • Bloom filter: Dharmapurikar 2003 • Bloomier filter: Chazelle 2004 • Chisel: Hasan 2006 • Distributed and Load Balanced Bloom Filters: Song 2009
Determine the Prefix Length Off-chip SRAM Expanded to 23 bits On-Chip TCAM
Routing Table Experiment • 5 largest routing tables; • DM-Hash, Single-Hash, NM-Hash (2-left Hash); • Vary the number of buckets from 16K to 2M; • Throughput: • Based on the fastest SRAM QDR SRAM III (72-bits block, 500M read/write operations per second) • Assume each prefix and routing info takes 40 bits
Throughput A future network processor needs to process >150 M packets per second Our DM-Hash can achieve the throughput up to 250 M packets per second
Conclusion • DM-Hash aims at the problem of fast routing table lookup; • It minimizes both the size of each bucket and the number of buckets that needs to be fetched; • It achieves over 250M table lookup per second; • It can be applied to many other applications.