top-rated free essay

Data Communication and Networking

By ncnikhil Feb 07, 2012 59903 Words
Don't forget to check out the Online Learning Center, www.mhhe.com/forouzan for additional resources!

Instructors and students using Data Communications and Networking, Fourth Edition by Behrouz A. Forouzan will find a wide variety of resources available at the Online Learning Center, www.mhhe.comlforouzan

Instructor Resources
Instructors can access the following resources by contacting their McGraw-Hill Representative for a secure password. PowerPoint Slides. Contain figures, tables, highlighted points, and brief descriptions of each section. Complete Solutions Manual. Password-protected solutions to all end-of-chapter problems are provided. a Pageout. A free tool that helps you create your own course website. D Instructor Message Board. Allows you to share ideas with other instructors using the text.

a

o

Student Resources
The student resources are available to those students using the book. Once you have accessed the Online Learning Center, click on "Student Resources," then select a chapter from the drop down menu that appears. Each chapter has a wealth of materials to help you review communications and networking concepts. Included are: Chapter Summaries. Bulleted summary points provide an essential review of major ideas and concepts covered in each chapter. a Student Solutions Manual. Contains answers for odd-numbered problems. Glossary. Defines key terms presented in the book. Flashcards. Facilitate learning through practice and review. a Animated Figures. Visual representations model key networking concepts, bringing them to life. D Automated Quizzes. Easy-to-use quizzes strengthen learning and emphasize important ideas from the book. Web links. Connect students to additional resources available online.

a

o o

a

DATA COMMUNICATIONS AND NETWORKING

McGraw-Hill Forouzan Networking Series

Titles by Behrouz A. Forouzan: Data Communications and Networking TCPflP Protocol Suite Local Area Networks Business Data Communications

DATA COMMUNICATIONS AND NETWORKING
Fourth Edition

Behrouz A. Forouzan
DeAnza College

with

Sophia Chung Fegan



Higher Education

Boston Burr Ridge, IL Dubuque, IA Madison, WI New York San Francisco S1. Louis Bangkok Bogota Caracas Kuala Lumpur Lisbon London Madrid Mexico City Milan Montreal New Delhi Santiago Seoul Singapore Sydney Taipei Toronto

The McGraw·HiII Companies

.~I

II Higher Education
DATA COMMUNICATIONS AND NETWORKING, FOURTH EDITION Published by McGraw-Hill, a business unit of The McGraw-Hill Companies. Inc., 1221 Avenue of the Americas, New York, NY 10020. Copyright © 2007 by The McGraw-Hill Companies, Inc. AlI rights reserved. No part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written consent of The McGraw-Hill Companies, Inc., including, but not limited to, in any network or other electronic storage or transmission, or broadcast for distance learning. Some ancillaries, including electronic and print components, may not be available to customers outside the United States. This book is printed on acid-free paper.

1234567890DOC/DOC09876
ISBN-13 ISBN-to 978-0-07-296775-3 0-07-296775-7

Publisher: Alan R. Apt Developmental Editor: Rebecca Olson Executive Marketing Manager: Michael Weitz Senior Project Manager: Sheila M. Frank Senior Production Supervisor: Kara Kudronowicz Senior Media Project Manager: Jodi K. Banowetz Associate Media Producer: Christina Nelson Senior Designer: David W Hash Cover Designer: Rokusek Design (USE) Cover Image: Women ascending Mount McKinley, Alaska. Mount McKinley (Denali) 12,000 feet, ©Allan Kearney/Getty Images Compositor: Interactive Composition Corporation Typeface: 10/12 Times Roman Printer: R. R. Donnelley Crawfordsville, IN

Library of Congress Cataloging-in~Publication Data
Forouzan, Behrouz A. Data communications and networking I Behrouz A Forouzan. - 4th ed. p. em. - (McGraw-HilI Forouzan networking series) Includes index. ISBN 978-0-07-296775-3 - ISBN 0-07-296775-7 (hard eopy : alk. paper) 1. Data transmission systems. 2. Computer networks. I. Title. II. Series. TK5105.F6617 004.6--dc22 www.mhhe.com 2007 2006000013 CIP

To lny wife, Faezeh, with love Behrouz Forouzan

Preface

XXlX

PART 1
Chapter 1 Chapter 2
PART 2

Overview
Introduction

1
3 27

Network Models

Physical Layer and Media
Data and Signals 57 101 141 Digital Transmission Analog Transmission

55

Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9 PART 3

Bandwidth Utilization: Multiplexing and Spreading Transmission Media Switching 213 191

161

Using Telephone and Cable Networksfor Data Transmission

241

Data Link Layer
Data Link Control Multiple Access

265
267 307 363 395

Chapter 10 Chapter 11 Chapter 12 Chapter 13 Chapter 14 Chapter 15 Chapter 16 Chapter 17 Chapter 18

Error Detection and Correction

Wired LANs: Ethernet Wireless LANs 421

Connecting LANs, Backbone Networks, and Virtual LANs Wireless WANs: Cellular Telephone and Satellite Networks SONETISDH 491 517

445 467

Virtual-Circuit Nenvorks: Frame Relay andATM

vii

viii

BRIEF CONTENTS

PART 4

Network Layer

547
549 579

Chapter 19 Chapter 20 Chapter 21 Chapter 22

Netvvork Layer: Logical Addressing Netvvork Layer: Internet Protocol

Netl,vork La.ver: Address Mapping, Error Reporting, and Multicasting 611 Network Layer: Delivery, Fonvarding, and Routing 647

PARTS
Chapter 23 Chapter 24
PART 6

Transport Layer

701
703 761

Process-to-Process Delivery: UDp, TCP, and SCTP Congestion Control and Quality ql'Sen'ice

Application Layer

795
797 817

Chapter 25 Chapter 26 Chapter 27 Chapter 28 Chapter 29

Domain Name System

Remote Logging, Electronic Mail, and File Transfer WWW and HTTP 851 873

Network Management: SNMP Multimedia 901

PART 7
Chapter 30 Chapter 31 Chapter 32 Appendix A Appendix B Appendix C Appendix D Appendix E Appendix F Appendix G Appendix H Acron.Vl11s ClOSSOlY References Index IIII

Security

929
931 961

Cf}1J tography

Network Security

Securit}' in the Internet: IPSec, SSLlTLS, PCp, VPN, and Firewalls 995 Unicode 1029 1037 1043

Numbering Systems Mathematical Review 8B/6T Code 1055

Telephone History Co!1tact Addresses RFCs 1063 UDP and TCP Ports

1059 1061 1065

1067 1071 1107

Preface

xxix Overview 1
3
3

PART 1

Chapter 1
1.1

Introduction

DATA COMMUNICATIONS
Components 4 Data Representation DataFlow 6

5

1.2

NETWORKS

7

Distributed Processing 7 Network Criteria 7 Physical Structures 8 Network Models 13 Categories of Networks 13 Interconnection of Networks: Internetwork

IS

1.3 1.4

THE INTERNET

16 19

A Brief History 17 The Internet Today 17

PROTOCOLS AND STANDARDS
Protocols 19 Standards 19 Standards Organizations Internet Standards 21 20

1.5

RECOMMENDED READING
Books 21 Sites 22 RFCs 22

21

1.6 1.7 1.8

KEY TERMS 22 SUMMARY 23 PRACTICE SET 24
Review Questions 24 Exercises 24 Research Activities 25

Chapter 2
2.1

Network Models
27
28

27

LAYERED TASKS

Sender, Receiver, and Carrier Hierarchy 29

ix

x

CONTENTS

2.2

THE OSI MODEL

29

Layered Architecture 30 Peer-to-Peer Processes 30 Encapsulation 33

2.3

LAYERS IN THE OSI MODEL
Physical Layer 33 Data Link Layer 34 Network Layer 36 Transport Layer 37 Session Layer 39 Presentation Layer 39 Application Layer 41 Summary of Layers 42 TCP/IP PROTOCOL SUITE 42 Physical and Data Link Layers 43 43 Network Layer Transport Layer 44 Application Layer 45

33

2.4

2.5

ADDRESSING

45

Physical Addresses 46 Logical Addresses 47 Port Addresses 49 Specific Addresses 50

2.6

RECOMMENDED READING
Books 51 Sites 51 RFCs 51

50

2.7 2.8 2.9

KEY lERMS 51 SUMMARY 52 PRACTICE SET 52
Review Questions 52 Exercises 53 Research Activities 54

PART 2

Physical Layer and Media
Data and Signals
57
58

55

Chapter 3
3.1

57

ANALOG AND DIGITAL

Analog and Digital Data 57 Analog and Digital Signals 58 Periodic and Nonperiodic Signals

3.2

PERIODIC ANALOG SIGNALS
Sine Wave 59 Phase 63 Wavelength 64 Time and Frequency Domains Composite Signals 66 Bandwidth 69

59

65

3.3

DIGITAL SIGNALS 71
Bit Rate 73 Bit Length 73 Digital Signal as a Composite Analog Signal Transmission of Digital Signals 74 74

CONTENTS

xi

3.4

TRANSMISSION IMPAIRMENT
Attenuation 81 Distortion 83 Noise 84

80

3.5

DATA RATE LIMITS

85

Noiseless Channel: Nyquist Bit Rate 86 Noisy Channel: Shannon Capacity 87 Using Both Limits 88

3.6

PERFORMANCE

89

Bandwidth 89 Throughput 90 Latency (Delay) 90 Bandwidth-Delay Product Jitter 94

92

3.7 3.8 3.9 3.10

RECOMMENDED READING
Books 94

94

KEYTERMS 94 SUMMARY 95 PRACTICE SET 96
Review Questions Exercises 96 96

Chapter 4
4.1

Digital Transmission

101
101

DIGITAL-TO-DIGITAL CONVERSION
Line Coding 101 Line Coding Schemes Block Coding 115 Scrambling 118 106

4.2 4.3 4.4 4.5 4.6 4.7

ANALOG-TO-DIGITAL CONVERSION
Pulse Code Modulation (PCM) Delta Modulation (DM) 129 121

120

TRANSMISSION MODES
Parallel Transmission 131 Serial Transmission 132

131 135

RECOMMENDED READING
Books 135

KEYTERMS 135 SUMMARY 136 PRACTICE SET 137
Review Questions Exercises 137 137

Chapter 5 Analog TranSl1'lission
5.1
Aspects of Digital-to-Analog Conversion Amplitude Shift Keying 143 Frequency Shift Keying 146 Phase Shift Keying 148 Quadrature Amplitude Modulation 152

141
141
142

DIGITAL-TO-ANALOG CONVERSION

5.2

ANALOG-TO-ANALOG CONVERSION
Amplitude Modulation 153 Frequency Modulation 154 Phase Modulation 155

152

xii

CONTENTS

5.3 5.4 5.5 5.6

RECOMMENDED READING
Books 156

156

KEY lERMS 157 SUMMARY 157 PRACTICE SET 158
Review Questions Exercises 158 158

Chapter 6
6.1

Ba17chridth Utili::.ation: Multiplexing and Spreading 161 161

MULTIPLEXING

Frequency-Division Multiplexing 162 Wavelength-Division Multiplexing 167 Synchronous Time-Division Multiplexing 169 Statistical Time-Division Multiplexing 179

6.2 6.3 6.4 6.5 6.6

SPREAD SPECTRUM

180
181

Frequency Hopping Spread Spectrum (FHSS) Direct Sequence Spread Spectrum 184

RECOMMENDED READING
Books 185

185

KEY lERMS 185 SUMMARY 186 PRACTICE SET 187
Review Questions Exercises 187 187

Chapter 7
7.1

Transmission Media 192

191

GUIDED MEDIA

Twisted-Pair Cable 193 Coaxial Cable 195 Fiber-Optic Cable 198

7.2

UNGUIDED MEDIA: WIRELESS
Radio Waves 205 Microwaves 206 Infrared 207

203

7.3 7.4 7.5 7.6

RECOMMENDED READING
Books 208

208

KEY lERMS 208 SUMMARY 209 PRACTICE SET 209
Review Questions Exercises 210 209

Chapter 8
8.1

Svvitching

213 214

CIRCUIT-SWITCHED NETWORKS

Three Phases 217 Efficiency 217 Delay 217 Circuit-Switched Technology in Telephone Networks

218

8.2

DATAGRAM NETWORKS
Routing Table 220

218

CONTENTS

xiii

Efficiency 220 Delay 221 Datagram Networks in the Internet

221

8.3

VIRTUAL-CIRCUIT NETWORKS

221

Addressing 222 Three Phases 223 Efficiency 226 Delay in Virtual-Circuit Networks 226 Circuit-Switched Technology in WANs 227

8.4 8.5 8.6 8.7 8.8

STRUCTURE OF A SWITCH
Structure of Circuit Switches 227 Structure of Packet Switches 232

227

RECOMMENDED READING
Books 235

235

KEY TERMS 235 SUMMARY 236 PRACTICE SET 236
Review Questions Exercises 237 236

Chapter 9
9.1

Using Telephone and Cable Networks for Data Transm,ission 241 241

1ELEPHONE NETWORK

Major Components 241 LATAs 242 Signaling 244 Services Provided by Telephone Networks

247

9.2 9.3

DIAL-UP MODEMS
Modem Standards ADSL 252 ADSL Lite 254 HDSL 255 SDSL 255 VDSL 255 Summary 255 249

248

DIGITAL SUBSCRIBER LINE 251

9.4 9.5

CABLE TV NETWORKS

256
256

Traditional Cable Networks 256 Hybrid Fiber-Coaxial (HFC) Network Bandwidth 257 Sharing 259 CM and CMTS 259 Data Transmission Schemes: DOCSIS

CABLE TV FOR DATA TRANSFER

257

260

9.6 9.7 9.8 9.9

RECOMMENDED READING
Books 261

261

KEY TERMS 261 SUMMARY 262 PRACTICE SET 263
Review Questions Exercises 264 263

xiv

CONTENTS

PART 3

Data Link Layer

265
267

Chapter 10
10.1

Error Detection and Correction
267

INTRODUCTION

Types of Errors 267 Redundancy 269 Detection Versus Correction 269 Forward Error Correction Versus Retransmission Coding 269 Modular Arithmetic 270

269

10.2

BLOCK CODING

271

Error Detection 272 Error Correction 273 Hamming Distance 274 Minimum Hamming Distance

274

10.3 10.4

LINEAR BLOCK CODES CYCLIC CODES 284

277
278

Minimum Distance for Linear Block Codes Some Linear Block Codes 278 Cyclic Redundancy Check 284 Hardware Implementation 287 Polynomials 291 Cyclic Code Analysis 293 Advantages of Cyclic Codes 297 Other Cyclic Codes 297

10.5

CHECKSUM

298

Idea 298 One's Complement 298 Internet Checksum 299

10.6 10.7 10.8 10.9

RECOMMENDED READING
Books 301 RFCs 301

30 I

KEY lERMS 301 SUMMARY 302 PRACTICE SET 303
Review Questions Exercises 303 303

Chapter 11
11.1 11.2 11.3 11.4 11.5 FRAMING

Data Link Control
307

307

Fixed-Size Framing 308 Variable-Size Framing 308

FLOW AND ERROR CONTROL
Flow Control 311 Error Control 311 PROTOCOLS 311

311

NOISELESS CHANNELS
Simplest Protocol 312 Stop-and-Wait Protocol 315

312

NOISY CHANNELS

318

Stop-and-Wait Automatic Repeat Request 318 Go-Back-N Automatic Repeat Request 324

CONTENTS

xv

Selective Repeat Automatic Repeat Request Piggybacking 339

332

11.6

HDLC

340
340

Configurations and Transfer Modes Frames 341 Control Field 343

11.7

POINT-TO-POINT PROTOCOL
Framing 348 Transition Phases 349 Multiplexing 350 Multilink PPP 355

346

11.8

RECOMMENDED READING
Books 357

357

11.9 KEY TERMS 357 11.10 SUMMARY 358 11.11 PRACTICE SET 359
Review Questions Exercises 359 359

Chapter 12
12.1

Multiple Access
364

363

RANDOMACCESS

ALOHA 365 Carrier Sense Multiple Access (CSMA) 370 Carrier Sense Multiple Access with Collision Detection (CSMAlCD) 373 Carrier Sense Multiple Access with Collision Avoidance (CSMAlCA) 377

12.2

CONTROLLED ACCESS
Reservation 379 Polling 380 Token Passing 381

379

12.3

CHANNELIZATION

383

Frequency-Division Multiple Access (FDMA) 383 Time-Division Multiple Access (TDMA) 384 Code-Division Multiple Access (CDMA) 385

12.4 12.5 12.6 12.7

RECOMMENDED READING
Books 391

390

KEY TERMS 391 SUMMARY 391 PRACTICE SET 392
Review Questions 392 Exercises 393 Research Activities 394

Chapter 13
13.1 13.2 13.3

Wired LANs: Ethernet
395 397 406

395

IEEE STANDARDS
Data Link Layer 396 Physical Layer 397

STANDARD ETHERNET
MAC Sublayer 398 Physical Layer 402

CHANGES IN THE STANDARD
Bridged Ethernet 406 Switched Ethernet 407 Full-Duplex Ethernet 408

xvi

CONTENTS

13.4 13.5

FAST ETHERNET
MAC Sublayer 409 Physical Layer 410

409 412

GIGABIT ETHERNET
MAC Sublayer 412 Physical Layer 414 Ten-Gigabit Ethernet 416

13.6 13.7 13.8 13.9

RECOMMENDED READING
Books 417

417

KEY TERMS 417 SUMMARY 417 PRACTICE SET 418
Review Questions Exercises 419 418

Chapter 14
14.1 IEEE 802.11

Wireless LANs
421
428

421

Architecture 421 MAC Sublayer 423 Addressing Mechanism Physical Layer 432

14.2

BLUETOOTH

434

Architecture 435 Bluetooth Layers 436 Radio Layer 436 Baseband Layer 437 L2CAP 440 Other Upper Layers 441

14.3 14.4 14.5 14.6

RECOMMENDED READING
Books 442

44 I

KEYTERMS 442 SUMMARY 442 PRACTICE SET 443
Review Questions Exercises 443 443

Chapter 15
15.1

Connecting LANs, Backbone Networks, and VirtuaL LANs 445
445

CONNECTING DEVICES
Passive Hubs 446 Repeaters 446 Active Hubs 447 Bridges 447 Two-Layer Switches 454 Routers 455 Three-Layer Switches 455 Gateway 455

15.2

BACKBONE NETWORKS
Bus Backbone 456 Star Backbone 457 Connecting Remote LANs 457

456

CONTENTS

xvii

15.3

VIRTUAL LANs 458 Membership 461 Configuration 461 Communication Between Switches IEEE Standard 462 Advantages 463 RECOMMENDED READING Books 463 Site 463

462

15.4 15.5 15.6 15.7

463

KEY TERMS 463 SUMMARY 464 PRACTICE SET 464
Review Questions Exercises 465 464

Chapter 16
16.1

Wireless WANs: Cellular Telephone and Satellite Networks 467 467
467

CELLULAR TELEPHONY
Frequency-Reuse Principle Transmitting 468 Receiving 469 Roaming 469 First Generation 469 Second Generation 470 Third Generation 477

16.2

SATELLITE NETWORKS
Orbits 479 Footprint 480 Three Categories of Satellites GEO Satellites 481 MEO Satellites 481 LEO Satellites 484

478
480

16.3 16.4 16.5 16.6

RECOMMENDED READING
Books 487

487

KEY TERMS 487 SUMMARY 487 PRACTICE SET 488
Review Questions Exercises 488 488

Chapter 17
17.1

SONETISDH

491

ARCHITECTURE 491
Signals 491 SONET Devices 492 Connections 493

17.2

SONET LAYERS

494

Path Layer 494 Line Layer 495 Section Layer 495 Photonic Layer 495 Device-Layer Relationships

495

xviii

CONTENTS

17.3

SONET FRAMES

496
496

Frame, Byte, and Bit Transmission STS-l Frame Format 497 Overhead Summary 501 Encapsulation 501

17.4

STS MULTIPLEXING 503
Byte Interleaving 504 Concatenated Signal 505 AddlDrop Multiplexer 506

17.5

SONET NETWORKS
Linear Networks 507 Ring Networks 509 Mesh Networks 510

507

17.6 17.7

VIRTUAL TRIBUTARIES
Types ofVTs Books 513 512

512 513

RECOMMENDED READING

17.8 KEY lERMS 513 17.9 SUMMARY 514 17.1 0 PRACTICE SET 514
Review Questions Exercises 515 514

Chapter 18
18.1

Virtual-Circuit Networks: Frame Relm' and ATM
517

517

FRAME RELAY

Architecture 518 Frame Relay Layers 519 Extended Address 521 FRADs 522 VOFR 522 LMI 522 Congestion Control and Quality of Service

522

18.2

ATM

523

Design Goals 523 Problems 523 Architecture 526 Switching 529 ATM Layers 529 Congestion Control and Quality of Service

535

18.3

ATM LANs

536

ATM LAN Architecture 536 LAN Emulation (LANE) 538 Client/Server Model 539 Mixed Architecture with Client/Server

540

18.4 18.5 18.6 18.7

RECOMMENDED READING
Books 541

540

KEY lERMS 541 SUMMARY 541 PRACTICE SET 543
Review Questions Exercises 543 543

CONTENTS

xix

PART 4

Network Layer

547
549

Chapter 19
19.1

Netvl/ark Layer: Logical Addressing
549

IPv4ADDRESSES

Address Space 550 Notations 550 Classful Addressing 552 Classless Addressing 555 Network Address Translation (NAT)

563

19.2 19.3

IPv6 ADDRESSES
Structure 567 Address Space 568

566 572

RECOMMENDED READING
Books 572 Sites 572 RFCs 572

19.4 19.5 19.6

KEY TERMS 572 SUMMARY 573 PRACTICE SET 574
Review Questions 574 Exercises 574 Research Activities 577

Chapter 20
20.1

Network Layer: Internet Protocol
579

579

INTERNETWORKING

Need for Network Layer 579 Internet as a Datagram Network 581 Internet as a Connectionless Network 582

20.2

IPv4

582

Datagram 583 Fragmentation 589 Checksum 594 Options 594

20.3

IPv6

596

Advantages 597 Packet Format 597 Extension Headers 602

20.4

TRANSITION FROM IPv4 TO IPv6
Dual Stack 604 Tunneling 604 Header Translation 605

603

20.5

RECOMMENDED READING
Books 606 Sites 606 RFCs 606

605

20.6 20.7 20.8

KEY TERMS 606 SUMMARY 607 PRACTICE SET 607
Review Questions 607 Exercises 608 Research Activities 609

xx

CONTENTS

Chapter 21
21.1 21.2

Network Layer: Address Mapping, Error Reporting, and Multicasting 611 611
618

ADDRESS MAPPING ICMP 621

Mapping Logical to Physical Address: ARP 612 Mapping Physical to Logical Address: RARp, BOOTP, and DHCP Types of Messages 621 Message Format 621 Error Reporting 622 Query 625 Debugging Tools 627

21.3

IGMP

630

Group Management 630 IGMP Messages 631 Message Format 631 IGMP Operation 632 Encapsulation 635 Netstat Utility 637

21.4 21.5

ICMPv6

638
638

Error Reporting Query 639 Books 641 Site 641 RFCs 641

RECOMMENDED READING

640

21.6 21.7 21.8

KEYTERMS 641 SUMMARY 642 PRACTICE SET 643
Review Questions 643 Exercises 644 Research Activities 645

Chapter 22
22.1 22.2 DELIVERY

Network Layer: Delivery, Forwarding, and Routing 647
647
647

Direct Versus Indirect Delivery

FORWARDING

648

Forwarding Techniques 648 Forwarding Process 650 Routing Table 655

22.3

UNICAST ROUTING PROTOCOLS
Optimization 658 Intra- and Interdomain Routing Distance Vector Routing 660 Link State Routing 666 Path Vector Routing 674 659

658

22.4

MULTICAST ROUTING PROTOCOLS
Unicast, Multicast, and Broadcast Applications 681 Multicast Routing 682 Routing Protocols 684 678

678

CONTENTS

xxi

22.5

RECOMMENDED READING
Books 694 Sites 694 RFCs 694

694

22.6 22.7 22.8

KEY lERMS 694 SUMMARY 695 PRACTICE SET 697
Review Questions 697 Exercises 697 Research Activities 699

PART 5

Transport Layer
and SeTP 703

701

Chapter 23
23.1

Process-fa-Process Delivery: UDp, TCp,
703
707

PROCESS-TO-PROCESS DELIVERY

Client/Server Paradigm 704 Multiplexing and Demultiplexing 707 Connectionless Versus Connection-Oriented Service Reliable Versus Unreliable 708 Three Protocols 708

23.2

USER DATAGRAM PROTOCOL (UDP)
Well-Known Ports for UDP User Datagram 710 Checksum 711 UDP Operation 713 Use ofUDP 715 709

709

23.3

TCP

715

TCP Services 715 TCP Features 719 Segment 721 A TCP Connection 723 Flow Control 728 Error Control 731 Congestion Control 735

23.4

SCTP

736

SCTP Services 736 SCTP Features 738 Packet Format 742 An SCTP Association 743 Flow Control 748 Error Control 751 Congestion Control 753

23.5

RECOMMENDED READING
Books 753 Sites 753 RFCs 753

753

23.6 23.7 23.8

KEY lERMS 754 SUMMARY 754 PRACTICE SET 756
Review Questions 756 Exercises 757 Research Activities 759

xxii

CONTENTS

Chapter 24
24.1 24.2 24.3 24.4 24.5 24.6

Congestion Control and Quality (~j'Service
761 763
764

767

DATA lRAFFIC CONGESTION

Traffic Descriptor 76] Traffic Profiles 762 Network Performance

CONGESTION CONTROL

765

Open-Loop Congestion Control 766 Closed-Loop Congestion Control 767 lWO EXAMPLES 768 Congestion Control in TCP 769 Congestion Control in Frame Relay 773

QUALITY OF SERVICE 775
Flow Characteristics Flow Classes 776 775

TECHNIQUES TO IMPROVE QoS
Scheduling 776 Traffic Shaping 777 Resource Reservation 780 Admission Control 780

776

24.7

INTEGRATED SERVICES

780

Signaling 781 Flow Specification 781 Admission 781 Service Classes 781 RSVP 782 Problems with Integrated Services

784

24.8 24.9

DIFFERENTIATED SERVICES
DS Field 785

785 786

QoS IN SWITCHED NETWORKS
QoS in Frame Relay QoS inATM 789 Books 791 787

24.10 RECOMMENDED READING 24.11 KEY TERMS 791 24.12 SUMMARY 791 24.13 PRACTICE SET 792 Review Questions Exercises 793 792

790

PART 6

Application Layer

795
797

Chapter 25
25.1 25.2

DO/nain Name Svstem

NAME SPACE 798 Flat Name Space 798 Hierarchical Name Space 798 DOMAIN NAME SPACE Label 799 Domain Narne Domain 801 799

799

CONTENTS

xxiii

25.3

DISTRIBUTION OF NAME SPACE
Hierarchy of Name Servers 802 Zone 802 Root Server 803 Primary and Secondary Servers 803

801

25.4

DNS IN THE INTERNET
Generic Domains 804 Country Domains 805 Inverse Domain 805

803

25.5

RESOLUTION

806

Resolver 806 Mapping Names to Addresses 807 Mapping Address to Names 807 Recursive Resolution 808 Iterative Resolution 808 Caching 808

25.6 25.7 25.8 25.9 25.10 25.11

DNS MESSAGES
Header 809 Question Record 811 Resource Record 811

809 811

TYPES OF RECORDS

REGISTRARS 811 DYNAMIC DOMAIN NAME SYSTEM (DDNS) ENCAPSULATION 812 RECOMMENDED READING 812 Books 813 Sites 813 RFCs 813

812

25.12 KEY TERMS 813 25.13 SUMMARY 813 25.14 PRACTICE SET 814 Review Questions Exercises 815 814

Chapter 26
26.1 26.2
TELNET 817

Remote Logging, Electronic Mail, and File Transfer
817 824

817

REMOTE LOGGING ELECTRONIC MAIL

Architecture 824 User Agent 828 Message Transfer Agent: SMTP 834 Message Access Agent: POP and IMAP Web-Based Mail 839

837

26.3 26.4

FILE TRANSFER

840
840

File Transfer Protocol (FTP) Anonymous FTP 844 Books 845 Sites 845 RFCs 845

RECOMMENDED READING

845

26.5 26.6

KEY lERMS 845 SUMMARY 846

xxiv

CONTENTS

26.7

PRACTICE SET

847

Review Questions 847 Exercises 848 Research Activities 848

Chapter 27
27.1

WWW and HTTP
851
853

851

ARCHITECTURE

Client (Browser) 852 Server 852 Uniform Resource Locator Cookies 853

27.2

WEB DOCUMENTS

854

Static Documents 855 Dynamic Documents 857 Active Documents 860

27.3

HTTP

861
868

HTTP Transaction 861 Persistent Versus Nonpersistent Connection Proxy Server 868

27.4

RECOMMENDED READING
Books 869 Sites 869 RFCs 869

869

27.5 27.6 27.7

KEY 1ERMS 869 SUMMARY 870 PRACTICE SET 871
Review Questions Exercises 871 871

Chapter 28
28.1

Network Management: SNMP
873

873

NETWORK MANAGEMENT SYSTEM
Configuration Management 874 Fault Management 875 Performance Management 876 Security Management 876 Accounting Management 877

28.2

SIMPLE NETWORK MANAGEMENT PROTOCOL (SNMP)
Concept 877 Management Components 878 Structure of Management Information Management Information Base (MIB) Lexicographic Ordering 889 SNMP 891 Messages 893 UDP Ports 895 Security 897 881 886

877

28.3

RECOMMENDED READING
Books 897 Sites 897 RFCs 897

897

28.4 28.5

KEY 1ERMS 897 SUMMARY 898

CONTENTS

xxv

28.6

PRACTICE SET
Review Questions Exercises 899

899
899

Chapter 29
29.1 29.2 29.3

Multimedia

901
902 903 908

DIGITIZING AUDIO AND VIDEO
Digitizing Audio 902 Digitizing Video 902

AUDIO AND VIDEO COMPRESSION
Audio Compression 903 Video Compression 904

STREAMING STORED AUDIO/VIDEO

First Approach: Using a Web Server 909 Second Approach: Using a Web Server with Metafile 909 Third Approach: Using a Media Server 910 Fourth Approach: Using a Media Server and RTSP 911

29.4 29.5 29.6 29.7

STREAMING LIVE AUDIOIVIDEO 912 REAL-TIME INTERACTIVE AUDIOIVIDEO Characteristics 912 917

912

RTP RTCP

916 919

RTP Packet Format UDPPort 919

Sender Report 919 Receiver Report 920 Source Description Message 920 Bye Message 920 Application-Specific Message 920 UDP Port 920

29.8 29.9

VOICE OVER IP
SIP 920 H.323 923

920 925

RECOMMENDED READING
Books 925 Sites 925

29.10 KEY 1ERMS 925 29.11 SUMMARY 926 29.12 PRACTICE SET 927 Review Questions 927 Exercises 927 Research Activities 928

PART 7

Security

929
931

Chapter 30
30.1 30.2

Cryptography
931

INTRODUCTION
Definitions 931 Two Categories 932

SYMMETRIC-KEY CRYPTOGRAPHY
Traditional Ciphers 935 Simple Modem Ciphers 938

935

xxvi

CONTENTS

Modern Round Ciphers 940 Mode of Operation 945

30.3 30.4 30.5 30.6 30.7

ASYMMETRIC-KEY CRYPTOGRAPHY
RSA 949 Diffie-Hellman Books 956 952

949

RECOMMENDED READING KEY TERMS 956 SUMMARY 957 PRACTICE SET 958 Review Questions 958 Exercises 959 Research Activities 960

956

Chapter 31
31.1

Network Security
961

961

SECURITY SERVICES

Message Confidentiality 962 Message Integrity 962 Message Authentication 962 Message Nonrepudiation 962 Entity Authentication 962

31.2 31.3

MESSAGE CONFIDENTIALITY MESSAGE INTEGRITY 964

962

Confidentiality with Symmetric-Key Cryptography 963 Confidentiality with Asymmetric-Key Cryptography 963 Document and Fingerprint 965 Message and Message Digest 965 Difference 965 Creating and Checking the Digest 966 Hash Function Criteria 966 Hash Algorithms: SHA-1 967

31.4 31.5

MESSAGE AUTHENTICATION
MAC 969

969

DIGITAL SIGNATURE
Comparison 97 I Need for Keys 972 Process 973 Services 974 Signature Schemes 976

971

31.6 31.7 31.8

ENTITY AUTHENTICATION
Passwords 976 Challenge-Response 978

976

KEY MANAGEMENT

981 990

Symmetric-Key Distribution 981 Public-Key Distribution 986

RECOMMENDED READING
Books 990

31.9 KEY TERMS 990 31.10 SUMMARY 991 31.11 PRACTICE SET 992
Review Questions 992 Exercises 993 Research Activities 994

CONTENTS

xxvii

Chapter 32
32.1

Security in the Internet: IPSec, SSUFLS, PGP, VPN, and Firewalls 995 996

IPSecurity (lPSec)

Two Modes 996 Two Security Protocols 998 Security Association 1002 Internet Key Exchange (IKE) 1004 Virtual Private Network 1004

32.2

SSLffLS

1008

SSL Services 1008 Security Parameters 1009 Sessions and Connections 1011 Four Protocols 10 12 Transport Layer Security 1013

32.3

PGP

1014

Security Parameters 1015 Services 1015 A Scenario 1016 PGP Algorithms 1017 Key Rings 1018 PGP Certificates 1019

32.4 32.5 32.6 32.7 32.8

FIREWALLS

1021 1024

Packet-Filter Firewall 1022 Proxy Firewall 1023

RECOMMENDED READING
Books 1024

KEY lERMS 1024 SUMMARY 1025 PRACTICE SET 1026
Review Questions Exercises 1026 1026

Appendix A
A.l UNICODE

Unicode

1029

1029

Planes 1030 Basic Multilingual Plane (BMP) 1030 Supplementary Multilingual Plane (SMP) 1032 Supplementary Ideographic Plane (SIP) 1032 Supplementary Special Plane (SSP) 1032 Private Use Planes (PUPs) 1032

A.2

ASCII

1032
1036

Some Properties of ASCII

Appendix B
B.l B.2
Weights 1038

Numbering Systems
1037

1037

BASE 10: DECIMAL BASE 2: BINARY
Weights 1038 Conversion 1038

1038

xxviii

CONTENTS

B.3

BASE 16: HEXADECIMAL
Weights 1039 Conversion 1039 A Comparison 1040

1039

BA

BASE 256: IP ADDRESSES
Weights 1040 Conversion 1040

1040 1041

B.5

OTHER CONVERSIONS
Binary and Hexadecimal 1041 Base 256 and Binary 1042

Appendix C
C.1

Mathenwtical Revietv
1043

1043

TRIGONOMETRIC FUNCTIONS
Sine Wave 1043 Cosine Wave 1045 Other Trigonometric Functions 1046 Trigonometric Identities 1046

C.2 C.3

FOURIER ANALYSIS
Fourier Series 1046 Fourier Transform 1048

1046 1050

EXPONENT AND LOGARITHM
Exponential Function 1050 Logarithmic Function 1051

Appendix 0 Appendix E

8B/6T Code

1055 1059

Telephone History
1059

Before 1984 1059 Between 1984 and 1996 After 1996 1059

Appendix F Appendix G Appendix H

Contact Addresses RFCs 1063

1061

UDP and TCP Ports

1065

Acronyms Glossary References Index
1111

1067 1071 1107

Data communications and networking may be the fastest growing technologies in our culture today. One of the ramifications of that growth is a dramatic increase in the number of professions where an understanding of these technologies is essential for successand a proportionate increase in the number and types of students taking courses to learn about them.

Features of the Book
Several features of this text are designed to make it particularly easy for students to understand data communications and networking.

Structure
We have used the five-layer Internet model as the framework for the text not only because a thorough understanding of the model is essential to understanding most current networking theory but also because it is based on a structure of interdependencies: Each layer builds upon the layer beneath it and supports the layer above it. In the same way, each concept introduced in our text builds upon the concepts examined in the previous sections. The Internet model was chosen because it is a protocol that is fully implemented. This text is designed for students with little or no background in telecommunications or data communications. For this reason, we use a bottom-up approach. With this approach, students learn first about data communications (lower layers) before learning about networking (upper layers).

Visual Approach
The book presents highly technical subject matter without complex formulas by using a balance of text and figures. More than 700 figures accompanying the text provide a visual and intuitive opportunity for understanding the material. Figures are particularly important in explaining networking concepts, which are based on connections and transmission. Both of these ideas are easy to grasp visually.

Highlighted Points
We emphasize important concepts in highlighted boxes for quick reference and immediate attention. xxix

xxx

PREFACE

Examples and Applications
When appropriate, we have selected examples to reflect true-to-life situations. For example, in Chapter 6 we have shown several cases of telecommunications in current telephone networks.

Recommended Reading
Each chapter includes a list of books and sites that can be used for further reading.

Key Terms
Each chapter includes a list of key terms for the student.

Summary
Each chapter ends with a summary of the material covered in that chapter. The summary provides a brief overview of all the important points in the chapter.

Practice Set
Each chapter includes a practice set designed to reinforce and apply salient concepts. It consists of three parts: review questions, exercises, and research activities (only for appropriate chapters). Review questions are intended to test the student's first-level understanding of the material presented in the chapter. Exercises require deeper understanding of the materiaL Research activities are designed to create motivation for further study.

Appendixes
The appendixes are intended to provide quick reference material or a review of materials needed to understand the concepts discussed in the book.

Glossary and Acronyms
The book contains an extensive glossary and a list of acronyms.

Changes in the Fourth Edition
The Fourth Edition has major changes from the Third Edition, both in the organization and in the contents.

Organization
The following lists the changes in the organization of the book: 1. Chapter 6 now contains multiplexing as well as spreading. 2. Chapter 8 is now totally devoted to switching. 3. The contents of Chapter 12 are moved to Chapter 11. 4. Chapter 17 covers SONET technology. 5. Chapter 19 discusses IP addressing. 6. Chapter 20 is devoted to the Internet Protocol. 7. Chapter 21 discusses three protocols: ARP, ICMP, and IGMP. 8. Chapter 28 is new and devoted to network management in the Internet. 9. The previous Chapters 29 to 31 are now Chapters 30 to 32.

PREFACE

xxxi

