10
9 О JYL PUTER SIXTH EDITION NETWORKING А Тор-Down Approach JAMES F. KUROSE University of Massachusetts, Amherst KEITH W. ROSS Polytechnic Institute of NYU International Edition contributions by Goutam Paul Jadavpur University, Kolkata PEARSON Boston Columbus Indianapolis New York San Francisco Upper Saddle River Amsterdam Cape Town Dubai London Madrid Milan Munich Paris Montreal Toronto Delhi Mexico City Säo Paulo Sydney Hong Kong Seoul Singapore Taipei Tokyo

9 О JYL PUTER SIXTH EDITION NETWORKING

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 9 О JYL PUTER SIXTH EDITION NETWORKING

9 О JYL P U T E R SIXTH EDITION

NETWORKING А Тор-Down Approach

J A M E S F. K U R O S E University of Massachusetts, Amherst

KEITH W. R O S S Polytechnic Institute of NYU

International Edition contributions by Goutam Paul Jadavpur University, Kolkata

PEARSON

Boston Columbus Indianapolis New York San Francisco Upper Saddle River Amsterdam Cape Town Dubai London Madrid Milan Munich Paris Montreal Toronto

Delhi Mexico City Säo Paulo Sydney Hong Kong Seoul Singapore Taipei Tokyo

Page 2: 9 О JYL PUTER SIXTH EDITION NETWORKING

С О JYl PUTER SIXTH EDITION

NETWORKING A Top-Down Approach

J A M E S F. K U R O S E University of Massachusetts, Amherst

KEITH W. R O S S Polytechnic Institute of NYU

International Edition contributions by Goutam Paul Jadavpur University, Kolkata

PEARSON

Boston Columbus Indianapolis New York San Francisco Upper Saddle River Amsterdam Cape Town Dubai London Madrid Milan Munich Paris Montreal Toronto

Delhi Mexico City Säo Paulo Sydney Hong Kong Seoul Singapore Taipei Tokyo

Page 3: 9 О JYL PUTER SIXTH EDITION NETWORKING

Table of Contents

Computer Networks and the Internet l.i

1.2

1.3

1.4

1.5

1.6 1.7

1.8

What Is the Internet? 1.1.1 A Nuts-and-Bolts Description 1.1.2 A Services Description 1.1.3 What Is a Protocol? The Network Edge 1.2.1 Access Networks 1.2.2 Physical Media The Network Core 1.3.1 Packet S witching 1.3.2 Circuit Switching 1.3.3 A Network of Networks Delay, Loss, and Throughput in Packet-Switched Networks 1.4.1 Overview of Delay in Packet-Switched Networks 1.4.2 Queuing Delay and Packet Loss 1.4.3 End-to-End Delay 1.4.4 Throughput in Computer Networks Protocol Layers and Their Service Models 1.5.1 Layered Architecture 1.5.2 Encapsulation Networks Under Attack History of Computer Networking and the Internet 1.7.1 The Development of Packet Switching: 1961-1972 1.7.2 Proprietary Networks and Internetworking: 1972-1980 1.7.3 A Proliferation of Networks: 1980-1990 1.7.4 The Internet Explosion: The 1990s 1.7.5 The New Millennium Summary

Homework Problems and Questions Wireshark Lab Interview: Leonard Kleinrock

27 28 28 31 33 35 38 44 48 48 53 58 61 61 65 68 70 73 73 79 81 86 86 88 89 90 91 92 94

104 106

17

Page 4: 9 О JYL PUTER SIXTH EDITION NETWORKING

18 Table of Contents

Chapter 2 Application Layer 109 2.1 Principles of Network Applications ПО

2.1.1 Network Application Architectures 112 2.1.2 Processes Communicating 114 2.1.3 Transport Services Available to Applications 117 2.1.4 Transport Services Provided by the Internet 119 2.1.5 Application-Layer Protocols 122 2.1.6 Network Applications Covered in This Book 123

