Download presentation
Presentation is loading. Please wait.
1
IP-Lookup and Packet Classification Computational Geometry, WS 2007/08 Lecture 14 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für Angewandte Wissenschaften Albert-Ludwigs-Universität Freiburg
2
Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann2 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 Priority Search Trees
3
Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann3 Dstn Addr ---- Dstn-prefixNext Hop Forwarding Table Forwarding Engine HEADERHEADER Lookup in an IP Router Next-Hop-Computation
4
Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann4 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
Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann5 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
Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann6 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. 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
Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann7 Example of an IP-Lookup Table PrefixNext-hop P1111*H1 P210*H2 P3101*H3 P410101H4 P5*H5 Prefixes may be considered as bitstrings of a maximal length W. Example: W = 5, p = 10111
8
Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann8 Generalisations of IP-Lookup Dynamisation: Insertion, deletion of prefixes (intervalls) Conflict free sets of intervalls (not nested) Priority matching instead of LMP lookup: PrefixNext- hop R110*H3 R21001*H2 R301100H5 R40*H4 R5010*H1 R6*H6 Determine the prefix with highest priority matching a given bitstring 10011
9
Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann9 Extension to higher dimensions Classify incoming packages into different flows according to different services. ServiceExample Traffic Shaping Ensure that ISP3 does not inject more than 50Mbps of total traffic on interface X, of which no more than 10Mbps is email traffic Packet Filtering Deny all traffic from ISP2 (on interface X) destined to E2 Policy Routing Send all voice-over-IP traffic arriving from E1 (on interface Y) and destined to E2 via a separate ATM network PAYLOAD L4-SP 16b L4-DP 16b PROTO 8b L3-SA 32b L3-DA 32b L3-Proto 8b L2-SA 48b L2-DA 48b
10
Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann10 Example Classifier RuleDestination Address Source Address R10*10* R20*01* R30*1* R400*1* R500*11* R610*1* R7*00* Field 1Field 2 IP-Lookup is a special case of the packet classification problem. Example: (00101, 11011)
11
Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann11 R1 R2 R3 R4 2-dim Classifier
12
Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann12 R1 R2 R3 {R1, R2} {R2, R3} {R1, R2, R3} 7 regions For a given point p: Find the rule (region) with highest priority containing p. 2-dim Classifier
13
Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann13 Solution stategies 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
Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann14 Binary Tries 0 0 1 1 1 0 00 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) {*, 00*, 010*, 10*,100*} 00001111
15
Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann15 Compression (1) 0 0 1 10 00
16
Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann16 Compression (2) 0 0 10 0 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
Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann17 Increasing the branching factor 00011011 0000 1111 Trie based structures are set- and order-unique, hence, oblivious structures!
18
Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann18 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 nested (but not necessarily a prefix 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.
19
Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann19 Mapping intervals to points Assumption: All points have pairwise distinct x-coordinates Map point (x, y) to ((x, – y), y) Interval (l, r) is mapped to point (r, l) below the main diagonal.
20
Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann20 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 Disjoint intervals
21
Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann21 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 Geometric interpretation of interval-inclusion
22
Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann22 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 ≼ Overlapping intervals
23
Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann23 B 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. Nested intervals
24
Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann24 Equivalent Query For a given p, find the leftmost point whose x-value is greater than or equal to p and whose y-value is less than or equal to p. p p Since the original intervals are nested, the topmost-leftmost point is also the leftmost one!
25
Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann25 Geometric version of the IP-lookup-problem Maintain a set of points in the plane (below the main diagonal) s.t. the following operations can be carried out efficiently: insertion of points deletion of points minXinRectagle queries (corresponds to topmost-leftmost queries) minXinRectangle(l, r, y 0 ) Data structures used: Priority-search-trees (Lu/Sahni, IEEE TC, 2004) Min-augmented-search-trees Priority-search-pennats (Lauer, Ottmann, Datta: Update efficient data structures for dynamic IP router tables, International Journal of Foundations of Computer Science, 18(1):139--161, Feb. 2007. World Scientific Publishing Company. )
26
Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann26 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
27
Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann27 8 3, 8 3245 6, 9 671 2, 4 1 4, 5 3 5, 4 57 1, 2 2 8, 3 6 7, 1 4 Priority search trees are - binary leaf search trees for the x-coordinates of the points. - min heaps for the y-coordinates of the points. Priority Search Tree
28
Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann28 l y0y0 r Executable in O(log n) time. Find topmost leftmost (or leftmost topmost) point in the range (l, r, y 0 ) p l y0y0 Well defined, if intervalls are nested, otherwise not! r minXinRectangle(l, r, y0)
29
Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann29 Finding topmost leftmost points in PST
30
Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann30 Finding leftmost topmost points in PST
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.