Presentation is loading. Please wait.

Presentation is loading. Please wait.

Survey and Proposal on Binary Search Algorithms for Longest Prefix Match Author: Hyesook Lim, Member, IEEE, and Nara Lee, Student Member, IEEE Publisher:

Similar presentations


Presentation on theme: "Survey and Proposal on Binary Search Algorithms for Longest Prefix Match Author: Hyesook Lim, Member, IEEE, and Nara Lee, Student Member, IEEE Publisher:"— 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 1

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

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 3

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

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

6 Trie-based Algorithms (Cont.) Binary Trie (B-Trie) No.Prefix P000* P1010* P21* P * P41101* P5111* P611111* P P0 P2 P5 P4 P3 P6 6

7 Trie-based Algorithms (Cont.) Binary Trie (B-Trie) No.Prefix validLeft pointRight pointOutput port P2 31--P P P P P P3 P P0 P2 P5 P4 P3 P6 7

8 Trie-based Algorithms (Cont.) Binary Trie (B-Trie) Example Input : Path : 0 -> 2 -> 5 -> 7 -> 9 -> 11 -> NULL Best matching prefix (BMP) : P2 -> P4 P P0 P2 P5 P4 P3 P6 8

9 Trie-based Algorithms (Cont.) Algorithms Complexity to provide incremental update Search performance degradation when applied to large routing date Search performance degradation when applied to IPv6 B-TrieVery low High 9

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

11 Trie-based Algorithms (Cont.) 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 P P0 P2 P5 P4 P3 P6 P P0 P2 P5P4 P3 P6 Skip 1 11

12 Trie-based Algorithms (Cont.) Path-Compressed Trie (PC-Trie) P P0 P2 P5P4 P3 P6 Skip 1 No. Prefix valid Skip value StringLength Next Point Output port 000* * *15P *2-P *3-P * *49P *311P *6-P *5-P6 12

13 Trie-based Algorithms (Cont.) Path-Compressed Trie (PC-Trie) References [7] P P0 P2 P5 P4 P3 P P0 4 P1 7 P3 8 P6 2 P2 6 P5 5 P No.Prefix P000* P1010* P21* P * P41101* P5111* P611111* 13

14 Trie-based Algorithms (Cont.) Path-Compressed Trie (PC-Trie) References [7] P0 4 P1 7 P3 8 P6 2 P2 6 P5 5 P No. Prefix valid Bit number String Left point Right point Output port 001* * *56P *--P *--P *7-P *-8P *--P *--P6 14

15 Trie-based Algorithms (Cont.) Path-Compressed Trie (PC-Trie) References [7] Example Input : Path : 0 -> 2 -> 5 -> 7 BMP : P2 -> P P0 4 P1 7 P3 8 P6 2 P2 6 P5 5 P No. Prefix valid Bit number String Left point Right point Output port 001* * *56P *--P *--P *7-P *-8P *--P *--P6 15

16 Trie-based Algorithms (Cont.) Algorithms Complexity to provide incremental update Search performance degradation when applied to large routing date Search performance degradation when applied to IPv6 B-TrieVery low High PC-TrieMedium Low 16

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

18 Trie-based Algorithms (Cont.) 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 P P0 P2 P5 P4 P3 P P0 P2 P5 P3 P1 P6 P4 18

19 Trie-based Algorithms (Cont.) Priority Trie (P-Trie) P0 P2 P5 P3 P1 P6 P4 No. Priority / Ordinary PrefixLengthLeft pointRight point Output port *612P *33-P1 201*1-4P2 3000*2--P *556P *4--P *3--P5 19

20 Trie-based Algorithms (Cont.) Priority Trie (P-Trie) Example Input : Path : 0 -> 2 -> 4 -> 5 BMP : P2 -> P P0 P2 P5 P3 P1 P6 P4 No.Prefix P000* P1010* P21* P * P41101* P5111* P611111* 20

21 Trie-based Algorithms (Cont.) Algorithms Complexity to provide incremental update Search performance degradation when applied to large routing date Search performance degradation when applied to IPv6 B-TrieVery low High PC-TrieMedium Low P-TrieLow Very low 21

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) 22

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) 23

24 Algorithms Performing Binary Search on Prefix Values (Cont.) Binary Search on Range (BSR) No.Prefix P000* P1010* P21* P * P41101* P5111* P611111* 24

