29
PRESENTED BY: ILYA NELKENBAUM KEREN ARMON SUPERVISOR: MR. YOSSI KANIZO 09/03/2011 Cuckoo the Kicking Bird 1

Cuckoo the Kicking Bird

  • Upload
    dooley

  • View
    58

  • Download
    0

Embed Size (px)

DESCRIPTION

Cuckoo the Kicking Bird. Presented By: Ilya nelkenbaum Keren armon Supervisor: Mr. Yossi Kanizo 09/03/2011. Motivation. Modern networking systems: Increasing traffic rates. Packet processing in switching level is essential and in some cases is crucial. - PowerPoint PPT Presentation

Citation preview

Page 1: Cuckoo the Kicking Bird

1

PRESENTED BY:ILYA NELKENBAUM

KEREN ARMON

SUPERVISOR:MR. YOSSI KANIZO

09 /03 /2011

Cuckoo the Kicking Bird

Page 2: Cuckoo the Kicking Bird

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.

Page 3: Cuckoo the Kicking Bird

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.

Page 4: Cuckoo the Kicking Bird

4

Cuckoo Hashing

A new approach for handling collisions.

Page 5: Cuckoo the Kicking Bird

5

Cuckoo Hashing

Y Z

X

Insert XH_1(X)=1H_2(X)=4

Page 6: Cuckoo the Kicking Bird

6

Cuckoo Hashing

X Z

Y

Insert YH_1(Y)=1H_2(Y)=7

Page 7: Cuckoo the Kicking Bird

7

Cuckoo Hashing

X Z Y

Page 8: Cuckoo the Kicking Bird

8

Cuckoo Hashing

X Z Y

Find(y)H_1(Y)=1H_2(Y)=7Found!

Page 9: Cuckoo the Kicking Bird

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

Page 10: Cuckoo the Kicking Bird

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

Page 11: Cuckoo the Kicking Bird

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.

Page 12: Cuckoo the Kicking Bird

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).

Page 13: Cuckoo the Kicking Bird

13

Class Diagram

Page 14: Cuckoo the Kicking Bird

14

Memory Structures

Hash Table: Memory segment API to memory

Segments: For each segment: operation queue

CAM: Content Addressable Memory

Page 15: Cuckoo the Kicking Bird

Cuckoo Logic

Implements an abstract Cuckoo schemeIs 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

Page 16: Cuckoo the Kicking Bird

16

Simulation Flow

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.

Page 17: Cuckoo the Kicking Bird

17

Naive Cuckoo Logic

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.

Page 18: Cuckoo the Kicking Bird

18

Naive Parallel Cuckoo Logic

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.

Page 19: Cuckoo the Kicking Bird

19

Parallel Cuckoo Logic

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.

Page 20: Cuckoo the Kicking Bird

20

API

Console APIGUI API

Page 21: Cuckoo the Kicking Bird

21

Simulation Classes

Main ClassSimulations

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.

Page 22: Cuckoo the Kicking Bird

22

CAM Load by number of elements

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

D = d = 2

D = d = 3

Page 23: Cuckoo the Kicking Bird

23

CAM Load by number of kicks

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.

Page 24: Cuckoo the Kicking Bird

24

Memory Access by number of elements

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

D = d = 2

D = d = 10

Page 25: Cuckoo the Kicking Bird

25

Number of kicks by number of elements

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.

Page 26: Cuckoo the Kicking Bird

26

Achievements

Reducing number of memory access by ~ x (b=100) Naive ~= 36944 NaiveParallel ~= 27556 Parallel ~= 9330

By increasing number of hash functions per element, nearly ~98% of memory is used. Therefore main memory utilization is significantly improved.

Providing a platform for finding the minimum number of kicks that limits CAM load. This limitation can further reduce memory accesses.

Page 27: Cuckoo the Kicking Bird

27

Future Development

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

Page 28: Cuckoo the Kicking Bird

28

Gant t

• 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.

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

Page 29: Cuckoo the Kicking Bird

29

Thank You Yossi !