1 / 41

Geometric Solutions for the IP-Lookup and Packet Classification Problem

Geometric Solutions for the IP-Lookup and Packet Classification Problem. (Lecture 12: The IP-LookUp & Packet Classification Problem, Part II) Advanced Algorithms & Data Structures. Prof. Dr. Th. Ottmann Albert-Ludwigs-Universität Freiburg, Germany ottmann@informatik.uni-freiburg.de. Overview.

ehren
Download Presentation

Geometric Solutions for the IP-Lookup and Packet Classification Problem

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. Geometric Solutions for theIP-Lookup and Packet Classification Problem (Lecture 12: The IP-LookUp & Packet Classification Problem, Part II) Advanced Algorithms & Data Structures Prof. Dr. Th. Ottmann Albert-Ludwigs-Universität Freiburg, Germany ottmann@informatik.uni-freiburg.de

  2. Overview • The IP-table lookup problem • Geometric interpretation of the problem • Solution using Priority Search Trees • Solution using augmented range 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. Geometric view: For a given point p, find the smallest interval stabbed by p.

  7. Overview • The IP-table lookup problem • Geometric interpretation of the problem • Solution using Priority Search Trees • Solution using augmented range trees

  8. Geometric view of IP-table lookup Find a representation of a (dynamic) set of intervals such that the following operations can be carried out efficiently: • Insertion of an interval • Deletion of an interval • For a given point p: Find the smallest interval stabbed by p (LMP-query) Assumptions: Set of intervals is a nested set. Every newly inserted interval does not overlap with any interval in the set. Conflict test: For a given interval test whether or not it overlaps (is in conflict) with any interval already in the set.

  9. Representation of intervals by points B C A D B D C A Interval (l, r) is mapped to point (r, l) below the main diagonal.

  10. Stabbing queries B C p A D B D C A p lies in (l, r) ⇔ (l, r) is stabbed by p ⇔ ( l ≤ p und p ≤ r ) All points representing intervals stabbed by p lie to the right and below point (p, p)

  11. Geometric interpretation of interval-inclusion A B B A A ⊒ B Interval A = (lA, rA) includes interval B = (lB, rB) iff. point A is right below point B A ⋟ B B ⊑ A ⇔ A ⊒B ⇔ point B left above point A ⇔ B ≼ A

  12. Disjoint intervals B B A A X and Y represent disjoint intervals ⇔ There is no point p on the diagonal, s.t. p ≼ X und p ≼ Y

  13. Overlapping intervals p D D C C X and Y represent overlapping intervals ⇔ There is a point p on the diagonal, s.t. p ≼ X and p ≼ Y , but X and Y are incomparable with resp. to ≼

  14. Nested intervals A p D B D B C A C X is smallest intervall, that contains point p ⇔ p ≼ X and for all Y with p ≼ Y : X ≼ Y Observation: Sets of nested intervals stabbed by a point are totally ordered with resp. to ≼ Points closer to the diagonal represent smaller intervals.

  15. LMP-Queries A p D B D B C A C The smallest interval containing a given point p is represented by the point closest to the diagonal in the region right below p. (This is the topmost leftmost point in the region!)

  16. Overview • The IP-table lookup problem • Geometric interpretation of the problem • Solution using Priority Search Trees • Solution using augmented range trees

  17. Priority Search Trees Priority Search trees are a 1.5-dim structure for the storage of points, they support the following operations: Insertion ofa point Deletion of a point South-grounded range queries

  18. LMP-Query p x x x´ = ∞ x x Find topmost leftmost (or leftmost topmost) point in the range (x, ∞ , x) Well defined, if intervalls are nested, otherwise not! Executable inO(log n)time.

  19. Finding topmost leftmost points in PST

  20. Finding leftmost topmost points in PST

  21. Pairwise distinct search keys B C A D C B D A (x, y) ↦ (2W x + 2W – 1 – y, y) = ((x, -y), y) All points have pairwise distinct x-coordinates. Points corresponding to intervals with equal left endpoint are l.t.r. sorted according to increasing lengths. LMP: Find point with smallest x-coordinate in a given x-range below a threshold!

  22. Dynamic PST Possibilities for the full dynamization of priority search trees: No rigid skeleton, but growing or shrinking with the point set. Insertion (5,3)

  23. 3 1 1 2 2 3 Balanced trees as skeletons of PSTs  Rotation preserves the x-order, but may destroy the y-order of points.

  24. 3 1 1 2 2 3 Balanced trees as skeletons of PSTs  px occurs in subtree 1: Insert p into subtree 1; Pull up a point from subtree 2 or 3. 2 log n steps for the trickle down process!

  25. 3 1 1 2 2 3 Balanced trees as skeletons of PSTs  px occurs in subtree 2: Compare py with the priorities stored at the roots of subtree 1 and 2; Insert a point into subtree 2 or 3; Pull up a point from subtree 2 or 3. 2 log n steps for the trickle down process!

  26. Conflict detection (Insertion) x y new (query) interval u v (1) There is an interval (x, y) stabbed by u that has a right endpoint y < v x y u v (2) The range (u, v) contains a left endpoint x of an interval (x, y) that has a right endpoint not in this range, i.e. y > v

  27. Conflict detection (Insertion) x y new (query) interval u v (1) There is an interval (x, y) stabbed by u that has a right endpoint y < v (u, u) (y, x) u v Points represent intervals sorted according to their right endpoints

  28. Conflict detection (Insertion) x y u v (2) The range (u, v) contains a left endpoint x of an interval (x, y) that has a right endpoint not in this range, i.e. y > v Map interval (x, y) to point (x, -y). Store points in PST -y < -v ⇔ y > v -v (x, -y) u v

  29. Overview • The IP-table lookup problem • Geometric interpretation of the problem • Solution using Priority Search Trees • Solution using augmented range trees

  30. 1-dim Range Tree: Summary Let P be a set of n points in 1-dim space. P can be stored in a balanced binary leaf-search tree such that the following holds: Construction time: O(n log n) Space requirement: O(n) Insertion of a point: O(log n) time Deletion of a point: O(log n) time 1-dim-range-query: Reporting all k points falling into a given query range can be carried out in time O(long n + k). The performance of 1-dim range trees does not depend on the chosen balancing scheme!

  31. MinXinRectangle Queries Problem:Given a set P of points that changes under insertions and deletions, construct a data structure to store P that can be updated in O(lg n) time and that can find the point with minimal x-coordinate in a given range below a given threshold in O(log n) time. y0 MinXinRectangle(l, r, y0) l r Assumption: All points have pairwise different x-coordinates

  32. MinXinRectangle Queries MinXinRectangle(l, r, y0) y0 l r Assumption: All points have pairwise different x-coordinates

  33. Min-augmented Range Tree Two data structures in one: 11 2 Leaf-search tree on x-coordinates of points 3 14 Min-tournament tree on y-coordinates of points 3 2 2 4 17 (14, 7) 4 3 2 8 15 21 (2, 12) (3, 4) (4, 11) 3 2 8 5 (11, 21) (15, 2) (17, 30) (21, 8) 3 (5, 3) (8, 5)

  34. MinXinRectangle(l, r, y0) Search for the boundary values l, r. Find the leftmost umbrella node with a min-field ≤ y0. Split node l r

  35. MinXinRectangle(l, r, y0) Search for the boundary values l, r. Find the leftmost umbrella node with a min-field ≤ y0. Proceed to the left son of the current node, if its min-field is ≤ y0, and to the right son, otherwise. Return the point at the leaf. Split node l r MinXinRectangle(l, r, y0) can be found in time O(height of tree).

  36. Updates Insert operation Insert node as into a standard binary leaf search tree. Adjust min-fields of every ancestor of the new node by playing a min tournament for each node and its sibling along the search path. Delete operation: Similar

  37. s4 s3 s5 Maintaining min-fields Under Rotations s1 s1 min{s5, s3} s3 s2 s4 s5

  38. Min-augmented Range Trees–Summary • Theorem:There exists a data structure to represent a dynamic set S of n points in the plane with the following properties:The data structure allows updates and to answer MinXinRectangle(l, r, y0) queries in O(log n) time. The data structure occupies O(n) space. • Note: The datastructure can be based on an arbitrary scheme of balanced binary leaf search trees. • Min-augmented range trees can be used (instaed of PSTs) to solve the dynamic version of the IP lookup problem without changing the time complexity of the lookup and update operations.

  39. Conflict detection (Insertion) x y new (query) interval u v (1) There is an interval (x, y) stabbed by u that has a right endpoint y < v (u, u) Choose a min-augmented range tree and check whether there is at least one point in the range [u,v] below the threshold u. (y, x) u v Points represent intervals sorted according to their right endpoints

  40. Conflict detection (Insertion) x y u v (2) The range (u, v) contains a left endpoint x of an interval (x, y) that has a right endpoint not in this range, i.e. y > v Map interval [x, y] to point (x, y). Store points in max-augmented range tree and check whether there is a point (x, y) in the range [u, v] with a right endpoint y > v. v (x, y) u v

  41. Open problems • Implement and test new solutions with real (benchmark) data. • Find a simple, efficient solution for the general, higher-dimensional case. • Consider the case of bursty and clustered updates. • Investigate the effect of using other data structures, like • fully dynamic segment trees, • relaxed balanced search trees, relaxed balanced PST, …. • Find an efficient method for conflict detection in 2 (or more) dimensions.

More Related