2.2 The Web and HTTP 124 2.2.1 Overview of HTTP 124 2.2.2 Non-Persistent and Persistent Connections 126 2.2.3 HTTP Message Format 129 2.2.4 User-Server Interaction: Cookies 134 2.2.5 Web Caching 136 2.2.6 The Conditional GET 140

2.3 File Transfer: FTP 142 2.3.1 FTP Commands and Replies 144

2.4 Electronic Mail in the Internet 144 2.4.1 SMTP 147 2.4.2 Comparison with HTTP 150 2.4.3 Mail Message Format 151 2.4.4 Mail Access Protocols 151

2.5 DNS—The Internet's Directory Service 156 2.5.1 Services Provided by DNS 157 2.5.2 Overview of How DNS Works 159 2.5.3 DNS Records and Messages 165

2.6 Peer-to-Peer Applications 170 2.6.1 P2P File Distribution 171 2.6.2 Distributed Hash Tables (DHTs) 177

2.7 Socket Programming: Creating Network Applications 182 2.7.1 Socket Programming with UDP 183 2.7.2 Socket Programming with TCP 189

2.8 Summary 194 Homework Problems and Questions 195 Socket Programming Assignments 205 Wireshark Labs: HTTP, DNS 207 Interview: Marc Andreessen 208

Page 5: 9 О JYL PUTER SIXTH EDITION NETWORKING

Table of Contents 19

Chapter 3 Transport Layer 211 3.1 Introduction and Transport-Layer Services 212

3.1.1 Relationship Between Transport and Network Layers 212 3.1.2 Overview of the Transport Layer in the Internet 215

3.2 Multiplexing and Demultiplexing 217 3.3 Connectionless Transport: UDP 224

3.3.1 UDP Segment Structure 228 3.3.2 UDP Checksum 228

3.4 Principles of Reliable Data Transfer 230 3.4.1 Building a Reliable Data Transfer Protocol 232 3.4.2 Pipelined Reliable Data Transfer Protocols 241 3.4.3 Go-Back-N (GBN) 244 3.4.4 Selective Repeat (SR) 249

3.5 Connection-Oriented Transport: TCP 256 3.5.1 The TCP Connection 257 3.5.2 TCP Segment Structure 259 3.5.3 Round-Trip Time Estimation and Timeout 264 3.5.4 Reliable Data Transfer 268 3.5.5 Flow Control 276 3.5.6 TCP Connection Management 278

3.6 Principles of Congestion Control 285 3.6.1 The Causes and the Costs of Congestion 285 3.6.2 Approaches to Congestion Control 291 3.6.3 Network-Assisted Congestion-Control Example:

ATM ABR Congestion Control 292 3.7 TCP Congestion Control 295

3.7.1 Fairness 305 3.8 Summary 309 Homework Problems and Questions * 311 Programming Assignments 326 Wireshark Labs: TCP, UDP 327 Interview: Van Jacobson 328

Chapter 4 The Network Layer 331 4.1 Introduction 332

4.1.1 Forwarding and Routing 334 4.1.2 Network Service Models 336

4.2 Virtual Circuit and Datagram Networks 339 4.2.1 Virtual-Circuit Networks 340 4.2.2 Datagram Networks 343 4.2.3 Origins of VC and Datagram Networks 345

Page 6: 9 О JYL PUTER SIXTH EDITION NETWORKING

20 Table of Contents

4.3 What's Inside a Router? 346 4.3.1 Input Processing 348 4.3.2 Switching 350 4.3.3 Output Processing 352 4.3.4 Where Does Queuing Occur? 353 4.3.5 The Routing Control Plane 357

4.4 The Internet Protocol (IP): Forwarding and Addressing in the Internet 357 4.4.1 Datagram Format 358 4.4.2 IPv4 Addressing 364 4.4.3 Internet Control Message Protocol (ICMP) 379 4.4.4 IPv6 382 4.4.5 A Brief Foray into IP Security 388

