24
DISTRIBUTED NETWORK SYSTEMS

DISTRIBUTED NETWORK SYSTEMS - Springer978-0-387-23840-1/1.pdf · 1.4 Software for Distributed Computing 1.4.1 Traditional Client-Server Model 1.4.2 Web-Based Distributed Computing

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: DISTRIBUTED NETWORK SYSTEMS - Springer978-0-387-23840-1/1.pdf · 1.4 Software for Distributed Computing 1.4.1 Traditional Client-Server Model 1.4.2 Web-Based Distributed Computing

DISTRIBUTED NETWORK SYSTEMS

Page 2: DISTRIBUTED NETWORK SYSTEMS - Springer978-0-387-23840-1/1.pdf · 1.4 Software for Distributed Computing 1.4.1 Traditional Client-Server Model 1.4.2 Web-Based Distributed Computing

Managing Editors:

Ding-Zhu DuUniversity of Minnesota, U.S.A.

Cauligi RaghavendraUniversity of Southern Califorina, U.S.A.

Network Theory and ApplicationsVolume 15

Page 3: DISTRIBUTED NETWORK SYSTEMS - Springer978-0-387-23840-1/1.pdf · 1.4 Software for Distributed Computing 1.4.1 Traditional Client-Server Model 1.4.2 Web-Based Distributed Computing

DISTRIBUTED NETWORK SYSTEMSFrom Concepts to Implementations

by

WEIJIA JIACity University of Hong Kong, P.R. China

WANLEI ZHOUDeakin University, Australia

Springer

Page 4: DISTRIBUTED NETWORK SYSTEMS - Springer978-0-387-23840-1/1.pdf · 1.4 Software for Distributed Computing 1.4.1 Traditional Client-Server Model 1.4.2 Web-Based Distributed Computing

eBook ISBN: 0-387-23840-9Print ISBN: 0-387-23839-5

Print ©2005 Springer Science + Business Media, Inc.

All rights reserved

No part of this eBook may be reproduced or transmitted in any form or by any means, electronic,mechanical, recording, or otherwise, without written consent from the Publisher

Created in the United States of America

Boston

©2005 Springer Science + Business Media, Inc.

Visit Springer's eBookstore at: http://ebooks.springerlink.comand the Springer Global Website Online at: http://www.springeronline.com

Page 5: DISTRIBUTED NETWORK SYSTEMS - Springer978-0-387-23840-1/1.pdf · 1.4 Software for Distributed Computing 1.4.1 Traditional Client-Server Model 1.4.2 Web-Based Distributed Computing

ContentsPreface xvii

Acknowledgements xxi

Biography of Authors xxiii

Table of Figures xxv

Chapter 1 Overview of Distributed Network Systems 11.1 Distributed Systems1.2 Computer Networks

1.2.1 Network History1.2.2 Network Architecture1.2.3 Network Fault Tolerance

1.3 Protocols and QoS1.4 Software for Distributed Computing

1.4.1 Traditional Client-Server Model1.4.2 Web-Based Distributed Computing Models1.4.3 Web-based Client-Server Computing

1.5 The Agent-Based Computing Models1.6 SummaryExercises

Chapter 2 Modelling for Distributed Network Systems: TheClient-Server Model

2.1 Issues Leading to the Client-Server Model2.2 The Client-Server Model in a Distributed Computing System

2.2.1 Basic Concepts2.2.2 Features and Problems of the Client-Server Model

2.3 Cooperation between Clients and Servers2.3.1 Cooperation Type and Chained Server2.3.2 Multiple Servers

2.4 Extensions to the Client-Server Model2.4.1 Agents and Indirect Client-Server Cooperation2.4.2 The Three-Tier Client-Server Architecture

2.5 Service Discovery2.5.1 Hardwiring Computer Address2.5.2 Broadcast Approach2.5.3 Name Server Approach2.5.4 Broker-Based Location Lookup

2.6 Client-Server Interoperability2.7 The Relationship2.8 Summary

1223456679

101213

15151616171818192020222425252627282930

Page 6: DISTRIBUTED NETWORK SYSTEMS - Springer978-0-387-23840-1/1.pdf · 1.4 Software for Distributed Computing 1.4.1 Traditional Client-Server Model 1.4.2 Web-Based Distributed Computing

viExercises 30

Chapter 3 Communication Paradigms for DistributedNetwork Systems 33

3.1 Introduction3.2 Message Passing Communication

3.2.1 What is a Message?3.2.2 Message-Passing Mechanisms

3.2.2.1 Basic Message-Passing Primitives3.2.2.2 Direct and Indirect Communication Ports3.2.2.3 Blocking versus Non-blocking Primitives3.2.2.4 Buffered versus Unbuffered Message Passing Primitives3.2.2.5 Unreliable versus Reliable Primitives

3.2.3 Structured Forms of Message-Passing Based Communication3.3 Remote Procedure Calls

3.3.1 Executing Remote Procedure Calls3.3.2 Basic Features and Properties3.3.3 Parameters and Results in RPCs

3.3.3.1 Representation of Parameters and Results3.3.3.2 Marshalling Parameters and Results

3.3.4 Client Server Binding3.4 Message Passing versus Remote Procedure Calls3.5 Group Communication

3.5.1 Basic Concepts3.5.1.1 Group Structures3.5.1.2 Behaviour Classification of Process Groups3.5.1.3 Closed and Open Groups

3.5.2 Group Membership Discovery and Operations3.6 Distributed Shared Memory

3.6.1 What is a Distributed Shared Memory (DSM) System?3.6.2 Design and Implementation Issues

3.6.2.1 Structure3.6.2.2 Synchronization Model3.6.2.3 Consistency3.6.2.4 Update Options3.6.2.5 Granularity3.6.2.6 Thrashing

