A Classified Multi-Suffix Trie for IP Lookup and Update

Similar documents
Dynamic Routing Tables Using Simple Balanced. Search Trees

Routing Lookup Algorithm for IPv6 using Hash Tables

Tree, Segment Table, and Route Bucket: A Multistage Algorithm for IPv6 Routing Table Lookup

Binary Search Schemes for Fast IP Lookups

Review on Tries for IPv6 Lookups

Grid of Segment Trees for Packet Classification

Multiway Range Trees: Scalable IP Lookup with Fast Updates

Efficient Construction Of Variable-Stride Multibit Tries For IP Lookup

Parallel-Search Trie-based Scheme for Fast IP Lookup

Shape Shifting Tries for Faster IP Route Lookup

ECE697AA Lecture 20. Forwarding Tables

Shape Shifting Tries for Faster IP Route Lookup

Power Efficient IP Lookup with Supernode Caching

Fast Update of Forwarding Tables in Internet Router Using AS Numbers Λ

A Novel Level-based IPv6 Routing Lookup Algorithm

Frugal IP Lookup Based on a Parallel Search

Disjoint Superposition for Reduction of Conjoined Prefixes in IP Lookup for Actual IPv6 Forwarding Tables

Packet Classification Using Dynamically Generated Decision Trees

FPGA Implementation of Lookup Algorithms

Problem Statement. Algorithm MinDPQ (contd.) Algorithm MinDPQ. Summary of Algorithm MinDPQ. Algorithm MinDPQ: Experimental Results.

A Hybrid Approach to CAM-Based Longest Prefix Matching for IP Route Lookup

Growth of the Internet Network capacity: A scarce resource Good Service

A Memory-Balanced Linear Pipeline Architecture for Trie-based IP Lookup

Implementation of Boundary Cutting Algorithm Using Packet Classification

Lecture notes of G. Q. Maguire Jr. IK2555, Spring Module 2

Tree-Based Minimization of TCAM Entries for Packet Classification

A Multi-stage IPv6 Routing Lookup Algorithm Based on Hash Table and Multibit Trie Xing-ya HE * and Yun YANG

Efficient Packet Classification using Splay Tree Models

Scalable Lookup Algorithms for IPv6

Chapter 12 Digital Search Structures

Recursively Partitioned Static IP Router-Tables *

IP lookup with low memory requirement and fast update

Fast binary and multiway prefix searches for packet forwarding

Succinct Representation Of Static Packet Classifiers

Forwarding and Routers : Computer Networking. Original IP Route Lookup. Outline

A Pipelined IP Address Lookup Module for 100 Gbps Line Rates and beyond

Efficient hardware architecture for fast IP address lookup. Citation Proceedings - IEEE INFOCOM, 2002, v. 2, p

CS419: Computer Networks. Lecture 6: March 7, 2005 Fast Address Lookup:

THE advent of the World Wide Web (WWW) has doubled

Lecture 12: Addressing. CSE 123: Computer Networks Alex C. Snoeren

5. Classless and Subnet Address Extensions 최양희서울대학교컴퓨터공학부

DESIGN AND IMPLEMENTATION OF OPTIMIZED PACKET CLASSIFIER

Multiway Range Trees: Scalable IP Lookup with Fast Updates

Novel Hardware Architecture for Fast Address Lookups

LONGEST prefix matching (LPM) techniques have received

Scalable IP Routing Lookup in Next Generation Network

Dynamic Pipelining: Making IP- Lookup Truly Scalable

Packet classification using diagonal-based tuple space search q

Lecture 12: Aggregation. CSE 123: Computer Networks Alex C. Snoeren

AN EFFICIENT HYBRID ALGORITHM FOR MULTIDIMENSIONAL PACKET CLASSIFICATION

Organizing Spatial Data

IP Address Lookup in Hardware for High-Speed Routing

Multi-core Implementation of Decomposition-based Packet Classification Algorithms 1

PC-DUOS: Fast TCAM Lookup and Update for Packet Classifiers

CHAPTER 2 LITERATURE SURVEY

IP Forwarding. CSU CS557, Spring 2018 Instructor: Lorenzo De Carli

Trie-Based Policy Representations for Network Firewalls

Performance Improvement of Hardware-Based Packet Classification Algorithm

Midterm Review. Congestion Mgt, CIDR addresses,tcp processing, TCP close. Routing. hierarchical networks. Routing with OSPF, IS-IS, BGP-4

Design of a High Speed FPGA-Based Classifier for Efficient Packet Classification

V6Gene: A Scalable IPv6 Prefix Generator for Route Lookup Algorithm

Message Switch. Processor(s) 0* 1 100* 6 1* 2 Forwarding Table

Switch and Router Design. Packet Processing Examples. Packet Processing Examples. Packet Processing Rate 12/14/2011

Performance Evaluation and Improvement of Algorithmic Approaches for Packet Classification

Data Structure Optimization of AS_PATH in BGP

An Extended Byte Carry Labeling Scheme for Dynamic XML Data

Scalable Packet Classification for IPv6 by Using Limited TCAMs

Efficient IP-Address Lookup with a Shared Forwarding Table for Multiple Virtual Routers

