Top Banner
James F. Kurose University of Massachusetts, Amherst Keith W. Ross Eurécom Institute A Top-Down Approach Featuring the Internet Computer Networking SECOND EDITION 02-068 FM pp4 6/14/02 5:13 PM Page i
28
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Computer Networking

James F. KuroseUniversity of Massachusetts, Amherst

Keith W. RossEurécom Institute

A Top-Down Approach Featuring the InternetComputer Networking

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

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

Page 2: Computer Networking

Executive Editor Susan Hartman SullivanAssistant Editor Galia ShokryExecutive Marketing Manager Michael HirschProduction Supervisor Kim EllwoodProduction Services Pre-Press Company, Inc.Composition Pre-Press Company, Inc.Art Pat Rossi Calkin and Pre-Press Company, Inc. Art Development Janet TheurerText and Cover Design Joyce Cosentino WellsPrepress and Manufacturing Caroline Fell Media Producer Jennifer Pelland

Access the latest information about Addison-Wesley Computing titles from our WorldWide Web site: http://www.aw.com/cs

The programs and applications presented in this book have been included for theirinstructional value. They have been tested with care, but are not guaranteed for anyparticular 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 DataKurose, 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-41. Internet. 2. Computer networks I. Ross, Keith W., 1956- II. Title.

TK5105.875.I57 K88 2002004.67'8—dc21 2002071100

Copyright © 2003 by Pearson Education, Inc.

All rights reserved. No part of this publication may be reproduced, stored in a retrievalsystem, 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

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

Page 3: Computer Networking

iii

About the AuthorsJim KuroseJim 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 NationalTechnological University, the recipient of the Outstanding Teacher Award from theCollege of Natural Science and Mathematics at the University of Massachusetts, andthe 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 FacultyDevelopment Award, and a Lilly Teaching Fellowship.

Dr. Kurose is a former Editor-In-Chief of the IEEE Transactions on Communications andof the IEEE/ACM Transactions on Networking. He is active in the program committeesfor IEEE Infocom, ACM SIGCOMM, and ACM SIGMETRICS. He holds a Ph.D. in Com-puter Science from Columbia University.

Keith RossKeith 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 wherehe held appointments in both the Department of Systems Engineering and the WhartonSchool 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 editorialboards 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 morethan ten Ph.D. theses. His research and teaching interests included multimedia networking,asynchronous learning, Web caching, streaming audio and video, and traffic modeling. Hereceived his Ph.D. from the University of Michigan.

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

Page 4: Computer Networking

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

Page 5: Computer Networking

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

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

Page 6: Computer Networking

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

Page 7: Computer Networking

In memory of Sajani and Subin Shrestha

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

Page 8: Computer Networking

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

Page 9: Computer Networking

PrefaceWelcome to the second edition of Computer Networking: A Top-Down ApproachFeaturing the Internet. Since the publication of the first edition two years ago, ourbook has been adopted for use at hundreds of colleges and universities and used bytens of thousands of students and practitioners worldwide. We’ve heard from manyof these readers and have been overwhelmed by the positive response.

We think one important reason for this success is that the book offers a freshapproach to computer networking instruction. Why is a fresh approach needed? Inrecent 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 1980sand 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, ubiquitoususe of e-mail, audio and video streaming, Internet phone, instant messaging, peer-to-peer applications, and online commerce.

We’ve made changes in this second edition, but we’ve also kept unchanged what webelieve (and the instructors and students who have used our book have confirmed) tobe the most important aspects of this book: its top-down approach, its focus on theInternet, its attention to both principles and practice, and its accessible style and ap-proach toward learning about computer networking. This second edition has beenupdated 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 beenupdated 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 newlab 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. Astudent 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

What’s new in the second edition?

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

Page 10: Computer Networking

presented in a Java context. Although this book is more precise and analytical thanmany other introductory computer networking texts, it rarely uses any mathematicalconcepts that are not taught in high school. We have made a deliberate effort to avoidusing any advanced calculus, probability, or stochastic process concepts. The book istherefore appropriate for undergraduate courses and for first-year graduate courses. Itshould also be useful to practitioners in the telecommunications industry.

