author: haoyu song, murali kodialam, fang hao and t.v. lakshman publisher/conf. : ieee international...

27
Author: Haoyu Song, Murali Kodialam, Fang Hao and T.V. Lakshman Publisher/Conf.: IEEE International Conference on Network Protocols (ICNP), 2009 Speaker: Han Jhen Guo Date: 2010.01.06 SCALABLE IP LOOKUPS USING SHAPE GRAPHS

Upload: avice-summers

Post on 06-Jan-2018

217 views

Category:

Documents


0 download

DESCRIPTION

INTRODUCTION - SHAPE GRAPHS Two trees are isomorphic if by switching a node’s left and right child nodes, along with the sub- trees they are rooted at, the two trees become identical  eg. There are 8 trie nodes, but there are only 4 (50%) unique isomorphic sub-trees 3 P0 P1 P3 P2 P4

TRANSCRIPT

Page 1: Author: Haoyu Song, Murali Kodialam, Fang Hao and T.V. Lakshman Publisher/Conf. : IEEE International Conference on Network Protocols (ICNP), 2009 Speaker:

Author: Haoyu Song, Murali Kodialam, Fang Hao and T.V. LakshmanPublisher/Conf.: IEEE International Conference on Network Protocols (ICNP), 2009Speaker: Han Jhen GuoDate: 2010.01.06

SCALABLE IP LOOKUPS USING SHAPE GRAPHS

Page 2: Author: Haoyu Song, Murali Kodialam, Fang Hao and T.V. Lakshman Publisher/Conf. : IEEE International Conference on Network Protocols (ICNP), 2009 Speaker:

INTRODUCTION

Find that there are significant structural, or shape, similarities between different part of a lookup trie

Exploit these similarities by using a new data structure that is called shape graphs to reduce structural redundancy, greatly improve upon the memory-efficiency of tries

2

Page 3: Author: Haoyu Song, Murali Kodialam, Fang Hao and T.V. Lakshman Publisher/Conf. : IEEE International Conference on Network Protocols (ICNP), 2009 Speaker:

INTRODUCTION - SHAPE GRAPHS Two trees are isomorphic if by switching a

node’s left and right child nodes, along with the sub-trees they are rooted at, the two trees become identical

eg. There are 8 trie nodes, but there are only 4 (50%) unique isomorphic sub-trees

3

P0

P1

P3

P2

P4

Page 4: Author: Haoyu Song, Murali Kodialam, Fang Hao and T.V. Lakshman Publisher/Conf. : IEEE International Conference on Network Protocols (ICNP), 2009 Speaker:

INTRODUCTION - SHAPE GRAPHS The transformation of the trie data structure from a

tree to a more compact graph where the compaction is accomplished using structural similarities in the trie

give each unique isomorphic sub-tree a unique id starting from 1 (The id 0 is intentionally reserved for a NULL shape)

4

10

??

Page 5: Author: Haoyu Song, Murali Kodialam, Fang Hao and T.V. Lakshman Publisher/Conf. : IEEE International Conference on Network Protocols (ICNP), 2009 Speaker:

INTRODUCTION - SHAPE GRAPHS Condensing all the trie nodes with the same

label to one graph node and removing the redundant trie branches In reality (BGP AS1221 prefixes table), has more

than 210K IPv4 prefixes 576,534 nodes but has only 48,762 (8%) unique

isomorphic trees → lower memory consumption

Too much loss of information that is inherent in the trie to perform IP lookups

5

Page 6: Author: Haoyu Song, Murali Kodialam, Fang Hao and T.V. Lakshman Publisher/Conf. : IEEE International Conference on Network Protocols (ICNP), 2009 Speaker:

INTRODUCTION - SHAPE GRAPHS Modification: construct the shape graphs with

identical sub-trees In reality (BGP AS1221 prefixes table), has more

than 210K IPv4 prefixes 576,534 nodes but has only 76,276 groups of identical

sub-trees → # of trie nodes >> # of identical subtrees > # of isomorphic subtrees

this modification still can cause a significant reduction in memory usage

6

Page 7: Author: Haoyu Song, Murali Kodialam, Fang Hao and T.V. Lakshman Publisher/Conf. : IEEE International Conference on Network Protocols (ICNP), 2009 Speaker:

SHAPE GRAPHS- COUNTING THE SHAPE AND LABELING THE TRIE

7

P1

P3

P2

P4

(1)

(2)

(2)

P0

(1) (1)

(3)

(4)

(5)1→ 2→…→ 5

counter

0→ 3shape id

00→ 2

00 →50→ 4

{1, 0}→{0, 1}→

{2, 4}→{3, 2}→

Page 8: Author: Haoyu Song, Murali Kodialam, Fang Hao and T.V. Lakshman Publisher/Conf. : IEEE International Conference on Network Protocols (ICNP), 2009 Speaker:

SHAPE GRAPHS- COUNTING THE SHAPE AND LABELING THE TRIE

terminate the trie traversal as soon as all the shape ids have been accessed

Some paths leading to a vertex may indicate valid prefixes while others may not vertex 2 actually maps to paths “0*” and “11*”, in

which “11*” is a valid prefix but “0*” is not8

P1

P3

P2

P4

(1)

(2)

(2)

P0

(1) (1)

(3)

(4)

(5)

P2

P1P3P4

P0

Page 9: Author: Haoyu Song, Murali Kodialam, Fang Hao and T.V. Lakshman Publisher/Conf. : IEEE International Conference on Network Protocols (ICNP), 2009 Speaker:

SHAPE GRAPHS- LEAF PUSHING terminating vertex

the only vertex in the shape graph that indicates all the valid prefixes, then if we reach this vertex, we know that we have matched a valid prefix and the matched prefix is implied by the walking path

only the leaf trie nodes in the original trie can indicate valid prefixes

9

Page 10: Author: Haoyu Song, Murali Kodialam, Fang Hao and T.V. Lakshman Publisher/Conf. : IEEE International Conference on Network Protocols (ICNP), 2009 Speaker:

SHAPE GRAPHS- LEAF PUSHING Leaf pushing

has the negative effect of expanding the prefix table size as well as the corresponding trie size

results in fewer shapes the corresponding shape graph is smaller contains one less vertex than before

offset of above two points for the AS1221 table, the shape graph after leaf

pushing contains 51,962 vertices, a 32% reduction compared to the shape graph before leaf pushing

10

Page 11: Author: Haoyu Song, Murali Kodialam, Fang Hao and T.V. Lakshman Publisher/Conf. : IEEE International Conference on Network Protocols (ICNP), 2009 Speaker:

SHAPE GRAPHS- LEAF PUSHING

11

P1 P0

P0 P3 P4 P2

P1nexthop

P0P2P3P4P0

{111*}→{ 00*}→

{110*}→ {01*}→{101*}→{100*}→

Page 12: Author: Haoyu Song, Murali Kodialam, Fang Hao and T.V. Lakshman Publisher/Conf. : IEEE International Conference on Network Protocols (ICNP), 2009 Speaker:

SHAPE GRAPHS- MULTI-BIT SHAPE GRAPHS For improved throughput of single-bit shape

graphs The multi-bit shape graph is derived from the

binary shape graph Multi-bit shape graph with stride of 1, 2, and

3

12

Page 13: Author: Haoyu Song, Murali Kodialam, Fang Hao and T.V. Lakshman Publisher/Conf. : IEEE International Conference on Network Protocols (ICNP), 2009 Speaker:

SHAPE GRAPHS- AVOIDING PREFIX EXPANSION Prefix expansion is unlike the multi-bit trie

where the next hop can be embedded into each trie node, the shape graph uses a hash table to store all the {prefix , nexthop} pairs

When the stride is large, the expanded prefix table would become quite large 13

Page 14: Author: Haoyu Song, Murali Kodialam, Fang Hao and T.V. Lakshman Publisher/Conf. : IEEE International Conference on Network Protocols (ICNP), 2009 Speaker:

SHAPE GRAPHS- AVOIDING PREFIX EXPANSION Maintain a 2s-bit bitmap in each vertex to

indicate which group of edges are for the same original prefix, if they lead to the terminating vertex

14

00110101 0101

0011

Page 15: Author: Haoyu Song, Murali Kodialam, Fang Hao and T.V. Lakshman Publisher/Conf. : IEEE International Conference on Network Protocols (ICNP), 2009 Speaker:

SHAPE GRAPHS- PERFORMING IP LOOKUPS eg. search IP = 11011

15

0101

0011

next vertex is NOT the terminating node → bitmap is unused

next vertex is the terminating node → use bitmap → prefix length = 2(1+1)-log22 = 3→ prefix = 110*s: stridek: traveled step → prefix length = t: consecutive 1s (or 0s) in the bitmap

P1nexthop

P0P2P3P4P4P0

{111*}→{ 00*}→

{110*}{110*}→→ {01*}→{101*}→{100*}→

Page 16: Author: Haoyu Song, Murali Kodialam, Fang Hao and T.V. Lakshman Publisher/Conf. : IEEE International Conference on Network Protocols (ICNP), 2009 Speaker:

SHAPE GRAPHS- INCREMENTAL UPDATE “lazy” deletion

simplify the operation and save memory accesses eg. delete prefix “100*”

Insertion: the route processing software works on the leaf-

pushing trie first and then modifies the shape graph and the hash table if necessary 16

P1nexthop

P0P2P3

P0

{111*}→{ 00*}→

{110*}{110*}→→ {01*}→{101*}→{100*}→

P0

P1

P3

P2

P4

