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 [email protected]
41
Embed
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 [email protected]. Overview. - PowerPoint PPT Presentation
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
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. OttmannAlbert-Ludwigs-Universität Freiburg, Germany
Sets of intervalls corresponding to sets of prefixes of IP-addressesare nested:Any two intervalls are either disjoint or one is contained in the other!
Overlaps are impossible!
6
128.9.16.0/21128.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 232-1
128.9.0.0/16142.12.0.0/19
65.0.0.0/8
128.9.16.14
LMP-Matching
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
A
B
C
D
A
B
CD
Interval (l, r) is mapped to point (r, l) below the main diagonal.
10
Stabbing queries
A
B
C
D
A
BC
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 theright and below point (p, p)
p
11
Geometric interpretation of interval-inclusion
A
B
A
B
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
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
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
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
LMP-Queries
B
C
A
B
p
A
D
C
D
The smallest interval containing a given point p is represented bythe 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 TreesPriority 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
x
x
x´ = ∞
Executable in O(log n) time.
LMP-Query
Find topmost leftmost (orleftmost topmost) point inthe range (x, ∞ , x)
p
x
x
Well defined, if intervalls are nested,otherwise not!
19
15,1
40
4,2
9
33,4
28
1
1,3
1
6,10
1317,35
302,4
2
17 28
17,9
17
Finding topmost leftmost points in PST
20
Finding leftmost topmost points in PST
21
Pairwise distinct search keys
A
BC
D
A
BC
D
(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 endpointare l.t.r. sorted according to increasing lengths.LMP: Find point with smallest x-coordinate in a given x-range below a threshold!
22
2,2
6
6,4
2
7,3
7
2
6
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
Balanced trees as skeletons of PSTs
q
x´
p
x
1 2
3
x
x´
1
2 3
Rotation preserves the x-order,but may destroy the y-order of points.
24
Balanced trees as skeletons of PSTs
q
x´
p
x
1 2
3
x
x´
1
2 3
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
Balanced trees as skeletons of PSTs
q
x´
p
x
1 2
3
x
x´
1
2 3
px occurs in subtree 2:Compare py with the priorities stored at the roots ofsubtree 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
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
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 sortedaccording to their right endpoints
(u, u)
v
(y, x)
u
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 ⇔ y > 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.
l r
y0
MinXinRectangle(l, r, y0)
Assumption: All points have pairwise different x-coordinates
32
MinXinRectangle Queries
lr
y0
MinXinRectangle(l, r, y0)
Assumption: All points have pairwise different x-coordinates
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)
2 4
3
11
8
5
14
17
15 21
2
2
2
3
4 3
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
MinXinRectangle(l, r, y0)
l r
Split node
Search for the boundary values l, r.Find the leftmost umbrella node witha min-field ≤ y0.
35
MinXinRectangle(l, r, y0)
l r
Split node
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.
MinXinRectangle(l, r, y0) can be found in time O(height of tree).
36
UpdatesInsert 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
Maintaining
min-fields
Under
Rotations
s1
s2s3
s4 s5
s1
s3s5
s4
min{s5, s3}
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 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
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 sortedaccording to their right endpoints
(u, u)
v
(y, x)
u
Choose a min-augmented rangetree andcheck whether there is at leastone point in the range [u,v] below the threshold u.
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
• 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, likefully dynamic segment trees,relaxed balanced search trees, relaxed balanced PST, ….
• Find an efficient method for conflict detection in 2 (or more) dimensions.