3.6.3 Consistency Models3.6.3.1 Sequential Consistency Model3.6.3.2 Weak Consistency Model3.6.3.3 Release Consistency Model3.6.3.4 Discussion

3.7 SummaryExercises

Chapter 4 Internetworking4.1 Communication Protocol Architectures

4.1.1 The OSI Protocol Architecture4.1.2 Internet Architecture

33343436363738404244444446474748485051515253535355555757585858596060606161626364

65656568

Page 7: DISTRIBUTED NETWORK SYSTEMS - Springer978-0-387-23840-1/1.pdf · 1.4 Software for Distributed Computing 1.4.1 Traditional Client-Server Model 1.4.2 Web-Based Distributed Computing

vii4.2 TCP/IP Protocol Suite

4.2.1 Communication Protocols4.2.2 Network Layer Protocol: IP

4.2.2.1 IP Address4.2.2.2 Domain Name System

4.2.3 Transport Layer Protocol: TCP and UDP4.3 The Next Generation Internet Protocol: IPv6

4.3.1 Why IPv6?4.3.2 IPv6 Features

4.4 SummaryExercises

Chapter 5 Interprocess Communication using MessagePassing

5.1 Developing Distributed Applications Using Message Passing5.1.1 Communication Services in Message Passing

5.1.1.1 Connection-Oriented and Connectionless Communications5.1.1.2 Reliable Communication

5.1.2 A Generic Framework for Distributed Applications5.2 Sockets

5.2.1 Socket Abstraction5.2.2 BSD Internet Domain Sockets

5.2.2.1 Socket Model5.2.2.2 Internet Domain Socket Naming5.2.2.3 Socket Types

5.3 Basic Socket System Calls5.3.1 Some Special Functions5.3.2 Socket Creation5.3.3 Name Binding5.3.4 Connection Establishment5.3.5 Transfer Data and Discard Sockets

5.4 Examples in C5.4.1 Using Stream Sockets: A Simple Example5.4.2 Using Datagram Sockets: A Simple Example

5.5 SummaryExercises

Chapter 6 TCP/UDP Communication in Java6.1 Java Sockets

6.1.1 Java Net Package6.1.2 The Socket Class6.1.3 The ServerSocket Class

6.2 Building TCP Clients and Servers6.2.1 Essential Components of Communication6.2.2 Implementing a TCP Client Program6.2.3 Implementing a TCP Server Program

6.3 Examples in Java6.3.1 Exchange of Multiple Messages6.3.2 Executing the Programs on Internet Hosts

6970717173737575767777

797979798081818283838485868790909192949498

102102

105105105106107109109109111112112115

Page 8: DISTRIBUTED NETWORK SYSTEMS - Springer978-0-387-23840-1/1.pdf · 1.4 Software for Distributed Computing 1.4.1 Traditional Client-Server Model 1.4.2 Web-Based Distributed Computing

viii6.3.3 Supporting Multiple Clients

6.4 A More Complex Example - A Java Messaging Program using TCP6.4.1 The Design6.4.2 The Implementation6.4.3 The Programs

6.5 Datagram Communications in Java6.5.1 Why Datagram Communication ?6.5.2 Java Datagram-based Classes

6.6 Building UDP Servers and Clients6.6.1 Sending and Receiving UDP Datagrams6.6.2 Datagram Server6.6.3 Datagram Client

6.7 SummaryExercises

Chapter 7 Interprocess Communication using RPC7.1 Distributed Computing Environment (DCE)

7.1.1 The Architecture of DCE7.1.2 The Role of RPC7.1.3 The DCE Services

7.1.3.1 Directory Services7.1.3.2 Security Services7.1.3.3 Time Services7.1.3.4 Distributed File Services

7.2 The DCE/RPC7.2.1 DCE/RPC Facility

7.2.1.1 DCE Application Development7.2.1.2 Location Broker7.2.1.3 RPC Handle7.2.1.4 Concurrent Programming Support

7.2.2 Related Tools7.2.3 Exception Handling

7.3 SUN/RPC7.3.1 Interface Definition Language7.3.2 Security Services7.3.3 Some Issues

7.3.3.1 Call Semantics7.3.3.2 Exception Handling7.3.3.3 Client-Server Binding

7.3.4 Critiques of Sun RPC7.4 The Simple RPC

7.4.1 An Introduction of SRPC7.4.2 Installation7.4.3 The SRPC System Architecture

7.4.3.1 The System Library7.4.3.2 The Location Server

7.4.4 The Stub and Driver Generator7.4.4.1 Syntax7.4.4.2 Semantics

118119120121122127127128130130131132133133

135135135137139140141142143145146146147147148149150151151153154154154154155155155157157157158159159160

Page 9: DISTRIBUTED NETWORK SYSTEMS - Springer978-0-387-23840-1/1.pdf · 1.4 Software for Distributed Computing 1.4.1 Traditional Client-Server Model 1.4.2 Web-Based Distributed Computing

ix7.4.5 Implementation7.4.6 An Application Example

7.5 Remote Method Invocation (RMI)7.5.1 RMI Architecture7.5.2 RMI Implementation7.5.3 Interfaces and Classes

7.6 An Interesting RMI Application7.7 SummaryExercises

Chapter 8 Group Communications8.1 Introduction8.2 Features of Group Communication

8.2.1 Message Delivery Semantics8.2.2 Message Response Semantics8.2.3 Message Ordering in Group Communication

8.3 Reliable Multicast Protocol8.3.1 Reliable Multicast System8.3.2 Design Issues

8.4 Multicast Approaches8.4.1 Centralized Approach8.4.2 Symmetrical Approach (Decentralized)8.4.3 Two-phase Approach

8.5 Multicast in Java8.6 Total Ordered Multicast Protocol based on a Logical Ring

8.6.1 Achieving Total Ordering8.6.2 Atomic Message Delivery8.6.3 Membership

8.6.3.1 Membership Construction8.6.3.2 Dynamic Membership

