http- www.engr.sjsu.edu nmir book01 toc

15
COMPUTER AND COMMUNICATION NETWORKS Nader F. Mir Upper Saddle River, NJ . Boston . Indianapolis . San Francisco . New York Toronto . Montreal . London . Munich . Paris . Madrid . Capetown Sydney . Tokyo . Singapore . Mexico City

Upload: anwith-kiran

Post on 01-Nov-2014

22 views

Category:

Documents


3 download

DESCRIPTION

Nader Mir Contents

TRANSCRIPT

Page 1: Http- Www.engr.Sjsu.edu Nmir Book01 Toc

COMPUTER AND COMMUNICATIONNETWORKS

Nader F. Mir

Upper Saddle River, NJ . Boston . Indianapolis . San Francisco . New YorkToronto . Montreal . London . Munich . Paris . Madrid . CapetownSydney . Tokyo . Singapore . Mexico City

Page 2: Http- Www.engr.Sjsu.edu Nmir Book01 Toc

Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Wherethose designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printedwith initial capital letters or in all capitals.

The author and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of anykind and assume no responsibility for errors or omissions. No liability is assumed for incidental or consequential damagesin connection with or arising out of the use of the information or programs contained herein.

The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales, whichmay include electronic versions and/or custom covers and content particular to your business, training goals, marketingfocus, and branding interests. For more information, please contact:

U.S. Corporate and Government Sales(800) [email protected]

For sales outside the United States, please contact:

International [email protected]

This Book Is Safari Enabled

The Safari® Enabled icon on the cover of your favorite technology book means the book is available throughSafari Bookshelf. When you buy this book, you get free access to the online edition for 45 days.

Safari Bookshelf is an electronic reference library that lets you easily search thousands of technical books, find code samples,download chapters, and access technical information whenever and wherever you need it.

To gain 45-day Safari Enabled access to this book:

. Go to http://www.prenhallprofessional.com/safarienabled

. Complete the brief registration form

. Enter the coupon code VZGY-SBEH-4Q1D-K8IN-BX58

If you have difficulty registering on Safari Bookshelf or accessing the online edition, please e-mail [email protected].

Visit us on the Web: www.prenhallprofessional.com

Library of Congress Cataloging-in-Publication Data

Mir, Nader F.Computer and communication networks / Nader F. Mir.

p. cm.Includes bibliographical references and index.ISBN 0-13-174799-1 (hardcover : alk. paper)1. Computer networks. 2. Data transmission systems. I. Title.TK5105.5M567 2006004.6—dc22

2006025914

Copyright © 2007 Pearson Education, Inc.

All rights reserved. Printed in the United States of America. This publication is protected by copyright, and permission mustbe obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in anyform or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permissions,write to:

Pearson Education, Inc.Rights and Contracts DepartmentOne Lake StreetUpper Saddle River, NJ 07458Fax: (201) 236-3290

ISBN 0-13-174799-1Text printed in the United States on recycled paper at R.R. Donnelley in Crawfordsville, Indiana.First printing, November 2006

Page 3: Http- Www.engr.Sjsu.edu Nmir Book01 Toc

Contents

Preface xxi

About the Author xxxi

PART I: Fundamental Concepts 1

1 Packet-Switched Networks 31.1 Basic Definitions in Data Networks 4

1.1.1 Packet Switching versus Circuit Switching 41.1.2 Messages, Packets, and Frames 51.1.3 The Internet 61.1.4 ISPs and Internetwork Components 9

1.2 Types of Packet-Switched Networks 101.2.1 Connectionless Networks 111.2.2 Connection-Oriented Networks 13

1.3 Packet Size and Optimizations 141.4 Summary 161.5 Exercises 17

2 Foundation of Networking Protocols 192.1 5-Layer TCP/IP Model 202.2 7-Layer OSI Model 222.3 Internet Protocols and Addressing 23

2.3.1 IP Packet 232.3.2 IP Addressing Scheme 242.3.3 Subnet Addressing and Masking 25

Page 4: Http- Www.engr.Sjsu.edu Nmir Book01 Toc

viii Contents

