Top Banner
Self Stabilizing Self Stabilizing Smoothing and Smoothing and Counting Counting Maurice Herlihy, Brown University Maurice Herlihy, Brown University Srikanta Tirthapura, Iowa State Srikanta Tirthapura, Iowa State University University
31

Self Stabilizing Smoothing and Counting Maurice Herlihy, Brown University Srikanta Tirthapura, Iowa State University.

Dec 13, 2015

Download

Documents

Polly West
Welcome message from author
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
Page 1: Self Stabilizing Smoothing and Counting Maurice Herlihy, Brown University Srikanta Tirthapura, Iowa State University.

Self Stabilizing Self Stabilizing Smoothing and Smoothing and

CountingCounting

Self Stabilizing Self Stabilizing Smoothing and Smoothing and

CountingCounting

Maurice Herlihy, Brown University Maurice Herlihy, Brown University

Srikanta Tirthapura, Iowa State UniversitySrikanta Tirthapura, Iowa State University

Page 2: Self Stabilizing Smoothing and Counting Maurice Herlihy, Brown University Srikanta Tirthapura, Iowa State University.

Overview

• Smoothing and Counting Networks

• Analysis of behavior without proper initialization- upper and lower bounds

• Self stabilization of smoothing networks

Page 3: Self Stabilizing Smoothing and Counting Maurice Herlihy, Brown University Srikanta Tirthapura, Iowa State University.

Smoothing Networks

2-smoothing network

In a k-smoothing Network, the numbers of Tokens on different output wires differ by at most 2

Page 4: Self Stabilizing Smoothing and Counting Maurice Herlihy, Brown University Srikanta Tirthapura, Iowa State University.

Counting Networks

• 1-smoothing networks with other additional properties

• Aspnes, Herlihy and Shavit in 1991

• Since then, scalable Construction and Properties well studied

• Bitonic and Periodic networks are two popular counting networks

Page 5: Self Stabilizing Smoothing and Counting Maurice Herlihy, Brown University Srikanta Tirthapura, Iowa State University.

Balancer

Page 6: Self Stabilizing Smoothing and Counting Maurice Herlihy, Brown University Srikanta Tirthapura, Iowa State University.

Balancer

Page 7: Self Stabilizing Smoothing and Counting Maurice Herlihy, Brown University Srikanta Tirthapura, Iowa State University.

Balancer

Page 8: Self Stabilizing Smoothing and Counting Maurice Herlihy, Brown University Srikanta Tirthapura, Iowa State University.

Counting Network

Initial State: All balancers pointing up

Width = 4

Depth = 4

Page 9: Self Stabilizing Smoothing and Counting Maurice Herlihy, Brown University Srikanta Tirthapura, Iowa State University.

1-Smoothing Property

Page 10: Self Stabilizing Smoothing and Counting Maurice Herlihy, Brown University Srikanta Tirthapura, Iowa State University.

Questions

• How do counting networks perform when initialized incorrectly (or by an adversary)?

• How to recover from illegal states reached during execution?

Page 11: Self Stabilizing Smoothing and Counting Maurice Herlihy, Brown University Srikanta Tirthapura, Iowa State University.

Motivation

• Initializing to a “correct” global state is hard or may be impossible – global reconfiguration expensive– network switches reboot

• Step towards building fault tolerant and dynamic smoothing networks

Page 12: Self Stabilizing Smoothing and Counting Maurice Herlihy, Brown University Srikanta Tirthapura, Iowa State University.

Our Results(1)

Periodic and Bitonic Counting Networks:

• When started from an arbitrary state, output is log w smooth (w = width of network)

• Tight lower bound: We demonstrate inputs such that the output is not log k smooth for any k < w

Page 13: Self Stabilizing Smoothing and Counting Maurice Herlihy, Brown University Srikanta Tirthapura, Iowa State University.

Our Results (2)

Self-stabilization of Balancing Networks

• Add extra state and actions• If network begins in illegal state, will

eventually return to a legal state• Upper bound on the time till

stabilization, and extra space required

Page 14: Self Stabilizing Smoothing and Counting Maurice Herlihy, Brown University Srikanta Tirthapura, Iowa State University.

Periodic[w] Counting Network

Block[w] Block[w] Block[w]

Page 15: Self Stabilizing Smoothing and Counting Maurice Herlihy, Brown University Srikanta Tirthapura, Iowa State University.

Block Network:Inductive Definition

Block[2]

Block[4]

Block[4]

000

001

010

011

100

101

110

111

Page 16: Self Stabilizing Smoothing and Counting Maurice Herlihy, Brown University Srikanta Tirthapura, Iowa State University.

Definitions

• Sequence is k-smooth if for all