Contents
We have revised the contents of many chapters including the following: 1. The contents of Chapters 1 to 5 are revised and augmented. Examples are added to clarify the contents. 2. The contents of Chapter 10 are revised and augmented to include methods of error detection and correction. 3. Chapter 11 is revised to include a full discussion of several control link protocols. 4. Delivery, forwarding, and routing of datagrams are added to Chapter 22. 5. The new transport protocol, SCTP, is added to Chapter 23. 6. The contents of Chapters 30, 31, and 32 are revised and augmented to include additional discussion about security issues and the Internet. 7. New examples are added to clarify the understanding of concepts.

End Materials
1. A section is added to the end of each chapter listing additional sources for study. 2. The review questions are changed and updated. 3. The multiple-choice questions are moved to the book site to allow students to self-test their knowledge about the contents of the chapter and receive immediate feedback. 4. Exercises are revised and new ones are added to the appropriate chapters. 5. Some chapters contain research activities.

Instructional Materials
Instructional materials for both the student and the teacher are revised and augmented. The solutions to exercises contain both the explanation and answer including full colored figures or tables when needed. The Powerpoint presentations are more comprehensive and include text and figures.

Contents
The book is divided into seven parts. The first part is an overview; the last part concerns network security. The middle five parts are designed to represent the five layers of the Internet model. The following summarizes the contents of each part.

Part One: Overview
The first part gives a general overview of data communications and networking. Chapter 1 covers introductory concepts needed for the rest of the book. Chapter 2 introduces the Internet model.

Part Two: Physical Layer
The second part is a discussion of the physical layer of the Internet model. Chapters 3 to 6 discuss telecommunication aspects of the physical layer. Chapter 7 introduces the transmission media, which, although not part of the physical layer, is controlled by it. Chapter 8 is devoted to switching, which can be used in several layers. Chapter 9 shows how two public networks, telephone and cable TV, can be used for data transfer.

xxxii

PREFACE

Part Three: Data Link Layer The third part is devoted to the discussion of the data link layer of the Internet model. Chapter 10 covers error detection and correction. Chapters 11, 12 discuss issues related to data link control. Chapters 13 through 16 deal with LANs. Chapters 17 and] 8 are about WANs. LANs and WANs are examples of networks operating in the first two layers of the Internet model. Part Four: Network Layer The fourth part is devoted to the discussion of the network layer of the Internet model. Chapter 19 covers IP addresses. Chapters 20 and 21 are devoted to the network layer protocols such as IP, ARP, ICMP, and IGMP. Chapter 22 discusses delivery, forwarding, and routing of packets in the Internet. Part Five: Transport Layer The fifth part is devoted to the discussion of the transport layer of the Internet model. Chapter 23 gives an overview of the transport layer and discusses the services and duties of this layer. It also introduces three transport-layer protocols: UDP, TCP, and SCTP. Chapter 24 discusses congestion control and quality of service, two issues related to the transport layer and the previous two layers. Part Six: Application Layer The sixth part is devoted to the discussion of the application layer of the Internet model. Chapter 25 is about DNS, the application program that is used by other application programs to map application layer addresses to network layer addresses. Chapter 26 to 29 discuss some common applications protocols in the Internet. Part Seven: Security The seventh part is a discussion of security. It serves as a prelude to further study in this subject. Chapter 30 briefly discusses cryptography. Chapter 31 introduces security aspects. Chapter 32 shows how different security aspects can be applied to three layers of the Internet model.

Online Learning Center
The McGraw-Hill Online Learning Center contains much additional material. Available at www.mhhe.com/forouzan. As students read through Data Communications and Networking, they can go online to take self-grading quizzes. They can also access lecture materials such as PowerPoint slides, and get additional review from animated figures from the book. Selected solutions are also available over the Web. The solutions to odd-numbered problems are provided to students, and instructors can use a password to access the complete set of solutions. Additionally, McGraw-Hill makes it easy to create a website for your networking course with an exclusive McGraw-Hill product called PageOut. It requires no prior knowledge of HTML, no long hours, and no design skills on your part. Instead, Page:Out offers a series of templates. Simply fill them with your course information and

PREFACE

xxxiii

click on one of 16 designs. The process takes under an hour and leaves you with a professionally designed website. Although PageOut offers "instant" development, the finished website provides powerful features. An interactive course syllabus allows you to post content to coincide with your lectures, so when students visit your PageOut website, your syllabus will direct them to components of Forouzan's Online Learning Center, or specific material of your own.

How to Use the Book
This book is written for both an academic and a professional audience. The book can be used as a self-study guide for interested professionals. As a textbook, it can be used for a one-semester or one-quarter course. The following are some guidelines.

o
o o

Parts one to three are strongly recommended. Parts four to six can be covered if there is no following course in TCP/IP protocol. Part seven is recommended if there is no following course in network security.

Acknowledgments
It is obvious that the development of a book of this scope needs the support of many people.

Peer Review The most important contribution to the development of a book such as this comes from peer reviews. We cannot express our gratitude in words to the many reviewers who spent numerous hours reading the manuscript and providing us with helpful comments and ideas. We would especially like to acknowledge the contributions of the following reviewers for the third and fourth editions of this book. Farid Ahmed, Catholic University Kaveh Ashenayi, University of Tulsa Yoris Au, University ofTexas, San Antonio Essie Bakhtiar, Clayton College & State University Anthony Barnard, University ofAlabama, Brimingham A.T. Burrell, Oklahoma State University Scott Campbell, Miami University Teresa Carrigan, Blackburn College Hwa Chang, Tufts University Edward Chlebus, Illinois Institute ofTechnology Peter Cooper, Sam Houston State University Richard Coppins, Virginia Commonwealth University Harpal Dhillon, Southwestern Oklahoma State University Hans-Peter Dommel, Santa Clara University M. Barry Dumas, Baruch College, CUNY William Figg, Dakota State University Dale Fox, Quinnipiac University Terrence Fries, Coastal Carolina University Errin Fulp, Wake Forest University

xxxiv

PREFACE

Sandeep Gupta, Arizona State University George Hamer, South Dakota State University James Henson, California State University, Fresno Tom Hilton, Utah State University Allen Holliday, California State University, Fullerton Seyed Hossein Hosseini, University ofWisconsin, Milwaukee Gerald Isaacs, Carroll College, Waukesha Hrishikesh Joshi, DeVry University E.S. Khosravi, Southern University Bob Kinicki, Worcester Polytechnic University Kevin Kwiat, Hamilton College Ten-Hwang Lai, Ohio State University Chung-Wei Lee, Auburn University Ka-Cheong Leung, Texas Tech University Gertrude Levine, Fairleigh Dickinson University Alvin Sek See Lim, Auburn University Charles Liu, California State University, Los Angeles Wenhang Liu, California State University, Los Angeles Mark Llewellyn, University of Central Florida Sanchita Mal-Sarkar, Cleveland State University Louis Marseille, Harford Community College Kevin McNeill, University ofArizona Arnold C. Meltzer, George Washington University Rayman Meservy, Brigham Young University Prasant Mohapatra, University of California, Davis Hung Z Ngo, SUNY, Buffalo Larry Owens, California State University, Fresno Arnold Patton, Bradley University Dolly Samson, Hawaii Pacific University Joseph Sherif, California State University, Fullerton Robert Simon, George Mason University Ronald 1. Srodawa, Oakland University Daniel Tian, California State University, Monterey Bay Richard Tibbs, Radford University Christophe Veltsos, Minnesota State University, Mankato Yang Wang, University ofMaryland, College Park Sherali Zeadally, Wayne State University

McGraw-Hill Staff
Special thanks go to the staff of McGraw-Hill. Alan Apt, our publisher, proved how a proficient publisher can make the impossible possible. Rebecca Olson, the developmental editor, gave us help whenever we needed it. Sheila Frank, our project manager, guided us through the production process with enormous enthusiasm. We also thank David Hash in design, Kara Kudronowicz in production, and Patti Scott, the copy editor.

Overview

Objectives
Part 1 provides a general idea of what we will see in the rest of the book. Four major concepts are discussed: data communications, networking, protocols and standards, and networking models. Networks exist so that data may be sent from one place to another-the basic concept of data communications. To fully grasp this subject, we must understand the data communication components, how different types of data can be represented, and how to create a data flow. Data communications between remote parties can be achieved through a process called networking, involving the connection of computers, media, and networking devices. Networks are divided into two main categories: local area networks (LANs) and wide area networks (WANs). These two types of networks have different characteristics and different functionalities. The Internet, the main focus of the book, is a collection of LANs and WANs held together by internetworking devices. Protocols and standards are vital to the implementation of data communications and networking. Protocols refer to the rules; a standard is a protocol that has been adopted by vendors and manufacturers. Network models serve to organize, unify, and control the hardware and software components of data communications and networking. Although the term "network model" suggests a relationship to networking, the model also encompasses data communications.

Chapters
This part consists of two chapters: Chapter 1 and Chapter 2. Chapter 1

In Chapter 1, we introduce the concepts of data communications and networking. We discuss data communications components, data representation, and data flow. We then move to the structure of networks that carry data. We discuss network topologies, categories of networks, and the general idea behind the Internet. The section on protocols and standards gives a quick overview of the organizations that set standards in data communications and networking.

Chapter 2
The two dominant networking models are the Open Systems Interconnection (OSI) and the Internet model (TCP/IP).The first is a theoretical framework; the second is the actual model used in today's data communications. In Chapter 2, we first discuss the OSI model to give a general background. We then concentrate on the Internet model, which is the foundation for the rest of the book.

I ,

I I

CHAPTERl

Introduction

Data communications and networking are changing the way we do business and the way we live. Business decisions have to be made ever more quickly, and the decision makers require immediate access to accurate information. Why wait a week for that report from Germany to arrive by mail when it could appear almost instantaneously through computer networks? Businesses today rely on computer networks and internetworks. But before we ask how quickly we can get hooked up, we need to know how networks operate, what types of technologies are available, and which design best fills which set of needs. The development of the personal computer brought about tremendous changes for business, industry, science, and education. A similar revolution is occurring in data communications and networking. Technological advances are making it possible for communications links to carry more and faster signals. As a result, services are evolving to allow use of this expanded capacity. For example, established telephone services such as conference calling, call waiting, voice mail, and caller ID have been extended. Research in data communications and networking has resulted in new technologies. One goal is to be able to exchange data such as text, audio, and video from all points in the world. We want to access the Internet to download and upload information quickly and accurately and at any time. This chapter addresses four issues: data communications, networks, the Internet, and protocols and standards. First we give a broad definition of data communications. Then we define networks as a highway on which data can travel. The Internet is discussed as a good example of an internetwork (i.e., a network of networks). Finally, we discuss different types of protocols, the difference between protocols and standards, and the organizations that set those standards.

1.1

DATA COMMUNICATIONS

When we communicate, we are sharing information. This sharing can be local or remote. Between individuals, local communication usually occurs face to face, while remote communication takes place over distance. The term telecommunication, which

3

4

CHAPTER 1

INTRODUCTION

includes telephony, telegraphy, and television, means communication at a distance (tele is Greek for "far"). The word data refers to information presented in whatever form is agreed upon by the parties creating and using the data. Data communications are the exchange of data between two devices via some form of transmission medium such as a wire cable. For data communications to occur, the communicating devices must be part of a communication system made up of a combination of hardware (physical equipment) and software (programs). The effectiveness of a data communications system depends on four fundamental characteristics: delivery, accuracy, timeliness, and jitter. I. Delivery. The system must deliver data to the correct destination. Data must be received by the intended device or user and only by that device or user. 7

Accuracy. The system must deliver the data accurately. Data that have been altered in transmission and left uncorrected are unusable.

3. Timeliness. The system must deliver data in a timely manner. Data delivered late are useless. In the case of video and audio, timely delivery means delivering data as they are produced, in the same order that they are produced, and without significant delay. This kind of delivery is called real-time transmission.

-\.. Jitter. Jitter refers to the variation in the packet arrival time. It is the uneven delay in the delivery of audio or video packets. For example, let us assume that video packets are sent every 3D ms. If some of the packets arrive with 3D-ms delay and others with 4D-ms delay, an uneven quality in the video is the result.

COinponents
A data communications system has five components (see Figure 1.1).

Figure 1.1 Five components ofdata communication
Rule 1: Rule 2: Rule n: Rule 1: Rule 2:

Protocol

-1

Message Medium

r

Protocol

Rulen:

I. Message. The message is the information (data) to be communicated. Popular I

forms of information include text, numbers, pictures, audio, and video. Sender. The sender is the device that sends the data message. It can be a computer, workstation, telephone handset, video camera, and so on.

3. Receiver. The receiver is the device that receives the message. It can be a computer, workstation, telephone handset, television, and so on. -1.. Transmission medium. The transmission medium is the physical path by which a message travels from sender to receiver. Some examples of transmission media include twisted-pair wire, coaxial cable, fiber-optic cable, and radio waves.

SECTION 1.1

DATA COMMUNICATIONS

5

5. Protocol. A protocol is a set of rules that govern data communications. It represents an agreement between the communicating devices. Without a protocol, two devices may be connected but not communicating, just as a person speaking French cannot be understood by a person who speaks only Japanese.

Data Representation
Information today comes in different forms such as text, numbers, images, audio, and video. Text

In data communications, text is represented as a bit pattern, a sequence of bits (Os or Is). Different sets of bit patterns have been designed to represent text symbols. Each set is called a code, and the process of representing symbols is called coding. Today, the prevalent coding system is called Unicode, which uses 32 bits to represent a symbol or character used in any language in the world. The American Standard Code for Information Interchange (ASCII), developed some decades ago in the United States, now constitutes the first 127 characters in Unicode and is also referred to as Basic Latin. Appendix A includes part of the Unicode. Numbers

Numbers are also represented by bit patterns. However, a code such as ASCII is not used to represent numbers; the number is directly converted to a binary number to simplify mathematical operations. Appendix B discusses several different numbering systems. Images

Images are also represented by bit patterns. In its simplest form, an image is composed of a matrix of pixels (picture elements), where each pixel is a small dot. The size of the pixel depends on the resolution. For example, an image can be divided into 1000 pixels or 10,000 pixels. In the second case, there is a better representation of the image (better resolution), but more memory is needed to store the image. After an image is divided into pixels, each pixel is assigned a bit pattern. The size and the value of the pattern depend on the image. For an image made of only blackand-white dots (e.g., a chessboard), a I-bit pattern is enough to represent a pixel. If an image is not made of pure white and pure black pixels, you can increase the size of the bit pattern to include gray scale. For example, to show four levels of gray scale, you can use 2-bit patterns. A black pixel can be represented by 00, a dark gray pixel by 01, a light gray pixel by 10, and a white pixel by 11. There are several methods to represent color images. One method is called RGB, so called because each color is made of a combination of three primary colors: red, green, and blue. The intensity of each color is measured, and a bit pattern is assigned to it. Another method is called YCM, in which a color is made of a combination of three other primary colors: yellow, cyan, and magenta. Audio

Audio refers to the recording or broadcasting of sound or music. Audio is by nature different from text, numbers, or images. It is continuous, not discrete. Even when we

6

CHAPTER 1

INTRODUCTION

use a microphone to change voice or music to an electric signal, we create a continuous signal. In Chapters 4 and 5, we learn how to change sound or music to a digital or an analog signal.

Video
Video refers to the recording or broadcasting of a picture or movie. Video can either be produced as a continuous entity (e.g., by a TV camera), or it can be a combination of images, each a discrete entity, arranged to convey the idea of motion. Again we can change video to a digital or an analog signal, as we will see in Chapters 4 and 5.

Data Flow
Communication between two devices can be simplex, half-duplex, or full-duplex as shown in Figure 1.2.

Figure 1.2 Data flow (simplex, half-duplex, andfull-duplex)

Direction of data

Mainframe

Monitor

a. Simplex
Direction of data at time I
~

Direction of data at time 2

b. Half-duplex

Direction of data all the time
)

c. Full·duplex

Simplex
In simplex mode, the communication is unidirectional, as on a one-way street. Only one of the two devices on a link can transmit; the other can only receive (see Figure 1.2a). Keyboards and traditional monitors are examples of simplex devices. The keyboard can only introduce input; the monitor can only accept output. The simplex mode can use the entire capacity of the channel to send data in one direction.

Half-Duplex
In half-duplex mode, each station can both transmit and receive, but not at the same time. : When one device is sending, the other can only receive, and vice versa (see Figure 1.2b).

SECTION 1.2

NETWORKS

7

The half-duplex mode is like a one-lane road with traffic allowed in both directions. When cars are traveling in one direction, cars going the other way must wait. In a half-duplex transmission, the entire capacity of a channel is taken over by whichever of the two devices is transmitting at the time. Walkie-talkies and CB (citizens band) radios are both half-duplex systems. The half-duplex mode is used in cases where there is no need for communication in both directions at the same time; the entire capacity of the channel can be utilized for each direction. Full-Duplex In full-duplex m.,lle (als@ called duplex), both stations can transmit and receive simultaneously (see Figure 1.2c). The full-duplex mode is like a tW~ o

'" ,,"

... '-.;:.~ L
,",
"

Output signal bandwidth

_C c:~::.:.~.•.•.. c critical angle, reflection

As the figure shows, if the angle of incidence I (the arIgle the ray makes with the line perpendicular to the interface between the two substances) is less than the critical angle, the ray refracts and moves closer to the surface. If the angle of incidence is equal to the critical angle, the light bends along the interface. If the angle is greater than the critical angle, the ray reflects (makes a turn) and travels again in the denser substance. Note that the critical angle is a property of the substance, and its value differs from one substance to another. Optical fibers use reflection to guide light through a channel. A glass or plastic core is surrounded by a cladding of less dense glass or plastic. The difference in density of the two materials must be such that a beam of light moving through the core is reflected off the cladding instead of being refracted into it. See Figure 7.11.

Propagation Modes
Current technology supports two modes (multimode and single mode) for propagating light along optical channels, each requiring fiber with different physical characteristics. Multimode can be implemented in two forms: step-index or graded-index (see Figure 7.12).

SECTION 7.1

GUlDED MEDIA

199

Figure 7.11

Opticaljiber

Cladding Sender Cladding Receiver

L.-_....J

Figure 7.12

Propagation modes

Multimode Multimode is so named because multiple beams from a light source move through the core in different paths. How these beams move within the cable depends on the structure ofthe core, as shown in Figure 7.13. In multimode step-index fiber, the density of the core remains constant from the center to the edges. A beam of light moves through this constant density in a straight line until it reaches the interface of the core and the cladding. At the interface, there is an abrupt change due to a lower density; this alters the angle of the beam's motion. The term step index refers to the suddenness of this change, which contributes to the distortion of the signal as it passes through the fiber. A second type of fiber, called multimode graded-index fiber, decreases this distortion of the signal through the cable. The word index here refers to the index of refraction. As we saw above, the index of refraction is related to density. A graded-index fiber, therefore, is one with varying densities. Density is highest at the center of the core and decreases gradually to its lowest at the edge. Figure 7.13 shows the impact of this variable density on the propagation of light beams. Single-Mode Single-mode uses step-index fiber and a highly focused source of light that limits beams to a small range of angles, all close to the horizontal. The singlemode fiber itself is manufactured with a much smaller diameter than that of multimode fiber, and with substantiallY lower density (index of refraction). The decrease in density results in a critical angle that is close enough to 90° to make the propagation of beams almost horizontal. In this case, propagation of different beams is almost identical, and delays are negligible. All the beams arrive at the destination "together" and can be recombined with little distortion to the signal (see Figure 7.13).

200

CHAPTER 7

TRANSMISSION MEDIA

Figure 7.13

Modes

JlJ1
Source

Destination

a. Multimode, step index

JlJ1
Source

Destination

b. Multimode, graded index

JlJ1
Source

Destination

c. Single mode

Fiber Sizes
Optical fibers are defined by the ratio of the diameter of their core to the diameter of their cladding, both expressed in micrometers. The common sizes are shown in Table 7.3. Note that the last size listed is for single-mode only.

Table 7.3 Fiber types
Type
501125 62.51125
Core(~)

Cladding (Jlm)
125 125 125 125

Mode
Multimode, graded index Multimode, graded index Multimode, graded index Single mode

50.0 62.5 100.0 7.0

100/125 7/125

Cable Composition
Figure 7.14 shows the composition of a typical fiber-optic cable. The outer jacket is made of either PVC or Teflon. Inside the jacket are Kevlar strands to strengthen the cable. Kevlar is a strong material used in the fabrication of bulletproof vests. Below the Kevlar is another plastic coating to cushion the fiber. The fiber is at the center of the cable, and it consists of cladding and core.

Fiber-Optic Cable Connectors
There are three types of connectors for fiber-optic cables, as shown in Figure 7.15.

SECTION 7.1

GUIDED MEDIA

201

Figure 7.14 Fiber construction
Du Pont Kevlar for strength

/

Glass or plastic core

Figure 7.15

Fiber-optic cable connectors

SC connector

ST connector

RX

TX
MT-RJ connector

The subscriber channel (SC) connector is used for cable TV. It uses a push/pull locking system. The straight-tip (ST) connector is used for connecting cable to networking devices. It uses a bayonet locking system and is more reliable than SC. MT-RJ is a connector that is the same size as RJ45.

Performance
The plot of attenuation versus wavelength in Figure 7.16 shows a very interesting phenomenon in fiber-optic cable. Attenuation is flatter than in the case of twisted-pair cable and coaxial cable. The performance is such that we need fewer (actually 10 times less) repeaters when we use fiber-optic cable.

Applications
Fiber-optic cable is often found in backbone networks because its wide bandwidth is cost-effective. Today, with wavelength-division multiplexing (WDM), we can transfer

202

CHAPTER 7

IRANSMISSION MEDIA

Figure 7.16

Optical fiber performance

100 50

~
~

IO 5

~

..l

0

00 00

1

0.5

0.1 0.05

0.01

800

1000

1200

1400 Wavelength (urn)

1600

1800

data at a rate of 1600 Gbps. The SONET network that we discuss in Chapter 17 provides such a backbone. Some cable TV companies use a combination of optical fiber and coaxial cable, thus creating a hybrid network. Optical fiber provides the backbone structure while coaxial cable provides the connection to the user premises. This is a cost-effective configuration since the narrow bandwidth requirement at the user end does not justify the use of optical fiber. Local-area networks such as 100Base-FX network (Fast Ethernet) and 1000Base-X also use fiber-optic cable. Advantages and Disadvantages of Optical Fiber

Advantages Fiber-optic cable has several advantages over metallic cable (twistedpair or coaxial).

D Higher bandwidth. Fiber-optic cable can support dramatically higher bandwidths (and hence data rates) than either twisted-pair or coaxial cable. Currently, data rates and bandwidth utilization over fiber-optic cable are limited not by the medium but by the signal generation and reception technology available. D Less signal attenuation. Fiber-optic transmission distance is significantly greater than that of other guided media. A signal can run for 50 km without requiring regeneration. We need repeaters every 5 km for coaxial or twisted-pair cable. D Immunity to electromagnetic interference. Electromagnetic noise cannot affect fiber-optic cables. o Resistance to corrosive materials. Glass is more resistant to corrosive materials than copper.

SECTION 7.2

UNGUIDED MEDIA: WIRELESS

203

o
o

Light weight. Fiber-optic cables are much lighter than copper cables. Greater immunity to tapping. Fiber-optic cables are more immune to tapping than copper cables. Copper cables create antenna effects that can easily be tapped.

Disadvantages There are some disadvantages in the use of optical fiber. Installation and maintenance. Fiber-optic cable is a relatively new technology. Its installation and maintenance require expertise that is not yet available everywhere. o Unidirectional light propagation. Propagation of light is unidirectional. If we need bidirectional communication, two fibers are needed. o Cost. The cable and the interfaces are relatively more expensive than those of other guided media. If the demand for bandwidth is not high, often the use of optical fiber cannot be justified.

o

7.2

UNGUIDED MEDIA: WIRELESS

Unguided media transport electromagnetic waves without using a physical conductor. This type of communication is often referred to as wireless communication. Signals are normally broadcast through free space and thus are available to anyone who has a device capable of receiving them. Figure 7.17 shows the part of the electromagnetic spectrum, ranging from 3 kHz to 900 THz, used for wireless communication.

Figure 7.17

Electromagnetic spectrumfor wireless communication

Radio wave and microwave

3 kHz

300
GHz

400

900

THz THz

Unguided signals can travel from the source to destination in several ways: ground propagation, sky propagation, and line-of-sight propagation, as shown in Figure 7.18. In ground propagation, radio waves travel through the lowest portion of the atmosphere, hugging the earth. These low-frequency signals emanate in all directions from the transmitting antenna and follow the curvature of the planet. Distance depends on the amount of power in the signal: The greater the power, the greater the distance. In sky propagation, higher-frequency radio waves radiate upward into the ionosphere (the layer of atmosphere where particles exist as ions) where they are reflected back to earth. This type of transmission allows for greater distances with lower output power. In line-or-sight propagation, very high-frequency signals are transmitted in straight lines directly from antenna to antenna. Antennas must be directional, facing each other,

204

CHAPTER 7

TRANSMISSION MEDIA

Figure 7.18

Propagation methods
Ionosphere Ionosphere Ionosphere

Ground propagation (below 2 MHz)

Sky propagation (2-30 MHz)

Line-af-sight propagation (above 30 MHz)

and either tall enough or close enough together not to be affected by the curvature of the earth. Line-of-sight propagation is tricky because radio transmissions cannot be completely focused. The section of the electromagnetic spectrum defined as radio waves and microwaves is divided into eight ranges, called bands, each regulated by government authorities. These bands are rated from very low frequency (VLF) to extremely highfrequency (EHF). Table 7.4 lists these bands, their ranges, propagation methods, and some applications. Table 7.4

Bands Band Range Propagation Application

VLF (very low frequency) LF (low frequency) MF (middle frequency) HF (high frequency)

3-30 kHz 30-300 kHz 300 kHz-3 MHz 3-30 MHz

Ground Ground Sky Sky

Long-range radio navigation Radio beacons and navigational locators AM radio Citizens band (CB), shipiaircraft communication VHF TV, FM radio UHF TV, cellular phones, paging, satellite Satellite communication Radar, satellite

VHF (very high frequency) UHF (ultrahigh frequency) SHF (superhigh frequency) EHF (extremely high frequency)

30-300 MHz 300 MHz-3 GHz 3-30 GHz 30-300 GHz

Sky and line-of-sight Line-of-sight Line-of-sight Line-of-sight

We can divide wireless transmission into three broad groups: radio waves, microwaves, and infrared waves. See Figure 7.19.

SECTION 7.2

UNGUIDED MEDIA: WIRELESS

205

Figure 7.19

Wireless transmission waves

Radio Waves
Although there is no clear-cut demarcation between radio waves and microwaves, electromagnetic waves ranging in frequencies between 3 kHz and 1 GHz are normally called radio waves; waves ranging in frequencies between 1 and 300 GHz are called microwaves. However, the behavior of the waves, rather than the frequencies, is a better criterion for classification. Radio waves, for the most part, are omnidirectional. When an antenna transmits radio waves, they are propagated in all directions. This means that the sending and receiving antennas do not have to be aligned. A sending antenna sends waves that can be received by any receiving antenna. The omnidirectional property has a disadvantage, too. The radio waves transmitted by one antenna are susceptible to interference by another antenna that may send signals using the same frequency or band. Radio waves, particularly those waves that propagate in the sky mode, can travel long distances. This makes radio waves a good candidate for long-distance broadcasting such as AM radio. Radio waves, particularly those of low and medium frequencies, can penetrate walls. This characteristic can be both an advantage and a disadvantage. It is an advantage because, for example, an AM radio can receive signals inside a building. It is a disadvantage because we cannot isolate a communication to just inside or outside a building. The radio wave band is relatively narrow, just under 1 GHz, compared to the microwave band. When this band is divided into subbands, the subbands are also narrow, leading to a low data rate for digital communications. Almost the entire band is regulated by authorities (e.g., the FCC in the United States). Using any part of the band requires permission from the authorities.

Omnidirectional Antenna
Radio waves use omnidirectional antennas that send out signals in all directions. Based on the wavelength, strength, and the purpose of transmission, we can have several types of antennas. Figure 7.20 shows an omnidirectional antenna.

Applications
The omnidirectional characteristics of radio waves make them useful for multicasting, in which there is one sender but many receivers. AM and FM radio, television, maritime radio, cordless phones, and paging are examples of multicasting.

206

CHAPTER 7

TRANSMISSION MEDIA

Figure 7.20

Omnidirectional antenna

Radio waves are used for multicast communications, such as radio and television, and paging systems.

Microwaves
Electromagnetic waves having frequencies between I and 300 GHz are called microwaves. Microwaves are unidirectional. When an antenna transmits microwave waves, they can be narrowly focused. This means that the sending and receiving antennas need to be aligned. The unidirectional property has an obvious advantage. A pair of antennas can be aligned without interfering with another pair of aligned antennas. The following describes some characteristics of microwave propagation:

o

o o o

Microwave propagation is line-of-sight. Since the towers with the mounted antennas need to be in direct sight of each other, towers that are far apart need to be very tall. The curvature of the earth as well as other blocking obstacles do not allow two short towers to communicate by using microwaves. Repeaters are often needed for longdistance communication. Very high-frequency microwaves cannot penetrate walls. This characteristic can be a disadvantage if receivers are inside buildings. The microwave band is relatively wide, almost 299 GHz. Therefore wider subbands can be assigned, and a high data rate is possible Use of certain portions of the band requires permission from authorities.

Unidirectional Antenna
Microwaves need unidirectional antennas that send out signals in one direction. Two types of antennas are used for microwave communications: the parabolic dish and the hom (see Figure 7.21). A parabolic dish antenna is based on the geometry of a parabola: Every line parallel to the line of symmetry (line of sight) reflects off the curve at angles such that all the lines intersect in a common point called the focus. The parabolic dish works as a

SECTION 7.2

UNGUIDED MEDIA: WIRELESS

207

Figure 7.21

Unidirectional antennas

Focus

~,,*=:::I

a. Dish antenna

b. Horn antenna

funnel, catching a wide range of waves and directing them to a common point. In this way, more of the signal is recovered than would be possible with a single-point receiver. Outgoing transmissions are broadcast through a horn aimed at the dish. The microwaves hit the dish and are deflected outward in a reversal of the receipt path. A horn antenna looks like a gigantic scoop. Outgoing transmissions are broadcast up a stem (resembling a handle) and deflected outward in a series of narrow parallel beams by the curved head. Received transmissions are collected by the scooped shape of the horn, in a manner similar to the parabolic dish, and are deflected down into the stem.

Applications
Microwaves, due to their unidirectional properties, are very useful when unicast (one-to-one) communication is needed between the sender and the receiver. They are used in cellular phones (Chapter 16), satellite networks (Chapter 16), and wireless LANs (Chapter 14). Microwaves are used for unicast communication such as cellular telephones, satellite networks, and wireless LANs.

Infrared
Infrared waves, with frequencies from 300 GHz to 400 THz (wavelengths from 1 mm to 770 nm), can be used for short-range communication. Infrared waves, having high frequencies, cannot penetrate walls. This advantageous characteristic prevents interference between one system and another; a short-range communication system in one room cannot be affected by another system in the next room. When we use our infrared remote control, we do not interfere with the use of the remote by our neighbors. However, this same characteristic makes infrared signals useless for long-range communication. In addition, we cannot use infrared waves outside a building because the sun's rays contain infrared waves that can interfere with the communication.

208

CHAPTER 7

TRANSMISSION MEDIA

Applications
The infrared band, almost 400 THz, has an excellent potential for data transmission. Such a wide bandwidth can be used to transmit digital data with a very high data rate. The Infrared Data Association (IrDA), an association for sponsoring the use of infrared waves, has established standards for using these signals for communication between devices such as keyboards, mice, PCs, and printers. For example, some manufacturers provide a special port called the IrDA port that allows a wireless keyboard to communicate with a PC. The standard originally defined a data rate of 75 kbps for a distance up to 8 m. The recent standard defines a data rate of 4 Mbps. Infrared signals defined by IrDA transmit through line of sight; the IrDA port on the keyboard needs to point to the PC for transmission to occur. Infrared signals can be used for short-range communication in a closed area using line-of-sight propagation.

7.3

RECOMMENDED READING

For more details about subjects discussed in this chapter, we recommend the following books. The items in brackets [...] refer to the reference list at the end of the text.

Books
Transmission media is discussed in Section 3.8 of [GW04], Chapter 4 of [Sta04], Section 2.2 and 2.3 of [Tan03]. [SSS05] gives a full coverage of transmission media.

7.4

KEY TERMS
IrDA port line-of-sight propagation microwave MT-RJ multimode graded-index fiber multimode step-index fiber omnidirectional antenna optical fiber parabolic dish antenna Radio Government (RG) number radio wave reflection refraction RJ45

angle of incidence Bayone-Neil-Concelman (BNC) connector cladding coaxial cable core critical angle electromagnetic spectrum fiber-optic cable gauge ground propagation guided media horn antenna infrared wave

SECTION 7.6

PRACTICE SET

209

shielded twisted-pair (STP) single-mode fiber sky propagation straight-tip (ST) connector subscriber channel (SC) connector transmission medium

twisted-pair cable unguided medium unidirectional antenna unshielded twisted-pair (UTP) wireless communication

7.5

SUMMARY

Transmission media lie below the physical layer. D A guided medium provides a physical conduit from one device to another. Twistedpair cable, coaxial cable, and optical fiber are the most popular types of guided media. D Twisted-pair cable consists of two insulated copper wires twisted together. Twistedpair cable is used for voice and data communications. D Coaxial cable consists of a central conductor and a shield. Coaxial cable can carry signals of higher frequency ranges than twisted-pair cable. Coaxial cable is used in cable TV networks and traditional Ethernet LANs. Fiber-optic cables are composed of a glass or plastic inner core surrounded by cladding, all encased in an outside jacket. Fiber-optic cables carry data signals in the form of light. The signal is propagated along the inner core by reflection. Fiberoptic transmission is becoming increasingly popular due to its noise resistance, low attenuation, and high-bandwidth capabilities. Fiber-optic cable is used in backbone networks, cable TV networks, and Fast Ethernet networks. D Unguided media (free space) transport electromagnetic waves without the use of a physical conductor. Wireless data are transmitted through ground propagation, sky propagation, and lineof-sight propagation.Wireless waves can be classified as radio waves, microwaves, or infrared waves. Radio waves are omnidirectional; microwaves are unidirectional. Microwaves are used for cellular phone, satellite, and wireless LAN communications. D Infrared waves are used for short-range communications such as those between a PC and a peripheral device. It can also be used for indoor LANs.

o

o

o

7.6
1. 2. 3. 4. 5.

PRACTICE SET
What is the position of the transmission media in the OSI or the Internet model? Name the two major categories of transmission media. How do guided media differ from unguided media? What are the three major classes of guided media? What is the significance of the twisting in twisted-pair cable?

Review Questions

210

CHAPTER 7

TRANSMISSION MEDIA

6. 7. 8. 9. 10.

What is refraction? What is reflection? What is the purpose of cladding in an optical fiber? Name the advantages of optical fiber over twisted-pair and coaxial cable. How does sky propagation differ from line-of-sight propagation? What is the difference between omnidirectional waves and unidirectional waves?

Exercises
11. Using Figure 7.6, tabulate the attenuation (in dB) of a 18-gauge UTP for the indicated frequencies and distances. Table 7.5 Attenuation/or I8-gauge UTP
Distance
1 Krn lOKm 15 Krn 20Km

dB at 1 KHz

dRat 10KHz

dB at 100 KHz

12. Use the result of Exercise 11 to infer that the bandwidth of a UTP cable decreases with an increase in distance. 13. If the power at the beginning of a 1 KIn 18-gauge UTP is 200 mw, what is the power at the end for frequencies 1 KHz, 10 KHz, and 100 KHz? Use the result of Exercise 11. 14. Using Figure 7.9, tabulate the attenuation (in dB) of a 2.6/9.5 mm coaxial cable for the indicated frequencies and distances. Table 7.6 Attenuation/or 2.6/9.5 mm coaxial cable

Distance
1 Km lOKrn 15Km 20Km

dB at 1 KHz

dB at 10 KHz

dB at 100KHz

15. Use the result of Exercise 14 to infer that the bandwidth of a coaxial cable decreases with the increase in distance. 16. If the power at the beginning of a 1 KIn 2.6/9.5 mm coaxial cable is 200 mw, what is the power at the end for frequencies 1 KHz, 10KHz, and 100 KHz? Use the result of Exercise 14. 17. Calculate the bandwidth of the light for the following wavelength ranges (assume a propagation speed of 2 x 108 m): a. 1000 to 1200 nm b. 1000 to 1400 nm

SECTION 7.6

PRACTICE SET

211

18. The horizontal axes in Figure 7.6 and 7.9 represent frequencies. The horizontal axis in Figure 7.16 represents wavelength. Can you explain the reason? lfthe propagation speed in an optical fiber is 2 x 108 ill, can you change the units in the horizontal axis to frequency? Should the vertical-axis units be changed too? Should the curve be changed too? 19. Using Figure 7.16, tabulate the attenuation (in dB) of an optical fiber for the indicated wavelength and distances. Table 7.7 Attenuation for optical fiber

Distance dB at 800 nm dB at 1000 nm dB at 1200nm

1 Km lOKm 15Km 20Km

20. A light signal is travelling through a fiber. What is the delay in the signal if the length of the fiber-optic cable is 10 m, 100 m, and 1 Km (assume a propagation speed of 2 x 108 ill)? 21. A beam oflight moves from one medium to another medium with less density. The critical angle is 60°. Do we have refraction or reflection for each of the following incident angles? Show the bending of the light ray in each case. a. 40° b. 60° c. 80 0

CHAPTER 8

Switching

A network is a set of connected devices. Whenever we have multiple devices, we have the problem of how to connect them to make one-to-one communication possible. One solution is to make a point-to-point connection between each pair of devices (a mesh topology) or between a central device and every other device (a star topology). These methods, however, are impractical and wasteful when applied to very large networks. The number and length of the links require too much infrastructure to be cost-efficient, and the majority of those links would be idle most of the time. Other topologies employing multipoint connections, such as a bus, are ruled out because the distances between devices and the total number of devices increase beyond the capacities of the media and equipment. A better solution is switching. A switched network consists of a series of interlinked nodes, called switches. Switches are devices capable of creating temporary connections between two or more devices linked to the switch. In a switched network, some of these nodes are connected to the end systems (computers or telephones, for example). Others are used only for routing. Figure 8.1 shows a switched network.

Figure 8.1 Switched network

The end systems (communicating devices) are labeled A, B, C, D, and so on, and the switches are labeled I, II, III, IV, and V. Each switch is connected to multiple links. 213