8.6.4 Fault Tolerance8.6.4.1 Single Member Failure8.6.4.2 Multiple Failures8.6.4.3 Network Partitioning

8.6.5 Efficiency8.7 Implementation Issues

8.7.1 System Structure and Communication Assumptions8.7.2 State Machine Approach for Implementing RMP8.7.3 Message Packet and Control Information8.7.4 Ordering Protocol8.7.5 Membership Protocol

8.8 SummaryExercises

Chapter 9 Reliability and Replication Techniques9.1 Basic Concepts

9.1.1 Fault Tolerance9.1.2 Reliability and Availability9.1.3 Failure Classification

9.2 Techniques to Achieve Reliability

161162163163164167167172173

175175176177177178180180181182182185185186190190192194194195196196198198199200201202203205207209209

213213213216217218

Page 10: DISTRIBUTED NETWORK SYSTEMS - Springer978-0-387-23840-1/1.pdf · 1.4 Software for Distributed Computing 1.4.1 Traditional Client-Server Model 1.4.2 Web-Based Distributed Computing

x9.2.1 Redundancy9.2.2 Fault Avoidance Techniques9.2.3 Fault Detection Techniques9.2.4 Fault Tolerance Techniques

9.3 Software Fault Tolerance9.3.1 Techniques for Software Fault-tolerance

9.4 Reliability Modelling9.4.1 Combinatorial Models9.4.2 Markov Models9.4.3 Fault Coverage and Its Impact on Reliability9.4.4 M-of-N Systems

9.5 Fault Tolerant Distributed Algorithms9.5.1 Distributed Mutual Exclusion9.5.2 Election Algorithms9.5.3 Deadlock Detection and Prevention

9.5.3.1 Distributed Deadlock Detection9.5.3.2 Distributed Deadlock Prevention

9.6 Replication and Reliability9.7 Replication Schemes

9.7.1 Case Study 1: The Primary-Backup Scheme9.7.2 Case Study 2: The Active Replication Scheme9.7.3 Case Study 3: Two Particular Replication Schemes

9.8 The Primary-Peer Replication Scheme9.8.1 Description of the Scheme9.8.2 Replication Transparency

9.9 Replication Consistency9.10 SummaryExercises

Chapter 10 Security10.1 Secure Networks

10.1.1 What is a Secure Network?10.1.2 Integrity Mechanisms and Access Control

10.2 Data Encryption10.2.1 Encryption Principles10.2.2 Basic Encryption Techniques

10.2.2.1 Code Shifting10.2.2.2 Code Mappings10.2.2.3 Key Application10.2.2.4 Bit Shifting

10.3 Cracking the Code10.3.1 Cracking Organizations10.3.2 Cracking Methods

10.4 Security Mechanisms on the Internet10.4.1 Digital Signatures10.4.2 Packet Filtering10.4.3 Internet Firewall

10.5 Distributed Denial of Service Attacks10.5.1 Launching a DDoS Attack

218220220221224225227227230231232233233236236237239240242243245247249249251251253253

255255255256256256259259260260261261261262263263264264265265

Page 11: DISTRIBUTED NETWORK SYSTEMS - Springer978-0-387-23840-1/1.pdf · 1.4 Software for Distributed Computing 1.4.1 Traditional Client-Server Model 1.4.2 Web-Based Distributed Computing

xi10.5.2 Evolution of DDoS Attacks10.5.3 Classification of DDoS Attacks10.5.4 Some Key Technical Methods of DDoS Tools

10.6 Passive Defense against DDoS Attacks10.6.1 Passive Defense Cycle10.6.2 Current Passive Defense Mechanisms10.6.3 Detecting Mechanisms10.6.4 Reacting Mechanisms10.6.5 SYN Attacks and Its Countermeasures10.6.6 Limitation of Passive Defense

10.7 Active Defense against DDoS Attacks10.7.1 Active Defense Cycle10.7.2 Objectives of Active Defense10.7.3 Current Techniques Applicable in Active Defense10.7.4 Comparison between Passive and Active Defense10.7.5 Major Challenges of Active Defense

10.8 SummaryExercises

Chapter 11 A Reactive System Architecture for Fault-Tolerant Computing

11.1 Introduction11.2 The Reactive System Model

11.2.1 The Generic Reactive System Architecture11.2.2 Reactive Modules

11.2.2.1 DMM Agents11.2.2.2 Sensor Actors11.2.2.3 Actuator Actors11.2.2.4 Communication Protocols

11.2.3 Simple and Composite Entities11.3 Group Communication Services

11.3.1 Ordering Constraints11.3.2 Fault Tolerance in the Reactive System11.3.3 Atomic Multicast Service11.3.4 Membership Management

11.4 Implementation Issues11.4.1 Multicast Datagram Communication11.4.2 Stream-based Communication11.4.3 Total Ordering Protocol11.4.4 Multicasting Atomicity Protocol11.4.5 DMM Classes11.4.6 Sensor/Actuator Classes11.4.7 Discussion

11.5 A Fault-Tolerant Application11.5.1 The Replicated Database System11.5.2 Failure Scenario

11.5.2.1 Crash Failure11.5.2.2 The Network Partitioning Failure

11.5.3 Fault Detection

267268270271271271273275280281282282283284290292292293

295295296296297298299299299300301301302303304305305306307308310311311311312313313314315

Page 12: DISTRIBUTED NETWORK SYSTEMS - Springer978-0-387-23840-1/1.pdf · 1.4 Software for Distributed Computing 1.4.1 Traditional Client-Server Model 1.4.2 Web-Based Distributed Computing

xii11.5.3.1 Crash Failure11.5.3.2 Network Partitioning Failure

11.5.4 Fault Tolerance11.5.5 Remarks

11.6 SummaryExercises

Chapter 12 Web-Based Databases12.1 Introduction12.2 Architectures of WBDB

