1 / 79

Survey and Proposal on Binary Search Algorithms for Longest Prefix Match

Survey and Proposal on Binary Search Algorithms for Longest Prefix Match. Author : Hyesook Lim, Member, IEEE, and Nara Lee, Student Member, IEEE Publisher : IEEE COMMUNICATIONS SURVEYS & TUTORIALS Presenter: Yu Hao , Tzeng Date : 2012/10/03. Outline. Introdution Trie -based Algorithms

tibor
Download Presentation

Survey and Proposal on Binary Search Algorithms for Longest Prefix Match

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Survey and Proposal on Binary Search Algorithms for Longest Prefix Match Author: Hyesook Lim, Member, IEEE, and Nara Lee, Student Member, IEEE Publisher: IEEE COMMUNICATIONS SURVEYS & TUTORIALS Presenter: Yu Hao, Tzeng Date: 2012/10/03

  2. Outline • Introdution • Trie-based Algorithms • Algorithms Performing Binary Search on Prefix Values • Algorithms Performing Binary Search on Prefix Lengths • Performance • Conclusion

  3. Introdution • Describe various IP address lookup algorithms and compare the characteristics. • Use a consistent example set to describe the data structure and the search procedure of each algorithm • Evaluate each algorithm in terms of the minimum, worst-case, and average-case number of memory accesses, as well as memory requirements

  4. Trie-based Algorithms • Binary Trie (B-Trie) • Path-Compressed Trie (PC-Trie) • Priority Trie (P-Trie)

  5. Trie-based Algorithms (Cont.) • Binary Trie (B-Trie) • Path-Compressed Trie (PC-Trie) • Priority Trie (P-Trie)

  6. Trie-based Algorithms (Cont.) 0 • Binary Trie (B-Trie) 1 2 3 4 5 6 7 8 9 10 P2 11 12 P0 13 P1 P5 P4 P6 P3

  7. Trie-based Algorithms (Cont.) 0 • Binary Trie (B-Trie) 1 2 3 4 5 6 7 8 9 10 P2 11 12 P0 13 P1 P5 P4 P6 P3

  8. Trie-based Algorithms (Cont.) 0 • Binary Trie (B-Trie) • Example • Input : 110100 • Path : 0 -> 2 -> 5 -> 7 -> 9 -> 11 -> NULL • Best matching prefix (BMP) : P2 -> P4 1 2 3 4 5 6 7 8 9 10 P2 11 12 P0 13 P1 P5 P4 P6 P3

  9. Trie-based Algorithms (Cont.)

  10. Trie-based Algorithms (Cont.) • Binary Trie (B-Trie) • Path-Compressed Trie (PC-Trie) • Priority Trie (P-Trie)

  11. Trie-based Algorithms (Cont.) 0 0 • Path-Compressed Trie (PC-Trie) • Use skip values to remove single-child empty internal nodes • Remove a child pointer by converting the sub-trie of each node into a full trie 1 1 2 2 3 3 4 4 5 6 6 7 7 8 8 9 10 9 12 P2 P2 11 12 P0 P0 P1 13 P4 P1 P5 P5 P6 P4 P3 Skip 1 P6 Skip 1 Skip 1 P3 Skip 1

  12. Trie-based Algorithms (Cont.) 0 • Path-Compressed Trie (PC-Trie) 1 2 3 4 6 7 8 9 12 P2 P0 P1 P4 P5 P6 P3 Skip 1 Skip 1 Skip 1 Skip 1

  13. Trie-based Algorithms (Cont.) 0 • Path-Compressed Trie (PC-Trie) • References [7] 1 2 3 4 5 6 7 8 0 9 10 1 P2 1 2 11 12 3 2 P2 P0 3 4 6 5 13 5 4 P4 P5 P1 P0 P1 P5 7 8 P3 P6 P4 P6 P3

  14. Trie-based Algorithms (Cont.) • Path-Compressed Trie (PC-Trie) • References [7] 0 1 1 2 3 2 P2 3 4 6 5 5 4 P4 P5 P1 P0 7 8 P3 P6

  15. Trie-based Algorithms (Cont.) • Path-Compressed Trie (PC-Trie) • References [7] • Example • Input : 110100 • Path : 0 -> 2 -> 5 -> 7 • BMP : P2 -> P4 0 1 1 2 3 2 P2 3 4 6 5 5 4 P4 P5 P1 P0 7 8 P3 P6

  16. Trie-based Algorithms (Cont.)

  17. Trie-based Algorithms (Cont.) • Binary Trie (B-Trie) • Path-Compressed Trie (PC-Trie) • Priority Trie (P-Trie)

  18. Trie-based Algorithms (Cont.) 0 0 • Priority Trie (P-Trie) • relocate the longest prefix belonging to the sub-trie of each empty internal node into the empty node to remove empty internal nodes in the binary trie 1 1 2 2 3 3 4 5 4 6 5 7 6 8 9 10 P2 P2 11 12 P3 P0 P0 13 P1 P1 P5 P5 P4 P6 P4 P6 P3

  19. Trie-based Algorithms (Cont.) 0 • Priority Trie (P-Trie) 1 2 3 4 5 6 P2 P3 P0 P1 P5 P6 P4

  20. Trie-based Algorithms (Cont.) 0 • Priority Trie (P-Trie) • Example • Input : 110100 • Path : 0 -> 2 -> 4 -> 5 • BMP : P2 -> P4 1 2 3 4 5 6 P2 P3 P0 P1 P5 P6 P4

  21. Trie-based Algorithms (Cont.)

  22. Algorithms Performing Binary Search on Prefix Values • Binary Search on Range (BSR) • Binary Search Tree (BST) • Weighted Binary Search Tree (WBST) • Binary Search Tree with Prefix Vector (BST-PV) • Binary Search Tree with Switch Pointer (BST-SP)

  23. Algorithms Performing Binary Search on Prefix Values (Cont.) • Binary Search on Range (BSR) • Binary Search Tree (BST) • Weighted Binary Search Tree (WBST) • Binary Search Tree with Prefix Vector (BST-PV) • Binary Search Tree with Switch Pointer (BST-SP)

  24. Algorithms Performing Binary Search on Prefix Values (Cont.) • Binary Search on Range (BSR)

  25. Algorithms Performing Binary Search on Prefix Values (Cont.) • Binary Search on Range (BSR)

  26. Algorithms Performing Binary Search on Prefix Values (Cont.) • Binary Search on Range (BSR) • Example • Input : 110100 • BMP : P4

  27. Algorithms Performing Binary Search on Prefix Values (Cont.)

  28. Algorithms Performing Binary Search on Prefix Values (Cont.) • Binary Search on Range (BSR) • Binary Search Tree (BST) • Weighted Binary Search Tree (WBST) • Binary Search Tree with Prefix Vector (BST-PV) • Binary Search Tree with Switch Pointer (BST-SP)

  29. Algorithms Performing Binary Search on Prefix Values (Cont.) 0 • Binary Search Tree (BST) 1 2 3 4 5 6 P1 P2 P0 P4 P5 P3 P6

  30. Algorithms Performing Binary Search on Prefix Values (Cont.) 0 • Binary Search Tree (BST) 1 2 3 4 5 6 P1 P2 P0 P4 P5 P3 P6

  31. Algorithms Performing Binary Search on Prefix Values (Cont.) 0 • Binary Search Tree (BST) • Example • Input : 110100 • Path : 0 -> 2 -> 3 -> 4 • BMP : P2 -> P4 1 2 3 4 5 6 P1 P2 P0 P4 P5 P3 P6

  32. Algorithms Performing Binary Search on Prefix Values (Cont.)

  33. Algorithms Performing Binary Search on Prefix Values (Cont.) • Binary Search on Range (BSR) • Binary Search Tree (BST) • Weighted Binary Search Tree (WBST) • Binary Search Tree with Prefix Vector (BST-PV) • Binary Search Tree with Switch Pointer (BST-SP)

  34. Algorithms Performing Binary Search on Prefix Values (Cont.) • Weighted Binary Search Tree (WBST) • Define the weight of a prefix, as the number of enclosed prefixes plus 1

  35. Algorithms Performing Binary Search on Prefix Values (Cont.) • Weighted Binary Search Tree (WBST) 0 P2 1 2 P0 P4 3 4 5 P1 P3 P5 6 P6

  36. Algorithms Performing Binary Search on Prefix Values (Cont.) • Weighted Binary Search Tree (WBST) • Example • Input : 110100 • Path : 0 -> 2 -> 4 • Output port : P2 -> P4 0 P2 1 2 P0 P4 3 4 5 P1 P3 P5 6 P6

  37. Algorithms Performing Binary Search on Prefix Values (Cont.)

  38. Algorithms Performing Binary Search on Prefix Values (Cont.) • Binary Search on Range (BSR) • Binary Search Tree (BST) • Weighted Binary Search Tree (WBST) • Binary Search Tree with Prefix Vector (BST-PV) • Binary Search Tree with Switch Pointer (BST-SP)

  39. Algorithms Performing Binary Search on Prefix Values (Cont.) 0 • Binary Search Tree with Prefix Vector (BST-PV) • prefix vectors are constructed for each leaf prefix of the binary trie • the leaf prefixes with a prefix vector are sorted in ascending order 1 2 3 4 5 6 7 8 9 10 P2 11 12 P0 13 P1 P5 P4 P6 P3

  40. Algorithms Performing Binary Search on Prefix Values (Cont.) • Binary Search Tree with Prefix Vector (BST-PV) • prefix vectors are constructed for each leaf prefix of the binary trie • the leaf prefixes with a prefix vector are sorted in ascending order

  41. Algorithms Performing Binary Search on Prefix Values (Cont.) • Binary Search Tree with Prefix Vector (BST-PV) • Example • Input : 110100 • Path : 0 -> 1 • BMP : P4 0 1 2 3

  42. Algorithms Performing Binary Search on Prefix Values (Cont.)

  43. Algorithms Performing Binary Search on Prefix Values (Cont.) • Binary Search on Range (BSR) • Binary Search Tree (BST) • Weighted Binary Search Tree (WBST) • Binary Search Tree with Prefix Vector (BST-PV) • Binary Search Tree with Switch Pointer (BST-SP)

  44. Algorithms Performing Binary Search on Prefix Values (Cont.) 0 • Binary Search Tree with Switch Pointer (BST-SP) 1 2 3 4 5 6 7 8 9 10 3 P2 P3 11 12 1 5 P0 P1 P5 13 4 6 0 2 P1 P5 P0 P4 P2 P6 P4 P6 P3

  45. Algorithms Performing Binary Search on Prefix Values (Cont.) • Binary Search Tree with Switch Pointer (BST-SP) 3 P3 1 5 P1 P5 4 6 0 2 P0 P4 P2 P6

  46. Algorithms Performing Binary Search on Prefix Values (Cont.) • Binary Search Tree with Switch Pointer (BST-SP) • Search • Best matching prefix (BMP) • Best matching length (BML) • Current matching enclosure length (CMEL) • Switch pointer (SP)

  47. Algorithms Performing Binary Search on Prefix Values (Cont.) • Binary Search Tree with Switch Pointer (BST-SP) • Example I • Input : 110100 3 P3 1 5 P1 P5 4 6 0 2 P0 P4 P2 P6

  48. Algorithms Performing Binary Search on Prefix Values (Cont.) • Binary Search Tree with Switch Pointer (BST-SP) • Example II • Input : 111000 3 P3 1 5 P1 P5 4 6 0 2 P0 P4 P2 P6

  49. Algorithms Performing Binary Search on Prefix Values (Cont.)

  50. Algorithms Performing Binary Search on Prefix Lengths (Cont.) • Waldvogels Binary Search on Length (W-BSL) • Binary Search on Length in a Leaf-Pushed Trie (L-BSL) • logW-Elevator Algorithm (logW-E) • Binary Search on Lengths in Multiple Tries (BSL-MT)

More Related