Download presentation
Presentation is loading. Please wait.
1
PRESENTED BY: ILYA NELKENBAUM KEREN ARMON SUPERVISOR: MR. YOSSI KANIZO 09/03/2011 Cuckoo the Kicking Bird 1
2
Motivation Modern networking systems: Increasing traffic rates. Packet processing in switching level is essential and in some cases is crucial. Memory access time becomes more critical. Fast memory is very expensive and size limited. All this requires faster and more efficient data structures. 2
3
Motivation (2) Applications can be found in wire speed communication, high speed packet processing, large data centers, etc. Hash-based data structures are an extremely useful technique to deal with this type of problems. Particularly hash table. Traditional data structures are not efficient enough. 3
4
Cuckoo Hashing 4 A new approach for handling collisions.
5
Cuckoo Hashing YZ X Insert X H_1(X)=1 H_2(X)=4 5
6
Cuckoo Hashing XZ Y Insert YH_1(Y)=1 H_2(Y)=7 6
7
Cuckoo Hashing XZY 7
8
XZY Find(y) H_1(Y)=1H_2(Y)=7 Found! 8
9
Cuckoo Hashing – Description Basic scheme: each element gets d possible locations. To insert x, check all locations for x. If one is empty, insert. If all are full, x kicks out an old element y. Then y moves to one of its other locations. If all locations are full, y kicks out z, and so on, until an empty slot is found 9
10
Hash Basics Hash memory include: Basic hash parameters: m – number of buckets. h - buckets height. D – number of memory segments. n - number of elements. d – number of hash functions. b – maximum number of kicks. h 10
11
Objectives Cuckoo’s Reduce number of memory accesses Number of accesses is translated to number of kicks. Better memory utilization. According to mathematical analysis, for a table twice the size of the number of elements, we will have zero elements in CAM Project Test the performance of parallel cuckoo implementation compared with a sequential one, in a manner of memory accesses in several system configurations. 11
12
Implementation Platform OOP language: C# (using Microsoft Visual Studio) OOP Generic data structures (Queue). Garbage collector GUI Unfamiliar language. Version control system: Using the lab facilities (SVN). 12
13
Class Diagram 13
14
Memory Structures Hash Table: Memory segment API to memory Segments: For each segment: operation queue CAM: Content Addressable Memory 14
15
Cuckoo Logic Implements an abstract Cuckoo scheme Is father of: Naive Cuckoo NaiveParallel Cuckoo Parallel Cuckoo Contains properties: CAM Operation queue (filled by simulations) Hash set – an assembly of randomized hash functions Statistics Methods: doQueue (virtual). Get Statistics methods 15
16
Simulation Flow 16 Input for hash table parameters (Including Cuckoo constants) Generating and inserting operations to hash table operations queue. Executing the operations by selected Cuckoo Logic Extracting flow data and processing it according to simulation type.
17
Naive Cuckoo Logic 17 Implements naive execution of operations: Get first operation. Execute sequentially for each hash function of element. When finished, get next operation. Methods: Enqueue doQueue addElement Was implemented first.
18
Naive Parallel Cuckoo Logic 18 Implements parallel examinations of different hash functions for each element: Get first operation. Inquire execution of all hash functions simultaneously. Save first success and drop all others. When finished, get next operation. Methods: Enqueue doQueue addElement Was implemented second.
19
Parallel Cuckoo Logic 19 Implements parallel execution of different operations: Consider all segments as pipelined system Each cycle (one memory access), all segments execute an operation. In case of failure, the operation is being transferred to the next segment. In case of success a new operation is being pulled from operations queue. Methods: AddNewOper CheckResult DoQueue Was implemented last.
20
API 20 Console API GUI API
21
Simulation Classes Main Class Simulations Two main simulation classes: Fast_simulation – samples the stats data after each operation Regular_Simulation – samples the stats after all operations were executed. GUI uses only fast simulation Constants Define all constants – m, n, d, D, b, h. Can be modified. 21
22
CAM Load by number of elements 22 In this type of simulation the insertion scenario of elements is running, while the final number of elements inserted is equal to number of buckets (m = 1000) D = d = 1D = d = 2D = d = 3
23
CAM Load by number of kicks 23 In this type of simulation we sweep the limit of the number of kicks allowed and each time insert 1000 elements into the hash table.
24
Memory Access by number of elements 24 In this type of simulation an insertion scenario is executed according to the parameters given. The number of memory accesses is shown as function of inserted elements number. D = d = 1D = d = 2D = d = 10
25
Number of kicks by number of elements 25 This type of simulation executes the insertion scenario according to the given parameters and the result is number of kicks that were made as function of inserted elements number.
26
Achievements 26
27
Future Development 27 Within the framework of the project one of the main goals was to provide a modular code for implementing and running different Cuckoo Logics over the same hash table. Due to the modularity, it will be possible in future to add the following features: Additional Cuckoo Logic approaches Additional operations for hash table (find and delete). Implementing mixed operations scenarios
28
Gantt Ramp up on problem, algorithm, terminology and theory. Designing the project, Get to know C#. Getting green light from supervisor. Implementation of ‘naive’ Cuckoo. Running simulations and analyzing results. Iterative improvements. Implementation of naive parallel Cuckoo. Running simulations and analyzing results. Iterative improvements. Implementation of parallel Cuckoo. Creating a GUI for configurations of simulations. Creating a GUI to review results. Project summary. 28 EXP. 1 2-3 3 4-6 7-9 10 11-13 X 14 REAL. 1 2-3 3 4 4-6 7 8-10 11-12 13-14 14-…
29
Thank You Yossi ! 29
30
30 API
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.