12.2.1 Two-tier Architecture of WBDB12.2.2 Three-tier Architecture of WBDB12.2.3 Hybrid Architecture of WBDB

12.3 Web Based Database Access Technologies12.3.1 Generic SQL12.3.2 Generation 1 (Traditional Web): HTML, HTTP, CGI12.3.3 Generation 2 (Faster and More interactive Web): JavaScript, Server-side API12.3.4 Generation 3 (Java-based Web): Java, JDBC

12.3.4.1 JAVA and JDBC12.3.4.2 Servlet

12.3.5 A New Generation: XML, Client/Mobile Agents/Server12.3.5.1 XML-based WBDB12.3.5.2 Mobile Agent Involved Architecture

12.3.6 Other Useful Techniques12.3.6.1 CORBA12.3.6.2 RMI

12.4 Challenges12.4.1 User Interfaces12.4.2 Application Server12.4.3 Database Server12.4.4 Other Challenges

12.5 A Layered Framework for WBDBs12.5.1 Description of Layers12.5.2 Framework Workflow

12.6 Developing Web-Based Databases12.6.1 The Java Database Connectivity (JDBC) Package12.6.2 Steps for Developing Web-based Databases

12.6.2.1 Preparing the Database12.6.2.2 Creating the Database Tables12.6.2.3 Populating the Tables12.6.2.4 Printing the Columns of Tables12.6.2.5 Select Statements (one table)

12.6.3 Developing A JDBC Application12.7 SummaryExercises

Chapter 13 Mobile Computing13.1 Introduction13.2 Overview of Mobile IP

315317320322323323

325325328329329331331332332

334335335336337337338339339340340341342342343344344346346347348348348350353354355366367

369369371

Page 13: DISTRIBUTED NETWORK SYSTEMS - Springer978-0-387-23840-1/1.pdf · 1.4 Software for Distributed Computing 1.4.1 Traditional Client-Server Model 1.4.2 Web-Based Distributed Computing

xiii13.3 Agent Advertisement and Solicitation

13.3.1 Foreign Agent and Home Agent13.3.2 Mobile Node Considerations13.3.3 Move Detection13.3.4 Returning Home

13.4 Registration13.4.1 Registration Overview13.4.2 Responses to Registration Request and Authentication13.4.3 Registration Related Message Format

13.4.3.1 Registration Request13.4.3.2 Registration Reply

13.5 Mobile Routing (Tunnelling)13.5.1 Packet Routing when Mobile Node is at Home13.5.2 Packet Routing when Mobile Node is on a Foreign Link

13.5.2.1 Unicast Datagram Routing13.5.2.2 Multicast Datagram Packets Routing

13.5.3 Mobile Routers and Networks13.6 Case Study: Mobile Multicast using Anycasting

13.6.1 Problems with Mobile IP13.6.2 Mobile Multicast Protocol (MMP)13.6.3 Performance

13.6.3.1 Analysis13.6.3.2 Simulation Model13.6.3.3 Simulation Results

13.7 SummaryExercises

Chapter 14 Distributed Network Systems: Case Studies14.1 Distributed File Systems

14.1.1 What is a Distributed File System14.1.2 A Distributed File System Example -- NFS14.1.3 Processing User Calls14.1.4 Exporting Files14.1.5 The Role of RPC14.1.6 Remarks

14.2 Network Operating Systems: Unix/Linux14.2.1 UNIX System Concepts

14.2.1.1 The File System14.2.1.2 Process Management14.2.1.3 The Shell

14.2.2 The UNIX Processes14.2.2.1 Process Address Spaces14.2.2.2 Process Management System Calls14.2.2.3 Process Context and Context-Switching

14.2.3 Linux as a UNIX Platform14.2.4 Linux Networking

14.2.4.1 TCP/IP14.2.4.2 PPP and SLIP14.2.4.3 File Sharing with NFS

378381382383384384384386387387388390391391391394394396396398402402403404405405

407407407408409410411412412412412413413414414414415416417417418418

Page 14: DISTRIBUTED NETWORK SYSTEMS - Springer978-0-387-23840-1/1.pdf · 1.4 Software for Distributed Computing 1.4.1 Traditional Client-Server Model 1.4.2 Web-Based Distributed Computing

xiv14.2.4.4 UUCP

14.2.5 Software Development in Linux14.3 CORBA

14.3.1 What is CORBA?14.3.2 The CORBA Architecture14.3.3 Interface Definition Language (IDL)14.3.4 An Example of CORBA for Java

14.4 DCOM14.4.1 COM and DCOM14.4.2 DCOM Facilities and Services

14.4.2.1 Location Transparency14.4.2.2 Dynamic and Remote Object Activation14.4.2.3 Security14.4.2.4 Interfaces14.4.2.5 Binary Interoperability

14.4.3 Applying DCOM14.5 SummaryExercises

Chapter 15 Distributed Network Systems: CurrentDevelopment

15.1 Cluster Computing15.1.1 Cluster Operating Systems15.1.2 Reliable Server Clusters

15.2 Grid Computing15.2.1 What is Grid Computing?15.2.2 Background to the Grid15.2.3 Grid Architectures and Infrastructures

15.2.3.1 Grid Architectures15.2.3.2 Grid Components

15.2.4 Layered Grid Architecture: The Globus Architecture15.2.5 Virtual Machine Environment: The Legion Architecture15.2.6 Cycle Scavenging Schemes: The Condor System15.2.7 Data Grids

15.2.7.1 Kangaroo15.2.7.2 Legion15.2.7.3 Storage Resource Broker15.2.7.4 Globus Data Grid Tools

15.2.8 Research Issues and Challenges for Grids15.2.8.1 Software Engineering Problems15.2.8.2 Load Balancing and Scheduling15.2.8.3 Autonomic Computing15.2.8.4 Replication