The subject of computer networking is enormously complex, involving many con-cepts, protocols, and technologies that are woven together in an intricate manner. Tocope 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 aboutthe distinct concepts and protocols in one part of the architecture while seeing thebig picture of how all parts fit together. For example, many texts are organizedaround the seven-layer OSI architecture. From a pedagogical perspective our per-sonal experience has been that such a layered approach to teaching is indeed highlydesirable. Nevertheless, we have found the traditional approach of teaching bottom-up—that is, from the physical layer towards the application layer—is not the bestapproach 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 thephysical layer. The top-down approach has several important benefits. First, it placesemphasis 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 takenplace at the application layer. In preparing the first edition of this book, we believedthat the application layer would remain the highest growth area in the field, both interms of research and actual deployment. The intervening years have unquestionablyshown this to be true! An early emphasis on application-layer issues differs from theapproaches taken in most other texts, which have only a small (or nonexistent)amount of material on network applications, their requirements, application-layerparadigms (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 arethrilled 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

x Preface

What Is Unique about This Textbook?

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

Page 11: Computer Networking

Preface xi

to support these applications. The student can then, in turn, examine the various waysin 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 applicationsand protocols work, but also learn how easy it is to create their own network applica-tions and application-level protocols. Other introductory computer networking textsdo not cover application development and socket programming. (Even though thereare books devoted to network programming, there are no introductory networkingtextbooks.) By providing socket programming examples in Java, we highlight thecentral ideas without confusing students with complex code. Undergraduates in elec-trical engineering and computer science should not have difficulty following the Javacode. Thus, with the top-down approach, students get early exposure to the notionsof 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 textbooksgive significant weight to a variety of telecommunications networks and protocolsuites, 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 forstudying some of the more fundamental computer networking concepts. But whyput the Internet in the spotlight? Why not some other networking technology, suchas ATM? First, computer networking is now synonymous with the Internet. Thiswasn’t the case five to ten years ago, when there was a lot of talk about ATM LANsand 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 overthe Internet (or intranets). Today, the only other type of network that competes withthe Internet is the circuit-switched telephone network. And this competitor may alsodisappear. Although today the majority of voice traffic is carried over the telephonenetworks, networking equipment manufacturers and telephone company operatorsare 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. Theyuse the Internet on a daily basis (at least to send e-mail and surf the Web), and they’veheard 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 studentsexcited 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, andphysical layers.

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

Page 12: Computer Networking

Addressing the Principles

Two of the unique features of the book—its top-down approach and its focus on theInternet—appear in the subtitle of this book. If we could have fit a third phrase intothe subtitle, it would have contained the word principles. The field of networking isnow mature enough that a number of fundamentally important issues can be identi-fied. For example, in the transport layer, the fundamental issues include reliablecommunication 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 betweentwo routers and dealing with the interconnection of a large number of heterogeneoussystems. In the data link layer, a fundamental problem is sharing a multiple accesschannel. In network security, techniques for providing confidentiality, authentica-tion, and message integrity are all based on cryptographic fundamentals. This textidentifies fundamental networking issues as well as approaches towards addressingthese 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 willallow 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 athttp://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 suchas the Traceroute program (through your browser) that shows the path that pack-ets follow in the Internet. Professors can use these interactive features as minilabs. The Web site also provides direct access to search engines for InternetDrafts and to a newsgroup in which topics of this book are discussed. Finally, thesite also makes available interactive quizzes that permit students to check theirbasic understanding of the subject matter.

✦ Over five hundred links to relevant material. As all of us Internet enthusiastsknow, 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 referencesas possible. The bibliography is online and will be updated as links change, andas new material becomes available. The links point not only to RFCs and journaland 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 materialbehind 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 theirstudents.

xii Preface

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

Page 13: Computer Networking

Preface xiii

We also expect to be constantly expanding the Web site, adding contributed materialfrom instructors and readers as well as our own new features. Updates should occurabout every three months. If you have any problems with the Web site, send mail [email protected].

We have each been teaching computer networking for almost 20 years. We bring tothis 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. (Infact, Jim and Keith first met each other as master’s students in a computer networkingcourse taught by Mischa Schwartz in 1979 at Columbia University.) We think all thisgives us a good perspective on where networking has been and where it is likely to goin the future. Nevertheless, we have resisted temptations to bias the material in thisbook towards our own pet research projects. We figure you can visit our personal Websites if you are interested in our research. Thus, this book is about modern computernetworking—it is about contemporary protocols and technologies as well as the un-derlying principles behind these protocols and technologies. We also believe thatlearning (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 adozen historical sidebars sprinkled throughout the chapters. In these historical pieces,we cover the invention of packet switching, the evolution of the Internet, the birth ofmajor 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 rapidlychanging field is critical for the success of any networking protocol or technology.

As noted previously, this book stresses the underlying principles of computernetworking 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

Pedagogical Features

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

Page 14: Computer Networking

interviews with Len Kleinrock, Tim Berners-Lee, Sally Floyd, Vint Cerf, Bob Met-calfe, Henning Schulzrinne, Steven Bellovin, and Jeff Case.

We realize that changing one’s approach to teaching a course or even updating acourse can be demanding on one’s time. To aid instructors in the transition, we areproviding a complete supplements package for qualified instructors, including:

✦ PowerPoint slides. The course Web site provides PowerPoint slides for all eightchapters. 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 toinstructors so you can customize them to best suit your own teaching needs. Anumber of these slides have been contributed by other instructors who havetaught from our book.

✦ Laboratory assignments. The Web site also provides several detailed program-ming assignments, including an assignment on building a multithreaded Webserver, on building an e-mail client with a GUI interface, programming thesender and receiver sides of a reliable data transport protocol, and an assignmenton 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 [email protected].

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 stagefor 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 2through 5 in sequence, thereby teaching according to the top-down philosophy. Eachof 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

xiv Preface

Supplements for Instructors

Chapter Dependencies

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

Page 15: Computer Networking

Preface xv

taught in any order. However, each of the last three chapters depends on the materialin 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.

We encourage instructors and students to create new Java applets that illustrate theconcepts and protocols in this book. If you have an applet that you think would beappropriate 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’sWeb 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-onlyportion of the Web site.

We also encourage students and instructors to e-mail us about any commentsthey 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 tosend us interesting URLs, to point out typos, to disagree with any of our claims, andto tell us what works and what doesn’t work. Tell us what you think should orshouldn’t be included in the next edition. Send your e-mail to [email protected] [email protected].

Since we began writing this book in 1996, many people have given us invaluablehelp and have been influential in shaping our thoughts on how to best organize andteach a networking course. We want to say A BIG THANKS to everyone who hashelped. 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 earliereditions of the book and suggestions for future editions of the book. Special thanksgo 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)

One Final Note

Acknowledgements

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

Page 16: Computer Networking

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 ResearchMax 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)