2.3.4 Classless Interdomain Routing (CIDR) 272.3.5 Packet Fragmentation and Reassembly 282.3.6 Internet Control Message Protocol (ICMP) 292.3.7 IP Version 6 (IPv6) 30

2.4 Equal-Sized Packets Model: ATM 332.4.1 ATM Protocol Structure 342.4.2 ATM Cell Structure 36

2.5 Summary 392.6 Exercises 39

3 Networking Devices 433.1 Multiplexers 43

3.1.1 Frequency-Division Multiplexing (FDM) 443.1.2 Wavelength-Division Multiplexing (WDM) 443.1.3 Time-Division Multiplexing 45

3.2 Modems and Internet Access Devices 503.2.1 Line Coding Methods 503.2.2 Digital Modulation Techniques 523.2.3 Digital Subscriber Line (DSL) Modems 543.2.4 Cable Modems 56

3.3 Switching and Routing Devices 573.3.1 Repeaters, Hubs, and Bridges 573.3.2 Routers and Higher-Layer Switches 59

3.4 Router Structure 603.4.1 Input Port Processor (IPP) 603.4.2 Switch Fabric 633.4.3 Switch Controller 643.4.4 Output Port Processors (OPP) 65

3.5 Summary 673.6 Exercises 67

4 Data Links and Transmission 714.1 Data Links 724.2 Wired Links and Transmission 73

4.2.1 Twisted-Pair Links 734.2.2 Coaxial Cable 734.2.3 Optical Fiber 73

4.3 Wireless Links and Transmission 744.3.1 Choice of Antenna 75

Page 5: Http- Www.engr.Sjsu.edu Nmir Book01 Toc

Contents ix

4.3.2 Wireless Channels 764.3.3 Capacity Limits of Wireless Channels 794.3.4 Channel Coding 794.3.5 Flat-Fading Countermeasures 794.3.6 Intersymbol Interference Countermeasures 804.3.7 Orthogonal Frequency Division Multiplexing (OFDM) 81

4.4 Methods of Channel Access on Links 824.4.1 Frequency-Division Multiple Access 834.4.2 Time-Division Multiple Access 834.4.3 Code-Division Multiple Access 854.4.4 Space-Division Multiple Access 874.4.5 Hybrid Multiple-Access Techniques 87

4.5 Error Detection and Correction 874.5.1 Error Detection Methods 894.5.2 Cyclic Redundancy Check (CRC) Algorithm 89

4.6 Link-Level Flow Control 944.6.1 Stop-and-Wait Flow Control 954.6.2 Sliding-Window Flow Control 96

4.7 Summary 984.8 Exercises 99

5 Local Area Networks and Networks of LANs 1015.1 LANs and Basic Topologies 1025.2 LAN Protocols 103

5.2.1 Logical-Link Layer (LLC) 1035.2.2 Medium Access Control (MAC) 104

5.3 MAC and IP Addresses 1045.3.1 Address Resolution Protocol (ARP) 1055.3.2 Reverse Address Resolution Protocol (RARP) 106

5.4 Classification of MAC Protocols 1065.5 Contention-Access MAC 107

5.5.1 Carrier Sense Multiple Access (CSMA) 1085.5.2 Ethernet LAN: IEEE 802.3 Standard 113

5.6 Round-Robin-Access MAC 1145.6.1 Token-Ring Access Protocol 1145.6.2 Token-Ring: IEEE 802.5 Standard 116

5.7 Network of LANs 1165.7.1 Using Repeaters, Hubs, and Bridges 1175.7.2 Layers 2 and 3 Switches 124

Page 6: Http- Www.engr.Sjsu.edu Nmir Book01 Toc

x Contents

5.8 Summary 1255.9 Exercises 126

6 Wireless Networks and Mobile IP 1296.1 Infrastructure of Wireless Networks 1306.2 Wireless LAN Technologies 131

6.2.1 Infrared LANs 1326.2.2 Spread-Spectrum LANs 1336.2.3 Narrowband RF LANs 1336.2.4 Home RF and Bluetooth 134

6.3 IEEE 802.11 Wireless Standard 1346.3.1 802.11 Physical Layer 1366.3.2 802.11 MAC Layer 1376.3.3 WiFi Technology and 802.11 141