25 Algorithms Performing Binary Search on Prefix Values (Cont.) Binary Search on Range (BSR) ValueBMP (equivalence)BMP (greater-than) P P0P P P P P3P P4P P P6- 25

26 Algorithms Performing Binary Search on Prefix Values (Cont.) Binary Search on Range (BSR) Example Input : BMP : P4 ValueBMP (equivalence)BMP (greater-than) P P0P P P P P3P P4P P P6- 26

27 Algorithms Performing Binary Search on Prefix Values (Cont.) Algorithms Complexity to provide incremental update Search performance degradation when applied to large routing date Search performance degradation when applied to IPv6 B-TrieVery low High PC-TrieMedium Low P-TrieLow Very low BSRVery highVery low 27

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) 28

29 Algorithms Performing Binary Search on Prefix Values (Cont.) Binary Search Tree (BST) P2 P5 P1 P0 P4 P3 P6 No.Prefix P000* P1010* P21* P * P41101* P5111* P611111* 29

30 Algorithms Performing Binary Search on Prefix Values (Cont.) Binary Search Tree (BST) P2 P5 P1 P0 P4 P3 P6 No.PrefixLengthLeft pointerRight PointerOutput port 0010*312P1 100*2--P0 21*1-3P *445P *6--P3 5111*3-6P *5--P6 30

31 Algorithms Performing Binary Search on Prefix Values (Cont.) Binary Search Tree (BST) Example Input : Path : 0 -> 2 -> 3 -> 4 BMP : P2 -> P P2 P5 P1 P0 P4 P3 P6 No.Prefix P000* P1010* P21* P * P41101* P5111* P611111* 31

32 Algorithms Performing Binary Search on Prefix Values (Cont.) Algorithms Complexity to provide incremental update Search performance degradation when applied to large routing date Search performance degradation when applied to IPv6 B-TrieVery low High PC-TrieMedium Low P-TrieLow Very low BSRVery highVery low BSTVery highHigh May or may not be low 32

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) 33

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 PrefixWeight P01 P11 P25 34

35 Algorithms Performing Binary Search on Prefix Values (Cont.) Weighted Binary Search Tree (WBST) No.PrefixLengthLeft pointerRight PointerOutput port 01*112P2 100*2-3P *445P4 3010*3--P *6--P3 5111*3-6P *5--P6 P P4 P2 P0 P1P3 P6 35

36 Algorithms Performing Binary Search on Prefix Values (Cont.) Weighted Binary Search Tree (WBST) Example Input : Path : 0 -> 2 -> 4 Output port : P2 -> P4 No.Prefix P000* P1010* P21* P * P41101* P5111* P611111* P P4 P2 P0 P1P3 P6 36

37 Algorithms Performing Binary Search on Prefix Values (Cont.) Algorithms Complexity to provide incremental update Search performance degradation when applied to large routing date Search performance degradation when applied to IPv6 B-TrieVery low High PC-TrieMedium Low P-TrieLow Very low BSRVery highVery low BSTVery highHigh May or may not be low WBSTVery highHighMay or may not be low 37

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) 38

39 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 P P0 P2 P5 P4 P3 P6 PrefixLengthPrefix vector 00*2-P *3--P *6P2--P4-P *5P2-P5-P6- 39

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 PrefixLengthPrefix vector 00*2-P *3--P *6P2--P4-P *5P2-P5-P6- 40

41 Algorithms Performing Binary Search on Prefix Values (Cont.) Binary Search Tree with Prefix Vector (BST-PV) Example Input : Path : 0 -> 1 BMP : P4 No.Prefix P000* P1010* P21* P * P41101* P5111* P611111*

42 Algorithms Performing Binary Search on Prefix Values (Cont.) Algorithms Complexity to provide incremental update Search performance degradation when applied to large routing date Search performance degradation when applied to IPv6 B-TrieVery low High PC-TrieMedium Low P-TrieLow Very low BSRVery highVery low BSTVery highHigh May or may not be low WBSTVery highHighMay or may not be low BST-PVVery highLowVery low 42

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) 43

44 Algorithms Performing Binary Search on Prefix Values (Cont.) Binary Search Tree with Switch Pointer (BST-SP) P P0 P2 P5 P4 P3 P6 No.Prefix P000* P1010* P21* P * P41101* P5111* P611111* P P5 P3 P1 P2 P4P0 44