214

CHAPTER 8

SWITCHING

Traditionally, three methods of switching have been important: circuit switching, packet switching, and message switching. The first two are commonly used today. The third has been phased out in general communications but still has networking applications. We can then divide today's networks into three broad categories: circuit-switched networks, packet-switched networks, and message-switched. Packet-switched networks can funher be divided into two subcategories-virtual-circuit networks and datagram networksas shown in Figure 8.2.

Figure 8.2 Taxonomy of switched networks

We can say that the virtual-circuit networks have some common characteristics with circuit-switched and datagram networks. Thus, we first discuss circuit-switched networks, then datagram networks, and finally virtual-circuit networks. Today the tendency in packet switching is to combine datagram networks and virtualcircuit networks. Networks route the first packet based on the datagram addressing idea, but then create a virtual-circuit network for the rest of the packets coming from the same source and going to the same destination. We will see some of these networks in future chapters. In message switching, each switch stores the whole message and forwards it to the next switch. Although, we don't see message switching at lower layers, it is still used in some applications like electronic mail (e-mail). We will not discuss this topic in this book.

8.1

CIRCUIT-SWITCHED NETWORKS

A circuit-switched network consists of a set of switches connected by physical links. A connection between two stations is a dedicated path made of one or more links. However, each connection uses only one dedicated channel on each link. Each link is normally divided into n channels by using FDM or TDM as discussed in Chapter 6. A circuit-switched network is made of a set of switches connected by physical links, in which each link is divided into n channels.

Figure 8.3 shows a trivial circuit-switched network with four switches and four links. Each link is divided into n (n is 3 in the figure) channels by using FDM or TDM.

SECTION 8.1

CIRCUIT-SWITCHED NETWORKS

215

Figure 8.3 A trivial circuit-switched network

One link,

II

channels

Path

We have explicitly shown the multiplexing symbols to emphasize the division of the link into channels even though multiplexing can be implicitly included in the switch fabric. The end systems, such as computers or telephones, are directly connected to a switch. We have shown only two end systems for simplicity. When end system A needs to communicate with end system M, system A needs to request a connection to M that must be accepted by all switches as well as by M itself. This is called the setup phase; a circuit (channel) is reserved on each link, and the combination of circuits or channels defines the dedicated path. After the dedicated path made of connected circuits (channels) is established, data transfer can take place. After all data have been transferred, the circuits are tom down. We need to emphasize several points here:

D
D

D

D

Circuit switching takes place at the physical layer. Before starting communication, the stations must make a reservation for the resources to be used during the communication. These resources, such as channels (bandwidth in FDM and time slots in TDM), switch buffers, switch processing time, and switch input/output ports, must remain dedicated during the entire duration of data transfer until the teardown phase. Data transferred between the two stations are not packetized (physical layer transfer of the signal). The data are a continuous flow sent by the source station and received by the destination station, although there may be periods of silence. There is no addressing involved during data transfer. The switches route the data based on their occupied band (FDM) or time slot (TDM). Of course, there is end-toend addressing used during the setup phase, as we will see shortly. In circuit switching, the resources need to be reserved during the setup phase; the resources remain dedicated for the entire duration of data transfer until the teardown phase.

216

CHAPTER 8

SWITCHING

Example 8.1
As a trivial example, let us use a circuit-switched network to connect eight telephones in a small area. Communication is through 4-kHz voice channels. We assume that each link uses FDM to connect a maximum of two voice channels. The bandwidth of each link is then 8 kHz. Figure 8.4 shows the situation. Telephone 1 is connected to telephone 7; 2 to 5; 3 to 8; and 4 to 6. Of course the situation may change when new connections are made. The switch controls the connections.

Figure 8.4 Circuit-switched network used in Example 8.1
Circuit-switched network

Example 8.2
As another example, consider a circuit-switched network that connects computers in two remote offices of a private company. The offices are connected using a T-l line leased from a communication service provider. There are two 4 X 8 (4 inputs and 8 outputs) switches in this network. For each switch, four output ports are folded into the input ports to allow communication between computers in the same office. Four other output ports allow communication between the two offices. Figure 8.5 shows the situation.

Figure 8.5

Circuit-switched network used in Example 8.2

Circuit-switched network

4x8
swItch T-l line with 1.544 Mbps

4x8
switch

SECTION 8.1

CIRCUIT-SWITCHED NEIWORKS

217

Three Phases
The actual communication in a circuit-switched network requires three phases: connection setup, data transfer, and connection teardown.

Setup Phase
Before the two parties (or multiple parties in a conference call) can communicate, a dedicated circuit (combination of channels in links) needs to be established. The end systems are normally connected through dedicated lines to the switches, so connection setup means creating dedicated channels between the switches. For example, in Figure 8.3, when system A needs to connect to system M, it sends a setup request that includes the address of system M, to switch I. Switch I finds a channel between itself and switch IV that can be dedicated for this purpose. Switch I then sends the request to switch IV, which finds a dedicated channel between itself and switch III. Switch III informs system M of system A's intention at this time. In the next step to making a connection, an acknowledgment from system M needs to be sent in the opposite direction to system A. Only after system A receives this acknowledgment is the connection established. Note that end-to-end addressing is required for creating a connection between the two end systems. These can be, for example, the addresses of the computers assigned by the administrator in a TDM network, or telephone numbers in an FDM network.

Data Transfer Phase
After the establishment of the dedicated circuit (channels), the two parties can transfer data.

Teardown Phase
When one of the parties needs to disconnect, a signal is sent to each switch to release the resources.

Efficiency
It can be argued that circuit-switched networks are not as efficient as the other two types of networks because resources are allocated during the entire duration of the connection. These resources are unavailable to other connections. In a telephone network, people normally terminate the communication when they have finished their conversation. However, in computer networks, a computer can be connected to another computer even if there is no activity for a long time. In this case, allowing resources to be dedicated means that other connections are deprived.

Delay
Although a circuit-switched network normally has low efficiency, the delay in this type of network is minimal. During data transfer the data are not delayed at each switch; the resources are allocated for the duration of the connection. Figure 8.6 shows the idea of delay in a circuit-switched network when only two switches are involved. As Figure 8.6 shows, there is no waiting time at each switch. The total delay is due to the time needed to create the connection, transfer data, and disconnect the circuit. The

218

CHAPTER 8

SWITCHING

Figure 8.6 Delay in a circuit-switched network

1I-------1.}\. f - - - - - - l

Data transfer

u

