Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Geometric Solutions for the IP-Lookup and Packet Classification Problem (Lecture 12: The IP-LookUp & Packet Classification Problem, Part II) Advanced.

Similar presentations


Presentation on theme: "1 Geometric Solutions for the IP-Lookup and Packet Classification Problem (Lecture 12: The IP-LookUp & Packet Classification Problem, Part II) Advanced."— Presentation transcript:

1 1 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

2 2 Overview  The IP-table lookup problem  Geometric interpretation of the problem  Solution using Priority Search Trees  Solution using augmented range trees

3 3 Dstn Addr ---- Dstn-prefixNext Hop Forwarding Table Forwarding Engine HEADERHEADER Lookup in an IP Router Next-Hop-Computation

4 4 0 2 24 2 32 -1 128.9.0.0/16 65.0.0.0 142.12.0.0/19 65.0.0.0/8 65.255.255.255 Destination IP Prefix Outgoing Port (Next-Hop) 65.0.0.0/ 83 128.9.0.0/161 142.12.0.0/197 IP prefix: 0-32 bits 128.9.16.14 Example Forwarding Table

5 5 128.9.16.0/21 128.9.172.0/21 128.9.176.0/24 0 2 32 -1 128.9.0.0/16 142.12.0.0/19 65.0.0.0/8 Nested intervalls 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 6 128.9.16.0/21 128.9.172.0/21 128.9.176.0/24 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. 0 2 32 -1 128.9.0.0/16 142.12.0.0/19 65.0.0.0/8 128.9.16.14 LMP-Matching

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

8 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 9 Representation of intervals by points A B C D A B C D Interval (l, r) is mapped to point (r, l) below the main diagonal.

10 10 Stabbing queries A B C D A B C D 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) p

11 11 Geometric interpretation of interval-inclusion A B A B A ⊒ B Interval A = (l A, r A ) includes interval B = (l B, r B ) iff. point A is right below point B A ⋟ B B ⊑ A ⇔ A ⊒ B ⇔ p oint B left above point A ⇔ B ≼ A

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

13 13 Overlapping intervals C p D C D 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 14 Nested intervals B C A B p A D 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. D

15 15 LMP-Queries B C A B p A D C D 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 16 Overview  The IP-table lookup problem  Geometric interpretation of the problem  Solution using Priority Search Trees  Solution using augmented range trees

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

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

19 19 Finding topmost leftmost points in PST

20 20 Finding leftmost topmost points in PST

21 21 Pairwise distinct search keys A B C D A B C D (x, y) ↦ (2 W x + 2 W – 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 22 Possibilities for the full dynamization of priority search trees: No rigid skeleton, but growing or shrinking with the point set. Insertion (5,3) Dynamic PST

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

24 24 Balanced trees as skeletons of PSTs 12 3 1 23  p x 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 25 Balanced trees as skeletons of PSTs 12 3 1 23  p x occurs in subtree 2: Compare p y 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 26 Conflict detection (Insertion) x vu y new (query) interval (1) There is an interval (x, y) stabbed by u that has a right endpoint y < v x y vu (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 27 Conflict detection (Insertion) x vu y new (query) interval (1) There is an interval (x, y) stabbed by u that has a right endpoint y < v Points represent intervals sorted according to their right endpoints (u, u) v (y, x) u

28 28 Conflict detection (Insertion) x y vu (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 v (x, -y) u -v -y v

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

30 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 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. l r y0y0 MinXinRectangle(l, r, y 0 ) Assumption: All points have pairwise different x-coordinates

32 32 MinXinRectangle Queries l r y0y0 MinXinRectangle(l, r, y 0 ) Assumption: All points have pairwise different x-coordinates

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

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

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

36 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 37 Maintaining min-fields Under Rotations s1s1 s2s2 s3s3 s4s4 s5s5 s1s1 s3s3 s5s5 s4s4 min{s 5, s 3 }

38 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, y 0 ) queries in O(log n) time. The data structure occupies O(n) space. Note: The data structure 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 39 Conflict detection (Insertion) x vu y new (query) interval (1) There is an interval (x, y) stabbed by u that has a right endpoint y < v Points represent intervals sorted according to their right endpoints (u, u) v (y, x) 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.

40 40 Conflict detection (Insertion) x y vu (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 41 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. Open problems


Download ppt "1 Geometric Solutions for the IP-Lookup and Packet Classification Problem (Lecture 12: The IP-LookUp & Packet Classification Problem, Part II) Advanced."

Similar presentations


Ads by Google