15.3 Peer-to-Peer (P2P) Computing15.3.1 What is Peer-to-Peer Computing?15.3.2 Possible Application Areas for P2P Systems15.3.3 Some Existing P2P Projects15.3.4 P2P File Sharing and its Legal implications

15.3.4.1 P2P File Sharing Systems

418419419419420424425427427428428429429430431432432432

435435436439440440441444444444447449452453454454455455457457458459459461461462462464464

Page 15: DISTRIBUTED NETWORK SYSTEMS - Springer978-0-387-23840-1/1.pdf · 1.4 Software for Distributed Computing 1.4.1 Traditional Client-Server Model 1.4.2 Web-Based Distributed Computing

xv15.3.4.2 Legal implications for P2P File Sharing

15.3.5 Some Challenges for P2P Computing15.4 Pervasive Computing

15.4.1 Pervasive Computing Characteristics15.4.2 Elite Care: An Application Using Pervasive Computing15.4.3 The Challenges for Pervasive Computing

15.5 SummaryExercises

ReferencesIndex

465466466466468469470470

472509

Page 16: DISTRIBUTED NETWORK SYSTEMS - Springer978-0-387-23840-1/1.pdf · 1.4 Software for Distributed Computing 1.4.1 Traditional Client-Server Model 1.4.2 Web-Based Distributed Computing

Preface

Both authors have taught the course of “Distributed Systems” for many years in therespective schools. During the teaching, we feel strongly that “Distributed systems”have evolved from traditional “LAN” based distributed systems towards “Internetbased” systems. Although there exist many excellent textbooks on this topic,because of the fast development of distributed systems and networkprogramming/protocols, we have difficulty in finding an appropriate textbook for thecourse of “distributed systems” with orientation to the requirement of theundergraduate level study for today’s distributed technology. Specifically, from up-to-date concepts, algorithms, and models to implementations for both distributedsystem designs and application programming.

Thus the philosophy behind this book is to integrate the concepts, algorithm designsand implementations of distributed systems based on network programming. Afterusing several materials of other textbooks and research books, we found that manytexts treat the distributed systems with separation of concepts, algorithm design andnetwork programming and it is very difficult for students to map the concepts ofdistributed systems to the algorithm design, prototyping and implementations.

This book intends to enable readers, especially postgraduates and seniorundergraduate level, to study up-to-date concepts, algorithms and networkprogramming skills for building modern distributed systems. It enables students notonly to master the concepts of distributed network system but also to readily use thematerial introduced into implementation practices.

The book takes an integrated approach to view the distributed system as a set ofprogramming blocks cooperating on distributed sites. The primary objective of theconcept, design and implementation is to meet the requirements or distributedapplications based on the networking environment. In this book, networking anddistribution design for applications are represented in the form of severaldimensions. Therefore, the book describes the distributed systems along a line fromgeneral distributed system requirement of applications to system transparency thatreflect system structure and algorithm designs and implementation techniques.

The striking features of the book, differs from others, can be illustrated from twobasic aspects:

(1) The viewpoint of applications, i.e., what kinds of concepts and programmingskill are fitted for the design of distributed systems and applications.

(2) The viewpoint of system designer and implementers, i.e., the system layers andtheir mapping to the design of distributed algorithms and their implementations.

The book not only provides the basic distributed systems and networks protocols(such as RPC, group communication and Mobile IP), but it also presents thediscussion of recent technology development for Internet such as IP for nextgeneration (IPv6 and multicast and anycast communication). As Web/Java

Page 17: DISTRIBUTED NETWORK SYSTEMS - Springer978-0-387-23840-1/1.pdf · 1.4 Software for Distributed Computing 1.4.1 Traditional Client-Server Model 1.4.2 Web-Based Distributed Computing

xviiitechnology is getting important and popular nowadays, this book illustrates howa distributed system and network protocols can be designed and implemented withdistributed system concepts and network programming in today’s Internetenvironment.

The book is composed of 15 chapters. Most chapters contain substantial materialsabout concepts, algorithm designs and implementation techniques. The outline of thebook is given below.

Chapter 1. Overview of Distributed Systems: This chapter outlines the basicconcepts of distributed systems and computer networks, such as their purposes,characteristics, advantages, and limitations, as well as their basic architectures,networking and applications.

Chapter 2 introduces the client-server model and its role in the development ofdistributed network systems. The chapter discusses the cooperation between clientsand servers/group servers in distributed network systems, and addresses extensionsto the client-server model. Service discovery, which is of crucial importance forachieving transparency in distributed network systems, is also elaborated in thischapter.

Chapter 3. Communication is an important issue in distributed computing systems:This chapter addresses the communication paradigm of distributed network systems,i.e., issues about how to build the communication model for these systems.

Chapter 4. Internetworking. Network software is arranged in a hierarchy of layers:Each layer presents an interface to the layers above it that extends the properties ofthe underlying communication system. Network functions are achieved through thelayered protocols. This chapter discusses the communication protocols in a network,especially, TCP/IP protocols used on the current Internet. The next generation ofInternet protocol – IPv6 is also addressed in the chapter.

Chapter 5. Interprocess Communication using Message-Passing: Processes in adistributed network system normally do not share common memory. Therefore,message-passing is one of the effective communication mechanisms between theseprocesses. In this chapter we discuss the most commonly used message-passingbased interprocess communication mechanism, i.e., the socket API.

Chapter 6. TCP/UDP Communication in Java: In this chapter we want to address theTCP/UDP programming in Java, since the Java language is currently the mostcommonly used language to implement a distributed computing system. Javaprovides the reliable stream-based communication for TCP as well as the unreliabledatagram communication for UDP.

