E-Book, Englisch, 548 Seiten
Anthony Systems Programming
1. Auflage 2015
ISBN: 978-0-12-800817-1
Verlag: Elsevier Science & Techn.
Format: EPUB
Kopierschutz: Adobe DRM (»Systemvoraussetzungen)
Designing and Developing Distributed Applications
E-Book, Englisch, 548 Seiten
ISBN: 978-0-12-800817-1
Verlag: Elsevier Science & Techn.
Format: EPUB
Kopierschutz: Adobe DRM (»Systemvoraussetzungen)
Systems Programming: Designing and Developing Distributed Applications explains how the development of distributed applications depends on a foundational understanding of the relationship among operating systems, networking, distributed systems, and programming. Uniquely organized around four viewpoints (process, communication, resource, and architecture), the fundamental and essential characteristics of distributed systems are explored in ways which cut across the various traditional subject area boundaries. The structures, configurations and behaviours of distributed systems are all examined, allowing readers to explore concepts from different perspectives, and to understand systems in depth, both from the component level and holistically. - Explains key ideas from the ground up, in a self-contained style, with material carefully sequenced to make it easy to absorb and follow. - Features a detailed case study that is designed to serve as a common point of reference and to provide continuity across the different technical chapters. - Includes a 'putting it all together' chapter that looks at interesting distributed systems applications across their entire life-cycle from requirements analysis and design specifications to fully working applications with full source code. - Ancillary materials include problems and solutions, programming exercises, simulation experiments, and a wide range of fully working sample applications with complete source code developed in C++, C# and Java. - Special editions of the author's established 'workbenches' teaching and learning tools suite are included. These tools have been specifically designed to facilitate practical experimentation and simulation of complex and dynamic aspects of systems.
Richard John Anthony has been a university lecturer for over 20 years with teaching focusing on operating systems, networking, distributed systems, programming and embedded systems; and he has considerable experience in curriculum design in these areas. He also works in commercial projects as a technology consultant and systems developer. Other previous roles include microprocessor technician, network manager, database administrator and senior software developer in a commercial role. This rich mix of experience gives him a good insight across all aspects of computer systems and technology, and the ability to see the big picture view as well as the low-level technology focus. He's also an established and active researcher, having over 90 academic publications in autonomic computing, smart embedded systems and distributed systems, and currently leads a research group in autonomic computing and smart embedded systems. His research is underpinned by strong software design and developmental skills, giving a highly empirical flavor to his work.
Autoren/Hrsg.
Weitere Infos & Material
1;Front Cover;1
2;Systems Programming: Designing and Developing Distributed Applications;4
3;Copyright;5
4;Dedication ;6
5;Contents;8
6;Preface;18
6.1;The origin and purpose of this book;18
6.2;The intended audience;20
6.3;The organization of the book;20
6.3.1;In-text activities;22
6.4;How to use the book;22
6.5;The support materials;24
7;Acknowledgments;26
8;Chapter 1: Introduction;28
8.1;1.1. Rationale;29
8.1.1;1.1.1. The Traditional Approach to Teaching Computer Science;29
8.1.2;1.1.2. The Systems Approach Taken in This Book;31
8.1.2.1;Chapter 2: Process View;31
8.1.2.2;Chapter 3: Communication View;32
8.1.2.3;Chapter 4: Resource View;32
8.1.2.4;Chapter 5: Architecture View;32
8.1.2.5;Chapter 6: Distributed Systems;32
8.1.2.6;Chapter 7: Case Studies—Putting it All Together;33
8.2;1.2. The Significance of Networking and Distributed Systems in Modern Computing—A Brief Historical Perspective;33
8.3;1.3. Introduction to Distributed Systems;36
8.3.1;1.3.1. Benefits and Challenges of Distributed Systems;36
8.3.2;1.3.2. The Nature of Distribution;37
8.3.3;1.3.3. Software Architectures for Distributed Applications;38
8.3.4;1.3.4. Metrics for Measuring the Quality of Distributed Systems and Applications;38
8.3.5;1.3.5. Introduction to Transparency;39
8.3.5.1;1.3.5.1. Access Transparency;39
8.3.5.2;1.3.5.2. Location Transparency;40
8.3.5.3;1.3.5.3. Replication Transparency;40
8.3.5.4;1.3.5.4. Concurrency Transparency;40
8.3.5.5;1.3.5.5. Migration Transparency;40
8.3.5.6;1.3.5.6. Failure Transparency;40
8.3.5.7;1.3.5.7. Scaling Transparency;40
8.3.5.8;1.3.5.8. Performance Transparency;40
8.3.5.9;1.3.5.9. Distribution Transparency;40
8.3.5.10;1.3.5.10. Implementation Transparency;41
8.3.5.11;1.3.5.11. Achieving Transparency;41
8.4;1.4. Introduction to the Case Studies;41
8.4.1;1.4.1. The Main (Distributed Game) Case Study;41
8.4.2;1.4.2. The Additional Case Studies;43
8.5;1.5. Introduction to Supplementary Material and Exercises;43
8.5.1;1.5.1. In-Text Activities;44
8.6;1.6. The Workbenches Suite of Interactive Teaching and Learning Tools;45
8.6.1;1.6.1. Operating Systems Workbench 3.1 “Systems Programming Edition”;46
8.6.2;1.6.2. The Networking Workbench 3.1 “Systems Programming Edition”;46
8.6.3;1.6.3. Distributed Systems Workbench 3.1 “Systems Programming Edition”;46
8.7;1.7. Sample Code and Related Exercises;46
8.7.1;1.7.1. Source Code, in C + +, C#, and Java;46
8.7.2;1.7.2. Application Development Exercises;47
9;Chapter 2: The process View;48
9.1;2.1. Rationale and Overview;49
9.2;2.2. Processes;49
9.2.1;2.2.1. Basic Concepts;49
9.2.2;2.2.2. Creating a Process;50
9.3;2.3. Process Scheduling;55
9.3.1;2.3.1. Scheduling Concepts;59
9.3.1.1;2.3.1.1. Time Slices and Quanta;60
9.3.1.2;2.3.1.2. Process States;64
9.3.1.3;2.3.1.3. Process Behavior;67
9.3.1.3.1;IO-Intensive Processes;67
9.3.1.3.2;Compute-Intensive (or CPU-Intensive) Processes;73
9.3.1.3.3;Balanced Processes;73
9.3.1.4;2.3.1.4. Scheduler Behavior, Components, and Mechanisms;73
9.3.1.5;2.3.1.5. Additional Process States: Suspended-Blocked and Suspended-Ready;74
9.3.1.6;2.3.1.6. Goals of Scheduling Algorithms;75
9.3.1.7;2.3.1.7. Scheduling Algorithms;77
9.3.1.7.1;First Come, First Served (FCFS);77
9.3.1.7.2;Shortest Job First (SJF);77
9.3.1.7.3;Round Robin (RR);77
9.3.1.7.4;Shortest Remaining Job Next (SRJN);80
9.3.1.7.5;Multilevel Queues;80
9.3.1.7.6;Multilevel Feedback Queues (MLFQ);80
9.4;2.4. Scheduling for Real-Time Systems;85
9.4.1;2.4.1. Limitations of General-Purpose Schedulers for Real-Time Systems;86
9.4.1.1;2.4.1.1. The Deadline Scheduling Algorithm;91
9.4.1.2;2.4.1.2. The Rate Monotonic Scheduling Algorithm;91
9.4.1.2.1;Introducing Variable, Bursty Workloads;94
9.5;2.5. Specific Scheduling Algorithms and Variants, Used in Modern Operating Systems;97
9.6;2.6. Interprocess Communication;97
9.6.1;2.6.1. Introduction to Sockets;97
9.7;2.7. Threads: An Introduction;102
9.7.1;2.7.1. General Concepts;102
9.7.2;2.7.2. Thread Implementations;103
9.7.3;2.7.3. Thread Scheduling Approaches;104
9.7.4;2.7.4. Synchronous (Sequential) Versus Asynchronous (Concurrent) Thread Operation;105
9.7.5;2.7.5. Additional Complexity Accompanying Threading;110
9.7.5.1;2.7.5.1. Application Scenarios for Multithreading;111
9.7.6;2.7.6. A Multithreaded IPC Example;111
9.8;2.8. Other Roles of the Operating System;118
9.9;2.9. Use of Timers Within Programs;118
9.9.1;2.9.1. Use of Timers to Simulate Threadlike Behavior;120
9.10;2.10. Transparency from the Process Viewpoint;121
9.10.1;2.10.1. Concurrency Transparency;121
9.10.2;2.10.2. Migration Transparency;121
9.11;2.11. The Case Study from the Process Perspective;122
9.11.1;2.11.1. Scheduling Requirements;122
9.11.2;2.11.2. Use of Timers;122
9.11.3;2.11.3. Need for Threads;123
9.11.4;2.11.4. IPC, Ports, and Sockets;123
9.12;2.12. End-of-Chapter Exercises;124
9.12.1;2.12.1. Questions;124
9.12.2;2.12.2. Exercises with the Workbenches;125
9.12.3;2.12.3. Programming Exercises;130
9.12.4;2.12.4. Answers to End-of-Chapter Questions;131
9.12.5;2.12.5. List of In-text Activities;132
9.12.6;2.12.6. List of Accompanying Resources;132
10;Chapter 3: The Communication View;134
10.1;3.1. Rationale and Overview;135
10.2;3.2. The Communication View;136
10.2.1;3.2.1. Communication Basics;136
10.3;3.3. Communication Techniques;137
10.3.1;3.3.1. One-Way Communication;137
10.3.2;3.3.2. Request-Reply Communication;142
10.3.3;3.3.3. Two-Way Data Transfer;146
10.3.4;3.3.4. Addressing Methodologies;147
10.3.4.1;3.3.4.1. Unicast Communication;147
10.3.4.2;3.3.4.2. Broadcast Communication;147
10.3.4.3;3.3.4.3. Multicast Communication;149
10.3.4.4;3.3.4.4. Anycast Communication;150
10.3.5;3.3.5. Remote Procedure Call;151
10.3.6;3.3.6. Remote Method Invocation;153
10.3.6.1;3.3.6.1. Java Interfaces;154
10.4;3.4. Layered Models of Communication;155
10.4.1;3.4.1. The OSI Model;158
10.4.2;3.4.2. The TCP/IP Model;159
10.5;3.5. The TCP/IP Suite;160
10.5.1;3.5.1. The IP;161
10.5.2;3.5.2. The TCP;163
10.5.3;3.5.3. The TCP Connection;165
10.5.3.1;3.5.3.1. Higher-Layer Protocols That Use TCP as a Transport Protocol;166
10.5.4;3.5.4. The UDP;167
10.5.4.1;3.5.4.1. Higher-Layer Protocols That Use UDP as a Transport Protocol;168
10.5.5;3.5.5. TCP and UDP Compared;168
10.5.6;3.5.6. Choosing Between TCP and UDP;168
10.6;3.6. Addresses;171
10.6.1;3.6.1. Flat Versus Hierarchical Addressing;171
10.6.2;3.6.2. Addresses in the Link Layer;172
10.6.3;3.6.3. Addresses in the Network Layer;172
10.6.3.1;3.6.3.1. IP Addresses;174
10.6.3.2;3.6.3.2. IPv4 Addresses;174
10.6.3.3;3.6.3.3. IPv6 Addresses;175
10.6.3.4;3.6.3.4. Translation Between IP Addresses and MAC Addresses;175
10.6.4;3.6.4. Addresses in the Transport Layer (Ports);175
10.6.5;3.6.5. Well-Known Ports;176
10.7;3.7. Sockets;178
10.7.1;3.7.1. The Socket API: An Overview;179
10.7.2;3.7.2. The Socket API: UDP Primitive Sequence;179
10.7.3;3.7.3. The Socket API: TCP Primitives Sequence;180
10.7.4;3.7.4. Binding (Process to Port);185
10.8;3.8. Blocking and Nonblocking Socket Behaviors;188
10.8.1;3.8.1. Handling Nonblocking Socket Behavior;191
10.8.2;3.8.2. Communication Deadlock;193
10.9;3.9. Error Detection and Error Correction;195
10.9.1;3.9.1. A Brief Introduction to Error Detection and Error Correction Codes;195
10.10;3.10. Application-Specific Protocols;197
10.11;3.11. Integrating Communication with Business Logic;197
10.12;3.12. Techniques to Facilitate Components Locating Each Other;199
10.13;3.13. Transparency Requirements from the Communication Viewpoint;200
10.13.1;3.13.1. Logical and Physical Views of Systems;201
10.14;3.14. The Case Study from the Communication Perspective;201
10.15;3.15. End-of-Chapter Exercises;208
10.15.1;3.15.1. Questions;208
10.15.2;3.15.2. Exercises with the Workbenches;211
10.15.3;3.15.3. Programming Exercises;214
10.15.4;3.15.4. Answers to End-of-Chapter Questions;214
10.15.5;3.15.5. Answers/Outcomes of the Workbench Exercises;216
10.15.6;3.15.6. List of in-Text Activities;217
10.15.7;3.15.7. List of Accompanying Resources;217
10.16;Appendix. Socket API Reference;218
10.16.1;A1. Socket;218
10.16.2;A2. Socket Options;220
10.16.3;A3. Socket Address Formats;221
10.16.4;A4. Setting a Socket to Operate in Blocking or Nonblocking IO Mode;222
10.16.5;A5. Bind;223
10.16.6;A6. Listen;223
10.16.7;A7. Connect;224
10.16.8;A8. Accept;224
10.16.9;A9. Send (Over a TCP Connection);225
10.16.10;A10. Recv (Over a TCP Connection);225
10.16.11;A11. SendTo (Send a UDP Datagram);226
10.16.12;A12. Recvfrom (Receive a UDP Datagram);227
10.16.13;A13. Shutdown;227
10.16.14;A14. CloseSocket;228
11;Chapter 4: The resource View;230
11.1;4.1. Rationale and Overview;231
11.2;4.2. The CPU as a Resource;231
11.3;4.3. Memory as a Resource for Communication;232
11.3.1;4.3.1. Memory Hierarchy;237
11.4;4.4. Memory Management;239
11.4.1;4.4.1. Virtual Memory;244
11.4.1.1;4.4.1.1. VM Operation;245
11.4.1.2;4.4.1.2. Page Replacement Algorithms;246
11.4.1.3;4.4.1.3. General Mechanism;246
11.4.1.4;4.4.1.4. Specific Algorithms;246
11.5;4.5. Resource Management;252
11.5.1;4.5.1. Static Versus Dynamic Allocation of Private Memory Resources;252
11.5.2;4.5.2. Shared Resources;254
11.5.3;4.5.3. Transactions;255
11.5.4;4.5.4. Locks;256
11.5.5;4.5.5. Deadlock;259
11.5.6;4.5.6. Replication of Resources;263
11.6;4.6. The Network as a Resource;265
11.6.1;4.6.1. Network Bandwidth;265
11.6.1.1;4.6.1.1. Minimal Transmissions;266
11.6.1.2;4.6.1.2. Frame Size (Layer 2 Transmission);267
11.6.1.3;4.6.1.3. Packet Size (Layer 3 Transmission);268
11.6.1.4;4.6.1.4. Message Size (Upper Layers Transmission);269
11.6.2;4.6.2. Data Compression Techniques;270
11.6.2.1;4.6.2.1. Lossy Versus Lossless Compression;271
11.6.2.2;4.6.2.2. Lossless Data Compression;271
11.6.2.3;4.6.2.3. Lossy Data Compression;273
11.6.3;4.6.3. Message Format;273
11.6.3.1;4.6.3.1. Fixed Versus Variable-Length Fields;274
11.6.3.2;4.6.3.2. Application-Level PDUs;275
11.6.4;4.6.4. Serialization;275
11.6.5;4.6.5. The Network as a Series of Links;278
11.6.6;4.6.6. Routers and Routing;281
11.6.7;4.6.7. Overheads of Communication;285
11.6.8;4.6.8. Recovery Mechanisms and Their Interplay with Network Congestion;286
11.7;4.7. Virtual Resources;289
11.7.1;4.7.1. Sockets;289
11.7.2;4.7.2. Ports;289
11.7.3;4.7.3. Network Addresses;290
11.7.4;4.7.4. Resource Names;290
11.8;4.8. Distributed Application Design Influences on Network Efficiency;291
11.9;4.9. Transparency from the Resource Viewpoint;292
11.9.1;4.9.1. Access Transparency;292
11.9.2;4.9.2. Location Transparency;292
11.9.3;4.9.3. Replication Transparency;292
11.9.4;4.9.4. Concurrency Transparency;292
11.9.5;4.9.5. Scaling Transparency and Performance Transparency;293
11.10;4.10. The Case Study from the Resource Perspective;293
11.11;4.11. End-of-Chapter Exercises;295
11.11.1;4.11.1. Questions;295
11.11.2;4.11.2. Exercises with the Workbenches;296
11.11.3;4.11.3. Programming Exercises;299
11.11.4;4.11.4. Answers to End-of-Chapter Questions;300
11.11.5;4.11.5. Answers/Outcomes of the Workbenches Exercises;301
11.11.6;4.11.6. List of in-Text Activities;303
11.11.7;4.11.7. List of Accompanying Resources;303
12;Chapter 5: The Architecture View;304
12.1;5.1. Rationale and Overview;306
12.2;5.2. The Architecture View;306
12.2.1;5.2.1. Separation of Concerns;307
12.2.2;5.2.2. Networking and Distribution;308
12.2.3;5.2.3. Complexity in Distributed Systems;309
12.2.4;5.2.4. Layered Architectures;310
12.2.5;5.2.5. Hierarchical Architectures;312
12.3;5.3. Heterogeneity;314
12.3.1;5.3.1. Definitions and Sources of Heterogeneity;314
12.3.2;5.3.2. Performance Heterogeneity;315
12.3.3;5.3.3. Platform Heterogeneity;316
12.3.4;5.3.4. Operating System Heterogeneity;317
12.3.5;5.3.5. Impact of Heterogeneity;317
12.3.6;5.3.6. Porting of Software;319
12.4;5.4. Hardware and System-Level Architectures;320
12.4.1;5.4.1. Tightly Coupled (Hardware) Systems;320
12.4.2;5.4.2. Loosely Coupled (Hardware) Systems;321
12.4.3;5.4.3. Parallel Processing;322
12.5;5.5. Software Architectures;323
12.5.1;5.5.1. Coupling Between Software Components;324
12.6;5.6. Taxonomy of Software Architecture Classes;329
12.6.1;5.6.1. Single-Tier Applications;329
12.6.2;5.6.2. Two-Tier Applications;329
12.6.3;5.6.3. Three-Tier Applications;331
12.6.4;5.6.4. Multitier Applications;331
12.7;5.7. Client-Server;332
12.7.1;5.7.1. Lifetimes of Client and Server;332
12.7.2;5.7.2. Active and Passive Sides of the Connection;333
12.7.3;5.7.3. The CS Architectural Model;333
12.7.4;5.7.4. Variants of the CS Model;335
12.7.5;5.7.5. Stateful Versus Stateless Services;336
12.7.6;5.7.6. Modular and Hierarchical CS Systems;337
12.8;5.8. Three-Tier and Multitier Architectures;339
12.9;5.9. Peer-to-Peer;350
12.9.1;5.9.1. Characteristics of Peer-to-Peer Applications;350
12.9.2;5.9.2. Complexity of Peer-to-Peer Connectivity;351
12.9.3;5.9.3. Exploring Peer-to-Peer Behavior;352
12.10;5.10. Distributed Objects;356
12.11;5.11. Middleware: Support for Software Architectures;358
12.11.1;5.11.1. Middleware Operation, an Overview;358
12.12;5.12. System Models of Collective Resources and Computation Resource Provision;360
12.12.1;5.12.1. Clusters;361
12.12.2;5.12.2. Grids;361
12.12.3;5.12.3. Data Centers;362
12.12.4;5.12.4. Clouds;362
12.13;5.13. Software Libraries;362
12.13.1;5.13.1. Software Library Case Example;365
12.13.1.1;5.13.1.1. A Brief Description of the Original Code;366
12.13.1.2;5.13.1.2. Refactoring Example for the MediaShare_Peer Application;368
12.13.1.3;5.13.1.3. Library Example for the MediaShare_Peer Application;368
12.13.2;5.13.2. Static Linking and Dynamic Linking;371
12.13.2.1;5.13.2.1. Static Linking;371
12.13.2.2;5.13.2.2. Dynamic Linking;371
12.13.2.3;5.13.2.3. Trade-Offs Between Static and Dynamic Libraries;372
12.13.3;5.13.3. Language-Dependent Feature: The C/C + + Header File;373
12.14;5.14. Hardware Virtualization;375
12.14.1;5.14.1. Virtual Machines;376
12.14.2;5.14.2. Java Virtual Machine;377
12.15;5.15. Static and Dynamic Configurations;378
12.15.1;5.15.1. Static Configuration;378
12.15.2;5.15.2. Dynamic Configuration;379
12.15.3;5.15.3. Context Awareness;379
12.16;5.16. Nonfunctional Requirements of Distributed Applications;380
12.16.1;5.16.1. Replication;382
12.16.2;5.16.2. Semantics of Replication;385
12.16.3;5.16.3. An Implementation of Replication;386
12.17;5.17. The Relationship Between Distributed Applications and Networks;396
12.18;5.18. Transparency from the Architecture Viewpoint;398
12.19;5.19. The Case Study from the Architectural Perspective;399
12.19.1;5.19.1. Stateful Server Design;399
12.19.2;5.19.2. Separation of Concerns for the Game Components;400
12.19.2.1;5.19.2.1. CS Variant;400
12.19.2.2;5.19.2.2. Client and Server Lifetimes;400
12.19.3;5.19.3. Physical and Logical Architectures of the Game Application;401
12.19.4;5.19.4. Transparency Aspects of the Game;402
12.20;5.20. End-of-Chapter Exercises;403
12.20.1;5.20.1. Questions;403
12.20.2;5.20.2. Programming Exercises;404
12.20.3;5.20.3. Answers to end-of-Chapter Questions;405
12.20.4;5.20.4. List of in-Text Activities;407
12.20.5;5.20.5. List of Accompanying Resources;408
12.21;Appendix. The Peer-to-Peer Application-Level Protocol Message Sequence;409
13;Chapter 6: Distributed Systems;410
13.1;6.1. Rationale and Overview;412
13.2;6.2. Transparency;412
13.2.1;6.2.1. Access Transparency;414
13.2.2;6.2.2. Location Transparency;415
13.2.3;6.2.3. Replication Transparency;416
13.2.3.1;6.2.3.1. Invalidation;419
13.2.3.2;6.2.3.2. Two-Phase Commit (2PC) Protocol;419
13.2.4;6.2.4. Concurrency Transparency;420
13.2.4.1;6.2.4.1. Transactions;422
13.2.5;6.2.5. Migration Transparency;425
13.2.6;6.2.6. Failure Transparency;425
13.2.6.1;6.2.6.1. Support for Failure Transparency;426
13.2.7;6.2.7. Scaling Transparency;427
13.2.7.1;6.2.7.1. Communication Intensity: Impact on Scalability;428
13.2.8;6.2.8. Performance Transparency;430
13.2.8.1;6.2.8.1. Support for Performance Transparency;430
13.2.9;6.2.9. Distribution Transparency;431
13.2.10;6.2.10. Implementation Transparency;431
13.3;6.3. Common Services;431
13.4;6.4. Name Services;432
13.4.1;6.4.1. Name Service Operation;433
13.4.2;6.4.2. Directory Service;434
13.4.3;6.4.3. Challenges of Name Service Design and Implementation;440
13.5;6.5. Domain Name System (DNS);441
13.5.1;6.5.1. Domain Namespace;442
13.5.2;6.5.2. DNS Implementation;444
13.5.3;6.5.3. DNS Name Servers: Authority and Delegation;447
13.5.4;6.5.4. Replication;448
13.5.5;6.5.5. Name Resolution in More Detail;449
13.5.6;6.5.6. Caching in DNS;450
13.5.7;6.5.7. Exploring Address Resolution;450
13.5.8;6.5.8. Reverse DNS Lookup;453
13.6;6.6. Time Services;454
13.6.1;6.6.1. Time Services;454
13.6.1.1;6.6.1.1. TIME Protocol;454
13.6.1.2;6.6.1.2. DAYTIME Protocol;454
13.6.1.3;6.6.1.3. Network Time Protocol (NTP);455
13.6.2;6.6.2. Physical Clock Synchronization;455
13.6.2.1;6.6.2.1. Physical Clock Synchronization Techniques;457
13.6.2.2;6.6.2.2. Cristian's Algorithm;458
13.6.2.3;6.6.2.3. The Berkeley Algorithm;459
13.6.3;6.6.3. Logical Clocks and Synchronization;460
13.6.3.1;6.6.3.1. Event Ordering Using Logical Clocks;461
13.6.3.2;6.6.3.2. Logical Clock Implementation;462
13.7;6.7. Election Algorithms;463
13.7.1;6.7.1. Operation Overview;464
13.7.2;6.7.2. The Bully Election Algorithm;466
13.7.3;6.7.3. The Ring Election Algorithm;467
13.7.4;6.7.4. Leader Preelection;467
13.7.5;6.7.5. Exploration with an Election Algorithm;468
13.8;6.8. Group Communications;475
13.8.1;6.8.1. Transparency Aspects of Group Communication;477
13.9;6.9. Notification Services;477
13.9.1;6.9.1. Publish-Subscribe Services;478
13.10;6.10. Middleware: Mechanism and Operation;479
13.11;6.11. Middleware Examples and Support Technologies;481
13.11.1;6.11.1. The Common Object Request Broker Architecture (CORBA);481
13.11.1.1;6.11.1.1. Motivation for CORBA;481
13.11.1.2;6.11.1.2. Object Adapter and Skeleton;483
13.11.1.3;6.11.1.3. CORBA Object Servers and Activation Policy;485
13.11.1.4;6.11.1.4. CORBA's Repositories;485
13.11.1.5;6.11.1.5. Static Method Invocation;485
13.11.1.6;6.11.1.6. Dynamic Method Invocation;486
13.11.1.7;6.11.1.7. OMG Interface Definition Language (IDL);488
13.11.1.8;6.11.1.8. CORBA Application Development;488
13.11.1.9;6.11.1.9. Automatic Code Generation in CORBA;488
13.11.2;6.11.2. Interface Definition Language (IDL);489
13.11.3;6.11.3. Extensible Markup Language;491
13.11.4;6.11.4. JavaScript Object Notation (JSON);492
13.11.5;6.11.5. Web Services and REST;493
13.11.5.1;6.11.5.1. Representational State Transfer (REST);493
13.11.6;6.11.6. The Simple Object Access Protocol (SOAP);494
13.12;6.12. Deterministic and Nondeterministic Aspects of Distributed Systems;495
13.13;6.13. End of Chapter Exercises;497
13.13.1;6.13.1. Questions;497
13.13.2;6.13.2. Programming Exercises;497
13.13.3;6.13.3. Answers to End of Chapter Questions;499
13.13.4;6.13.4. List of In-Text Activities;500
13.13.5;6.13.5. List of Accompanying Resources;500
14;Chapter 7: Case Studies: Putting it all Together;502
14.1;7.1. Rationale and Overview;503
14.2;7.2. Introduction to the Use Cases;503
14.3;7.3. Case Study #1: Time Service Client (with Library);504
14.3.1;7.3.1. Learning Outcomes Associated with the Case Study;504
14.3.2;7.3.2. Requirements Analysis;504
14.3.3;7.3.3. Architecture and Code Structure;505
14.3.4;7.3.4. Separation of Concerns;510
14.3.5;7.3.5. Coupling and Binding Between Components;511
14.3.5.1;7.3.5.1. Client Binding to Time Servers;511
14.3.6;7.3.6. Communication Aspects of the Design;511
14.3.6.1;7.3.6.1. Message Types and Semantics;512
14.3.6.2;7.3.6.2. NTP Protocol Definition Unit (PDU);512
14.3.6.3;7.3.6.3. URL Resolution with DNS;514
14.3.6.4;7.3.6.4. Rationale for the Chosen Communication Design;514
14.3.7;7.3.7. Implementation;515
14.3.8;7.3.8. Testing;515
14.3.9;7.3.9. Transparency Aspects of the Use Case;516
14.3.10;7.3.10. Case Study Resources;518
14.4;7.4. Case Study #2: Event Notification Service;519
14.4.1;7.4.1. Learning Outcomes Associated with the Case Study;519
14.4.2;7.4.2. Requirements Analysis;520
14.4.3;7.4.3. Architecture and Code Structure;521
14.4.4;7.4.4. Separation of Concerns;522
14.4.5;7.4.5. Coupling and Binding Between Components;522
14.4.5.1;7.4.5.1. Application-Level Coupling;522
14.4.6;7.4.6. Communication Aspects of the Design;523
14.4.6.1;7.4.6.1. ENS Message Types;526
14.4.6.2;7.4.6.2. ENS Communication Semantics;526
14.4.6.3;7.4.6.3. DS Message Types;527
14.4.6.4;7.4.6.4. DS Communication Semantics;528
14.4.7;7.4.7. An Application Use Scenario to Illustrate the Use of the ENS;528
14.4.8;7.4.8. Testing ( Table 7.2) ;530
14.4.9;7.4.9. Transparency Aspects of the ENS;530
14.4.10;7.4.10. Case Study Resources;535
14.5;7.5. Good Design Practice for Distributed Applications;535
14.5.1;7.5.1. Requirements Analysis;536
14.5.2;7.5.2. Architectural Aspects;536
14.5.3;7.5.3. Communication Aspects;537
14.5.4;7.5.4. Reuse Code When Opportunities Arise;537
14.5.5;7.5.5. Create Libraries of Tested and Trusted Code;538
14.5.6;7.5.6. Testing Aspects;538
14.6;7.6. End of Chapter Programming Exercises;539
14.7;7.7. List of Accompanying Resources;540
15;Index;542
Chapter 1 Introduction
Abstract
This chapter introduces the book, its structure, the way the technical material is organised and the motivation behind this. It provides a historical perspective and explains the significance of distributed systems in modern computing. It also explains the integrative, cross-discipline nature of the presentation used in the book and the underlying ‘systems thinking’ approach. It describes and justifies the way that material has been presented from four carefully selected viewpoints (ways of looking at systems structure, organisation and behaviour). These viewpoints have been chosen to overcome the artificial boundaries that are introduced when material is divided for the purposes of teaching into traditional categorisations of operating systems, networking, distributed systems, and programming; whereas many of the key concepts pertinent to the design and development of distributed applications overlap several of these areas or reside in the margins between these areas. This chapter also provides an essential concise introductory discussion of distributed systems to set the scene for the four core chapters which follow. Distributed systems are then examined in depth in Chapter 6. There is also an introduction to the three case studies and the extensive supplemental technical resources. Keywords Transparency QoS metrics Functional requirements Nonfunctional requirements Software architectures Case studies. Chapter Contents 1.1 Rationale 2 1.1.1 The Traditional Approach to Teaching Computer Science 2 1.1.2 The Systems Approach Taken in This Book 4 Chapter 2: Process View 4 Chapter 3: Communication View 5 Chapter 4: Resource View 5 Chapter 5: Architecture View 5 Chapter 6: Distributed Systems 5 Chapter 7: Case Studies—Putting it All Together 6 1.2 The Significance of Networking and Distributed Systems in Modern Computing—A Brief Historical Perspective 6 1.3 Introduction to Distributed Systems 9 1.3.1 Benefits and Challenges of Distributed Systems 9 1.3.2 The Nature of Distribution 10 1.3.3 Software Architectures for Distributed Applications 11 1.3.4 Metrics for Measuring the Quality of Distributed Systems and Applications 11 1.3.5 Introduction to Transparency 12 1.3.5.1 Access Transparency 12 1.3.5.2 Location Transparency 13 1.3.5.3 Replication Transparency 13 1.3.5.4 Concurrency Transparency 13 1.3.5.5 Migration Transparency 13 1.3.5.6 Failure Transparency 13 1.3.5.7 Scaling Transparency 13 1.3.5.8 Performance Transparency 13 1.3.5.9 Distribution Transparency 13 1.3.5.10 Implementation Transparency 14 1.3.5.11 Achieving Transparency 14 1.4 Introduction to the Case Studies 14 1.4.1 The Main (Distributed Game) Case Study 14 1.4.2 The Additional Case Studies 16 1.5 Introduction to Supplementary Material and Exercises 16 1.5.1 In-Text Activities 17 1.6 The Workbenches Suite of Interactive Teaching and Learning Tools 18 1.6.1 Operating Systems Workbench 3.1 “Systems Programming Edition” 19 1.6.2 The Networking Workbench 3.1 “Systems Programming Edition” 19 1.6.3 Distributed Systems Workbench 3.1 “Systems Programming Edition” 19 1.7 Sample Code and Related Exercises 19 1.7.1 Source Code, in C++, C#, and Java 19 1.7.2 Application Development Exercises 20 This book is a self-contained introduction to designing and developing distributed applications. It brings together the essential supporting theory from several key subject areas and places the material into the context of real-world applications and scenarios with numerous clearly explained examples. There is a strong practical emphasis throughout the entire book, involving programming exercises and experiments for the reader to engage in, as well as three detailed fully functional case studies, one of which runs through the four core chapters, places theory aspects into application perspectives, and cross-links across the various themes of the chapters. The book is an ideal companion text for undergraduate degree courses. This chapter introduces the book, its structure, the way the technical material is organized, and the motivation behind this. It provides a historical perspective and explains the significance of distributed systems in modern computing. It also explains the integrative, cross-discipline nature of the presentation and the underlying “systems thinking” approach. It describes and justifies the way that material has been presented from four carefully selected viewpoints (ways of looking at systems, structure, organization, and behavior). These viewpoints have been chosen to overcome the artificial boundaries that are introduced when material is divided for the purposes of teaching into traditional categorizations of operating systems, networking, distributed systems, and programming; whereas many of the key concepts pertinent to distributed systems overlap several of these areas or reside in the margins between these areas. The overall goal of the book is to furnish the reader with a rounded understanding of the architecture and communication aspects of systems, and also the theoretical underpinning necessary to understand the various design choices available and to be able to appreciate the consequences of the various design decisions and tradeoffs. Upon reaching the end of this book, the reader will be equipped to design and build their first distributed application. The technical content is brought alive through an interactive style which incorporates practical activities, examples, sample code, analogies, exercises, and case studies. Many practical experiments and simulation activities are provided by a special edition of the author’s established Workbenches teaching and learning resources suite. Application examples are provided throughout the book to put the conceptual aspects into perspective. These are backed up by extensive source code and a mix of theory and practice exercises to enhance both skills and supporting knowledge. 1.1 Rationale
1.1.1 The Traditional Approach to Teaching Computer Science
Computer science is an extremely broad field of knowledge, encompassing diverse topics which include systems architectures, systems analysis, data structures, programming languages, software engineering techniques, operating systems, networking and communication among many others. Traditionally, the subject material within computer science has been divided into these topic areas (disciplines) for the pragmatic purposes of teaching at universities. Hence, a student will study Operating Systems as one particular subject, Networking as another, and Programming as another. This model works well in general, and has been widely implemented as a means of structuring learning in this field. However, there are many aspects of computer systems which cut across the boundaries of several of these disciplines, and cannot be fully appreciated from the viewpoint of any single one of these disciplines; so to gain a deep understanding of the way systems work, it is necessary to study systems holistically across several disciplines simultaneously. One very important...