4.5 Routing Algorithms 389 4.5.1 The Link-State (LS) Routing Algorithm 392 4.5.2 The Distance-Vector (DV) Routing Algorithm 397 4.5.3 Hierarchical Routing 405

4.6 Routing in the Internet 409 4.6.1 Intra-AS Routing in the Internet: RIP 410 4.6.2 Intra-AS Routing in the Internet: OSPF 414 4.6.3 Inter-AS Routing: BGP 416

4.7 Broadcast and Multicast Routing 425 4.7.1 Broadcast Routing Algorithms 426 4.7.2 Multicast 431

4.8 Summary 438 Homework Problems and Questions 439 Programming Assignments 455 Wireshark Labs: IP, ICMP 456 Interview: Vinton G. Cerf 457

Chapter 5 The Link Layer: Links, Access Networks, and LANs 459 5.1 Introduction to the Link Layer 460

5.1.1 The Services Provided by the Link Layer 462 5.1.2 Where Is the Link Layer Implemented? 463

5.2 Error-Detection and -Correction Techniques 464 5.2.1 Parity Checks 466 5.2.2 Checksumming Methods 468 5.2.3 Cyclic Redundancy Check (CRC) 469

5.3 Multiple Access Links and Protocols 471 5.3.1 Channel Partitioning Protocols 474 5.3.2 Random Access Protocols 475 5.3.3 Taking-Turns Protocols 485 5.3.4 DOCSIS: The Link-Layer Protocol for Cable Internet Access 486

Page 7: 9 О JYL PUTER SIXTH EDITION NETWORKING

Table of Contents 21

5.4 Switched Local Area Networks 487 5.4.1 Link-Layer Addressing and ARP 488 5.4.2 Ethernet 495 5.4.3 Link-Layer Switches 502 5.4.4 Virtual Local Area Networks (VLANs) 508

5.5 Link Virtualization: A Network as a Link Layer 512 5.5.1 Multiprotocol Label Switching (MPLS) 513

5.6 Data Center Networking 516 5.7 Retrospective: A Day in the Life of a Web Page Request 521

5.7.1 Getting Started: DHCP, UDP, IP, and Ethernet 521 5.7.2 Still Getting Started: DNS and ARP 523 5.7.3 Still Getting Started: Intra-Domain Routing to the DNS Server 524 5.7.4 Web Client-Server Interaction: TCP and HTTP 525

5.8 Summary 526 Homework Problems and Questions 528 Wireshark Labs: Ethernet and ARP, DHCP 536 Interview: Simon S. Lam 537

Chapter 6 Wireless and Mobile Networks 539 ff.l Introduction 540 6.2 Wireless Links and Network Characteristics 545

6.2.1 CDMA 548 6.3 WiFi: 802.11 Wireless LANs 552

6.3.1 The 802.11 Architecture 553 6.3.2 The 802.11 MAC Protocol 557 6.3.3 The IEEE 802.11 Frame 563 6.3.4 Mobility in the Same IP Subnet 567 6.3.5 Advanced Features in 802.11 568 6.3.6 Personal Area Networks: Bluetooth and Zigbee 570

6.4 Cellular Internet Access 572 6.4.1 An Overview of Cellular Network Architecture 573 6.4.2 3G Cellular Data Networks: Extending the Internet to Cellular

Subscribers 576 6.4.3 On to 4G: LTE 579

6.5 Mobility Management: Principles 581 6.5.1 Addressing 583 6.5.2 Routing to a Mobile Node 585

6.6 Mobile IP 590 6.7 Managing Mobility in Cellular Networks 596

6.7.1 Routing Calls to a Mobile User 597 6.7.2 Handoffs in GSM 598

Page 8: 9 О JYL PUTER SIXTH EDITION NETWORKING

22 Table of Contents

6.8 Wireless and Mobility: Impact on Higher-Layer Protocols 601 6.9 Summary 604 Homework Problems and Questions 604 Wireshark Lab: IEEE 802.11 (WiFi) 609 Interview: Deborah Estrin 610