Page 17: Author: Haoyu Song, Murali Kodialam, Fang Hao and T.V. Lakshman Publisher/Conf. : IEEE International Conference on Network Protocols (ICNP), 2009 Speaker:

SHAPE GRAPHS- INCREMENTAL UPDATE

17

Illustration of the shape graph updates as the new prefixes “001*” is inserted not used in lookup

but preserve

*

Page 18: Author: Haoyu Song, Murali Kodialam, Fang Hao and T.V. Lakshman Publisher/Conf. : IEEE International Conference on Network Protocols (ICNP), 2009 Speaker:

SHAPE GRAPHS- INCREMENTAL UPDATE Illustration of the shape graph updates as the

new prefixes “1100*” is inserted

18*

Page 19: Author: Haoyu Song, Murali Kodialam, Fang Hao and T.V. Lakshman Publisher/Conf. : IEEE International Conference on Network Protocols (ICNP), 2009 Speaker:

SHAPE GRAPHS- INCREMENTAL UPDATE Illustration of the shape graph updates as the

new prefixes “1111* ” is inserted

19

reused again

Page 20: Author: Haoyu Song, Murali Kodialam, Fang Hao and T.V. Lakshman Publisher/Conf. : IEEE International Conference on Network Protocols (ICNP), 2009 Speaker:

SHAPE GRAPHS- INCREMENTAL UPDATE Unused vertices should be recycled regularly

(i.e. remove the unused vertices from the memory and reuse the corresponding shape ids for new shapes) to avoid exhausting the memory if otherwise unattended

20

Page 21: Author: Haoyu Song, Murali Kodialam, Fang Hao and T.V. Lakshman Publisher/Conf. : IEEE International Conference on Network Protocols (ICNP), 2009 Speaker:

IMPLEMENT CONSIDERATIONS- FAST SHAPE GRAPH LOOKUP Deploy multiple memory blocks and spread

the graph vertices into them to improve the lookup throughput

21

Page 22: Author: Haoyu Song, Murali Kodialam, Fang Hao and T.V. Lakshman Publisher/Conf. : IEEE International Conference on Network Protocols (ICNP), 2009 Speaker:

IMPLEMENT CONSIDERATIONS- FAST SHAPE GRAPH LOOKUP Memory balance

each memory block should roughly contain the same number of vertices so the memory block size

Algorithm - min-max heuristic sort the vertices in decreasing weight order

each graph vertex is associated with a weight which indicates the probability for it to be accessed by a prefix lookup

assign each vertex in the current least weighted memory block according to the weight order; we repeat the process until all vertices are assigned 22

Page 23: Author: Haoyu Song, Murali Kodialam, Fang Hao and T.V. Lakshman Publisher/Conf. : IEEE International Conference on Network Protocols (ICNP), 2009 Speaker:

IMPLEMENT CONSIDERATIONS- EFFICIENT HASH TABLE CONSTRUCTION Assign the weight to the vertices

static scheme a vertex with weight w means there are w prefixes

passing through it

dynamic scheme keeps track the access rate of each vertex and update

their weight accordingly when a better vertex distribution is preferred, we run

the algorithm and escort the affected vertices to their new host memory blocks

23

Page 24: Author: Haoyu Song, Murali Kodialam, Fang Hao and T.V. Lakshman Publisher/Conf. : IEEE International Conference on Network Protocols (ICNP), 2009 Speaker:

PERFORMANCE EVALUATION

Number of trie nodes versus number of graph vertices the left side is for AS1221 and the right side is

for Maewest A large table AS1221 that contains 215,454 prefixes A small table Maewest that contains 27,930 prefixes

24

Page 25: Author: Haoyu Song, Murali Kodialam, Fang Hao and T.V. Lakshman Publisher/Conf. : IEEE International Conference on Network Protocols (ICNP), 2009 Speaker:

PERFORMANCE EVALUATION

Overall memory consumption comparison on two prefix tables

25

Page 26: Author: Haoyu Song, Murali Kodialam, Fang Hao and T.V. Lakshman Publisher/Conf. : IEEE International Conference on Network Protocols (ICNP), 2009 Speaker:

PERFORMANCE EVALUATION

Memory consumption for different number of memory blocks

26support k bloom filter (k prefix length); the prefixes with lengths that are not covered by the Bloom filters need to be expanded to multiple longer prefixes ← overhead!

Page 27: Author: Haoyu Song, Murali Kodialam, Fang Hao and T.V. Lakshman Publisher/Conf. : IEEE International Conference on Network Protocols (ICNP), 2009 Speaker:

PERFORMANCE EVALUATION

The number of shape graph vertices vs. the number of multi-bit trie nodes for IPv6 forwarding tables the left side is for the IPv6 BGP table (900 prefixes) and

the right side is for the synthesized IPv6 table (generate from the AS1221 IPv4 table, 215,518 prefixes)

27