Chapter 7. Interprocess Communication using RPC: When using message-passingfor interprocess communications, a programmer is aware of the passing of messagesbetween the two processes. However, in a remote procedure call situation, passing ofmessages is invisible to the programmer. Instead, a language-level concept, theprocedure call, is used to mask the actual communication between two processes. Inthis chapter we discuss two commonly used RPC tools, the DCE/RPC and theSUN/RPC. We have developed a RPC tool, called the Simple RPC tool, which willbe described in the chapter. The idea of RPC has been extended to develop

Page 18: DISTRIBUTED NETWORK SYSTEMS - Springer978-0-387-23840-1/1.pdf · 1.4 Software for Distributed Computing 1.4.1 Traditional Client-Server Model 1.4.2 Web-Based Distributed Computing

xixinterprocess communication mechanisms for object-oriented paradigm, notablythe Remote Method Invocation (RMI) in Java. We also introduce this mechanism inthe chapter.

Chapter 8. Group Communications is highly desirable for maintaining a consistentstate in distributed systems. Many existing protocols are quite expensive and oflimited benefit for distributed systems in terms of efficiency. This chapter describesconcepts and design techniques of group communication protocol including messageordering, dynamic assessment of membership and fault tolerance. The protocolensures total ordering of messages and atomicity of delivery in the presence ofcommunication failures and site failures, and guarantees that all operationalmembers belonging to the same group observe a consistent view of ordered events.The dynamic membership and failure recovery algorithms can handle site failuresand recovery; group partitions and merges; dynamic members join and leave.

Chapter 9. Reliability and Replication Techniques: A computer system, or adistributed system consists of many hardware/software components that are likely tofail eventually. In many cases, such failures may have disastrous results. With theever-increasing dependency being placed on distributed systems, the number ofusers requiring fault tolerance is likely to increase. The design and understanding offault-tolerant distributed systems is a very difficult task. We have to deal with notonly all the complex problems of distributed systems when all the components arewell, but also the more complex problems when some of the components fail. Thischapter introduces the basic concepts and techniques that relate to fault-tolerantcomputing.

Chapter 10. Security: There is a pervasive need for measures to guarantee theprivacy, integrity and availability of resources in distributed network systems.Designers of secure distributed systems must cope with exposed service interfacesand insecure networks in an environment where attackers are likely to haveknowledge of the algorithms used and to deploy computing resources. In this chapterwe talk about security issues of distributed network systems, such as integritymechanisms and encryption techniques, and in particular, the techniques for defenseagainst Distributed Denial-of-Service attacks.

Chapter 11. A Reactive System Architecture for Fault-Tolerant Computing: Mostfault-tolerant application programs cannot cope with constant changes in theirenvironments and user requirements because they embed fault-tolerant computingpolicies and mechanisms together so that if policies or mechanisms are changed thewhole programs have to be changed. This chapter presents a reactive systemapproach to overcoming this limitation. The reactive system concepts are anattractive paradigm for system design, development and maintenance because itseparates policies from mechanisms. In the chapter we propose a generic reactivesystem architecture and use group communication primitives to model it. We thenimplement it as a generic package, which can be applied in any distributedapplications. The system performance shows that it can be used in a distributedenvironment effectively.

Chapter 12. Web-Based Databases: World Wide Web has changed the way we dobusiness and research. It also brings a lot of challenges, such as infinite contents,resource diversity, and maintenance and update of contents. Web-based database

Page 19: DISTRIBUTED NETWORK SYSTEMS - Springer978-0-387-23840-1/1.pdf · 1.4 Software for Distributed Computing 1.4.1 Traditional Client-Server Model 1.4.2 Web-Based Distributed Computing

xx(WBDB) is one of the answers to these challenges. In this chapter, we classifyWBDB architectures into three types: two-tier architecture, three-tier architecture,and hybrid architectures, according to WBDB access methods. Then the existingtechnologies used in WBDB are introduced as various generations, i.e. thetraditional Web (generation 1), fast and more interactive Web (generation 2), Java-based Web (generation 3), and a new generation combining the techniques of XMLand mobile agents. Based on the introduction, we provide the challenges and somesolutions for current WBDB. Finally we outline a future framework of WBDB.

Chapter 13. Mobile Computing: Mobile computing requires wirelesscommunication, mobility and portability. In the past few years, we have seen anexplosion of mobile devices over the world such as notebook, multimedia PDA andmobile phones. The rapidly expanding markets of cellular voice and limited dataservice have created a great demand for mobile communication and computing.Mobile communications applications include mobile computing and wirelesscommunications. Many of the advances in communications involve the use ofInternet Protocol (IP), Asynchronous Transfer Mode (ATM), and ad hoc networkprotocols. Recently much focus has been directed at advancing communicationtechnology in the area of mobile wireless networks especially on the IP basedwireless networks. This chapter focuses on two major issues: Mobile IP and mobilemulticast / anycast applications.

Chapter 14. Distributed Network Systems: Case Studies. In the previous chapters wehave discussed various aspects of distributed network systems. Distributed networksystems are now used everywhere, especially on the Internet. In this chapter westudy several well-known distributed network systems, as the examples of ourdiscussion.

Chapter 15. Distributed Network Systems: Current Development. This last chapteroutlines the most recent development in distributed network systems. In particular,we present four “hot” topics that have attracted a lot of attention from both academiaand industry. These topics include: cluster computing, grid computing, peer-to-peercomputing, and pervasive computing. For each topic, we try to outline its currentdevelopment, its potential applications and benefits, and its challenges. The purposeof this chapter is to broaden the reader’s knowledge in distributed network systems.

The book is suitable to any one who needs a informative introduction, basic designand programming strategies of distributed systems and applications. It serves as anidea textbook of one-semester course for senior undergraduates and post-graduates.Chapters 1-6 serve as the basis for the distributed system design and networkprogramming. There are diverse objectives for using the book: (1) For learning ofdistributed operating system design and implementations: Chapters 7, 8, 9, 10, and14 can serve the purpose. (2) For readers who are interested in the design andimplementations of web-based databases and Internet computing, Chapters 7, 8, 12and 15 can be used. (3) To learn the concepts of fault-tolerant distributed systemdesign, Chapters 8,9, 11 will serve the purpose. (4) For understanding group, RPCcommunication protocols and Mobile IP, Chapters 8, 10, 13 will help.

