02-068 FM pp4 6/14/02 5:13 PM Page i

                                  S E C O N D             E D I T I O N

02-068 FM pp4 6/14/02 5:13 PM Page ii

      Executive Editor                 Susan Hartman Sullivan
      Assistant Ed...
02-068 FM pp4 6/14/02 5:13 PM Page iii

            About the Authors
            Jim Kurose
            Jim Kurose is ...
02-068 FM pp4 6/14/02 5:13 PM Page iv
02-068 FM pp4 6/14/02 5:13 PM Page v

                                            To Julie and our three precious
02-068 FM pp4 6/14/02 5:13 PM Page vi
02-068 FM pp4 6/14/02 5:13 PM Page vii

                                   In memory of Sajani and Subin Shrestha
02-068 FM pp4 6/14/02 5:13 PM Page viii
02-068 FM pp4 6/14/02 5:13 PM Page ix

            Welcome to the second edition of Computer Networ...
02-068 FM pp4 6/14/02 5:13 PM Page x

      x     Preface

                          presented in a Java context. Al...
02-068 FM pp4 6/14/02 5:13 PM Page xi

02-068 FM pp4 6/14/02 5:13 PM Page xii

      xii    Preface

                          Addressing the Principles
02-068 FM pp4 6/14/02 5:13 PM Page xiii

02-068 FM pp4 6/14/02 5:13 PM Page xiv

      xiv    Preface

                          interviews with Len Kleinroc...
02-068 FM pp4 6/14/02 5:13 PM Page xv