ADDRESS lookup is one of the fundamental functions

Trees. Q: Why study trees? A: Many advance ADTs are implemented using tree-based data structures.

ITCT Lecture 6.1: Huffman Codes

Lecture 5: Suffix Trees

The Adaptive Radix Tree

A Scalable Approach for Packet Classification Using Rule-Base Partition

The Encoding Complexity of Network Coding

CS 268: Route Lookup and Packet Classification

B-Trees and External Memory

Fast and Scalable IP Address Lookup with Time Complexity of Log m Log m (n)

Recursive Flow Classification: An Algorithm for Packet Classification on Multiple Fields

Last Lecture: Network Layer

Journal of Network and Computer Applications

ECE697AA Lecture 21. Packet Classification

Three Different Designs for Packet Classification

Abstract We consider the problem of organizing the Internet routing tables in such a way as to enable fast routing lookup performance. We concentrate

Data Structures for Packet Classification

AN ASSOCIATIVE TERNARY CACHE FOR IP ROUTING. 1. Introduction. 2. Associative Cache Scheme

Exploiting Graphics Processors for High-performance IP Lookup in Software Routers

B-Trees and External Memory

Rules in Play: On the Complexity of Routing Tables and Firewalls

An Enhancement of Mobile IP by Home Agent Handover

Fast IP Routing Lookup with Configurable Processor and Compressed Routing Table

Optimal Routing Table Design for IP Address Lookups Under Memory Constraints

Multi-Way Search Tree

An Efficient IP Routing Lookup by Using Routing Interval

Packet Classification Using Pipelined Two-Dimensional Multibit Tries

Binary Trees, Binary Search Trees

Fast Packet Classification Algorithms

Trees. Reading: Weiss, Chapter 4. Cpt S 223, Fall 2007 Copyright: Washington State University

Fast and scalable conflict detection for packet classifiers

IP: Routing and Subnetting

Transcription:

A Classified Multi-Suffix Trie for IP Lookup and Update Sun-Yuan Hsieh and Ying-Chi Yang Department of Computer Science and Information Engineering, National Cheng Kung University, No. 1, University Road, Tainan 701, TAIWAN Abstract In this paper, a new data structure, called the classified multi-suffix trie (CMST), is proposed for designing dynamic router-tables. CMST achieves a better performance than existing data structures because each node can store more than one prefix and the longest matching prefix may be found in an internal node rather than on a leaf. Furthermore, with the classification in each node, the dynamic router-table operations can be performed efficiently. To reduce the memory requirement, we store each prefix s corresponding suffix in a CMST node, instead of storing a full binary string. Based on the CMST, we also propose another data structure, called the Partitioning Classified Multi-Suffix Trie (PCMST) to reduce the height of the trie and expedite router-table operations. Experiments using real IPv4 routing databases demonstrate that the proposed data structures are efficient in terms of memory usage and it performs well in terms of the average times of the lookup, insert and delete operations. We report the results of experiments conducted to compare the performance of the proposed data structure with that of other structures using the benchmark IPv4 prefix databases AS4637, AS6447, and AS65000 with 219,581, 296,552, and 226,847 prefixes respectively. Keywords: Classless inter domain routing, dynamic router tables, IP address lookup, longest matching prefix, multi-prefix trie, classified multi-suffix trie. 1. Introduction To continue providing good service with the rapid growth of Internet traffic, Internet routers need to offer higher link speeds, better data throughput, and faster packet forwarding rates. Since solutions for the first two requirements are already available, we focus on the third factor in this paper. IP address lookup is the key step in packet forwarding. An Internet router performs the IP lookup step in its router-table to determine the next hop of each incoming packet based on the packet s destination address. Under the classful addressing, many IP addresses are not actually in use, which leads to exhaustion of the address space; however, Classless Inter Domain Routing (CIDR) [9] provides Corresponding author. E-mail: hsiehsy@mail.ncku.edu.tw E-mail: chyi204@yahoo.com.tw The classful addressing has four address classes: A, B, and C contain 8-bit, 16-bit, and 24-bit networkaddresses respectively, and D is for multicast. Digital Object Indentifier 10.1109/TC.2011.86 1 0018-9340/11/$26.00 2011 IEEE

