IP Address Lookup - IEEE Xplore

3 downloads 328 Views 874KB Size Report
Index Terms— Longest Prefix Matching, Binary Prefix Tree,. Binary Search, Leaf Pushing, Disjoint Prefix Tree. I. Introduction. In early days of the Internet, ...
Binary Search in a Balanced Tree for IP Address Lookup Hyesook Lim*, Wonjung Kim*, and Bomi Lee** *DepaTtment of Information Electronics, Ewha W. University, Seoul, Korea **Digital media research center, MCT Group, LG Electronics, SeouI, Korea E-mail: [email protected] ,4bstrucr- IP address lookup provides forwarding decision based on incoming packet's destination address. Due to the rapid growth o l the internet traffic, IP address lookup became a bottleneck in the Internet routers since it should be performed in wire-speed on packet-by-packet basis. It has been required efficient algorithms and architectures for IP address lookup in terms of lookup performance, memory size requirement, scalability, and update. In this paper, we propose an IP address lookup architecture which shows very good performance in search speed while requires a single smsll-size memory. In the proposed architecture, using leaf pushing, each of the prefixes becomes disjoiut, and the disjoint prefix set constructs a balanced tree that exploits outstanding storage efficiency. The proposed scheme performs binary search on the routing tobIe, in which each of prefixes is stored in ascending order. By confining the binary search space using f i s t 8 bits of prefix, the proposed architecture also improves the search performance greatly. Performance evaluation results show that the proposed scheme requires a single 266.6 KFSyte SRAM to store about 41000 routing entries, and an address lookup is achieved by 10.4 memory accesses in average.

Index Terms- Longest Prefix Matching, Binary Prefix Tree, Binary Search, Leaf Pushing, Disjoint Prefix Tree

I. INTRODUCTION

