160 likes | 171 Views
This paper presents an efficient binary search algorithm for IP address lookup in Internet routers. It introduces a perfectly balanced search algorithm based on a binary search tree, providing excellent search performance and scalability for large routing tables.
E N D
IP Address Lookup for Internet Routers Using Balanced Binary Search with Prefix Vector Author: Hyesook Lim, Hyeong-gee Kim, Changhoon Publisher: IEEE TRANSACTIONS ON COMMUNICATIONS 2009 Presenter: Chen-Yu Chang Date: 2009/4/22
Outline • Introduction • Proposed algorithm • Performance
Introduction • We propose an efficient binary search algorithm for IP address lookup in the Internet routers. • We propose a perfectly balanced search algorithmbased on the binary search tree. • It provides excellent search performance and scalability toward large routing tables.
Outline • Introduction • Proposed algorithm • Performance
Proposed algorithm(1/9) • To construct a balanced binary search tree, we remove the prefix nesting relationship of nodes in the binary search tree and make each node hold a prefix vector containing the nesting information. • Definition: • Pl:Leaf prefixes of the binary trie. • Ex:P0,P1,P3, P4 or P7
Proposed algorithm(2/9) • What is the prefix vector? Prefix vector is composed of n(Pl) elements: V = [v1, v2,…,vn(Pl)] , if S(Pl, k) = Pi for k = 1, …, n(Pl), vk = Yi where Yi is the output port. If there is no Pisuch that S(Pl, k) = Pi , vkis a null element and is represented as ø. • Ex:The prefix vector of P4 is [Y2, ø, ø, Y5, ø, Y4]
Proposed algorithm(4/9) • Building the routing table of the proposed algorithm has two steps: • First:A prefix vector is constructed for each leaf prefix of the binary trie. • Second:Leaf prefixes with a prefix vector are sorted in the ascending order and stored into a memory array.
Proposed algorithm(3/9) • Since each leaf prefix is free from nesting, the restriction coming from the prefix nesting relationship in building the binary search tree is not applied. • The number of entries in the proposed algorithm is smaller than the actual number of routing prefixes.
Proposed algorithm(5/9) • Search algorithm • V(u) be the prefix vector of a node u. • P(u) be the leaf prefix stored at the node u. • K∗ represent the best matching prefix length. • O∗ represent the corresponding output port of the BMP.
Proposed algorithm(6/9) • Ex: 1111100 1110101 K*:0 K*:1 K*:5 K*:1 K*:3 O*:default O*:Y2 O*:Y7 O*:Y2 O*:Y6
Proposed algorithm(7/9) • Update • In inserting or deleting a prefix, we searching both the start point and the end point, we can narrow down the range affected by the change. • If the start and the end are the same, by examining one entry up or down, we can find out the longest prefix of a new entry or an obsolete entry, and hence we can handle the required prefix vector.
Proposed algorithm(8/9) • Assume W=7 • Ex:Insert 110* start:1100000 end:1101111 • Ex:Insert 111110* start:1111100 end:1111101 • Ex:Delete 1* start:1000000 end:1111111
Proposed algorithm(9/9) • Search complexity:O(logN) • Space complexity:O(WN) • Update complexity:O(2 logN + α) • α is the number of linear searches for entries in the affected range.
Outline • Introduction • Proposed algorithm • Performance and discussion
Performance(1/2) • Table I shows that the proposed algorithm is effective for large routing tables and hence provides good scalability.