• Matching layer of balancers for sequences X and Y joins and in a one-to-one correspondence

lxxxX ...

21

kxxji ||

ix i

y

lji ,

Page 17: Self Stabilizing Smoothing and Counting Maurice Herlihy, Brown University Srikanta Tirthapura, Iowa State University.

Matching Lemma

If X and Y are each k-smooth then result of matching X and Y is (k+1)-smooth

Holds irrespective of the orientations of balancers

3

2

1

104

103

102

54

53

53

52

52

51

X

Y

Page 18: Self Stabilizing Smoothing and Counting Maurice Herlihy, Brown University Srikanta Tirthapura, Iowa State University.

Block[w] is (log w)-smooth

• Proof by Induction

• Assume Output of Block[n] is log n smooth

• Show that output of Block[2n] is log (2n) smooth Block[2n

]

Block[n]

Block[n]

A

B

Page 19: Self Stabilizing Smoothing and Counting Maurice Herlihy, Brown University Srikanta Tirthapura, Iowa State University.

Lower Bound

• Worst Case bound: There exist input sequences and initial states such that output of Block[w] is not k-smooth for any k < log w

• Show a fixed-point sequence for Block[w]which is not k-smooth for any k < log w

Page 20: Self Stabilizing Smoothing and Counting Maurice Herlihy, Brown University Srikanta Tirthapura, Iowa State University.

Fixed Point Sequence

Block[2]

Block[4]

Block[4]

5

4

5

6

5

4

6

7

6

5

5

6

5

4

6

7

6

5

5

66

7

5

6

4

5

5

4

Sequence not k-smooth for anyk < log (width)

Page 21: Self Stabilizing Smoothing and Counting Maurice Herlihy, Brown University Srikanta Tirthapura, Iowa State University.

Bitonic Counting Network

Starting from an arbitrary initial state

• Output is always log w smooth, where w=width

• Matching worst case lower bound on smoothness

Page 22: Self Stabilizing Smoothing and Counting Maurice Herlihy, Brown University Srikanta Tirthapura, Iowa State University.

Self Stabilization

• Extra state and actions added to the network

• Self-stabilizing Actions enabled only if network in illegal state otherwise, normal execution

Page 23: Self Stabilizing Smoothing and Counting Maurice Herlihy, Brown University Srikanta Tirthapura, Iowa State University.

Self Stabilization

• Definition:Legal State can be reached in an execution starting from the Correct Initial State

• Natural definition, but hard to use directly, so need alternate characterization

• Local state can be observed easily

• Strategy: Characterize legality in terms of local states

Page 24: Self Stabilizing Smoothing and Counting Maurice Herlihy, Brown University Srikanta Tirthapura, Iowa State University.

Global vs Local States

Page 25: Self Stabilizing Smoothing and Counting Maurice Herlihy, Brown University Srikanta Tirthapura, Iowa State University.

Additional State

Top In

Bot In Bot Out

Top Out

These counters can be bounded – details in paper

Page 26: Self Stabilizing Smoothing and Counting Maurice Herlihy, Brown University Srikanta Tirthapura, Iowa State University.

Local States

• Balancer is Legal if (1)Top In + Bot In = Top Out + Bot Out(2)Toggle State is correct

• Wire is Legal ifTokens entering the wire = Tokens leaving the wire + Tokens in Transit

Page 27: Self Stabilizing Smoothing and Counting Maurice Herlihy, Brown University Srikanta Tirthapura, Iowa State University.

Global Legality in terms of Local

Theorem:

Iff (every wire and every balancer is in legal local state), then (the network is in a legal global state)

Now focus on stabilizing the local states- simpler problem

Page 28: Self Stabilizing Smoothing and Counting Maurice Herlihy, Brown University Srikanta Tirthapura, Iowa State University.

Space and Time Complexity

• Time to Stabilization = d parallel timesteps where d = depth of network

• Total additional space =w = width of network

)( 2wdO

Page 29: Self Stabilizing Smoothing and Counting Maurice Herlihy, Brown University Srikanta Tirthapura, Iowa State University.

Issues

• Lazy versus pro-active stabilization

• Transient Behavior till stabilization might differ from “legal” behavior

• Tokens might be unevenly distributed till then

Page 30: Self Stabilizing Smoothing and Counting Maurice Herlihy, Brown University Srikanta Tirthapura, Iowa State University.

Summary

• Even if bitonic and periodic networks are not initialized, they are log smooth

• If only approximate smoothing is needed, then use (log w) depth uninitialized block network

• Can be converted into 1-smooth behavior by self-stabilization - overhead is small and analytically bounded

Page 31: Self Stabilizing Smoothing and Counting Maurice Herlihy, Brown University Srikanta Tirthapura, Iowa State University.