Advanced Hash Algorithms with Key Bits Duplication for
Advanced Hash Algorithms with Key Bits Duplication for IP Address Lookup Author: Christopher Martinez and Wei-Ming Lin Publisher: 2009 Fifth International Conference on Networking and Services Presenter: Han-Chen Date: 2009/10/7 1
Outline o o o Introduction Some of Non-Duplication XOR Folding Algorithms Bit-Duplication XOR Hashing approaches Minimal IDC Duplication Performance 2
Introduction o o Preprocess & Improve XOR Hashing Algorithms Reduce MSL (Maximum Search Length) & ASL (Average Search Length) 2 m entry … Hash function … Data data … collision data m bits Bucket … collision data 3
MSL & ASL Data Hash function 0 1 2 3 4 5 6 7 Bucket 2 1 3 MSL=3 1 1 ASL=(2+1+3+1+1)/6 1 4
XOR Hashing (Group XOR) o Random XORing process (m=3) DB Entry #0 #1 #2 #3 #4 #5 #6 #7 Bit Position 76543210 1 0 0 0 1 1 1 1 0 1 0 0 0 1 0 0 1 1 1 0 0 0 1 0 1 1 1 0 1 A Bit Position B C 7 6 5 4 3 2 1 0 ⊕ ⊕ ⊕ A B C 5
Non-Duplication XOR Hashing (In-order XOR Hashing) DB Entry Bit Position #7 7 1 0 0 d= 42644422 #0 #1 #2 #3 #4 #5 #6 DB Entry #0 #1 #2 #3 #4 #5 #6 #7 d= 6 0 0 1 0 0 0 1 1 5 1 1 1 0 1 4 0 0 0 1 1 0 3 1 0 0 0 1 0 2 0 1 1 1 0 0 0 1 0 1 1 1 0 1 A 0 0 1 1 1 0 1 7 1 0 0 4 0 0 0 1 1 0 3 1 0 0 0 1 0 2 0 1 1 1 0 5 1 1 1 0 1 22244446 C Bit Position 6 1 0 7 4 3 2 5 d value 2 2 2 4 4 6 Sort d value Bit Position 1 1 1 0 0 0 1 B ⊕ ⊕ ⊕ A B C 6
Three Simple Bit-Duplication XOR Hashing Approaches o o o Self-Duplication Exchange-Duplication Cycle-Duplication 7
Self-Duplication Deficiency: Nullification Bucket size : m=4 A B C D W X Y Z d value small A A big A⊕A=0 8
Exchange-Duplication Deficiency: Downgrade Bucket size : m=4 A B C D W X Y Z d value small B A A A big A⊕B=B⊕A 9
Cycle-Duplication Bucket size : m=4 A B C D W X Y Z d value small D A B C big 10
MSL & ASL on Randomly Generated Data Sets length m Maximum Search Length m Average Search Length The self-duplication reduction of 15% both in MSL and ASL. The cycle-duplication reduction of 50% in MSL and 27% in ASL. 11
Minimal IDC Duplication (1/4) IDC : Induced Duplication Correlation bit 0 Bucket size : m=4 bit 1 bit 2 bit 3 bit 0 bit 1 bit 2 bit 3 A B C D D A B C B C D A B C Duplication times : X=2 Given m, how many times can it be duplicated without causing the downgrading problem? or In order to duplicate X times without the downgrading problem, what is the minimal m required? 12
Minimal IDC Duplication (2/4) bit 0 m=7 X=2 bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 A B C D E F G A B C D E F X 3 E F G A B C D X 5 X 1 … A X 6 X 2 … X 4 A n. Proof : m ≥ (X + 1)2 – (X + 1) = X 2 + X +1 m ≥ X * (X + 1) + 1 13
Minimal IDC Duplication (3/4) bit 0 bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 A B C D E F G m=7 X=2 G A B C D E F F G A B C D E o o Dij = min( (si − sj) mod m , (sj − si) mod m ) Dij = Dkl , ∀i, j, k, l, 0 ≤ i, j, k, l ≤ m, and (i, j) ≠(k, l). 14
Minimal IDC Duplication (4/4) m=13, X=3 13 ≥ 3 * (3 + 1) + 1 ok! D 01=Min((0 -1)mod 13, (1 -0)mod 13)=1 D 13=Min((0 -2)mod 13, (2 -0)mod 13)=2 D 03=Min((0 -3)mod 13, (3 -0)mod 13)=3 D 09=Min((0 -9)mod 13, (9 -0)mod 13)=4 D 19=Min((1 -9)mod 13, (9 -1)mod 13)=5 D 39=Min((3 -9)mod 13, (9 -3)mod 13)=6 15
Performance length m m MSL & ASL on Randomly Generated Data Sets 16
Thanks for your listening 17
- Slides: 17