Title: Scalable, Memory Efficient, HighSpeed IP Lookup Algorithms
1Scalable, Memory Efficient, High-Speed IP Lookup
Algorithms
- Rama Sangireddy,
- Natsuhiko Futamura,
- Srinivas Aluru,
- Arun K. Somani
IEEE/ACM TRANSACTIONS ON NETWORKING, AUGUST 2005
2Outline
- Introduction
- Elevator-Stairs Algorithm
- logW-Elevator Algorithm
- Results and Analysis
3Introduction
- Since the introduction of Classless Inter Domain
Routing (CIDR) in 1993, the IP address lookup
mechanism has been designed based on the longest
prefix matching (LPM) algorithm. - when the IPv6 routing protocol is introduced
where the address length is 128 bits, the problem
of routing millions of communication packets
every second, based on longest prefix matching,
becomes a labyrinth. - IP routing tables are expanding in both the
dimensions, i.e., address length and number of
prefixes.
4Introduction
- we present two algorithmsElevator-Stairs
algorithm and logW-Elevators algorithm. - Elevator-Stairs algorithm provides a search time
of O(W/k k), update time of O(W/k k 2k),
while requiring only O(N) memory. - logW-Elevators algorithm performs lookup in
O(logW) time, update in O(N) time and requires
O(NlogW) memory.
5Elevator-Stairs Algorithm
- Basic Concept
- Elevator-Stairs algorithm is similar to a
scenario wherein a tall building has an elevator
that stops only at certain intermediate floors. A
passenger desiring to reach any floor from the
topmost floor of the building can take the
elevator up to the nearest possible upper floor
and then reach the destination floor by taking
the stairs.
6Elevator-Stairs Algorithm
7Elevator-Stairs Algorithm
- Build binary trie.
- The space required for a binary trie is O(NW)
where N is the number of strings and W is the
maximum length of a string. - The space can be reduced to O(N) by compressing
each maximal nonbranching path into one edge,
which called PATRICIA trie.
8Elevator-Stairs Algorithm
- path label of a path in PATRICIA trie is the
concatenation of edge labels along the path. - string depth of a node is the length of the path
label from the root to the node. - level l in a PATRICIA trie to be the set of all
the nodes that are at string depth l.
9Elevator-Stairs Algorithm
10Elevator-Stairs Algorithm
- IP lookup using PATRICIA trie takes O(W) time in
the worst case. - This run time complexity can be improved by
leaping multiple bits at once.
11Elevator-Stairs Algorithm
- The Elevator-Stairs algorithm uses hash tables
with multiple bits as a key to skip multiple
levels of the PATRICIA trie. - We call this structure the kth-level-tree.
12Elevator-Stairs Algorithm
- For all the edges that cross a k-level, a
nonbranching node is created at the k-level so
that the node can be indexed in the
kth-level-tree. - Each node in kth-level-tree at string depth ik
has a pointer to the corresponding node in the
PATRICIA trie, and a hash table H(u) that stores
pointers to all the nodes at string depth (i1)k
in the subtrie of PATRICIA trie with u as the
root node.
13Elevator-Stairs Algorithm
- The key for a pointer stored in the hash table is
obtained by the concatenation of edge labels
between u and the corresponding node. - Each node in the kth-level-tree at string depth
keeps a copy of the next hop port (NHP) of the
corresponding node in the PATRICIA trie.
14Elevator-Stairs Algorithm
15Elevator-Stairs Algorithm
16Elevator-Stairs Algorithm
- Optimal Complexity of Multiple Metrics
- Going through each level takes constant time
provided hash table lookup takes constant time,
and hence the total search time is O(W/k k),
which is minimized when k O(vW) and achieves a
search time of O(vW).
17Elevator-Stairs Algorithm
- The memory required for storing the
kth-level-tree is O(NW/k) since O(N) edges may
cross multiple k-levels and many nonbranching
nodes may be created in the PATRICIA trie. - The memory space can be reduced to O(N).
18Elevator-Stairs Algorithm
- Update of Address Lookup Data Structure
- There are two cases of insertion
- a) the prefix that needs to be inserted forms a
new leaf in the PATRICIA trie - b) the inserted prefix does not form a new leaf
and in that case the structures of the PATRICIA
tree and the kth-level-tree do not change.
19Elevator-Stairs Algorithm
- In case (a), a new leaf is attached to the tree
at the point where the search ends. - If the edge to the leaf crosses a k-level, a new
node is created on this edge at that level in the
PATRICIA trie. - A node in kth-level-tree is also created to
represent the new node in PATRICIA trie, - A pointer to the new node is added to the hash
table in its ancestor in the kth-level-tree.
20Elevator-Stairs Algorithm
- In case the hash table becomes full, the hash
table size is doubled and all the elements are
rehashed. - This results in an amortized constant time per
insertion. - Update takes search_time O(1)
- O(W/k k) amortized time.
21Elevator-Stairs Algorithm
- In case (b), there are no changes in the
structure of the PATRICIA trie, but the new port
number must be copied to the nearest kth-level
below the updated node in kth-level-tree. - This insertion takes search_time O(2k)
- O(W/k k 2k) time.
- The procedure for deletion of a prefix occurs in
the same way as insertion.
22Elevator-Stairs Algorithm
23Elevator-Stairs Algorithm
24logW-Elevator Algorithm
- For IP address lookups, the algorithm contains
kth-level-trees for k (W/2), (W/4), , 2, in
addition to the PATRICIA trie. - the total space required is O(NlogW) since each
kth-level-tree consumes O(N) space.
25logW-Elevator Algorithm
26logW-Elevator Algorithm
- If the node at level W/2 does not have an edge
starting with (W/21)th bit of p, the longest
match in PATRICIA trie is found. - If the node at level W/2 has an edge starting
with (W/21)th bit of p, search should finish
between level (W/21) and level W. - If there is no hash table entry with p1W/2 as
key, the search must finish between levels 1 and
W/2.
27logW-Elevator Algorithm
28logW-Elevator Algorithm
29logW-Elevator Algorithm
- Optimal Complexity of Multiple Metrics
- IP address lookup can be performed in O(logW)
time using a memory space of O(NlogW).
30logW-Elevator Algorithm
- Update of Address Lookup Data Structure
- There exist, again, two cases for insertion
- a) the prefix that needs to be inserted forms a
new leaf in the PATRICIA trie, - b) the inserted prefix does not form a new leaf
in the PATRICIA trie and in that case the
structures of the PATRICIA tree and the
th-level-tree do not change.
31logW-Elevator Algorithm
- In case (a), a new edge is created in the
PATRICIA trie and all the kth-level-trees that
have a level crossing the edge to the newly
created leaf may be modified. - Modification of each kth-level-tree takes
amortized constant time, considering the
occasional doubling of the hash tables. - Total modification consumes search_time O(logW)
O(logW) time.
32logW-Elevator Algorithm
- In case (b), a modification of a port number has
to be copied to the descendant nodes that do not
have a port number assigned. - This may take search_time O(N) O(N) time.
33logW-Elevator Algorithm
34logW-Elevator Algorithm
35Results and Analysis
36Results and Analysis
37Results and Analysis
38Results and Analysis
- 97.34 of time update occurs at leaf nodes of
PATRICIA trie. In that scenario, the
logW-Elevators algorithm can update in O(logW)
time, while the Elevator-Stairs algorithm can
update in O(W/k k) time.
39(No Transcript)