Page 20: DISTRIBUTED NETWORK SYSTEMS - Springer978-0-387-23840-1/1.pdf · 1.4 Software for Distributed Computing 1.4.1 Traditional Client-Server Model 1.4.2 Web-Based Distributed Computing

Acknowledgements

We are grateful to many classes students at City University of Hong Kong andDeakin University who have made a lot of feedbacks to our teaching materials astheir comments inspire us to write this book. Inspirations also come from DingzhuDu, Wei Zhao, Qing Li and Andrzej Goscinski.

The following people gave their time to help us to formulate the book, especially,Changgui Chen, who helped to edit the book and contributed partially to Chapter 13.Yang Xiang contributed partially to Chapter 10; Mingjun Lan contributed partiallyto Chapter 12; and John Casey contributed partially to Section 15.2. Pui-On Au andYujia Wang helped to format the final version of the book.

We would like to acknowledge some support from research grants we have received,in particular, CityU Strategic grant nos. 7001587/7001446 and UGC grant nos.CityU 1055/01E and CityU 1076/00E, the Austalian Research Council Small Grantno. 0504-32409-0132-3501 and the Deakin University Research Grant 0504-23434-3101. Although the research grants are not directly used to support the writing of thebook, some interesting research results presented in the book are taken from ourresearch papers which indeed (partially) supported through these grants. We alsowould like to express our appreciations to the editors in Kluwer AcademicPublishers, especially John Martindale and Angela Quilici, for their excellentprofessional support.

Finally we are grateful to the family of each of us for their consistent and persistentsupports. Weijia would like to present the book to XieMei and Sally. Wanlei wouldlike to present the book to Ling, Lingdi and Andi. Without their support, the bookmay just become some unpublished discussions.

Weijia

Wanlei

1-May-04

Page 21: DISTRIBUTED NETWORK SYSTEMS - Springer978-0-387-23840-1/1.pdf · 1.4 Software for Distributed Computing 1.4.1 Traditional Client-Server Model 1.4.2 Web-Based Distributed Computing

Biography of Authors

Dr. Weijia Jia is an Associate Professor in Department of Computer Science andDepartment of Computer Engineering and Information Tech., City University ofHong Kong. He received his BSc and MSc in Computer Science from Center SouthUniversity (CSU), Changsha, China in 1982 and 1984, respectively. He joined the,CSUT as an Assistant Lecturer in 1984. From 1987 to 1988, as a guest researcher heworked at the Department of Computer Science, University of Ottawa, Canada.From 1988 to 1991, he was a Lecturer in Department of Computer Science, CSU. In1993, he received his PhD in Computer Science from Faculty Polytechnic of Mons,Belgium and joined German National Research Center for Information Technology(GMD) in St. Augustin as a research fellow. In 1995 he joined the Department ofComputer Science, City University of Hong Kong as an assistant professor. Hisresearch interest includes computer network and systems with emphasis onparallel/distributed object group system, communication protocols, real-time andInternet communications. He has published extensively in these fields, especially thefield of Anycast routing and applications. He is a member of IEEE, IEEECommunication Society and IEEE Computer Society.

Dr. Wanlei Zhou is a Chair Professor and Head of School of InformationTechnology, Deakin University, Melbourne, Australia. Dr. Zhou received the B.Engand M.Eng degrees from Harbin Institute of Technology, Harbin, China in 1982 and1984, respectively, and the PhD degree from The Australian National University,Canberra, Australia, in 1991. Before joining Deakin University, Dr. Zhou has been aLecturer in Chengdu Institute of Radio Engineering (University of ElectronicScience and Technology of China), China, a programmer in Apollo/HP atMassachusetts, U.S.A., a Lecturer in National University of Singapore, Singapore,and a Lecturer in Monash University, Melbourne, Australia. His research interestsinclude distributed computing, computer networks, IT security, performanceevaluation, and fault-tolerant computing, and he has published extensively in theseresearch areas. Dr. Zhou is a member of the IEEE and IEEE Computer Society, andthe ACM.

Page 22: DISTRIBUTED NETWORK SYSTEMS - Springer978-0-387-23840-1/1.pdf · 1.4 Software for Distributed Computing 1.4.1 Traditional Client-Server Model 1.4.2 Web-Based Distributed Computing

Table of FiguresFigure 2.1. The basic client-server modelFigure 2.2. Printing service (a service example)Figure 2.3. Indirect client-server cooperationFigure 2.4. Examples of three-tier configurationsFigure 2.5. An example implementation of the three-tier architectureFigure 2.6. Service discovery -- broadcast approachFigure 2.7. Service discovery -- name server and server location lookupFigure 2.8. A distributed computing system architectureFigure 3.1. CORBA CDR messageFigure 3.2. Time diagram of the execution of message-passing primitivesFigure 3.3. Send primitives: (a) blocking; (b) non-blockingFigure 3.4. Blocked send primitiveFigure 3.5. Unbuffered and buffered message passingFigure 3.6. Message passing; (a) unreliable; (b) reliableFigure 3.7. Message-passing semantics. (a) at-least-once; (b) exactly-onceFigure 3.8. An RPC example: a read callFigure 3.9. Group structuresFigure 4.1. The layered protocol modelFigure 4.2. The OSI reference modelFigure 4.3. Comparison of Internet and OSI architecturesFigure 4.4. The Layered TCP/IP protocol suiteFigure 5.1. The distributed application modelFigure 5.2. BSD interprocess socketsFigure 5.3. File and socket descriptorsFigure 5.4. Socket modelFigure 7.1. DCE architectureFigure 7.2. Build a DEC ApplicationFigure 7.3. Using threads in a client-server applicationFigure 7.4. The CDS directory hierarchyFigure 7.5. Components of the DCE directory serviceFigure 7.6. Time synchronisation using intervalsFigure 7.7. Time synchronisation within a multi-LAN cellFigure 7.8. Interactions between DFS componentsFigure 7.9. The RMI architectureFigure 8.1. Causal ordering rule (Group G={S1, S2, S3})Figure 8.2. Causal ordering and total orderingFigure 8.3. Reliable multicast system architectureFigure 8.4. A group comprises of n+1 sitesFigure 8.5. GroupsFigure 8.6. A group of n members form a logical token ringFigure 8.7. Logical token ring structure and normal operationsFigure 8.8. Message transmission exampleFigure 8.9. Dynamic membershipFigure 8.10. System structureFigure 8.11. RMP hierarchy structureFigure 8.12. Packet for logical ring