6.4 Cellular Networks 1426.4.1 Connectivity 1436.4.2 Frequency Reuse 1466.4.3 Local and Regional Handoffs 1496.4.4 Mobility Management 1506.4.5 Generations of Cellular Systems 1546.4.6 CDMA-Based Mobile Wireless 154

6.5 Mobile IP 1556.5.1 Addresses and Agents 1566.5.2 Agent Discovery Phase 1576.5.3 Registration 1586.5.4 Mobile IP Routing 1596.5.5 Security 163

6.6 Wireless Mesh Networks (WMNs) 1636.6.1 WiMAX Technology and IEEE 802.16 1636.6.2 Applications of Mesh Networks 1646.6.3 Physical and MAC Layers of WMNs 167

6.7 Summary 1686.8 Exercises 168

7 Routing and Internetworking 1717.1 Network-Layer Routing 172

7.1.1 Assigning Addresses to Hosts and Routers, and DHCP 1737.1.2 Network Address Translation (NAT) 1747.1.3 Route Cost 1767.1.4 Classification of Routing Algorithms 176

Page 7: Http- Www.engr.Sjsu.edu Nmir Book01 Toc

Contents xi

7.2 Least-Cost-Path Algorithms 1777.2.1 Dijkstra’s Algorithm 1777.2.2 Bellman-Ford Algorithm 178

7.3 Non-Least-Cost-Path Routing 1807.3.1 Flood Routing 1807.3.2 Deflection Routing 181

7.4 Intradomain Routing Protocols 1827.4.1 Routing Information Protocol (RIP) 1837.4.2 Open Shortest Path First (OSPF) 187

7.5 Interdomain Routing Protocols 1907.5.1 Border Gateway Protocol (BGP) 190

7.6 Congestion Control at Network Layer 1947.6.1 Unidirectional Congestion Control 1967.6.2 Bidirectional Congestion Control 1977.6.3 Random Early Detection (RED) 1987.6.4 A Quick Estimation of Link Blocking 200

7.7 Summary 2027.8 Exercises 203

8 Transport and End-to-End Protocols 2078.1 Transport Layer 208

8.1.1 Interaction of Transport and Network Layers 2098.2 Transmission Control Protocol (TCP) 209

8.2.1 TCP Segment 2108.2.2 Connection Setup 212

8.3 User Datagram Protocol (UDP) 2138.3.1 UDP Segment 2138.3.2 Applications of TCP and UDP 214

8.4 Mobile Transport Protocols 2158.4.1 TCP for Mobility 2158.4.2 UDP for Mobility 216

8.5 TCP Congestion Control 2178.5.1 Additive Increase, Multiplicative Decrease Control 2178.5.2 Slow Start Method 2198.5.3 Fast Retransmit Method 2208.5.4 TCP Congestion Avoidance Methods 221

8.6 Summary 2228.7 Exercises 223

Page 8: Http- Www.engr.Sjsu.edu Nmir Book01 Toc

xii Contents

9 Applications and Network Management 2259.1 Application-Layer Overview 226

9.1.1 Client and Server Model 2269.2 Domain Name System (DNS) 227

9.2.1 Domain Name Space 2289.2.2 Name/Address Mapping 2309.2.3 DNS Message Format 231

9.3 Remote Login Protocols 2329.3.1 TELNET Protocol 2339.3.2 Secure Shell (SSH) Protocol 234

9.4 Electronic Mail (E-mail) 2359.4.1 Simple Mail Transfer Protocol (SMTP) and E-mail 235

9.5 File Transfer and FTP 2379.5.1 File Transfer Protocol (FTP) 2379.5.2 Secure Copy Protocol (SCP) 237

9.6 World Wide Web (WWW) and HTTP 2379.6.1 Web Caching (Proxy Server) 238

9.7 Network Management 2399.7.1 Elements of Network Management 2419.7.2 Structure of Management Information (SMI) 2419.7.3 Management Information Base (MIB) 2429.7.4 Simple Network Management Protocol (SNMP) 243

9.8 Summary 2459.9 Exercises 246

10 Network Security 24910.1 Overview of Network Security 250

