本书特色:
·专门为本科生和研究生设计
·突出显示关键术语、保留字和标识符:用粗体显示关键术语和短语;用斜体显示特殊单词,比如程序的标识符、非标准的协议名称或操作名称;Java语言和协议的保留字和标识符也用斜体显示
·重点讨论计算抽象(也称为细节隐藏)和范例
·揉合了概念与实践,使用示范代码和动手练习来说明和巩固所提出的概念
·为learn by doing教学而设计,提供了示范代码和实验活动
·提供教辅,包括演示文稿、示范代码、网站和教师手册
·提供参考文献,供读者进一步探索分布式计算领域
通过本书的阅读,读者能应用基本的分布式编程技术来建立网络服务和网络应用。
Preface
Acknowledgments
CHAPTTER 1
Distributed Computing, An Introduction
1.1 Definitions
1.2 The History of Distributed Computing
1.3 Different Forms of Computing
1.4 The Strengths and Weaknesses of Distributed Computing
1.5 Basics of Operating Systems
1.6 Network Basics
1.7 Software Engineering Basics
Summary
Exercises
References
CHAPTER 2
Interprocess Communications
2.1 An Archetypal IPC Program Interface
2.2 Event Synchronization
2.3 Timeouts and Threading
2.4 Deadlocks and Timeouts
2.5 Data Representation
2.6 Data Encoding
2.7 Text-Based Protocols
2.8 Request-Response Protocols
2.9 Event Diagram and Sequence Diagram
2.10 Connection-Oriented versus Connectionless IPC
2.11 The Evolution of Paradigms for Interprocess Communications
Summary
Exercises
References
CHAPTER 3
Distributed Commputing Paradigms
3.1 Paradigms and Abstraction
3.2 An Example Application
3.3 Paradigms for Distributed Applications
3.4 Trade-offs
Summary
Exercises
References
CHAPTER 4
The Socket API
4.1 Background
4.2 The Socket Metaphor in IPC
4.3 The Datagram Socket API
4.4 The Stream-Mode Socket API
4.5 Sockets with Nonblocking I/O Operations
4.6 Secure Socket API
Summary
Exercises
References
CHAPTER 5
The Client-Server Paradigm
5.1 Background
5.2 Client-Server Paradigm Issues
5.3 Software Engineering for a Network Service
5.4 Connection-Oriented and Connectionless Servers
5.5 Iterative Server and Concurrent Server
5.6 Stateful Servers
Summary
Exercises
References
CHAPTER 6
Group Communication
6.1 Unicasting versus Multicasting
6.2 An Archetypal Multicast API
6.3 Connectionless versus Connection-Oriented Multicast
6.4 Reliable Multicasting versus Unreliable Multicasting
6.5 The Java Basic Multicast API
6.6 Reliable Multicast API
Summary
Exercises
References
CHAPTER 7
Distributed Objects
7.1 Message Passing versus Distributed Objects
7.2 An Archetypal Distributed Object Architecture
7.3 Distributed Object Systems
7.4 Remote Procedure Calls
7.5 Remote Method Invocation
7.6 The Java RMI Architecture
7.7 The API for the Java RMI
7.8 A Sample RMI Application
7.9 Steps for Building an RMI Application
7.10 Testing and Debugging
7.11 Comparison of RMI and Socket APIs
7.12 Food for Thought
Summary
Exercises
References
CMAPTER 8
Advanced RMI
8.1 Client Callback
8.2 Stub Downloading
8.3 RMI Security Manager
Summary
Exercises
References
CHAPTER 9
Internet Applications
9.1 HTML
9.2 XML-The Extensible Markup Language
9.3 HTTP
9.4 Dynamically Generated Web Contents
9.5 Common Gateway Interface (CGI)
9.6 Web Session and Session State Data
Summary
Exercises
References
CHAPTER 10
The Common Object Request Broker Architecture
10.1 The Basic Architecture
10.2 The CORBA Object Interface
10.3 Inter-ORB Protocols
10.4 Object Servers and Object Clients
10.5 CORBA Object References
10.6 CORBA Naming Service and the Interoperable
10.7 CORBA Object Services
10.8 Object Adapters
10.9 Java IDL
10.10 Trade-offs
Summary
Exercises
References
CHAPTER 11
Internet Applications-Part 2
11.1 Applets
11.2 Servlets
11.3 Web Services
11.4 The Simple Object Access Protocol(SOAP)
Summary
Exercises
References
CHAPTER 12
Advanced Distributed Commputing Paradigms
12.1 Message Queue System Paradigm
12.2 Mobile Agents
12.3 Network Services
12.4 Object Spaces
Summary
Exercises
References
Epilogue
Index
In the Year 2001 Model Curricula for Computing (Computing Curricula 2001) (http://www. computer, org/education/cc2OO1/report/index.html) developed by the Joint IEEE Computer Society/ACM Task Force, net-centric computing is included as a key area in the Computer Science body of knowledge:
Recent advances in computer and telecommunications networking, particularly those based on TCP/IP, have increased the importance of networking technologies in the computing discipline. Net-centric computing covers a range of subspecialties, including computer communication network concepts and protocols, multi-media systems, Web standards and technologies, network security, wireless and obile computing, and distributed systems.
Mastery of this subject., area involves both theory and practice. Learning experiences that involve hands-on experimentation and analysis are strongly recommended as they reinforce student understanding of concepts and their application to real-world problems. Laboratory experiments should involve data collection and synthesis, empirical modeling, protocol analysis at the source code level, net-work packet monitoring, software construction, and evaluation of alternative design models. All of these are important concepts that can be best understood by laboratory experimentation.
The ACM model curricula lists a number of topics in this area, specifying a minimum of 15 hours of core .topics and additional elective topics. Many of these topics are covered in a series of courses in distributed computing that I initiated and have taught at California Polytechnic State University (Cai Poly), San Luis Obispo, since 1996. For these courses I employed excerpts from various publications, as well as materials I developed, including overhead slides, code sampies, and laboratory/problem/research assignments, which I provided as a course.package to my students. This textbook is a synthesis of the course materials I accumulated over a span of six years, designed fora sequence of technical elective courses for upper-division undergraduates.
Reasons for the Book
Traditionally, distributed computing courses are offered at the graduate level. With the growth of Internet and intranet applications, more and more under-graduate students are engaged in net-centric computing, either at the workplace or on their own initiative. Distributed computing is distinct from (1) communications and networks and (2) distributed operating systems. It operates at a higher level of abstraction than the network layer and the operating systems layer and deals with programming paradigms, application program interfaces (APIs) or toolkits, and protocols and standards in the context of net-centric computing. Although there are numerous books available on network programming and technologies, there is a lack of books written in a textbook style, combining the theory and practice of distributed computing.
This book has the following distinctive features:
· It is designed to introduce undergraduate students to the principles of distributed computing, topics formerly reserved for graduate students.
· It focuses on the upper layers of the architecture for net-centric computing, specifically on computing abstractions and paradigms.
· It incorporates both conceptual topics and practical topics, using program samples and hands-on exercises to illustrate and reinforce the concepts presented.
· It is designed as a textbook, with a narrative style suitable for academic settings, diagrams to illustrate the topics, exercises at the end of each chapter, and a list of references for student research.
· It is designed for learn-by-doing teaching: programming samples are used to reinforce the topics presented, and laboratory activities are incorporated in the exercises at the end of each chapter.
· Supplementary teaching materials, including presentation slides, program samples, a Web site, and an instructor's manual, will be provided by the author.
· In addition to printed books and articles, this book cites reliable references that are accessible via the World Wide Web. For example, the references include a link to the archival sites where Internet Requests for Comments (RFCs) can be looked up online. It is the author's belief that undergraduate students are more inclined to look up references that are readily available on the Web. (Note: Although I have chosen to include as references Web links that are reliable and stable, it is possible that some of the links may become obsolete over time. I would appreciate receiving reports of inactive links.)
What This Book is Not About
· This book is not about networking. In a general sense, networking encompasses distributed computing in as much as distributed computing involves networked computers. But in academia, courses in networking typically focus on the lower layers of the network architecture and address topics such as signal transmission, error corrections, data link layer protocols, transport layer protocols, and the Internet layer protocol. By comparison, this book deals with the uppermost layers of the network architecture, namely the application, presentation, and session layers, and more from the viewpoint of computing paradigms and abstractions than from the viewpoint of system architecture.
· This book is not about distributed systems. Our focus is not on system architecture or system resources.
· This book is not about Web application development. Although the Internet is the most popular network, programming for the Internet is a specialized form of distributed computing. This book addresses distributed computing for networks in general, including the Internet, intranet, and local area networks.
· This book is not about application program interfaces (APIs) or technologies. Although a number of APIs are introduced in the book, they are presented as representative toolkits that support particular paradigms; the introduction of these APIs is meant to allow students to write programs for hands-on laboratory exercises that reinforce the concepts and principles.
A Word to Fellow Instructors
The book is designed for use in a technical elective course during an academic term. The entire twelve chapters of the book can be covered in a quarter at a fast pace or in a semester at a more leisurely pace. The material requires no advanced knowledge of networks, operating systems, or software engineering. A course taught using the book can be taken by an upper-division undergraduate student.
With a field as wide as distributed computing, it is impossible for one book to cover every corner of the discipline. In particular, there is no intention here to cover the latest technologies. The book is meant to convey fundamental concepts in interprocess communication.
A common thread that runs through this book is the idea of abstraction, in the sense of detail encapsulation--how that idea applies in the various paradigms of distributed computing and the trade-offs between tools that provide different levels of abstraction. It is my firm belief that these concepts and ideas are important to each student in computer science and computer engineering, regardless of the student's chosen area of specialization. With an understanding of these fundamental concepts, students should be well equipped to explore new tools and technologies on their own, as they will be expected to do throughout their career.
The first three chapters of the book contain introductory background material that can be covered in the first one or two weeks of an academic term, during which students are gently introduced to a multitude of issues to which they may or may not have been exposed already. Subsequent chapters are more technical and detailed and can be covered at roughly a chapter each week.
Broad as the subject of distributed computing is, you will likely feel compelled to supplement this text with additional material that you deem important. For example, you may be inclined to add an introduction to distributed algorithms, or to go into more depth in the area of security. To allow time for such additions, you may consider omitting selected chapters from this book.
It is not assumed that readers of this book have had prior expertise in distributed computing. At Cal Poly, I have used the material to teach students with diverse backgrounds, ranging from some students who had no experience with multiprocess programming, to those who were already sophisticated network software developers. While the material worked best with the former, those with advanced backgrounds would find the topics of interest nevertheless.
Readers, Please Note
A word on the use of typefaces in the narrative of this book:
· Key terms and phrases are emphasized through the use of boldface; for example: This book addresses distributed computing.
· A special word, such as one used as a program identifier, nonstandard protocol name, or operation name, is expressed in italic to distinguish it from the rest of the text in a sentence; for example: What do you expect the outcome to be when RunThread3 is executed? Compile and run it.
· Reserved words and identifiers, such as those stipulated by the Java Language or by a well-known protocol, appear in italic; for example: To support threading in a program, Java provides a class named Thread as well as an interface named Runnable interface.
A word on the article inserts and Web links:
Throughout the text of this book, excerpts from articles previously published in various media are inserted. These articles were chosen for their relevance to the topics, and for the interest that they may bring to the readers.
Many of the references listed at the end of each chapter are Web links. This is a deliberate choice, because the author believes that the accessibility of Web-available contents will enhance a student's initiative to pursue research in a topic. The Web links chosen are those that the author deemed to be reliable and stable. But obsolescence of some links is inevitable, in which case the author offers an apology and welcomes your notification of such an occurrence.
Contacting the Author
The compilation of a textbook is a painstaking and consuming task. To the best of my ability, I have attempted to maximize the accuracy of the materials presented within the pages of this book. If you discover any errors or inaccuracy, or if you have suggestions for improvements, I shall be grateful to hear from you. Please email to mliu@csc, calpoly, edu.
Supplementary Materials
Supplementary materials, including the source files for programming samples and overhead slides, are available at URL www.aw.com. Additional supplementary materials for instructors only are available by contacting your local Addison Wesley sales representative.
Acknowledgments
I thank the generosity of the various authors and publishers who granted reprint permission to allow the inclusion of previously published work in the text of this book.
I am forever indebted to my doctoral program advisors, Dr. Divyakant Agrawal and Dr. Amr El Abbadi, Computer Science Department, University of California at Santa Barbara, who introduced me to the field of distributed computing. ratitude is due to Cai Poly students Jared Smith, Domingo Colon, Vinh Pham, Hafeez Jaffer, Erik Buchholz, and Lori Sawdey for the gift of their time and efforts in reviewing the book. Thanks are also due to the students who enrolled in these courses at Cai Poly in school year 2001-2003: Computer Engineering 369, Computer Engineering 469, and Computer Science 569, for their patience with the numerous errors in the initial drafts of the manuscript for this book.
I thank my colleagues in the Computer Science Department and the College of Engineering at Cai Poly, who provided the opportunities for me to teach the courses that inspired this book, and without whose encouragement the book would not have been possible.