nearly days of the Intemet, a classful addressing scheme has been used, and the prefix length of internet protocol (IP) address is 8, 16, or 24 bits fixed. However, due to the fixed fength of prefixes in this scheme, address space was not efficiently used, and hence IP address got rapidly exhausted. The dassful addressing scheme also has an issue that routing table is expanded exponentially. In order to solve the problems, classless inter-domain routing (CIDR') was deployed. The CIDR allows not only efficient usage of address space but also address aggregation which prevents routing table from massively growing. On the other hand, since incoming packets do not carry the information of the prefix length of the packets, routers should perform the longest prefix match in order to find out the most specific route. In other words, routers need to search the space of all prefix lengths and determine the longest matched prefix [ 11. Efficient algorithms and architectures for IP address lookup in terms of search speed, memory size, update, and scalability toward IPv6 are accordingly required

I

PI. 0-7803-8924-7/05/$20.00 ( ~ ) 2 0 0 5IEEE.

490

In this paper, we propose a software-based address lookup structure based on binary search that achieves high speed in lookup performance while requiring a small-size memory, In the proposed scheme, a routing table is constructed as a single balanced tree and stored into a memory very efficiently. IP address lookup is performed by binary search on the routing table. The rest of this paper is organized as follows. In section 11, related works are briefly summarized. Section 111 presents our proposed architecture. Section IV shows simulation results using real database and performance comparison with related works. Brief conclusions are provided in Section V.

n.

RELATED "ORKS

For the prefix samples shown in Table 1 , Figure I shows a binaIy trie representing prefixes stored in a routing table. Binary trie is a tree-based structure which is simple and easy to update. But it wastes memory space due to un-assigned internal nodes, and the depth is proportional to the maximum length of prefixes. In an attempt to improve the drawbacks, various schemes have been proposed. Path-compressed trie is to remove un-assigned single-child nodes, multibit trie is to compare multiple bits with a single memory access, and level-compressed t i e is to combine the path-compressed trie and the multibit trie [I]. Nevertheless, these schemes have a shortcoming that they do not completely remove un-assigned intemal nodes. As a software-based scheme, Lulea scheme [3] is to represent a large forwarding table in a compact form, but it also has a drawback that incremental update of routing table is not possible because of complex pre-processing. Waldvogel et ai 141 proposed to use a binary search on prefix length and hashing on prefix value. However, it has to be pre-computed and stored best matching prefixes and markers indicating the existence of longer prefixes in each entry. Moreover, the scheme is not practical since it assumes to find out a perfect hash function for a given prefix 'distribution. By encoding prefixes as two full-length bit strings and sorting them, binary search on ranges [5] performs the binary search on a pre-computed routing table. It is a very good scheme which achieves binary search for longest prefix match, but it requires the pre-computation of the best matching prefix in each entry as well as it doubles the number of routing entries.

TASLE

E

1 SAMPLE PREFIXES I

I

I

11010011

d e f f.

h 1

j k m

r

0l10001101 0110010101 0ll001101 0110100000 0111 100 10101 101 1 I1000 11001

S

I

11011 1 1 1000110 I 1 101 101

I1

1111

V

00000001 0000001 000OOl 00001 000 I 1010I

W

X

Y z

U

Figure 2 Yazdani’s Tree

111.

Yazdani et al. 161 recently proposed a new tree-based structure which does not include any un-assigned internal nodes, and hence this scheme completely eliminates the redundant space. Yazdani’s tree is shown in Figure 2 for the prefix samples in Table 1. By making several definitions which allow comparisons between prefixes of different lengths, they achieved IP address lookup using the binary search. The only problem of this scheme is that the constructed tree is unbalanced, and hence tree depth is proportional to the maximum length of prefixes rather than the number of prefixes. In order to improve the lookup performance by shortening the depth of the Yazdani’s tree, weighted binary prefix tree (WBPT)[7] defines the number of prefixes belonging to each enclosure (including the enclosure itself) as the weight of the enclosure and constructs a more balanced tree by considering the weight of each prefix. The depth of WBPT is very close to the completely balanced tree and results in reduced number of worst case memory accesses compared to Yazdani’s tree. However, since it fails to construct a completely balanced tree, and hence each node needs to store pointers locating its children, it does not improve the performance in required memory size. In this paper, we propose a balanced tree structure using leaf pushing which requires the small size of memory. Since the constructed tree is a balanced tree in the proposed scheme, the binary search for an address lookup is efficiently performed using memory indices rather than pointers to children. By confining the search space using range table, the proposed scheme further improves the search performance significantly.

PROPOSED ARCHITECTURE

A. LeufPusliSg As an input address can be matched to multiple nodes in a trie, search should be continued to reach a leaf node. In order to

find out the most specific route without applying the longest prefix matching, leaf pushing [SI is introduced. Leaf pushing removes prefixes in internal nodes by pushing down to leaves, and hence prefixes are transformed into a set of disjoint prefixes. New leaves inherit the forwarding information from their ancestors, and input addresses are matched with a single leaf. Figure 3 and Figure 4 show an example binary trie and its leaf-pushed trie, respectively. Prefixes a1 and a2 inherit the forwarding infomation from prefix a, and the prefix d l inherits the forwarding information from prefix d. For example, if 010100 is searched, while the prefix d (010*) is selected as the longest matched prefix between matched two prefixes, a (O*) and d (01 0*) in Figure 3, the input is matched to one prefix 0 101* (dl) in Figure 4. A

Figure 3 Binay Trie

Figure 4 Disjoint-PrefixBinary Trie

Figure I Binaly Trie

--

-

0-7803-8924-7/05B20.00 (~)2005IEEE.

B. Disjoint Prefl Tree We propose a new structure, disjoint prefix tree (DPT). For the prefix samples shown in Table 1, an enclosure prefix a (OOO*) is pushed to leaves as shown in Figure 5 in order to convert the prefixes into a disjoint set of prefixes. Figure 6 shows the proposed DPT using the disjoint set of prefixes. In 491

constructing the proposed tree, one of Yazdani's definitions [6] for the comparison of prefixes of different lengths is used as follows.

D.Searching The proposed scheme consists of disjoint prefixes only. Hence, once a matched prefix is found, search is completed. Search starts from the range table. Using the first 8bits of incoming destination address as the index of the range table, we first have the search space of the main table. Binary searches are performed to find out a matched prefix in the confined search space. If we have a matched prefix, its forwarding information is returned and the search is completed. Likewise, if there is no match in the search space, the search is completed and the default forwarding information is returned. For the example routing table shown in Figure 7, for the incoming address of 00011000, the first 3 bits are 000, and hence the search space is between 0 and 10 in the main table. As a result of the binary search, we have a match with 0001 1OO*. Hence search is completed with 0001100* and its forwarding infomation is returned.

Definition For two prefixes, A=aIa2...a, and B=bibz...b,, where a, and b, are 0 or 1 for all i s andjs, assuming n