10.1.1 Elements of Network Security 25010.1.2 Threats to Network Security 251

10.2 Overview of Security Methods 25510.2.1 Cryptographic Techniques 25510.2.2 Authentication Techniques 256

10.3 Secret-Key Encryption Protocols 25710.3.1 Data Encryption Standard (DES) 25710.3.2 Advanced Encryption Standard (AES) 259

10.4 Public-Key Encryption Protocols 26010.4.1 RSA Algorithm 26010.4.2 Diffie-Hillman Key-Exchange Protocol 262

Page 9: Http- Www.engr.Sjsu.edu Nmir Book01 Toc

Contents xiii

10.5 Authentication 26310.5.1 Secure Hash Algorithm (SHA) 264

10.6 Authentication and Digital Signature 26510.7 Security of IP and Wireless Networks 266

10.7.1 IP Security and IPsec 26610.7.2 Security of Wireless Networks and IEEE 802.11 267

10.8 Firewalls 26910.9 Summary 27010.10 Exercises 271

PART II: Advanced Concepts 273

11 Packet Queues and Delay Analysis 27511.1 Little’s Theorem 27611.2 Birth-and-Death Process 27811.3 Queueing Disciplines 27911.4 Markovian FIFO Queueing Systems 281

11.4.1 M/M/1 Queueing Systems 28111.4.2 Systems with Limited Queueing Space: M/M/1/b 28611.4.3 M/M/a Queueing Systems 28711.4.4 Models for Delay-Sensitive Traffic: M/M/a/a 29211.4.5 M/M/∞ Queueing Systems 293

11.5 Non-Markovian and Self-Similar Models 29511.5.1 Pollaczek-Khinchin Formula and M/G/1 29511.5.2 M/D/1 Models 29811.5.3 Self-Similarity and Batch-Arrival Models 298

11.6 Networks of Queues 29911.6.1 Burke’s Theorem 29911.6.2 Jackson’s Theorem 304

11.7 Summary 30811.8 Exercises 309

12 Quality of Service and Resource Allocation 31512.1 Overview of QoS 31612.2 Integrated Services QoS 316

12.2.1 Traffic Shaping 31712.2.2 Admission Control 32412.2.3 Resource Reservation Protocol (RSVP) 324

Page 10: Http- Www.engr.Sjsu.edu Nmir Book01 Toc

xiv Contents

12.2.4 Packet Scheduling 32512.3 Differentiated Services QoS 335

12.3.1 Per-Hop Behavior (PHB) 33612.4 Resource Allocation 337

12.4.1 Management of Resources 33812.4.2 Classification of Resource-Allocation Schemes 33812.4.3 Fairness in Resource Allocation 34012.4.4 ATM Resource Allocation 34012.4.5 Cell Scheduling and QoS 343

12.5 Summary 34412.6 Exercises 344

13 Networks in Switch Fabrics 34913.1 Characteristics and Features of Switch Fabrics 350

13.1.1 Blocking and Nonblocking Networks 35013.1.2 Features of Switch Fabrics 35113.1.3 Complexity of Switching Networks 35113.1.4 Definitions and Symbols 351

13.2 Crossbar Switch Fabrics 35213.3 Blocking Switch Fabrics 353

13.3.1 Omega Network 35313.3.2 Banyan Network 35513.3.3 Delta Networks 35513.3.4 Benes Networks 356

13.4 Nonblocking Switch Fabrics: Clos Networks 35713.4.1 Estimation of Blocking Probabilities 36013.4.2 Five-Stage Clos Networks 361

13.5 Concentration and Expansion Switches 36113.5.1 Knockout Switching Network 36313.5.2 Expansion Network 364

13.6 Shared-Memory Switch Fabrics 36513.7 Techniques for Improving Performance 366

13.7.1 Parallel-Plane Switching Networks 36713.8 Case Study: Multipath Buffered Crossbar 368

13.8.1 Queueing Model 37013.8.2 Markov Chain Model 37113.8.3 Throughput and Delay 374

Page 11: Http- Www.engr.Sjsu.edu Nmir Book01 Toc

Contents xv

13.9 Summary 37513.10 Exercises 376

14 Optical Networks and WDM Systems 37914.1 Overview of Optical Networks 380

