1 / 31

IP-Lookup and Packet Classification

IP-Lookup and Packet Classification. Advanced Algorithms & Data Structures Lecture Theme 08 – Part I Prof. Dr. Th. Ottmann Summer Semester 2006. Overview. The IP-Lookup problem Generalisations of IP-Lookup: Dynamisation, conflict-free ranges Packet classification

brier
Download Presentation

IP-Lookup and Packet Classification

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. IP-Lookup and Packet Classification Advanced Algorithms & Data Structures Lecture Theme 08 – Part I Prof. Dr. Th. Ottmann Summer Semester 2006

  2. Overview • The IP-Lookup problem • Generalisations of IP-Lookup: Dynamisation, conflict-free ranges • Packet classification • Category 1 solutions: Structure the universe • Category 2 solutions: Structure the prefix set Inverted Next Lists Priority Search Trees

  3. Lookup in an IP Router HEADER Forwarding Engine Dstn Addr Next-Hop-Computation Forwarding Table Dstn-prefix Next Hop ---- ---- ---- ---- ---- ----

  4. Example Forwarding Table IP prefix: 0-32 bits 142.12.0.0/19 128.9.0.0/16 65.0.0.0/8 224 128.9.16.14 0 232-1 65.0.0.0 65.255.255.255

  5. Nested intervalls 128.9.176.0/24 128.9.16.0/21 128.9.172.0/21 142.12.0.0/19 128.9.0.0/16 65.0.0.0/8 0 232-1 Sets of intervalls corresponding to sets of prefixes of IP-addresses are nested: Any two intervalls are either disjoint or one is contained in the other! Overlaps are impossible!

  6. LMP-Matching 128.9.176.0/24 128.9.16.0/21 128.9.172.0/21 142.12.0.0/19 128.9.0.0/16 65.0.0.0/8 0 232-1 128.9.16.14 Routing lookup:Find the longest matching prefix (the most specific route) among all prefixes that match the destination address.

  7. Example of an IP-Lookup Table Prefixes may be considered as bitstrings of a maximal length W. Example: W = 5, p = 10111

  8. Generalisations of the IP-Lookup Problem • Dynamisation: Insertion, deletion of prefixes (intervalls) • Conflict free sets of intervalls (not nested) • Priority matching instead of LMP lookup: Determine the prefix with highest priority matching a given bitstring 10011

  9. L4-SP 16b L4-DP 16b PROTO 8b L3-SA 32b L3-DA 32b L3-Proto 8b L2-SA 48b L2-DA 48b PAYLOAD Extension to higher dimensions: Classification Classify incoming packages into different flows according to different services.

  10. Example Classifier IP-Lookup is a special case of the packet classification problem. Example: (00101, 11011)

  11. 2-dim Classifier R4 R3 R2 R1

  12. {R1, R2} {R1, R2, R3} 2-dim Classifier 7 regions {R2, R3} R3 R2 R1 For a given point p: Find the rule (region) with highest priority containing p.

  13. Solution stategies for IP-Lookup and Packet Classification • Structure the universe of all bitstrings of length W: Trie based methods + Lookup becomes dependent only on the length of the given prefix - Updates expensive • Structure the current set of n prefixes: Geometry based methods + Efficient updates - Lookup dependent on n • Hardware-based solutions • Hybrid methods

  14. Binary Tries {*, 00*, 010*, 10*,100*} 1 0 0 1 1 0 0 0 0000 1111 A full binary tree of height W is a possible raster for storing all prefixes and bitstrings of length ≤ W. LMP: For a given bitstring p find the deepest node representing a prefix on the search path to leaf p! Time: O(W)

  15. Compression (1) 1 0 0 1 0 0 0

  16. Compression (2) 10 0 0 0 10 The number of nodes in a contracted binary trie storing n prefixes is ≤ 2n. CBT are similar to Ukkonen‘s implicit suffix trees. Lookup, insertion and deletion of prefixes in time O(W). Many possible variations: Increase branching factor in order to decrease height. Adapt branching factor on each level to number of prefixes. ……

  17. Increasing the branching factor 00 01 10 11 0000 1111 Trie based structures are set- and order-unique, hence, oblivious structures!

  18. Structure the set of intervals Fragments 1 2 3 4 5 6 7 8 9 10 G F H Intervals B C D E A Set of n nested intervals, among them the interval * representing the whole universe. n intervals partition the universe into ≤ 2n fragments.

  19. LMP Fragments 1 2 3 4 5 6 7 8 9 10 G F H Intervals B C D E A For a given point p: Find the fragment f, into which p falls, and determine the smallest interval X containing f.

  20. LMP and updates P0 P1 P2 P3 P4 P5 P6 Storing the smallest interval I containing fragment f at the fragments: LMP in time O(log n) Update: W(n)

  21. Definition next(x) Fragments 1 2 3 4 5 6 7 8 9 10 G F H Intervals B C D E A Let x be an arbitrary fragment or interval, define: next(x) = the smallest interval containing x For any given set of nested intervals: For each fragment and each interval x (except *) next(x) exists and is well defined!

  22. Inverted-Next-Lists Fragments 1 2 3 4 5 6 7 8 9 10 G F H Intervals B C D E A Inverted-Next-List of interval X = {Y; next(Y) = X}, sorted in l.t.r.o. A: B, 3, C, 7, D, 9, E B: 1, F C: 4, H D: 8 E: 10 F: 2 G: 5 H: G, 6 For each point p in fragment Y: If next(Y) = X, then X is the smallest interval containing p!

  23. Inverted-Next-Lists Fragments 1 2 3 4 5 6 7 8 9 10 G F H Intervals B C D E A Inverted-Next-List of interval X = {Y; next(Y) = X}, sorted in l.t.r.o. A: B, 3, C, 7, D, 9, E B: 1, F C: 4, H D: 8 E: 10 F: 2 G: 5 H: G, 6 Fragment i has direct link to the position, where i occurs in an INL. Each fragment and intervall in an INL is specified by ist start- and endpoint. Sum of lengths of all INL is at most 2 n.

  24. Longest Prefix Matching for point p 1 2 3 4 5 6 7 8 9 10 G F H B C D E A A: B, 3, C, 7, D, 9, E B: 1, F C: 4, H D: 8 E: 10 F: 2 G: 5 H: G, 6 Determine fragment Y, into which p falls, follow the link from Y to the INL, in which Y occurs, proceed from Y to the head of this INL, report the interval X at the header of this list!

  25. Insertion of a new interval without expansion of the fragment raster(2) 1 2 3 4 5 6 7 8 9 10 G F H B C D E I A A: B, I, 9. E I: 3, C, 7, D A: B, 3, C, 7, D, 9, E B: 1, F C: 4, H D: 8 E: 10 F: 2 G: 5 H: G, 6

  26. Insertion of a new interval with expansion of the fragment raster(1) Fragments 1 2 4 5 6 8 9 10 3b 3a 7a 7b G F H Intervals B C D E I A A: B, 3, C, 7, D, 9, E B: 1, F C: 4, H D: 8 E: 10 F: 2 G: 5 H: G, 6 A: B, 3a, I, 7b, D, 9, E I: 3b, C, 7a

  27. Deletion of an interval without contractionof the fragment raster(1) Fragments 1 2 3 4 5 6 7 8 9 10 G F H Intervals B C D E A A: B, 3, C, 7, D, 9, E B: 1, F C: 4, H D: 8 E: 10 F: 2 G: 5 H: G, 6 A: B, 3, 4, H, 7, D, 9, E

  28. Implementation List of fragments:Balanced leaf-search-tree, Operations: Search, insert, delete Inverted Next Lists:Balanced leaf-search-tree Operations: Find root (marking), splitting a tree according to a given x-value, join of 2 or 3 trees to a new one. All operations can be carried out in time O(log n), n = #(intervals) Alternative implementations may use: Biased Skip Lists (for bursty access patterns): Sahni/Kim 2003 Splay Trees (self adjusting to the access pattern) ……..

  29. Summary Trie-based solutions: (1-dim) static: LMP in time O(W) dynamic: insertion, deletion in time O(W) (Doeringer et al, 1996) Dynamic programming algorithm for the construction of space optimal tries of a predetermined height (optimize the strides of tries) (Sahni et al, 2003) Geometry-based solutions: (dynamic) Dimension: 1-dim, 2-dim, higher … Interval sets: nested, conflict free, general Priorities: length of intervals (LMP), general Structures: inverted lists, (balaced) search trees, skip lists segment trees, interval trees, PST Efficiency: worst case, amortized w.c., expected case

  30. 1-dim, nested intervals, LMP-priority, Sahni et al. 2003 search, insertion, deletion in time O(log n), inverted lists, balanced trees, skip lists 1-dim, nested intervals, general priorities, Kaplan et al. 2003 search, insertion, deletion in time O(log n) and space O(n) worst case: balanced dynamic trees amortized: self-adjusting dynamic trees 1-dim, general intervals, general priorities, Kaplan et al. 2003 search in worst-case time O(log n) insertion in amortized time O(log n) deletion in amortized time O(log n log log n) space O(n) interval trees, BB[a] trees 2-dim, general rectangles, general priorities search, insert, delete in time O(log2 n) and space O(n log n) dynamic segment trees

  31. 2-dim, nested rectangles, general priorities, Kaplan et al. 2003 search in amortized time O(log n) insertion in amortized time O(log2 n) space O(n log n) splay trees 2-dim, general rectangles over fixed universe U, general priorities, Eppstein et al. 2001 Static case (no updates) search in time O(log |U|) conflict detection in time O(n3/2) k-d-trees, Open problems: Simple, efficient solution for the general, higher-dimensional case. Bursty and clustered updates. Using other data structures, like fully dynamic segment trees, relaxed balanced search trees, relaxed balanced PST, ….

More Related