17182122232627293536393941424346526666687082838384

136138139140141143144145164179180180183184184191192196201203204

Page 23: DISTRIBUTED NETWORK SYSTEMS - Springer978-0-387-23840-1/1.pdf · 1.4 Software for Distributed Computing 1.4.1 Traditional Client-Server Model 1.4.2 Web-Based Distributed Computing

xxviFigure 8.13. Ordered multicastFigure 8.14. Steps taken for RMP to multicast an ordered messageFigure 9.1. A systemFigure 9.2. Fault, error, and failureFigure 9.3. The bathtub curveFigure 9.4. Relationships between MTBF, MTTF, and MTTRFigure 9.5. Reconfigurable duplication architectureFigure 9.6. Reliability block diagram of a series systemFigure 9.7. The example reliability block diagramFigure 9.8. Reliability block diagram of the parallel systemFigure 9.9. Example reliability block diagramFigure 9.10. Reduced reliability block diagramFigure 9.11. State diagram of a TRM systemFigure 9.12. Reduced state diagram of a TMR systemFigure 9.13. Reliability block diagram of a simple parallel systemFigure 9.14. Impact of the fault coverageFigure 9.15. Reliability comparison of TMR and a single moduleFigure 9.16. DeadlockFigure 9.17. False deadlockFigure 9.18. Distributed deadlock detectionFigure 9.19. The Primary-Backup Replication SchemeFigure 9.20. Hot replication implementationsFigure 9.21. The active replication schemeFigure 9.22. The scenario of requests arriving in different ordersFigure 9.23. The Primary-Peer Replication SchemeFigure 10.1. Single (private) key encryptionFigure 10.2. Key distribution serverFigure 10.3. Public key encryptionFigure 10.4. Packet filter in a routerFigure 10.5. Internet firewallFigure 10.6. A hierarchical model of a DDoS attackFigure 10.7. Key methods used before making an effective DDoS attackFigure 10.8. Active defense cycleFigure 11.1. The generic reactive system architectureFigure 11.2. A DMM agentFigure 11.3. Sensors and actuatorsFigure 11.4. Tunnelling multicast packets between subnetsFigure 11.5. The generic sensor architectureFigure 11.6. A distributed replication systemFigure 11.7. Replication manager and database serverFigure 11.8. Using polling sensorsFigure 11.9. Using event sensorsFigure 11.10. Using embedded DMMsFigure 11.11. Using polling sensors for network partitioningFigure 11.12. Using event sensors for partition-tolerant applicationsFigure 12.1. Two-tier architecture of WBDBFigure 12.2. Three-tier architecture of WBDBFigure 12.3. Hybrid architecture of WBDB ( agent-based)

206207214214215218222227228228229229230231231232233237238238243244245247250256258258264264266270282296298301306307312313316316317318319329330331

Page 24: DISTRIBUTED NETWORK SYSTEMS - Springer978-0-387-23840-1/1.pdf · 1.4 Software for Distributed Computing 1.4.1 Traditional Client-Server Model 1.4.2 Web-Based Distributed Computing

xxviiFigure 12.4. Generation 1 framework (CGI-based) of WBDBFigure 12.5. Generation 2 framework (Client and Server-side JavaScript) of WBDB

Figure 12.6. Generation 3 (JDBC-based) framework of WBDBFigure 12.7. Servlet-based framework of WBDBFigure 12.8. XML–based two-tier framework of WBDBFigure 12.9. Mobile agent involved framework of WBDBFigure 12.10. Intelligent interactive framework of WBDBFigure 13.1. Example of Mobile applicationsFigure 13.2. IP TunnelingFigure 13.3. Operation of Mobile Node under Mobile IPFigure 13.4. Operation of Mobile IP on care-of addressFigure 13.5. Operation of Mobile IP on collocated care-of addressFigure 13.6. ICMP Router Advertisement and Mobility Agent Advertisement

Extension MessageFigure 13.7. ICMP Router Solicitation MessageFigure 13.8. The mobility agents (either home or foreign) multicast Agent

AdvertisementFigure 13.9. The message format of Registration Request and Mobile-Foreign

Authentication ExtensionFigure 13.10. The message format of Registration ReplyFigure 13.11. Bi-directional Tunneled Multicast MethodFigure 13.12. MMP topology and Mobile ConnectionsFigure 13.13. Network Topology of the SimulationFigure 13.14. Message delivery delaysFigure 13.15. Number of delivered messagesFigure 14.1. A distributed file system structureFigure 14.2. NFS structureFigure 14.3. OMA Reference ArchitectureFigure 14.4. CORBA client and serverFigure 14.5. CORBA architectureFigure 14.6. Interface inheritance and implementation inheritanceFigure 14.7. Distributed COM is built on top of DCE RPCFigure 14.8. DCOM securityFigure 14.9. DCOM binary specification

333

334335337337339345369373377377378

379379

385

387389397398403404405408409420421422425428430431