Small Forwarding Tables for Fast Routing Lookups

27
Presenter: Shin, Byoungheon

description

A brief review of the paper "Small Forwarding Tables for Fast Routing Lookups" in computer networks

Transcript of Small Forwarding Tables for Fast Routing Lookups

Page 1: Small Forwarding Tables for Fast Routing Lookups

Presenter: Shin, Byoungheon

Page 2: Small Forwarding Tables for Fast Routing Lookups

Introduction Routing and Forwarding tables Design goals and parameters Data Structure Performance measurements Scaling Conclusion

Page 3: Small Forwarding Tables for Fast Routing Lookups

Larger network size (Internet) and Faster network speed

IP routing lookup in software level◦ …Possible?◦ Most think software IP routing lookup cannot

come up with the speed of Gigabit network.

Page 4: Small Forwarding Tables for Fast Routing Lookups

Routers

Local version of routing table

Local version of routing table

Page 5: Small Forwarding Tables for Fast Routing Lookups

Traditional implementations of routing tables use Patricia trees.◦ More than 2MB

How about very small and fast forwarding table?◦ 40,000 routing entries, 150-160KB size

Purpose◦ Software IP routing lookup on the general purpose

processors(Alpha 21164 333MHz, Pentium Pro 200MHz)

Page 6: Small Forwarding Tables for Fast Routing Lookups

Routing table◦ Determines next hop for IP datagrams◦ Updated frequently (dynamic)

Forwarding table◦ Local version of routing table◦ Can be optimized for “lookup speed”

Page 7: Small Forwarding Tables for Fast Routing Lookups

Goal◦ Minimize lookup time◦ Minimize two parameters:

The number of memory accesses during lookup The size of data structure

◦ The data structure: Need few instructions during lookup Keep the entities naturally aligned as much as possible to

avoid expensive instructions and cumbersome bit-extraction operations

Page 8: Small Forwarding Tables for Fast Routing Lookups

The forwarding table◦ Binary tree covering all IP addresses

Page 9: Small Forwarding Tables for Fast Routing Lookups

Rule of the longest match◦ When several routing entries cover the same IP

address

Routing entry e1 is hidden by e2 for addresses in the

range r.

Page 10: Small Forwarding Tables for Fast Routing Lookups

Forwarding table◦ Representation of the binary tree spanned by all

routing entries◦ Prefix tree (trie)

should be complete

Page 11: Small Forwarding Tables for Fast Routing Lookups

Three levels of the data structure◦ Level 1: 16 bits◦ Level 2: 8 bits◦ Level 3: 8 bits

Page 12: Small Forwarding Tables for Fast Routing Lookups

Core result◦ can represent a complete binary tree of height h

using only one bit per possible leaf at depth h, plus one base index per 64 possible leaves, plus the information stored in the leaves.

◦ The size of a tree in bytes with l leaves holding information of size d is:

2h-3 + b × 2h-6 + l × d

(b: size of a base index)

Page 13: Small Forwarding Tables for Fast Routing Lookups

Level 1◦ Initial 16 bits of IP address: used for an index◦ Depth is 16. (binary tree)◦ 1 – 64K(216) children◦ Leaves in depth 16: bit vector

Page 14: Small Forwarding Tables for Fast Routing Lookups

Level 1 cont’d◦ Heads: Nodes in depth 16 if existing

Or, the lowest bit in the interval covered by that leaf is set.

◦ A bit in the bit vector: A one representing a root head A one representing a genuine head Zero which means this value is a member of a range

covered by a leaf at a depth less than 16

Page 15: Small Forwarding Tables for Fast Routing Lookups

Level 1 cont’d

Root headGenuine

head

Page 16: Small Forwarding Tables for Fast Routing Lookups

Level 1 cont’d◦ Head information

Root head: index to the level 2 chunk that represents the corresponding subtree

Genuine head: index into the next-hop table Encoded in 16-bit pointers stored in an array

2 bits: the kind of pointer 14 bits: index into next-hop or index into an array

Page 17: Small Forwarding Tables for Fast Routing Lookups

Level 1 cont’d◦ Finding pointer groups

An array of codewords as many as bit-masks An array of base indices, one per four code words: to find a

group of pointers Codeword: 10 bit value(r1, r2, …) + 6 bit offset(0,3,10, …)

Page 18: Small Forwarding Tables for Fast Routing Lookups

Level 1 cont’d◦ Maptable

To find the correct pointer in the group of pointers Bit-masks are generated from a complete prefix tree, not all

combinations of the 16 bits are possible. Non-zero bit-mask of length 2n: combination of two bit-

masks of length n or bit-mask with value 1

Page 19: Small Forwarding Tables for Fast Routing Lookups

Level 1 cont’d◦ Searching

Page 20: Small Forwarding Tables for Fast Routing Lookups

Levels 2 and 3◦ Chunks: A chunk covers a subtree of height 8 and

can contain at most 28=256 heads.◦ 3 kinds of chunks

1-8 heads: the chunk is “sparse.” 9-64 heads: the chunk is “dense.” 65-256 heads: the chunk is “very dense.”

Page 21: Small Forwarding Tables for Fast Routing Lookups

Levels 2 and 3 cont’d◦ Sparse: array of 8-bit indices of the heads◦ Dense: just one base index for all 16 codewords◦ ‘Dense and very dense’ chunks are searched

analogously with the 1st level.

Page 22: Small Forwarding Tables for Fast Routing Lookups

Growth limitations◦ The number of chunks of each kind is limited to

214=16384.◦ The number of pointers in levels 2 and 3 is limited

by the size of base indices.◦ The number of distinct next-hops is limited to

214=16384.

◦ BUT, with small modifications, it can accommodate a large increase in number of routing entries.

Page 23: Small Forwarding Tables for Fast Routing Lookups

Many routing tables◦ Collected through the Internet (IPMA project)

Very few. Searching one level takes 4 memory accesses.

Mostly less than 8 memory accesses

Page 24: Small Forwarding Tables for Fast Routing Lookups

Lookup times◦ Alpha 21164: at least 2.2 million lookups /sec◦ Pentium Pro: at least 2.0 million lookups /sec

Page 25: Small Forwarding Tables for Fast Routing Lookups

Forwarding table size

Table building time◦ The table is built during a single pass over all

routing entries. Larger addresses

◦ IPv6 possible inflating table size

Page 26: Small Forwarding Tables for Fast Routing Lookups

Compact forwarding table◦ Searched quickly to find the longest matching

prefix.

Resides in the cache of general purpose CPUs.

Can scale to accommodate the growth in routing table size.

Page 27: Small Forwarding Tables for Fast Routing Lookups

Thank you!