45 Algorithms Performing Binary Search on Prefix Values (Cont.) Binary Search Tree with Switch Pointer (BST-SP) No.Prefix P000* P1010* P21* P * P41101* P5111* P611111* P P5 P3 P1 P2 P4P0 No.PrefixLength Output port Switch pointer Enclosure length 000*1P *3P1-0 21*1P *6P *4P *3P *5P653 45

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) 46

47 Algorithms Performing Binary Search on Prefix Values (Cont.) Binary Search Tree with Switch Pointer (BST-SP) Example I Input : Statu #BMPBMLCMELSP 0Wildcard P2144 P P5 P3 P1 P2 P4P0 No.PrefixLength Output port Switch pointer Enclosure length 000*1P *3P1-0 21*1P *6P *4P *3P *5P653 47

48 Algorithms Performing Binary Search on Prefix Values (Cont.) Binary Search Tree with Switch Pointer (BST-SP) Example II Input : Statu #BMPBMLCMELSP 0Wildcard P5324 P P5 P3 P1 P2 P4P0 No.PrefixLength Output port Switch pointer Enclosure length 000*1P *3P1-0 21*1P *6P *4P *3P *5P653 48

49 Algorithms Performing Binary Search on Prefix Values (Cont.) Algorithms Complexity to provide incremental update Search performance degradation when applied to large routing date Search performance degradation when applied to IPv6 B-TrieVery low High PC-TrieMedium Low P-TrieLow Very low BSRVery highVery low BSTVery highHigh May or may not be low WBSTVery highHighMay or may not be low BST-PVVery highLowVery low BST-SPVery highHighMay or may not be low 49

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) 50

51 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) 51

52 Algorithms Performing Binary Search on Prefix Lengths (Cont.) Waldvogels Binary Search on Length (W-BSL) M P P0 P2 P5 P4 P3 P6 M BMP = P2 M BMP = P

53 Algorithms Performing Binary Search on Prefix Lengths (Cont.) Waldvogels Binary Search on Length (W-BSL) M P P0 P2 P5 P4 P3 P6 M BMP = P2 M BMP = P Level 3 Prefix / InternalNodeMarkerPrefix / pre-computed BMP 10100P P P5 53

54 Algorithms Performing Binary Search on Prefix Lengths (Cont.) Waldvogels Binary Search on Length (W-BSL) M P P0 P2 P5 P4 P3 P6 M BMP = P2 M BMP = P Level 1 Prefix / InternalNodeMarkerPrefix / pre-computed BMP P2 54

55 Algorithms Performing Binary Search on Prefix Lengths (Cont.) Waldvogels Binary Search on Length (W-BSL) M P P0 P2 P5 P4 P3 P6 M BMP = P2 M BMP = P Level 5 Prefix / InternalNodeMarkerPrefix / pre-computed BMP P P6 55

56 Algorithms Performing Binary Search on Prefix Lengths (Cont.) Waldvogels Binary Search on Length (W-BSL) M P P0 P2 P5 P4 P3 P6 M BMP = P2 M BMP = P Level 2 Prefix / InternalNodeMarkerPrefix / pre-computed BMP 1000P

57 Algorithms Performing Binary Search on Prefix Lengths (Cont.) Waldvogels Binary Search on Length (W-BSL) M P P0 P2 P5 P4 P3 P6 M BMP = P2 M BMP = P Level 4 Prefix / InternalNodeMarkerPrefix / pre-computed BMP P

58 Algorithms Performing Binary Search on Prefix Lengths (Cont.) Waldvogels Binary Search on Length (W-BSL) M P P0 P2 P5 P4 P3 P6 M BMP = P2 M BMP = P Level 6 Prefix / InternalNodeMarkerPrefix / pre-computed BMP P3 58

59 Algorithms Performing Binary Search on Prefix Lengths (Cont.) Waldvogels Binary Search on Length (W-BSL) Example Input : Path : 3 -> 5 -> 6 BMP : P2 -> P4 Level 3 Prefix / InternalNodeMarkerPrefix / pre-computed BMP 10100P P P5 Level 5 Prefix / InternalNodeMarkerPrefix / pre-computed BMP P P6 Level 6 Prefix / InternalNodeMarkerPrefix / pre-computed BMP P

60 Algorithms Performing Binary Search on Prefix Lengths (Cont.) Algorithms Complexity to provide incremental update Search performance degradation when applied to large routing date Search performance degradation when applied to IPv6 B-TrieVery low High PC-TrieMedium Low P-TrieLow Very low BSRVery highVery low BSTVery highHigh May or may not be low WBSTVery highHighMay or may not be low BST-PVVery highLowVery low BST-SPVery highHighMay or may not be low W-BSLVery highVery lowLow 60

