Download presentation

Presentation is loading. Please wait.

Published byWeston Tungate Modified about 1 year ago

1
IP Routing Lookups Scalable High Speed IP Routing Lookups. Based on a paper by: Marcel Waldvogel, George Vaghese, Jon Turner, Bernhard Plattner.

2
Background and Motivation Rapidly growing Internet increases demands for high performance routing. Routing table lookup for a destination address is one of the key components of packet forwarding. –Given IP address, find out the output link that is the best choice to reach this IP. –Hierarchial IP address structure. –BMP – Best matching prefix problem.

3
The Address Lookup Problem Address in a packet is compared to the stored prefixes starting from the left most bit. The longest prefix found is the desired match. The packet is forwarded to the specific next hop. Next hop field changes – topology, traffic. Set of prefixes changes rarely – inserting/removing network or host.

4
Address lookup using Tries Prefixes stored in a binary trie Black nodes denote terminal nodes for prefixes. Remember the most recent black node. The search ends either in leaf or because of no matching branch to follow. Time Complexity W (= 32 for IPv4 and 128 for IPv6) memory accesses. 1 0 0 01 1 1 1 1 1 0 0 0 Existing prefixes: 000, 001, 010, 011, 100, 101, 11, 111

5
Liner Search of Hash Tables Organize prefixes into the hash tables by length. Start searching from the longest prefix size. W hash function computations in the worst case. W = maximal prefix length, 32 for IPv4.

6
Binary Search of Hash Tables. (Basic Scheme) Organize prefixes into the hash tables by length. Introduce markers. Remember the last found BMP to avoid backtracking. log 2 w hash function computations.

7
Binary Search of Hash Tables. Binary search Hash tables Hash tables with markers 1100 0 111 11 00 - Prefix - Marker 1 2 3 Prefix length P1=00 P1=0 P3=111

8
Binary Search of Hash Tables. (Code) Binary_Search(D) // Search for address D Initialize search range R to cover the whole array L ; Initialize BMP found so far to NULL ; While R is not empty { Let i correspond to the middle level in range R; Extract the first L[i].length() bits of D into D’ ; M = Search(D’,L[i].hash); // search hash for D’ if (M == NULL) R = Upper half of R; // Not found else if (M is a prefix and not a marker) { BMP = M.bmp; break;} else { // M is a pure marker or a marker and a prefix BMP = M.bmp; // update the best matching prefix so far R = lower half of R; } End;

9
Mutating Binary Search Every match in the binary search with some marker X – means that we need only search among the set of prefixes for which X is a prefix. BS mutates (changes) the levels on which it searches dynamically –(in a way that always reduces the level to be searched) as it gets more match information. Average number of memory lookups is 2 for IPv4 (32 bit) Root X New Trie on failure New Trie on match (first m bits of Prefix = X) m = median length among all prefix lengths in trie

10
Mutating Binary Search (example:) 16 17 18 19 20 21 22 23 24 Prefix length Mutating search treesHash Tables E: …, Tree2 F:...111, Tree3 J: …1010, End H:...101, Tree4 G: …11100, End Node_Name: Prefix(… stands for E), Tree to use from now on Hash entry structure : H:...101, Tree4

11
Advantages: –Faster average lookup time. Disadvantages: –Increased new prefix insertion time. –Increased storage requirements for optimal binary search trees family. Mutating Binary Search: Advantages / Disadvantages

12
On match we use the new tree On miss we use only the upper part of the current tree We never use more then a single rope like branch from any specific tree. So we can store ropes instead of binary trees Mutating Binary Search: How to reduce the storage needed?

13
Ropes of a sub tree – the sequence of levels which binary search will follow on repeated failures. 16 17 18 19 20 22 23 24 Prefix length Mutating search treesHash Tables E: …, Tree2 F:...111, Tree3 J: …1010, End H:...101, Tree4 G: …11100, EndH:...101, Tree4 21 Example:

14
Rope Variation of Mutating Binary Search Search for address D: Rope Search(D) { R default search sequence BMP NULL While R is not empty { i first pointer found in R D’ first L[i].length() bits of D M Search(D’,L[i].hash) // search hash for D’ if (M != NULL) { BMP M.bmp //update the best matching prefix so far R M.rope //get the new Rope, possibly empty }

15
Possible variations Arrays usage instead of hash tables for the initial prefix lookup. –Space time tradeoff : w o prefix length for which array is used (w o =16) 2 Wo space used (2 16 ) Hardware implementations. –Rope search algorithm is simple –Can be pipelined

16
Precomputations – building the rope search data structure optimized for a given prefix set. Insertions/deletions result in performance degradation Mutating Binary Search: Implementation:

17
Conclusions: Simple Binary search algorithm reduce number of memory accesses from W to log 2 W. Where w = number of bits in the IP address. (5 = log 2 32 hash computations for IPv4) Mutating Binary search algorithm further reduce the average case hash computations number to 2. The DS initialization takes O(sum of prefix lengths)

18
Practical measurements made on 200 MHz Pentium Pro, C using compiler max. optimizations on table with 33,000 entries –about 80ns for IPv4 –about 150-200ns for IPv6 Practical Measurements:

19
Generalized Level Compressed Tries. Definition – Tries with n levels compressed into the hash tables. Time complexity optimization problem under memory constrains. To be presented the next lecture.

Similar presentations

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google