14.1.1 Protocol Models and Standards 38014.2 Basic Optical Networking Devices 382

14.2.1 Tunable Lasers 38214.2.2 Optical Buffers or Delay Elements 38214.2.3 Optical Amplifiers 38214.2.4 Optical Filters 38214.2.5 Wavelength-Division Multiplexer (WDM) 38314.2.6 Optical Switches 384

14.3 Large-Scale Optical Switches 38614.3.1 Crossbar Switching Network 38714.3.2 Spanke-Benes Switching Network 387

14.4 Optical Routers 38814.4.1 Structure of Wavelength Routing Nodes 389

14.5 Wavelength Allocation in Networks 39114.5.1 Classification of Optical Networks 39214.5.2 Wavelength Allocation 393

14.6 Case Study: An All-Optical Switch 39514.6.1 Self-Routing in SSN 39714.6.2 Transmission in SSN 397

14.7 Summary 39814.8 Exercises 399

15 Multicasting Techniques and Protocols 40115.1 Basic Definitions and Techniques 402

15.1.1 IP Multicast Address 40315.1.2 Basic Multicast Tree Algorithms 40415.1.3 Classification of Multicast Protocols 406

15.2 Intradomain Multicast Protocols 40615.2.1 Distance Vector Multicast Routing Protocol (DVMRP) 40715.2.2 Internet Group Management Protocol (IGMP) 40715.2.3 Multicast OSPF (MOSPF) Protocol 40915.2.4 Protocol-Independent Multicast (PIM) 41015.2.5 Core-Based Trees (CBT) Protocol 413

Page 12: Http- Www.engr.Sjsu.edu Nmir Book01 Toc

xvi Contents

15.2.6 Multicast Backbone (MBone) 41315.3 Interdomain Multicast Protocols 414

15.3.1 Multiprotocol BGP (MBGP) 41415.3.2 Multicast Source Discovery Protocol (MSDP) 41515.3.3 Border Gateway Multicast Protocol (BGMP) 417

15.4 Node-Level Multicast Algorithms 41715.4.1 Tree-Based Multicast Algorithm 41815.4.2 Boolean Splitting Multicast Algorithm 42015.4.3 Packet Recirculation Multicast Algorithm 42315.4.4 Multicasting in Three-Dimensional Switches 424

15.5 Summary 42615.6 Exercises 427

16 VPNs, Tunneling, and Overlay Networks 43116.1 Virtual Private Networks (VPNs) 432

16.1.1 Remote-Access VPN 43316.1.2 Site-to-Site VPN 43316.1.3 Tunneling and Point-to-Point Protocol (PPP) 43416.1.4 Security in VPNs 436

16.2 Multiprotocol Label Switching (MPLS) 43716.2.1 MPLS Operation 43816.2.2 Routing in MPLS Domains 43916.2.3 Tunneling and Use of FEC 44116.2.4 Traffic Engineering 44216.2.5 MPLS-Based VPNs 443

16.3 Overlay Networks 44416.3.1 Peer-to-Peer (P2P) Connection 445

16.4 Summary 44616.5 Exercises 447

17 Compression of Digital Voice and Video 44917.1 Overview of Data Compression 45017.2 Digital Voice and Compression 451

17.2.1 Signal Sampling 45117.2.2 Quantization and Distortion 452

17.3 Still Images and JPEG Compression 45517.3.1 Raw-Image Sampling and DCT 45617.3.2 Quantization 45917.3.3 Encoding 460

Page 13: Http- Www.engr.Sjsu.edu Nmir Book01 Toc

Contents xvii

17.4 Moving Images and MPEG Compression 46117.4.1 MP3 and Streaming Audio 462

17.5 Limits of Compression with Loss 46317.5.1 Basics of Information Theory 46317.5.2 Entropy of Information 46417.5.3 Shannon’s Coding Theorem 46517.5.4 Compression Ratio and Code Efficiency 467

17.6 Compression Methods Without Loss 46717.6.1 Run-Length Encoding 46817.6.2 Huffman Encoding 46817.6.3 Lempel-Ziv Encoding 469

