icdcs 05adaptive counting networks srikanta tirthapura elec. and computer engg. iowa state...

38
ICDCS 05 Adaptive Counting Networks Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

Upload: olivia-nelson

Post on 20-Jan-2018

217 views

Category:

Documents


0 download

DESCRIPTION

ICDCS 05Adaptive Counting Networks Distributed Load Balancing Load Balancing Network Routing Tasks to Processors

TRANSCRIPT

Page 1: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

Adaptive Counting Networks

Srikanta TirthapuraElec. And Computer Engg.

Iowa State University

Page 2: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

Example: Producer - Consumer

DistributedStructure

Jobs Resources

Centralized Solutions don’tscale, look for distributed solutions

Page 3: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

Distributed Load Balancing

Load Balancing Network

Routing Tasks to Processors

Page 4: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

CountingNetwork

Counting Network

Page 5: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

Input Tokens(imbalanced)

Output Tokens(balanced)

CountingNetwork

Counting Network: Step Property

Page 6: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

CountingNetwork

Step Property

Page 7: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

CountingNetwork

Step Property

Page 8: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

CountingNetwork

Step Property

Page 9: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

CountingNetwork

Step Property

Page 10: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

Applications

• Load Balancing

• Producer-Consumer solved using two back-to-back counting networks

• Shared Counters in a Distributed System

Page 11: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

Counting Network Construction

• Bitonic network, Periodic network (Aspnes, Herlihy, Shavit – 1991)

• Network of basic elements called balancers

• State of the system distributed over the network– No sequential bottleneck

Page 12: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

Balancer

Page 13: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

Balancer

Page 14: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

Balancer

Page 15: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

Balancer

Page 16: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

Balancer

Page 17: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

Balancer

Page 18: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

Bitonic[4]Bitonic[2]

Scalable Construction

Page 19: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

Bitonic[8] Network

Page 20: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

Recursive Construction of Bitonic[w]

Bitonic[w/2]

Bitonic[w/2]

Merger[w/2]

Merger[w/2]

Mix[w/2]

Mix[w/2]

Page 21: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

Overlay Networks

• Plan: Counting network as a peer-to-peer overlay network

– Balancers nodes of the network– Wires communication links between nodes

• Structured peer-to-peer network

1. Efficient lookup service• Plaxton et. al., Chord, CAN, etc

2. Good local estimates of network size• Manku, Viceroy, Horowitz-Malkhi, …

Page 22: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

Problem

• All Current Constructions of counting networks are Static– Degree of parallelism (width) has to be decided in advance

• System size changes with time!

• Does not scale with the underlying network size

• Bad:– Width 64 network for a system with 20 nodes– Width 4 network with 1000 nodes

• Question: How to build an adaptive counting network (or your favorite distributed data structure)?

Page 23: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

Adaptive Counting Network

Degree of parallelism tunes itself to current network conditions

• As underlying physical network expands and contracts, so will the counting network

• Expansion and contraction are local operations (no central control)

• Decision of when to expand and contract also local

Page 24: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

Solution Ideas for Bitonic Network

1. Network built using variable sized components rather than fixed sized balancers

2. Network size changes with underlying physical network size

1. Expand: A component splits into more components2. Contract: Many components merge into a single one

3. Distributed Decisions for Splitting and Merging1. Sense current network conditions using Distributed Network

Size Estimation

Page 25: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

Component

Component[k]

j th input token leaves on wire (j mod k)

Can be implemented trivially on a single node

0

2

k-1

1

0

2

k-1

1

Page 26: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

Adaptive Bitonic Network

Input Output

Bitonic[32]

• Choose a maximum width for the network Suppose maximum width = 32

• Initially the whole network is implemented as a single component

Page 27: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

Load Increases: Split Components

Bitonic[16]

Bitonic[16]

Merger[16]

Merger[16]

Mix[16]

Mix[16]

Page 28: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

More Splits – “Irregular” Network

B[16] M[16]

M[16]

X[16]

X[8]

X[8]

B[8]

B[8]

M[8]

M[8]

X[8]

X[8]

On a single node, each component can be implemented trivially

Page 29: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

Flexibility

• Using components rather than balancers allows many more possibilities

• Network can morph into the best possible implementation for the current conditions

Page 30: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

When to Split and Merge?

• Decision local to each node

• Possible Strategies:– Based on Load experienced by a node– Based on Estimate of network size

• Our Recipe (yields provable theoretical bounds): – Locally estimate network size – If network size estimate > threshold, then split– If network size estimate < threshold, then merge– Threshold varies with the component

Page 31: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

Network Size Estimation

• Each node uses local estimate of physical network size

• Example: Chord p2p system– Nodes organized in a ring– Rough estimate =

1/(distance to successor) – Better estimate =

k/(distance to kth successor)

• Local (inaccurate) estimates are enough for our purposes – Local Decisions are approximate,

but aggregate of decisions is “pretty good”

E[dist]=1/N

N = number of nodes

Page 32: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

Component HierarchyB[32]

B[16] B[16] M[16] M[16] X[16] X[16]

M[8]M[8] X[8]X[8]

Intuition: N < 6 nodes, level 1 is ideal N = 6 to 24 nodes, level 2 is best N = 24 to 80, level 3 is best

We show that the level estimate of every component is close to the “optimal”

Page 33: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

Balanced Hierarchy

Highly Unlikely

More Likely

Page 34: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

Our Results for Bitonic Network

Definitions:

• Effective Width = number of edge disjoint paths from input to output

• Effective Depth = longest path from input to output

Page 35: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

Our Results for Bitonic Network

If N = number of nodes currently in the physical network

With high probability,

• Total Number of Components = O(N)

• Effective width

• Effective Depth

• Total number of components=

• Effective width = w is a constant

• Effective depth =

N

NO 2log

)(log2 NO

Adaptive Network Static Network

)log( 2 wwO

)(log2 wO

Page 36: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

Conclusions• Counting networks built out of variable width components

rather than fixed width balancers

• Distributed Decisions expand and contract the Network

• Final Network is provably tuned to the current network conditions (assuming a structured p2p overlay)

• Applies to any distributed data structure – That can be decomposed recursively– Needs to resize dynamically in response to system load

Page 37: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

How to Locate Components?

• Each component has a name, derived from its position in the recursive decomposition

• Lookup component location by name (using the distributed hash table)

• If output component changes during execution, then re-compute location

Page 38: ICDCS 05Adaptive Counting Networks Srikanta Tirthapura Elec. And Computer Engg. Iowa State University

ICDCS 05 Adaptive Counting Networks

Acknowledgments

• Thanks to Costas Busch for help with the presentation