xvi Preface

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

Page 17: Computer Networking

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!): KimEllwood, 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 beencompleted without her management, encouragement, patience, and perseverance.

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

Page 18: Computer Networking

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

Page 19: Computer Networking

xix

Table of Contents

Chapter 1 Computer Networks and the Internet 11.1 What Is the Internet? 2

1.1.1 A Nuts-and-Bolts Description 21.1.2 A Service Description 51.1.3 What Is a Protocol? 61.1.4 Some Good Hyperlinks 8

1.2 The Network Edge 91.2.1 End Systems, Clients, and Servers 91.2.2 Connectionless and Connection-Oriented Service 12

1.3 The Network Core 141.3.1 Circuit Switching and Packet Switching 141.3.2 Packet Forwarding in Computer Networks 25

1.4 Network Access and Physical Media 291.4.1 Network Access 301.4.2 Physical Media 35

1.5 ISPs and Internet Backbones 391.6 Delay and Loss in Packet-Switched Networks 41

1.6.1 Types of Delay 411.6.2 Queuing Delay and Packet Loss 451.6.3 Delay and Routes in the Internet 47

1.7 Protocol Layers and Their Service Models 491.7.1 Layered Architecture 501.7.2 The Internet Protocol Stack 541.7.3 Network Entities and Layers 57

