The rights of Andrew S. Tanenbaum, Nick Feamster, and David Wetherall to be identified as the authors of this work have been asserted by them in accordance with the Copyright, Designs and Patents Act 1988.
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, photocopying, recording or otherwise, without either the prior written permission of the publisher or a license permitting restricted copying in the United Kingdom issued by the Copyright Licensing Agency Ltd, Saffron House, 6–10 Kirby Street, London EC 1N 8TS.
All trademarks used herein are the property of their respective owners. The use of any trademark in this text does not vest in the author or publisher any trademark ownership rights in such trademarks, nor does the use of such trademarks imply any affiliation with or endorsement of this book by such owners. For information regarding permissions, request forms, and the appropriate contacts within the Pearson Education Global Rights and Permissions department, please visit www.pearsoned.com/permissions.
This eBook is a standalone product and may or may not include all assets that were part of the print version. It also does not provide access to other Pearson digital products like MyLab and Mastering. The publisher reserves the right to remove any material in this eBook at any time.
British Library Cataloguing-in-Publication Data
A catalogue record for this book is available from the British Library
ISBN 10: 1-292-37406-3
ISBN 13: 978-1-292-37406-2
eBook ISBN 13: 9781292374017
To Suzanne,Barbara, Daniel, Aron, Nathan, Marvin, Matilde,Olivia, and Mirte (AST)
To Marshini, Mila, and Kira(NF)
To Katrin, Lucy,and Pepper (DJW)
This page is intentionally left blank
CONTENTS
PREFACE xix
1 INTRODUCTION
1.1 USESOF COMPUTER NETWORKS 1
1.1.1 Accessto Information2
1.1.2 Person-to-PersonCommunication 5
1.1.3 ElectronicCommerce 6
1.1.4 Entertainment6
1.1.5 TheInternet of Things7
1.2 TYPESOF COMPUTER NETWORKS 7
1.2.1 BroadbandAccess Networks 8
1.2.2 Mobileand Wireless Access Networks 8
1.2.3 ContentProvider Networks 11
1.2.4 Transit Networks 12
1.2.5 EnterpriseNetworks 13
1.3 NETWORK TECHNOLOGY,FROMLOCAL TOGLOBAL 15
1.3.1 PersonalArea Networks 15
1.3.2 LocalArea Networks 16
1.3.3 HomeNetworks 18
1.3.4 MetropolitanArea Networks 20
1.3.5 Wide Area Networks 21
1.3.6 Internetworks 25
viii
CONTENTS
1.4 EXAMPLESOF NETWORKS 26
1.4.1 TheInternet 26
1.4.2 MobileNetworks 36
1.4.3 Wireless Networks (WiFi) 43
1.5 NETWORK PROTOCOLS 47
1.5.1 DesignGoals 47
1.5.2 ProtocolLayering 49
1.5.3 Connectionsand Reliability53
1.5.4 ServicePrimitives56
1.5.5 TheRelationship of Services to Protocols58
1.6 REFERENCEMODELS 59
1.6.1 TheOSI Reference Model59
1.6.2 TheTCP/IP Reference Model61
1.6.3 ACritique of the OSI Model and Protocols64
1.6.4 ACritique of the TCP/IP Reference Model and Protocols66
1.6.5 TheModel Used in This Book67
1.7 STANDARDIZATION 68
1.7.1 Standardizationand Open Source68
1.7.2 Who’sWho in the Telecommunications World 69
1.7.3 Who’sWho in the International Standards World 71
1.7.4 Who’sWho in the Internet Standards World 72
1.8 POLICY,LEGAL, AND SOCIAL ISSUES75
1.8.1 OnlineSpeech 75
1.8.2 NetNeutrality 76
1.8.3 Security77
1.8.4 Privacy 78
1.8.5 Disinformation79
1.9 METRICUNITS 80
1.10 OUTLINEOF THE REST OF THE BOOK81
1.11 SUMMARY82
2 THE PHYSICAL LAYER
2.1 GUIDEDTRANSMISSION MEDIA90
2.1.1 PersistentStorage 90
2.1.2 Twisted Pairs 91
2.1.3 CoaxialCable 93
2.1.4 Power Lines94
2.1.5 FiberOptics 95
2.2 WIRELESSTRANSMISSION 100
2.2.1 TheElectromagnetic Spectrum101
2.2.2 FrequencyHopping Spread Spectrum103
2.2.3 DirectSequence Spread Spectrum103
2.2.4 Ultra-Wideband Communication104
2.3 USINGTHE SPECTRUM FOR TRANSMISSION104
2.3.1 RadioTransmission 104
2.3.2 Microwave Transmission 106
2.3.3 InfraredTransmission 107
2.3.4 LightTransmission 108
2.4 FROM WAVEFORMS TOBITS 109
2.4.1 TheTheoretical Basis for Data Communication110
2.4.2 TheMaximum Data Rate of a Channel114
2.4.3 DigitalModulation 115
2.4.4 Multiplexing 123
2.5 THEPUBLIC SWITCHED TELEPHONE NETWORK 131
2.5.1 Structureof the Telephone System131
2.5.2 TheLocal Loop: Telephone Modems, ADSL, and Fiber134
2.5.3 Trunks and Multiplexing 143
2.5.4 Switching149
2.6 CELLULARNETWORKS 154
2.6.1 CommonConcepts: Cells, Handoff, Paging 155
2.6.2 First-Generation(1G) Technology: Analog Voice 156
2.6.3 Second-Generation(2G) Technology: Digital Voice 158
2.6.4 GSM:The Global System for Mobile Communications159
2.6.5 Third-Generation(3G) Technology: Digital Voice and Data162
This book is nowinits sixth edition.Each edition has corresponded to a different phase in the way computer networks were used.When the first edition appeared in 1980, networks were an academic curiosity.When the second edition appeared in 1988, networks were used by universities and large businesses. When the third edition appeared in 1996, computer networks, especially the Internet, had become a daily reality for millions of people.By the fourth edition, in 2003, wireless networks and mobile computers had become commonplace for accessing the Weband the Internet.By the fifth edition, networks were about content distribution (especially videos using CDNs and peer-to-peer networks) and mobile phones. Nowinthe sixth edition, industry emphasis on is very high performance, with 5G cellular networks, 100-gigabit Ethernet, and 802.11ax WiFi at speeds up to 11 Gbps just around the corner.
New in the Sixth Edition
Among the manychanges in this book, the most important one is the addition of Prof. Nick Feamster as a co-author.Prof. Feamster has a Ph.D. from M.I.T.and is nowafull professor at the University of Chicago.
Another important change is that Chapter 8 (on security) has been very heavily modified by Prof. Herbert Bos of the Vrije Universiteit in Amsterdam.The focus has movedfrom cryptographytonetwork security.The issues of hacking, DoS attacks and so much more is front-and-center in the news almost every day,sowe are very grateful that Prof. Bos has redone the chapter to deal with these important issues in detail.The chapter discusses vulnerabilities, howto fixthem, howhackers respond to the fixes, howthe defenders react, and so on ad infinitum.The material on cryptographyhas been reduced somewhat to makeroom for the large amount of newmaterial on network security.
Of course, the book also has manyother changes to keep up with the everchanging world of computer networks. Achapter-by-chapter list of the major changes follows.
PREFACE
Chapter 1 serves the same introductory function as in previous editions, but the contents have been revised and brought up to date. Specific updates including adding additional discussions on the Internet of Things and modern cellular architectures, including 4G and 5G networks. Much of the discussion on Internet policy has also been updated, particularly the discussion on net neutrality.
Chapter 2 has been updated to include discussion of more prevalent physical media in access networks, such as DOCSIS and fiber arhictectures. Treatment of modern cellular network architectures and technologies was added, and the section on satellite networks was also substantially updated. Emerging technologies such as virtualization were added, including discussions on mobile virtual network operators and cellular network slicing. The policydiscussion was reorganized and updated to include discussion on policyquestions in the wireless arena, such as spectrum.
Chapter 3 has been updated to include DOCSIS as a protocol example, as it is awidely used access technology.Much of the error correction codes are, of course, timeless.
Chapter 4 has been brought up to date, with newmaterial on 40- and 100-gigabit Ethernet, 802.11.ac, 802.11ad, and 802.11ax.Newmaterial has been added on DOCSIS, explaining the MACsublayer in cable networks. Thematerial on 802.16 has been removedasitnow appears that this technology is going to lose out to the cellular 4G and 5G technologies.The section on RFID has also been removedto makespace for newmaterial, but also because it was not directly network related.
Chapter 5 has been updated to clarify and modernize the discussions on congestion management.The sections on traffic management have been updated and clarified, and the discussions on traffic shaping and traffic engineering have been updated. The chapter includes an entirely newsection on software-defined networking (SDN), including OpenFlowand programmable hardware (e.g., Tofino). The chapter also includes discussion on emerging applications of SDN, such as inband network telemetry.Some of the discussion on IPv6 has also been updated.
Chapter 6 has been extensively edited to include newmaterial on modern transport protocols, including TCP CUBIC, QUIC, and BBR. The material on performance measurement has been completely rewritten to focus on the measurement of throughput in computer networks, including an extensive discussion on the challenges of measuring access network throughout as speeds in access ISPs increase. The chapter also includes newmaterial on measuring user quality of experience, an emerging area in performance measurement.
Chapter 7 has been heavily edited. Over 60 pages of material that is no longer relevant to a book on computer networks has been removed. Thematerial on DNS has been almost completely rewritten to reflect modern developments in DNS, including the ongoing trends to encrypt DNS and generally improve its privacy characteristics. Emerging protocols such as DNS-over-HTTPS and other privacypreserving techniques for DNS are discussed. The discussion of the Web has been extensively updated, to reflect the increasing deployment of encryption on the Web,
as well as extensive privacy issues (e.g., tracking) that are now pervasive on the Web. The chapter includes a completely new section on Web privacy, more extensive discussions of modern content delivery technology (e.g., content delivery networks), and an expanded discussion on peer-to-peer networks. The section on the evolution of the Internet has also been edited to reflect trends towards distributed cloud services.
Chapter 8 has been completely overhauled. In previous editions, the focus of the security chapter was almost exclusively on information security by means of cryptography However, cryptography is only one aspect of network security and if we look at security incidents in practice, it is generally not the aspect where the problems are. To remedy this, we added new content on security principles, fundamental attack techniques, defenses, and a wide range of systems-related security issues. Moreover, we updated the existing sections by dropping some encryption techniques that are now obsolete and introducing more modern versions of protocols and standards.
Chapter 9 contains a renewed list of suggested readings and a comprehensive bibliography
In addition, dozens of new exercises and dozens of new references have been added.
List of Acronyms
Computer books are full of acronyms. This one is no exception. By the time you are completely finished reading this one, the following should ring a bell: AES, AMI, ARP, ARQ, ASK, BGP, BSC, CCK, CDM, CDN, CRL, DCF, DES, DIS, DMT, DMZ, DNS, EAP, ECN, EDE, EPC, FDD, FDM, FEC, FSK, GEO, GSM, HFC, HLR, HLS, HSS, IAB, IDS, IGP, IKE, IPS, ISM, ISO, ISP, ITU, IXC, IXP, KDC, LAN, LCP, LEC, LEO, LER, LLD, LSR, LTE, MAN, MEO, MFJ, MGW, MIC, MME, MPD, MSC, MSS, MTU, NAP, NAT, NAV, NCP, NFC, NIC, NID, NRZ, ONF, OSI, PAR, PCF, PCM, PCS, PGP, PHP, PIM, PKI, PON, POP, PPP, PSK, RAS, RCP, RED, RIP, RMT, RNC, RPC, RPR, RTO, RTP, SCO, SDH, SDN, SIP, SLA, SNR, SPE, SSL, TCG, TCM, TCP, TDM, TLS, TPM, UDP, URL, USB, UTP, UWB, VLR, VPN, W3C, WAF, WAN, WDM, WEP, WFQ and WPA. But don’t worry. Each will appear in boldface type and be carefully defined before it is used. As a fun test, see how many you can identify before reading the book, write the number in the margin, then try again after reading the book.
Instructors’ Resource Materials
The following protected instructors’ resource materials are available on the publisher’s Web site at www.pearsonglobaleditions.com For a user-name and password, please contact your local Pearson representative.
•Solutions manual
•PowerPoint lecture slides
PREFACE
Students’ Resource Materials
Resources for students are available through the open-access Companion Web site link on www.pearsonglobaleditions.com, including
•Figures, tables, and programs from the book
•Steganographydemo
•Protocol simulators
Acknowledgements
Manypeople helped us during the course of the sixth edition.We would especially liketothank Phyllis Davis (St. Louis Community College), Farah Kandah (University of Tennessee, Chattanooga), Jason Livingood (Comcast), Louise Moser (University of California, Santa Barbara), Jennifer Rexford (Princeton), Paul Schmitt (Princeton), Doug Sicker (CMU), Wenye Wang (North Carolina State University), and GregWhite (Cable Labs).
Some of Prof. Tanenbaum’sstudents have givenvaluable feedback on the manuscript, including: Ece Doganer,Yael Goede, Bruno Hoevelaken, Elena Ibi, Oskar Klonowski, Johanna Sänger,Theresa Schantz, Karlis Svilans, Mascha van der Marel, AnthonyWilkes, for providing ideas and feedback.
Jesse Donkervliet (Vrije Universiteit) thought of manynew end-of-chapter exercises to challenge the reader.
Paul Nagin (Chimborazo Publishing, Inc.)produced the Power Point slides for instructors.
Our editor at Pearson, TracyJohnson, was her usual helpful self in manyways large and small.Without her advice, drive,and persistence, this edition might neverhavehappened. Thankyou Tracy. Wereally appreciate your help.
Finally,wecome to the most important people.Suzanne has been through this 23 times nowand still has endless patience and love.Barbara and Marvin now knowthe difference between good textbooks and bad ones and are always an inspiration to produce good ones. Daniel and Matilde are wonderful additions to our family.Aron, Nathan, Olivia, and Mirte probably aren’tgoing to read this edition, buttheyinspire me and makemehopeful about the future (AST).Marshini, Mila, and Kira: My favorite network is the one we have built together.Thank you for your support and love (NF). Katrinand Lucyprovided endless support and always managed to keep a smile on my face. Thankyou (DJW).
ANDREW S TANENBAUM NICK FEAMSTER
DAVID J WETHERALL
1
INTRODUCTION
Each of the past three centuries was dominated by a single newtechnology. The 18th century was the era of the great mechanical systems accompanying the Industrial Revolution. The19th century was the age of the steam engine.During the 20th century,the key technology was information gathering, processing, and distribution. Amongother developments, we sawthe deployment of worldwide telephone networks, the invention of radio and television, the birth and unprecedented growth of the computer industry,the launching of communication satellites, and, of course, the Internet.Who knows what miracles the 21st century will bring?
As a result of this rapid technological progress, these areas are rapidly converging in the 21st century,and the differences between collecting, transporting, storing, and processing information are quickly disappearing.Organizations with hundreds of offices spread overawide geographical area routinely expect to be able to examine the current status of eventheir most remote outpost at the push of abutton. Asour ability to gather,process, and distribute information grows, the demand for more sophisticated information processing grows evenfaster.
1.1 USESOF COMPUTER NETWORKS
Although the computing industry is still young compared to other technical industries such as automobiles and air transportation, computers have made spectacular progress in a short time.During the first twodecades of their existence, 1
INTRODUCTION
computer systems were highly centralized, usually within a single room.Often, this room had glass windows, through which visitors could gawkatthe great electronic wonder inside.Amedium-sized companyoruniversity might have had one or twocomputers, while large institutions had at most a fewdozen. Theidea that within fifty years vastly more powerful computers smaller than postage stamps would be mass produced by the billions was science fiction.
The convergence of computers and communications has had a profound influence on the organization of computer systems.The once-dominant concept of the ‘‘computer center’’asaroom with a single large computer to which users bring their work for processing is nowobsolete (although data centers holding hundreds of thousands of Internet servers are common).The old model of a single computer serving all of the organization’scomputational needs has been replaced by one in which a large number of separate but interconnected computers do the job.These systems are called computer networks.The design and organization of these networks are the subjects of this book.
Throughout the book, we will use the term ‘‘computer network’’tomean a collection of interconnected, autonomous computing devices. Two computers are said to be interconnected if theycan exchange information.Interconnection can take place overavariety of transmission media including copper wire, fiber optic cable, and radio waves(e.g., microwave,infrared, communication satellites). Networks come in manysizes, shapes, and forms, as we will explore throughout the book. Theyare usually connectedto makelarger networks, with the Internet being the most well-known example of a network of networks.
1.1.1
Accessto Information
Access to information comes in manyforms. A common method of accessing information via the Internet is using a Web browser,which allows a user to retrieve information from various Web sites, including increasingly popular social media sites. Mobile applications on smartphones nowalso allowusers to access remote information. Topics include the arts, business, cooking, government, health, history,hobbies, recreation, science, sports, travel, and manyothers. Funcomes in too manyways to mention, plus some ways that are better left unmentioned. News organizations have largely migrated online, with some evenceasing print operations entirely.Access to information, including the news, is increasingly personalizable. Someonline publications evenallowyou to tell them that you are interested in corrupt politicians, big fires, scandals involving celebrities, and epidemics, but no football, thank you.This trend certainly threatens the employment of 12-year-old paperboys, but online distribution has allowed the distribution of news to reach far larger and broader audiences.
Increasingly,newsisalso being curated by social media platforms, where users can post and share news content from a variety of sources, and where the news that anygivenuser sees is prioritized and personalized based on both explicit user
preferences and complexmachine learning algorithms that predict user preferences based on the user’shistory.Online publishing and content curation on social media platforms supports a funding model that depends largely on highly targeted behavioral advertising, which necessarily implies gathering data about the behavior of individual users.This information has sometimes been misused.
Online digital libraries and retail sites nowhost digital versions of content ranging from academic journals to books.Manyprofessional organizations, such as the ACM (www.acm.org)and the IEEE Computer Society (www.computer.org), already have all their journals and conference proceedings online.Electronic book readers and online libraries may someday makeprinted books obsolete.Skeptics should takenote of the effect the printing press had on the medievalilluminated manuscript.
Much information on the Internet is accessed using a client-server model, where a client explicitly requests information from a server that hosts that information, as illustrated in Fig. 1-1.
The client-servermodel is widely used and forms the basis of much network usage. Themost popular realization is that of a Webapplication,where a server generates Web pages based on its database in response to client requests that may update the database.The client-server model is applicable not only when the client and server are both in the same building (and belong to the same company), but also when theyare far apart.Forexample, when a person at home accesses a page on the World Wide Web, the same model is employed, with the remote Web server being the server and the user’spersonal computer being the client.Under most conditions, one server can handle a large number (hundreds or thousands) of clients simultaneously.
If we look at the client-server model, to a first approximation we see that two processes (running programs) are involved, one on the client machine and one on the server machine.Communication takes the form of the client process sending a
Figure1-1. Anetwork with twoclients and one server.