61 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) 61

62 Algorithms Performing Binary Search on Prefix Lengths (Cont.) Binary Search on Length in a Leaf-Pushed Trie (L-BSL) 62

63 Algorithms Performing Binary Search on Prefix Lengths (Cont.) Binary Search on Length in a Leaf-Pushed Trie (L-BSL) 63

64 Algorithms Performing Binary Search on Prefix Lengths (Cont.) Binary Search on Length in a Leaf-Pushed Trie (L-BSL) Example Input : Path : 3 -> 5 -> 6 BMP : P4 Level 3 Prefix / InternalNodePrefix 1010P Level 5 Prefix / InternalNodePrefix P P P6 Level 6 Prefix / InternalNodePrefix P P3 64

65 Algorithms Performing Binary Search on Prefix Lengths (Cont.) Algorithms Complexity to provide incremental update Search performance degradation when applied to large routing date Search performance degradation when applied to IPv6 B-TrieVery low High PC-TrieMedium Low P-TrieLow Very low BSRVery highVery low BSTVery highHigh May or may not be low WBSTVery highHighMay or may not be low BST-PVVery highLowVery low BST-SPVery highHighMay or may not be low W-BSLVery highVery lowLow L-BSLVery highVery lowLow 65

66 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) 66

67 Algorithms Performing Binary Search on Prefix Lengths (Cont.) logW-Elevator Algorithm (logW-E) This algorithm constructs multiple kth-level tries for k = W/2, W/4, · · ·, 2 required to perform a binary search on levels, in addition to a PATRICIA trie. P P0 P2 P5 P4 P3 P6 67

68 Algorithms Performing Binary Search on Prefix Lengths (Cont.) logW-Elevator Algorithm (logW-E) Example I Input :

69 Algorithms Performing Binary Search on Prefix Lengths (Cont.) logW-Elevator Algorithm (logW-E) Example II Input :

70 Algorithms Performing Binary Search on Prefix Lengths (Cont.) Algorithms Complexity to provide incremental update Search performance degradation when applied to large routing date Search performance degradation when applied to IPv6 B-TrieVery low High PC-TrieMedium Low P-TrieLow Very low BSRVery highVery low BSTVery highHigh May or may not be low WBSTVery highHighMay or may not be low BST-PVVery highLowVery low BST-SPVery highHighMay or may not be low W-BSLVery highVery lowLow L-BSLVery highVery lowLow logW-EHighVery lowLow 70

71 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) 71

72 Algorithms Performing Binary Search on Prefix Lengths (Cont.) Binary Search on Lengths in Multiple Tries (BSL-MT) P P0 P2 P5 P4 P3 P6 72

73 Algorithms Performing Binary Search on Prefix Lengths (Cont.) Binary Search on Lengths in Multiple Tries (BSL-MT) 73

74 Algorithms Performing Binary Search on Prefix Lengths (Cont.) Algorithms Complexity to provide incremental update Search performance degradation when applied to large routing date Search performance degradation when applied to IPv6 B-TrieVery low High PC-TrieMedium Low P-TrieLow Very low BSRVery highVery low BSTVery highHigh May or may not be low WBSTVery highHighMay or may not be low BST-PVVery highLowVery low BST-SPVery highHighMay or may not be low W-BSLVery highVery lowLow L-BSLVery highVery lowLow logW-EHighVery lowLow BSL-MTVery lowLow in average, high in worst caseMay or may not be low 74

75 Performance 75

76 Performance (Cont.) 76

77 Performance (Cont.) 77

78 Performance (Cont.) 78

79 Conclusion Algorithms Complexity to provide incremental update Search performance degradation when applied to large routing date Search performance degradation when applied to IPv6 B-TrieVery low High PC-TrieMedium Low P-TrieLow Very low BSRVery highVery low BSTVery highHigh May or may not be low WBSTVery highHighMay or may not be low BST-PVVery highLowVery low BST-SPVery highHighMay or may not be low W-BSLVery highVery lowLow L-BSLVery highVery lowLow logW-EHighVery lowLow BSL-MTVery lowLow in average, high in worst caseMay or may not be low 79


Download ppt "Survey and Proposal on Binary Search Algorithms for Longest Prefix Match Author: Hyesook Lim, Member, IEEE, and Nara Lee, Student Member, IEEE Publisher:"

Similar presentations


Ads by Google