17.7 Case Study: FAX Compression for Transmission 47017.8 Summary 47217.9 Exercises 472

18 VoIP and Multimedia Networking 47918.1 Overview of IP Telephony 480

18.1.1 VoIP Quality-of-Service 48118.2 VoIP Signaling Protocols 482

18.2.1 Session Initiation Protocol (SIP) 48318.2.2 H.323 Protocols 486

18.3 Real-Time Media Transport Protocols 49018.3.1 Real-Time Transport Protocol (RTP) 49118.3.2 Real-Time Control Protocol (RTCP) 49318.3.3 Estimation of Jitter in Real-Time Traffic 496

18.4 Distributed Multimedia Networking 49718.4.1 Content Distribution Networks (CDNs) 49818.4.2 CDN Interactions with DNS 49818.4.3 Providing QoS to Streaming 499

18.5 Stream Control Transmission Protocol (SCTP) 50018.5.1 SCTP Packet Structure 501

18.6 Self-Similarity and Non-Markovian Streaming Analysis 50318.6.1 Self-Similarity with Batch Arrival Models 503

18.7 Summary 50618.8 Exercises 507

19 Mobile Ad-Hoc Networks 51119.1 Overview of Wireless Ad-Hoc Networks 512

Page 14: Http- Www.engr.Sjsu.edu Nmir Book01 Toc

xviii Contents

19.2 Routing in Ad-Hoc Networks 51319.2.1 Classification of Routing Protocols 514

19.3 Routing Protocols for Ad-Hoc Networks 51519.3.1 Destination-Sequenced Distance Vector (DSDV) Protocol 51519.3.2 Cluster-Head Gateway Switch Routing Protocol 51719.3.3 Wireless Routing Protocol (WRP) 51719.3.4 Dynamic Source Routing (DSR) Protocol 51919.3.5 Temporally Ordered Routing Algorithm (TORA) 52019.3.6 Associative-Based Routing (ABR) Protocol 52119.3.7 Ad-Hoc On-Demand Distance Vector (AODV) Protocol 522

19.4 Security of Ad-Hoc Networks 52819.4.1 Types of Attacks 52919.4.2 Criteria for a Secure Routing Protocol 530

19.5 Summary 53119.6 Exercises 531

20 Wireless Sensor Networks 53520.1 Sensor Networks and Protocol Structures 536

20.1.1 Clustering in Sensor Networks 53620.1.2 Protocol Stack 53720.1.3 Sensor Node Structure 538

20.2 Communication Energy Model 54020.3 Clustering Protocols 545

20.3.1 Classification of Clustering Protocols 54620.3.2 LEACH Clustering Protocol 54620.3.3 DEEP Clustering Protocol 54720.3.4 Reclustering 551

20.4 Routing Protocols 55120.4.1 Intracluster Routing Protocols 55220.4.2 Intercluster Routing Protocols 554

20.5 Case Study: Simulation of a Sensor Network 55720.5.1 Cluster-Head Constellation and Distribution of Load 55720.5.2 Optimum Percentage of Cluster Heads 558

20.6 Other Related Technologies 55920.6.1 Zigbee Technology and IEEE 802.15.4 559

20.7 Summary 56020.8 Exercises 561

Page 15: Http- Www.engr.Sjsu.edu Nmir Book01 Toc

Contents xix

Appendix A: Glossary of Acronyms 563

Appendix B: RFCs 569

Appendix C: Probabilities and Stochastic Processes 573C.1 Probability Theory 573

C.1.1 Bernulli and Binomial Sequential Laws 574C.1.2 Counting and Sampling Methods 574

C.2 Random Variables 574C.2.1 Basic Functions 575C.2.2 Conditional Functions 575C.2.3 Popular Random Variables 576C.2.4 Expected Value and Variance 577C.2.5 A Function of Random Variable 578

C.3 Multiple Random Variables 578C.3.1 Basic Functions of Two Random Variables 578C.3.2 Two Independent Random Variables 579

C.4 Stochastic (Random) Processes 579C.4.1 IID Random Process 580C.4.2 Brownian Motion Random Process 580

C.5 Theory of Markov Chains 580C.5.1 Continuous-Time Markov Chains 581

Index 583