1.8 History of Computer Networking and the Internet 581.8.1 The Development of Packet Switching: 1961–1972 581.8.2 Proprietary Networks and Internetworking: 1972–1980 601.8.3 A Proliferation of Networks: 1980–1990 611.8.4 The Internet Explosion: The 1990s 621.8.5 Recent Developments 64

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

Page 20: Computer Networking

1.9 Summary 65Homework Problems and Questions 67Problems 68Discussion Questions 73

Interview: Leonard Kleinrock 74

Chapter 2 Application Layer 762.1 Principles of Application Layer Protocols 77

2.1.1 Application-Layer Protocols 782.1.2 What Services Does an Application Need? 832.1.3 Services Provided by the Internet Transport Protocols 852.1.4 Network Applications Covered in this Book 87

2.2 The Web and HTTP 882.2.1 Overview of HTTP 892.2.2 Nonpersistent and Persistent Connections 912.2.3 HTTP Message Format 942.2.4 User-Server Interaction: Authorization and Cookies 992.2.5 The Conditional GET 1012.2.6 HTTP Content 103

2.3 File Transfer: FTP 1032.3.1 FTP Commands and Replies 105

2.4 Electronic Mail in the Internet 1062.4.1 SMTP 1082.4.2 Comparison with HTTP 1112.4.3 Mail Message Formats and MIME 1122.4.4 Mail Access Protocols 117

2.5 DNS—The Internet’s Directory Service 1212.5.1 Services Provided by DNS 1222.5.2 Overview of How DNS Works 1242.5.3 DNS Records 1292.5.4 DNS Messages 131

2.6 Socket Programming with TCP 1332.6.1 Socket Programming with TCP 1342.6.2 An Example Client/Server Application in Java 136

2.7 Socket Programming with UDP 1432.8 Building a Simple Web Server 151

2.8.1 Web Server Functions 1512.9 Content Distribution 155

2.9.1 Web Caching 1562.9.2 Content Distribution Networks 1622.9.3 Peer-to-Peer File Sharing 165

xx Table of Contents

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

Page 21: Computer Networking

Table of Contents xxi

2.10 Summary 172Homework Problems and Questions 173Problems 175Discussion Questions 179Programming Assignments 180

Interview: Tim Berners-Lee 182

Chapter 3 Transport Layer 1843.1 Introduction and Transport-Layer Services 185

3.1.1 Relationship Between Transport and Network Layers 1853.1.2 Overview of the Transport Layer in the Internet 188

3.2 Multiplexing and Demultiplexing 1903.3 Connectionless Transport: UDP 196

3.3.1 UDP Segment Structure 1993.3.2 UDP Checksum 200

3.4 Principles of Reliable Data Transfer 2013.4.1 Building a Reliable Data Transfer Protocol 2033.4.2 Pipelined Reliable Data Transfer Protocols 2143.4.3 Go-Back-N (GBN) 2173.4.4 Selective Repeat (SR) 222

3.5 Connection-Oriented Transport: TCP 2283.5.1 The TCP Connection 2283.5.2 TCP Segment Structure 2303.5.3 Round-Trip Time Estimation and Timeout 2353.5.4 Reliable Data Transfer 2383.5.5 Flow Control 2463.5.6 TCP Connection Management 248

3.6 Principles of Congestion Control 2533.6.1 The Causes and the Costs of Congestion 2533.6.2 Approaches to Congestion Control 2593.6.3 Network Assisted Congestion Control Example:

ATM ABR Congestion Control 2603.7 TCP Congestion Control 262

3.7.1 Fairness 2683.7.2 TCP Delay Modeling 271

3.8 Summary 280Homework Problems and Questions 281Problems 282Discussion Questions 290

Interview: Sally Floyd 291

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

Page 22: Computer Networking

Chapter 4 Network Layer and Routing 2934.1 Introduction and Network Service Models 294

4.1.1 Network Service Model 2964.1.2 Origins of Datagram and Virtual Circuit Service 300

4.2 Routing Principles 3014.2.1 A Link State Routing Algorithm 3044.2.2 The Distance Vector Routing Algorithm 3084.2.3 Other Routing Algorithms 317

4.3 Hierarchical Routing 3174.4 The Internet Protocol (IP) 321

4.4.1 IPv4 Addressing 3224.4.2 Moving a Datagram from Source to Destination:

Addressing, Routing, and Forwarding 3304.4.3 Datagram Format 3334.4.4 IP Datagram Fragmentation 3364.4.5 ICMP: Internet Control Message Protocol 3394.4.6 Dynamic Host Configuration Protocol 3404.4.7 Network Address Translators (NATs) 342

4.5 Routing in the Internet 3464.5.1 Intra-Autonomous System Routing in the Internet: RIP and OSPF 3464.5.2 Inter-Autonomous System Routing: BGP 353

4.6 What’s Inside a Router? 3584.6.1 Input Ports 3604.6.2 Switching Fabric 3624.6.3 Output Ports 3644.6.4 Where Does Queuing Occur? 365

4.7 IPv6 3684.7.1 IPv6 Packet Format 3694.7.2 Transitioning from IPv4 to IPv6 372

4.8 Multicast Routing 3754.8.1 Introduction: The Internet Multicast Abstraction and

Multicast Groups 3754.8.2 IGMP 3794.8.3 Multicast Routing: The General Case 3834.8.4 Multicast Routing in the Internet 388

4.9 Mobility and the Network Layer 3914.9.1 Mobility Considerations in Network–Layer Design 3914.9.2 Mobility Management 3934.9.3 Mobile IP 400

4.10 Summary 405Homework Problems and Questions 406Problems 408Discussion Questions 414

Interview: Vinton G. Cerf 417

xxii Table of Contents

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

Page 23: Computer Networking

Table of Contents xxiii

Chapter 5 Link Layer and Local Area Networks 4195.1 Data Link Layer: Introduction and Services 421

5.1.1 The Services Provided by the Link Layer 4215.1.2 Adapters Communicating 424

5.2 Error–Detection and –Correction Techniques 4255.2.1 Parity Checks 4275.2.2 Checksumming Methods 4295.2.3 Cyclic Redundancy Check (CRC) 430

5.3 Multiple Access Protocols 4325.3.1 Channel Partitioning Protocols 4345.3.2 Random Access Protocols 4385.3.3 Taking-Turns Protocols 4465.3.4 Local Area Networks (LANs) 447

5.4 LAN Addresses and ARP 4495.4.1: LAN Addresses 4495.4.2: Address Resolution Protocol 451

5.5 Ethernet 4555.5.1 Ethernet Basics 4565.5.2 CSMA/CD: Ethernet’s Multiple Access Protocol 4605.5.3 Ethernet Technologies 462

5.6 Hubs, Bridges, and Switches 4665.6.1 Hubs 4675.6.2 Bridges 4685.6.3 Switches 476

5.7 Wireless Links 4805.7.1 Wireless LANs: IEEE 802.11b 4815.7.2 Bluetooth 487

5.8 PPP: The Point-to-Point Protocol 4885.8.1 PPP Data Framing 4905.8.2 PPP Link-Control Protocol (LCP) and Network-Control Protocols 492

5.9 Asynchronous Transfer Mode (ATM) 4945.9.1 Principal Characteristics of ATM 4955.9.2 ATM Physical Layer 4975.9.3 ATM Layer 4995.9.4 ATM Adaptation Layer 5005.9.5 IP over ATM 502

5.10 Frame Relay 5055.10.1 The Historical Context 5055.10.2 Frame Relay 506

5.11 Summary 510Homework Problems and Questions 511Problems 513Discussion Questions 519

Interview: Robert M. Metcalfe 520

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

Page 24: Computer Networking

Chapter 6 Multimedia Networking 5226.1 Multimedia Networking Applications 523

6.1.1 Examples of Multimedia Applications 5236.1.2 Hurdles for Multimedia in Today’s Internet 5266.1.3 How Should the Internet Evolve to Support Multimedia Better? 5276.1.4 Audio and Video Compression 528

6.2 Streaming Stored Audio and Video 5316.2.1 Accessing Audio and Video Through a Web Server 5326.2.2 Sending Multimedia from a Streaming Server to a Helper Application 5356.2.3 Real-Time Streaming Protocol (RTSP) 537