02-068 FM pp4 6/14/02 5:13 PM Page xvi

      xvi    Preface

                          Steven Bellovin (AT&T Resear...
02-068 FM pp4 6/14/02 5:13 PM Page xvii

02-068 FM pp4 6/14/02 5:13 PM Page xviii
02-068 FM pp4 6/14/02 5:13 PM Page xix

                                             Table of Contents
02-068 FM pp4 6/14/02 5:13 PM Page xx

      xx    Table of Contents

                    1.9     Summary           ...
02-068 FM pp4 6/14/02 5:13 PM Page xxi

02-068 FM pp4 6/14/02 5:13 PM Page xxii

      xxii    Table of Contents

      Chapter 4 Network Layer and Routing ...
02-068 FM pp4 6/14/02 5:13 PM Page xxiii

02-068 FM pp4 6/14/02 5:13 PM Page xxiv

      xxiv    Table of Contents

      Chapter 6 Multimedia Networking     ...
02-068 FM pp4 6/14/02 5:13 PM Page xxv

02-068 FM pp4 6/14/02 5:13 PM Page xxvi

      xxvi    Table of Contents

                    7.9     Summary       ...
02-068 FM pp4 6/14/02 5:13 PM Page xxvii

                       Computer Networking
                        A Top-Down...
02-068 FM pp4 6/14/02 5:13 PM Page xxviii
Upcoming SlideShare
Loading in …5

Computer Networking


Published on

  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Computer Networking

  1. 1. 02-068 FM pp4 6/14/02 5:13 PM Page i S E C O N D E D I T I O N Computer Networking A Top-Down Approach Featuring the Internet James F. Kurose University of Massachusetts, Amherst Keith W. Ross Eurécom Institute
  2. 2. 02-068 FM pp4 6/14/02 5:13 PM Page ii Executive Editor Susan Hartman Sullivan Assistant Editor Galia Shokry Executive Marketing Manager Michael Hirsch Production Supervisor Kim Ellwood Production Services Pre-Press Company, Inc. Composition Pre-Press Company, Inc. Art Pat Rossi Calkin and Pre-Press Company, Inc. Art Development Janet Theurer Text and Cover Design Joyce Cosentino Wells Prepress and Manufacturing Caroline Fell Media Producer Jennifer Pelland Access the latest information about Addison-Wesley Computing titles from our World Wide Web site: http://www.aw.com/cs The programs and applications presented in this book have been included for their instructional value. They have been tested with care, but are not guaranteed for any particular purpose. The publisher does not offer any warranties or representations, nor does it accept any liabilities with respect to the programs or applications. Library of Congress Cataloging-in-Publication Data Kurose, James F Computer networking: a top-down approach featuring the Internet / James F. Kurose, Keith W. Ross.—2nd ed. p. cm. Ross’s name appears first on the earlier edition. Includes bibliographical references and index. ISBN 0-201-97699-4 1. Internet. 2. Computer networks I. Ross, Keith W., 1956- II. Title. TK5105.875.I57 K88 2002 004.67'8—dc21 2002071100 Copyright © 2003 by Pearson Education, Inc. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photo- copying, recording, or otherwise, without the prior written permission of the publisher. Printed in the United States of America. ISBN 0-201-97699-4 12345678910-CRW-04030201
  3. 3. 02-068 FM pp4 6/14/02 5:13 PM Page iii About the Authors Jim Kurose Jim Kurose is a professor of Computer Science at the University of Massachusetts, Amherst. He is the eight-time recipient of the Outstanding Teacher Award from the National Technological University, the recipient of the Outstanding Teacher Award from the College of Natural Science and Mathematics at the University of Massachusetts, and the recipient of the 1996 Outstanding Teaching Award of the Northeast Association of Graduate Schools. He has been the recipient of a GE Fellowship, an IBM Faculty Development Award, and a Lilly Teaching Fellowship. Dr. Kurose is a former Editor-In-Chief of the IEEE Transactions on Communications and of the IEEE/ACM Transactions on Networking. He is active in the program committees for IEEE Infocom, ACM SIGCOMM, and ACM SIGMETRICS. He holds a Ph.D. in Com- puter Science from Columbia University. Keith Ross Keith Ross is a professor in the Multimedia Communications Department at Eurécom Insti- tute. From 1985 through 1997 he was a Professor at the University of Pennsylvania where he held appointments in both the Department of Systems Engineering and the Wharton School of Business. In 1999, he co-founded the Internet startup Wimba.com. Dr. Ross has published over 50 papers and written two books. He has served on editorial boards of five major journals, and has served on the program committees of major net- working conferences., including IEEE Infocom and ACM SIGCOMM. He has supervised more than ten Ph.D. theses. His research and teaching interests included multimedia networking, asynchronous learning, Web caching, streaming audio and video, and traffic modeling. He received his Ph.D. from the University of Michigan. iii
  4. 4. 02-068 FM pp4 6/14/02 5:13 PM Page iv
  5. 5. 02-068 FM pp4 6/14/02 5:13 PM Page v To Julie and our three precious ones—Chris, Charlie, and Nina JFK To my wife, Véronique, and our trois petits pois, Cécile, Claire, and Katie KWR
  6. 6. 02-068 FM pp4 6/14/02 5:13 PM Page vi
  7. 7. 02-068 FM pp4 6/14/02 5:13 PM Page vii In memory of Sajani and Subin Shrestha
  8. 8. 02-068 FM pp4 6/14/02 5:13 PM Page viii
  9. 9. 02-068 FM pp4 6/14/02 5:13 PM Page ix Preface Welcome to the second edition of Computer Networking: A Top-Down Approach Featuring the Internet. Since the publication of the first edition two years ago, our book has been adopted for use at hundreds of colleges and universities and used by tens of thousands of students and practitioners worldwide. We’ve heard from many of these readers and have been overwhelmed by the positive response. We think one important reason for this success is that the book offers a fresh approach to computer networking instruction. Why is a fresh approach needed? In recent years we have witnessed two revolutionary changes in the field of network- ing—changes that are not reflected in the networking texts published in the 1980s and 1990s. First, the Internet has taken over computer networking. Any serious dis- cussion about computer networking today has to be done with the Internet in mind. Second, over the past ten years the biggest growth area has been in networking serv- ices and applications, which can be seen with the emergence of the Web, ubiquitous use of e-mail, audio and video streaming, Internet phone, instant messaging, peer- to-peer applications, and online commerce. What’s new in the second edition? We’ve made changes in this second edition, but we’ve also kept unchanged what we believe (and the instructors and students who have used our book have confirmed) to be the most important aspects of this book: its top-down approach, its focus on the Internet, its attention to both principles and practice, and its accessible style and ap- proach toward learning about computer networking. This second edition has been updated to reflect the rapid changes in the field of networking over the last few years. It includes new and expanded material on peer-to-peer networking, content distribu- tion networks, mobility and mobile IP, wireless networks, BGP, multimedia network- ing, network security, and much more. The entire text and references have been updated based on changes in the field and feedback from readers of the first edition. Additional homework problems have also been added. This edition also features new lab exercises (including one exciting lab on video streaming using RTP and RTSP). Audience This textbook is for a first course on computer networking. It can be used in both com- puter science and electrical engineering departments. In terms of programming lan- guages, the book assumes only that the student has experience with C, C++, or Java. A student who has programmed only in C or C++ and not Java should not have any diffi- culty following the application programming material, even though this material is
  10. 10. 02-068 FM pp4 6/14/02 5:13 PM Page x x Preface presented in a Java context. Although this book is more precise and analytical than many other introductory computer networking texts, it rarely uses any mathematical concepts that are not taught in high school. We have made a deliberate effort to avoid using any advanced calculus, probability, or stochastic process concepts. The book is therefore appropriate for undergraduate courses and for first-year graduate courses. It should also be useful to practitioners in the telecommunications industry. What Is Unique about This Textbook? The subject of computer networking is enormously complex, involving many con- cepts, protocols, and technologies that are woven together in an intricate manner. To cope with this scope and complexity, many computer networking texts are often or- ganized around the “layers” of a network architecture. With a layered organization, students can see through the complexity of computer networking—they learn about the distinct concepts and protocols in one part of the architecture while seeing the big picture of how all parts fit together. For example, many texts are organized around the seven-layer OSI architecture. From a pedagogical perspective our per- sonal experience has been that such a layered approach to teaching is indeed highly desirable. Nevertheless, we have found the traditional approach of teaching bottom- up—that is, from the physical layer towards the application layer—is not the best approach for a modern course on computer networking. A Top-Down Approach Unlike the other computer networking texts, this text is organized in a top-down man- ner—that is, it begins at the application layer and works its way down toward the physical layer. The top-down approach has several important benefits. First, it places emphasis on the application layer, which has been the high “growth area” of com- puter networking. Indeed, many of the recent revolutions in computer networking— including the Web, audio and video streaming, and content distribution—have taken place at the application layer. In preparing the first edition of this book, we believed that the application layer would remain the highest growth area in the field, both in terms of research and actual deployment. The intervening years have unquestionably shown this to be true! An early emphasis on application-layer issues differs from the approaches taken in most other texts, which have only a small (or nonexistent) amount of material on network applications, their requirements, application-layer paradigms (e.g., client/server), and the application programming interfaces. Second, our experience as instructors has been that teaching networking applica- tions near the beginning of the course is a powerful motivational tool. Students are thrilled to learn about how networking applications work—applications such as e- mail and the Web, which most students use on a daily basis. Once a student under- stands the applications, the student can then understand the network services needed
  11. 11. 02-068 FM pp4 6/14/02 5:13 PM Page xi Preface xi to support these applications. The student can then, in turn, examine the various ways in which such services might be provided and implemented in the lower layers. Cov- ering applications early thus provides motivation for the remainder of the text. Third, the top-down approach enables instructors to introduce network applica- tion development at an early stage. Students not only see how popular applications and protocols work, but also learn how easy it is to create their own network applica- tions and application-level protocols. Other introductory computer networking texts do not cover application development and socket programming. (Even though there are books devoted to network programming, there are no introductory networking textbooks.) By providing socket programming examples in Java, we highlight the central ideas without confusing students with complex code. Undergraduates in elec- trical engineering and computer science should not have difficulty following the Java code. Thus, with the top-down approach, students get early exposure to the notions of application programming interfaces (APIs), service models, and protocols—im- portant concepts that resurface in all of the subsequent layers. An Internet Focus As indicated by the title, this textbook features the Internet. Most existing textbooks give significant weight to a variety of telecommunications networks and protocol suites, and they treat the Internet as one of many networking technologies. We in- stead put the Internet in the spotlight and use the Internet protocols as vehicles for studying some of the more fundamental computer networking concepts. But why put the Internet in the spotlight? Why not some other networking technology, such as ATM? First, computer networking is now synonymous with the Internet. This wasn’t the case five to ten years ago, when there was a lot of talk about ATM LANs and applications directly interfacing with ATM (without passing through TCP/IP). But now we have reached the point where just about all data traffic is carried over the Internet (or intranets). Today, the only other type of network that competes with the Internet is the circuit-switched telephone network. And this competitor may also disappear. Although today the majority of voice traffic is carried over the telephone networks, networking equipment manufacturers and telephone company operators are currently preparing for a major migration to Internet technology. Another benefit of spotlighting the Internet is that most computer science and elec- trical engineering students are eager to learn about the Internet and its protocols. They use the Internet on a daily basis (at least to send e-mail and surf the Web), and they’ve heard that the Internet is a revolutionary and disruptive technology profoundly chang- ing our world. Given the enormous relevance of the Internet, students are naturally cu- rious about what is “under the hood.” Thus, it is easy for an instructor to get students excited about the basic principles when using the Internet as the guiding focus. Because our book has an Internet focus, it is organized around a five-layer In- ternet architecture rather than around the more traditional seven-layer OSI architec- ture. These five layers consist of the application, transport, network, link, and physical layers.
  12. 12. 02-068 FM pp4 6/14/02 5:13 PM Page xii xii Preface Addressing the Principles Two of the unique features of the book—its top-down approach and its focus on the Internet—appear in the subtitle of this book. If we could have fit a third phrase into the subtitle, it would have contained the word principles. The field of networking is now mature enough that a number of fundamentally important issues can be identi- fied. For example, in the transport layer, the fundamental issues include reliable communication over an unreliable network layer, connection establishment/tear- down and handshaking, congestion and flow control, and multiplexing. In the net- work layer, two fundamentally important issues are finding “good’’ paths between two routers and dealing with the interconnection of a large number of heterogeneous systems. In the data link layer, a fundamental problem is sharing a multiple access channel. In network security, techniques for providing confidentiality, authentica- tion, and message integrity are all based on cryptographic fundamentals. This text identifies fundamental networking issues as well as approaches towards addressing these issues. We believe that the combination of using the Internet to get the stu- dent’s foot in the door and then emphasizing the issues and solution approaches will allow the student to quickly understand just about any networking technology. The Web Site This textbook has an extensive companion Web site for all book readers at http://www.aw.com/kurose-ross, which includes: ✦ Interactive learning material. The site contains interactive Java applets, illustrat- ing key networking concepts. It also provides direct access to the programs such as the Traceroute program (through your browser) that shows the path that pack- ets follow in the Internet. Professors can use these interactive features as mini labs. The Web site also provides direct access to search engines for Internet Drafts and to a newsgroup in which topics of this book are discussed. Finally, the site also makes available interactive quizzes that permit students to check their basic understanding of the subject matter. ✦ Over five hundred links to relevant material. As all of us Internet enthusiasts know, much of the best material describing the Internet is in the Internet itself. We’ve made an effort to include Web URLs for as many of the book’s references as possible. The bibliography is online and will be updated as links change, and as new material becomes available. The links point not only to RFCs and journal and conference articles, but also to sites that are more pedagogical in nature, in- cluding home-brewed pages on particular aspects of Internet technology and ar- ticles appearing in online trade magazines. Professors can assign the material behind the links as supplementary or even required reading. ✦ Multimedia lecture material from the authors. The WWW site also makes avail- able Real-Audio in-class lectures of the authors teaching this material to their students.
  13. 13. 02-068 FM pp4 6/14/02 5:13 PM Page xiii Preface xiii We also expect to be constantly expanding the Web site, adding contributed material from instructors and readers as well as our own new features. Updates should occur about every three months. If you have any problems with the Web site, send mail to aw.cse@aw.com. Pedagogical Features We have each been teaching computer networking for almost 20 years. We bring to this text more than combined 30 years of teaching experience to over 3,000 students. We have also been active researchers in computer networking during this time. (In fact, Jim and Keith first met each other as master’s students in a computer networking course taught by Mischa Schwartz in 1979 at Columbia University.) We think all this gives us a good perspective on where networking has been and where it is likely to go in the future. Nevertheless, we have resisted temptations to bias the material in this book towards our own pet research projects. We figure you can visit our personal Web sites if you are interested in our research. Thus, this book is about modern computer networking—it is about contemporary protocols and technologies as well as the un- derlying principles behind these protocols and technologies. We also believe that learning (and teaching!) about networking can be fun. A sense of humor, use of analo- gies, and real-world examples in this book will hopefully make this material more fun. Historical Sidebars and Principles in Practice The field of computer networking, beginning in the late 1960s, has a rich and fascinat- ing history. We have made a special effort in the text to tell the history of computer net- working. This is done with a special historical section in Chapter 1 and with about a dozen historical sidebars sprinkled throughout the chapters. In these historical pieces, we cover the invention of packet switching, the evolution of the Internet, the birth of major networking giants such as Cisco and 3Com, and many other important events. Students will be stimulated by these historical pieces. Also, as historians tell us, his- tory helps us predict the future. And correctly predicting the future in this rapidly changing field is critical for the success of any networking protocol or technology. As noted previously, this book stresses the underlying principles of computer networking as well as the role of these principles in practice. In each of the chapters, we include a special sidebar that highlights an important principle in computer net- working. These sidebars will help students appreciate some of the fundamental con- cepts being applied in modern networking. Interviews We have included yet another original feature that should inspire and motivate stu- dents—interviews with renowned innovators in the field of networking. We provide
  14. 14. 02-068 FM pp4 6/14/02 5:13 PM Page xiv xiv Preface interviews with Len Kleinrock, Tim Berners-Lee, Sally Floyd, Vint Cerf, Bob Met- calfe, Henning Schulzrinne, Steven Bellovin, and Jeff Case. Supplements for Instructors We realize that changing one’s approach to teaching a course or even updating a course can be demanding on one’s time. To aid instructors in the transition, we are providing a complete supplements package for qualified instructors, including: ✦ PowerPoint slides. The course Web site provides PowerPoint slides for all eight chapters. The slides cover each chapter in detail. They use graphics and anima- tions (rather than relying only on monotonous text bullets) to make the slides in- teresting and visually appealing. We provide the original PowerPoint slides to instructors so you can customize them to best suit your own teaching needs. A number of these slides have been contributed by other instructors who have taught from our book. ✦ Laboratory assignments. The Web site also provides several detailed program- ming assignments, including an assignment on building a multithreaded Web server, on building an e-mail client with a GUI interface, programming the sender and receiver sides of a reliable data transport protocol, and an assignment on routing in the Internet. ✦ Homework Solutions. The Web site provides a solutions manual for the home- work problems in the text. These solutions are for instructors only. All of this material is available on the instructor’s portion of the Web site, http://www.aw.com/kurose-ross. Access to this portion of the WWW site is avail- able by contacting your Addison-Wesley sales representative or by sending an e- mail message to aw.cse@aw.com. Chapter Dependencies The first chapter of this text presents a self-contained overview of computer net- working. Introducing many key concepts and terminology, this chapter sets the stage for the rest of the book. All of the other chapters directly depend on this first chap- ter. We recommend that, after completing Chapter 1, instructors cover Chapters 2 through 5 in sequence, thereby teaching according to the top-down philosophy. Each of these five chapters leverages material from the preceding chapters. After completing the first five chapters, the instructor has quite a bit of flexibil- ity. There are no interdependencies among the last three chapters, so they can be
  15. 15. 02-068 FM pp4 6/14/02 5:13 PM Page xv Preface xv taught in any order. However, each of the last three chapters depends on the material in the first five chapters. Ideally, the instructor will have time to teach selected mate- rial from all three final chapters in a full semester course. We also note that the first chapter of the text, being comprehensive and self- contained, can serve as the foundation of a short course on networking. One Final Note We encourage instructors and students to create new Java applets that illustrate the concepts and protocols in this book. If you have an applet that you think would be appropriate for this text, please submit it to the authors. If the applet (including no- tation and terminology) are appropriate, we will be happy to include it on the text’s Web site, with an appropriate reference to the authors of the applet. We also encour- age instructors to send us new homework problems (and solutions) that would com- plement the current homework problems. We will post these on the instructor-only portion of the Web site. We also encourage students and instructors to e-mail us about any comments they might have about our book. It’s been wonderful for us to hear from so many in- structors and students from around the world about our first edition. Feel free to send us interesting URLs, to point out typos, to disagree with any of our claims, and to tell us what works and what doesn’t work. Tell us what you think should or shouldn’t be included in the next edition. Send your e-mail to kurose@cs.umass.edu and ross@eurecom.fr. Acknowledgements Since we began writing this book in 1996, many people have given us invaluable help and have been influential in shaping our thoughts on how to best organize and teach a networking course. We want to say A BIG THANKS to everyone who has helped. We are also very thankful to the hundreds of readers from around the world— students, faculty, practitioners—who have sent us thoughts and comments on earlier editions of the book and suggestions for future editions of the book. Special thanks go out to: Al Aho (Lucent Bell Laboratories) Pratima Akkunoor (Arizona State University) Paul Amer (University of Delaware) Shamiul Azom (Arizona State University) Paul Barford (University of Wisconsin)
  16. 16. 02-068 FM pp4 6/14/02 5:13 PM Page xvi xvi Preface Steven Bellovin (AT&T Research) Shahid Bokhari (University of Engineering & Technology, Lahore) Ernst Biersack (Eurécom Institute) Daniel Brushteyn (former University of Pennsylvania student) Evandro Cantu (Federal University of Santa Catarina) Jeff Case (SNMP Research International) Vinton Cerf (MCI WorldCom) John Daigle (University of Mississippi) Edmundo A. de Souza e Silva (Federal University of Rio de Janiero) Philippe Decuetos (Eurécom Institute) Christophe Diot (Sprint) Michalis Faloutsos (University of California at Riverside) Wu-chi Feng (Oregon Graduate Institute) Sally Floyd (ICIR, University of California at Berkeley) JJ Garcia-Luna-Aceves (University of California at Santa Cruz) Mario Gerla (University of California at Los Angeles) Tim Griffin, AT&T Research Max Hailperin (Gustavus Adolphus College) Bruce Harvey (Florida A&M University, Florida State University) Carl Hauser (Washington State University) Phillipp Hoschka (INRIA/W3C) Albert Huang (former University of Pennsylvania student) Jobin James (University of California at Riverside) Sugih Jamin (University of Michigan) Shivkumar Kalyanaraman (Rensselaer Polytechnic Institute) Jussi Kangasharju (Eurécom Institute) Hyojin Kim (former University of Pennsylvania student) Leonard Kleinrock (University of California at Los Angeles) David Kotz (Dartmouth College) Beshan Kulapala (Arizona State University) Steve Lai (Ohio State University) Tim-Berners Lee (World Wide Web Consortium) Brian Levine (University of Massachusetts) William Liang (former University of Pennsylvania student) Willis Marti (Texas A&M University) Deep Medhi (University of Missouri, Kansas City) Bob Metcalfe (International Data Group) Erich Nahum (IBM Research) Christos Papadopoulos (University of Southern California) Craig Partridge (BBN Technologies) Radia Perlman (Sun Microsystems) Jitendra Padhye (Microsoft Research) George Polyzos (University of California at San Diego) Sriram Rajagopalan (Arizona State University)
  17. 17. 02-068 FM pp4 6/14/02 5:13 PM Page xvii Preface xvii Ken Reek (Rochester Institute of Technology) Martin Reisslein (Arizona State University) Jennifer Rexford (AT&T Research) Sumit Roy (University of Washington) Avi Rubin (Johns Hopkins University) Despina Saparilla (Lucent Bell Labs) Henning Schulzrinne (Columbia University) Mischa Schwartz (Columbia University) K. Sam Shanmugan (University of Kansas) Prashant Shenoy (University of Massachusetts) Clay Shields (Georgetown University) Subin Shrestra (University of Pennsylvania) Peter Steenkiste (Carnegie Mellon University) Tatsuya Suda (University of California at Irvine) Kin Sun Tam (State University of New York at Albany) Don Towsley (University of Massachusetts) David Turner (California State University, San Bernardino) Ira Winston (University of Pennsylvania) Raj Yavatkar (Intel) Yechiam Yemini (Columbia University) Ellen Zegura (Georgia Institute of Technology) Hui Zhang (Carnegie Mellon University) Lixia Zhang (University of California at Los Angeles) ZhiLi Zhang (University of Minnesota) Lixia Zhang (University of California at Los Angeles) Shuchun Zhang (former University of Pennsylvania student) Phil Zimmermann (independent consultant) We also want to thank the entire Addison-Wesley team, who have done an ab- solutely outstanding job (and who have put up with two very finicky authors!): Kim Ellwood, Susan Hartman Sullivan, Michael Hirsch, Patty Mahtani, Galia Shokry, and Joyce Wells. Thanks also to the artists, Janet Theurer and Patrice Rossi Calkin, for their work on the beautiful figures in the second edition. Special thanks go to Su- san, our editor at Addison-Wesley. This book could not and would not have been completed without her management, encouragement, patience, and perseverance.
  18. 18. 02-068 FM pp4 6/14/02 5:13 PM Page xviii
  19. 19. 02-068 FM pp4 6/14/02 5:13 PM Page xix Table of Contents Chapter 1 Computer Networks and the Internet 1 1.1 What Is the Internet? 2 1.1.1 A Nuts-and-Bolts Description 2 1.1.2 A Service Description 5 1.1.3 What Is a Protocol? 6 1.1.4 Some Good Hyperlinks 8 1.2 The Network Edge 9 1.2.1 End Systems, Clients, and Servers 9 1.2.2 Connectionless and Connection-Oriented Service 12 1.3 The Network Core 14 1.3.1 Circuit Switching and Packet Switching 14 1.3.2 Packet Forwarding in Computer Networks 25 1.4 Network Access and Physical Media 29 1.4.1 Network Access 30 1.4.2 Physical Media 35 1.5 ISPs and Internet Backbones 39 1.6 Delay and Loss in Packet-Switched Networks 41 1.6.1 Types of Delay 41 1.6.2 Queuing Delay and Packet Loss 45 1.6.3 Delay and Routes in the Internet 47 1.7 Protocol Layers and Their Service Models 49 1.7.1 Layered Architecture 50 1.7.2 The Internet Protocol Stack 54 1.7.3 Network Entities and Layers 57 1.8 History of Computer Networking and the Internet 58 1.8.1 The Development of Packet Switching: 1961–1972 58 1.8.2 Proprietary Networks and Internetworking: 1972–1980 60 1.8.3 A Proliferation of Networks: 1980–1990 61 1.8.4 The Internet Explosion: The 1990s 62 1.8.5 Recent Developments 64 xix
  20. 20. 02-068 FM pp4 6/14/02 5:13 PM Page xx xx Table of Contents 1.9 Summary 65 Homework Problems and Questions 67 Problems 68 Discussion Questions 73 Interview: Leonard Kleinrock 74 Chapter 2 Application Layer 76 2.1 Principles of Application Layer Protocols 77 2.1.1 Application-Layer Protocols 78 2.1.2 What Services Does an Application Need? 83 2.1.3 Services Provided by the Internet Transport Protocols 85 2.1.4 Network Applications Covered in this Book 87 2.2 The Web and HTTP 88 2.2.1 Overview of HTTP 89 2.2.2 Nonpersistent and Persistent Connections 91 2.2.3 HTTP Message Format 94 2.2.4 User-Server Interaction: Authorization and Cookies 99 2.2.5 The Conditional GET 101 2.2.6 HTTP Content 103 2.3 File Transfer: FTP 103 2.3.1 FTP Commands and Replies 105 2.4 Electronic Mail in the Internet 106 2.4.1 SMTP 108 2.4.2 Comparison with HTTP 111 2.4.3 Mail Message Formats and MIME 112 2.4.4 Mail Access Protocols 117 2.5 DNS—The Internet’s Directory Service 121 2.5.1 Services Provided by DNS 122 2.5.2 Overview of How DNS Works 124 2.5.3 DNS Records 129 2.5.4 DNS Messages 131 2.6 Socket Programming with TCP 133 2.6.1 Socket Programming with TCP 134 2.6.2 An Example Client/Server Application in Java 136 2.7 Socket Programming with UDP 143 2.8 Building a Simple Web Server 151 2.8.1 Web Server Functions 151 2.9 Content Distribution 155 2.9.1 Web Caching 156 2.9.2 Content Distribution Networks 162 2.9.3 Peer-to-Peer File Sharing 165
  21. 21. 02-068 FM pp4 6/14/02 5:13 PM Page xxi Table of Contents xxi 2.10 Summary 172 Homework Problems and Questions 173 Problems 175 Discussion Questions 179 Programming Assignments 180 Interview: Tim Berners-Lee 182 Chapter 3 Transport Layer 184 3.1 Introduction and Transport-Layer Services 185 3.1.1 Relationship Between Transport and Network Layers 185 3.1.2 Overview of the Transport Layer in the Internet 188 3.2 Multiplexing and Demultiplexing 190 3.3 Connectionless Transport: UDP 196 3.3.1 UDP Segment Structure 199 3.3.2 UDP Checksum 200 3.4 Principles of Reliable Data Transfer 201 3.4.1 Building a Reliable Data Transfer Protocol 203 3.4.2 Pipelined Reliable Data Transfer Protocols 214 3.4.3 Go-Back-N (GBN) 217 3.4.4 Selective Repeat (SR) 222 3.5 Connection-Oriented Transport: TCP 228 3.5.1 The TCP Connection 228 3.5.2 TCP Segment Structure 230 3.5.3 Round-Trip Time Estimation and Timeout 235 3.5.4 Reliable Data Transfer 238 3.5.5 Flow Control 246 3.5.6 TCP Connection Management 248 3.6 Principles of Congestion Control 253 3.6.1 The Causes and the Costs of Congestion 253 3.6.2 Approaches to Congestion Control 259 3.6.3 Network Assisted Congestion Control Example: ATM ABR Congestion Control 260 3.7 TCP Congestion Control 262 3.7.1 Fairness 268 3.7.2 TCP Delay Modeling 271 3.8 Summary 280 Homework Problems and Questions 281 Problems 282 Discussion Questions 290 Interview: Sally Floyd 291
  22. 22. 02-068 FM pp4 6/14/02 5:13 PM Page xxii xxii Table of Contents Chapter 4 Network Layer and Routing 293 4.1 Introduction and Network Service Models 294 4.1.1 Network Service Model 296 4.1.2 Origins of Datagram and Virtual Circuit Service 300 4.2 Routing Principles 301 4.2.1 A Link State Routing Algorithm 304 4.2.2 The Distance Vector Routing Algorithm 308 4.2.3 Other Routing Algorithms 317 4.3 Hierarchical Routing 317 4.4 The Internet Protocol (IP) 321 4.4.1 IPv4 Addressing 322 4.4.2 Moving a Datagram from Source to Destination: Addressing, Routing, and Forwarding 330 4.4.3 Datagram Format 333 4.4.4 IP Datagram Fragmentation 336 4.4.5 ICMP: Internet Control Message Protocol 339 4.4.6 Dynamic Host Configuration Protocol 340 4.4.7 Network Address Translators (NATs) 342 4.5 Routing in the Internet 346 4.5.1 Intra-Autonomous System Routing in the Internet: RIP and OSPF 346 4.5.2 Inter-Autonomous System Routing: BGP 353 4.6 What’s Inside a Router? 358 4.6.1 Input Ports 360 4.6.2 Switching Fabric 362 4.6.3 Output Ports 364 4.6.4 Where Does Queuing Occur? 365 4.7 IPv6 368 4.7.1 IPv6 Packet Format 369 4.7.2 Transitioning from IPv4 to IPv6 372 4.8 Multicast Routing 375 4.8.1 Introduction: The Internet Multicast Abstraction and Multicast Groups 375 4.8.2 IGMP 379 4.8.3 Multicast Routing: The General Case 383 4.8.4 Multicast Routing in the Internet 388 4.9 Mobility and the Network Layer 391 4.9.1 Mobility Considerations in Network–Layer Design 391 4.9.2 Mobility Management 393 4.9.3 Mobile IP 400 4.10 Summary 405 Homework Problems and Questions 406 Problems 408 Discussion Questions 414 Interview: Vinton G. Cerf 417
  23. 23. 02-068 FM pp4 6/14/02 5:13 PM Page xxiii Table of Contents xxiii Chapter 5 Link Layer and Local Area Networks 419 5.1 Data Link Layer: Introduction and Services 421 5.1.1 The Services Provided by the Link Layer 421 5.1.2 Adapters Communicating 424 5.2 Error–Detection and –Correction Techniques 425 5.2.1 Parity Checks 427 5.2.2 Checksumming Methods 429 5.2.3 Cyclic Redundancy Check (CRC) 430 5.3 Multiple Access Protocols 432 5.3.1 Channel Partitioning Protocols 434 5.3.2 Random Access Protocols 438 5.3.3 Taking-Turns Protocols 446 5.3.4 Local Area Networks (LANs) 447 5.4 LAN Addresses and ARP 449 5.4.1: LAN Addresses 449 5.4.2: Address Resolution Protocol 451 5.5 Ethernet 455 5.5.1 Ethernet Basics 456 5.5.2 CSMA/CD: Ethernet’s Multiple Access Protocol 460 5.5.3 Ethernet Technologies 462 5.6 Hubs, Bridges, and Switches 466 5.6.1 Hubs 467 5.6.2 Bridges 468 5.6.3 Switches 476 5.7 Wireless Links 480 5.7.1 Wireless LANs: IEEE 802.11b 481 5.7.2 Bluetooth 487 5.8 PPP: The Point-to-Point Protocol 488 5.8.1 PPP Data Framing 490 5.8.2 PPP Link-Control Protocol (LCP) and Network-Control Protocols 492 5.9 Asynchronous Transfer Mode (ATM) 494 5.9.1 Principal Characteristics of ATM 495 5.9.2 ATM Physical Layer 497 5.9.3 ATM Layer 499 5.9.4 ATM Adaptation Layer 500 5.9.5 IP over ATM 502 5.10 Frame Relay 505 5.10.1 The Historical Context 505 5.10.2 Frame Relay 506 5.11 Summary 510 Homework Problems and Questions 511 Problems 513 Discussion Questions 519 Interview: Robert M. Metcalfe 520
  24. 24. 02-068 FM pp4 6/14/02 5:13 PM Page xxiv xxiv Table of Contents Chapter 6 Multimedia Networking 522 6.1 Multimedia Networking Applications 523 6.1.1 Examples of Multimedia Applications 523 6.1.2 Hurdles for Multimedia in Today’s Internet 526 6.1.3 How Should the Internet Evolve to Support Multimedia Better? 527 6.1.4 Audio and Video Compression 528 6.2 Streaming Stored Audio and Video 531 6.2.1 Accessing Audio and Video Through a Web Server 532 6.2.2 Sending Multimedia from a Streaming Server to a Helper Application 535 6.2.3 Real-Time Streaming Protocol (RTSP) 537 6.3 Making the Best of the Best-Effort Service: An Internet Phone Example 541 6.3.1 The Limitations of a Best-Effort Service 541 6.3.2 Removing Jitter at the Receiver for Audio 543 6.3.3 Recovering from Packet Loss 546 6.3.4 Streaming Stored Audio and Video 549 6.4 Protocols for Real-Time Interactive Applications 550 6.4.1 RTP 550 6.4.2 RTP Control Protocol (RTCP) 555 6.4.3 SIP 558 6.4.4 H.323 563 6.5 Beyond Best-Effort 565 6.5.1 Scenario 1: A 1 Mbps Audio Applicaion and an FTP Transfer 566 6.5.2 Scenario 2: A 1 Mbps Audio Applicaion and a High Priority FTP Transfer 567 6.5.3 Scenario 3: A Misbehaving Audio Applicaion and an FTP Transfer 568 6.5.4 Scenario 4: Two 1 Mbps Audio Applicaions Over an Overloaded 1.5 Mbps Link 570 6.6 Scheduling and Policing Mechanisms 572 6.6.1 Scheduling Mechanisms 572 6.6.2 Policing: The Leaky Bucket 576 6.7 Integrated Services 579 6.7.1 Guaranteed Quality of Service 580 6.7.2 Controlled-Load Network Service 581 6.8 RSVP 582 6.8.1 The Essence of RSVP 582 6.8.2 A Few Simple Examples 584 6.9 Differentiated Services 587 6.9.1 Differentiated Services: A Simple Scenario 588 6.9.2 Traffic Classification and Conditioning 590 6.9.3 Per-Hop Behaviors 592 6.9.4 Criticisms of Differentiated Services 593
  25. 25. 02-068 FM pp4 6/14/02 5:13 PM Page xxv Table of Contents xxv 6.10 Summary 594 Homework Problems and Questions 596 Problems 596 Discussion Questions 600 Programming Assignment 601 Interview: Henning Schulzrinne 602 Chapter 7 Security in Computer Networks 604 7.1 What Is Network Security? 605 7.2 Principles of Cryptography 608 7.2.1 Symmetric Key Cryptography 610 7.2.2 Public Key Encryption 614 7.3 Authentication 620 7.3.1 Authentication Protocol ap1.0 621 7.3.2 Authentication Protocol ap2.0 621 7.3.3 Authentication Protocol ap3.0 622 7.3.4 Authentication Protocol ap3.1 623 7.3.5 Authentication Protocol ap4.0 623 7.3.6 Authentication Protocol ap5.0 624 7.4 Integrity 627 7.4.1 Generating Digital Signatures 628 7.4.2 Message Digests 629 7.4.3 Hash Function Algorithms 631 7.5 Key Distribution and Certification 633 7.5.1 The Key Distribution Center 635 7.5.2 Public Key Certification 636 7.6 Access Control: Firewalls 640 7.6.1 Packet Filtering 641 7.6.2 Application Gateway 644 7.7 Attacks and Countermeasures 646 7.7.1 Mapping 646 7.7.2 Packet Sniffing 646 7.7.3 Spoofing 648 7.7.4 Denial-of-Service and Distributed Denial-of-Service Attacks 648 7.7.5 Hijacking 650 7.8 Security in Many Layers: Case Studies 650 7.8.1 Secure E-mail 651 7.8.2 Secure Sockets Layer (SSL) and Transport Layer Security (TLS) 656 7.8.3 Network-Layer Security: IPsec 660 7.8.4 Security in IEEE 802.11 663
  26. 26. 02-068 FM pp4 6/14/02 5:13 PM Page xxvi xxvi Table of Contents 7.9 Summary 665 Homework Problems and Questions 666 Problems 667 Discussion Questions 669 Interview: Steven M. Bellovin 670 Chapter 8 Network Management 672 8.1 What Is Network Management? 673 8.2 The Infrastructure for Network Management 677 8.3 The Internet-Standard Management Framework 680 8.3.1 Structure of Management Information: SMI 681 8.3.2 Management Information Base: MIB 684 8.3.3 SNMP Protocol Operations and Transport Mappings 686 8.3.4 Security and Administration 690 8.4 ASN.1 693 8.5 Conclusion 698 Homework Problems and Questions 698 Problems 699 Discussion Questions 700 Interview: Jeff Case 701 References 703 Index 733
  27. 27. 02-068 FM pp4 6/14/02 5:13 PM Page xxvii Computer Networking A Top-Down Approach Featuring the Internet Second Edition
  28. 28. 02-068 FM pp4 6/14/02 5:13 PM Page xxviii