i[-----------------Time Time Time Time

Q

delay caused by the setup is the sum of four parts: the propagation time of the source computer request (slope of the first gray box), the request signal transfer time (height of the first gray box), the propagation time of the acknowledgment from the destination computer (slope of the second gray box), and the signal transfer time of the acknowledgment (height of the second gray box). The delay due to data transfer is the sum of two parts: the propagation time (slope of the colored box) and data transfer time (height of the colored box), which can be very long. The third box shows the time needed to tear down the circuit. We have shown the case in which the receiver requests disconnection, which creates the maximum delay.

Circuit-Switched Technology in Telephone Networks
As we will see in Chapter 9, the telephone companies have previously chosen the circuitswitched approach to switching in the physical layer; today the tendency is moving toward other switching techniques. For example, the telephone number is used as the global address, and a signaling system (called SS7) is used for the setup and teardown phases. Switching at the physical layer in the traditional telephone network uses the circuit-switching approach.

8.2

DATAGRAM NETWORKS

In data communications, we need to send messages from one end system to another. If the message is going to pass through a packet-switched network, it needs to be divided into packets of fixed or variable size. The size of the packet is determined by the network and the governing protocol. In packet switching, there is no resource allocation for a packet. This means that there is no reserved bandwidth on the links, and there is no scheduled processing time

SECTION 8.2

DATAGRAM NETWORKS

219

for each packet. Resources are allocated on demand. The allocation is done on a firstcome, first-served basis. When a switch receives a packet, no matter what is the source or destination, the packet must wait if there are other packets being processed. As with other systems in our daily life, this lack of reservation may create delay. For example, if we do not have a reservation at a restaurant, we might have to wait. In a packet-switched network, there is no resource reservation; resources are allocated on demand.

In a datagram network, each packet is treated independently of all others. Even if a packet is part of a multipacket transmission, the network treats it as though it existed alone. Packets in this approach are referred to as datagrams. Datagram switching is normally done at the network layer. We briefly discuss datagram networks here as a comparison with circuit-switched and virtual-circuitswitched networks. In Part 4 of this text, we go into greater detail. Figure 8.7 shows how the datagram approach is used to deliver four packets from station A to station X. The switches in a datagram network are traditionally referred to as routers. That is why we use a different symbol for the switches in the figure.

Figure 8.7 A datagram network with four switches (routers)
Datagram network
A

In this example, all four packets (or datagrams) belong to the same message, but may travel different paths to reach their destination. This is so because the links may be involved in carrying packets from other sources and do not have the necessary bandwidth available to carry all the packets from A to X. This approach can cause the datagrams of a transmission to arrive at their destination out of order with different delays between the packets. Packets may also be lost or dropped because of a lack of resources. In most protocols, it is the responsibility of an upper-layer protocol to reorder the datagrams or ask for lost datagrams before passing them on to the application. The datagram networks are sometimes referred to as connectionless networks. The term connectionless here means that the switch (packet switch) does not keep information about the connection state. There are no setup or teardown phases. Each packet is treated the same by a switch regardless of its source or destination.

220

CHAPTER 8

SWITCHING

Routing Table
If there are no setup or teardown phases, how are the packets routed to their destinations in a datagram network? In this type of network, each switch (or packet switch) has a routing table which is based on the destination address. The routing tables are dynamic and are updated periodically. The destination addresses and the corresponding forwarding output ports are recorded in the tables. This is different from the table of a circuitswitched network in which each entry is created when the setup phase is completed and deleted when the teardown phase is over. Figure 8.8 shows the routing table for a switch.

Figure 8.8 Routing table in a datagram network
Destination address Output port
I 2

1232 4150

.
9130

.
3

-1

21

-3

-......;..,: 7

-4

A switch in a datagram network uses a routing table that is based on the destination address.

Destination Address
Every packet in a datagram network carries a header that contains, among other information, the destination address of the packet. When the switch receives the packet, this destination address is examined; the routing table is consulted to find the corresponding port through which the packet should be forwarded. This address, unlike the address in a virtual-circuit-switched network, remains the same during the entire journey of the packet. The destination address in the header of a packet in a datagram network remains the same during the entire journey of the packet.

Efficiency
The efficiency of a datagram network is better than that of a circuit-switched network; resources are allocated only when there are packets to be transferred. If a source sends a packet and there is a delay of a few minutes before another packet can be sent, the resources can be reallocated during these minutes for other packets from other sources.

SECTION 8.3

VIRTUAL-CIRCUIT NETWORKS

221

Delay
There may be greater delay in a datagram network than in a virtual-circuit network. Although there are no setup and teardown phases, each packet may experience a wait at a switch before it is forwarded. In addition, since not all packets in a message necessarily travel through the same switches, the delay is not uniform for the packets of a message. Figure 8.9 gives an example of delay in a datagram network for one single packet.

Figure 8.9 Delay in a datagram network
Am---------tl~I_----_~_----_____1 B

Transmis~ion[

lime

r----=:--,-,---J
Waiting [ time

,------1
Wai~ing[
time

i------J

Time

Time

Time

Time

The packet travels through two switches. There are three transmission times (3T), three propagation delays (slopes 3't of the lines), and two waiting times (WI + w2)' We ignore the processing time in each switch. The total delay is Total delay = 3T + 3t + WI + W2

Datagram Networks in the Internet
As we will see in future chapters, the Internet has chosen the datagram approach to switching at the network layer. It uses the universal addresses defined in the network layer to route packets from the source to the destination. Switching in the Internet is done by using the datagram approach to packet switching at the network layer.

8.3

VIRTUAL-CIRCUIT NETWORKS

A virtual-circuit network is a cross between a circuit-switched network and a datagram network. It has some characteristics of both. 1. As in a circuit-switched network, there are setup and teardown phases in addition to the data transfer phase.

222

CHAPTER 8

SWITCHING

2. Resources can be allocated during the setup phase, as in a circuit-switched network, or on demand, as in a datagram network. 3. As in a datagram network, data are packetized and each packet carries an address in the header. However, the address in the header has local jurisdiction (it defines what should be the next switch and the channel on which the packet is being canied), not end-to-end jurisdiction. The reader may ask how the intermediate switches know where to send the packet if there is no final destination address carried by a packet. The answer will be clear when we discuss virtual-circuit identifiers in the next section. 4. As in a circuit-switched network, all packets follow the same path established during the connection. 5. A virtual-circuit network is normally implemented in the data link layer, while a circuit-switched network is implemented in the physical layer and a datagram network in the network layer. But this may change in the future. Figure 8.10 is an example of a virtual-circuit network. The network has switches that allow traffic from sources to destinations. A source or destination can be a computer, packet switch, bridge, or any other device that connects other networks. Figure 8.10 Virtual-circuit network

Addressing
In a virtual-circuit network, two types of addressing are involved: global and local (virtual-circuit identifier).

Global Addressing
A source or a destination needs to have a global address-an address that can be unique in the scope of the network or internationally if the network is part of an international network. However, we will see that a global address in virtual-circuit networks is used only to create a virtual-circuit identifier, as discussed next.

Virtual-Circuit Identifier
The identifier that is actually used for data transfer is called the virtual-circuit identifier (Vel). A vel, unlike a global address, is a small number that has only switch scope; it

SECTION 8.3

VIRTUAL-CIRCUIT NETWORKS

223

is used by a frame between two switches. When a frame arrives at a switch, it has a VCI; when it leaves, it has a different VCl. Figure 8.11 shows how the VCI in a data frame changes from one switch to another. Note that a VCI does not need to be a large number since each switch can use its own unique set of VCls.

Figure 8.11

Virtual-circuit identifier

VCI

-----===::::=------~..I'.. =====---~

I

Data

tEJ ~

I
I
Data

VCI

I~ ~

Three Phases
As in a circuit-switched network, a source and destination need to go through three phases in a virtual-circuit network: setup, data transfer, and teardown. In the setup phase, the source and destination use their global addresses to help switches make table entries for the connection. In the teardown phase, the source and destination inform the switches to delete the corresponding entry. Data transfer occurs between these two phases. We first discuss the data transfer phase, which is more straightforward; we then talk about the setup and teardown phases.

Data Transfer Phase
To transfer a frame from a source to its destination, all switches need to have a table entry for this virtual circuit. The table, in its simplest form, has four columns. This means that the switch holds four pieces of information for each virtual circuit that is already set up. We show later how the switches make their table entries, but for the moment we assume that each switch has a table with entries for all active virtual circuits. Figure 8.12 shows such a switch and its corresponding table. Figure 8.12 shows a frame arriving at port 1 with a VCI of 14. When the frame arrives, the switch looks in its table to find port 1 and a VCI of 14. When it is found, the switch knows to change the VCI to 22 and send out the frame from port 3. Figure 8.13 shows how a frame from source A reaches destination B and how its VCI changes during the trip. Each switch changes the VCI and routes the frame. The data transfer phase is active until the source sends all its frames to the destination. The procedure at the switch is the same for each frame of a message. The process creates a virtual circuit, not a real circuit, between the source and destination.

Setup Phase
In the setup phase, a switch creates an entry for a virtual circuit. For example, suppose source A needs to create a virtual circuit to B. Two steps are required: the setup request and the acknowledgment.

224

CHAPTER 8

SWITCHING

Figure 8.12

Switch and tables in a virtual-circuit network
Incoming Port
1 1

Outgoing Port 2

VCl 14 77

3

VCl 22 41

~'~

I

Data

~I

Data

[EJ-+

lA3
2

I

Data

@]-+

~t
Figure 8.13
Source-to-destination data transfer in a virtual-circuit network Incoming Outgoing Port VCl Port VCl I 14 3 66 Incoming Outgoing Port VCl Port VCI 2 22 3 77

Incoming Outgoing Port VCI Port VCl 1 66 2 22

Setup Request A setup request frame is sent from the source to the destination. Figure 8.14 shows the process. a. Source A sends a setup frame to switch 1. b. Switch 1 receives the setup request frame. It knows that a frame going from A to B goes out through port 3. How the switch has obtained this information is a point covered in future chapters. The switch, in the setup phase, acts as a packet switch; it has a routing table which is different from the switching table. For the moment, assume that it knows the output port. The switch creates an entry in its table for

SECTION 8.3

VIRTUAL-CIRCUIT NETWORKS

225

Figure 8.14

Setup request in a virtual-circuit network
Incoming Outgoing Port IVCI Port IVCI 2 122 3 I

Incoming Outgoing Port IvcI Port IVCI 1 I 14 3 I

VCI=77

Incoming Outgoing Port IVCI Port IVCI 2 I I I 66

this virtual circuit, but it is only able to fill three of the four columns. The switch assigns the incoming port (1) and chooses an available incoming VCI (14) and the outgoing port (3). It does not yet know the outgoing VCI, which will be found during the acknowledgment step. The switch then forwards the frame through port 3 to switch 2. c. Switch 2 receives the setup request frame. The same events happen here as at switch 1; three columns of the table are completed: in this case, incoming port (l), incoming VCI (66), and outgoing port (2). d. Switch 3 receives the setup request frame. Again, three columns are completed: incoming port (2), incoming VCI (22), and outgoing port (3). e. Destination B receives the setup frame, and if it is ready to receive frames from A, it assigns a VCI to the incoming frames that come from A, in this case 77. This VCI lets the destination know that the frames come from A, and not other sources.

Acknowledgment A special frame, called the acknowledgment frame, completes the entries in the switching tables. Figure 8.15 shows the process. a. The destination sends an acknowledgment to switch 3. The acknowledgment carries the global source and destination addresses so the switch knows which entry in the table is to be completed. The frame also carries VCI 77, chosen by the destination as the incoming VCI for frames from A. Switch 3 uses this VCI to complete the outgoing VCI column for this entry. Note that 77 is the incoming VCI for destination B, but the outgoing VCI for switch 3. b. Switch 3 sends an acknowledgment to switch 2 that contains its incoming VCI in the table, chosen in the previous step. Switch 2 uses this as the outgoing VCI in the table. c. Switch 2 sends an acknowledgment to switch 1 that contains its incoming VCI in the table, chosen in the previous step. Switch 1 uses this as the outgoing VCI in the table. d. Finally switch 1 sends an acknowledgment to source A that contains its incoming VCI in the table, chosen in the previous step. e. The source uses this as the outgoing VCI for the data frames to be sent to destination B.

226

CHAPTER 8

SWITCHING

Figure 8.15

Setup acknowledgment in a virtual-circuit network
Incoming Outgoing Port IVCI Port IVCI I I 14 3 166 Incoming Outgoing Port IVCI Port IVCI 2 122 3 I 77

VCI == 14

VCI == 77

A 1--==--;

o

~

B

@

Incoming Outgoing Port IVCI Port IVCI I I 66 2 122

Teardowil Phase In this phase, source A, after sending all frames to B, sends a special frame called a teardown request. Destination B responds with a teardown confirmation frame. All switches delete the corresponding entry from their tables.

Efficiency
As we said before, resource reservation in a virtual-circuit network can be made during the setup or can be on demand during the data transfer phase. In the first case, the delay for each packet is the same; in the second case, each packet may encounter different delays. There is one big advantage in a virtual-circuit network even if resource allocation is on demand. The source can check the availability of the resources, without actually reserving it. Consider a family that wants to dine at a restaurant. Although the restaurant may not accept reservations (allocation of the tables is on demand), the family can call and find out the waiting time. This can save the family time and effort. In virtual-circuit switching, all packets belonging to the same source and destination travel the same path; but the packets may arrive at the destination with different delays if resource allocation is on demand.

Delay in Virtual-Circuit Networks
In a virtual-circuit network, there is a one-time delay for setup and a one-time delay for teardown. If resources are allocated during the setup phase, there is no wait time for individual packets. Figure 8.16 shows the delay for a packet traveling through two switches in a virtual-circuit network. The packet is traveling through two switches (routers). There are three transmission times (3T), three propagation times (3't), data transfer depicted by the sloping lines, a setup delay (which includes transmission and propagation in two directions),

SECTION 8.4

STRUCTURE OF A SWITCH

227

Figure 8.16 Delay in a virtual-circuit network

I ~I

1;'ransmission ] tIme

" ~ [--~--------------~

,

~
Time Time Time Time

and a teardown delay (which includes transmission and propagation in one direction). We ignore the processing time in each switch. The total delay time is Total delay = 3T + 3't + setup delay + teardown delay

Circuit-Switched Technology in WANs
As we will see in Chapter 18, virtual-circuit networks are used in switched WANs such as Frame Relay and ATM networks. The data link layer of these technologies is well suited to the virtual-circuit technology. Switching at the data link layer in a switched WAN is normally implemented by using virtual-circuit techniques.

8.4

STRUCTURE OF A SWITCH

We use switches in circuit-switched and packet-switched networks. In this section, we discuss the structures of the switches used in each type of network.

Structure of Circuit Switches
Circuit switching today can use either of two technologies: the space-division switch or the time-division switch. Space-Division Switch

In space-division switching, the paths in the circuit are separated from one another spatially. This technology was originally designed for use in analog networks but is used currently in both analog and digital networks. It has evolved through a long history of many designs.

228

CHAPTER 8

SWITCHING

Crossbar Switch A crossbar switch connects n inputs to m outputs in a grid, using electronic microswitches (transistors) at each crosspoint (see Figure 8.17). The major limitation of this design is the number of crosspoints required. To connect n inputs to m outputs using a crossbar switch requires n x m crosspoints. For example, to connect 1000 inputs to 1000 outputs requires a switch with 1,000,000 crosspoints. A crossbar with this number of crosspoints is impractical. Such a switch is also inefficient because statistics show that, in practice, fewer than 25 percent of the crosspoints are in use at any given time. The rest are idle. Figure 8.17 Crossbar switch with three inputs and four outputs

2

30-+-·.....

--4.---.--.
II III IV

Multistage Switch The solution to the limitations of the crossbar switch is the multistage switch, which combines crossbar switches in several (normally three) stages, as shown in Figure 8.18. In a single crossbar switch, only one row or column (one path) is active for any connection. So we need N x N crosspoints. If we can allow multiple paths inside the switch, we can decrease the number of crosspoints. Each crosspoint in the middle stage can be accessed by multiple crosspoints in the first or third stage.

Figure 8.18

Multistage switch

Nln
Crossbars

k

Nln
Crossbars

Crossbars

n[ N n[ n[
Stage 1 Stage 2 Stage 3

In In N In

SECTION 8.4

STRUCTURE OF A SWITCH

229

To design a three-stage switch, we follow these steps: 1. We divide the N input lines into groups, each of n lines. For each group, we use one crossbar of size n x k, where k is the number of crossbars in the middle stage. In other words, the first stage has N/n crossbars of n x k crosspoints. 2. We use k crossbars, each of size (N/n) x (N/n) in the middle stage. 3. We use N/n crossbars, each of size k x n at the third stage. We can calculate the total number of crosspoints as follows:

N -en x k) + k (N x N) + -N(k x n) = 2kN + k (N)2 n n n n n
In a three-stage switch, the total number of crosspoints is

2kN +k(~Y
which is much smaller than the number of crosspoints in a single-stage switch (N2 ).

Example 8.3
Design a three-stage, 200 x 200 switch (N = 200) with k = 4 and n = 20.

Solution
In the first stage we have N/n or 10 crossbars, each of size 20 x 4. In the second stage, we have 4 crossbars, each of size 10 x 10. In the third stage, we have 10 crossbars, each of size 4 x 20. The total number of crosspoints is 2kN + k(N/n)2, or 2000 crosspoints. This is 5 percent of the number of crosspoints in a single-stage switch (200 x 200 = 40,000).

The multistage switch in Example 8.3 has one drawback-blocking during periods of heavy traffic: The whole idea of multistage switching is to share the crosspoints in the middle-stage crossbars. Sharing can cause a lack of availability if the resources are limited and all users want a connection at the same time. Blocking refers to times when one input cannot be connected to an output because there is no path available between them-all the possible intermediate switches are occupied. In a single-stage switch, blocking does not occur because every combination of input and output has its own crosspoint; there is always a path. (Cases in which two inputs are trying to contact the same output do not count. That path is not blocked; the output is merely busy.) In the multistage switch described in Example 8.3, however, only 4 of the first 20 inputs can use the switch at a time, only 4 of the second 20 inputs can use the switch at a time, and so on. The small number of crossbars at the middle stage creates blocking. In large systems, such as those having 10,000 inputs and outputs, the number of stages can be increased to cut down on the number of crosspoints required. As the number of stages increases, however, possible blocking increases as well. Many people have experienced blocking on public telephone systems in the wake of a natural disaster when the calls being made to check on or reassure relatives far outnumber the regular load of the system.

230

CHAPTER 8

SWITCHING

Clos investigated the condition of nonblocking in multistage switches and came up with the following formula. In a nonblocking switch, the number of middle-stage switches must be at least 2n - 1. In other words, we need to have k 2 2n - 1. Note that the number of crosspoints is still smaller than that in a single-stage switch. Now we need to minimize the number of crosspoints with a fixed N by using the Clos criteria. We can take the derivative of the equation with respect to n (the only variable) and find the value of n that makes the result zero. This n must be equal to or greater than (N/2)1/2. In this case, the total number of crosspoints is greater than or equal to 4N [(2N) 112 -1]. In other words, the minimum number of crosspoints according to the Clos criteria is proportional to N 3/2. According to Clos criterion: n

=(NI2)1/2

k>2n-1 Total number of crosspoints 2 4N [(2N)1/2 -1]

Example 8.4
Redesign the previous three-stage, 200 x 200 switch, using the Clos criteria with a minimum number of crosspoints.

Solution
We let n = (200/2) 1/2, or n = 10. We calculate k = 2n - 1 = 19. In the first stage, we have 200/10, or 20, crossbars, each with lOX 19 crosspoints. In the second stage, we have 19 crossbars, each with 10 X 10 crosspoints. In the third stage, we have 20 crossbars each with 19 X 10 crosspoints. The total number of crosspoints is 20(10 X 19) + 19(10 X 10) + 20(19 XlO) = 9500. If we use a single-stage switch, we need 200 X 200 = 40,000 crosspoints. The number of crosspoints in this three-stage switch is 24 percent that of a single-stage switch. More points are needed than in Example 8.3 (5 percent). The extra crosspoints are needed to prevent blocking.

A multistage switch that uses the Clos criteria and a minimum number of crosspoints still requires a huge number of crosspoints. For example, to have a 100,000 input/output switch, we need something close to 200 million crosspoints (instead of 10 billion). This means that if a telephone company needs to provide a switch to connect 100,000 telephones in a city, it needs 200 million crosspoints. The number can be reduced if we accept blocking. Today, telephone companies use time-division switching or a combination of space- and time-division switches, as we will see shortly. Time-Division Switch

Time-division switching uses time-division multiplexing (TDM) inside a switch. The most popular technology is called the time-slot interchange (TSI). Time-Slot Interchange Figure 8.19 shows a system connecting four input lines to four output lines. Imagine that each input line wants to send data to an output line according to the following pattern:

SECTION 8.4

STRUCTURE OF A SWITCH

231

Figure 8.19

Time-slot interchange

Time-division switch TSI ,C{Jnt!ol unit
1~3
2~4

3~1 4~2

The figure combines a TDM multiplexer, a TDM demultiplexer, and a TSI consisting of random access memory (RAM) with several memory locations. The size of each location is the same as the size of a single time slot. The number oflocations is the same as the number of inputs (in most cases, the numbers of inputs and outputs are equal). The RAM fills up with incoming data from time slots in the order received. Slots are then sent out in an order based on the decisions of a control unit.

Time- and Space-Division Switch Combinations
When we compare space-division and time-division switching, some interesting facts emerge. The advantage of space-division switching is that it is instantaneous. Its disadvantage is the number of crosspoints required to make space-division switching acceptable in terms of blocking. The advantage of time-division switching is that it needs no crosspoints. Its disadvantage, in the case of TSI, is that processing each connection creates delays. Each time slot must be stored by the RAM, then retrieved and passed on. In a third option, we combine space-division and time-division technologies to take advantage of the best of both. Combining the two results in switches that are optimized both physically (the number of crosspoints) and temporally (the amount of delay). Multistage switches of this sort can be designed as time-space-time (TST) switch. Figure 8.20 shows a simple TST switch that consists of two time stages and one space stage and has 12 inputs and 12 outputs. Instead of one time-division switch, it divides the inputs into three groups (of four inputs each) and directs them to three timeslot interchanges. The result is that the average delay is one-third of what would result from using one time-slot interchange to handle all 12 inputs. The last stage is a mirror image of the first stage. The middle stage is a spacedivision switch (crossbar) that connects the TSI groups to allow connectivity between all possible input and output pairs (e.g., to connect input 3 of the first group to output 7 of the second group).

232

CHAPTER 8

SWITCHING

Figure 8.20

Time-space-time switch

TST

Space

Structure of Packet Switches
A switch used in a packet-switched network has a different structure from a switch used in a circuit-switched network.We can say that a packet switch has four components: input ports, output ports, the routing processor, and the switching fabric, as shown in Figure 8.21.

Figure 8.21

Packet switch components

--------------------------------------1
Routing processor Input ports Output ports

Switching fabric

1'--_ _----' I L

_

Input Ports

An input port performs the physical and data link functions of the packet switch. The bits are constructed from the received signal. The packet is decapsulated from the frame. Errors are detected and corrected. The packet is now ready to be routed by the network layer. In addition to a physical layer processor and a data link processor, the input port has buffers (queues) to hold the packet before it is directed to the switching fabric. Figure 8.22 shows a schematic diagram of an input port.

SECTION 8.4

STRUCTURE OF A SWITCH

233

Figure 8.22

Input port
Input port Physical layer processor Data link layer processor

Output Port

The output port performs the same functions as the input port, but in the reverse order. First the outgoing packets are queued, then the packet is encapsulated in a frame, and finally the physical layer functions are applied to the frame to create the signal to be sent on the line. Figure 8.23 shows a schematic diagram of an output port.

Figure 8.23

Output port
Output port Data link layer processor Physical layer processor

ROllting Processor

The routing processor performs the functions of the network layer. The destination address is used to find the address of the next hop and, at the same time, the output port number from which the packet is sent out. This activity is sometimes referred to as table lookup because the routing processor searches the routing table. In the newer packet switches, this function of the routing processor is being moved to the input ports to facilitate and expedite the process. Switching "Fabrics

The most difficult task in a packet switch is to move the packet from the input queue to the output queue. The speed with which this is done affects the size of the input/output queue and the overall delay in packet delivery. In the past, when a packet switch was actually a dedicated computer, the memory of the computer or a bus was used as the switching fabric. The input port stored the packet in memory; the output port retrieved the packet from memory. Today, packet switches are specialized mechanisms that use a variety of switching fabrics. We briefly discuss some of these fabrics here. Crossbar Switch The simplest type of switching fabric is the crossbar switch, discussed in the previous section. Banyan Switch A more realistic approach than the crossbar switch is the banyan switch (named after the banyan tree). A banyan switch is a multistage switch with

234

CHAPTER 8

SWITCHING

microswitches at each stage that route the packets based on the output port represented as a binary string. For n inputs and n outputs, we have log2 n stages with nl2 microswitches at each stage. The first stage routes the packet based on the high-order bit of the binary string. The second stage routes the packet based on the second high-order bit, and so on. Figure 8.24 shows a banyan switch with eight inputs and eight outputs. The number of stages is Iog2(8) = 3.

Figure 8.24 A banyan switch
Left bit Middle bit Right bit

O~ l~

~6
~7

Figure 8.25 shows the operation. In part a, a packet has arrived at input port 1 and must go to output port 6 (110 in binary). The first microswitch (A-2) routes the packet based on the first bit (1), the second microswitch (B-4) routes the packet based on the second bit (1), and the third microswitch (C-4) routes the packet based on the third bit (0). In part b, a packet has arrived at input port 5 and must go to output port 2 (010 in binary). The first microswitch (A-2) routes the packet based on the first bit (0), the second microswitch (B-2) routes the packet based on the second bit (l), and the third microswitch (C-2) routes the packet based on the third bit (0).

Figure 8.25

Examples of routing in a banyan switch

0 1 2 3 4 5 6
7

0 1 2 3 4 5 6 7

0 1 2 3 4 5 6 7

0 I 2 3

4 5
6 7

a. Input 1 sending a cell to output 6 (110)

b. Input 5 sending a cell to output 2 (010)

SECTION 8.6

KEY TERMS

235

Figure 8.26

Batcher-banyan switch
Banyan switch

O~ l~

~2

Batcher switch

Trap module

~3

~--+ro ~"'lr-r ~ 4
~5

6~
7~

~6
~7

Batcher-Banyan Switch The problem with the banyan switch is the possibility of internal collision even when two packets are not heading for the same output port. We can solve this problem by sorting the arriving packets based on their destination port. K. E. Batcher designed a switch that comes before the banyan switch and sorts the incoming packets according to their final destinations. The combination is called the Batcher-banyan switch. The sorting switch uses hardware merging techniques, but we do not discuss the details here. Normally, another hardware module called a trap is added between the Batcher switch and the banyan switch (see Figure 8.26) The trap module prevents duplicate packets (packets with the same output destination) from passing to the banyan switch simultaneously. Only one packet for each destination is allowed at each tick; if there is more than one, they wait for the next tick.

8.5

RECOMMENDED READING

For more details about subjects discussed in this chapter, we recommend the following books. The items in brackets [...] refer to the reference list at the end of the text.

Books
Switching is discussed in Chapter 10 of [Sta04] and Chapters 4 and 7 of [GW04]. Circuitswitching is fully discussed in [BELOO].

8.6

KEY TERMS
crosspoint data transfer phase datagram datagram network end system input port

banyan switch Batcher-banyan switch blocking circuit switching circuit-switched network crossbar switch

236

CHAPTER 8

SWITCHING

multistage switch output port packet-switched network routing processor setup phase space-division switching switch switching switching fabric

table lookup teardown phase time-division switching time-slot interchange (TSI) time-space-time (TST) switch trap virtual-circuit identifier (VCI) virtual-circuit network

8.7

SUMMARY
A switched network consists of a series of interlinked nodes, called switches. Traditionally' three methods of switching have been important: circuit switching, packet switching, and message switching. We can divide today's networks into three broad categories: circuit-switched networks, packet-switched networks, and message-switched. Packet-switched networks can also be divided into two subcategories: virtual-circuit networks and datagram networks A circuit-switched network is made of a set of switches connected by physical links, in which each link is divided into n channels. Circuit switching takes place at the physical layer. In circuit switching, the resources need to be reserved during the setup phase; the resources remain dedicated for the entire duration of data transfer phase until the teardown phase. In packet switching, there is no resource allocation for a packet. This means that there is no reserved bandwidth on the links, and there is no scheduled processing time for each packet. Resources are allocated on demand. In a datagram network, each packet is treated independently of all others. Packets in this approach are referred to as datagrams. There are no setup or teardown phases. A virtual-circuit network is a cross between a circuit-switched network and a datagram network. It has some characteristics of both. Circuit switching uses either of two technologies: the space-division switch or the time-division switch. A switch in a packet-switched network has a different structure from a switch used in a circuit-switched network.We can say that a packet switch has four types of components: input ports, output ports, a routing processor, and switching fabric.

o

o
o

o
o

o
o o

8.8

PRACTICE SET

Review Questions
I. Describe the need for switching and define a switch.

2. List the three traditional switching methods. What are the most common today?

SECTION 8.8

PRACTICE SET

237

3. What are the two approaches to packet-switching? 4. Compare and contrast a circuit-switched network and a packet-switched network. 5. What is the role of the address field in a packet traveling through a datagram network? 6. What is the role of the address field in a packet traveling through a virtual-circuit network? 7. Compare space-division and time-division switches. 8. What is TSI and its role in a time-division switching? 9. Define blocking in a switched network. 10. List four major components of a packet switch and their functions.

Exercises
11. A path in a digital circuit-switched network has a data rate of I Mbps. The exchange of 1000 bits is required for the setup and teardown phases. The distance between two parties is 5000 km. Answer the following questions if the propagataion speed is 2 X 108 m: a. What is the total delay if 1000 bits of data are exchanged during the data transfer phase? b. What is the total delay if 100,000 bits of data are exchanged during the data transfer phase? c. What is the total delay if 1,000,000 bits of data are exchanged during the data transfer phase? d. Find the delay per 1000 bits of data for each of the above cases and compare them. What can you infer? 12. Five equal-size datagrams belonging to the same message leave for the destination one after another. However, they travel through different paths as shown in Table 8.1.

Table 8.1

Exercise 12 Path Length Visited Switches

Datagram

1 2 3 4 5

3200Km 11,700 Km 12,200 Km 10,200 Km 10,700 Km

1,3,5 1,2,5 1,2,3,5 1,4,5 1,4,3,5

We assume that the delay for each switch (including waiting and processing) is 3, 10, 20, 7, and 20 ms respectively. Assuming that the propagation speed is 2 x 108 m, find the order the datagrams arrive at the destination and the delay for each. Ignore any other delays in transmission.

238

CHAPTER 8

SWITCHING

13. Transmission of information in any network involves end-to-end addressing and sometimes local addressing (such as YCI). Table 8.2 shows the types of networks and the addressing mechanism used in each of them. Table 8.2 Exercise 13

Network Circuit-switched Datagram Virtual-circuit End-to-end Setup End-ta-end End-ta-end Local End-to-end Data Transfer Teardown End-ta-end

Answer the following questions: a. Why does a circuit-switched network need end-to-end addressing during the setup and teardown phases? Why are no addresses needed during the data transfer phase for this type of network? b. Why does a datagram network need only end-to-end addressing during the data transfer phase, but no addressing during the setup and teardown phases? c. Why does a virtual-circuit network need addresses during all three phases? 14. We mentioned that two types of networks, datagram and virtual-circuit, need a routing or switching table to find the output port from which the information belonging to a destination should be sent out, but a circuit-switched network has no need for such a table. Give the reason for this difference. 15. An entry in the switching table of a virtual-circuit network is normally created during the setup phase and deleted during the teardown phase. In other words, the entries in this type of network reflect the current connections, the activity in the network. In contrast, the entries in a routing table of a datagram network do not depend on the current connections; they show the configuration of the network and how any packet should be routed to a final destination. The entries may remain the same even if there is no activity in the network. The routing tables, however, are updated if there are changes in the network. Can you explain the reason for these two different characteristics? Can we say that a virtual-circuit is a connectionoriented network and a datagram network is a connectionLess network because of the above characteristics? 16. The minimum number of columns in a datagram network is two; the minimum number of columns in a virtual-circuit network is four. Can you explain the reason? Is the difference related to the type of addresses carried in the packets of each network? 17. Figure 8.27 shows a switch (router) in a datagram network. Find the output port for packets with the following destination addresses: Packet 1: 7176 Packet 2: 1233 Packet 3: 8766 Packet 4: 9144 18. Figure 8.28 shows a switch in a virtual circuit network.

SECTION 8.8

PRACTICE SET

239

Figure 8.27

Exercise 17
Destination address 1233 Output port

1456 3255 4470 7176 8766 9144

3 2 1 4 2
3

4

2

3

2

Figure 8.28 Exercise 18
Incoming Port VCI Outgoing Port VCI

1 2 2 3 3
4

14 71 92 58 78 56

3

4 1
2 2

3

22 41 45 43 70 11

4

2

Find the output port and the output VCI for packets with the following input port and input VCI addresses: Packet 1: 3, 78 Packet 2: 2, 92 Packet 3: 4, 56 Packet 4: 2, 71 19. Answer the following questions: a. Can a routing table in a datagram network have two entries with the same destination address? Explain. b. Can a switching table in a virtual-circuit network have two entries with the same input port number? With the same output port number? With the same incoming VCls? With the same outgoing VCls? With the same incoming values (port, VCI)? With the same outgoing values (port, VCI)? 20. It is obvious that a router or a switch needs to do searching to find information in the corresponding table. The searching in a routing table for a datagram network is based on the destination address; the searching in a switching table in a virtualcircuit network is based on the combination of incoming port and incoming VCI. Explain the reason and define how these tables must be ordered (sorted) based on these values. 2]. Consider an n X k crossbar switch with n inputs and k outputs. a. Can we say that switch acts as a multiplexer if n > k? b. Can we say that switch acts as a demultiplexer if n < k?

240

CHAPTER 8

SWITCHING

22. We need a three-stage space-division switch with N = 100. We use 10 crossbars at the first and third stages and 4 crossbars at the middle stage. a. Draw the configuration diagram. b. Calculate the total number of crosspoints. c. Find the possible number of simultaneous connections. d. Find the possible number of simultaneous connections if we use one single crossbar (100 x 100). e. Find the blocking factor, the ratio of the number of connections in c and in d. 23. Repeat Exercise 22 if we use 6 crossbars at the middle stage. 24. Redesign the configuration of Exercise 22 using the Clos criteria. 25. We need to have a space-division switch with 1000 inputs and outputs. What is the total number of crosspoints in each of the following cases? a. Using one single crossbar. b. Using a multi-stage switch based on the Clos criteria 26. We need a three-stage time-space-time switch with N = 100. We use 10 TSIs at the first and third stages and 4 crossbars at the middle stage. a. Draw the configuration diagram. b. Calculate the total number of crosspoints. c. Calculate the total number of memory locations we need for the TSIs.

CHAPTER 9

Using Telephone and Cable Networks for Data Transmission
Telephone networks were originally created to provide voice communication. The need to communicate digital data resulted in the invention of the dial-up modem. With the advent of the Internet came the need for high-speed downloading and uploading; the modem was just too slow. The telephone companies added a new technology, the digital subscriber line (DSL). Although dial-up modems still exist in many places all over the world, DSL provides much faster access to the Internet through the telephone network. In this chapter, we first discuss the basic structure of the telephone network. We then see how dial-up modems and DSL technology use these networks to access the Internet. Cable networks were originally created to provide access to TV programs for those subscribers who had no reception because of natural obstructions such as mountains. Later the cable network became popular with people who just wanted a better signal. In addition, cable networks enabled access to remote broadcasting stations via microwave connections. Cable TV also found a good market in Internet access provision using some of the channels originally designed for video. After discussing the basic structure of cable networks, we discuss how cable modems can provide a high-speed connection to the Internet.

9.1

TELEPHONE NETWORK

Telephone networks use circuit switching. The telephone network had its beginnings in the late 1800s. The entire network, which is referred to as the plain old telephone system (POTS), was originally an analog system using analog signals to transmit voice. With the advent of the computer era, the network, in the 1980s, began to carry data in addition to voice. During the last decade, the telephone network has undergone many technical changes. The network is now digital as well as analog.

Major Components
The telephone network, as shown in Figure 9.1, is made of three major components: local loops, trunks, and switching offices. The telephone network has several levels of switching offices such as end offices, tandem offices, and regional offices. 241

242

CHAPTER 9

USING 1ELEPHONE AND CABLE NETWORKS FOR DATA TRANSMISSION

Figure 9.1

A telephone system

Trunk Tandem offices

Trunk

Regional offices

Local Loops
One component of the telephone network is the local loop, a twisted-pair cable that connects the subscriber telephone to the nearest end office or local central office. The local loop, when used for voice, has a bandwidth of 4000 Hz (4 kHz). It is interesting to examine the telephone number associated with each local loop. The first three digits of a local telephone number define the office, and the next four digits define the local loop number.

Trunks

Trunks are transmission media that handle the communication between offices. A trunk normally handles hundreds or thousands of connections through multiplexing. Transmission is usually through optical fibers or satellite links.

Switching Offices
To avoid having a permanent physical link between any two subscribers, the telephone company has switches located in a switching office. A switch connects several local loops or trunks and allows a connection between different subscribers.

LATAs
After the divestiture of 1984 (see Appendix E), the United States was divided into more than 200 local-access transport areas (LATAs). The number of LATAs has increased since then. A LATA can be a small or large metropolitan area. A small state may have one single LATA; a large state may have several LATAs. A LATA boundary may overlap the boundary of a state; part of a LATA can be in one state, part in another state.

Intra-LATA Services
The services offered by the common carriers (telephone companies) inside a LATA are called intra-LATA services. The carrier that handles these services is called a local exchange carrier (LEC). Before the Telecommunications Act of 1996 (see Appendix E), intra-LATA services were granted to one single carrier. This was a monopoly. After 1996, more than one carrier could provide services inside a LATA. The carrier that provided services before 1996 owns the cabling system (local loops) and is called the incumbent local exchange carrier (ILEC). The new carriers that can provide services are called competitive local exchange carriers (CLECs). To avoid the costs of new cabling, it

SECTION 9.1

TELEPHONE NETWORK

243

was agreed that the ILECs would continue to provide the main services, and the CLECs would provide other services such as mobile telephone service, toll calls inside a LATA, and so on. Figure 9.2 shows a LATA and switching offices. Intra-LATA services are provided by local exchange carriers. Since 1996, there are two types ofLECs: incumbent local exchange carriers and competitive local exchange carriers.

Figure 9.2

Switching offices in a LATA

Tandem (toll) offices

Communication inside a LATA is handled by end switches and tandem switches. A call that can be completed by using only end offices is considered toll-free. A call that has to go through a tandem office (intra-LATA toll office) is charged.

Inter-LATA Services
The services between LATAs are handled by interexchange carriers (IXCs). These carriers, sometimes called long-distance companies, provide communication services between two customers in different LATAs. After the act of 1996 (see Appendix E), these services can be provided by any carrier, including those involved in intra-LATA services. The field is wide open. Carriers providing inter-LATA services include AT&T, MCI, WorldCom, Sprint, and Verizon. The IXCs are long-distance carriers that provide general data communications services including telephone service. A telephone call going through an IXC is normally digitized, with the carriers using several types of networks to provide service.

Points of Presence
As we discussed, intra-LATA services can be provided by several LECs (one ILEC and possibly more than one CLEC). We also said that inter-LATA services can be provided by several IXCs. How do these carriers interact with one another? The answer is, via a switching office called a point of presence (POP). Each IXC that wants to provide interLATA services in a LATA must have a POP in that LATA. The LECs that provide services inside the LATA must provide connections so that every subscriber can have access to all POPs. Figure 9.3 illustrates the concept. A subscriber who needs to make a connection with another subscriber is connected first to an end switch and then, either directly or through a tandem switch, to a POP. The

244

CHAPTER 9

USING TELEPHONE AND CABLE NETWORKS FOR DATA TRANSMISSION

Figure 9.3

Point ofpresences (POPs)

LATA

call now goes from the POP of an IXC (the one the subscriber has chosen) in the source LATA to the POP of the same IXC in the destination LATA. The call is passed through the toll office of the IXC and is carried through the network provided by the IXC.

Signaling
The telephone network, at its beginning, used a circuit-switched network with dedicated links (multiplexing had not yet been invented) to transfer voice communication. As we saw in Chapter 8, a circuit-switched network needs the setup and teardown phases to establish and terminate paths between the two communicating parties. In the beginning, this task was performed by human operators. The operator room was a center to which all subscribers were connected. A subscriber who wished to talk to another subscriber picked up the receiver (off-hook) and rang the operator. The operator, after listening to the caller and getting the identifier of the called party, connected the two by using a wire with two plugs inserted into the corresponding two jacks. A dedicated circuit was created in this way. One of the parties, after the conversation ended, informed the operator to disconnect the circuit. This type of signaling is called in-band signaling because the same circuit can be used for both signaling and voice communication. Later, the signaling system became automatic. Rotary telephones were invented that sent a digital signal defining each digit in a multidigit telephone number. The switches in the telephone companies used the digital signals to create a connection between the caller and the called parties. Both in-band and out-of-band signaling were used. In in-band signaling, the 4-kHz voice channel was also used to provide signaling. In out-of-band signaling, a portion of the voice channel bandwidth was used for signaling; the voice bandwidth and the signaling bandwidth were separate.

SECTION 9.1

TELEPHONE NETWORK

245

As telephone networks evolved into a complex network, the functionality of the signaling system increased. The signaling system was required to perform other tasks such as 1. 2. 3. 4. 5. 6. Providing dial tone, ring tone, and busy tone Transferring telephone numbers between offices Maintaining and monitoring the call Keeping billing information Maintaining and monitoring the status of the telephone network equipment Providing other functions such as caller ID, voice mail, and so on

These complex tasks resulted in the provision of a separate network for signaling. This means that a telephone network today can be thought of as two networks: a signaling network and a data transfer network. The tasks of data transfer and signaling are separated in modern telephone networks: data transfer is done by one network, signaling by another.

However, we need to emphasize a point here. Although the two networks are separate, this does not mean that there are separate physical links everywhere; the two networks may use separate channels of the same link in parts of the system.

Data Transfer Network
The data transfer network that can carry multimedia information today is, for the most part, a circuit-switched network, although it can also be a packet-switched network. This network follows the same type of protocols and model as other networks discussed in this book.

Signaling Network
The signaling network, which is our main concern in this section, is a packet-switched network involving the layers similar to those in the OSI model or Internet model, discussed in Chapter 2. The nature of signaling makes it more suited to a packet-switching network with different layers. For example, the information needed to convey a telephone address can easily be encapsulated in a packet with all the error control and addressing information. Figure 9.4 shows a simplified situation of a telephone network in which the two networks are separated. The user telephone or computer is connected to the signal points (SPs). The link between the telephone set and SP is common for the two networks. The signaling network uses nodes called signal transport ports (STPs) that receive and forward signaling messages. The signaling network also includes a service control point (SCP) that controls the whole operation of the network. Other systems such as a database center may be included to provide stored information about the entire signaling network.

Signaling System Seven (5S7)
The protocol that is used in the signaling network is called Signaling System Seven (SS7). It is very similar to the five-layer Internet model we saw in Chapter 2, but the layers have different names, as shown in Figure 9.5.

246

CHAPTER 9

USING TELEPHONE AND CABLE NETWORKS FOR DATA TRANSMISSION

Figure 9.4 Data transfer and signaling networks
SP: Signal point STP: Signal transfer point

Database

Signaling network

Data transfer network

Figure 9.5 Layers in SS7
MTP: Message transfer part SCCP: Signaling connection control point TeAP: Transaction capabilities application port TUP: Telephone user port ISUP: ISDN user port

TUP

Upper layers ,', T(;~ __ SCCP Network layer Data link layer Physical layer MTP level 3 MTPIevel2 MTPlevell

~SNP ":,I, r,; ~

Physical Layer: MTP Level 1 The physical layer in SS7 called message transport part (MTP) level I uses several physical layer specifications such as T-l (1.544 Mbps) and DCa (64 kbps). Data Link Layer: MTP Level 2 The MTP level 2 layer provides typical data link layer services such as packetizing, using source and destination address in the packet header, and CRC for error checking. Network Layer: MTP Level 3 The MTP level 3 layer provides end-to-end connectivity by using the datagram approach to switching. Routers and switches route the signal packets from the source to the destination. Transport Layer: SCCP The signaling connection control point (SCCP) is used for special services such as SaO-call processing. Upper Layers: TUP, TCAP, and ISUP There are three protocols at the upper layers. Telephone user port (TUP) is responsible for setting up voice calls. It receives the dialed

SECTION 9.1

TELEPHONE NETWORK

247

digits and routes the calls. Transaction capabilities application port (TCAP) provides remote calls that let an application program on a computer invoke a procedure on another computer. ISDN user port (ISUP) can replace TUP to provide services similar to those of an ISDN network.

Services Provided by Telephone Networks
Telephone companies provide two types of services: analog and digital.

Analog Services
In the beginning, telephone companies provided their subscribers with analog services. These services still continue today. We can categorize these services as either analog switched services or analog leased services. Analog Switched Services This is the familiar dial-up service most often encountered when a home telephone is used. The signal on a local loop is analog, and the bandwidth is usually between 0 and 4000 Hz. A local call service is normally provided for a flat monthly rate, although in some LATAs, the carrier charges for each call or a set of calls. The rationale for a non flat-rate charge is to provide cheaper service for those customers who do not make many calls. A toll call can be intra-LATA or inter-LATA. If the LATA is geographically large, a call may go through a tandem office (toll office) and the subscriber will pay a fee for the call. The inter-LATA calls are long-distance calls and are charged as such. Another service is called 800 service. If a subscriber (normally an organization) needs to provide free connections for other subscribers (normally customers), it can request the 800 service. In this case, the call is free for the caller, but it is paid by the callee. An organization uses this service to encourage customers to call. The rate is less expensive than that for a normal long-distance call. The wide-area telephone service (WATS) is the opposite of the 800 service. The latter are inbound calls paid by the organization; the former are outbound calls paid by the organization. This service is a less expensive alternative to regular toll calls; charges are based on the number of calls. The service can be specified as outbound calls to the same state, to several states, or to the whole country, with rates charged accordingly. The 900 services are like the 800 service, in that they are inbound calls to a subscriber. However, unlike the 800 service, the call is paid by the caller and is normally much more expensive than a normal long-distance call. The reason is that the carrier charges two fees: the first is the long-distance toll, and the second is the fee paid to the callee for each call. Analog Leased Service An analog leased service offers customers the opportunity to lease a line, sometimes called a dedicated line, that is permanently connected to another customer. Although the connection still passes through the switches in the telephone network, subscribers experience it as a single line because the switch is always closed; no dialing is needed.

Digital Services
Recently telephone companies began offering digital services to their subscribers. Digital services are less sensitive than analog services to noise and other forms of interference.

248

CHAPTER 9

USING TELEPHONE AND CABLE NETWORKS FOR DATA TRANSMISSION

The two most common digital services are switched/56 service and digital data service (DDS). We already discussed high-speed digital services-the T lines-in Chapter 6. We discuss the other services in this chapter. Switched/56 Service Switched/56 service is the digital version of an analog switched line. It is a switched digital service that allows data rates of up to 56 kbps. To communicate through this service, both parties must subscribe. A caller with normal telephone service cannot connect to a telephone or computer with switched/56 service even if the caller is using a modem. On the whole, digital and analog services represent two completely different domains for the telephone companies. Because the line in a switched! 56 service is already digital, subscribers do not need modems to transmit digital data. However, they do need another device called a digital service unit (DSU). Digital Data Service Digital data service (DDS) is the digital version of an analog leased line; it is a digital leased line with a maximum data rate of 64 kbps.

9.2

DIAL~UP

MODEMS

Traditional telephone lines can carry frequencies between 300 and 3300 Hz, giving them a bandwidth of 3000 Hz. All this range is used for transmitting voice, where a great deal of interference and distortion can be accepted without loss of intelligibility. As we have seen, however, data signals require a higher degree of accuracy to ensure integrity. For safety's sake, therefore, the edges of this range are not used for data communications. In general, we can say that the signal bandwidth must be smaller than the cable bandwidth. The effective bandwidth of a telephone line being used for data transmission is 2400 Hz, covering the range from 600 to 3000 Hz. Note that today some telephone lines are capable of handling greater bandwidth than traditional lines. However, modem design is still based on traditional capability (see Figure 9.6). Figure 9.6 Telephone line bandwidth

Used for voice

300
I I I I
I.

600
I
I"

2400 Hz for data
3000 Hz for voice

3300
I

I I
.. I

I

The term modem is a composite word that refers to the two functional entities that make up the device: a signal modulator and a signal demodulator. A modulator creates a bandpass analog signal from binary data. A demodulator recovers the binary data from the modulated signal. Modem stands for modulator/demodulator.

SECTION 9.2

DIAL-UP MODEMS

249

Figure 9.7 shows the relationship of modems to a communications linle The computer on the left sends a digital signal to the modulator portion of the modem; the data are sent as an analog signal on the telephone lines. The modem on the right receives the analog signal, demodulates it through its demodulator, and delivers data to the computer on the right. The communication can be bidirectional, which means the computer on the right can simultaneously send data to the computer on the left, using the same modulation/demodulation processes.

Figure 9.7

Modulation/demodulation

TELCO: Telephone company
A B
r<

.........
c=J n

Modem Standards
Today, many of the most popular modems available are based on the V-series standards published by the ITU-T. We discuss just the most recent series.

V.32 and V.32bis
The V.32 modem uses a combined modulation and encoding technique called trelliscoded modulation. Trellis is essentially QAM plus a redundant bit. The data stream is divided into 4-bit sections. Instead of a quadbit (4-bit pattern), however, a pentabit (5-bit pattern) is transmitted. The value of the extra bit is calculated from the values of the data bits. The extra bit is used for error detection. The Y.32 calls for 32-QAM with a baud rate of 2400. Because only 4 bits of each pentabit represent data, the resulting data rate is 4 x 2400 = 9600 bps. The constellation diagram and bandwidth are shown in Figure 9.8. The V.32bis modem was the first of the ITU-T standards to support 14,400-bps transmission. The Y.32bis uses 128-QAM transmission (7 bits/baud with I bit for error control) at a rate of 2400 baud (2400 x 6 = 14,400 bps). An additional enhancement provided by Y.32bis is the inclusion of an automatic fall-back and fall-forward feature that enables the modem to adjust its speed upward or downward depending on the quality of the line or signal. The constellation diagram and bandwidth are also shown in Figure 9.8.

V. 34bis
The V.34bis modem provides a bit rate of 28,800 with a 960-point constellation and a bit rate of 33,600 bps with a 1664-point constellation.

250

CHAPTER 9

USING TELEPHONE AND CABLE NETWORKS FOR DATA TRANSMISSION

Figure 9.8

The V.32 and V.32bis constellation and bandwidth

90

• • • • • • • • • • 180 • • 0 • • • • • • • • •I•

01'

Full-duplex 2400-baud 9600-bps 2-wire

·i · •1•
270 90

600

1800

3000

a. Constellation and bandwidth for V.32

•••l ••• ••• • ••• • • •••• • ••••• • •• •• •••• • •• ••••••• • ••••• • • • ••• • ••••• 0 180 • • ••••••• • ••••• • • ••• ••••• • •••• • • •• ••• • ••• • • • ••• ••• 270

Full-duplex. 2400-baud 14,400-bps 4-wire

600

1800

3000

b. Constellation and bandwidth for V.32bis

1--:90

Traditional modems have a data rate limitation of 33.6 kbps, as determined by the Shannon capacity (see Chapter 3). However, V.90 modems with a bit rate of 56,000 bps are available; these are called 56K modems. These modems may be used only if one party is using digital signaling (such as through an Internet provider). They are asymmetric in that the downloading rate (flow of data from the Internet service provider to the PC) is a maximum of 56 kbps, while the uploading rate (flow of data from the PC to the Internet provider) can be a maximum of 33.6 kbps. Do these modems violate the Shannon capacity principle? No, in the downstream direction, the SNR ratio is higher because there is no quantization error (see Figure 9.9). In uploading, the analog signal must still be sampled at the switching station. In this direction, quantization noise (as we saw in Chapter 4) is introduced into the signal, which reduces the SNR ratio and limits the rate to 33.6 kbps. However, there is no sampling in the downloading. The signal is not affected by quantization noise and not subject to the Shannon capacity limitation. The maximum data rate in the uploading direction is still 33.6 kbps, but the data rate in the downloading direction is now 56 kbps. One may wonder how we arrive at the 56-kbps figure. The telephone companies sample 8000 times per second with 8 bits per sample. One of the bits in each sample is used for control purposes, which means each sample is 7 bits. The rate is therefore 8000 x 7, or 56,000 bps or 56 kbps.

SECTION 9.3

DIGITAL SUBSCRIBER LINE

251

Figure 9.9

Uploading and downloading in 56K modems

Quantization noise limits the data rate
1--------1 1 1 1 PCM --.I I
I

-=tP-~ ~
Uploading, quantization noise

ISP server

1--------1

1
1 1

Inverse
PCM

I

I I

-=tP- ~ -=tP- ~
"'--~~
Downloading, no quantization noise ISP server

~

1':92

The standard above V90 is called ~92. These modems can adjust their speed, and if the noise allows, they can upload data at the rate of 48 kbps. The downloading rate is still 56 kbps. The modem has additional features. For example, the modem can interrupt the Internet connection when there is an incoming call if the line has call-waiting service.

9.3

DIGITAL SUBSCRIBER LINE

After traditional modems reached their peak data rate, telephone companies developed another technology, DSL, to provide higher-speed access to the Internet. Digital subscriber line (DSL) technology is one of the most promising for supporting high-speed digital communication over the existing local loops. DSL technology is a set of technologies, each differing in the first letter (ADSL, VDSL, HDSL, and SDSL). The set is often referred to as xDSL, where x can be replaced by A, V, H, or S.

252

CHAPTER 9

USING TELEPHONE AND CABLE NETWORKS FOR DATA TRANSMISSION

ADSL
The first technology in the set is asymmetric DSL (ADSL). ADSL, like a 56K modem, provides higher speed (bit rate) in the downstream direction (from the Internet to the resident) than in the upstream direction (from the resident to the Internet). That is the reason it is called asymmetric. Unlike the asymmetry in 56K modems, the designers of ADSL specifically divided the available bandwidth of the local loop unevenly for the residential customer. The service is not suitable for business customers who need a large bandwidth in both directions. ADSL is an asymmetric communication technology designed for residential users; it is not suitable for businesses.

Using Existing Local Loops
One interesting point is that ADSL uses the existing local loops. But how does ADSL reach a data rate that was never achieved with traditional modems? The answer is that the twisted-pair local loop is actually capable of handling bandwidths up to 1.1 MHz, but the filter installed at the end office of the telephone company where each local loop terminates limits the bandwidth to 4 kHz (sufficient for voice communication). If the filter is removed, however, the entire 1.1 MHz is available for data and voice communications. The existing local loops can handle bandwidths up to 1.1 MHz.

Adaptive Technology
Unfortunately, 1.1 MHz is just the theoretical bandwidth of the local loop. Factors such as the distance between the residence and the switching office, the size of the cable, the signaling used, and so on affect the bandwidth. The designers of ADSL technology were aware of this problem and used an adaptive technology that tests the condition and bandwidth availability of the line before settling on a data rate. The data rate of ADSL is not fixed; it changes based on the condition and type of the local loop cable. ADSL is an adaptive technology. The system uses a data rate based on the condition of the local loop line.

Discrete Multitone Technique
The modulation technique that has become standard for ADSL is called the discrete multitone technique (DMT) which combines QAM and FDM. There is no set way that the bandwidth of a system is divided. Each system can decide on its bandwidth division. Typically, an available bandwidth of 1.104 MHz is divided into 256 channels. Each channel uses a bandwidth of 4.312 kHz, as shown in Figure 9.10. Figure 9.11 shows how the bandwidth can be divided into the following:

o o

Voice. Channel 0 is reserved for voice communication. Idle. Channels 1 to 5 are not used and provide a gap between voice and data communication.

SECTION 9.3

DIGITAL SUBSCRIBER LINE

253

Figure 9.10

Discrete multitone technique

Upstream bits

Downstream bits

Figure 9.11

Bandwidth division in ADSL

Voice

Upstream
/

Downstream

""'\ ,;d
"-

I'

'"
1104
kHz

Not used

o

4

26

108 138

o

o

Upstream data and control. Channels 6 to 30 (25 channels) are used for upstream data transfer and control. One channel is for control, and 24 channels are for data transfer. If there are 24 channels, each using 4 kHz (out of 4.312 kHz available) with QAM modulation, we have 24 x 4000 x 15, or a 1.44-Mbps bandwidth, in the upstream direction. However, the data rate is normally below 500 kbps because some of the carriers are deleted at frequencies where the noise level is large. In other words, some of channels may be unused. Downstream data and control. Channels 31 to 255 (225 channels) are used for downstream data transfer and control. One channel is for control, and 224 channels are for data. If there are 224 channels, we can achieve up to 224 x 4000 x 15, or 13.4 Mbps. However, the data rate is normally below 8 Mbps because some of the carriers are deleted at frequencies where the noise level is large. In other words, some of channels may be unused.

Customer Site: ADSL Modem
Figure 9.12 shows an ADSL modem installed at a customer's site. The local loop connects to a splitter which separates voice and data communications. The ADSL

254

CHAPTER 9

USING TELEPHONE AND CABLE NETWORKS FOR DATA TRANSMISSION

modem modulates and demodulates the data, using DMT, and creates downstream and upstream channels.

Figure 9.12

ADSL modem
Splitter Voice

Local loop Data ADSLmodem

Note that the splitter needs to be installed at the customer's premises, normally by a technician from the telephone company. The voice line can use the existing telephone wiring in the house, but the data line needs to be installed by a professional. All this makes the ADSL line expensive. We will see that there is an alternative technology, Universal ADSL (or ADSL Lite).

Telephone Company Site: DSLAM
At the telephone company site, the situation is different. Instead of an ADSL modem, a device called a digital subscriber line access multiplexer (DSLAM) is installed that functions similarly. In addition, it packetizes the data to be sent to the Internet (ISP server). Figure 9.13 shows the configuration.

Figure 9.13

DSLAM
Splitter

To telephone ~ network Packetized

V_o_ic_e_ _-+--i

Low-pass filter

Local loop

High-pass To the ~_ _~d~at~a_---i~d~ Internet UIIM---I--"" filter ",_,",!"",,_..u.

ADSL Lite
The installation of splitters at the border of the premises and the new wiring for the data line can be expensive and impractical enough to dissuade most subscribers. A new version of ADSL technology called ADSL Lite (or Universal ADSL or splitterless ADSL) is available for these subscribers. This technology allows an ASDL Lite modem to be plugged directly into a telephone jack and connected to the computer. The splitting is done at the telephone company. ADSL Lite uses 256 DMT carriers with 8-bit modulation

SECTION 9.3

DIGITAL SUBSCRIBER LINE

255

(instead of 15-bit). However, some of the carriers may not be available because errors created by the voice signal might mingle with them. It can provide a maximum downstream data rate of 1.5 Mbps and an upstream data rate of 512 kbps.

HDSL
The high-bit-rate digital subscriber line (HDSL) was designed as an alternative to the T-lline (1.544 Mbps). The T-1line uses alternate mark inversion (AMI) encoding, which is very susceptible to attenuation at high frequencies. This limits the length of a T-l line to 3200 ft (1 km). For longer distances, a repeater is necessary, which means increased costs. HDSL uses 2B1Q encoding (see Chapter 4), which is less susceptible to attenuation. A data rate of 1.544 Mbps (sometimes up to 2 Mbps) can be achieved without repeaters up to a distance of 12,000 ft (3.86 km). HDSL uses two twisted pairs (one pair for each direction) to achieve full-duplex transmission.

SDSL
The symmetric digital subscriber line (SDSL) is a one twisted-pair version ofHDSL. It provides full-duplex symmetric communication supporting up to 768 kbps in each direction. SDSL, which provides symmetric communication, can be considered an alternative to ADSL. ADSL provides asymmetric communication, with a downstream bit rate that is much higher than the upstream bit rate. Although this feature meets the needs of most residential subscribers, it is not suitable for businesses that send and receive data in large volumes in both directions.

VDSL
The very high-bit-rate digital subscriber line (VDSL), an alternative approach that is similar to ADSL, uses coaxial, fiber-optic, or twisted-pair cable for short distances. The modulating technique is DMT. It provides a range of bit rates (25 to 55 Mbps) for upstream communication at distances of 3000 to 10,000 ft. The downstream rate is normally 3.2 Mbps.

Summary
Table 9.1 shows a summary of DSL technologies. Note that the data rate and distances are approximations and can vary from one implementation to another. Table 9.1 Technology ADSL ADSL Lite HDSL SDSL VDSL Summary of DSL technologies Downstream Rate 1.5-6.1 Mbps 1.5 Mbps 1.5-2.0 Mbps 768 kbps 25-55 Mbps Upstream Rate 16-640 kbps 500 kbps 1.5-2.0 Mbps 768 kbps 3.2 Mbps Distance (jt) 12,000 18,000 12,000 12,000 3000-10,000 Twisted Pairs 1

Line Code DMT DMT 2B1Q 2B1Q DMT

1 2
1

1

256

CHAPTER 9

USING TELEPHONE AND CABLE NETWORKS FOR DATA TRANSMISSION

9.4

CABLE TV NETWORKS

The cable TV network started as a video service provider, but it has moved to the business of Internet access. In this section, we discuss cable TV networks per se; in Section 9.5 we discuss how this network can be used to provide high-speed access to the Internet.

Traditional Cable Networks
Cable TV started to distribute broadcast video signals to locations with poor or no reception in the late 1940s. It was called community antenna TV (CATV) because an antenna at the top of a tall hill or building received the signals from the TV stations and distributed them, via coaxial cables, to the community. Figure 9.14 shows a schematic diagram of a traditional cable TV network. Figure 9.14 Traditional cable TV network

Splitter

Tap

The cable TV office, called the head end, receives video signals from broadcasting stations and feeds the signals into coaxial cables. The signals became weaker and weaker with distance, so amplifiers were installed through the network to renew the signals. There could be up to 35 amplifiers between the head end and the subscriber premises. At the other end, splitters split the cable, and taps and drop cables make the connections to the subscriber premises. The traditional cable TV system used coaxial cable end to end. Due to attenuation of the signals and the use of a large number of amplifiers, communication in the traditional network was unidirectional (one-way). Video signals were transmitted downstream, from the head end to the subscriber premises. Communication in the traditional cable TV network is unidirectional.

Hybrid Fiber-Coaxial (HFC) Network
The second generation of cable networks is called a hybrid fiber-coaxial (HFC) network. The network uses a combination of fiber-optic and coaxial cable. The transmission

SECTION 9.5

CABLE TV FOR DATA TRANSFER

257

medium from the cable TV office to a box, called the fiber node, is optical fiber; from the fiber node through the neighborhood and into the house is still coaxial cable. Figure 9.15 shows a schematic diagram of an HFC network. Figure 9.15 Hybridfiber-coaxial (HFC) network

High-bandwidth fiber

RCH

The regional cable head (RCH) normally serves up to 400,000 subscribers. The RCHs feed the distribution hubs, each of which serves up to 40,000 subscribers. The distribution hub plays an important role in the new infrastructure. Modulation and distribution of signals are done here; the signals are then fed to the fiber nodes through fiber-optic cables. The fiber node splits the analog signals so that the same signal is sent to each coaxial cable. Each coaxial cable serves up to 1000 subscribers. The use of fiber-optic cable reduces the need for amplifiers down to eight or less. One reason for moving from traditional to hybrid infrastructure is to make the cable network bidirectional (two-way). Communication in an HFC cable TV network can be bidirectional.

9.5

CABLE TV FOR DATA TRANSFER

Cable companies are now competing with telephone companies for the residential customer who wants high-speed data transfer. DSL technology provides high-data-rate connections for residential subscribers over the local loop. However, DSL uses the existing unshielded twisted-pair cable, which is very susceptible to interference. This imposes an upper limit on the data rate. Another solution is the use of the cable TV network. In this section, we briefly discuss this technology.

Bandwidth
Even in an HFC system, the last part of the network, from the fiber node to the subscriber premises, is still a coaxial cable. This coaxial cable has a bandwidth that ranges

258

CHAPTER 9

USING TELEPHONE AND CABLE NETWORKS FOR DATA TRANSMISSION

from 5 to 750 MHz (approximately). To provide Internet access, the cable company has divided this bandwidth into three bands: video, downstream data, and upstream data, as shown in Figure 9.16.

Figure 9.16

Division of coaxial cable band by CATV

.
Frequency, MHz 5

l1PStf~~~

Data:~

~::2i

Video

bapd
550

Data downstream 750

4254

Downstream Video Band
The downstream video band occupies frequencies from 54 to 550 MHz. Since each TV channel occupies 6 MHz, this can accommodate more than 80 channels.

Downstream Data Band
The downstream data (from the Internet to the subscriber premises) occupies the upper band, from 550 to 750 MHz. This band is also divided into 6-MHz channels.

Modulation

Downstream data band uses the 64-QAM (or possibly 256-QAM)

modulation technique.
Downstream data are modulated using the 64-QAM modulation technique.

Data Rate There is 6 bits/baud in 64-QAM. One bit is used for forward error correction; this leaves 5 bits of data per baud. The standard specifies I Hz for each baud; this means that, theoretically, downstream data can be received at 30 Mbps (5 bitslHz x 6 MHz). The standard specifies only 27 Mbps. However, since the cable modem is normally connected to the computer through a lOBase-T cable (see Chapter 13), this limits the data rate to 10 Mbps. The theoretical downstream data rate is 30 Mbps.

Upstream Data Band
The upstream data (from the subscriber premises to the Internet) occupies the lower band, from 5 to 42 MHz. This band is also divided into 6-MHz channels.

Modulation The upstream data band uses lower frequencies that are more susceptible to noise and interference. For this reason, the QAM technique is not suitable for this band. A better solution is QPSK. Upstream data are modulated using the QPSK modulation technique.

SECTION 9.5

CABLE TV FOR DATA TRANSFER

259

Data Rate There are 2 bitslbaud in QPSK. The standard specifies 1 Hz for each baud; this means that, theoretically, upstream data can be sent at 12 Mbps (2 bitslHz x 6 MHz). However, the data rate is usually less than 12 Mbps. The theoretical upstream data rate is 12 Mbps.

Sharing
Both upstream and downstream bands are shared by the subscribers.

Upstream Sharing
The upstream data bandwidth is 37 MHz. This means that there are only six 6-MHz channels available in the upstream direction. A subscriber needs to use one channel to send data in the upstream direction. The question is, "How can six channels be shared in an area with 1000,2000, or even 100,000 subscribers?" The solution is timesharing. The band is divided into channels using FDM; these channels must be shared between subscribers in the same neighborhood. The cable provider allocates one channel, statically or dynamically, for a group of subscribers. If one subscriber wants to send data, she or he contends for the channel with others who want access; the subscriber must wait until the channel is available.

Downstream Sharing
We have a similar situation in the downstream direction. The downstream band has 33 channels of 6 MHz. A cable provider probably has more than 33 subscribers; therefore, each channel must be shared between a group of subscribers. However, the situation is different for the downstream direction; here we have a multicasting situation. If there are data for any of the subscribers in the group, the data are sent to that channel. Each subscriber is sent the data. But since each subscriber also has an address registered with the provider; the cable modem for the group matches the address carried with the data to the address assigned by the provider. If the address matches, the data are kept; otherwise, they are discarded.

CMandCMTS
To use a cable network for data transmission, we need two key devices: a cable modem (CM) and a cable modem transmission system (CMTS).

CM
The cable modem (CM) is installed on the subscriber premises. It is similar to an ADSL modem. Figure 9.17 shows its location.

CMTS
The cable modem transmission system (CMTS) is installed inside the distribution hub by the cable company. It receives data from the Internet and passes them to the combiner, which sends them to the subscriber. The CMTS also receives data from the subscriber and passes them to the Internet. Figure 9.18 shows the location of the CMTS.

260

CHAPTER 9

USING TELEPHONE AND CABLE NETWORKS FOR DATA TRANSMISSION

Figure 9.17

Cable modem (CM)
Cable
r------------------------I
I I
Thp"~~

Customer residence

V~OO

I I

I
I
1 1 1

Data
1 1

Cable modem

=-

r-

1

1
1 1

..J1

Figure 9.18

Cable modem transmission system (CMTS)
Distribution hub ------------------I From head end
I Video
I

I
I

Combiner

I

I

~,",,"-,, 2t
I'

Any valid codeword Any corrupted codeword with 1 to terrors

In Figure 10.9, d min > 2t; since the next integer increment is 1, we can say that dmin =2t + 1. To guarantee correction of up to t errors in all cases, the minimum Hamming distance in a block code must be d min == 2t + 1.

Example 10.9
A code scheme has a Hamming distance dmin == 4. What is the error detection and correction capability of this scheme?

Solution
This code guarantees the detection of up to three errOrs (s == 3), but it can correct up to one error. In other words, if this code is used for error correction, part of its capability is wasted. Error correction codes need to have an odd minimum distance (3, 5, 7, ... ).

10.3

LINEAR BLOCK CODES

Almost all block codes used today belong to a subset called linear block codes. The use of nonlinear block codes for error detection and correction is not as widespread because their structure makes theoretical analysis and implementation difficult. We therefore concentrate on linear block codes. The formal definition of linear block codes requires the knowledge of abstract algebra (particularly Galois fields), which is beyond the scope of this book. We therefore give an informal definition. For our purposes, a linear block code is a code in which the exclusive OR (addition modulo-2) of two valid codewords creates another valid codeword.

278

CHAPTER 10

ERROR DETECTION AND CORRECTION

In a linear block code, the exclusive OR (XOR) of any two valid codewords creates another valid codeword.

Example 10.10
Let us see if the two codes we defined in Table 10.1 and Table 10.2 belong to the class of linear block codes. 1. The scheme in Table 10.1 is a linear block code because the result of XORing any codeword with any other codeword is a valid codeword. For example, the XORing of the second and third codewords creates the fourth one. 2. The scheme in Table 10.2 is also a linear block code. We can create all four codewords by XORing two other codewords.

Minimum Distance for Linear Block Codes
It is simple to find the minimum Hamming distance for a linear block code. The minimum Hamming distance is the number of Is in the nonzero valid codeword with the smallest number of Is.

Example 10.11
In our first code (Table 10.1), the numbers of Is in the nonzero codewords are 2, 2, and 2. So the minimum Hamming distance is dmin = 2. In our second code (Table 10.2), the numbers of Is in the nonzero codewords are 3, 3, and 4. So in this code we have d min = 3.

Some Linear Block Codes
Let us now show some linear block codes. These codes are trivial because we can easily find the encoding and decoding algorithms and check their performances.

Simple Parity-Check Code
Perhaps the most familiar error-detecting code is the simple parity-check code. In this code, a k-bit dataword is changed to an n-bit codeword where n = k + 1. The extra bit, called the parity bit, is selected to make the total number of Is in the codeword even. Although some implementations specify an odd number of Is, we discuss the even case. The minimum Hamming distance for this category is d min = 2, which means that the code is a single-bit error-detecting code; it cannot correct any error. A simple parity-check code is a single-bit error-detecting code in which n = k + 1 with d min = 2.

Our first code (Table 10.1) is a parity-check code with k -= 2 and n =3. The code in Table 10.3 is also a parity-check code with k =4 and n =5. Figure 10.10 shows a possible structure of an encoder (at the sender) and a decoder (at the receiver). The encoder uses a generator that takes a copy of a 4-bit dataword (ao, aI' a2' and a3) and generates a parity bit roo The dataword bits and the parity bit create the 5-bit codeword. The parity bit that is added makes the number of Is in the codeword even.

SECTION 10.3

LINEAR BLOCK CODES

279

Table 10.3 Simple parity-check code C(5, 4)
Datawords Codewords Datawords Codewords

0000 0001 0010 0011 0100 0101 0110 0111

00000 00011 00101 00110 01001 01010 01100 01111

1000 1001 1010 1011 1100 1101 1110 1111

10001 10010 10100 10111 11000 11011 11101 11110

Figure 10.10 Encoder and decoder for simple parity-check code Sender Receiver Encoder Decoder

la31 a21 all aol

Dataword

la31 a21 ad aol
Accept Decision logic
"0 r, or L > r + 1, the syndrome is 0 and the error is undetected. It can be proved that in these cases, the probability of undetected burst error of length greater than r + 1 is (112t For example, if our generator is x 14 + x 3 + 1, in which r = 14, a burst error of length greater than 15 can slip by undetected with the probability of (112)14 or almost 1 in 16,000 cases.

o o

o

All burst errors with L ::::; r will be detected. All burst errors with L =r + 1 will be detected with probability 1 - (112/- 1• All burst errors with L > r + 1 will be detected with probability 1- (1/2[.

Example 10.17
Find the suitability of the following generators in relation to burst errors of different lengths. a. x 6 + 1 b. x I8 + x 7 + x + 1 c. x32+~3+x7+1

SECTION 10.4

CYCLIC CODES

297

Solution
a. This generator can detect all burst errors with a length less than or equal to 6 bits; 3 out of 100 burst errors with length 7 will slip by; 16 out of 1000 burst errors of length 8 or more will slip by. b. This generator can detect all burst errors with a length less than or equal to 18 bits; 8 out of 1 million burst errors with length 19 will slip by; 4 out of I million burst errors of length 20 or more will slip by. c. This generator can detect all burst errors with a length less than or equal to 32 bits; 5 out of 10 billion burst errors with length 33 will slip by; 3 out of 10 billion burst errors of length 34 or more will slip by.

Summary
We can summarize the criteria for a good polynomial generator: A good polynomial generator needs to have the following characteristics: 1. 2. 3. 4.

It should have at least two terms. The coefficient of the term xO should be 1. It should not divide Xl + 1, for t between 2 and n - 1. It should have the factor x + 1.

Standard Polynomials
Some standard polynomials used by popular protocols for in Table 10.7. Table 10.7 Standard polynomials Name Polynomial
2 x S +x +x + 1

eRe generation are shown

Application

CRC-8 CRC-lO CRC-16 CRC-32

ATM header ATMAAL HDLC

xIO+x9+~+x4+x2+ I
x 16

+ x 12 + ~ + 1 + xlI + x lO +

x 32 + 2 6 + 2 3 + x 22 + x 16 + x 12 2 7 5 4 8 x +x +x +x +x +x + 1

LANs

Advantages of Cyclic Codes
We have seen that cyclic codes have a very good performance in detecting single-bit errors, double errors, an odd number of errors, and burst errors. They can easily be implemented in hardware and software. They are especially fast when implemented in hardware. This has made cyclic codes a good candidate for many networks.

Other Cyclic Codes
The cyclic codes we have discussed in this section are very simple. The check bits and syndromes can be calculated by simple algebra. There are, however, more powerful polynomials that are based on abstract algebra involving Galois fields. These are beyond

298

CHAPTER 10

ERROR DETECTION AND CORRECTION

the scope of this book. One of the most interesting of these codes is the Reed-Solomon code used today for both detection and correction.

10.5

CHECKSUM

The last error detection method we discuss here is called the checksum. The checksum is used in the Internet by several protocols although not at the data link layer. However, we briefly discuss it here to complete our discussion on error checking. Like linear and cyclic codes, the checksum is based on the concept of redundancy. Several protocols still use the checksum for error detection as we will see in future chapters, although the tendency is to replace it with a CRe. This means that the CRC is also used in layers other than the data link layer.

Idea
The concept of the checksum is not difficult. Let us illustrate it with a few examples. Example 10.18 Suppose our data is a list of five 4-bit numbers that we want to send to a destination. In addition to sending these numbers, we send the sum of the numbers. For example, if the set of numbers is (7, 11, 12, 0, 6), we send (7, 11, 12,0,6,36), where 36 is the sum of the original numbers. The receiver adds the five numbers and compares the result with the sum. If the two are the same, the receiver assumes no error, accepts the five numbers, and discards the sum. Otherwise, there is an error somewhere and the data are not accepted.

Example 10.19
We can make the job of the receiver easier if we send the negative (complement) of the sum, called the checksum. In this case, we send (7, 11, 12,0,6, -36). The receiver can add all the numbers received (including the checksum). If the result is 0, it assumes no error; otherwise, there is an error.

One's Complement
The previous example has one major drawback. All of our data can be written as a 4-bit word (they are less than 15) except for the checksum. One solution is to use one's complement arithmetic. In this arithmetic, we can represent unsigned numbers between 0 and 2n - 1 using only n bits. t If the number has more than n bits, the extra leftmost bits need to be added to the n rightmost bits (wrapping). In one's complement arithmetic, a negative number can be represented by inverting all bits (changing a 0 to a 1 and a 1 to a 0). This is the same as subtracting the number from 2 n - 1. Example 10.20 How can we represent the number 21 in one's complement arithmetic using only four bits? t Although one's complement can represent both positive and negative numbers, we are concerned only with unsigned representation here.

SECTION 10.5

CHECKSUM

299

Solution
The number 21 in binary is 1010 1 (it needs five bits). We can wrap the leftmost bit and add it to the four rightmost bits. We have (0101 + 1) = 0110 or 6.

Example 10.21
How can we represent the number -6 in one's complement arithmetic using only four bits?

Solution
In one's complement arithmetic, the negative or complement of a number is found by inverting all bits. Positive 6 is 0110; negative 6 is 100I. If we consider only unsigned numbers, this is 9. In other words, the complement of 6 is 9. Another way to find the complement of a number in one's complement arithmetic is to subtract the numberfrom 2n - I (16 - 1 in this case).

Example 10.22
Let us redo Exercise 10.19 using one's complement arithmetic. Figure 10.24 shows the process at the sender and at the receiver. The sender initializes the checksum to 0 and adds all data items and the checksum (the checksum is considered as one data item and is shown in color). The result is 36. However, 36 cannot be expressed in 4 bits. The extra two bits are wrapped and added with the sum to create the wrapped sum value 6. In the figure, we have shown the details in binary. The sum is then complemented, resulting in the checksum value 9 (15 - 6 = 9). The sender now sends six data items to the receiver including the checksum 9. The receiver follows the same procedure as the sender. It adds all data items (including the checksum); the result is 45. The sum is wrapped and becomes 15. The wrapped sum is complemented and becomes O. Since the value of the checksum is 0, this means that the data is not corrupted. The receiver drops the checksum and keeps the other data items. If the checksum is not zero, the entire packet is dropped.

Figure 10.24
Sender site 7 11 12 0 6 0 36 6 9 Receiver site 7 11 12 0 6 9 45 15 0 45

Sum~

~ 7, II, 12,0,6,9 ~
Packet

Sum~

Wrapped sum Checksum

~
~

Wrapped sum Checksum

~ ~

L!.J!JO 1 0 0
~10

36

L!....Q.J 1 1 0 1
~10

6 1 0 9 100 1 Details of wrapping and complementing

o1

1 1 1 1

15

o0 0 0
Details of wrapping and complementing

o

Internet Checksum
Traditionally, the Internet has been using a 16-bit checksum. The sender calculates the checksum by following these steps.

300

CHAPTER 10

ERROR DETECTION AND CORRECTION

Sender site: 1. The message is divided into 16-bit words. 2. The value of the checksum word is set to O. 3. All words including the checksum are added ushtg one's complement addition. 4. The sum is complemented and becomes the checksum. 5. The checksum is sent with the data.

The receiver uses the following steps for error detection.

Receiver site: 1. The message (including checksum) is divided into 16-bit words. 2. All words are added using one's complement addition. 3. The sum is complemented and becomes the new checksum. 4. If the value of checksum is 0, the message is accepted; otherwise, it is rejected.

The nature of the checksum (treating words as numbers and adding and complementing them) is well-suited for software implementation. Short programs can be written to calculate the checksum at the receiver site or to check the validity of the message at the receiver site.

Example 10.23
Let us calculate the checksum for a text of 8 characters ("Forouzan"). The text needs to be divided into 2-byte (l6-bit) words. We use ASCII (see Appendix A) to change each byte to a 2-digit hexadecimal number. For example, F is represented as Ox46 and 0 is represented as Ox6F. Figure 10.25 shows how the checksum is calculated at the sender and receiver sites. In part a of the figure, the value of partial sum for the first column is Ox36. We keep the rightmost digit (6) and insert the

Figure 10.25
I

0

1

3
6 6
7

Carries
F
F
A
(Fo)

1

()

1 3

Carries
IFo)
(ro)

4
7 7

6 2 5

6 1 6 E 0 0 0 0 8 F C 6
1

(ro) luz) (an) Checksum (initial) Sum (partial) Sum Checksum (to send)

4 6 6 F 7 2 6 F
7

5
1

7

A

6
7

0

6 3

E

(uz) (an) Checksum (received) Sum (partial) Sum Checksum (new}

8
1

F F 0

F F E F 0

8 F C 7 0 3

7

F F
0
()

8

a. Checksum at the sender site

b. Checksum at the receiver site

SECTION fO.7

KEY TERMS

301

leftmost dight (3) as the carry in the second column. The process is repeated for each column. Hexadecimal numbers are reviewed in Appendix B. Note that if there is any corruption, the checksum recalculated by the receiver is not all as. We leave this an exercise.

Performance
The traditional checksum uses a small number of bits (16) to detect errors in a message of any size (sometimes thousands of bits). However, it is not as strong as the CRC in error-checking capability. For example, if the value of one word is incremented and the value of another word is decremented by the same amount, the two errors cannot be detected because the sum and checksum remain the same. Also if the values of several words are incremented but the total change is a multiple of 65535, the sum and the checksum does not change, which means the errors are not detected. Fletcher and Adler have proposed some weighted checksums, in which each word is multiplied by a number (its weight) that is related to its position in the text. This will eliminate the first problem we mentioned. However, the tendency in the Internet, particularly in designing new protocols, is to replace the checksum with a CRC.

10.6

RECOMMENDED READING

For more details about subjects discussed in this chapter, we recommend the following books. The items in brackets [...] refer to the reference list at the end of the text.

Books
Several excellent book are devoted to error coding. Among them we recommend [Ham80], [Zar02], [Ror96], and [SWE04].

RFCs
A discussion of the use of the checksum in the Internet can be found in RFC 1141.

10.7

KEY TERMS
error correction error detection forward error correction generator polynomial Hamming code Hamming distance interference linear block code minimum Hamming distance modular arithmetic

block code burst error check bit checksum codeword convolution code cyclic code cyclic redundancy check (CRC) dataword error

302

CHAPTER 10

ERROR DETECTION AND CORRECTION

modulus one's complement parity bit parity-check code polynomial redundancy Reed-Solomon

register retransmission shift register single-bit error syndrome two-dimensional parity check

10.8

SUMMARY

o o

o o
o

o
o
o

Data can be corrupted during transmission. Some applications require that errors be detected and corrected. In a single-bit error, only one bit in the data unit has changed. A burst error means that two or more bits in the data unit have changed. To detect or correct errors, we need to send extra (redundant) bits with data. There are two main methods of error correction: forward error correction and correction by retransmission. We can divide coding schemes into two broad categories: block coding and convolution coding. In coding, we need to use modulo-2 arithmetic. Operations in this arithmetic are very simple; addition and subtraction give the same results. we use the XOR (exclusive OR) operation for both addition and subtraction. In block coding, we divide our message into blocks, each of k bits, called datawords. We add r redundant bits to each block to make the length n ::: k + r. The resulting n-bit blocks are called codewords. In block coding, errors be detected by using the following two conditions: a. The receiver has (or can find) a list of valid codewords. b. The original codeword has changed to an invalid one. The Hamming distance between two words is the number of differences between corresponding bits. The minimum Hamming distance is the smallest Hamming distance between all possible pairs in a set of words. To guarantee the detection of up to s errors in all cases, the minimum Hamming distance in a block code must be d min ::: s + 1. To guarantee correction of up to t errors in all cases, the minimum Hamming distance in a block code must be dmin ::: 2t + 1. In a linear block code, the exclusive OR (XOR) of any two valid codewords creates another valid codeword. A simple parity-check code is a single-bit error-detecting code in which n ::: k + 1 with d min ::: 2. A simple parity-check code can detect an odd number of errors. All Hamming codes discussed in this book have dmin ::: 3. The relationship between m and n in these codes is n::: 2m - 1. Cyclic codes are special linear block codes with one extra property. In a cyclic code, if a codeword is cyclically shifted (rotated), the result is another codeword.

o
o

o o
o

o

SECTION 10.9

PRACTICE SET

303

o o
o

A category of cyclic codes called the cyclic redundancy check (CRC) is used in networks such as LANs and WANs. A pattern of Os and Is can be represented as a polynomial with coefficients of 0 and 1. Traditionally, the Internet has been using a I6-bit checksum, which uses one's complement arithmetic. In this arithmetic, we can represent unsigned numbers between o and 2n -1 using only n bits.

10.9
1. 2. 3. 4. 5. 6. 7.

PRACTICE SET

Review Questions
How does a single-bit error differ from a burst error? Discuss the concept of redundancy in error detection and correction. Distinguish between forward error correction versus error correction by retransmission. What is the definition of a linear block code? What is the definition of a cyclic code? What is the Hamming distance? What is the minimum Hamming distance? How is the simple parity check related to the two-dimensional parity check? In CRC, show the relationship between the following entities (size means the number of bits): a. The size of the dataword and the size of the codeword b. The size of the divisor and the remainder c. The degree of the polynomial generator and the size of the divisor d. The degree of the polynomial generator and the size of the remainder 8. What kind of arithmetic is used to add data items in checksum calculation? 9. What kind of error is undetectable by the checksum? 10. Can the value of a checksum be all Os (in binary)? Defend your answer. Can the value be allIs (in binary)? Defend your answer.

Exercises
11. What is the maximum effect of a 2-ms burst of noise on data transmitted at the following rates? a. 1500 bps b. 12 kbps c. 100 kbps d. 100 Mbps 12. Apply the exclusive-or operation on the following pair of patterns (the symbol EB means XOR): a. (10001) EB (10000) b. (10001) EB (10001) (What do you infer from the result?) c. (11100) EB (00000) (What do you infer from the result?) d. (10011) EEl (11111) (What do you infer from the result?)

304

CHAPTER 10

ERROR DETECTION AND CORRECTION

13. In Table 10.1, the sender sends dataword 10. A 3-bit burst error corrupts the codeword. Can the receiver detect the error? Defend your answer. 14. In Table 10.2, the sender sends dataword 10. If a 3-bit burst en-or con-upts the first three bits of the codeword, can the receiver detect the error? Defend your answer. 15. What is the Hamming distance for each of the following codewords:

a. d (10000, 00000) b. d (10101, 10000) c. d (11111,11111) d. d (000, 000) 16. Find the minimum Hamming distance for the following cases: a. Detection of two en-ors. b. Correction of two errors. c. Detection of 3 errors or correction of 2 errors. d. Detection of 6 errors or correction of 2 errors. 17. Using the code in Table 10.2, what is the dataword if one of the following codewords is received? a. 01011 b. 11111 c. 00000 d. 11011 18. Prove that the code represented by Table 10.8 is not a linear code. You need to find only one case that violates the linearity. Table 10.8

Table for Exercise 18 Codeword

Dataword

00 01 10 11

00000 01011 10111 11111

19. Although it can mathematically be proved that a simple parity check code is a linear code, use manual testing of linearity for five pairs of the codewords in Table 10.3 to partially prove this fact. 20. Show that the Hamming code C(7,4) of Table lOA can detect two-bit en-ors but not necessarily three-bit error by testing the code in the following cases. The character "V" in the burst en-or means no en-or; the character "E" means an error. a. Dataword: 0100 b. Dataword: 0111 c. Dataword: 1111 d. Dataword: 0000 Burst error: VEEVVVV Burst error: EVVVVVE Burst error: EVEVVVE Burst en-or: EEVEVVV

SECTION 10.9

PRACTICE SET

305

21. Show that the Hamming code C(7,4) of Table lOA can correct one-bit errors but not more by testing the code in the following cases. The character "V" in the burst error means no error; the character "E" means an error. a. Dataword: 0100 Burst error: EVVVVVV

b. Dataword: 0111 Burst error: VEVVVVV c. Dataword: 1111 Burst error: EVVVVVE d. Dataword: 0000 Burst error: EEVVVVE 22. Although it can be proved that code in Table 10.6 is both linear and cyclic, use only two tests to partially prove the fact: a. Test the cyclic property on codeword 0101100. b. Test the linear property on codewords 0010110 and 1111111. 23. We need a dataword of at least 11 bits. Find the values of k and n in the Hamming code C(n, k) with d min ::: 3. 24. Apply the following operations on the corresponding polynomials: a. (x 3 + xl + X + 1) + (x 4 + xl + x + 1) b. (x 3 + xl + x + 1) - (x4 + xl + x + 1) c. (x 3 + xl) X

(x 4 + x 2 + x + 1)

d. (x 3 + x 2 + x + 1) / (x 2 + 1)

25. Answer the following questions: a. What is the polynomial representation of 10111O? b. What is the result of shifting 101110 three bits to the left? c. Repeat part b using polynomials. d. What is the result of shifting 101110 four bits to the right? e. Repeat part d using polynomials. 26. Which of the following CRC generators guarantee the detection of a single bit error? a. x 3 + x + 1 b. x 4 + xl

c. 1
d. x 2 + 1

27. Referring to the CRC-8 polynomial in Table 10.7, answerthe following questions: a. Does it detect a single error? Defend your answer. b. Does it detect a burst error of size 6? Defend your answer. c. What is the probability of detecting a burst error of size 9? d. What is the probability of detecting a burst error of size 15? 28. Referring to the CRC-32 polynomial in Table 10.7, answer the following questions: a. Does it detect a single error? Defend your answer. b. Does it detect a burst error of size 16? Defend your answer. c. What is the probability of detecting a burst error of size 33? d. What is the probability of detecting a burst error of size 55?

306

CHAPTER 10

ERROR DETECTION AND CORRECTION

29. Assuming even parity, find the parity bit for each of the following data units. a. 1001011 b. 0001100 c. 1000000 d. 1110111 30. Given the dataword 1010011110 and the divisor 10111, a. Show the generation of the codeword at the sender site (using binary division). h. Show the checking of the codeword at the receiver site (assume no error). 3 I. Repeat Exercise 30 using polynomials. 32. A sender needs to send the four data items Ox3456, OxABCC, Ox02BC, and OxEEEE. Answer the following: a. Find the checksum at the sender site. b. Find the checksum at the receiver site if there is no error. c. Find the checksum at the receiver site if the second data item is changed to OxABCE. d. Find the checksum at the receiver site if the second data item is changed to OxABCE and the third data item is changed to Ox02BA. 33. This problem shows a special case in checksum handling. A sender has two data items to send: Ox4567 and OxBA98. What is the value of the checksum?

CHAPTER 11

Data Link Control

The two main functions of the data link layer are data link control and media access control. The first, data link control, deals with the design and procedures for communication between two adjacent nodes: node-to-node communication. We discuss this functionality in this chapter. The second function of the data link layer is media access control, or how to share the link. We discuss this functionality in Chapter 12. Data link control functions include framing, flow and error control, and softwareimplemented protocols that provide smooth and reliable transmission of frames between nodes. In this chapter, we first discuss framing, or how to organize the bits that are carried by the physical layer. We then discuss flow and error control. A subset of this topic, techniques for error detection and correction, was discussed in Chapter 10. To implement data link control, we need protocols. Each protocol is a set of rules that need to be implemented in software and run by the two nodes involved in data exchange at the data link layer. We discuss five protocols: two for noiseless (ideal) channels and three for noisy (real) channels. Those in the first category are not actually implemented, but provide a foundation for understanding the protocols in the second category. After discussing the five protocol designs, we show how a bit-oriented protocol is actually implemented by using the High-level Data Link Control (HDLC) Protocol as an example. We also discuss a popular byte-oriented protocol, Point-to-Point Protocol (PPP).

11.1

FRAMING

Data transmission in the physical layer means moving bits in the form of a signal from the source to the destination. The physical layer provides bit synchronization to ensure that the sender and receiver use the same bit durations and timing. The data link layer, on the other hand, needs to pack bits into frames, so that each frame is distinguishable from another. Our postal system practices a type of framing. The simple act of inserting a letter into an envelope separates one piece of information from another; the envelope serves as the delimiter. In addition, each envelope defines the sender and receiver addresses since the postal system is a many-to-many carrier facility. 307

308

CHAPTER 11

DATA LINK CONTROL

Framing in the data link layer separates a message from one source to a destination, or from other messages to other destinations, by adding a sender address and a destination address. The destination address defines where the packet is to go; the sender address helps the recipient acknowledge the receipt. Although the whole message could be packed in one frame, that is not normally done. One reason is that a frame can be very large, making flow and error control very inefficient. When a message is carried in one very large frame, even a single-bit error would require the retransmission of the whole message. When a message is divided into smaller frames, a single-bit error affects only that small frame.

Fixed-Size Framing
Frames can be of fixed or variable size. In fixed-size framing, there is no need for defining the boundaries of the frames; the size itself can be used as a delimiter. An example of this type of framing is the ATM wide-area network, which uses frames of fixed size called cells. We discuss ATM in Chapter 18.

Variable-Size Framing
Our main discussion in this chapter concerns variable-size framing, prevalent in localarea networks. In variable-size framing, we need a way to define the end of the frame and the beginning of the next. Historically, two approaches were used for this purpose: a character-oriented approach and a bit-oriented approach. Character-Oriented Protocols In a character-oriented protocol, data to be carried are 8-bit characters from a coding system such as ASCII (see Appendix A). The header, which normally carries the source and destination addresses and other control information, and the trailer, which carries error detection or error correction redundant bits, are also multiples of 8 bits. To separate one frame from the next, an 8-bit (I-byte) flag is added at the beginning and the end of a frame. The flag, composed of protocol-dependent special characters, signals the start or end of a frame. Figure 11.1 shows the format of a frame in a character-oriented protocol. Figure 11.1 Aframe in a character-oriented protocol Data from upper layer

Character-oriented framing was popular when only text was exchanged by the data link layers. The flag could be selected to be any character not used for text communication. Now, however, we send other types of information such as graphs, audio, and video. Any pattern used for the flag could also be part of the information. If this happens, the receiver, when it encounters this pattern in the middle of the data, thinks it has reached the end of the frame. To fix this problem, a byte-stuffing strategy was added to

SECTION 11.1

FRAMING

309

character-oriented framing. In byte stuffing (or character stuffing), a special byte is added to the data section of the frame when there is a character with the same pattern as the flag. The data section is stuffed with an extra byte. This byte is usually called the escape character (ESC), which has a predefined bit pattern. Whenever the receiver encounters the ESC character, it removes it from the data section and treats the next character as data, not a delimiting flag. Byte stuffing by the escape character allows the presence of the flag in the data section of the frame, but it creates another problem. What happens if the text contains one or more escape characters followed by a flag? The receiver removes the escape character, but keeps the flag, which is incorrectly interpreted as the end of the frame. To solve this problem, the escape characters that are part of the text must also be marked by another escape character. In other words, if the escape character is part of the text, an extra one is added to show that the second one is part of the text. Figure 11.2 shows the situation.

Figure 11.2 Byte stuffing and unstuffing

Frame sent Flag Header

Stuffed

Extra 2 bytes Frame received Flag Header Unstuffed

Byte stuffing is the process of adding 1 extra byte whenever there is a flag or escape character in the text.

Character-oriented protocols present another problem in data communications. The universal coding systems in use today, such as Unicode, have 16-bit and 32-bit characters that conflict with 8-bit characters. We can say that in general, the tendency is moving toward the bit-oriented protocols that we discuss next.

Bit-Oriented Protocols
In a bit-oriented protocol, the data section of a frame is a sequence of bits to be interpreted by the upper layer as text, graphic, audio, video, and so on. However, in addition to headers (and possible trailers), we still need a delimiter to separate one frame from the other. Most protocols use a special 8-bit pattern flag 01111110 as the delimiter to define the beginning and the end of the frame, as shown in Figure 11.3.

310

CHAPTER 11

DATA LINK CONTROL

Figure 11.3 A frame in a bit-oriented protocol

I'
Header

Data from upper layer Variable number of bits '

I
Flag

This flag can create the same type of problem we saw in the byte-oriented protocols. That is, if the flag pattern appears in the data, we need to somehow inform the receiver that this is not the end of the frame. We do this by stuffing 1 single bit (instead of I byte) to prevent the pattern from looking like a flag. The strategy is called bit stuffing. In bit stuffing, if a 0 and five consecutive I bits are encountered, an extra 0 is added. This extra stuffed bit is eventually removed from the data by the receiver. Note that the extra bit is added after one 0 followed by five 1s regardless of the value of the next bit. This guarantees that the flag field sequence does not inadvertently appear in the frame. Bit stuffing is the process of adding one extra 0 whenever five consecutive 18 follow a 0 in the data, so that the receiver does not mistake the pattern 0111110 for a flag.

Figure 11.4 shows bit stuffing at the sender and bit removal at the receiver. Note that even if we have a 0 after five 1s, we still stuff a O. The 0 will be removed by the receiver.

Figure 11.4

Bit stuffing and unstuffing
Data from upper layer 100011111110011111010001 Frame sent Stuffed Header

t

I Flag

!

10001111101100111110010001 Trailer Extra 2 bits

IFlag I

Frame received

I Flag 1

Header

10001111101100111110010001 Trailer 1Flag Unsroffed

I000 1l11l1100111110 1000 I
Data to upper layer

t

I

This means that if the flaglike pattern 01111110 appears in the data, it will change to 011111010 (stuffed) and is not mistaken as a flag by the receiver. The real flag 01111110 is not stuffed by the sender and is recognized by the receiver.

SECTION II.3

PROTOCOLS

311

11.2

FLOW AND ERROR CONTROL

Data communication requires at least two devices working together, one to send and the other to receive. Even such a basic arrangement requires a great deal of coordination for an intelligible exchange to occur. The most important responsibilities of the data link layer are flow control and error control. Collectively, these functions are known as data link control.

Flow Control
Flow control coordinates the amount of data that can be sent before receiving an acknowledgment and is one of the most important duties of the data link layer. In most protocols, flow control is a set of procedures that tells the sender how much data it can transmit before it must wait for an acknowledgment from the receiver. The flow of data must not be allowed to overwhelm the receiver. Any receiving device has a limited speed at which it can process incoming data and a limited amount of memory in which to store incoming data. The receiving device must be able to inform the sending device before those limits are reached and to request that the transmitting device send fewer frames or stop temporarily. Incoming data must be checked and processed before they can be used. The rate of such processing is often slower than the rate of transmission. For this reason, each receiving device has a block of memory, called a buffer, reserved for storing incoming data until they are processed. If the buffer begins to fill up, the receiver must be able to tell the sender to halt transmission until it is once again able to receive. Flow control refers to a set of procedures used to restrict the amount of data that the sender can send before waiting for acknowledgment.

Error Control
Error control is both error detection and error correction. It allows the receiver to inform the sender of any frames lost or damaged in transmission and coordinates the retransmission of those frames by the sender. In the data link layer, the term error control refers primarily to methods of error detection and retransmission. Error control in the data link layer is often implemented simply: Any time an error is detected in an exchange, specified frames are retransmitted. This process is called automatic repeat request (ARQ). Error control in the data link layer is based on automatic repeat request, which is the retransmission of data.

11.3 PROTOCOLS
Now let us see how the data link layer can combine framing, flow control, and error control to achieve the delivery of data from one node to another. The protocols are normally implemented in software by using one of the common programming languages. To make our

312

CHAPTER 11

DATA LINK CONTROL

discussions language-free, we have written in pseudocode a version of each protocol that concentrates mostly on the procedure instead of delving into the details of language rules. We divide the discussion of protocols into those that can be used for noiseless (error-free) channels and those that can be used for noisy (error-creating) channels. The protocols in the first category cannot be used in real life, but they serve as a basis for understanding the protocols of noisy channels. Figure 11.5 shows the classifications.

Figure 11.5

Taxonomy ofprotocols discussed in this chapter

Simplest Stop-and-Wait

Stop-and-Wait ARQ Go-Hack-N ARQ Selective Repeat ARQ

There is a difference between the protocols we discuss here and those used in real networks. All the protocols we discuss are unidirectional in the sense that the data frames travel from one node, called the sender, to another node, called the receiver. Although special frames, called acknowledgment (ACK) and negative acknowledgment (NAK) can flow in the opposite direction for flow and error control purposes, data flow in only one direction. In a real-life network, the data link protocols are implemented as bidirectional; data flow in both directions. In these protocols the flow and error control information such as ACKs and NAKs is included in the data frames in a technique called piggybacking. Because bidirectional protocols are more complex than unidirectional ones, we chose the latter for our discussion. If they are understood, they can be extended to bidirectional protocols. We leave this extension as an exercise.

11.4

NOISELESS CHANNELS

Let us first assume we have an ideal channel in which no frames are lost, duplicated, or corrupted. We introduce two protocols for this type of channel. The first is a protocol that does not use flow control; the second is the one that does. Of course, neither has error control because we have assumed that the channel is a perfect noiseless channel.

Simplest Protocol
Our first protocol, which we call the Simplest Protocol for lack of any other name, is one that has no flow or en'or control. Like other protocols we will discuss in this chapter, it is a unidirectional protocol in which data frames are traveling in only one direction-from the

SECTION 11.4

NOISELESS CHANNELS

313

sender to receiver. We assume that the receiver can immediately handle any frame it receives with a processing time that is small enough to be negligible. The data link layer of the receiver immediately removes the header from the frame and hands the data packet to its network layer, which can also accept the packet immediately. In other words, the receiver can never be overwhelmed with incoming frames. Design There is no need for flow control in this scheme. The data link layer at the sender site gets data from its network layer, makes a frame out of the data, and sends it. The data link layer at the receiver site receives a frame from its physical layer, extracts data from the frame, and delivers the data to its network layer. The data link layers of the sender and receiver provide transmission services for their network layers. The data link layers use the services provided by their physical layers (such as signaling, multiplexing, and so on) for the physical transmission of bits. Figure 11.6 shows a design.

Figure 11.6 The design of the simplest protocol with no flow or error control Sender Network Get data Receiver Delivrdata
I

Network

t
Data link
I

Data link

...
I

Physical

Send frame

t

Receive frame Physical Data frames -+-

I

~~~~~~~

I

Repeat forever

Event: )\{otifu:ation from physlclU iaye]"

We need to elaborate on the procedure used by both data link layers. The sender site cannot send a frame until its network layer has a data packet to send. The receiver site cannot deliver a data packet to its network layer until a frame arrives. If the protocol is implemented as a procedure, we need to introduce the idea of events in the protocol. The procedure at the sender site is constantly running; there is no action until there is a request from the network layer. The procedure at the receiver site is also constantly rulming, but there is no action until notification from the physical layer arrives. Both procedures are constantly running because they do not know when the corresponding events will occur.

314

CHAPTER 11

DATA LINK CONTROL

Algorithms
Algorithm 11.1 shows the procedure at the sender site. Algorithm 11.1 2 3 {

Sender-site algorithm for the simplest protocol
II Repeat forever II Sleep until an event occurs //There is a packet to send

1 while (true) WaitForEvent()i if(Event(RequestToSend»
{

4
5 6 7 8 9 10

GetData()i MakeFrame()i SendFrame()i
}

//Send the frame

}

Analysis

The algorithm has an infinite loop, which means lines 3 to 9 are repeated forever once the program starts. The algorithm is an event-driven one, which means that it sleeps (line 3) until an event wakes it up (line 4). This means that there may be an undefined span of time between the execution of line 3 and line 4; there is a gap between these actions. When the event, a request from the network layer, occurs, lines 6 though 8 are executed. The program then repeats the loop and again sleeps at line 3 until the next occurrence of the event. We have written pseudocode for the main process. We do not show any details for the modules GetData, MakeFrame, and SendFrame. GetDataO takes a data packet from the network layer, MakeFrameO adds a header and delimiter flags to the data packet to make a frame, and SendFrameO delivers the frame to the physical layer for transmission.

Algorithm 11.2 shows the procedure at the receiver site. Algorithm 11.2

Receiver-site algorithm for the simplest protocol
II Repeat forever

1 while(true) 2 { 3 WaitForEvent()i 4 if(Event(ArrivalNotification» 5 { 6 ReceiveFrame()i 7 ExtractData()i Del iverDat a ( ) i 8 9 10
}

II Sleep until an event occurs IIData frame arrived

/ /Deli ver data to network layez

}

Analysis

This algorithm has the same format as Algorithm 11.1, except that the direction of the frames and data is upward. The event here is the arrival of a data frame. After the event occurs, the data link layer receives the frame from the physical layer using the ReceiveFrameO process, extracts the data from the frame using the ExtractDataO process, and delivers the data to the network layer using the DeliverDataO process. Here, we also have an event-driven algorithm because the algorithm never knows when the data frame will arrive.

SECTION 11.4

NOISELESS CHANNELS

315

Example 11.1
Figure 11.7 shows an example of communication using this protocol. It is very simple. The sender sends a sequence of frames without even thinking about the receiver. To send three frames, three events occur at the sender site and three events at the receiver site. Note that the data frames are shown by tilted boxes; the height of the box defines the transmission time difference between the first bit and the last bit in the frame.

Figure 11.7 Flow diagram for Example 11.1

GJ
I I

Sender

Receiver

[i""1

Request Request

~r=am:-e

~ratne
:

I

---------1 . ~Arri"al
~
:

I I

~Arr~

Request ~ame :

~Arrival

t
Time

t
Time

Stop-and-Wait Protocol
If data frames arrive at the receiver site faster than they can be processed, the frames must be stored until their use. Normally, the receiver does not have enough storage space, especially if it is receiving data from many sources. This may result in either the discarding of frames or denial of service. To prevent the receiver from becoming overwhelmed with frames,we somehow need to tell the sender to slow down. There must be feedback from the receiver to the sender. The protocol we discuss now is called the Stop-and-Wait Protocol because the sender sends one frame, stops until it receives confirmation from the receiver (okay to go ahead), and then sends the next frame. We still have unidirectional communication for data frames, but auxiliary ACK frames (simple tokens of acknowledgment) travel from the other direction. We add flow control to our previous protocol.

Design
Figure 11.8 illustrates the mechanism. Comparing this figure with Figure 11.6, we can see the traffic on the forward channel (from sender to receiver) and the reverse channel. At any time, there is either one data frame on the forward channel or one ACK frame on the reverse channel. We therefore need a half-duplex link.

Algorithms
Algorithm 11.3 is for the sender site.

316

CHAPTER 11

DATA LINK CONTROL

Figure 11.8 Design of Stop-and- Wait Protocol
Sender Network Gettata Receiver Deliver data

T
Data link:

.I

Network

T R I. Physical ecelve Send
frame

.

Data link

I
I

~ R ecelVe I.
frame Data frame
~~

frame

Send Physical frame

,T

I

I
~DACKframe

Repeat forever

Algorithm 11.3

Sender-site algorithm for Stop-and- Wait Protocol

1 Iwhile (true) 2 canS end = true

IIRepeat forever IIAllow the first frame to go

3 4
5 6

{

WaitForEvent()i II Sleep until an event occurs if (Event (RequestToSend) AND canSend} {

7 8 9

GetDataO i MakeFrame(); SendFrame()i

10
11
}

canSend

= false;

I/Send the data frame
I/cannot send until ACK arrives

12 WaitForEvent()i II Sleep until an event occurs 13 if (Event (ArrivalNotification) /1 An ACK has arrived { 14 15 ReceiveFrame(); I/Receive the ACK £r~e 16 canSend ~ true; 17 } 18 }

Analysis Here two events can occur: a request from the network layer or an arrival notification from the physical layer. The responses to these events must alternate. In other words, after a frame is sent, the algorithm must ignore another network layer request until that frame is

SECTION 1I.4

NOISELESS CHANNELS

317

acknowledged. We know that two arrival events cannot happen one after another because the channel is error-free and does not duplicate the frames. The requests from the network layer, however, may happen one after another without an arrival event in between. We need somehow to prevent the immediate sending of the data frame. Although there are several methods, we have used a simple canSend variable that can either be true or false. When a frame is sent, the variable is set to false to indicate that a new network request cannot be sent until canSend is true. When an ACK is received, canSend is set to true to allow the sending of the next frame.

Algorithm 11.4 shows the procedure at the receiver site. Algorithm 11.4

Receiver-site algorithm for Stop-and- Wait Protocol

1 while (true) IIRepeat forever 2 { 3 WaitForEvent(); II Sleep until an event occurf 4 if(Event(ArrivalNotification)} IIData frame arrives 5 6 7 8
{

9 10
11 }

ReceiveFrame(}; ExtractData(}i Deliver(data}; SendFrame();
}

/IDeliver data to network layex IISend an ACK frame

This is very similar to Algorithm 11.2 with one exception. After the data frame arrives, the receiver sends an ACK frame (line 9) to acknowledge the receipt and allow the sender to send the next frame.

Analysis

Example 11.2
Figure 11.9 shows an example of communication using this protocol. It is still very simple. The sender sends one frame and waits for feedback from the receiver. When the ACK arrives, the sender sends the next frame. Note that sending two frames in the protocol involves the sender in four events and the receiver in two events.

Figure 11.9 Flow diagramfor Example 1I.2

INA]
Request

Sender

Receiver

rIJ
Arrival :
I

Frame

Arrival

ReqUest~~Arrival :
I I

1.

AC'i..


Arrival'

t
Time

Time

t

1

I

318

CHAPTER 11

DATA LINK CONTROL

11.5

NOISY CHANNELS

Although the Stop-and-Wait Protocol gives us an idea of how to add flow control to its predecessor, noiseless channels are nonexistent. We can ignore the error (as we sometimes do), or we need to add error control to our protocols. We discuss three protocols in this section that use error control.

Stop-and-Wait Automatic Repeat Request
Our first protocol, called the Stop-and-Wait Automatic Repeat Request (Stop-andWait ARQ), adds a simple error control mechanism to the Stop-and-Wait Protocol. Let us see how this protocol detects and corrects errors. To detect and correct corrupted frames, we need to add redundancy bits to our data frame (see Chapter 10). When the frame arrives at the receiver site, it is checked and if it is corrupted, it is silently discarded. The detection of errors in this protocol is manifested by the silence of the receiver. Lost frames are more difficult to handle than corrupted ones. In our previous protocols, there was no way to identify a frame. The received frame could be the correct one, or a duplicate, or a frame out of order. The solution is to number the frames. When the receiver receives a data frame that is out of order, this means that frames were either lost or duplicated. The comlpted and lost frames need to be resent in this protocol. If the receiver does not respond when there is an error, how can the sender know which frame to resend? To remedy this problem, the sender keeps a copy of the sent frame. At the same time, it starts a timer. If the timer expires and there is no ACK for the sent frame, the frame is resent, the copy is held, and the timer is restarted. Since the protocol uses the stop-and-wait mechanism, there is only one specific frame that needs an ACK even though several copies of the same frame can be in the network.

Error correction in Stop-and-Wait ARQ is done by keeping a copy of the sent frame and retransmitting of the frame when the timer expires.

Since an ACK frame can also be corrupted and lost, it too needs redundancy bits and a sequence number. The ACK frame for this protocol has a sequence number field. In this protocol, the sender simply discards a corrupted ACK frame or ignores an out-of-order one.

Sequence Numbers
As we discussed, the protocol specifies that frames need to be numbered. This is done by using sequence numbers. A field is added to the data frame to hold the sequence number of that frame. One important consideration is the range of the sequence numbers. Since we want to minimize the frame size, we look for the smallest range that provides unambiguous

SECTION 11.5

NOISY CHANNELS

319

communication. The sequence numbers of course can wrap around. For example, if we decide that the field is m bits long, the sequence numbers start from 0, go to 2m - 1, and then are repeated. Let us reason out the range of sequence numbers we need. Assume we have used x as a sequence number; we only need to use x + 1 after that. There is no need for x + 2. To show this, assume that the sender has sent the frame numbered x. Three things can happen. 1. The frame arrives safe and sound at the receiver site; the receiver sends an acknowledgment. The acknowledgment arrives at the sender site, causing the sender to send the next frame numbered x + 1. 2. The frame arrives safe and sound at the receiver site; the receiver sends an acknowledgment, but the acknowledgment is corrupted or lost. The sender resends the frame (numbered x) after the time-out. Note that the frame here is a duplicate. The receiver can recognize this fact because it expects frame x + I but frame x was received. 3. The frame is corrupted or never arrives at the receiver site; the sender resends the frame (numbered x) after the time-out. We can see that there is a need for sequence numbers x and x + I because the receiver needs to distinguish between case 1 and case 2. But there is no need for a frame to be numbered x + 2. In case 1, the frame can be numbered x again because frames x and x + 1 are acknowledged and there is no ambiguity at either site. In cases 2 and 3, the new frame is x + I, not x + 2. If only x and x + 1 are needed, we can let x = 0 and x + I == 1. This means that the sequence is 0, I, 0, I, 0, and so on. Is this pattern familiar? This is modulo-2 arithmetic as we saw in Chapter 10. In Stop-and-Wait ARQ~ we use sequence numbers to number the frames. The sequence numbers are based on modul0-2 arithmetic.

Acknowledgment Numbers
Since the sequence numbers must be suitable for both data frames and ACK frames, we use this convention: The acknowledgment numbers always announce the sequence number of the next frame expected by the receiver. For example, if frame 0 has arrived safe and sound, the receiver sends an ACK frame with acknowledgment 1 (meaning frame 1 is expected next). If frame 1 has arrived safe and sound, the receiver sends an ACK frame with acknowledgment 0 (meaning frame 0 is expected). In Stop-and-WaitARQ~the acknowledgment number always announces in modul0-2 arithmetic the sequence number of the next frame expected.

Design
Figure 11.10 shows the design of the Stop-and-Wait ARQ Protocol. The sending device keeps a copy of the last frame transmitted until it receives an acknowledgment for that frame. A data frames uses a seqNo (sequence number); an ACK frame uses an ackNo (acknowledgment number). The sender has a control variable, which we call Sn (sender, next frame to send), that holds the sequence number for the next frame to be sent (0 or 1).

320

CHAPTER 11

DATA LINK CONTROL

Figure 11.10 Design of the Stop-and-WaitARQ Protocol
SII Next frame

' 0 ' 1 0 1 '10 ' · · · L _ __
~___

r---r---

J;

0

send
J

---r---,

Sender Network Get data

Data frame

I
T
Data link

'1*
seqNo

*"

-

ACKframe ackNo

rr-

Receiver Deliver data

...
I

Network

T R I. Physical ecelve Send frame frame



Data link

I
I

...
R ecelve I. frame
!
liM
~ ~~

I
Send frame

T

Physical

I

Event:

I
-

Request from network layer

I
.-

Repeat forever
.
,.C;
~-

-

t
,

I

~-

..

;._,,,:,,:,,'.:"

;~AIgmnhm for sender 'site

0
Time-out Event:

Repeat forever

I

."
~-.

.'

--

.AJ:go.rlt,bm for receiver Site
1..

..

..

1..
E
t: Notification from ven. physical layer

I

I

I

E t: Notification from ven. Ph ' allayer ySlC

I

I

I

The receiver has a control variable, which we call R n (receiver, next frame expected), that holds the number of the next frame expected. When a frame is sent, the value of Sn is incremented (modulo-2), which means if it is 0, it becomes 1 and vice versa. When a frame is received, the value of R n is incremented (modulo-2), which means if it is 0, it becomes 1 and vice versa. Three events can happen at the sender site; one event can happen at the receiver site. Variable Sn points to the slot that matches the sequence number of the frame that has been sent, but not acknowledged; R n points to the slot that matches the sequence number of the expected frame. Algorithms Algorithm 11.5 is for the sender site. Algorithm 11.5 1 2

n

Sender-site algorithm for Stop-and- Wait ARQ
II Frame 0 should be sent first II Allow the first request to go II Repeat forever II Sleep until an event occurs

anSend = true; 3 hile (true) 4 { WaitForEvent(); 5

=

0;

SECTION 11.5

NOISY CHANNELS

321

Algorithm 11.5
6 7
8 9

Sender-site algorithm for Stop-and- Wait ARQ (continued)

10 11 12 13 14

if (Event (RequestToSend) AND canSend) { Get Data () i / /The seqNo is Sn MakeFrame (Sn) ; //Keep copy StoreFrame(Sn); SendFrame(Sn) ; StartTimerO; Sn = Sn + 1; canSend false;

=

15
16 17 18 19 20 21 22 23 24

}

WaitForEvent(); if (Event (ArrivaINotification)
{

II Sleep II An ACK has arrived

ReceiveFrame(ackNo); if(not corrupted AND ackNo
{

80) / /Valid

//Receive the ACE fram ACK

Stoptimer{}; PurgeFrame(Sn_l); canSend true;

=

//Copy is not needed

25
26 27 28 29 30 31 32 33 }
}

}

if (Event (TimeOUt)
{

II The timer expired
//Resend a copy check

StartTimer(); ResendFrame(Sn_l);
}

We first notice the presence of Sn' the sequence number of the next frame to be sent. This variable is initialized once (line 1), but it is incremented every time a frame is sent (line 13) in preparation for the next frame. However, since this is modulo-2 arithmetic, the sequence numbers are 0, 1,0, 1, and so on. Note that the processes in the first event (SendFrame, StoreFrame, and PurgeFrame) use an Sn defining the frame sent out. We need at least one buffer to hold this frame until we are sure that it is received safe and sound. Line 10 shows that before the frame is sent, it is stored. The copy is used for resending a corrupt or lost frame. We are still using the canSend variable to prevent the network layer from making a request before the previous frame is received safe and sound. If the frame is not corrupted and the ackNo of the ACK frame matches the sequence number of the next frame to send, we stop the timer and purge the copy of the data frame we saved. Otherwise, we just ignore this event and wait for the next event to happen. After each frame is sent, a timer is started. When the timer expires (line 28), the frame is resent and the timer is restarted.

Analysis

Algorithm 11.6 shows the procedure at the receiver site. Algorithm 11.6 Receiver-site algorithm for Stop-and-Wait ARQ Protocol 1
= 0;

II Frame 0 expected to arrive firs II Sleep until an event occurs

2 hile (true) 3 { 4 WaitForEvent();

322

CHAPTER 11

DATA LINK CONTROL

Algorithm 11.6 Receiver-site algorithm for Stop-and- Wait ARQ Protocol (continued) 5 6 7 8
9

if(Event(Arriva1Notification»
{

//Data frame arrives

10 11 12 13 14 15 16 } 17 18 }

ReceiveFrame()i if(corrupted(frame»i sleep () i if (seqNo ;;;;:;;;; Rn) {

//Valid data frame

ExtractData(); De1iverData()i Ru ;;;; Ru + 1;
}

//Deliver data

SendFrame (Rn) ;

//Send an ACK

Analysis This is noticeably different from Algorithm 11.4. First, all arrived data frames that are corrupted are ignored. If the seqNo of the frame is the one that is expected (R n ), the frame is accepted, the data are delivered to the network layer, and the value of R n is incremented. However, there is one subtle point here. Even if the sequence number of the data frame does not match the next frame expected, an ACK is sent to the sender. This ACK, however, just reconfirms the previous ACK instead of confirming the frame received. This is done because the receiver assumes that the previous ACK might have been lost; the receiver is sending a duplicate frame. The resent ACK may solve the problem before the time-out does it.

Example 11.3
Figure 11.11 shows an example of Stop-and-Wait ARQ. Frame a is sent and acknowledged. Frame 1 is lost and resent after the time-out. The resent frame 1 is acknowledged and the timer stops. Frame a is sent and acknowledged, but the acknowledgment is lost. The sender has no idea if the frame or the acknowledgment is lost, so after the time-out, it resends frame 0, which is acknowledged.

Efficiency
The Stop-and-WaitARQ discussed in the previous section is very inefficient if our channel is thick and long. By thick, we mean that our channel has a large bandwidth; by long, we mean the round-trip delay is long. The product of these two is called the bandwidthdelay product, as we discussed in Chapter 3. We can think of the channel as a pipe. The bandwidth-delay product then is the volume of the pipe in bits. The pipe is always there. If we do not use it, we are inefficient. The bandwidth-delay product is a measure of the number of bits we can send out of our system while waiting for news from the receiver.

Example 11.4
Assume that, in a Stop-and-Wait ARQ system, the bandwidth of the line is 1 Mbps, and 1 bit takes 20 ms to make a round trip. What is the bandwidth-delay product? If the system data frames are 1000 bits in length, what is the utilization percentage of the link?

Solution
The bandwidth-delay product is

SECTION 11.5

NOISY CHANNELS

323

Figure 11.11 Flow diagram for Example 11.3
Sender Receiver

Start

cp

Sn
Request

@rU9I(~qn~

m
I I
I

Stop

l
5n
Request

ACK 1]

f9"1iJ-9J]~3iff~
f9"rtr9n_:_qff~
5n Rn

Time-out restart

Time-out

:~~[nQIrIqUJ Arrival

Stop Start It

~9_ET9Ihql!J Arrival
Time-out It restart

Rn

Time-out :-6 !._l£J__'_01"1-' f ~ _ i __ ,__ ~ i

+
5"

1

1 _ _ 1_ _

~o:-(:-o+o~-(: Arrival :_J...!.1_!.._.!

Rn

Stop

---------1

Discard, duplicate

1
1

t
Time

The system can send 20,000 bits during the time it takes for the data to go from the sender to the receiver and then back again. However, the system sends only 1000 bits. We can say that the link utilization is only 1000/20,000, or 5 percent. For this reason, for a link with a high bandwidth or long delay, the use of Stop-and-Wait ARQ wastes the capacity of the link.

Example 11.5
What is the utilization percentage of the link in Example 11.4 if we have a protocol that can send up to 15 frames before stopping and worrying about the acknowledgments?

Solution
The bandwidth-delay product is still 20,000 bits. The system can send up to 15 frames or 15,000 bits during a round trip. This means the utilization is 15,000/20,000, or 75 percent. Of course, if there are damaged frames, the utilization percentage is much less because frames have to be resent.

Pipelining
In networking and in other areas, a task is often begun before the previous task has ended. This is known as pipelining. There is no pipelining in Stop-and-Wait ARQ because we need to wait for a frame to reach the destination and be acknowledged before the next frame can be sent. However, pipelining does apply to our next two protocols because

324

CHAPTER 11

DATA LINK CONTROL

several frames can be sent before we receive news about the previous frames. Pipelining improves the efficiency of the transmission if the number of bits in transition is large with respect to the bandwidth-delay product.

Go-Back-N Automatic Repeat Request
To improve the efficiency of transmission (filling the pipe), multiple frames must be in transition while waiting for acknowledgment. In other words, we need to let more than one frame be outstanding to keep the channel busy while the sender is waiting for acknowledgment. In this section, we discuss one protocol that can achieve this goal; in the next section, we discuss a second. The first is called Go-Back-N Automatic Repeat Request (the rationale for the name will become clear later). In this protocol we can send several frames before receiving acknowledgments; we keep a copy of these frames until the acknowledgments arrive.

Sequence Numbers
Frames from a sending station are numbered sequentially. However, because we need to include the sequence number of each frame in the header, we need to set a limit. If the header of the frame allows m bits for the sequence number, the sequence numbers range from 0 to 2 m - 1. For example, if m is 4, the only sequence numbers are 0 through 15 inclusive. However, we can repeat the sequence. So the sequence numbers are 0, 1,2,3,4,5,6, 7,8,9, 10, 11, 12, 13, 14, 15,0, 1,2,3,4,5,6,7,8,9,10, 11, ...

In other words, the sequence numbers are modulo-2 m .
In the Go-Back-N Protocol, the sequence numbers are modulo 1!", where m is the size of the sequence number field in bits.

Sliding Window
In this protocol (and the next), the sliding window is an abstract concept that defines the range of sequence numbers that is the concern of the sender and receiver. In other words, the sender and receiver need to deal with only part of the possible sequence numbers. The range which is the concern of the sender is called the send sliding window; the range that is the concern of the receiver is called the receive sliding window. We discuss both here. The send window is an imaginary box covering the sequence numbers of the data frames which can be in transit. In each window position, some of these sequence numbers define the frames that have been sent; others define those that can be sent. The maximum size of the window is 2m - 1 for reasons that we discuss later. In this chapter, we let the size be fixed and set to the maximum value, but we will see in future chapters that some protocols may have a variable window size. Figure 11.12 shows a sliding window of size 15 (m = 4). The window at any time divides the possible sequence numbers into four regions. The first region, from the far left to the left wall of the window, defines the sequence

SECTION 11.5

NOISY CHANNELS

325

Figure 11.12

Send window for Go-Back-N ARQ

Sf Send window, ~'~d;"g

'"m,
15

:)Xf)!~r(5~~Z;!
Frames already acknowledged

3

14

!6
Frames that can be sent, but not received from upper layer Frames that cannot be sent

Frames sent, but not acknowledged (outstanding)

Send window, size SSilC '" 2m - 1

a. Send window before sliding

5"

---w:±J:m:w:L:l12 i 13 i 14 i IS i 0CIl
b. Send window after sliding

numbers belonging to frames that are already acknowledged. The sender does not worry about these frames and keeps no copies of them. The second region, colored in Figure 11.12a, defines the range of sequence numbers belonging to the frames that are sent and have an unknown status. The sender needs to wait to find out if these frames have been received or were lost. We call these outstanding frames. The third range, white in the figure, defines the range of sequence numbers for frames that can be sent; however, the corresponding data packets have not yet been received from the network layer. Finally, the fourth region defines sequence numbers that cannot be used until the window slides, as we see next. The window itself is an abstraction; three variables define its size and location at any time. We call these variables Sf(send window, the first outstanding frame), Sn (send window, the next frame to be sent), and Ssize (send window, size). The variable Sf defines the sequence number of the first (oldest) outstanding frame. The variable Sn holds the sequence number that will be assigned to the next frame to be sent. Finally, the variable Ssize defines the size of the window, which is fixed in our protocol. The send window is an abstract concept defining an imaginary box of size 2m ~ 1 with three variables: Sp Sm and Ssize'

Figure 11.12b shows how a send window can slide one or more slots to the right when an acknowledgment arrives from the other end. As we will see shortly, the acknowledgments in this protocol are cumulative, meaning that more than one frame can be acknowledged by an ACK frame. In Figure 11.12b, frames 0, I, and 2 are acknowledged, so the window has slid to the right three slots. Note that the value of Sf is 3 because frame 3 is now the first outstanding frame. The send window can slide one or more slots when a valid acknowledgment arrives.

326

CHAPTER 11

DATA LINK CONTROL

The receive window makes sure that the correct data frames are received and that the correct acknowledgments are sent. The size of the receive window is always I. The receiver is always looking for the arrival of a specific frame. Any frame arriving out of order is discarded and needs to be resent. Figure 11.13 shows the receive window.

Figure 11.13 Receive window for Go-Back-N ARQ
R II Receive window, next frame expected

, 13 l

"---,---r---,---,---,---~---,---,---,---,---,---,---,---,---,---,---,---,---,---, I .I

14

I J

IS

lI

0

lI

1

I 1

2 "' 4 , 3 I

J.

I

5

I l

6

I 1

7

I 1

8 .1 9 ,

1~

I

10 1I II 1, 12 1, 13 __

I .L

14 J, 15

I J

0

JI

1

~

I

Frames already received and acknowledged a. Receive window R II "- ~

Frames that cannot be received until the window slides

, 13

-, - - - ,- - -, - - -, I J

14

I J

15

~

I

0

I J.

1

-- ,-- - ,- - I 1

2 1' 3 ' 4

~

~
I

- - -, - -, - --, -- -, - - -, -" -, ---, - - -" - - -, - - - ,- --, - --, 5 .1.I 6 1' 7 .1I 8 ... 9 1I 10 1I I I 1I 12 1I 13 1 14 J.I 15 .JI 0 .II 1 , ' , ~

-

-- --

b. Window after sliding

The receive window is an abstract concept defining an imaginary box of size 1 with one single variable R n • The window slides when a correct frame has arrived; sliding occurs one slot at a time.

Note that we need only one variable Rn (receive window, next frame expected) to define this abstraction. The sequence numbers to the left of the window belong to the frames already received and acknowledged; the sequence numbers to the right of this window define the frames that cannot be received. Any received frame with a sequence number in these two regions is discarded. Only a frame with a sequence number matching the value of R n is accepted and acknowledged. The receive window also slides, but only one slot at a time. When a correct frame is received (and a frame is received only one at a time), the window slides. Timers

Although there can be a timer for each frame that is sent, in our protocol we use only one. The reason is that the timer for the first outstanding frame always expires first; we send all outstanding frames when this timer expires. Acknowledgment

The receiver sends a positive acknowledgment if a frame has arrived safe and sound and in order. If a frame is damaged or is received out of order, the receiver is silent and will discard all subsequent frames until it receives the one it is expecting. The silence of

SECTION 11.5

NOISY CHANNELS

327

the receiver causes the timer of the unacknowledged frame at the sender site to expire. This, in turn, causes the sender to go back and resend all frames, beginning with the one with the expired timer. The receiver does not have to acknowledge each frame received. It can send one cumulative acknowledgment for several frames. Resending a Frame When the timer expires, the sender resends all outstanding frames. For example, suppose the sender has already sent frame 6, but the timer for frame 3 expires. This means that frame 3 has not been acknowledged; the sender goes back and sends frames 3, 4,5, and 6 again. That is why the protocol is called Go-Back-N ARQ. Design Figure 11.14 shows the design for this protocol. As we can see, multiple frames can be in transit in the forward direction, and mUltiple acknowledgments in the reverse direction. The idea is similar to Stop-and-Wait ARQ; the difference is that the send

Figure 11.14 Design of Go-Back-N ARQ
S Next

!i~nd

I ! I
Sender Network Get data

i
Data frame ACKframe ackNo

,.
I

'1
seqNo

~

Receiver Deliver data

...
I

Network

Data link

Data link

...
Physical R frame

I
frame

T I, ecelve Send

...
,

!

I

i

&f&§

'¥§



ReceIve frame
w,
'#,M#
I:::l'aI

I,

Send Physical frame

I t

I

-+--~

~

I

Event:

Repeat forever

Repeat forever

Event:

328

CHAPTER 11

DATA LINK CONTROL

window allows us to have as many frames in transition as there are slots in the send window. Send Window Size

We can now show why the size of the send window must be less than 2 m . As an example, we choose m = 2, which means the size of the window can be 2 m - 1, or 3. Figure 11.15 compares a window size of 3 against a window size of 4. If the size of the window is 3 (less than 22) and all three acknowledgments are lost, the frame timer expires and all three frames are resent. The receiver is now expecting frame 3, not frame 0, so the duplicate frame is correctly discarded. On the other hand, if the size of the window is 4 (equal to 22 ) and all acknowledgments are lost, the sender will send a duplicate of frame 0. However, this time the window of the receiver expects to receive frame 0, so it accepts frame 0, not as a duplicate, but as the first frame in the next cycle. This is an error.

°

Figure 11.15

Window size for Go-Back-N ARQ

Sender

Receiver

Sender

Receiver

a. Window size < 2m

b. Window size = 2m

In Go-Back-N ARQ, the size of the send window must be less than r; the size of the receiver window is always 1.

Algorithms

Algorithm 11.7 shows the procedure for the sender in this protocol.

SECTION 11.5

NOISY CHANNELS

329

Algorithm 11.7
1

Go-Back-N sender algorithm

Sw = 2'" - 1;

2 Sf = 0; 3 Sn = OJ 4 5 ~hile (true)
6 7 8 9
{

//Repeat forever

WaitForEvent(); if(Event(RequestToSend»
{

//A packet to send

10
11

12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34

if (Sn-Sf >= Sw) Sleep () ; GetData() ; MakeFrame (Sn) ; StoreFrame (Sn) ; SendFrame(Sn) ; Sn = Sn + 1; if(timer not running) StartTimer{); }

II I f window is full

if{Event{ArrivalNotification»
{

IIACK arrives

Receive (ACK) ; if{corrupted{ACK» Sleep (); if{{ackNo>sf)&&{ackNO tI)' station C senses the medium and finds it idle because, at this time, the first bits from station B have not reached station C. Station C also sends a frame. The two signals collide and both frames are destroyed. Vulnerable Time The vulnerable time for CSMA is the propagation time Tp . This is the time needed for a signal to propagate from one end of the medium to the other. When a station sends a frame, and any other station tries to send a frame during this time, a collision will result. But if the first bit of the frame reaches the end of the medium, every station will already have heard the bit and will refrain from sending. Figure 12.9 shows the worst Figure 12.9 Vulnerable time in CSMA

Ill~~~~~~~
Frame propagation

B senses here

Vulnerable time ] propagation time

Time

Time

372

CHAPTER 12

MULTIPLE ACCESS

case. The leftmost station A sends a frame at time tl' which reaches the rightmost station D at time tl + Tp . The gray area shows the vulnerable area in time and space. Persistence Methods

What should a station do if the channel is busy? What should a station do if the channel is idle? Three methods have been devised to answer these questions: the I-persistent method, the nonpersistent method, and the p-persistent method. Figure 12.10 shows the behavior of three persistence methods when a station finds a channel busy.

Figure 12.10 Behavior of three persistence methods
Sense and transmit

~ Busy
3.

~I
Sense Sense

------~
Sense and transmit

:-Time

I-persistent

~C_=== Busy .===!:=J=::J.r------------~..
b. Nonpersistent
Probability outcome does not allow transmission.

~:.::::::::w;::::a::::it:::::,~------,w..:..::a::..:.it

't

I
Time

Transmit Time slot

~
I

Continuously sense

I

I I

I-I

Time slot

I I I .1 III
I

Time slot

.1.
I

I I I

- - - - - - - - - - - - - - - )~ Time ..

l

l

Busy

c. p-persistent

Figure 12.11 shows the flow diagrams for these methods.

I-Persistent The I-persistent method is simple and straightforward. In this method, after the station finds the line idle, it sends its frame immediately (with probability I). This method has the highest chance of collision because two or more stations may find the line idle and send their frames immediately. We will see in Chapter 13 that Ethernet uses this method. Nonpersistent In the nonpersistent method, a station that has a frame to send senses the line. If the line is idle, it sends immediately. If the line is not idle, it waits a

SECTION 12.1

RANDOM ACCESS

373

Figure 12.11 Flow diagram for three persistence methods

Station can transmit.

Station can transmit.

a. 1- persistent

b. Nonpersistent

Idle

Use back-off process as though collision occurred.

Station can transmit.

c. p-persistent

random amount of time and then senses the line again. The nonpersistent approach reduces the chance of collision because it is unlikely that two or more stations will wait the same amount of time and retry to send simultaneously. However, this method reduces the efficiency of the network because the medium remains idle when there may be stations with frames to send.

p-Persistent The p-persistent method is used if the channel has time slots with a slot duration equal to or greater than the maximum propagation time. The p-persistent approach combines the advantages of the other two strategies. It reduces the chance of collision and improves efficiency. In this method, after the station finds the line idle it follows these steps: 1. With probability p, the station sends its frame. 2. With probability q = 1 - p, the station waits for the beginning of the next time slot and checks the line again. a. If the line is idle, it goes to step 1. b. If the line is busy, it acts as though a collision has occurred and uses the backoff procedure.

Carrier Sense Multiple Access with Collision Detection (CSMA/CD) The CSMA method does not specify the procedure following a collision. Carrier sense multiple access with collision detection (CSMA/CD) augments the algorithm to handle the collision.

374

CHAPTER 12

MULTIPLEACCESS

In this method, a station monitors the medium after it sends a frame to see if the transmission was successful. If so, the station is finished. If, however, there is a collision, the frame is sent again. To better understand CSMA/CD, let us look at the first bits transmitted by the two stations involved in the collision. Although each station continues to send bits in the frame until it detects the collision, we show what happens as the first bits collide. In Figure 12.12, stations A and C are involved in the collision.

Figure 12.12 Collision of the first bit in CSMAlCD

tl

First bit of A

Transmission time [
1 4

~_----FFii;'rs;;tb;it~(Jf C
A's collision detection and abortion

C's

collris-io--n;;";;';;"':"':":~l

detection and Collision abortion occurs Time

Time

At time t 1, station A has executed its persistence procedure and starts sending the bits of its frame. At time t2, station C has not yet sensed the first bit sent by A. Station C executes its persistence procedure and starts sending the bits in its frame, which propagate both to the left and to the right. The collision occurs sometime after time t2' Station C detects a collision at time t3 when it receives the first bit of A's frame. Station C immediately (or after a short time, but we assume immediately) aborts transmission. Station A detects collision at time t4 when it receives the first bit of C's frame; it also immediately aborts transmission. Looking at the figure, we see that A transmits for the duration t4 - tl; C transmits for the duration t3 - t2' Later we show that, for the protocol to work, the length of any frame divided by the bit rate in this protocol must be more than either of these durations. At time t4, the transmission of A:s frame, though incomplete, is aborted; at time t 3 , the transmission of B's frame, though incomplete, is aborted. Now that we know the time durations for the two transmissions, we can show a more complete graph in Figure 12.13.

Minimum Frame Size
For CSMAlCD to work, we need a restriction on the frame size. Before sending the last bit of the frame, the sending station must detect a collision, if any, and abort the transmission. This is so because the station, once the entire frame is sent, does not keep a copy of the frame and does not monitor the line for collision detection. Therefore, the frame transmission time Tfr must be at least two times the maximum propagation time Tp . To understand the reason, let us think about the worst-case scenario. If the two stations involved in a collision are the maximum distance apart, the signal from the first takes time Tp to reach the second, and the effect of the collision takes another time Tp to reach the first. So the requirement is that the first station must still be transmitting after 2Tp .

SECTION 12.1

RANDOM ACCESS

375

Figure 12.13 Collision and abortion in CSMAlCD

Collision

tIme Transmission A detects collision and aborts

[1[ t4*~~
Time

~~;!~~i~~i~~~~I~~~~112 ~ransmission
13

]

tIme

C detects collision and aborts

Time

Example 12.5
A network using CSMA/CD has a bandwidth of 10 Mbps. If the maximum propagation time (including the delays in the devices and ignoring the time needed to send a jamming signal, as we see later) is 25.611S, what is the minimum size of the frame?

Solution
The frame transmission time is Tfr = 2 x Tp = 51.2 ~s. This means, in the worst case, a station needs to transmit for a period of 51.2 ~s to detect the collision. The minimum size of the frame is 10 Mbps x 51.2 !-ls = 512 bits or 64 bytes. This is actually the minimum size of the frame for Standard Ethernet, as we will see in Chapter 13.

Procedure
Now let us look at the flow diagram for CSMAlCD in Figure 12.14. It is similar to the one for the ALOHA protocol, but there are differences. The first difference is the addition of the persistence process. We need to sense the channel before we start sending the frame by using one of the persistence processes we discussed previously (nonpersistent, I-persistent, or p-persistent). The corresponding box can be replaced by one of the persistence processes shown in Figure 12.11. The second difference is the frame transmission. In ALOHA, we first transmit the entire frame and then wait for an acknowledgment. In CSMA/CD, transmission and collision detection is a continuous process. We do not send the entire frame and then look for a collision. The station transmits and receives continuously and simultaneously (using two different ports). We use a loop to show that transmission is a continuous process. We constantly monitor in order to detect one of two conditions: either transmission is finished or a collision is detected. Either event stops transmission. When we come out of the loop, if a collision has not been detected, it means that transmission is complete; the entire frame is transmitted. Otherwise, a collision has occurred. The third difference is the sending of a short jamming signal that enforces the collision in case other stations have not yet sensed the collision.

Energy Level
We can say that the level of energy in a channel can have three values: zero, normal, and abnormal. At the zero level, the channel is idle. At the normal level, a station has

376

CHAPTER 12

MULTIPLE ACCESS

Figure 12.14

Flow diagramfor the CSMAlCD
Station has a frame to send

K: Number of attempts Tp : Maximum propagation time Tfr : Average transmission time for a frame Tn: Back-off time

Apply one of the persistence methods (I-persistent, nonpersistent, or p-persistent) Eligihlc fur transmission

Wait TBtime (TB = R x r" or R X Tfr )

Choose a random number R between o and 2K -l

Kma \ is normally 15

K=K+I

Send a jamming signal

successfully captured the channel and is sending its frame. At the abnormal level, there is a collision and the level of the energy is twice the normal level. A station that has a frame to send or is sending a frame needs to monitor the energy level to determine if the channel is idle, busy, or in collision mode. Figure 12.15 shows the situation. Figure 12.15 Energy level during transmission, idleness, or collision Energy Collision

Frame transmission Idle

Frame transmission

Time

Throughput
The throughput of CSMAlCD is greater than that of pure or slotted ALOHA. The maximum throughput occurs at a different value of G and is based on the persistence method

SECTION 12.1

RANDOM ACCESS

377

and the value of p in the p-persistent approach. For I-persistent method the maximum throughput is around 50 percent when G = 1. For nonpersistent method, the maximum throughput can go up to 90 percent when G is between 3 and 8.

Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA) The basic idea behind CSMA/CD is that a station needs to be able to receive while transmitting to detect a collision. When there is no collision, the station receives one signal: its own signal. When there is a collision, the station receives two signals: its own signal and the signal transmitted by a second station. To distinguish between these two cases, the received signals in these two cases must be significantly different. In other words, the signal from the second station needs to add a significant amount of energy to the one created by the first station. In a wired network, the received signal has almost the same energy as the sent signal because either the length of the cable is short or there are repeaters that amplify the energy between the sender and the receiver. This means that in a collision, the detected energy almost doubles. However, in a wireless network, much of the sent energy is lost in transmission. The received signal has very little energy. Therefore, a collision may add only 5 to 10 percent additional energy. This is not useful for effective collision detection. We need to avoid collisions on wireless networks because they cannot be detected. Carrier sense multiple access with collision avoidance (CSMAlCA) was invented for this network. Collisions are avoided through the use of CSMAICA's three strategies: the interframe space, the contention window, and acknowledgments, as shown in Figure 12.16.

Figure 12.16 Timing in CSMAICA
-Found idle Size: l1Jillill1binary exponential

~ Busy
Interframe Space (IFS)

~~~u~,'i~'~~l. ~ .

~__-- - ,
Send frame

L-.

Contention window

-'HC==:J~ Time-out Time

First, collisions are avoided by deferring transmission even if the channel is found idle. When an idle channel is found, the station does not send immediately. It waits for a period of time called the interframe space or IFS. Even though the channel may appear idle when it is sensed, a distant station may have already started transmitting. The distant station's signal has not yet reached this station. The IFS time allows the front of the transmitted signal by the distant station to reach this station. If after the IFS time the channel is still idle, the station can send, but it still needs to wait a time equal to the contention time (described next). The IFS variable can also be used to prioritize

378

CHAPTER 12

MULTIPLE ACCESS

stations or frame types. For example, a station that is assigned a shorter IFS has a higher priority.

In CSMAlCA, the IFS can also be used to define the priority of a station or a frame.

Contention Window
The contention window is an amount of time divided into slots. A station that is ready to send chooses a random number of slots as its wait time. The number of slots in the window changes according to the binary exponential back-off strategy. This means that it is set to one slot the first time and then doubles each time the station cannot detect an idle channel after the IFS time. This is very similar to the p-persistent method except that a random outcome defines the number of slots taken by the waiting station. One interesting point about the contention window is that the station needs to sense the channel after each time slot. However, if the station finds the channel busy, it does not restart the process; it just stops the timer and restarts it when the channel is sensed as idle. This gives priority to the station with the longest waiting time.

In CSMAlCA, if the station finds the channel busy, it does not restart the timer of the contention window; it stops the timer and restarts it when the channel becomes idle.

Acknowledgment
With all these precautions, there still may be a collision resulting in destroyed data. In addition, the data may be corrupted during the transmission. The positive acknowledgment and the time-out timer can help guarantee that the receiver has received the frame.

Procedure
Figure 12.17 shows the procedure. Note that the channel needs to be sensed before and after the IFS. The channel also needs to be sensed during the contention time. For each time slot of the contention window, the channel is sensed. If it is found idle, the timer continues; if the channel is found busy, the timer is stopped and continues after the timer becomes idle again.

CSMAICA and Wireless Networks
CSMAICA was mostly intended for use in wireless networks. The procedure described above, however, is not sophisticated enough to handle some particular issues related to wireless networks, such as hidden terminals or exposed terminals. We will see how these issues are solved by augmenting the above protocol with hand-shaking features. The use of CSMNCA in wireless networks will be discussed in Chapter 14.

SECTION 12.2

CONTROLLED ACCESS

379

Figure 12.17 Flow diagramfor CSMAICA

Contention window size is ZK - 1.

Choose a random number R between o and ZK - I

After each slot, if idle, continue; if busy, halt and continue when idle.

No

K=K+I

12.2

CONTROLLED ACCESS

In controlled access, the stations consult one another to find which station has the right to send. A station cannot send unless it has been authorized by other stations. We discuss three popular controlled-access methods.

Reservation
In the reservation method, a station needs to make a reservation before sending data. Time is divided into intervals. In each interval, a reservation frame precedes the data frames sent in that interval.

380

CHAPTER 12

MULTIPLE ACCESS

If there are N stations in the system, there are exactly N reservation minislots in the reservation frame. Each minislot belongs to a station. When a station needs to send a data frame, it makes a reservation in its own minislot. The stations that have made reservations can send their data frames after the reservation frame. Figure 12.18 shows a situation with five stations and a five-minislot reservation frame. In the first interval, only stations 1, 3, and 4 have made reservations. In the second interval, only station 1 has made a reservation.

Figure 12.18 Reservation access method

B!m,.------,
1 2345
Reservation frame

1 2 345

1 2 345

r,....,--,----,---, , - - - - - - , r - - - - - - , ' - - . - _ - J '-T.L...J..,..J-rI-l

Polling
Polling works with topologies in which one device is designated as a primary station and the other devices are secondary stations. All data exchanges must be made through the primary device even when the ultimate destination is a secondary device. The primary device controls the link; the secondary devices follow its instructions. It is up to the primary device to determine which device is allowed to use the channel at a given time. The primary device, therefore, is always the initiator of a session (see Figure 12.19).

Figure 12.19
Primary

Select and poll functions in polling access method

Primary

SEL r-----'~
1-+----""1 ACK 1 - - - - - " " 1

Select

r------l

Data r----l~

Poll

1....------1 ACK 1------,

If the primary wants to receive data, it asks the secondaries if they have anything to send; this is called poll function. If the primary wants to send data, it tells the secondary to get ready to receive; this is called select function.

SECTION 12.2

CONTROLLED ACCESS

381

Select

The select function is used whenever the primary device has something to send. Remember that the primary controls the link. If the primary is neither sending nor receiving data, it knows the link is available. If it has something to send, the primary device sends it. What it does not know, however, is whether the target device is prepared to receive. So the primary must alert the secondary to the upcoming transmission and wait for an acknowledgment of the secondary's ready status. Before sending data, the primary creates and transmits a select (SEL) frame, one field of which includes the address of the intended secondary. Poll

The poll function is used by the primary device to solicit transmissions from the secondary devices. When the primary is ready to receive data, it must ask (poll) each device in turn if it has anything to send. When the first secondary is approached, it responds either with a NAK frame if it has nothing to send or with data (in the form of a data frame) if it does. If the response is negative (a NAK frame), then the primary polls the next secondary in the same manner until it finds one with data to send. When the response is positive (a data frame), the primary reads the frame and returns an acknowledgment (ACK frame), verifying its receipt.

Token Passing
In the token-passing method, the stations in a network are organized in a logical ring. In other words, for each station, there is a predecessor and a successor. The predecessor is the station which is logically before the station in the ring; the successor is the station which is after the station in the ring. The current station is the one that is accessing the channel now. The right to this access has been passed from the predecessor to the current station. The right will be passed to the successor when the current station has no more data to send. But how is the right to access the channel passed from one station to another? In this method, a special packet called a token circulates through the ring. The possession of the token gives the station the right to access the channel and send its data. When a station has some data to send, it waits until it receives the token from its predecessor. It then holds the token and sends its data. When the station has no more data to send, it releases the token, passing it to the next logical station in the ring. The station cannot send data until it receives the token again in the next round. In this process, when a station receives the token and has no data to send, it just passes the data to the next station. Token management is needed for this access method. Stations must be limited in the time they can have possession of the token. The token must be monitored to ensure it has not been lost or destroyed. For example, if a station that is holding the token fails, the token will disappear from the network. Another function of token management is to assign priorities to the stations and to the types of data being transmitted. And finally, token management is needed to make low-priority stations release the token to highpriority stations.

382

CHAPTER 12

MULTIPLE ACCESS

Logical Ring
In a token-passing network, stations do not have to be physically connected in a ring; the ring can be a logical one. Figure 12.20 show four different physical topologies that can create a logical ring.

Figure 12.20 Logical ring and physical topology in token-passing access method

a. Physical ring

b. Dual ring

1 1 1 1 1 1 1
1-

c. Bus ring

d. Star ring

In the physical ring topology, when a station sends the token to its successor, the token cannot be seen by other stations; the successor is the next one in line. This means that the token does not have to have the address of the next successor. The problem with this topology is that if one of the links-the medium between two adjacent stationsfails, the whole system fails. The dual ring topology uses a second (auxiliary) ring which operates in the reverse direction compared with the main ring. The second ring is for emergencies only (such as a spare tire for a car). If one of the links in the main ring fails, the system automatically combines the two rings to form a temporary ring. After the failed link is restored, the auxiliary ring becomes idle again. Note that for this topology to work, each station needs to have two transmitter ports and two receiver ports. The high-speed Token Ring networks called FDDI (Fiber Distributed Data Interface) and CDDI (Copper Distributed Data Interface) use this topology. In the bus ring topology, also called a token bus, the stations are connected to a single cable called a bus. They, however, make a logical ring, because each station knows the address of its successor (and also predecessor for token management purposes). When a station has finished sending its data, it releases the token and inserts the address of its successor in the token. Only the station with the address matching the destination address of the token gets the token to access the shared media. The Token Bus LAN, standardized by IEEE, uses this topology. In a star ring topology, the physical topology is a star. There is a hub, however, that acts as the connector. The wiring inside the hub makes the ring; the stations are connected to this ring through the two wire connections. This topology makes the network

SECTION 12.3

CHANNELIZATION

383

less prone to failure because if a link goes down, it will be bypassed by the hub and the rest of the stations can operate. Also adding and removing stations from the ring is easier. This topology is still used in the Token Ring LAN designed by IBM.

12.3

CHANNELIZATION

Channelization is a multiple-access method in which the available bandwidth of a link is shared in time, frequency, or through code, between different stations. In this section, we discuss three channelization protocols: FDMA, TDMA, and CDMA. We see the application of all these methods in Chapter 16 when we discuss cellular phone systems.

Frequency-Division Multiple Access (FDMA)
In frequency-division multiple access (FDMA), the available bandwidth is divided into frequency bands. Each station is allocated a band to send its data. In other words, each band is reserved for a specific station, and it belongs to the station all the time. Each station also uses a bandpass filter to confine the transmitter frequencies. To prevent station interferences, the allocated bands are separated from one another by small guard bands. Figure 12.21 shows the idea of FDMA. Figure 12.21

Frequency-division multiple access (FDMA)
Data Data

f~

~

••• t

Common channel

"I
Data

f~C
_ _ _ _ _ _ _ .J

---------------

_ _ _ _ _ _ _ .J

•••

-------f~ ========
_ _ _ _ _ _ _ .J

_ _ _ _ _ _ _ ..J

--------

•••

-.--,

--"---

-

t

t

Silent

Data

In FDMA, the available bandwidth of the common channel is divided into bands that are separated by guard bands.

384

CHAPTER 12

MULTIPLE ACCESS

FDMA specifies a predetermined frequency band for the entire period of communication. This means that stream data (a continuous flow of data that may not be packetized) can easily be used with FDMA. We will see in Chapter 16 how this feature can be used in cellular telephone systems. We need to emphasize that although FDMA and FDM conceptually seem similar, there are differences between them. FDM, as we saw in Chapter 6, is a physical layer technique that combines the loads from low-bandwidth channels and transmits them by using a high-bandwidth channel. The channels that are combined are low-pass. The multiplexer modulates the signals, combines them, and creates a bandpass signal. The bandwidth of each channel is shifted by the multiplexer. FDMA, on the other hand, is an access method in the data link layer. The data link layer in each station tells its physical layer to make a bandpass signal from the data passed to it. The signal must be created in the allocated band. There is no physical multiplexer at the physical layer. The signals created at each station are automatically bandpass-filtered. They are mixed when they are sent to the common channel.

Time-Division Multiple Access (TDMA)
In time-division multiple access (TDMA), the stations share the bandwidth of the channel in time. Each station is allocated a time slot during which it can send data. Each station transmits its data in is assigned time slot. Figure 12.22 shows the idea behind TDMA.

Figure 12.22 Time-division multiple access (TDMA)
Data Data

f

f

I:: : I···
~

-.;" -I,-II I,

-, ,
t

,

II I
I

II
'I

"

I···
I

I

r

Common

channel

Data

f
I

f
-I~-ll-­

, '
Silent

I

: •••

II IJ II

II II II

I I

Data

The main problem with TDMA lies in achieving synchronization between the different stations. Each station needs to know the beginning of its slot and the location of its slot. This may be difficult because of propagation delays introduced in the system if the stations are spread over a large area. To compensate for the delays, we can insert guard

SECTION 12.3

CHANNELIZATION

385

times. Synchronization is normally accomplished by having some synchronization bits (normally refened to as preamble bits) at the beginning of each slot. In TDMA, the bandwidth is just one channel that is timeshared between different stations.

We also need to emphasize that although TDMA and TDM conceptually seem the same, there are differences between them. TDM, as we saw in Chapter 6, is a physical layer technique that combines the data from slower channels and transmits them by using a faster channel. The process uses a physical multiplexer that interleaves data units from each channel. TDMA, on the other hand, is an access method in the data link layer. The data link layer in each station tells its physical layer to use the allocated time slot. There is no physical multiplexer at the physical layer.

Code-Division Multiple Access (CDMA)
Code-division multiple access (CDMA) was conceived several decades ago. Recent advances in electronic technology have finally made its implementation possible. CDMA differs from FDMA because only one channel occupies the entire bandwidth of the link. It differs from TDMA because all stations can send data simultaneously; there is no timesharing. In CDMA, one channel carries all transmissions simultaneously.

Analogy

Let us first give an analogy. CDMA simply means communication with different codes. For example, in a large room with many people, two people can talk in English if nobody else understands English. Another two people can talk in Chinese if they are the only ones who understand Chinese, and so on. In other words, the common channel, the space of the room in this case, can easily allow communication between several couples, but in different languages (codes). Idea

Let us assume we have four stations 1, 2, 3, and 4 connected to the same channel. The data from station 1 are d l , from station 2 are d 2 , and so on. The code assigned to the first station is cI, to the second is c2, and so on. We assume that the assigned codes have two properties. 1. If we multiply each code by another, we get O. 2. If we multiply each code by itself, we get 4 (the number of stations).

With these two properties in mind, let us see how the above four stations can send data using the same common channel, as shown in Figure 12.23. Station 1 mUltiplies (a special kind of multiplication, as we will see) its data by its code to get d l . Cl' Station 2 multiplies its data by its code to get d 2 . c2' And so on. The

386

CHAPTER 12

MULTIPLE ACCESS

Figure 12.23 Simple idea of communication with code

I d,' (',

+ d2 • c2 + d3 • ('3 + d4 • ('4
Data

I

Common channel

data that go on the channel are the sum of all these terms, as shown in the box. Any station that wants to receive data from one of the other three multiplies the data on the channel by the code of the sender. For example, suppose stations 1 and 2 are talking to each other. Station 2 wants to hear what station I is saying. It multiplies the data on the channel by cl' the code of station 1. Because (cl . cl) is 4, but (c2 . cI), (c3 . cI), and (c4 . cl) are all Os, station 2 divides the result by 4 to get the data from station 1. data

= (d} . Cj + dz . Cz + d 3 . C3 + d4 . c4) . Cl

=d
Chips

j •

Cl . Cj

+ dz . Cz . Cl + d 3 . C3

. Cl

+ d 4 . C4' CI

=4 X d 1

CDMA is based on coding theory. Each station is assigned a code, which is a sequence of numbers called chips, as shown in Figure 12.24. The codes are for the previous example.

Figure 12.24 Chip sequences

I

[+1 +1 +1 +11

I

1[+1 -1 +1 -I)

II

C3 [+1 +\ -I - 11

II

[+\ -1 -1 +IJ

I

Later in this chapter we show how we chose these sequences. For now, we need to know that we did not choose the sequences randomly; they were carefully selected. They are called orthogonal sequences and have the following properties: 1. Each sequence is made of N elements, where N is the number of stations.

SECTION 12.3

CHANNELIZATION

387

2. If we multiply a sequence by a number, every element in the sequence is multiplied by that element. This is called multiplication of a sequence by a scalar. For example, 2. [+1 +1-1-1]=[+2+2-2-2]

3. If we multiply two equal sequences, element by element, and add the results, we get N, where N is the number of elements in the each sequence. This is called the inner product of two equal sequences. For example, [+1 +1-1

-n· [+1 +1 -1 -1] = 1 + 1 + 1 + 1 = 4

4. If we multiply two different sequences, element by element, and add the results, we get O. This is called inner product of two different sequences. For example, [+1 +1 -1 -1] • [+1 +1 +1 +1] = 1 + 1 - 1 - 1 = 0

5. Adding two sequences means adding the corresponding elements. The result is another sequence. For example, [+1+1-1-1]+[+1+1+1+1]=[+2+2 00]

Data Representation
We follow these rules for encoding: If a station needs to send a 0 bit, it encodes it as -1; if it needs to send a 1 bit, it encodes it as + 1. When a station is idle, it sends no signal, which is interpreted as a O. These are shown in Figure 12.25. Figure 12.25

Data representation in CDMA

I

Data bit 0

--.~ -I

I

I Data bit I

----1.~ +1

I!

Silence

----I.~ 0

I

Encoding and Decoding
As a simple example, we show how four stations share the link during a I-bit interval. The procedure can easily be repeated for additional intervals. We assume that stations 1 and 2 are sending a 0 bit and channel 4 is sending a 1 bit. Station 3 is silent. The data at the sender site are translated to -1, -1, 0, and + 1. Each station multiplies the corresponding number by its chip (its orthogonal sequence), which is unique for each station. The result is a new sequence which is sent to the channel. For simplicity, we assume that all stations send the resulting sequences at the same time. The sequence on the channel is the sum of all four sequences as defined before. Figure 12.26 shows the situation. Now imagine station 3, which we said is silent, is listening to station 2. Station 3 multiplies the total data on the channel by the code for station 2, which is [+ 1 -1 + 1 -1], to get [-1-1-3 +1]· [+1-1 +1-1] =-4/4 =-1 ...... bit 1

388

CHAPTER 12

MULTIPLE ACCESS

Figure 12.26 Sharing channel in CDMA
Bit a Bit a C2 1+1 -I +1 -1]

C1
1+1 +1 +1 +IJ
d 1 • c1 [-1 -I -I -I]

[-1 -1 -3 +1]

Common channel

Data

[+1 +1 -1 -11

c.-

C4 1+1 -I -1 +11

Silent

Bit 1

Signal Level The process can be better understood if we show the digital signal produced by each station and the data recovered at the destination (see Figure 12.27). The figure shows the corresponding signals for each station (using NRZ-L for simplicity) and the signal that is on the common channel.

Figure 12.27 Digital signal created by four stations in CDMA

BitO

~

1-1 -1 -I -I]
Time

BitO

~
~

1-1 +1 -I +1]
Time
[0 0 0 0]

Silent

Time

Bit I

~

1+1 -I -I +1]
Time

Data on the channel Time

Figure 12.28 shows how station 3 can detect the data sent by station 2 by using the code for station 2. The total data on the channel are multiplied (inner product operation) by the signal representing station 2 chip code to get a new signal. The station then integrates and adds the area under the signal, to get the value -4, which is divided by 4 and interpreted as bit O.

SECTION 12.3

CHANNELIZATION

389

Figure 12.28

Decoding of the composite signal for one in CDMA

Data on the channel Time

m

Station 2's code [+1 -I +1 -1] Time Inner product result Time

Summing the values Time

-4

~

-4/4

~

-I

~

BitO

Sequence Generation
To generate chip sequences, we use a Walsh table, which is a two-dimensional table with an equal number of rows and columns, as shown in Figure 12.29.

Figure 12.29

General rule and examples of creating Walsh tables

a. Two basic rules

WI = [+1

J
W4

+1 +1

+1 -1
+1
-1

+1 +1
-1 -1

+1

-1
-1

=
+1 +1

Wz

=

[+1 +1J +1 -1

+1

b. Generation of WI' W z, and W 4

In the Walsh table, each row is a sequence of chips. WI for a one-chip sequence has one row and one column. We can choose -lor +1 for the chip for this trivial table (we chose +1). According to Walsh, if we know the table for N sequences WN' we can create the table for 2N sequences W 2N, as shown in Figure 12.29. The WN with the overbar W N stands for the complement of WN' where each +1 is changed to -1 and vice versa. Figure 12.29 also shows how we can create W 2 and W4 from WI' After we select WI, W 2

390

CHAPTER 12

MULTIPLE ACCESS

can be made from four Wj 's, with the last one the complement of Wl' After W2 is generated, W4 can be made of four W2 's, with the last one the complement of W 2 . Of course, Ws is composed of four W4 's, and so on. Note that after WN is made, each station is assigned a chip corresponding to a row. Something we need to emphasize is that the number of sequences N needs to be a power of 2. In other words, we need to have N = 2m . The number of sequences in a Walsh table needs to beN = 2m .

Example 12.6
Find the chips for a network with a. Two stations b. Four stations

Solution
We can use the rows of W 2 and W4 in Figure 12.29: a. For a two-station network, we have [+ 1 + 1] and [+ 1 -1]. b. For a four-station network we have [+1 +1 +1 +1], [+1 -1 +1 -1], [+1 +1 -1 -1], and [+1-1-1 +1].

Example 12.7
What is the number of sequences if we have 90 stations in our network?

Solution
The number of sequences needs to be 2m . We need to choose m = 7 and N = 27 or 128. We can then use 90 of the sequences as the chips.

Example 12.8
Prove that a receiving station can get the data sent by a specific sender if it multiplies the entire data on the channel by the sender's chip code and then divides it by the number of stations.

Solution
Let us prove this for the first station, using our previous four-station example. We can say that the data on the channel D = Cd l . ("1 + d 2 . ("2 + d 3 . ("3 + d4 . ("4)' The receiver which wants to get the data sent by station I multiplies these data by ("I' D . ("1

= (d 1 • ("1 + d 2 . ("2 + d3 . ("3 + d4 . ("4) . ("1
+ d 2 . ("2 . ("1 + d 3 . ("3 . ("1 + d 4 . ("4 =d I X N + d 2 X 0 + d 3 X 0 + d 4 X 0 =d l xN = d 1 . ("1
. ("1 . ("1

When we divide the result by N, we get d I'

12.4

RECOMMENDED READING

For more details about subjects discussed in this chapter, we recommend the following books. The items in brackets [... J refer to the reference list at the end of the text.

SECTION 12.6

SUMMARY

391

Books
Multiple access is discussed in Chapter 4 of [Tan03], Chapter 16 of [Sta04], Chapter 6 of [GW04], and Chapter 8 of [For03]. More advanced materials can be found in [KMK04].

12.5

KEY TERMS
multiple access (MA) nonpersistent method orthogonal sequence polling p-persistent method primary station propagation time pure ALOHA random access reservation secondary station slotted ALOHA time-division multiple access (TDMA) token token passing vulnerable time Walsh table

I-persistent method ALOHA binary exponential backup carrier sense multiple access (CSMA) carrier sense multiple access with collision avoidance (CSMAlCA) carrier sense multiple access with collision detection (CSMAlCD) channelization code-division multiple access (CDMA) collision contention controlled access frequency-division multiple access (FDMA) inner product interframe space (IFS) jamming signal

12.6

SUMMARY

o
U

o o
o

We can consider the data link layer as two sublayers. The upper sublayer is responsible for data link control, and the lower sublayer is responsible for resolving access to the shared media. Many formal protocols have been devised to handle access to a shared link. We categorize them into three groups: random access protocols, controlled access protocols, and channelization protocols. In random access or contention methods, no station is superior to another station and none is assigned the control over another. ALOHA allows multiple access (MA) to the shared medium.There are potential collisions in this arrangement. When a station sends data, another station may attempt to do so at the same time. The data from the two stations collide and become garbled. To minimize the chance of collision and, therefore, increase the performance, the CSMA method was developed. The chance of collision can be reduced if a station

392

CHAPTER 12

MULTIPLE ACCESS

o
D

o
o o
D

o
D D

o

senses the medium before trying to use it. Carrier sense multiple access (CSMA) requires that each station first listen to the medium before sending. Three methods have been devised for carrier sensing: I-persistent, nonpersistent, and p-persistent. Carrier sense multiple access with collision detection (CSMA/CD) augments the CSMA algorithm to handle collision. In this method, a station monitors the medium after it sends a frame to see if the transmission was successful. If so, the station is finished. If, however, there is a collision, the frame is sent again. To avoid collisions on wireless networks, carrier sense multiple access with collision avoidance (CSMA/CA) was invented. Collisions are avoided through the use three strategies: the interframe space, the contention window, and acknowledgments. In controlled access, the stations consult one another to find which station has the right to send. A station cannot send unless it has been authorized by other stations. We discussed three popular controlled-access methods: reservation, polling, and token passing. In the reservation access method, a station needs to make a reservation before sending data. Time is divided into intervals. In each interval, a reservation frame precedes the data frames sent in that interval. In the polling method, all data exchanges must be made through the primary device even when the ultimate destination is a secondary device. The primary device controls the link; the secondary devices follow its instructions. In the token-passing method, the stations in a network are organized in a logical ring. Each station has a predecessor and a successor. A special packet called a token circulates through the ring. Channelization is a multiple-access method in which the available bandwidth of a link is shared in time, frequency, or through code, between different stations. We discussed three channelization protocols: FDMA, TDMA, and CDMA. In frequency-division multiple access (FDMA), the available bandwidth is divided into frequency bands. Each station is allocated a band to send its data. In other words, each band is reserved for a specific station, and it belongs to the station all the time. In time-division multiple access (TDMA), the stations share the bandwidth of the channel in time. Each station is allocated a time slot during which it can send data. Each station transmits its data in its assigned time slot. In code-division multiple access (CDMA), the stations use different codes to achieve multiple access. CDMA is based on coding theory and uses sequences of numbers called chips. The sequences are generated using orthogonal codes such the Walsh tables.

12.7

PRACTICE SET

Review Questions
1. List three categories of multiple access protocols discussed in this chapter. 2. Define random access and list three protocols in this category.

SECTION 12.7

PRACTICE SET

393

3. Define controlled access and list three protocols in this category. 4. Define channelization and list three protocols in this category. 5. Explain why collision is an issue in a random access protocol but not in controlled access or channelizing protocols. 6. Compare and contrast a random access protocol with a controlled access protocol. 7. Compare and contrast a random access protocol with a channelizing protocol. 8. Compare and contrast a controlled access protocol with a channelizing protocol. 9. Do we need a multiple access protocol when we use the 1ocalloop of the telephone company to access the Internet? Why? 10. Do we need a multiple access protocol when we use one CATV channel to access the Internet? Why?

Exercises
11. We have a pure ALOHA network with 100 stations. If Tfr = 1 }.is, what is the number of frames/s each station can send to achieve the maximum efficiency. 12. Repeat Exercise 11 for slotted ALOHA. 13. One hundred stations on a pure ALOHA network share a l-Mbps channel. If frames are 1000 bits long, find the throughput if each station is sending 10 frames per second. 14. Repeat Exercise 13 for slotted ALOHA.

15. In a CDMAlCD network with a data rate of 10 Mbps, the minimum frame size is found to be 512 bits for the correct operation of the collision detection process. What should be the minimum frame size if we increase the data rate to 100 Mbps? To 1 Gbps? To 10 Gbps? 16. In a CDMAlCD network with a data rate of 10 Mbps, the maximum distance between any station pair is found to be 2500 m for the correct operation of the collision detection process. What should be the maximum distance if we increase the data rate to 100 Mbps? To 1 Gbps? To 10 Gbps? 17. In Figure 12.12, the data rate is 10 Mbps, the distance between station A and C is 2000 m, and the propagation speed is 2 x 10 8 mls. Station A starts sending a long frame at time t1 = 0; station C starts sending a long frame at time t2 = 3 }.is. The size of the frame is long enough to guarantee the detection of collision by both stations. Find: a. The time when station C hears the collision (t3)' b. The time when station A hears the collision (t4)' c. The number of bits station A has sent before detecting the collision. d. The number of bits station C has sent before detecting the collision. 18. Repeat Exercise 17 if the data rate is 100 Mbps. 19. Calculate the Walsh table Ws from W4 in Figure 12.29. 20. Recreate the W2 and W4 tables in Figure 12.29 using WI = [-1]. Compare the recreated tables with the ones in Figure 12.29. 21. Prove the third and fourth orthogonal properties of Walsh chips for W4 in Figure 12.29.

394

CHAPTER 12

MULTIPLE ACCESS

22. Prove the third and fourth orthogonal properties of Walsh chips for W4 recreated in Exercise 20. 23. Repeat the scenario depicted in Figures 12.27 to 12.28 if both stations 1 and 3 are silent. 24. A network with one primary and four secondary stations uses polling. The size of a data frame is 1000 bytes. The size of the poll, ACK, and NAK frames are 32 bytes each. Each station has 5 frames to send. How many total bytes are exchanged if there is no limitation on the number of frames a station can send in response to a poll? 25. Repeat Exercise 24 if each station can send only one frame in response to a poll.

Research Activities
26. Can you explain why the vulnerable time in ALOHA depends on Tpf' but in CSMA depends on Tp ? 27. In analyzing ALOHA, we use only one parameter, time; in analyzing CSMA, we use two parameters, space and time. Can you explain the reason?

CHAPTER 13

Wired LANs: Ethernet

In Chapter 1, we learned that a local area network (LAN) is a computer network that is designed for a limited geographic area such as a building or a campus. Although a LAN can be used as an isolated network to connect computers in an organization for the sole purpose of sharing resources, most LANs today are also linked to a wide area network (WAN) or the Internet. The LAN market has seen several technologies such as Ethernet, Token Ring, Token Bus, FDDI, and ATM LAN. Some of these technologies survived for a while, but Ethernet is by far the dominant technology. In this chapter, we first briefly discuss the IEEE Standard Project 802, designed to regulate the manufacturing and interconnectivity between different LANs. We then concentrate on the Ethernet LANs. Although Ethernet has gone through a four-generation evolution during the last few decades, the main concept has remained. Ethernet has changed to meet the market needs and to make use of the new technologies.

13.1

IEEE STANDARDS

In 1985, the Computer Society of the IEEE started a project, called Project 802, to set standards to enable intercommunication among equipment from a variety of manufacturers. Project 802 does not seek to replace any part of the OSI or the Internet model. Instead, it is a way of specifying functions of the physical layer and the data link layer of major LAN protocols. The standard was adopted by the American National Standards Institute (ANSI). In 1987, the International Organization for Standardization (ISO) also approved it as an international standard under the designation ISO 8802. The relationship of the 802 Standard to the traditional OSI model is shown in Figure 13.1. The IEEE has subdivided the data link layer into two sublayers: logical link control (LLC) and media access control (MAC). IEEE has also created several physicallayer standards for different LAN protocols.

395

396

CHAPTER 13

WIRED LANs: ETHERNET

Figure 13.1 IEEE standardfor LANs
LLC: Logical link control MAC: Media access control

Upper layers

Upper layers .'
,:""

Data link layer Ethernet MAC Ethernet physical layers (several) Token Ring MAC Token Bus MAC Token Bus physical layer

...

Physical layer

Token Ring physical layer

OSl or Internet model

IEEE Standard

Data Link Layer
As we mentioned before, the data link layer in the IEEE standard is divided into two sublayers: LLC and MAC.

Logical Link Control (LLC)
In Chapter II, we discussed data link control. We said that data link control handles framing, flow control, and error control. In IEEE Project 802, flow control, error control, and part of the framing duties are collected into one sublayer called the logical link control. Framing is handled in both the LLC sublayer and the MAC sublayer. The LLC provides one single data link control protocol for all IEEE LANs. In this way, the LLC is different from the media access control sublayer, which provides different protocols for different LANs. A single LLC protocol can provide interconnectivity between different LANs because it makes the MAC sublayer transparent. Figure 13.1 shows one single LLC protocol serving several MAC protocols. Framing LLC defines a protocol data unit (PDU) that is somewhat similar to that of HDLC. The header contains a control field like the one in HDLC; this field is used for flow and error control. The two other header fields define the upper-layer protocol at the source and destination that uses LLC. These fields are called the destination service access point (DSAP) and the source service access point (SSAP). The other fields defined in a typical data link control protocol such as HDLC are moved to the MAC sublayer. In other words, a frame defined in HDLC is divided into a PDU at the LLC sublayer and a frame at the MAC sublayer, as shown in Figure 13.2. Need for LLC The purpose of the LLC is to provide flow and error control for the upper-layer protocols that actually demand these services. For example, if a LAN or several LANs are used in an isolated system, LLC may be needed to provide flow and error control for the application layer protocols. However, most upper-layer protocols

SECTION 13.2

STANDARD ETHERNET

397

Figure 13.2 HDLC frame compared with LLC and MAC frames
DSAP' Destination service access point SSAP: Source service acces, point co

LLC PDD D S A p FCS MAC
I I I I I

S S A p

Control

Upper-layer data

Address Control

Upper-layer data

,
.. .. ..

HDLC frame

~I

.. ...

I_h............. :...... eade r f...

-

MAC aluad

. p_y

.......·... .

H

I I I I

MAC frame

such as IP (discussed in Chapter 20), do not use the services of LLC. For this reason, we end our discussion of LLC.

Media Access Control (MAC)
In Chapter 12, we discussed multiple access methods including random access, controlled access, and channelization. IEEE Project 802 has created a sublayer called media access control that defines the specific access method for each LAN. For example, it defines CSMA/CD as the media access method for Ethernet LANs and the tokenpassing method for Token Ring and Token Bus LANs. As we discussed in the previous section, part of the framing function is also handled by the MAC layer. In contrast to the LLC sublayer, the MAC sublayer contains a number of distinct modules; each defines the access method and the framing format specific to the corresponding LAN protocol.

Physical Layer
The physical layer is dependent on the implementation and type of physical media used. IEEE defines detailed specifications for each LAN implementation. For example, although there is only one MAC sublayer for Standard Ethernet, there is a different physical layer specifications for each Ethernet implementations as we will see later.

13.2

STANDARD ETHERNET

The original Ethernet was created in 1976 at Xerox's Palo Alto Research Center (PARC). Since then, it has gone through four generations: Standard Ethernet (lot Mbps), Fast Ethernet (100 Mbps), Gigabit Ethernet (l Gbps), and Ten-Gigabit Ethernet (l0 Gbps), as shown in Figure 13.3. We briefly discuss all these generations starting with the first, Standard (or traditional) Ethernet.

t Ethernet defined some I-Mbps protocols, but they did not survive.

398

CHAPTER 13

WIRED LANs: ETHERNET

Figure 13.3 Ethernet evolution through four generations

HI l\Ibps

100 Mbps

10

Gbp~

MAC Sublayer
In Standard Ethernet, the MAC sublayer governs the operation of the access method. It also frames data received from the upper layer and passes them to the physical layer. Frame Format

The Ethernet frame contains seven fields: preamble, SFD, DA, SA, length or type of protocol data unit (PDU), upper-layer data, and the CRe. Ethernet does not provide any mechanism for acknowledging received frames, making it what is known as an unreliable medium. Acknowledgments must be implemented at the higher layers. The format ofthe MAC frame is shown in Figure 13.4.

Figure 13.4 802.3 MAC frame
Pr~amble: 56

bits of alternating 1s and as.

SFD: Start frame delimiter, flag (10101011)
Data and padding

I.

7 bytes

1 byte. 1

6 bytes

6 bytes

Physical layer header

D Preamble. The first field of the 802.3 frame contains 7 bytes (56 bits) of alternating Os and Is that alerts the receiving system to the coming frame and enables it to synchronize its input timing. The pattern provides only an alert and a timing pulse. The 56-bit pattern allows the stations to miss some bits at the beginning of the frame. The preamble is actually added at the physical layer and is not (formally) part of the frame. D Start frame delimiter (SFD). The second field (l byte: 10101011) signals the beginning of the frame. The SFD warns the station or stations that this is the last chance for synchronization. The last 2 bits is 11 and alerts the receiver that the next field is the destination address.

SECTION 13.2

STANDARD ETHERNET

399

o
o
o

o

o

Destination address (DA). The DA field is 6 bytes and contains the physical address of the destination station or stations to receive the packet. We will discuss addressing shortly. Source address (SA). The SA field is also 6 bytes and contains the physical address of the sender of the packet. We will discuss addressing shortly. Length or type. This field is defined as a type field or length field. The original Ethernet used this field as the type field to define the upper-layer protocol using the MAC frame. The IEEE standard used it as the length field to define the number of bytes in the data field. Both uses are common today. Data. This field carries data encapsulated from the upper-layer protocols. It is a minimum of 46 and a maximum of 1500 bytes, as we will see later. CRC. The last field contains error detection information, in this case a CRC-32 (see Chapter 10).

Frame Length
Ethernet has imposed restrictions on both the minimum and maximum lengths of a frame, as shown in Figure 13.5.

Figure 13.5

Minimum and maximum lengths
Minimum payload length: 46 bytes

IDestination address 6 bytes Source address 6 bytes Length PDU 2 bytes

Maximum payload length: 1500 bytes

_I
CRC
4 bytes

Data and padding

Minimum frame length: 512 bits or 64 bytes MaXImum frame length. 12,144 bIts or 1518 bytes

The minimum length restriction is required for the correct operation of CSMAlCD as we will see shortly. An Ethernet frame needs to have a minimum length of 512 bits or 64 bytes. Part of this length is the header and the trailer. If we count 18 bytes of header and trailer (6 bytes of source address, 6 bytes of destination address, 2 bytes of length or type, and 4 bytes of CRC), then the minimum length of data from the upper layer is 64 - 18 = 46 bytes. If the upper-layer packet is less than 46 bytes, padding is added to make up the difference. The standard defines the maximum length of a frame (without preamble and SFD field) as 1518 bytes. If we subtract the 18 bytes of header and trailer, the maximum length of the payload is 1500 bytes. The maximum length restriction has two historical reasons. First, memory was very expensive when Ethernet was designed: a maximum length restriction helped to reduce the size of the buffer. Second, the maximum length restriction prevents one station from monopolizing the shared medium, blocking other stations that have data to send.

400

CHAPTER 13

WIRED LANs: ETHERNET

Frame length: Minimum: 64 bytes (512 bits) Maximum: 1518 bytes (12,144 bits)

Addressing Each station on an Ethernet network (such as a PC, workstation, or printer) has its own network interface card (NIC). The NIC fits inside the station and provides the station with a 6-byte physical address. As shown in Figure 13.6, the Ethernet address is 6 bytes (48 bits), nonnally written in hexadecimal notation, with a colon between the bytes.

Figure 13.6

Example of an Ethernet address in hexadecimal notation

06:01 :02:01:2C:4B
6 bytes

= 12 hex digits = 48 bits

Unicast, Multicast, and Broadcast Addresses A source address is always a unicast address-the frame comes from only one station. The destination address, however, can be unicast, multicast, or broadcast. Figure 13.7 shows how to distinguish a unicast address from a multicast address. If the least significant bit of the first byte in a destination address is 0, the address is unicast; otherwise, it is multicast.

Figure 13.7

Unicast and multicast addresses
Unicast: 0; multicast: 1
W" , .

;"' ~ I----- ...
¥~ ~~"
.&

Byte I

Byte 2

Byte 6

The least significant bit of the first byte defines the type of address. If the bit is 0, the address is unicast; otherwise, it is multicast.

A unicast destination address defines only one recipient; the relationship between the sender and the receiver is one-to-one. A multicast destination address defines a group of addresses; the relationship between the sender and the receivers is one-to-many. The broadcast address is a special case of the multicast address; the recipients are all the stations on the LAN. A broadcast destination address is forty-eight Is. The broadcast destination address is a special case of the multicast address in which all bits are Is.

SECTION 13.2

STANDARD ETHERNET

401

Example 13.1
Define the type of the following destination addresses:
a. 4A:30:10:21:1O:1A

b. 47:20:1B:2E:08:EE c. FF:FF:FF:FF:FF:FF

Solution To find the type of the address, we need to look at the second hexadecimal digit from the left. If it is even, the address is unicast. If it is odd, the address is multicast. If all digits are F's, the address is broadcast. Therefore, we have the following: a. This is a unicast address because A in binary is 1010 (even). b. This is a multicast address because 7 in binary is 0111 (odd). c. This is a broadcast address because all digits are F's. The way the addresses are sent out on line is different from the way they are written in hexadecimal notation. The transmission is left-to-right, byte by byte; however, for each byte, the least significant bit is sent first and the most significant bit is sent last. This means that the bit that defines an address as unicast or multicast arrives first at the receIver.

Example 13.2
Show how the address 47:20:1B:2E:08:EE is sent out on line. Solution The address is sent left-to-right, byte by byte; for each byte, it is sent right-to-Ieft, bit by bit, as shown below: ~

11100010 00000100 11011000 01110100 00010000 01110111

Access Method: CSMAICD
Standard Ethernet uses I-persistent CSMAlCD (see Chapter 12). Slot Time In an Ethernet network, the round-trip time required for a frame to travel from one end of a maximum-length network to the other plus the time needed to send the jam sequence is called the slot time. Slot time =round-trip time + time required to send the jam sequence The slot time in Ethernet is defined in bits. It is the time required for a station to send 512 bits. This means that the actual slot time depends on the data rate; for traditional 10-Mbps Ethernet it is 51.2 I1s. Slot Time and Collision The choice of a 512-bit slot time was not accidental. It was chosen to allow the proper functioning of CSMAlCD. To understand the situation, let us consider two cases. In the first case, we assume that the sender sends a minimum-size packet of 512 bits. Before the sender can send the entire packet out, the signal travels through the network

402

CHAPTER 13

WIRED LANs: ETHERNET

and reaches the end of the network. If there is another signal at the end of the network (worst case), a collision occurs. The sender has the opportunity to abort the sending of the frame and to send a j am sequence to inform other stations of the collision. The round-trip time plus the time required to send the jam sequence should be less than the time needed for the sender to send the minimum frame, 512 bits. The sender needs to be aware of the collision before it is too late, that is, before it has sent the entire frame. In the second case, the sender sends a frame larger than the minimum size (between 512 and 1518 bits). In this case, if the station has sent out the first 512 bits and has not heard a collision, it is guaranteed that collision will never occur during the transmission of this frame. The reason is that the signal will reach the end of the network in less than one-half the slot time. If all stations follow the CSMA/CD protocol, they have already sensed the existence of the signal (carrier) on the line and have refrained from sending. If they sent a signal on the line before one-half of the slot time expired, a collision has occurred and the sender has sensed the collision. In other words, collision can only occur during the first half of the slot time, and if it does, it can be sensed by the sender during the slot time. This means that after the sender sends the first 512 bits, it is guaranteed that collision will not occur during the transmission of this frame. The medium belongs to the sender, and no other station will use it. In other words, the sender needs to listen for a collision only during the time the first 512 bits are sent. Of course, all these assumptions are invalid if a station does not follow the CSMAlCD protocol. In this case, we do not have a collision, we have a corrupted station. Slot Time and Maximum Network Length There is a relationship between the slot time and the maximum length of the network (collision domain). It is dependent on the propagation speed of the signal in the particular medium. In most transmission media, the signal propagates at 2 x 108 rnls (two-thirds of the rate for propagation in air). For traditional Ethernet, we calculate MaxLength ::::: PropagationSpeedx SlotTime

2 8) X(5L2 X 10-6 (2)= 5120m MaxLength:::; (2x to

Of course, we need to consider the delay times in repeaters and interfaces, and the time required to send the jam sequence. These reduce the maximum-length of a traditional Ethernet network to 2500 m, just 48 percent of the theoretical calculation. MaxLength

=2500

ill

Physical Layer
The Standard Ethernet defines several physical layer implementations; four of the most common, are shown in Figure 13.8.

Encoding and Decoding
All standard implementations use digital signaling (baseband) at 10 Mbps. At the sender, data are converted to a digital signal using the Manchester scheme; at the receiver, the

SECTION 13.2

STANDARD ETHERNET

403

Figure 13.8

Categories ofStandard Ethernet

Standard Ethernet common implementations

Rus. thick coaxial

Bus, thin coaxial

Star,
UTP

Star, fiber

received signal is interpreted as Manchester and decoded into data. As we saw in Chapter 4, Manchester encoding is self-synchronous, providing a transition at each bit interval. Figure 13.9 shows the encoding scheme for Standard Ethernet. Figure 13.9 Encoding in a Standard Ethernet implementation 10 Mbps data 10 Mbps data

t
Manchester encoder Station

t
Manchester decoder

I
I

I

I

I

Twisted pairs or fibers

lOBase5: Thick Ethernet The first implementation is called 10BaseS, thick Ethernet, or Thicknet. The nickname derives from the size of the cable, which is roughly the size of a garden hose and too stiff to bend with your hands. lOBaseS was the first Ethernet specification to use a bus topology with an external transceiver (transmitter/receiver) connected via a tap to a thick coaxial cable. Figure 13.10 shows a schematic diagram of a lOBase5 implementation. Figure 13.10 IOBase5 implementation

10 Mbps

gOBf4l
Baseband (digital)

500 m Cable end

Transceiver cable maximum 50 m

1f;;=.~=.~===h·;;;;k==·====4"'="''''';;;;jI end Transceiver T IC coaXial cable maximum 500 m

Cable

404

CHAPTER 13

WIRED LANs: ETHERNET

The transceiver is responsible for transmitting, receiving, and detecting collisions. The transceiver is connected to the station via a transceiver cable that provides separate paths for sending and receiving. This means that collision can only happen in the coaxial cable. The maximum length of the coaxial cable must not exceed 500 m, otherwise, there is excessive degradation of the signal. If a length of more than 500 m is needed, up to five segments, each a maximum of SOO-meter, can be connected using repeaters. Repeaters will be discussed in Chapter 15.

10Base2: Thin Ethernet
The second implementation is called lOBase2, thin Ethernet, or Cheapernet. IOBase2 also uses a bus topology, but the cable is much thinner and more flexible. The cable can be bent to pass very close to the stations. In this case, the transceiver is normally part of the network interface card (NIC), which is installed inside the station. Figure 13.11 shows the schematic diagram of a IOBase2 implementation.

Figure 13.11

lOBase2 implementation
Cable end

10 Mbps

gOBa~
Baseband (digital)

185 m

~

Thin coaxial cable, maximum 185 m

Note that the collision here occurs in the thin coaxial cable. This implementation is more cost effective than 10BaseS because thin coaxial cable is less expensive than thick coaxial and the tee connections are much cheaper than taps. Installation is simpler because the thin coaxial cable is very flexible. However, the length of each segment cannot exceed 185 m (close to 200 m) due to the high level of attenuation in thin coaxial cable.

lOBase-T: Twisted-Pair Ethernet
The third implementation is called lOBase-T or twisted-pair Ethernet. 1OBase-T uses a physical star topology. The stations are connected to a hub via two pairs of twisted cable, as shown in Figure 13.12. Note that two pairs of twisted cable create two paths (one for sending and one for receiving) between the station and the hub. Any collision here happens in the hub. Compared to lOBaseS or lOBase2, we can see that the hub actually replaces the coaxial

SECTION 13.2

STANDARD ETHERNET

405

Figure 13.12 IOBase-T implementation

10 Mbps

~OBr'Q
Baseband (digital)

Twisted pair

i

I~I

~

m

i

Two pairs of

~UTPcable

I[Q] [QJ

... ~I

lOBase-T hub

cable as far as a collision is concerned. The maximum length of the twisted cable here is defined as 100 m, to minimize the effect of attenuation in the twisted cable.

lOBase-F: Fiber Ethernet
Although there are several types of optical fiber lO-Mbps Ethernet, the most common is called 10Base-F. lOBase-F uses a star topology to connect stations to a hub. The stations are connected to the hub using two fiber-optic cables, as shown in Figure 13.13.

Figure 13.13 IOBase-F implementation

] 0 Mbps

~OBr~
Baseband (digital)

Fiber

Two fiber-optic cables

lOBase-F hub

Summary Table 13.1 shows a summary of Standard Ethernet implementations. Table 13.1 Summary ofStandard Ethernet implementations Characteristics lOBase5 lOBase2 lOBase-T IOBase-F

Media Maximum length Line encoding

Thick coaxial cable 500m Manchester

Thin coaxial cable 185 m Manchester

2UTP 100m Manchester

2 Fiber 2000m Manchester

406

CHAPTER 13

WIRED LANs: ETHERNET

13.3

CHANGES IN THE STANDARD

The 10-Mbps Standard Ethernet has gone through several changes before moving to the higher data rates. These changes actually opened the road to the evolution of the Ethernet to become compatible with other high-data-rate LANs. We discuss some of these changes in this section.

Bridged Ethernet
The first step in the Ethernet evolution was the division of a LAN by bridges. Bridges have two effects on an Ethernet LAN: They raise the bandwidth and they separate collision domains. We discuss bridges in Chapter 15.

Raising the Bandwidth
In an unbridged Ethernet network, the total capacity (10 Mbps) is shared among all stations with a frame to send; the stations share the bandwidth of the network. If only one station has frames to send, it benefits from the total capacity (10 Mbps). But if more than one station needs to use the network, the capacity is shared. For example, if two stations have a lot of frames to send, they probably alternate in usage. When one station is sending, the other one refrains from sending. We can say that, in this case, each station on average, sends at a rate of 5 Mbps. Figure 13.14 shows the situation.

Figure 13.14
Rate One frame

Sharing bandwidth

Rate One frame
r--

10 Mbps 5 Mbps

-

One frame
r--

One frame

-

10 Mbps

One frame

One frame

One frame

One frame

- - -- - - --

-

- -

...
Time

5 Mbps

Time b. Second station

a. First station

The bridge, as we will learn in Chapter 15, can help here. A bridge divides the network into two or more networks. Bandwidth-wise, each network is independent. For example, in Figure 13.15, a network with 12 stations is divided into two networks, each with 6 stations. Now each network has a capacity of 10 Mbps. The lO-Mbps capacity in each segment is now shared between 6 stations (actually 7 because the bridge acts as a station in each segment), not 12 stations. In a network with a heavy load, each station theoretically is offered 10/6 Mbps instead of 10/12 Mbps, assuming that the traffic is not going through the bridge. It is obvious that if we further divide the network, we can gain more bandwidth for each segment. For example, if we use a four-port bridge, each station is now offered 10/3 Mbps, which is 4 times more than an unbridged network.

SECTION 13.3

CHANGES IN THE STANDARD

407

Figure 13.15 A network with and without a bridge

a. Without bridging

b. With bridging

Separating Collision Domains
Another advantage of a bridge is the separation of the collision domain. Figure 13.16 shows the collision domains for an unbridged and a bridged network. You can see that the collision domain becomes much smaller and the probability of collision is reduced tremendously. Without bridging, 12 stations contend for access to the medium; with bridging only 3 stations contend for access to the medium. Figure 13.16 Domain

r---~----------~-~-~------------~--~------------------ -------~----------------------------

Collision domains in an unbridged network and a bridged network

a. Without bridging

Domain 1--------------------1, ,

,

1""",,

=_ :~"a~:, :_---~~-~- -~--- -~-_:
I

Domain
l--------------~~----J , ,

i-~-a-~-!
b. With bridging

'aaa' 'aaa:
,
~

Domain ,---------------------I , , , ,
=-:.

1""""'-:'

=-:.

,
1

.1

Domain

I

,

,

,

1=-1.;;
~

= ....

="'"":

,
I
1 1

~

Switched Ethernet
The idea of a bridged LAN can be extended to a switched LAN. Instead of having two to four networks, why not have N networks, where N is the number of stations on the LAN? In other words, if we can have a multiple-port bridge, why not have an N-port

408

CHAPTER 13

WIRED IANs: ETHERNET

switch? In this way, the bandwidth is shared only between the station and the switch (5 Mbps each). In addition, the collision domain is divided into N domains. A layer 2 switch is an N-port bridge with additional sophistication that allows faster handling of the packets. Evolution from a bridged Ethernet to a switched Ethernet was a big step that opened the way to an even faster Ethernet, as we will see. Figure 13.17 shows a switched LAN. Figure 13.17 Switched Ethernet

,,'-.....
Domain:

,

riiI-"i:-:r----~-+--El C3--I-~--____,,-~- :
\~~-~-

-,-

\

,
Domain
I

--==""'''''-

--_

--~

__ '

Domain--

\,

,

Domain

.. _--

- - - Domain

-

Full-Duplex Ethernet
One of the limitations of 10Base5 and lOBase2 is that communication is half-duplex (lOBase-T is always full-duplex); a station can either send or receive, but may not do both at the same time. The next step in the evolution was to move from switched Ethernet to full-duplex switched Ethernet. The full-duplex mode increases the capacity of each domain from 10 to 20 Mbps. Figure 13.18 shows a switched Ethernet in full-duplex mode. Note that instead of using one link between the station and the switch, the configuration uses two links: one to transmit and one to receive. Figure 13.18 Full-duplex switched Ethernet

Switch

~

~

-E-I(_T_ra_ns_m_it_·_1

Receive

II_

Trno,mit •
Receive

~~

~_

Iflf ~0~>

a

No Needfor CSMAICD In full-duplex switched Ethernet, there is no need for the CSMAICD method. In a fullduplex switched Ethernet, each station is connected to the switch via two separate links.

SECTION 13.4

FAST ETHERNET

409

Each station or switch can send and receive independently without worrying about collision. Each link is a point-to-point dedicated path between the station and the switch. There is no longer a need for carrier sensing; there is no longer a need for collision detection. The job of the MAC layer becomes much easier. The carrier sensing and collision detection functionalities of the MAC sublayer can be turned off.

MAC Control Layer
Standard Ethernet was designed as a connectionless protocol at the MAC sublayer. There is no explicit flow control or error control to inform the sender that the frame has arrived at the destination without error. When the receiver receives the frame, it does not send any positive or negative acknowledgment. To provide for flow and error control in full-duplex switched Ethernet, a new sublayer, called the MAC control, is added between the LLC sublayer and the MAC sublayer.

13.4

FAST ETHERNET

Fast Ethernet was designed to compete with LAN protocols such as FDDI or Fiber Channel (or Fibre Channel, as it is sometimes spelled). IEEE created Fast Ethernet under the name 802.3u. Fast Ethernet is backward-compatible with Standard Ethernet, but it can transmit data 10 times faster at a rate of 100 Mbps. The goals of Fast Ethernet can be summarized as follows: 1. Upgrade the data rate to 100 Mbps. 2. Make it compatible with Standard Ethernet.

3. Keep the same 48-bit address. 4. Keep the same frame format. 5. Keep the same minimum and maximum frame lengths.

MAC Sublayer
A main consideration in the evolution of Ethernet from 10 to 100 Mbps was to keep the MAC sublayer untouched. However, a decision was made to drop the bus topologies and keep only the star topology. For the star topology, there are two choices, as we saw before: half duplex and full duplex. In the half-duplex approach, the stations are connected via a hub; in the full-duplex approach, the connection is made via a switch with buffers at each port. The access method is the same (CSMAlCD) for the half-duplex approach; for fullduplex Fast Ethernet, there is no need for CSMAlCD. However, the implementations keep CSMA/CD for backward compatibility with Standard Ethernet.

Autonegotiatioll
A new feature added to Fast Ethernet is called autonegotiation. It allows a station or a hub a range of capabilities. Autonegotiation allows two devices to negotiate the mode

410

CHAPTER 13

WIRED LANs: ETHERNET

or data rate of operation. It was designed particularly for the following purposes:

o

o
o

To allow incompatible devices to connect to one another. For example, a device with a maximum capacity of 10 Mbps can communicate with a device with a 100 Mbps capacity (but can work at a lower rate). To allow one device to have multiple capabilities. To allow a station to check a hub's capabilities.

Physical Layer
The physical layer in Fast Ethernet is more complicated than the one in Standard Ethernet. We briefly discuss some features of this layer.

Topology
Fast Ethernet is designed to connect two or more stations together. If there are only two stations, they can be connected point-to-point. Three or more stations need to be connected in a star topology with a hub or a switch at the center, as shown in Figure 13.19.

Figure 13.19 Fast Ethernet topology

a. Point-to-point

Implementation
Fast Ethernet implementation at the physical layer can be categorized as either two-wire or four-wire. The two-wire implementation can be either category 5 UTP (lOOBase-TX) or fiber-optic cable (lOOBase-FX). The four-wire implementation is designed only for category 3 UTP (l00Base-T4). See Figure 13.20.

Figure 13.20

Fast Ethernet implementations

Two wires category 5 UTP

Two wires fiber

Four wires category 3 UTP

SECTION 13.4

FAST ETHERNET

411

Encoding
Manchester encoding needs a 200-Mbaud bandwidth for a data rate of 100 Mbps, which makes it unsuitable for a medium such as twisted-pair cable. For this reason, the Fast Ethernet designers sought some alternative encoding/decoding scheme. However, it was found that one scheme would not perform equally well for all three implementations. Therefore, three different encoding schemes were chosen (see Figure 13.21).

Figure 13.21

Encoding for Fast Ethernet implementation
100Base-TX 100Base-FX 4 x 25 Mbps 4x 25 Mbps 4 x 25 Mbps

4 x 25 Mbps

Station

t
Two UTP category 5

Station

t
Two fibers

100Base-T4 100 Mbps 100 Mbps

~
~ ;;;iiR/6T ~~
~~:;C
----cJ.~[>-~.~1

R

R

ADM

1------l~[>----i.~1

R

tDrop

______
l
Section Section Line

_

J
~

_~

__ J
Line

J
Section

Section

t

Section

J

Path

signal into its correspondent OC-n signal. A SONET regenerator replaces some of the existing overhead information (header information) with new information. Add/drop Multiplexer Add/drop multiplexers allow insertion and extraction of signals. An add/drop multiplexer (ADM) can add STSs coming from different sources into a given path or can remove a desired signal from a path and redirect it without demultiplexing the entire signal. Instead of relying on timing and bit positions, add/drop multiplexers use header information such as addresses and pointers (described later in this section) to identify individual streams. In the simple configuration shown by Figure 17.1, a number of incoming electronic signals are fed into an STS multiplexer, where they are combined into a single optical signal. The optical signal is transmitted to a regenerator, where it is recreated without the noise it has picked up in transit. The regenerated signals from a number of sources are then fed into an add/drop multiplexer. The add/drop multiplexer reorganizes these signals, if necessary, and sends them out as directed by information in the data frames. These remultiplexed signals are sent to another regenerator and from there to the receiving STS demultiplexer, where they are returned to a format usable by the receiving links.

Terminals
A terminal is a device that uses the services of a SONET network. For example, in the Internet, a terminal can be a router that needs to send packets to another router at the other side of a SONET network.

Connections
The devices defined in the previous section are connected using sections, lines, and paths.

494

CHAPTER 17 SONETISDH

Sections

A section is the optical link connecting two neighbor devices: multiplexer to multiplexer, multiplexer to regenerator, or regenerator to regenerator. Lines

A line is the portion of the network between two multiplexers: STS multiplexer to add/ drop multiplexer, two add/drop multiplexers, or two STS multiplexers. Paths

A path is the end-to-end portion of the network between two STS multiplexers. In a simple SONET of two STS multiplexers linked directly to each other, the section, line, and path are the same.

17.2 SONET LAYERS
The SONET standard includes four functional layers: the photonic, the section, the line, and the path layer. They correspond to both the physical and the data link layers (see Figure 17.2). The headers added to the frame at the various layers are discussed later in this chapter. SONET defines four layers: path, line, section, and photonic.

Figure 17.2 SONET layers compared with OSI or the Internet layers

Path layer Line layer Data link Section layer

Physical

Photonic layer

I

Path Layer
The path layer is responsible for the movement of a signal from its optical source to its optical destination. At the optical source, the signal is changed from an electronic form into an optical form, multiplexed with other signals, and encapsulated in a frame. At the optical destination, the received frame is demultiplexed, and the individual optical signals are changed back into their electronic forms. Path layer overhead is added at this layer. STS multiplexers provide path layer functions.

SECTION 17.2

SONET LAYERS

495

Line Layer
The line layer is responsible for the movement of a signal across a physical line. Line layer overhead is added to the frame at this layer. STS multiplexers and add/drop multiplexers provide line layer functions.

Section Layer
The section layer is responsible for the movement of a signal across a physical section. It handles framing, scrambling, and error control. Section layer overhead is added to the frame at this layer.

Photonic Layer
The photonic layer corresponds to the physical layer of the OSI model. It includes physical specifications for the optical fiber channel, the sensitivity of the receiver, multiplexing functions, and so on. SONET uses NRZ encoding with the presence of light representing 1 and the absence of light representing O.

Device-Layer Relationships
Figure 17.3 shows the relationship between the devices used in SONET transmission and the four layers of the standard. As you can see, an STS multiplexer is a four-layer device. An add/drop multiplexer is a three-layer device. A regenerator is a two-layer device.

Figure 17.3 Device-layer relationship in SONET
Electric signal Electric signal

Path Line Section Photonic

~-~----I

~-:i--:----I

Path Line Section Photonic

Optical signal

Optical signal

Optical signal

Optical signal

Regenerator

Regenerator

Add/drop multiplexer

496

CHAPTER 17 SONETISDH

17.3

SONET FRAMES

Each synchronous transfer signal STS-n is composed of 8000 frames. Each frame is a two-dimensional matrix of bytes with 9 rows by 90 x n columns. For example, STS-l frame is 9 rows by 90 columns (810 bytes), and an STS-3 is 9 rows by 270 columns (2430 bytes). Figure 17.4 shows the general format of an STS-l and an STS-n.

Figure 17.4 An STS-l and an STS-nframe
90 bytes 90 x bytes

11

I..._ _ ' 8_10_b)_'te_s_ _

"II9b

Y ,,,

1_'

8_IO_X_lIb_)'t_es

'I}~,

a. STS-l frame

b. STS-n frame

Frame, Byte, and Bit Transmission
One of the interesting points about SONET is that each STS-n signal is transmitted at a fixed rate of 8000 frames per second. This is the rate at which voice is digitized (see Chapter 4). For each frame the bytes are transmitted from the left to the right, top to the bottom. For each byte, the bits are transmitted from the most significant to the least significant (left to right). Figure 17.5 shows the order of frame and byte transmission.

Figure 17.5 STS-l frames in transition
First - - - - - - - - - , . byte Left to right
8000 frames/second

and
'-- top to bottom Last byte

a. Byte transmission

b. Frame transmission

A SONET STS-n signal is transmitted at 8000 frames per second.

If we sample a voice signal and use 8 bits (l byte) for each sample, we can say that each byte in a SONET frame can carry information from a digitized voice channe1. In other words, an STS-l signal can carry 774 voice channels simultaneously (810 minus required bytes for overhead). Each byte in a SONET frame can carry a digitized voice channel.

SECTION 17.3

SONET FRAMES

497

Example 17.1
Find the data rate of an STS-l signal.

Solution
STS-l, like other STS signals, sends 8000 frames per second. Each STS-l frame is made of 9 by (l X 90) bytes. Each byte is made of 8 bits. The data rate is STS~1

data rate :::: 8000 X 9 X (1 X 90) x8:; 51.840 Mbps

Example 17.2
Find the data rate of an STS-3 signal.

Solution
STS-3, like other STS signals, sends 8000 frames per second. Each STS-3 frame is made of 9 by (3 X 90) bytes. Each byte is made of 8 bits. The data rate is ..

.

. STS-3 data rate:::: 8000 x 9 x (3 X 90) x 8 :::: 155.52 Mbps Note that in SONET, there is an exact relationship between the data rates of different STS signals. We could have found the data rate of STS-3 by using the data rate of STS-l (multiply the latter by 3).

In SONET, the data rate of an STS-n signal is n times the data rate of an STS-l signals.

Example 17.3
What is the duration of an STS-l frame? STS-3 frame? STS-n frame?

Solution
In SONET, 8000 frames are sent per second. This means that the duration of an STS-l, STS-3, or STS-n frame is the same and equal to 1/8000 S, or 125 j..ls.

In SONET, the duration of any frame is 125 j..ls.

STS-l Frame Format
The basic format of an STS-l frame is shown in Figure 17.6. As we said before, a SONET frame is a matrix of 9 rows of 90 bytes (octets) each, for a total of 810 bytes. The first three columns of the frame are used for section and line overhead. The upper three rows of the first three columns are used for section overhead (SOH). The lower six are line overhead (LOH). The rest of the frame is called the synchronous payload envelope (SPE). It contains user data and path overhead (POH) needed at the user data level. We will discuss the format of the SPE shortly. Section Overhead

The section overhead consists of nine octets. The labels, functions, and organization of these octets are shown in Figure 17.7.

498

CHAPTER 17 SONETISDH

Figure 17.6 STS-1 frame overheads
90 octets per row Section [ overhead STS-I SPE User data and path overhead Line [ overhead 9 rows x 87 columns 9 rows

Figure 17.7 STS-1 frame: section overhead
A I, AZ: Alignment HI: Parity byte C 1: Identification Dl, I)Z, D3: Management EI: Order wire byte FI: User

Al

~A2

CI FI

BI

El

D1 D2 D3

/

STS-I SPE

o

o

o

o o

Alignment bytes (AI and A2). Bytes Al and A2 are used for framing and synchronization and are called alignment bytes. These bytes alert a receiver that a frame is arriving and give the receiver a predetermined bit pattern on which to synchronize. The bit patterns for these two bytes in hexadecimal are OxF628. The bytes serve as a flag. Section parity byte (BI). Byte B1 is for bit interleaved parity (BIP-8). Its value is calculated over all bytes of the previous frame. In other words, the ith bit of this byte is the parity bit calculated over all ith bits of the previous STS-n frame. The value of this byte is filled only for the first STS-l in an STS-n frame. In other words, although an STS-n frame has n B 1 bytes, as we will see later, only the first byte has this value; the rest are filled with Os. Identification byte (el). Byte Cl carries the identity of the STS-l frame. This byte is necessary when multiple STS-ls are multiplexed to create a higher-rate STS (STS-3, STS-9, STS-12, etc.). Information in this byte allows the various signals to be recognized easily upon demultiplexing. For example, in an STS-3 signal, the value of the C1 byte is 1 for the first STS-l; it is 2 for the second; and it is 3 for the third. Management bytes (DI, D2, and D3). Bytes Dl, D2, and D3 together form a 192-kbps channel (3 x 8000 x 8) called the data communication channel. This channel is required for operation, administration, and maintenance (OA&M) signaling. Order wire byte (EI). Byte El is the order wire byte. Order wire bytes in consecutive frames form a channel of 64 kbps (8000 frames per second times 8 bits per

SECTION 17.3

SONET FRAMES

499

o

frame). This channel is used for communication between regenerators, or between terminals and regenerators. User's byte (Fl). The FI bytes in consecutive frames form a 64-kbps channel that is reserved for user needs at the section level. Section overhead is recalculated for each SONET device (regenerators and multiplexers).

Line Overhead

Line overhead consists of 18 bytes. The labels, functions, and arrangement of these bytes are shown in Figure 17.8. Figure 17.8
STS-l frame: line overhead
B2: Line parity byte D4-DI2: Management bytes E2: Order wire byte HI, H2, H3: Pointers Kl, K2: Automatic protection switching bytes Zl, Z2: Growth bytes (reserved)

HI B2

HZ
KI

H3
K2 D6

~
STS-I SPE

D4
D7

D5 08

D9

DIO Dll DI2
Zl
Z2 E2

V

o

o o o
o

Line parity byte (B2). Byte B2 is for bit interleaved parity. It is for error checking of the frame over a line (between two multiplexers). In an STS-n frame, B2 is calculated for all bytes in the previous STS-I frame and inserted at the B2 byte for that frame. In other words, in a STS-3 frame, there are three B2 bytes, each calculated for one STS-I frame. Contrast this byte with B I in the section overhead. Data communication channel bytes (D4 to D12). The line overhead D bytes (D4 to D12) in consecutive frames form a 576-kbps channel that provides the same service as the DI-D3 bytes (OA&M), but at the line rather than the section level (between multiplexers). Order wire byte (E2). The E2 bytes in consecutive frames form a 64-kbps channel that provides the same functions as the EI order wire byte, but at the line level. Pointer bytes (HI, 82, and 83). Bytes HI, H2, and H3 are pointers. The first two bytes are used to show the offset of the SPE in the frame; the third is used for justification. We show the use of these bytes later. Automatic protection switching bytes (Kl and K2). The KI and K2 bytes in consecutive frames form a I28-kbps channel used for automatic detection of problems in

500

CHAPTER 17 SONETISDH

D

line-terminating equipment. We discuss automatic protection switching (APS) later in the chapter. Growth bytes (Zl and Z2). The Zl and Z2 bytes are reserved for future use.

Synchronous Payload Envelope

The synchronous payload envelope (SPE) contains the user data and the overhead related to the user data (path overhead). One SPE does not necessarily fit it into one STS-l frame; it may be split between two frames, as we will see shortly. This means that the path overhead, the leftmost column of an SPE, does not necessarily align with the section or line overhead. The path overhead must be added first to the user data to create an SPE, and then an SPE can be inserted into one or two frames. Path overhead consists of 9 bytes. The labels, functions, and arrangement of these bytes are shown in Figure 17.9.

Figure 17.9 STS-l frame: path overhead
B3: Path parity byte

H4: Virtual tributary indicator

11
B3

C2: Path signal label byte
Gl: Path status byte

J 1: Path trace byte
Z3, Z4, Z5: Growth bytes (reserved)

C2

F2: Path user channel byte

Gl

F2
H4

Data

23
STS-I SPE

Z4
25 Path overhead

D Path parity byte (B3). Byte B3 is for bit interleaved parity, like bytes Bland B2, but calculated over SPE bits. It is actually calculated over the previous SPE in the stream. D Path signal label byte (C2). Byte C2 is the path identification byte. It is used to identify different protocols used at higher levels (such as IP or ATM) whose data are being carried in the SPE. D Path user channel byte (F2). The F2 bytes in consecutive frames, like the FI bytes, form a 64-kbps channel that is reserved for user needs, but at the path level. D Path status byte (Gl). Byte GI is sent by the receiver to communicate its status to the sender. It is sent on the reverse channel when the communication is duplex. We will see its use in the linear or ring networks later in the chapter. D Multiframe indicator (H4). Byte H4 is the multiframe indicator. It indicates payloads that cannot fit into a single frame. For example, virtual tributaries can be

SECTION 17.3

SONET FRAMES

501

o

o

combined to form a frame that is larger than an SPE frame and need to be divided into different frames. Virtual tributaries are discussed in the next section. Path trace byte (JI). The 11 bytes in consecutive frames form a 64-kbps channel used for tracking the path. The 11 byte sends a continuous 64-byte string to verify the connection. The choice of the string is left to the application program. The receiver compares each pattern with the previous one to ensure nothing is wrong with the communication at the path layer. Growth bytes (Z3, Z4, and Z5). Bytes Z3, Z4, and Z5 are reserved for future use. Path overhead is only calculated for end-to-end (at STS multiplexers).

Overhead Summary
Table 17.2 compares and summarizes the overheads used in a section, line, and path. Table 17.2 SONETISDH rates Byte Function Section Line Path

Alignment Parity Identifier OA&M Order wire User Status Pointers Trace Failure tolerance Growth (reserved for future)

Al,A2 Bl CI DI-D3 EI FI HI-H3 F2 Gl H4 D4-DI2 B2 B3 C2

11
KI,K2 ZI, Z2 Z3-Z5

Example 17.4
What is the user data rate of an STS-l frame (without considering the overheads)?

Solution
The user data part in an STS-I frame is made of 9 rows and 86 columns. So we have STS-l user data tate

=8000 x9>-.

Il:I

a. Postal mail

b. Electromc mall

Envelope

The envelope usually contains the sender and the receiver addresses.

Message The message contains the header and the body. The header of the message defines the sender, the receiver, the subject of the message, and some other information (such as encoding type, as we see shortly). The body of the message contains the actual information to be read by the recipient. Receiving Mail The user agent is triggered by the user (or a timer). If a user has mail, the VA informs the user with a notice. If the user is ready to read themail.alist is displayed in which each line contains a summary of the information about a particular message in the mailbox. The summary usually includes the sender mail address, the subject, and the time the mail was sent or received. The user can select any of the messages and display its contents on the screen.

SECTION 26.2

ELECTRONIC MAIL

831

Addresses To deliver mail, a mail handling system must use an addressing system with unique addresses. In the Internet, the address consists of two parts: a local part and a domain name, separated by an @ sign (see Figure 26.13).

Figure 26.13 E-mail address
@

Address of the mailbox on the mail server

The domain name of the mail server

Local Part The local part defines the name of a special file, called the user mailbox, where all the mail received for a user is stored for retrieval by the message access agent. Domain Name The second part of the address is the domain name. An organization usually selects one or more hosts to receive and send e-mail; the hosts are sometimes called mail servers or exchangers. The domain name assigned to each mail exchanger either comes from the DNS database or is a logical name (for example, the name of the organization). Mailing List Electronic mail allows one name, an alias, to represent several different e-mail addresses; this is called a mailing list. Every time a message is to be sent, the system checks the recipient's name against the alias database; if there is a mailing list for the defined alias, separate messages, one for each entry in the list, must be prepared and handed to the MTA. If there is no mailing list for the alias, the name itself is the receiving address and a single message is delivered to the mail transfer entity. MIME Electronic mail has a simple structure. Its simplicity, however, comes at a price. It can send messages only in NVT 7-bit ASCII format. In other words, it has some limitations. For example, it cannot be used for languages that are not supported by 7-bit ASCII characters (such as French, German, Hebrew, Russian, Chinese, and Japanese). Also, it cannot be used to send binary files or video or audio data. Multipurpose Internet Mail Extensions (MIME) is a supplementary protocol that allows non-ASCII data to be sent through e-mail. MIME transforms non-ASCII data at the sender site to NVT ASCII data and delivers them to the client MTA to be sent through the Internet. The message at the receiving side is transformed back to the original data. We can think of MIME as a set of software functions that transforms non-ASCII data (stream of bits) to ASCII data and vice versa, as shown in Figure 26.14.

832

CHAPTER 26

REMOTE LOGGING, ELECTRONIC MAIL, AND FILE TRANSFER

Figure 26.14 MIME
User User

Non-ASCII code

Non-ASCII code

7-bit NVT ASCII 7-bit NVT ASCII

7-bit NVT ASCII

MIME defines five headers that can be added to the original e-mail header section to define the transformation parameters: 1. MIME-Version
2. Content-Type

3. Content-Transfer-Encoding 4. Content-Id
5. Content-Description

Figure 26.15 shows the MIME headers. We will describe each header in detail.

Figure 26.15 MIME header

E-mail header MIME-Version: 1.1 Content-Type: type/subtype Content-Transfer-Encoding: encoding type Content-Id: message id Content-Description: textual explanation of nontextual contents

MIME headers

MIME-Version is 1.1.

This header defines the version of MIME used. The current version

SECTION 26.2

ELECTRONIC MAIL

833

Content-Type This header defines the type of data used in the body of the message. The content type and the content subtype are separated by a slash. Depending on the subtype, the header may contain other parameters.

CDBtent-'I)pe: ~ J subtjl;pe; parameters> .
MIME allows seven different types of data. These are listed in Table 26.5.

Table 26.5
Type Text

Data types and subtypes in MIME Subtype Plain HTML Mixed Unformatted HTML format (see Chapter 27) Body contains ordered parts of different data types Same as above, but no order Similar to mixed subtypes, but the default is message/ RFC822 Parts are different versions of the same message Body is an encapsulated message Body is a fragment of a bigger message Body is a reference to another message Image is in IPEG format Image is in GIF format Video is in MPEG format Single-channel encoding of voice at 8 kHz Adobe PostScript General binary data (8-bit bytes) Description

Multipart

Parallel Digest Alternative RFC822

Message

Partial External-Body

Image

IPEG GIF

Video Audio Application

MPEG Basic PostScript Octet-stream

Content-Transfer-Encoding This header defines the method used to encode the messages into Os and Is for transport:

::, i·:.~on~~Tta~~;ltne{)~iIlg: Is reports 227 Entering Passive Mode (153,18,17,11,238,169) 150 Here comes the directory listing. drwxr-xr-x drwxr-xr-x drwxr-xr-x 23027 23027 23027 411 411 411 4096 Sep 24 2002 business 4096 Sep 24 2002 personal 4096 Sep 24 2002 school

226 Directory send OK.

ftp>quit 221 Goodbye.

1. After the control connection is created, the FIP server sends the 220 (service ready) response on the control connection. 2. The client sends its name. 3. The server responds with 331 (user name is OK, password is required).

844

CHAPTER 26 REMOTE LOGGING, ELECTRONIC MAIL, AND FILE TRANSFER

4. The client sends the password (not shown). 5. The server responds with 230 (user log-in is OK). 6. The client sends the list command Os reports) to find the list of files on the directory named report. 7. Now the server responds with 150 and opens the data connection. 8. The server then sends the list of the files or directories (as a file) on the data connection. When the whole list (file) is sent, the server responds with 226 (closing data connection) over the control connection. 9. The client now has two choices. It can use the QUIT command to request the closing of the control connection, or it can send another command to start another activity (and eventually open another data connection). In our example, the client sends a QUIT command. 10. After receiving the QUIT command, the server responds with 221 (service closing) and then closes the control connection.

Anonymous FTP
To use FfP, a user needs an account (user name) and a password on the remote server. Some sites have a set of files available for public access, to enable anonymous FTP. To access these files, a user does not need to have an account or password. Instead, the user can use anonymous as the user name and guest as the password. User access to the system is very limited. Some sites allow anonymous users only a subset of commands. For example, most sites allow the user to copy some files, but do not allow navigation through the directories. Example 26.5

We show an example of anonymous FTP. We assume that some public data are available at intemic.net.

$ ftp intemic.net Connected to internic.net 220 Server ready Name: anonymous 331 Guest login OK, send "guest".as password'

.Password~guest -ftp>pwd"
257 'I' is current directory

..

.

jip>1s
:200-0K 150 Opening ASCII mode
bin

...
ttp>

close

221 Goodbye

ftp>quit

SECTION 26.5

KEY TERMS

845

26.4

RECOMMENDED READING

For more details about subjects discussed in this chapter, we recommend the following books and sites. The items in brackets [...] refer to the reference list at the end of the text.

Books
Remote logging is discussed in Chapter 18 of [For06] and Chapter 26 of [Ste94]. Electronic mail is discussed in Chapter 20 of [For06], Section 9.2 of [PD03], Chapter 32 of [Com04], Section 7.2 of [Tan03], and Chapter 28 of [Ste94]. FTP is discussed in Chapter 19 of [For06], Chapter 27 of [Ste94], and Chapter 34 of [Com04].

Sites
The following sites are related to topics discussed in this chapter.

o

www.ietf.org/rfc.htrnl

Information about RFCs

RFCs
The following RFCs are related to TELNET:

.~.:131~ 3~0, 393:i;4itj;'~~$.:,4~2;i·~,~4~S~$13f:529,,;~~2, ~~S; ~&6;.:$99;i~6~~.b79,7()t,',

.~

:
,

I

Calculating e, d, mldn
Bob

Y

j
C=pemodn
Encryption Ciphertext
p= Cemodn

-Plaintext Decryption

The two keys, e and d, have a special relationship to each other, a discussion of this relationship is beyond the scope of this book. We just show how to calculate the keys without proof. Selecting Keys

Bob use the following steps to select the private and public keys: 1. Bob chooses two very large prime numbers p and q. Remember that a prime num-

2. 3. 4. 5.

ber is one that can be divided evenly only by 1 and itself. Bob multiplies the above two primes to find n, the modulus for encryption and decryption. In other words, n ::: p X q. Bob calculates another number ::: (p -1) X (q - 1). Bob chooses a random integer e. He then calculates d so that d x e::: 1 mod . Bob announces e and n to the public; he keeps and d secret. In RSA, e and n are announced to the public; d and

are kept secret.

950

CHAPTER 30

CRYPTOGRAPHY

Encryption
Anyone who needs to send a message to Bob can use nand e. For example, if Alice needs to send a message to Bob, she can change the message, usually a short one, to an integer. This is the plaintext. She then calculates the ciphertext, using e and n. C=pt!(modn)

Alice sends C, the ciphertext, to Bob.

Decryption
Bob keeps

Cite This Document

Related Documents

  • Data Communication and Networking Lab Exercise

    ... Data communication and networking 7040 Week 4 assignment: Lab exercise Introduction: All network administrators must focus the rules and their system and network administrations and clients will discover satisfactory. These operational conditions can be viewed as ordinary for that system. Studies have demonstrated th...

    Read More
  • Data Communications and Networking

    ... Net Neutrality Paper Data Communications and Networking Sharath chander reddy konda Wilmington University Table of Contents: Introduction - 3 Do you suspect your Internet speed has been, reduced at any time? - 5 Are you aware of ...

    Read More
  • Data Communication and networking Assignment 1

    ...determination – Network Layer. b. Flow Control – Data Link and Transport Layer. c. Interface to Transmission Media – Physical Layer. d. Provides access for the end user – Application layer. 4. Match the following to one or more layers of the OSI (TCP/IP) model: a. Reliable Process to process message – Transport Layer. b. Route ...

    Read More
  • Data Communication and Networking

    ...DCN VIVA QUESTIONS 1. What do you mean by data communication? Ans: It is the exchange of data between two devices via some form of transmission medium such as wire cable. The communicating system must be part of a communication system made up of a combination of hardware and software. The effectiveness of a data communication system depends on t...

    Read More
  • Data Communication

    ...for67757_fm.fm Page i Saturday, January 7, 2006 12:00 AM DATA COMMUNICATIONS AND NETWORKING for67757_fm.fm Page ii Saturday, January 7, 2006 12:00 AM McGraw-Hill Forouzan Networking Series Titles by Behrouz A. Forouzan: Data Communications and Networking TCP/IP Protocol Suite Local Area Networks Business Data Communications for6...

    Read More
  • Data and Communication

    ... Databases and Data Communication BIS 320 September 16, 2013 Lisa Ricks Databases and Data Communication Databases are great when you want to create a model of data such as numbers for figuring out how much you can spend on a new home when you are in the buying marketing, you can use excel to figure out how much you can ...

    Read More
  • Bpr, Csharp, Data Communication and Networking, Financial Accounting

    ... However, the individual goals listed should not be the sole reason for a company to choose to do a process reengineering effort (Carr and Johansson, 1995). It may appear that process reengineering could be the solution to many of the performance issues facing businesses today, however, it's time for a reality check. In the early 90s, more th...

    Read More
  • Data Communications

    ...Short Questions: Differentiate between guided media and unguided media. Differentiate between an analog and a digital electromagnetic signal. What are three important characteristics of a periodic signal. What is the relationship between the wavelength and frequency of a sine wave. Define fundamental frequency. What is the relationshi...

    Read More

Discover the Best Free Essays on StudyMode

Conquer writer's block once and for all.

High Quality Essays

Our library contains thousands of carefully selected free research papers and essays.

Popular Topics

No matter the topic you're researching, chances are we have it covered.