a way to alleviate the problem. In CIDR, the routing entries are pairs of (p/l, o), where p = p 0 p 1...p l 1 * is a prefix formed of binary bits; l is the length of p, which is at most 32 bits for IPv4 [16] and 128 bits for IPv6 [6]; and o is an output port identifier. The prefix length of CIDR is variable, so it can provide more IP addresses for use. Although implementing CIDR reduces the size of router-tables, the lookup operation becomes more complex because routers must find the longest matching prefix (LMP) instead of an exact matching. To find the LMP, the operation first compares all the prefixes in the given routing table to the destination address bit-by-bit, and then finds the longest one in the set of matching prefixes. Generally, existing IP lookup schemes can be divided into static and dynamic schemes. In static schemes, update operations are batched and the tables need to be reconstructed periodically, but that is costly in terms of time. The schemes are only suitable for routing environments in which insertion and deletion are not required; therefore, we concentrate on dynamic router-tables to support real-time instant updates. Designing router-tables based on different data structures has received a great deal of attention in recent years. Schemes based on the concept of range encoding have been proposed to transform the prefixes to a unique length to search on values only [3 5, 11, 13, 14, 18, 23]. Many trie-based data structures have also been proposed [2, 7, 8, 10, 15, 17, 19 22]. To further reduce the time required for router-table operations, we propose a novel trie-based data structure called Classified Multi-Suffix Trie (CMST) for designing dynamic router-tables. CMST avoids the above shortcomings and preserves the advantages of the data structures proposed in [10] in which each node can store more than one prefix and can return the longest matching prefix immediately when it is found in some internal node. By classifying the prefixes in each node of the CMST, the lookup or insertion operations performed on a node only need to compare the corresponding prefix instead of comparing all the prefixes. In most cases, only one additional memory access is required to select a replacement from the corresponding child node when deleting a prefix. Moreover, we can use different-sized nodes in each level to reduce the memory requirement. As a result, we use less memory in a lower level node to store a prefix because the path from root of the trie to that node can record some bits of the prefix. Based on the CMST, we also propose a data structure called the Partitioning Classified Multi-Suffix Trie (PCMST) to reduce the height of a trie and expedite router-table operations. 2

The details of the PCMST and the corresponding operations are provided in the Appendix at http://algorithm.csie.ncku.edu.tw/supp/. Note that the two proposed data structures can be applied to both IPv4 and IPv6 routing databases. The remainder of this paper is organized as follows: In Section 2, we introduce the proposed data structure, CMST. The dynamic router-table operations for the data structure are described in Section 3. Section 4 presents the results of experiments conducted to compare the proposed data structures with some existing solutions (in terms of the average lookup time and the average update time) using real IPv4 router tables. Section 5 contains some concluding remarks. Related works are presented in the Appendix at http://algorithm.csie.ncku.edu.tw/supp/. 2. The Proposed Data Structure In this section, we describe the proposed data structure for designing dynamic router-tables. The structure utilizes the Prefix Tree (PT) defined in [2] as an auxiliary sub-structure. First, we define some terms used in the remainder of this paper. For a prefix p = p 0 p 1...p l 1 *, let p = p 0 p 1...p i for 0 i l 2beasub-prefix of p. We also regard p 0 p 1...p i * as a sub-prefix of p if there is no ambiguity. In addition, let q = p j p j+1...p l 1 for 0 j l 1beasuffix of p. Note that p is also a suffix of itself. The length of a prefix p, denoted by len(p), is the number of non- symbols; for example, len(p 0 p 1...p l 1 *) = l. The level of a node v in a rooted tree, denoted by level(v), is the number of edges on the path from the root to v. 2.1. Prefix trees Each node in a prefix tree contains exactly one prefix, so the size of the prefix tree is equal to the size of the routing table. The lookup procedure for a prefix tree is similar to that of a binary trie. While doing lookup, we visit the left child when the next bit is 0 and visit the right child when the next bit is 1. During the search, we keep the LMP found currently until we reaching a leaf. Each node contains a prefix and two pointers that point to subsequent tree nodes. The length of the prefix must be greater than or equal to the level where the prefix is located. For convenience, we use PT Lookup, PT Insert and PT Delete, to represent the respective algorithms for lookup, insertion, and deletion operations in prefix trees in O(W ) time [2], where W is the length of the IP address. Note that the PT Lookup algorithm can find the LMP. 3

2.2. Classified multi-suffix tries Given a string x = x 1 x l of length l and a string y = y 1 y n of length n, the concatenation of x and y, written as x y, is the string obtained by appending y to the end of x, asinx 1...x l y 1...y n. Let b[i] be a binary string of length k, whose decimal value equals i. Any node u on a unique path from the root of a rooted tree T to v is called an ancestor of v. If u is an ancestor of v, then v is a descendant of u. (Every node is both an ancestor and a descendant of itself.) If u is an ancestor of v and u v, then u is a proper ancestor of v, and v is a proper descendant of u. Atrie is a rooted tree data structure that uses bits of prefixes to form the branches. For a node v in a multibit trie with a fixed stride k, let α v represent the string of k level(v) bits, which is obtained by concatenating the labels of the edges on the path from the root to v. Definition 1. A k-stride Classified Multi-Suffix Trie (k-cmst) contains two types of nodes, a major node (m-node) and a secondary node (s-node), which possess the following data fields and structure characteristics: D1. Each m-node v contains the following fields: (1) 0 t(v) 2 k is the number of suffixes stored in v. (2) There are 2 k fields, f 0 (v),f 1 (v),...,f 2 1(v). They are used to k store strings s 0 (v),s 1 (v),...,s 2 1(v), where each s k i (v) can be ε or a suffix, such that if s i (v) ε, then len(s i (v)) >kand α v s i (v) is a prefix containing sub-prefix α v b[i]. Field f i (v) is said to be empty if s i (v) = ε. Hereafter, for each s i (v) ε, we call α v s i (v) the original prefix of s i (v); α v s i (v) corresponds to v. (3) If s i (v) ε, then port(s i (v)) stores the output port of α v s i (v). However, if s i (v) =ε, then port(s i (v)) = 1. (4) There are 2 k fields, port 0 (v), port 1 (v),..., port 2 1(v), which are used as follows. If α v b[i] is a prefix that does not correspond to any proper ancestor of v, k then port i (v) stores the output port of prefix α v b[i] without storing prefix α v b[i]. Otherwise, let port i (v) = 1. We call port 0 (v), port 1 (v),...,port 2 1(v) the inside ports of k v. Hereafter, for each port i (v) 1, we also say prefix α v b[i] corresponds to v. (5) 0 c(v) 2 k is the number of port i (v)s with port i (v) 1. (6) s pointer(v) is a pointer that points to a prefix tree PT comprised of s-nodes, which are used to store some suffixes q with 1 len(q) < k. For convenience, the prefix tree indicated by This technique can be viewed as a classification of prefixes according to their lengths. There is another prefix 4