6.3 Making the Best of the Best-Effort Service: An Internet Phone Example 5416.3.1 The Limitations of a Best-Effort Service 5416.3.2 Removing Jitter at the Receiver for Audio 5436.3.3 Recovering from Packet Loss 5466.3.4 Streaming Stored Audio and Video 549

6.4 Protocols for Real-Time Interactive Applications 5506.4.1 RTP 5506.4.2 RTP Control Protocol (RTCP) 5556.4.3 SIP 5586.4.4 H.323 563

6.5 Beyond Best-Effort 5656.5.1 Scenario 1: A 1 Mbps Audio Applicaion and an FTP Transfer 5666.5.2 Scenario 2: A 1 Mbps Audio Applicaion and a High Priority

FTP Transfer 5676.5.3 Scenario 3: A Misbehaving Audio Applicaion and an FTP Transfer 5686.5.4 Scenario 4: Two 1 Mbps Audio Applicaions Over an Overloaded

1.5 Mbps Link 5706.6 Scheduling and Policing Mechanisms 572

6.6.1 Scheduling Mechanisms 5726.6.2 Policing: The Leaky Bucket 576

6.7 Integrated Services 5796.7.1 Guaranteed Quality of Service 5806.7.2 Controlled-Load Network Service 581

6.8 RSVP 5826.8.1 The Essence of RSVP 5826.8.2 A Few Simple Examples 584

6.9 Differentiated Services 5876.9.1 Differentiated Services: A Simple Scenario 5886.9.2 Traffic Classification and Conditioning 5906.9.3 Per-Hop Behaviors 5926.9.4 Criticisms of Differentiated Services 593

xxiv Table of Contents

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

Page 25: Computer Networking

Table of Contents xxv

6.10 Summary 594Homework Problems and Questions 596Problems 596Discussion Questions 600Programming Assignment 601

Interview: Henning Schulzrinne 602

Chapter 7 Security in Computer Networks 6047.1 What Is Network Security? 6057.2 Principles of Cryptography 608

7.2.1 Symmetric Key Cryptography 6107.2.2 Public Key Encryption 614

7.3 Authentication 6207.3.1 Authentication Protocol ap1.0 6217.3.2 Authentication Protocol ap2.0 6217.3.3 Authentication Protocol ap3.0 6227.3.4 Authentication Protocol ap3.1 6237.3.5 Authentication Protocol ap4.0 6237.3.6 Authentication Protocol ap5.0 624

7.4 Integrity 6277.4.1 Generating Digital Signatures 6287.4.2 Message Digests 6297.4.3 Hash Function Algorithms 631

7.5 Key Distribution and Certification 6337.5.1 The Key Distribution Center 6357.5.2 Public Key Certification 636

7.6 Access Control: Firewalls 6407.6.1 Packet Filtering 6417.6.2 Application Gateway 644

7.7 Attacks and Countermeasures 6467.7.1 Mapping 6467.7.2 Packet Sniffing 6467.7.3 Spoofing 6487.7.4 Denial-of-Service and Distributed Denial-of-Service Attacks 6487.7.5 Hijacking 650

7.8 Security in Many Layers: Case Studies 6507.8.1 Secure E-mail 6517.8.2 Secure Sockets Layer (SSL) and Transport Layer Security (TLS) 6567.8.3 Network-Layer Security: IPsec 6607.8.4 Security in IEEE 802.11 663

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

Page 26: Computer Networking

7.9 Summary 665Homework Problems and Questions 666Problems 667Discussion Questions 669

Interview: Steven M. Bellovin 670

Chapter 8 Network Management 6728.1 What Is Network Management? 6738.2 The Infrastructure for Network Management 6778.3 The Internet-Standard Management Framework 680

8.3.1 Structure of Management Information: SMI 6818.3.2 Management Information Base: MIB 6848.3.3 SNMP Protocol Operations and Transport Mappings 6868.3.4 Security and Administration 690

8.4 ASN.1 6938.5 Conclusion 698

Homework Problems and Questions 698Problems 699Discussion Questions 700

Interview: Jeff Case 701

References 703Index 733

xxvi Table of Contents

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

Page 27: Computer Networking

A Top-Down Approach Featuring the InternetComputer Networking

Second Edition

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

Page 28: Computer Networking

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