design and analysis of distributed algorithms santoro 2006 10 27 Cấu trúc dữ liệu và giải thuật

603 22 0
design and analysis of distributed algorithms santoro 2006 10 27 Cấu trúc dữ liệu và giải thuật

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

DESIGN AND ANALYSIS OF DISTRIBUTED ALGORITHMS Nicola Santoro Carleton University, Ottawa, Canada WILEY-INTERSCIENCE A JOHN WILEY & SONS, INC., PUBLICATION CuuDuongThanCong.com Copyright © 2007 by John Wiley & Sons, Inc All rights reserved Published by John Wiley & Sons, Inc., Hoboken, New Jersey Published simultaneously in Canada No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning, or otherwise, except as permitted under Section 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, Inc., 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 750-4470, or on the web at www.copyright.com Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permission Limit of Liability/Disclaimer of Warranty: While the publisher and author have used their best efforts in preparing this book, they make no representations or warranties with respect to the accuracy or completeness of the contents of this book and specifically disclaim any implied warranties of merchantability or fitness for a particular purpose No warranty may be created or extended by sales representatives or written sales materials The advice and strategies contained herein may not be suitable for your situation You should consult with a professional where appropriate Neither the publisher nor author shall be liable for any loss of profit or any other commercial damages, including but not limited to special, incidental, consequential, or other damages For general information on our other products and services or for technical support, please contact our Customer Care Department within the United States at (800) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002 Wiley also publishes its books in a variety of electronic formats Some content that appears in print may not be available in electronic formats For more information about Wiley products, visit our web site at www.wiley.com Library of Congress Cataloging-in-Publication Data: Santoro, N (Nicola), 1951Design and analysis of distributed algorithms / by Nicola Santoro p cm – (Wiley series on parallel and distributed computing) Includes index ISBN-13: 978-0-471-71997-7 (cloth) ISBN-10: 0-471-71997-8 (cloth) Electronic data processing–Distributed processing Computer algorithms QA76.9.D5.S26 2007 005.1–dc22 2006011214 Printed in the United States of America 10 CuuDuongThanCong.com I Title II Series To my favorite distributed environment: My children Monica, Noel, Melissa, Maya, Michela, Alvin CuuDuongThanCong.com CONTENTS Preface xiv Distributed Computing Environments 1.1 Entities 1.2 Communication 1.3 Axioms and Restrictions 1.3.1 Axioms 1.3.2 Restrictions 1.4 Cost and Complexity 1.4.1 Amount of Communication Activities 1.4.2 Time 1.5 An Example: Broadcasting 1.6 States and Events 1.6.1 Time and Events 1.6.2 States and Configurations 1.7 Problems and Solutions ( ) 1.8 Knowledge 1.8.1 Levels of Knowledge 1.8.2 Types of Knowledge 1.9 Technical Considerations 1.9.1 Messages 1.9.2 Protocol 1.9.3 Communication Mechanism 1.10 Summary of Definitions 1.11 Bibliographical Notes 1.12 Exercises, Problems, and Answers 1.12.1 Exercises and Problems 1.12.2 Answers to Exercises 1 4 9 10 10 14 14 16 17 19 19 21 22 22 23 24 25 25 26 26 27 Basic Problems And Protocols 2.1 Broadcast 2.1.1 The Problem 2.1.2 Cost of Broadcasting 2.1.3 Broadcasting in Special Networks 29 29 29 30 32 vii CuuDuongThanCong.com viii CONTENTS 2.2 Wake-Up 2.2.1 Generic Wake-Up 2.2.2 Wake-Up in Special Networks 2.3 Traversal 2.3.1 Depth-First Traversal 2.3.2 Hacking ( ) 2.3.3 Traversal in Special Networks 2.3.4 Considerations on Traversal 2.4 Practical Implications: Use a Subnet 2.5 Constructing a Spanning Tree 2.5.1 SPT Construction with a Single Initiator: Shout 2.5.2 Other SPT Constructions with Single Initiator 2.5.3 Considerations on the Constructed Tree 2.5.4 Application: Better Traversal 2.5.5 Spanning-Tree Construction with Multiple Initiators 2.5.6 Impossibility Result 2.5.7 SPT with Initial Distinct Values 2.6 Computations in Trees 2.6.1 Saturation: A Basic Technique 2.6.2 Minimum Finding 2.6.3 Distributed Function Evaluation 2.6.4 Finding Eccentricities 2.6.5 Center Finding 2.6.6 Other Computations 2.6.7 Computing in Rooted Trees 2.7 Summary 2.7.1 Summary of Problems 2.7.2 Summary of Techniques 2.8 Bibliographical Notes 2.9 Exercises, Problems, and Answers 2.9.1 Exercises 2.9.2 Problems 2.9.3 Answers to Exercises 62 63 65 70 71 74 76 78 81 84 85 89 89 90 90 91 91 95 95 Election 3.1 Introduction 3.1.1 Impossibility Result 3.1.2 Additional Restrictions 3.1.3 Solution Strategies 3.2 Election in Trees 3.3 Election in Rings 3.3.1 All the Way 99 99 99 100 101 102 104 105 CuuDuongThanCong.com 36 36 37 41 42 44 49 50 51 52 53 58 60 62 CONTENTS ix 3.3.2 As Far As It Can 3.3.3 Controlled Distance 3.3.4 Electoral Stages 3.3.5 Stages with Feedback 3.3.6 Alternating Steps 3.3.7 Unidirectional Protocols 3.3.8 Limits to Improvements ( ) 3.3.9 Summary and Lessons Election in Mesh Networks 3.4.1 Meshes 3.4.2 Tori Election in Cube Networks 3.5.1 Oriented Hypercubes 3.5.2 Unoriented Hypercubes Election in Complete Networks 3.6.1 Stages and Territory 3.6.2 Surprising Limitation 3.6.3 Harvesting the Communication Power Election in Chordal Rings ( ) 3.7.1 Chordal Rings 3.7.2 Lower Bounds Universal Election Protocols 3.8.1 Mega-Merger 3.8.2 Analysis of Mega-Merger 3.8.3 YO-YO 3.8.4 Lower Bounds and Equivalences Bibliographical Notes Exercises, Problems, and Answers 3.10.1 Exercises 3.10.2 Problems 3.10.3 Answers to Exercises 109 115 122 127 130 134 150 157 158 158 161 166 166 174 174 174 177 180 183 183 184 185 185 193 199 209 212 214 214 220 222 Message Routing and Shortest Paths 4.1 Introduction 4.2 Shortest Path Routing 4.2.1 Gossiping the Network Maps 4.2.2 Iterative Construction of Routing Tables 4.2.3 Constructing Shortest-Path Spanning Tree 4.2.4 Constructing All-Pairs Shortest Paths 4.2.5 Min-Hop Routing 4.2.6 Suboptimal Solutions: Routing Trees 4.3 Coping with Changes 4.3.1 Adaptive Routing 225 225 226 226 228 230 237 240 250 253 253 3.4 3.5 3.6 3.7 3.8 3.9 3.10 CuuDuongThanCong.com x CONTENTS 4.3.2 Fault-Tolerant Tables 4.3.3 On Correctness and Guarantees 4.4 Routing in Static Systems: Compact Tables 4.4.1 The Size of Routing Tables 4.4.2 Interval Routing 4.5 Bibliographical Notes 4.6 Exercises, Problems, and Answers 4.6.1 Exercises 4.6.2 Problems 4.6.3 Answers to Exercises 255 259 261 261 262 267 269 269 274 274 Distributed Set Operations 5.1 Introduction 5.2 Distributed Selection 5.2.1 Order Statistics 5.2.2 Selection in a Small Data Set 5.2.3 Simple Case: Selection Among Two Sites 5.2.4 General Selection Strategy: RankSelect 5.2.5 Reducing the Worst Case: ReduceSelect 5.3 Sorting a Distributed Set 5.3.1 Distributed Sorting 5.3.2 Special Case: Sorting on a Ordered Line 5.3.3 Removing the Topological Constraints: Complete Graph 5.3.4 Basic Limitations 5.3.5 Efficient Sorting: SelectSort 5.3.6 Unrestricted Sorting 5.4 Distributed Sets Operations 5.4.1 Operations on Distributed Sets 5.4.2 Local Structure 5.4.3 Local Evaluation ( ) 5.4.4 Global Evaluation 5.4.5 Operational Costs 5.5 Bibliographical Notes 5.6 Exercises, Problems, and Answers 5.6.1 Exercises 5.6.2 Problems 5.6.3 Answers to Exercises 277 277 279 279 280 282 287 292 297 297 299 Synchronous Computations 6.1 Synchronous Distributed Computing 6.1.1 Fully Synchronous Systems 333 333 333 CuuDuongThanCong.com 303 306 309 312 315 315 317 319 322 323 323 324 324 329 329 CONTENTS xi 6.1.2 Clocks and Unit of Time 6.1.3 Communication Delays and Size of Messages 6.1.4 On the Unique Nature of Synchronous Computations 6.1.5 The Cost of Synchronous Protocols Communicators, Pipeline, and Transformers 6.2.1 Two-Party Communication 6.2.2 Pipeline 6.2.3 Transformers Min-Finding and Election: Waiting and Guessing 6.3.1 Waiting 6.3.2 Guessing 6.3.3 Double Wait: Integrating Waiting and Guessing Synchronization Problems: Reset, Unison, and Firing Squad 6.4.1 Reset / Wake-up 6.4.2 Unison 6.4.3 Firing Squad Bibliographical Notes Exercises, Problems, and Answers 6.6.1 Exercises 6.6.2 Problems 6.6.3 Answers to Exercises 334 336 336 342 343 344 353 357 360 360 370 378 385 386 387 389 391 392 392 398 400 Computing in Presence of Faults 7.1 Introduction 7.1.1 Faults and Failures 7.1.2 Modelling Faults 7.1.3 Topological Factors 7.1.4 Fault Tolerance, Agreement, and Common Knowledge 7.2 The Crushing Impact of Failures 7.2.1 Node Failures: Single-Fault Disaster 7.2.2 Consequences of the Single Fault Disaster 7.3 Localized Entity Failures: Using Synchrony 7.3.1 Synchronous Consensus with Crash Failures 7.3.2 Synchronous Consensus with Byzantine Failures 7.3.3 Limit to Number of Byzantine Entities for Agreement 7.3.4 From Boolean to General Byzantine Agreement 7.3.5 Byzantine Agreement in Arbitrary Graphs 7.4 Localized Entity Failures: Using Randomization 7.4.1 Random Actions and Coin Flips 7.4.2 Randomized Asynchronous Consensus: Crash Failures 7.4.3 Concluding Remarks 408 408 408 410 413 415 417 417 424 425 426 430 435 438 440 443 443 444 449 6.2 6.3 6.4 6.5 6.6 CuuDuongThanCong.com xii CONTENTS 7.5 Localized Entity Failures: Using Fault Detection 7.5.1 Failure Detectors and Their Properties 7.5.2 The Weakest Failure Detector 7.6 Localized Entity Failures: Pre-Execution Failures 7.6.1 Partial Reliability 7.6.2 Example: Election in Complete Network 7.7 Localized Link Failures 7.7.1 A Tale of Two Synchronous Generals 7.7.2 Computing With Faulty Links 7.7.3 Concluding Remarks 7.7.4 Considerations on Localized Entity Failures 7.8 Ubiquitous Faults 7.8.1 Communication Faults and Agreement 7.8.2 Limits to Number of Ubiquitous Faults for Majority 7.8.3 Unanimity in Spite of Ubiquitous Faults 7.8.4 Tightness 7.9 Bibliographical Notes 7.10 Exercises, Problems, and Answers 7.10.1 Exercises 7.10.2 Problems 7.10.3 Answers to Exercises 449 450 452 454 454 455 457 458 461 466 466 467 467 468 475 485 486 488 488 492 493 Detecting Stable Properties 8.1 Introduction 8.2 Deadlock Detection 8.2.1 Deadlock 8.2.2 Detecting Deadlock: Wait-for Graph 8.2.3 Single-Request Systems 8.2.4 Multiple-Requests Systems 8.2.5 Dynamic Wait-for Graphs 8.2.6 Other Requests Systems 8.3 Global Termination Detection 8.3.1 A Simple Solution: Repeated Termination Queries 8.3.2 Improved Protocols: Shrink 8.3.3 Concluding Remarks 8.4 Global Stable Property Detection 8.4.1 General Strategy 8.4.2 Time Cuts and Consistent Snapshots 8.4.3 Computing A Consistent Snapshot 8.4.4 Summary: Putting All Together 8.5 Bibliographical Notes 500 500 500 500 501 503 505 512 516 518 519 523 525 526 526 527 530 531 532 CuuDuongThanCong.com CONTENTS xiii 8.6 Exercises, Problems, and Answers 8.6.1 Exercises 8.6.2 Problems 8.6.3 Answers to Exercises 534 534 536 538 Continuous Computations 9.1 Introduction 9.2 Keeping Virtual Time 9.2.1 Virtual Time and Causal Order 9.2.2 Causal Order: Counter Clocks 9.2.3 Complete Causal Order: Vector Clocks 9.2.4 Concluding Remarks 9.3 Distributed Mutual Exclusion 9.3.1 The Problem 9.3.2 A Simple And Efficient Solution 9.3.3 Traversing the Network 9.3.4 Managing a Distributed Queue 9.3.5 Decentralized Permissions 9.3.6 Mutual Exclusion in Complete Graphs: Quorum 9.3.7 Concluding Remarks 9.4 Deadlock: System Detection and Resolution 9.4.1 System Detection and Resolution 9.4.2 Detection and Resolution in Single-Request Systems 9.4.3 Detection and Resolution in Multiple-Requests Systems 9.5 Bibliographical Notes 9.6 Exercises, Problems, and Answers 9.6.1 Exercises 9.6.2 Problems 9.6.3 Answers to Exercises 541 541 542 542 544 545 548 549 549 550 551 554 559 561 564 566 566 567 568 569 570 570 572 573 Index 577 CuuDuongThanCong.com ... description and the complexity analysis of protocols and distributed algorithms, the reactive model is more expressive and simpler to understand, to handle, and to use 1.12 EXERCISES, PROBLEMS, AND ANSWERS... processing transmission of messages (re)setting of the alarm clock changing the value of the status register Design and Analysis of Distributed Algorithms, by Nicola Santoro Copyright © 2007... Cataloging-in-Publication Data: Santoro, N (Nicola), 195 1Design and analysis of distributed algorithms / by Nicola Santoro p cm – (Wiley series on parallel and distributed computing) Includes

Ngày đăng: 29/08/2020, 22:06

Tài liệu cùng người dùng

Tài liệu liên quan