Figure 1: A simple representation of an m-node v s pointer(v) is called the PT of v. (7) The content of an m-node can be represented simply as (t(v),c(v),s 0 (v), port 0 (v),s 1 (v), port 1 (v),...,s 2 k 1(v), port 2 k 1(v),s pointer(v)). D2. The stride, k, is the number of bits used by an m-node to determine which branch to take. An m-node whose stride is k has 2 k children corresponding to the 2 k possible values for the k used bits. For ease of presentation, we use child 0 (v),child 1 (v),..., child 2 k 1(v) to represent 2 k children corresponding to 2 k possible values from 00 }{{...0} to 11 }{{...1}. Thus, if k =2, k k there will be four children, child 0 (v),child 1 (v), child 2 (v), and child 3 (v), corresponding to 00, 01, 10, and 11, respectively. D3. An m-node that has children is called an internal m-node, and an m-node without children is called an external m-node. D4. Let p and q be two suffixes stored in m-nodes u and v, respectively. In addition, let p be the original prefix of p and let q be the original prefix of q. Ifq is a sub-prefix of p, then level(u) < level(v). D5. Each s-node w has the following fields: (1) s(w) is the suffix stored in w. (2) Assume that w is in the PT of v; then, port(s(w)) is the output port of prefix α v s(w). (3) left(w) is a pointer indicating the left s-node of w if it exists; otherwise, the pointer is set as null. (4) right(w) is a pointer indicating the right s-node of w if it exists; otherwise, the pointer is set as null. An m-node v is set as empty if it does not contain any suffix, i.e., t(v) = 0 and c(v) =0. Figure 1 shows a simple representation of an m-node. For ease of presentation, the integers t(v) and c(v) in an m-node v are not shown in the subsequent figures. Figure 2 illustrates a 2-CMST with four m-nodes a, b, c and d, where a and b are internal m-nodes, c and d are external m- partitioning technique proposed in [12] whereby a dynamic router-table data structure can be used to store the prefixes in each partition. Based on this property, we can return the LMP as soon as we match a suffix in an m-node. 5

Prefix 001* Next-hop A 00* B 10* C 000010* D 0001* E 0011111* F 0010010* G 101* H 00111* I 00101* J 0100* K 1001* L 100* M 110* N 0010001* O 001001* P a (0011111*,F) B (01001*,K) -1 (1001*,L) C (110*,N) -1-00 01 10 11 b c (0010*,D) -1 - E (10010*,G) -1 (111*,I) -1-00 01 10 11 (1*,A) (0*,M) (1*,H) PT 1 PT 2 d (001*,O) -1 - P - -1 - -1 00 01 10 11 (1*,J) PT 3 Figure 2: A 2-CMST in which 00* and 10* correspond to a, 0001* corresponds to b, and 001001* corresponds to d nodes, and c is empty. The three dotted pointers represent s pointers, which point to three PTs, PT 1,PT 2, and PT 3, where PT 1 contains suffix 1* with the original prefix 001*; PT 2 contains suffixes 0* and 1* with the corresponding original prefixes 100* and 101*; and PT 3 contains suffix 1* with the original prefix 00101*. Note that 00111* is the original prefix of suffix 111* stored in b, and 0011111* is the original prefix of suffix 0011111* stored in a. Since 00111* is a sub-prefix of 0011111*, we have level(a) = 0 < 1 = level(b). The following proposition follows directly from the structure of k-cmsts. Proposition 1. There are at most 2 k+1 prefixes that correspond to an m-node v, and they have a common sub-prefix α v with len(α v )=k level(v). In addition, there are at most 2 k prefixes that correspond to v, and their length is k (level(v)+1). For a k-cmst T, the height of T is max{level(v) v is a node (m-node or s-node) in T }, denoted by h(t ). To traverse a path in T from the root (an m-node) to a leaf, the current m-node requires k bits to branch out to the next m-node until it arrives at the leaf. Hence, the longest path from the root to an external m-node is bound by W, where W be the length of k the IP address. Moreover, the s pointer of an external m-node may point to a prefix tree whose height is bounded by k 1. Therefore, the following lemma holds. Proposition 2. Let W be the length of the IP address and let T be a k-cmst. Then, h(t ) W k + k 1. 6

3. Dynamic router-table operations In this section, we discuss four dynamic router-table operations in a k-cmst: construction, insertion, lookup, and deletion. Examples of executing the insertion, lookup, and deletion operations are presented in the Appendix at http://algorithm.csie.ncku.edu.tw/supp/. 3.1. Construction To build a k-cmst T, we first execute the following algorithm to create an empty root node and then utilize an insertion algorithm (described in Section 3.2) to insert the original set of all prefixes in the router-table. Both algorithms incorporate an auxiliary procedure called Allocate m- node, which allocates the memory space to be used by a new m-node in O(1) time. Algorithm 1: CMST Create(T ) 1 v := Allocate m-node() 2 root(t ) := v; 3.2. Insertion operation Before describing the insertion algorithm for a k-cmst, we introduce some definitions, which are useful in our algorithms. Definition 2. Let S = {(p 0 p 1...p l 1 *,i,j) p t {0, 1} for 0 t l 1 and 0 i j l 1}. The function Get : S Z + is defined as Get(p 0 p 1...p l 1,i,j)= j r=i p r2 j r. Definition 3. Let p be a prefix and let k be an integer. The function Cut(p, k) cuts the first k bits of p and returns the suffix formed by the remaining bits. Note that the length of the returned suffix is len(p) k. For example, Get(0100000*, 0, 3) = (0100) 2 = 4 and Cut(01001*,2) = 001*, and len(001*) = len(01001* ) 2 = 3. The algorithm is presented in Algorithm CMST Insert(p,v). The initial call to insert a prefix p is CMST Insert(p, root). It is not difficult to show that Algorithm CMST Insert(p, root) can be implemented to run in O(W ) time. 3.3. Lookup operation The steps of the algorithm are detailed in Algorithm CMST Lookup(DA, v), where next hop is used to record the output port of the current best matching prefix and default route is used 7

Algorithm 2: CMST Insert(p, v) 1 if v is null then 2 v :=Allocate m-node() 3 if len(p) <kthen // p should be in the PT of v 4 u := Allocate s-node() // allocate the storage for a new s-node 5 PT Insert(p, u, s pointer(v)) 6 else // len(p) k 7 r := Get(p, 0, k 1) // get the first k bits of p 8 if len(p) =k then 9 port r (v) := the output port of p 10 else // len(p) >k 11 if f r (v) = empty then 12 s r (v) := p // store p directly 13 else // f r (v) empty 14 if len(p) >len(s r (v)) then 15 q := s r (v) 16 s r (v) := p // replace s r (v) with p 17 q :=Cut(q, k) 18 else // len(p) <len(s r (v)) 19 q :=Cut(p, k) 20 v := child r (v) 21 CMST Insert(q,v) 22 return to record the default output port. The initial call is CMST Lookup(DA, root), where root is the root of the given k-cmst. It is not difficult to show that Algorithm CMST Lookup(DA, root) runs in O(W ) time. 3.4. Deletion operation The following functions are useful to Algorithm 4 and Algorithm 5. Definition 4. Let p be a binary string and i be an integer. The function Get Bit(p, i) returns the ith bit of p. If the bit does not exist, the function returns 1. Definition 5. Let q be a prefix, and let r and k be two integers. In addition, let x be the k bits binary representation of r. The Concatenation(q, r, k) returns a binary string p = x q of length l = k + len(q). For example, Concatenation(011*, 3, 2) = 11011*. The steps of the algorithm used to obtain a replacement for the suffix s r (v) from child r (v) are detailed in Algorithm Get Replacement(r, v). 8

Algorithm 3: CMST Lookup(DA, v) 1 next hop := default route 2 while v null do 3 r := Get(DA, 0,k 1) 4 if f r (v) is non-empty and s r (v) matches DA then // LMP is Found. 5 return port(s r (v)) 6 else 7 if port r (v) 1 then 8 next hop := port r (v) 9 else // port r (v) = 1 10 next hop := PT Lookup(DA, s pointer(v)) // If no output port is found in the PT, next hop must keep its old value. 11 DA := Cut(DA, k) 12 v := child r (v) 13 return next hop The steps of the deletion algorithm are detailed in Algorithm CMST Delete(p, v). This algorithm utilizes two auxiliary procedures, Free s-node and Free m-node, which free the corresponding storage allocations of an s-node and an m-node in O(1) time. The initial call to delete a prefix p from the CMST is CMST Delete(p, root). It is not difficult to show that Algorithm CMST Delete(p, root) can be implemented to run in O( 2k W ) time. k 4. Experimental Results To evaluate our trie structures, we conducted experiments on the benchmark IPv4 prefix databases obtained from [1], as shown in Table 1. We implemented the proposed data structures as well as for other data structures (for comparison) using C++. All the experiments were performed on a 1GHz PC with a 1.25GB RAM. To compare our tries with other data structures, we select the appropriate stride k for k-cmst and k-pcmst and analyze their performance in the Appendix at http://algorithm.csie.ncku.edu.tw/supp/. We compare the proposed data structures, 4-CMST and 4-PCMST, with the following structures: a binary trie, an LC-trie [15], a modified LC-trie [17], a prefix tree [2], a Dynamic Tree BitMap (DTBM) [20], a PLPFST [24], a Fixed-Stride Trie (FST) [19], k-mpt [10], and k- IMPT [10]. For the multi-bit trie-based structure, we adopted the k-fst, a fixed-stride trie with level k. We applied Sahni and Kim s algorithm [19] to compute the cost and the best strides of 9

Algorithm 4: Get Replacement(r, v) 1 u := child r (v) 2 i := 0 3 flag := 0 4 if t(u) > 0 then 5 while flag =0do 6 if f i (u) is non-empty then 7 z := s i (u) 8 flag := 1 9 else 10 i := i + 1 11 else if c(u) > 0 then 12 while flag =0do 13 if port i (u) 1 then 14 z := b[i] // get the suffix of port i (u) and store it in z 15 flag := 1 16 else 17 i := i + 1 18 else // get the replacement from the PT of u 19 u := s pointer(u) 20 z := s(u) 21 while u null do 22 if len(s(u)) >len(z) then 23 z := s(u) 24 if Get Bit(z,i)=0then 25 u := left(u) 26 else if Get Bit(z,i)=1then 27 u := right(u) 28 else // Get Bit(z,i)= 1 29 if u is not a leaf node then 30 u := any child of u // For ease of implementation, we can select the first child of u for further processing. 31 32 else // u is a leaf node 33 u := null 34 i := i + 1 35 return z 10

Algorithm 5: CMST Delete(p, v) 1 if v is null then 2 output p is not found 3 if len(p) <kthen // p is in the PT of v 4 PT Delete(p, s pointer(v)) 5 Free s-node 6 if v is empty and s pointer(v) = null then 7 Free m-node(v); 8 else // len(p) k 9 r := Get(p, 0, k 1) 10 if len(p) =k then 11 port r (v) := 1 12 c(v) := c(v) 1 13 if v is empty and s pointer(v) = null then 14 Free m-node(v) 15 else // len(p) >k 16 if s r (v) = p then // p is found 17 s r (v) := ε 18 if child r (v) null then // select a replacement from child r (v) 19 q := Get Replacement(r, v) 20 s r (v) := Concatenation(q, r, k) 21 v := child r (v) 22 CMST Delete(q, v) 23 else // child r (v) = null 24 t(v) := t(v) 1 25 if v is empty and s pointer(v) = null then 26 Free m-node(v) 27 else // p is not in v 28 v := child r (v) 29 q := Cut (p, k) 30 CMST Delete(q, v) 31 return Table 1: The three BGP routing tables used in the experiment Database AS4637 AS6447 AS65000 date(year.month) 2007.11 2009.07 2010.04 # prefix 219,581 296,552 226,847 11

Table 2: The Average Tree Height and Storage Comparison of Different Data Structures Avg. Tree Height Storage (KB) Data Structure AS4637 AS6447 AS65000 AS4637 AS6447 AS65000 Binary Trie 32 32 32 2558 3698 2772 LC-Trie 14 12 12 3847 5744 4383 Modified LC-Trie 14 12 12 3847 5744 4383 Prefix Tree 29 32 28 1233 1665 1274 DTBM 10 10 10 24654 32956 23309 PLPFST 13.91 15.07 14.52 1339 1804 1380 5-FST 5 5 5 3044 4549 3790 4-MPT 9 10 10 3312 4514 3393 4-IMPT 7.68 8.04 8.05 3499 4773 3640 4-CMST 10 10 10 3370 4458 3801 4-PCMST 6.27 6.41 6.45 3372 4444 3805 k-fst for 2 k 7. In our experiment, the storage requirements of 2-FST and 3-FST are too large, so we consider 4 k 7. Although the storage requirement of 5-FST is not the smallest, the trie has the best average lookup time and a reasonable storage requirement. Therefore, we compare 5-FST with the proposed data structures. For LPFST and PLPFST, the performance of PLPFST is much better than that of LPFST; hence, we only compare PLPFST with the proposed data structures. For k-mpt and k-impt, based on the three router databases, we compare the average lookup and update times for different k and m, where k is the stride and m is the maximum number of prefixes stored in a node [10]. In the experiment, both k-mpt and k-impt achieve a better performance with k = 4. We select m = k for 4-MPT and m = k +2 for 4-IMPT because their lookup and update times are better than other choices of m. First, we compare the average tree height and storage requirement of different data structures when implementing the three router databases, as shown in Table 2. Note that, because the height of 4-CMST (4-PCMST) is less than that of most data structures, fewer memory accesses are required for dynamic router-table operations. Although the height of 4-CMST (4-PCMST) is not the smallest, it achieves a better performance in terms of router-table operations (We discuss this aspect in detail in a later paragraph). The binary trie, LC-trie, Modified LC-trie, DTBM, and 5-FST use dummy nodes to handle the storage requirement, which increases the storage costs substantially. However, the size of each node in the binary trie and 5-FST is smaller than that in 4-CMST and 4-PCMST; as a result, their storage requirement is not larger. In contrast, the LC-trie, Modified LC-trie, and DTBM use larger nodes as well as dummy nodes, so their storage requirements are larger than those of 4-CMST and 4-PCMST. Because each memory access requires a great deal of time, the number of memory accesses affects the operating time. The operations on each node also affect the operating time. We compare the average lookup time and the number of memory accesses required for different data 12

structures in Table 3. Note that both 4-CMST and 4-PCMST require fewer memory accesses than the other data structures, except for 5-FST, which implies that their lookup times are shorter than those of the other data structures. One key reason is that our data structures may return the LMP when it is found in an internal node without going to a leaf to return it. Even though 4-MPT and 4-IMPT have the above feature, they need to compare all the prefixes in each visited p-node and often search the corresponding secondary structure, which increases the number of memory accesses required for lookup operations. In contrast, the proposed 4-CMST and 4-PCMST only need to compare one prefix in each node and may only need to read the inside port instead of searching the whole secondary structure. Therefore, they require fewer memory accesses for lookup operations. In addition, the more complex operations of 4-MPT and 4-IMPT increase the lookup time. Similarly, 5-FST requires more time to perform lookup operations, even though it needs fewer memory accesses than 4-CMST and 4-PCMST. The reason is that when a node is visited in the 5-FST, the corresponding stride must be read in order to go to the next node. The lookup procedure of PLPFST can also terminate in some internal node and it performs a simple lookup procedure. The lookup time is as good as 4-PCMST. However, the number of memory accesses of PLPFST is larger than the proposed data structures. Table 3: Comparison of the Lookup Time and Number of Memory Accesses for Different Data Structures Avg. Lookup Time (# Clock Cycles) Avg. # Memory Accesses Data Structure AS4637 AS6447 AS65000 AS4637 AS6447 AS65000 Binary Trie 5688 5039 4848 21.65 19.10 18.33 LC-Trie 6635 6886 6916 10.94 11.97 12.17 Modified LC-Trie 7398 6728 6785 7.87 7.39 7.35 Prefix Tree 6071 5567 5355 20.64 18.83 18.19 DTBM 6971 6258 6026 7.47 6.62 6.35 PLPFST 2842 3188 2986 9.16 11.38 10.97 5-FST 4777 4963 4796 3.06 2.02 1.87 4-MPT 4767 6313 6125 6.78 9.34 8.93 4-IMPT 4643 6464 6335 6.00 8.89 8.55 4-CMST 3995 3979 4351 4.23 4.43 4.43 4-PCMST 2990 3128 3101 4.39 4.53 4.64 The performance comparison of the update operations is shown in Table 4. In the experiments, we insert 5,000 prefixes into, and delete 5,000 prefixes from, each of the three router databases. We only compare the update operation with different dynamic data structures. Since the LC-trie, modified LC-trie, and FST are static, the whole table must be reconstructed when inserting or deleting a prefix; hence, we exclude the above three data structures from the comparison. The experimental results show that both 4-CMST and 4-PCMST require shorter update times than most of other structures. Although PLPFST has a simple update procedure, it still needs more time than 4-PCMST to perform updating because the number of memory accesses of PLPFST 13

Table 4: Performance Comparison of Update Operations under Different Data Structures Avg. Update Time (# Clock Cycles) Avg. # Memory Accesses Data Structure AS4637 AS6447 AS65000 AS4637 AS6447 AS65000 Binary Trie 5042 6877 6792 15.27 20.83 21.92 Prefix Tree 4996 6142 6130 15.22 20.56 20.84 DTBM 4359 6915 6844 5.94 9.05 8.90 PLPFST 2986 5800 5895 8.14 14.73 14.41 4-MPT 4462 6313 8197 5.51 9.83 9.87 4-IMPT 4497 8224 8133 5.54 10.2 10.24 4-CMST 4276 5825 5925 5.47 5.75 5.87 4-PCMST 2759 4481 4549 4.67 5.23 5.29 is larger that of 4-PCMST. Since the binary trie may insert or delete the longest prefix, the number of memory accesses is 32 for IPv4 (and 128 for IPv6). Moreover, the number of memory accesses for the prefix tree is almost the same as that for the binary trie. This is because, in both structures, the insertion and deletion of many routing entries in the router databases often follow a downward path from the root to leaves in order to execute the operations. Therefore, the update times of the binary trie and prefix tree are longer than those in our data structures. Although DTBM possesses the same height as 4-CMST, it requires more memory accesses for update operations because most updates in 4-CMST can be completed on nodes in higher levels. Note that, since 4-PCMST has the properties of 4-CMST and its height is shorter than that of DTBM, both 4-CMST and 4-PCMST require fewer memory accesses and shorter update times than DTBM. Furthermore, because 4-CMST (4-PCMST) requires fewer memory accesses to select a replacement when deleting a prefix, it requires fewer memory accesses for update operations than 4-MPT and 4-IMPT. In addition, with the aid of simple operations on each node, the update time of 4-CMST and 4-PCMST is much shorter than that of 4-MPT and 4-IMPT. 5. Concluding Remarks We have developed two novel data structures, CMST and PCMST, for designing dynamic router tables. The experimental results based on three router databases show that the proposed data structures can achieve faster average lookup and update times. Moreover, CMST and PCMST do not need to compare all the prefixes in each visited node when inserting a prefix or performing lookup; and they may only need one additional memory access to select a replacement when deleting a prefix from an m-node. The structures do not contain dummy nodes and they utilize a technique that stores suffixes instead of prefixes in nodes; hence, they require less storage. In our future work, we will try to reduce the memory requirement while preserving the fast lookup 14

and update operations. References [1] BGP Table obtained from http://bgp.potaroo.net/. [2] M. Berger, IP lookup with low memory requirement and fast update, in Proceedings of IEEE High Performance Switching and Routing, pp. 287 291, Jun. 2003. [3] Y. K. Chang, Y. C. Lin, and C. C. Su, Dynamic multiway segment tree for IP lookups and the fast pipelined search engine, IEEE Transactions on Computers, vol. 59, no. 4, pp. 492 506, Apr. 2010. [4] Y. K. Chang and Y. C. Lin, Dynamic segment trees for ranges and prefixes, IEEE Transactions on Computers, vol. 56, no. 6, pp. 769 784, Jun. 2007. [5] Y. K. Chang, Simple and fast IP lookups using binomial spanning trees, Computer Communications, vol. 28, no. 5, pp. 529 539, Mar. 2005. [6] S. Deering and R. Hinden, Internet protocol version 6 (IPv6) specification, RFC 1883, Dec. 1995. [7] M. Degermark, A. Brodnik, S. Carlsson, and S. Pink, Small forwarding tables for fast routing lookups, in Proceedings of ACM SIGCOMM Computer Communication Review, pp. 3-14, 1997. [8] W. Eatherton, G. Varghese, and Z. Dittia, Tree bitmap: hardware/ software IP lookup with incremental updates, in Proceedings of ACM SIGCOMM Computer Communication Review, 34, 2, Apr. 2004. [9] V. Fuller, T. Li, J. Yu, and K. Varadhan, Classless inter-domain routing (CIDR): an address assignment and aggregation strategy, RFC 1519, Sep. 1993. [10] Sun-Yuan Hsieh, Yi-Ling Huang, Ying-Chi Yang, Multi-Prefix Trie: a New Data Structure for Designing Dynamic Router-Tables, IEEE Transactions on Computers, vol. 60, no. 5, pp. 693 706, May 2011. [11] B. Lampson, V. Srinivasan, and G. Varghese, IP lookups using multiway and multicolumn search, IEEE/ACM Transactions on Networking, vol. 7, no. 3, pp. 324 334, Jun. 1999. [12] H. Lu, K. S. Kim, and S. Sahni, Prefix and interval-partitioned dynamic IP router-tables, IEEE Transactions on Computers, vol. 54, no. 5, pp. 545 557, May 2005. [13] H. Lu and S. Sahni, A B-tree dynamic router-table design, IEEE Transactions on Computers, vol. 54, no. 7, pp. 813 824, Jul. 2005. [14] H. Lu and S. Sahni, Enhanced interval trees for dynamic IP router-tables, IEEE Transactions on Computers, vol. 53, no. 12, pp. 1615 1628, Dec. 2004. [15] S. Nilsson and G. Karlsson, IP-address lookup using LC-trie, IEEE Journal on selected Areas in Communications, vol. 17, no. 6, pp. 1083 1092, Jun. 1999. [16] J. Postel, Internet protocol darpa internet program protocol specification, RFC791, Sep. 1981. [17] V. C. Ravikumar, R. Mahapatra, and J. C. Liu, Modified LC-trie based efficient routing lookup, in Proceedings of the 10th IEEE International Symposium on Modeling, Analysis, and Simulation of Computer and Telecommunications Systems (MASCOTS), pp. 177 182, Oct. 2002. [18] S. Sahni and K. S. Kim, An O(log n) dynamic router-table design, IEEE Transactions on Computers, vol. 53, no. 3, pp. 351 363, Mar. 2004. [19] S. Sahni and K. S. Kim, Efficient construction of multibit tries for IP lookup, IEEE/ACM Transactions on Networking, vol. 11, no. 3, pp. 650 662, 2003. [20] S. Sahni and H. Lu, Dynamic tree bitmap for IP lookup and update, in Proceedings of the Sixth International Conference on Networking, pp. 79 84, 2007. [21] K. Sklower, A tree-based packet routing table for Berkeley unix, in Proceedings of Winter Usenix Conference, pp. 93 99, 1991. [22] V. Srinivasan and G. varghese, Fast address lookups using controlled prefix expansion, ACM Transactions on Computer Systems, vol. 17, no. 1, pp. 1-40, 1999. [23] P. R. Warkhede, S. Suri, and G. Varghese, Multiway range tree: scalable IP lookup with fast updates, Computer Network, vol. 44, no. 3, pp. 289 303, Feb. 2004. [24] L. C. Wuu, T. J. Liu, and K. M. Chen, A longest prefix first search tree for IP lookup, Computer Network, vol. 51, Issue 12, pp. 3354 3367, Aug. 2007. 15