Chapter 7 Multimedia Networking 613 7.1 Multimedia Networking Applications 614

7.1.1 Properties of Video 614 7.1.2 Properties of Audio 616 7.1.3 Types of Multimedia Network Applications 617

7.2 Streaming Stored Video 619 7.2.1 UDP Streaming 621 7.2.2 HTTP Streaming 622

7.2.3 Adaptive Streaming and DASH 626 7.2.4 Content Distribution Networks 628 7.2.5 Case Studies: Netflix, YouTube, and Kankan 634

7.3 Voice-over-IP 638 7.3.1 Limitations of the Best-Effort IP Service 638 7.3.2 Removing Jitter at the Receiver for Audio 640 7.3.3 Recovering from Packet Loss 643 7.3.4 Case Study: VoIP with Skype 646

7.4 Protocols for Real-Time Conversational Applications 649 7.4.1 RTP 650 7.4.2 SIP 653

7.5 Network Support for Multimedia 658 7.5.1 Dimensioning Best-Effort Networks 660 7.5.2 Providing Multiple Classes of Service 662 7.5.3 Diffserv 674 7.5.4 Per-Connection Quality-of-Service (QoS) Guarantees:

Resource Reservation and Call Admission 678 7.6 Summary 681 Homework Problems and Questions 682 Programming Assignment 692 Interview: Henning Schulzrinne 694

Chapter 8 Security in Computer Networks 697 8.1 What Is Network Security? 698 8.2 Principles of Cryptography 701

8.2.1 Symmetric Key Cryptography 702 8.2.2 Public Key Encryption 709

Page 9: 9 О JYL PUTER SIXTH EDITION NETWORKING

Table of Contents 23

8.3 Message Integrity and Digital Signatures 714 8.3.1 Cryptographic Hash Functions 715 8.3.2 Message Authentication Code 717 8.3.3 Digital Signatures 719

8.4 End-Point Authentication 726 8.4.1 Authentication Protocol apl.O 726 8.4.2 Authentication Protocol apl.O 727 8.4.3 Authentication Protocol арЗ.О 728 8.4.4 Authentication Protocol ap3.1 729 8.4.5 Authentication Protocol ap4.0 729

8.5 Securing E-Mail 731 8.5.1 Secure E-Mail 732 8.5.2 PGP 736

8.6 Securing TCP Connections: SSL 737 8.6.1 The Big Picture 739 8.6.2 A More Complete Picture 742

8.7 Network-Layer Security: IPsec and Virtual Private Networks 744 8.7.1 IPsec and Virtual Private Networks (VPNs) 744 8.7.2 The AH and ESP Protocols 746 8.7.3 Security Associations 746 8.7.4 The IPsec Datagram 747 8.7.5 IKE: Key Management in IPsec 751

8.8 Securing Wireless LANs 752 8.8.1 Wired Equivalent Privacy (WEP) 752 8.8.2 IEEE 802.1 li 754

8.9 Operational Security: Firewalls and Intrusion Detection Systems 757 8.9.1 Firewalls ' 757 8.9.2 Intrusion Detection Systems 765

8.10 Summary 768 Homework Problems and Questions 770 Wireshark Lab: SSL 778 IPsec Lab 778 Interview: Steven M. Bellovin 779

Chapter 9 Network Management 781 9.1 What Is Network Management? 782 9.2 The Infrastructure for Network Management 786 9.3 The Internet-Standard Management Framework 790

9.3.1 Structure of Management Information: SMI 792 9.3.2 Management Information Base: MIB 796

Page 10: 9 О JYL PUTER SIXTH EDITION NETWORKING

24 Table of Contents

9.3.3 SNMP Protocol Operations and Transport Mappings 798 9.3.4 Security and Administration 801

9.4 ASN.l 804 9.5 Conclusion 809 Homework Problems and Questions 809 Interview: Jennifer Rexford 812

References 815 Index 849