TCP/IP Protocol Suit Forouzan

1029

description

TCP/IP Protocol Suit Forouzan

Transcript of TCP/IP Protocol Suit Forouzan

  • 1. Acronyms2DES double DES3DES triple DESAAL application adaptation layerADSL asymmetric digital subscriber lineAES Advanced Encryption StandardAH Authentication HeaderANSI American National StandardsInstituteANSNET Advanced Networks and ServicesNetworkARP Address Resolution ProtocolARPA Advanced Research Projects AgencyARPANET Advanced Research ProjectsAgency NetworkAS autonomous systemASCII American Standard Code forInformation InterchangeASN.1 Abstract Syntax Notation 1ATM asynchronous transfer modeBER Basic Encoding RulesBGP Border Gateway ProtocolBOOTP Bootstrap ProtocolBSS basic service setCA certification authorityCBC cipher-block chainingCBT core-based treeCCITT Consultative Committee forInternational Telegraphy andTelephonyCGI common gateway interfaceCIDR Classless Interdomain RoutingCMS Cryptographic Message SyntaxCSMA/CA carrier sense multiple access withcollision avoidanceCSMA/CD carrier sense multiple access withcollision detectionCSNET Computer Science NetworkDARPA Defense Advanced ResearchProjects AgencyDDN Defense Data NetworkDDNS Dynamic Domain NameSystemDES Data Encryption StandardDHCP Dynamic Host ConfigurationProtocolDNS Domain Name SystemDSL digital subscriber lineDSS Digital Signature StandardDSSS direct sequence spread spectrumDVMRP Distance Vector Multicast RoutingProtocolEBCDIC Extended Binary Coded DecimalInterchange CodeEIA Electronic Industries Alliance

2. ESP Encapsulating Security PayloadESS extended service setFCC Federal CommunicationsCommissionFCS frame check sequenceFHSS frequency hopping spread spectrumFQDN fully qualified domain nameFTP File Transfer ProtocolHDSL high bit rate digital subscriberlineHMAC hashed message authenticationcodeHTML Hypertext Markup LanguageHTTP Hypertext Transfer ProtocolIAB Internet Architecture BoardIANA Internet Assigned NumbersAuthorityICANN Internet Corporation for AssignedNames and NumbersICMP Internet Control MessageProtocolIEEE Institute of Electrical andElectronics EngineersIEGS Internet Engineering SteeringGroupIETF Internet Engineering Task ForceIGMP Internet Group ManagementProtocolIKE Internet Key ExchangeINTERNIC Internet Network InformationCenterIP Internet ProtocolIPng Internetworking Protocol, nextgenerationIPSec IP SecurityIRTF Internet Research Task ForceISAKMP Internet Security Association andKey Management ProtocolISO International Organization forStandardizationISOC Internet SocietyISP Internet service providerITU-T International TelecommunicationsUnionTelecommunicationStandardization SectorIV initial vectorKDC key-distribution centerLAN local area networkLCP Link Control ProtocolLIS logical IP subnetLSA link state advertisementMAA message access agentMAC media access control or messageauthentication codeMBONE multicast backboneMD Message DigestMIB management information baseMILNET Military NetworkMIME Multipurpose Internet Mail ExtensionMOSPF Multicast Open Shortest Path FirstMSS maximum segment sizeMTA message transfer agentMTU maximum transfer unitNAP Network Access PointNAT network address translationNIC Network Information CenterNIC network interface cardNIST National Institute of Standards andTechnologyNSA National Security Agency 3. NSF National Science FoundationNSFNET National Science FoundationNetworkNVT network virtual terminalOSI Open Systems InterconnectionOSPF open shortest path firstPGP Pretty Good PrivacyPIM Protocol IndependentMulticastPIM-DM Protocol Independent Multicast,Dense ModePIM-SM Protocol Independent Multicast,Sparse ModePING Packet Internet GroperPKI public-key infrastructurePOP Post Office ProtocolPPP Point-to-Point ProtocolPQDN partially qualified domainnameRACE Research in AdvancedCommunications for EuropeRADSL rate adaptive asymmetrical digitalsubscriber lineRARP Reverse Address ResolutionProtocolRFC Request for CommentRIP Routing Information ProtocolROM read-only memoryRPB reverse path broadcastingRPF reverse path forwardingRPM reverse path multicastingRSA Rivest, Shamir, AdelmanRTCP Real-time Transport ControlProtocolRTP Real-time Transport ProtocolRTSP Real-Time Streaming ProtocolRTT round-trip timeS/MIME Secure/Multipurpose Internet MailExtensionSA security associationSAD Security Association DatabaseSCTP Stream Control TransmissionProtocolSDH synchronous digital hierarchySDSL symmetric digital subscriberlineSFD start frame delimiterSHA Secure Hash AlgorithmSI stream identifierSKEME Secure Key ExchangeMechanismSMI Structure of ManagementInformationSNMP Simple Network ManagementProtocolSONET Synchronous Optical NetworkSP Security PolicySPD Security Policy DatabaseSSH secure shellSSL Secure Sockets LayerSSN stream sequence numberSVC switched virtual circuitTCP Transmission Control ProtocolTCP/IP Transmission Control Protocol/Internet ProtocolTELNET Terminal NetworkTFTP Trivial File Transfer Protocol 4. TLS Transport Layer SecurityTOS type of serviceTSN transmission sequence numberTTL time to liveUA user agentUDP User Datagram ProtocolUNI user network interfaceURL uniform resource locatorVC virtual circuitVCI virtual channel identifierVDSL very high bit rate digitalsubscriber lineVPI virtual path identifierVPN virtual private networkWAN wide area networkWWW World Wide Web 5. TCP/IPProtocol Suite 6. McGraw-Hill Forouzan Networking SeriesTitles by Behrouz A. Forouzan:Data Communications and NetworkingTCP/IP Protocol SuiteLocal Area NetworksBusiness Data CommunicationsCryptography and Network Security 7. TCP/IPProtocol SuiteFourth EditionBehrouz A. Forouzan 8. TCP/IP PROTOCOL SUITE, FOURTH EDITIONPublished by McGraw-Hill, a business unit of The McGraw-Hill Companies, Inc., 1221 Avenue of theAmericas, New York, NY 10020. Copyright 2010 by The McGraw-Hill Companies, Inc. All rightsreserved. Previous editions 2006, 2003, and 2001. No part of this publication may be reproduced ordistributed in any form or by any means, or stored in a database or retrieval system, without the priorwritten consent of The McGraw-Hill Companies, Inc., including, but not limited to, in any network orother electronic storage or transmission, or broadcast for distance learning.Some ancillaries, including electronic and print components, may not be available to customers outsidethe United States.This book is printed on acid-free paper.1 2 3 4 5 6 7 8 9 0 DOC/DOC 0 9ISBN 978-0-07-337604-2MHID 0-07-337604-3Global Publisher: Raghothaman SrinivasanDirector of Development: Kristine TibbettsSenior Marketing Manager: Curt ReynoldsProject Manager: Joyce WattersSenior Production Supervisor: Sherry L. KaneLead Media Project Manager: Stacy A. PatchDesigner: Laurie B. JanssenCover Designer: Ron Bissell(USE) Cover Image: Chad Baker/Getty ImagesCompositor: Macmillan Publishing SolutionsTypeface: 10/12 Times RomanPrinter: R. R. Donnelley Crawfordsville, INAll credits appearing on page or at the end of the book are considered to be an extension of thecopyright page.Library of Congress Cataloging-in-Publication DataForouzan, Behrouz A.TCP/IP protocol suite / Behrouz A. Forouzan.4th ed.p. cm.Includes index.ISBN 978-0-07-337604-2ISBN 0-07-337604-3 (hard copy : alk. paper) 1. TCP/IP (Computernetwork protocol) I. Title.TK5105.585.F67 2010004.6'2dc222008051008www.mhhe.com 9. To the memory of my parents,the source of my inspiration.Behrouz A. Forouzan 10. viiBrief ContentsPreface xxxiTrademarks xxxvPart 1 Introduction and Underlying Technologies 1Chapter 1 Introduction 2Chapter 2 The OSI Model and the TCP/IP Protocol Suite 18Chapter 3 Underlying Technologies 46Part 2 Network Layer 93Chapter 4 Introduction to Network Layer 94Chapter 5 IPv4 Addresses 114Chapter 6 Delivery and Forwarding of IP Packets 160Chapter 7 Internet Protocol Version 4 (IPv4) 186Chapter 8 Address Resolution Protocol (ARP) 220Chapter 9 Internet Control Message Protocol Version 4 (ICMPv4) 244Chapter 10 Mobile IP 268Chapter 11 Unicast Routing Protocols (RIP, OSPF, and BGP) 282Chapter 12 Multicasting and Multicast Routing Protocols 334Part 3 Transport Layer 373Chapter 13 Introduction to the Transport Layer 374Chapter 14 User Datagram Protocol (UDP) 414Chapter 15 Transmission Control Protocol (TCP) 432Chapter 16 Stream Control Transmission Protocol (SCTP) 502 11. viii BRIEF CONTENTSPart 4 Application Layer 541Chapter 17 Introduction to the Application Layer 542Chapter 18 Host Configuration: DHCP 568Chapter 19 Domain Name System (DNS) 582Chapter 20 Remote Login: TELNET and SSH 610Chapter 21 File Transfer: FTP and TFTP 630Chapter 22 World Wide Web and HTTP 656Chapter 23 Electronic Mail: SMTP, POP, IMAP, and MIME 680Chapter 24 Network Management: SNMP 706Chapter 25 Multimedia 728Part 5 Next Generation 767Chapter 26 IPv6 Addressing 768Chapter 27 IPv6 Protocol 786Chapter 28 ICMPv6 800Part 6 Security 815Chapter 29 Cryptography and Network Security 816Chapter 30 Internet Security 858Part 7 Appendices 891Appendix A Unicode 892Appendix B Positional Numbering Systems 896Appendix C Error Detection Codes 904Appendix D Checksum 914Appendix E HTML, XHTML, XML, and XSL 920Appendix F Client-Server Programming in Java 926Appendix G Miscellaneous Information 932Glossary 935References 955Index 957 12. ixContentsPreface xxxiTrademarks xxxvPart 1 Introduction and Underlying Technologies 1Chapter 1 Introduction 21.1 A BRIEF HISTORY 3ARPANET 3Birth of the Internet 3Transmission Control Protocol/Internetworking Protocol (TCP/IP) 4MILNET 4CSNET 4NSFNET 4ANSNET 5The Internet Today 5World Wide Web 6Time Line 6Growth of the Internet 71.2 PROTOCOLS AND STANDARDS 7Protocols 7Standards 81.3 STANDARDS ORGANIZATIONS 8Standards Creation Committees 8Forums 10Regulatory Agencies 101.4 INTERNET STANDARDS 10Maturity Levels 11Requirement Levels 121.5 INTERNET ADMINISTRATION 13Internet Society (ISOC) 13Internet Architecture Board (IAB) 13Internet Engineering Task Force (IETF) 13Internet Research Task Force (IRTF) 14Internet Assigned Numbers Authority (IANA) and Internet Corporationfor Assigned Names and Numbers (ICANN) 14Network Information Center (NIC) 14 13. x CONTENTS1.6 FURTHER READING 14Books and Papers 15Websites 151.7 KEY TERMS 151.8 SUMMARY 151.9 PRACTICE SET 16Exercises 16Research Activities 17Chapter 2 The OSI Model and the TCP/IP Protocol Suite 182.1 PROTOCOL LAYERS 19Hierarchy 20Services 202.2 THE OSI MODEL 20Layered Architecture 21Layer-to-Layer Communication 22Encapsulation 23Layers in the OSI Model 24Summary of OSI Layers 282.3 TCP/IP PROTOCOL SUITE 28Comparison between OSI and TCP/IP Protocol Suite 28Layers in the TCP/IP Protocol Suite 302.4 ADDRESSING 35Physical Addresses 35Logical Addresses 37Port Addresses 39Application-Specific Addresses 402.5 FURTHER READING 40Books 40RFCs 402.6 KEY TERMS 412.7 SUMMARY 412.8 PRACTICE SET 42Exercises 42Research Activities 44Chapter 3 Underlying Technologies 463.1 WIRED LOCAL AREA NETWORKS 47IEEE Standards 47Frame Format 48Addressing 49Ethernet Evolution 51Standard Ethernet 51Fast Ethernet 55Gigabit Ethernet 56Ten-Gigabit Ethernet 59 14. CONTENTS xi3.2 WIRELESS LANS 59IEEE 802.11 59MAC Sublayer 61Addressing Mechanism 64Bluetooth 673.3 POINT-TO-POINT WANS 7056K Modems 70DSL Technology 71Cable Modem 72T Lines 75SONET 75PPP 763.4 SWITCHED WANS 77X.25 77Frame Relay 78ATM 783.5 CONNECTING DEVICES 83Repeaters 83Bridges 84Routers 863.6 FURTHER READING 883.7 KEY TERMS 883.8 SUMMARY 893.9 PRACTICE SET 89Exercises 89Research Activities 90Part 2 Network Layer 93Chapter 4 Introduction to Network Layer 944.1 INTRODUCTION 954.2 SWITCHING 96Circuit Switching 96Packet Switching 964.3 PACKET SWITCHING AT NETWORK LAYER 97Connectionless Service 97Connection-Oriented Service 994.4 NETWORK LAYER SERVICES 103An Example 103Logical Addressing 104Services Provided at the Source Computer 105Services Provided at Each Router 106Services Provided at the Destination Computer 1074.5 OTHER NETWORK LAYER ISSUES 108Error Control 108Flow Control 109Congestion Control 110 15. xii CONTENTSQuality of Service 111Routing 111Security 1114.6 FURTHER READING 1114.7 KEY TERMS 1124.8 SUMMARY 1124.9 PRACTICE SET 112Exercises 112Chapter 5 IPv4 Addresses 1145.1 INTRODUCTION 115Address Space 115Notation 115Range of Addresses 117Operations 1185.2 CLASSFUL ADDRESSING 121Classes 121Classes and Blocks 123Two-Level Addressing 126An Example 129Three-Level Addressing: Subnetting 131Supernetting 1345.3 CLASSLESS ADDRESSING 135Variable-Length Blocks 136Two-Level Addressing 136Block Allocation 141Subnetting 1425.4 SPECIAL ADDRESSES 147Special Blocks 147Special Addresses in Each block 1485.5 NAT 149Address Translation 150Translation Table 1505.6 FURTHER READING 152Books 152RFCs 1525.7 KEY TERMS 1535.8 SUMMARY 1535.9 PRACTICE SET 154Exercises 154Chapter 6 Delivery and Forwarding of IP Packets 1606.1 DELIVERY 161Direct Delivery 161Indirect Delivery 1616.2 FORWARDING 162Forwarding Based on Destination Address 162Forwarding Based on Label 176 16. CONTENTS xiii6.3 STRUCTURE OF A ROUTER 178Components 1786.4 FURTHER READING 181Books 182RFCs 1826.5 KEY TERMS 1826.6 SUMMARY 1826.7 PRACTICE SET 183Exercises 183Research Activities 184Chapter 7 Internet Protocol Version 4 (IPv4) 1867.1 INTRODUCTION 1877.2 DATAGRAMS 1877.3 FRAGMENTATION 192Maximum Transfer Unit (MTU) 192Fields Related to Fragmentation 1937.4 OPTIONS 197Format 197Option Types 1987.5 CHECKSUM 205Checksum Calculation at the Sender 205Checksum Calculation at the Receiver 205Checksum in the IP Packet 2067.6 IP OVER ATM 207ATM WANs 208Routing the Cells 2087.7 SECURITY 210Security Issues 210IPSec 2117.8 IP PACKAGE 211Header-Adding Module 212Processing Module 213Queues 213Routing Table 214Forwarding Module 214MTU Table 214Fragmentation Module 214Reassembly Table 215Reassembly Module 2157.9 FURTHER READING 216Books 216RFCs 2177.10 KEY TERMS 2177.11 SUMMARY 2177.12 PRACTICE SET 218Exercises 218Research Activities 219 17. xiv CONTENTSChapter 8 Address Resolution Protocol (ARP) 2208.1 ADDRESS MAPPING 221Static Mapping 221Dynamic Mapping 2228.2 THE ARP PROTOCOL 222Packet Format 223Encapsulation 224Operation 224Proxy ARP 2268.3 ATMARP 228Packet Format 228ATMARP Operation 229Logical IP Subnet (LIS) 2328.4 ARP PACKAGE 233Cache Table 233Queues 235Output Module 235Input Module 236Cache-Control Module 237More Examples 2388.5 FURTHER READING 240Books 240RFCs 2408.6 KEY TERMS 2408.7 SUMMARY 2418.8 PRACTICE SET 241Exercises 241Chapter 9 Internet Control Message Protocol Version 4(ICMPv4) 2449.1 INTRODUCTION 2459.2 MESSAGES 246Message Format 246Error Reporting Messages 246Query Messages 253Checksum 2569.3 DEBUGGING TOOLS 257Ping 257Traceroute 2599.4 ICMP PACKAGE 262Input Module 263Output Module 2639.5 FURTHER READING 264Books 264RFCs 2649.6 KEY TERMS 2649.7 SUMMARY 265 18. CONTENTS xv9.8 PRACTICE SET 265Exercises 265Research Activities 267Chapter 10 Mobile IP 26810.1 ADDRESSING 269Stationary Hosts 269Mobile Hosts 26910.2 AGENTS 270Home Agent 271Foreign Agent 27110.3 THREE PHASES 271Agent Discovery 271Registration 273Data Transfer 27510.4 INEFFICIENCY IN MOBILE IP 277Double Crossing 277Triangle Routing 277Solution 27710.5 FURTHER READING 278Books 278RFCs 27810.6 KEY TERMS 27810.7 SUMMARY 27910.8 PRACTICE SET 279Exercises 279Research Activities 280Chapter 11 Unicast Routing Protocols (RIP, OSPF,and BGP) 28211.1 INTRODUCTION 283Cost or Metric 283Static versus Dynamic Routing Tables 283Routing Protocol 28311.2 INTRA- AND INTER-DOMAIN ROUTING 28411.3 DISTANCE VECTOR ROUTING 285Bellman-Ford Algorithm 285Distance Vector Routing Algorithm 287Count to Infinity 29111.4 RIP 293RIP Message Format 294Requests and Responses 295Timers in RIP 296RIP Version 2 297Encapsulation 29911.5 LINK STATE ROUTING 299Building Routing Tables 300 19. xvi CONTENTS11.6 OSPF 304Areas 304Metric 305Types of Links 305Graphical Representation 307OSPF Packets 307Link State Update Packet 309Other Packets 317Encapsulation 32011.7 PATH VECTOR ROUTING 320Reachability 321Routing Tables 32211.8 BGP 323Types of Autonomous Systems 323Path Attributes 324BGP Sessions 324External and Internal BGP 324Types of Packets 325Packet Format 325Encapsulation 32911.9 FURTHER READING 329Books 329RFCs 33011.10 KEY TERMS 33011.11 SUMMARY 33011.12 PRACTICE SET 331Exercises 331Research Activities 333Chapter 12 Multicasting and Multicast Routing Protocols 33412.1 INTRODUCTION 335Unicasting 335Multicasting 336Broadcasting 33812.2 MULTICAST ADDRESSES 338Multicast Addresses in IPv4 339Selecting Multicast Address 341Delivery of Multicast Packets at Data Link Layer 34212.3 IGMP 343Group Management 344IGMP Messages 344IGMP Protocol Applied to Host 347IGMP Protocol Applied to Router 351Role of IGMP in Forwarding 352Variables and Timers 354Encapsulation 355Compatibility with Older Versions 35512.4 MULTICAST ROUTING 355Optimal Routing: Shortest Path Trees 355 20. CONTENTS xvii12.5 ROUTING PROTOCOLS 358Multicast Link State Routing: MOSPF 358Multicast Distance Vector 360DVMRP 364CBT 364PIM 36612.6 MBONE 36712.7 FURTHER READING 368Books 368RFCs 36812.8 KEY TERMS 36812.9 SUMMARY 36912.10 PRACTICE SET 369Exercises 369Research Activities 371Part 3 Transport Layer 373Chapter 13 Introduction to the Transport Layer 37413.1 TRANSPORT-LAYER SERVICES 375Process-to-Process Communication 375Addressing: Port Numbers 375Encapsulation and Decapsulation 378Multiplexing and Demultiplexing 379Flow Control 379Error Control 382Combination of Flow and Error Control 383Congestion Control 385Connectionless and Connection-Oriented Services 38613.2 TRANSPORT-LAYER PROTOCOLS 389Simple Protocol 390Stop-and-Wait Protocol 391Go-Back-N Protocol 395Selective-Repeat Protocol 403Bidirectional Protocols: Piggybacking 40813.3 FURTHER READING 40913.4 KEY TERMS 40913.5 SUMMARY 41013.6 PRACTICE SET 411Exercises 411Research Activities 413Chapter 14 User Datagram Protocol (UDP) 41414.1 INTRODUCTION 41514.2 USER DATAGRAM 41614.3 UDP SERVICES 417Process-to-Process Communication 417Connectionless Services 418 21. xviii CONTENTSFlow Control 418Error Control 418Congestion Control 420Encapsulation and Decapsulation 420Queuing 421Multiplexing and Demultiplexing 423Comparison between UDP and Generic Simple Protocol 42314.4 UDP APPLICATIONS 424UDP Features 424Typical Applications 42614.5 UDP PACKAGE 426Control-Block Table 426Input Queues 426Control-Block Module 426Input Module 427Output Module 428Examples 42814.6 FURTHER READING 430Books 430RFCs 43014.7 KEY TERMS 43014.8 SUMMARY 43014.9 PRACTICE SET 431Exercises 431Chapter 15 Transmission Control Protocol (TCP) 43215.1 TCP SERVICES 433Process-to-Process Communication 433Stream Delivery Service 434Full-Duplex Communication 436Multiplexing and Demultiplexing 436Connection-Oriented Service 436Reliable Service 43615.2 TCP FEATURES 437Numbering System 437Flow Control 438Error Control 438Congestion Control 43915.3 SEGMENT 439Format 439Encapsulation 44115.4 A TCP CONNECTION 442Connection Establishment 442Data Transfer 444Connection Termination 446Connection Reset 44815.5 STATE TRANSITION DIAGRAM 449Scenarios 450 22. CONTENTS xix15.6 WINDOWS IN TCP 457Send Window 457Receive Window 45815.7 FLOW CONTROL 459Opening and Closing Windows 460Shrinking of Windows 462Silly Window Syndrome 46315.8 ERROR CONTROL 465Checksum 465Acknowledgment 465Retransmission 466Out-of-Order Segments 467FSMs for Data Transfer in TCP 467Some Scenarios 46815.9 CONGESTION CONTROL 473Congestion Window 473Congestion Policy 47415.10 TCP TIMERS 478Retransmission Timer 478Persistence Timer 481Keepalive Timer 482TIME-WAIT Timer 48215.11 OPTIONS 48215.12 TCP PACKAGE 489Transmission Control Blocks (TCBs) 490Timers 491Main Module 491Input Processing Module 495Output Processing Module 49615.13 FURTHER READING 496Books 496RFCs 49615.14 KEY TERMS 49615.15 SUMMARY 49715.16 PRACTICE SET 498Exercises 498Research Activities 501Chapter 16 Stream Control Transmission Protocol (SCTP) 50216.1 INTRODUCTION 50316.2 SCTP SERVICES 504Process-to-Process Communication 504Multiple Streams 504Multihoming 505Full-Duplex Communication 506Connection-Oriented Service 506Reliable Service 506 23. xx CONTENTS16.3 SCTP FEATURES 506Transmission Sequence Number (TSN) 506Stream Identifier (SI) 506Stream Sequence Number (SSN) 507Packets 507Acknowledgment Number 509Flow Control 509Error Control 509Congestion Control 51016.4 PACKET FORMAT 510General Header 510Chunks 51116.5 AN SCTP ASSOCIATION 519Association Establishment 519Data Transfer 521Association Termination 524Association Abortion 52416.6 STATE TRANSITION DIAGRAM 525Scenarios 52616.7 FLOW CONTROL 529Receiver Site 529Sender Site 530A Scenario 53016.8 ERROR CONTROL 531Receiver Site 532Sender Site 532Sending Data Chunks 534Generating SACK Chunks 53416.9 CONGESTION CONTROL 535Congestion Control and Multihoming 535Explicit Congestion Notification 53516.10 FURTHER READING 535Books 536RFCs 53616.11 KEY TERMS 53616.12 SUMMARY 53616.13 PRACTICE SET 537Exercises 537Research Activities 539Part 4 Application Layer 541Chapter 17 Introduction to the Application Layer 54217.1 CLIENT-SERVER PARADIGM 543Server 544Client 544Concurrency 544 24. CONTENTS xxiSocket Interfaces 546Communication Using UDP 554Communication Using TCP 558Predefined Client-Server Applications 56417.2 PEER-TO-PEER PARADIGM 56417.3 FURTHER READING 56517.4 KEY TERMS 56517.5 SUMMARY 56517.6 PRACTICE SET 566Exercises 566Chapter 18 Host Configuration: DHCP 56818.1 INTRODUCTION 569Previous Protocols 569DHCP 57018.2 DHCP OPERATION 570Same Network 570Different Networks 571UDP Ports 572Using TFTP 572Error Control 573Packet Format 57318.3 CONFIGURATION 576Static Address Allocation 576Dynamic Address Allocation 576Transition States 576Other Issues 578Exchanging Messages 57918.4 FURTHER READING 579Books and RFCs 57918.5 KEY TERMS 58018.6 SUMMARY 58018.7 PRACTICE SET 580Exercises 580Research Activities 581Chapter 19 Domain Name System (DNS) 58219.1 NEED FOR DNS 58319.2 NAME SPACE 584Flat Name Space 584Hierarchical Name Space 584Domain Name Space 585Domain 587Distribution of Name Space 58719.3 DNS IN THE INTERNET 589Generic Domains 589Country Domains 590 25. xxii CONTENTSInverse Domain 591Registrar 59219.4 RESOLUTION 593Resolver 593Mapping Names to Addresses 593Mapping Addresses to Names 593Recursive Resolution 593Iterative Resolution 594Caching 59419.5 DNS MESSAGES 595Header 59619.6 TYPES OF RECORDS 598Question Record 598Resource Record 59919.7 COMPRESSION 60019.8 ENCAPSULATION 60419.9 REGISTRARS 60419.10 DDNS 60419.11 SECURITY OF DNS 60519.12 FURTHER READING 605Books 606RFCs 60619.13 KEY TERMS 60619.14 SUMMARY 60619.15 PRACTICE SET 607Exercises 607Research Activities 608Chapter 20 Remote Login: TELNET and SSH 61020.1 TELNET 611Concepts 611Time-Sharing Environment 611Network Virtual Terminal (NVT) 613Embedding 614Options 615Symmetry 618Suboption Negotiation 618Controlling the Server 618Out-of-Band Signaling 620Escape Character 620Modes of Operation 621User Interface 623Security Issue 62420.2 SECURE SHELL (SSH) 624Versions 624Components 624Port Forwarding 625Format of the SSH Packets 626 26. CONTENTS xxiii20.3 FURTHER READING 626Books 626RFCs 62720.4 KEY TERMS 62720.5 SUMMARY 62720.6 PRACTICE SET 628Exercises 628Research Activities 629Chapter 21 File Transfer: FTP and TFTP 63021.1 FTP 631Connections 631Communication 633Command Processing 635File Transfer 639Anonymous FTP 642Security for FTP 643The sftp Program 64321.2 TFTP 643Messages 644Connection 646Data Transfer 647UDP Ports 649TFTP Example 650TFTP Options 650Security 651Applications 65121.3 FURTHER READING 652Books 652RFCs 65221.4 KEY TERMS 65221.5 SUMMARY 65321.6 PRACTICE SET 653Exercises 653Research Activities 655Chapter 22 World Wide Web and HTTP 65622.1 ARCHITECTURE 657Hypertext and Hypermedia 658Web Client (Browser) 658Web Server 659Uniform Resource Locator (URL) 65922.2 WEB DOCUMENTS 660Static Documents 660Dynamic Documents 660Active Documents 66322.3 HTTP 664HTTP Transaction 664 27. xxiv CONTENTSConditional Request 670Persistence 670Cookies 672Web Caching: Proxy Server 675HTTP Security 67522.4 FURTHER READING 676Books 676RFCs 67622.5 KEY TERMS 67622.6 SUMMARY 67622.7 PRACTICE SET 677Exercises 677Research Activities 678Chapter 23 Electronic Mail: SMTP, POP, IMAP,and MIME 68023.1 ARCHITECTURE 681First Scenario 681Second Scenario 682Third Scenario 682Fourth Scenario 68323.2 USER AGENT 684Services Provided by a User Agent 684User Agent Types 685Sending Mail 685Receiving Mail 686Addresses 686Mailing List or Group List 68623.3 MESSAGE TRANSFER AGENT: SMTP 687Commands and Responses 687Mail Transfer Phases 69123.4 MESSAGE ACCESS AGENT: POP AND IMAP 693POP3 694IMAP4 69523.5 MIME 695MIME Headers 69523.6 WEB-BASED MAIL 700Case I 700Case II 70123.7 E-MAIL SECURITY 70123.8 FURTHER READING 702Books 702RFCs 70223.9 KEY TERMS 70223.10 SUMMARY 70223.11 PRACTICE SET 703Exercises 703Research Activities 704 28. CONTENTS xxvChapter 24 Network Management: SNMP 70624.1 CONCEPT 707Managers and Agents 70724.2 MANAGEMENT COMPONENTS 708Role of SNMP 708Role of SMI 708Role of MIB 709An Analogy 709An Overview 71024.3 SMI 711Name 711Type 712Encoding Method 71324.4 MIB 715Accessing MIB Variables 716Lexicographic Ordering 71824.5 SNMP 719PDUs 719Format 721Messages 72224.6 UDP PORTS 72424.7 SECURITY 72524.8 FURTHER READING 725Books 725RFCs 72524.9 KEY TERMS 72624.10 SUMMARY 72624.11 PRACTICE SET 726Exercises 726Research Activity 727Chapter 25 Multimedia 72825.1 INTRODUCTION 72925.2 DIGITIZING AUDIO AND VIDEO 730Digitizing Audio 730Digitizing Video 73025.3 AUDIO AND VIDEO COMPRESSION 731Audio Compression 731Video Compression 73125.4 STREAMING STORED AUDIO/VIDEO 736First Approach: Using a Web Server 736Second Approach: Using a Web Server with Metafile 737Third Approach: Using a Media Server 738Fourth Approach: Using a Media Server and RTSP 73825.5 STREAMING LIVE AUDIO/VIDEO 73925.6 REAL-TIME INTERACTIVE AUDIO/VIDEO 740Characteristics 740 29. xxvi CONTENTS25.7 RTP 744RTP Packet Format 745UDP Port 74625.8 RTCP 746Sender Report 746Receiver Report 747Source Description Message 747Bye Message 747Application-Specific Message 747UDP Port 74725.9 VOICE OVER IP 748SIP 748H.323 75025.10 QUALITY OF SERVICE 752Flow Characteristics 752Flow Classes 753Techniques to Improve QoS 753Resource Reservation 757Admission Control 75825.11 INTEGRATED SERVICES 758Signaling 758Flow Specification 758Admission 759Service Classes 759RSVP 759Problems with Integrated Services 76225.12 DIFFERENTIATED SERVICES 762DS Field 76225.13 RECOMMENDED READING 764Books 764RFCs 76425.14 KEY TERMS 76425.15 SUMMARY 76525.16 PRACTICE SET 766Exercises 766Part 5 Next Generation 767Chapter 26 IPv6 Addressing 76826.1 INTRODUCTION 769Notations 769Address Space 772Three Address Types 772Broadcasting and Multicasting 77326.2 ADDRESS SPACE ALLOCATION 773Assigned and Reserved Blocks 77526.3 GLOBAL UNICAST ADDRESSES 778Three Levels of Hierarchy 779 30. CONTENTS xxvii26.4 AUTOCONFIGURATION 78126.5 RENUMBERING 78226.6 FURTHER READING 782Books 782RFCs 78226.7 KEY TERMS 78326.8 SUMMARY 78326.9 PRACTICE SET 783Exercises 783Chapter 27 IPv6 Protocol 78627.1 INTRODUCTION 787Rationale for Change 787Reason for Delay in Adoption 78727.2 PACKET FORMAT 788Base Header 788Flow Label 789Comparison between IPv4 and IPv6 Headers 790Extension Headers 790Comparison between IPv4 and IPv6 79527.3 TRANSITION FROM IPv4 TO IPv6 796Dual Stack 796Tunneling 797Header Translation 79727.4 FURTHER READING 798Books 798RFCs 79827.5 KEY TERMS 79827.6 SUMMARY 79927.7 PRACTICE SET 799Exercises 799Research Activity 799Chapter 28 ICMPv6 80028.1 INTRODUCTION 80128.2 ERROR MESSAGES 802Destination-Unreachable Message 802Packet-Too-Big Message 803Time-Exceeded Message 803Parameter-Problem Message 80428.3 INFORMATIONAL MESSAGES 804Echo-Request Message 804Echo-Reply Message 80528.4 NEIGHBOR-DISCOVERY MESSAGES 805Router-Solicitation Message 805Router-Advertisement Message 806Neighbor-Solicitation Message 806 31. xxviii CONTENTSNeighbor-Advertisement Message 807Redirection Message 808Inverse-Neighbor-Solicitation Message 808Inverse-Neighbor-Advertisement Message 80828.5 GROUP MEMBERSHIP MESSAGES 809Membership-Query Message 809Membership-Report Message 810Functionality 81028.6 FURTHER READING 812Books 812RFCs 81228.7 KEY TERMS 81228.8 SUMMARY 81228.9 PRACTICE SET 813Exercises 813Research Activities 813Part 6 Security 815Chapter 29 Cryptography and Network Security 81629.1 INTRODUCTION 817Security Goals 817Attacks 818Services 819Techniques 81929.2 TRADITIONAL CIPHERS 820Key 821Substitution Ciphers 821Transposition Ciphers 824Stream and Block Ciphers 82529.3 MODERN CIPHERS 826Modern Block Ciphers 826Data Encryption Standard (DES) 828Modern Stream Ciphers 83029.4 ASYMMETRIC-KEY CIPHERS 831Keys 832General Idea 832RSA Cryptosystem 834Applications 83629.5 MESSAGE INTEGRITY 836Message and Message Digest 836Hash Functions 83729.6 MESSAGE AUTHENTICATION 838HMAC 83829.7 DIGITAL SIGNATURE 839Comparison 839Process 840 32. CONTENTS xxixSigning the Digest 841Services 842RSA Digital Signature Scheme 843Digital Signature Standard (DSS) 84429.8 ENTITY AUTHENTICATION 844Entity versus Message Authentication 844Verification Categories 845Passwords 845Challenge-Response 84529.9 KEY MANAGEMENT 847Symmetric-Key Distribution 847Symmetric-Key Agreement 850Public-Key Distribution 85129.10 FURTHER READING 85329.11 KEY TERMS 85329.12 SUMMARY 85429.13 PRACTICE SET 855Exercises 855Research Activities 856Chapter 30 Internet Security 85830.1 NETWORK LAYER SECURITY 859Two Modes 859Two Security Protocols 861Services Provided by IPSec 864Security Association 865Internet Key Exchange (IKE) 868Virtual Private Network (VPN) 86830.2 TRANSPORT LAYER SECURITY 869SSL Architecture 869Four Protocols 87230.3 APPLICATION LAYER SECURITY 875E-mail Security 875Pretty Good Privacy (PGP) 876Key Rings 878PGP Certificates 878S/MIME 881Applications of S/MIME 88530.4 FIREWALLS 885Packet-Filter Firewall 885Proxy Firewall 88630.5 RECOMMENDED READING 88730.6 KEY TERMS 88730.7 SUMMARY 88830.8 PRACTICE SET 888Exercises 888Research Activities 889 33. xxx CONTENTSPart 7 Appendices 891Appendix A Unicode 892Appendix B Positional Numbering Systems 896Appendix C Error Detection Codes 904Appendix D Checksum 914Appendix E HTML, XHTML, XML, and XSL 920Appendix F Client-Server Programming in Java 926Appendix G Miscellaneous Information 932Glossary 935References 955Index 957 34. xxxiPrefaceechnologies related to networks and internetworking may be the fastest growing inour culture today. Many professors and students who have used, read, or reviewedTthe third edition of the book suggested the publication of a new edition that includethese changes. In the fourth edition, I have reorganized the book incorporating manychanges and added several new chapters and appendices.The fourth edition of the book assumes the reader has no prior knowledge of theTCP/IP protocol suite, although a previous course in data communications is desirable.OrganizationThis book is divided into seven parts. Part I (Introduction and Underlying Technologies), comprising Chapters 1 to 3,reviews the basic concepts and underlying technologies that, although independentfrom the TCP/IP protocols, are needed to support them. Part II (Network Layer), comprising Chapters 4 to 12, discusses IPv4 addressing,the IPv4 protocol, all auxiliary protocols helping IPv4 protocol, and unicast andmulticast routing protocols. Part III (Transport Layer), comprising Chapters 13 to 16, introduces the generalconcepts in the transport layer (Chapter 13) and then fully discusses three transportlayer protocols: UDP, TCP, and SCTP (Chapters 14, 15, and 16). Part IV (Application Layer), comprising Chapters 17 to 25, introduces the generalconcepts in the application layer including client-server programming (Chapter 17)and then fully discusses seven application layer protocols (Chapters 18 to 24).Chapter 25 is devoted to multimedia in the Internet. Part V (New Generation), comprising Chapters 26 to 28, introduces the new gener-ationof IP protocol, IPv6 addressing (Chapter 26), IPv6 protocol (Chapter 27), andICMPv6 (Chapter 28). Part VI (Security), comprising Chapters 29 to 30, discusses the inevitable topics suchas cryptography and network security (Chapter 29) and Internet security (Chapter 30). Part VII (Appendices) inclosed seven appendices that may be needed when readingthe book.FeaturesSeveral features of this text are designed to make it particularly easy for students tounderstand TCP/IP. 35. xxxii PREFACEVisual ApproachThe book presents highly technical subject matter without complex formulas by using abalance of text and figures. More than 650 figures accompanying the text provide avisual and intuitive opportunity for understanding the material. Figures are particularlyimportant in explaining networking concepts, which are based on connections andtransmission. Often, these are more easily grasped visually rather than verbally.Highlighted PointsI have repeated important concepts in boxes for quick reference and immediate attention.Examples and ApplicationsWhenever appropriate, I have included examples that illustrate the concepts introducedin the text. Also, I have added real-life applications throughout each chapter to motivatestudents.Protocol PackagesAlthough I have not tried to give the detailed code for implementing each protocol,many chapters contain a section that discusses the general idea behind the implementa-tionof each protocol. These sections provide an understanding of the ideas and issuesinvolved in each protocol, but may be considered optional material.Key TermsThe new terms used in each chapter are listed at the end of the chapter and their defini-tionsare included in the glossary.SummaryEach chapter ends with a summary of the material covered by that chapter. The sum-maryis a bulleted overview of all the key points in the chapter.Practice SetEach chapter includes a practice set designed to reinforce salient concepts and encour-agestudents to apply them. It consists of two parts: exercises and research activities.Exercises require understanding of the material. Research activities challenge those whowant to delve more deeply into the material.AppendicesThe appendices are intended to provide a quick reference or review of materials neededto understand the concepts discussed in the book. The appendices in the previous edi-tionhave been revised, combined, and some new ones have been added.Glossary and AcronymsThe book contains an extensive glossary and a list of acronyms.Instructor ResourcesSolutions, PowerPoint presentations, and Student Quizzes are available through thebooks website at www.mhhe.com/forouzan. 36. PREFACE xxxiiiElectronic Book OptionsCourseSmart. This text is offered through CourseSmart for both instructors and stu-dents.CourseSmart is an online browser where students can purchase access to this andother McGraw-Hill textbooks in digital format. Through their browser, students canaccess a complete text online at almost half the cost of a traditional text. Purchasing theetextbook also allows students to take advantage of CourseSmarts Web tools for learn-ing,which include full text search, notes and highlighting, and e-mail tools for sharingnotes between classmates. To learn more about CourseSmart options, contact yoursales representative or visit www.CourseSmart.com.VitalSource. VitalSource is a downloadable eBook. Students who choose the Vital-Source eBook can save up to 45 percent off the cost of the print book, reduce theirimpact on the environment, and access powerful digital learning tools. Students canshare notes with others, customize the layout of the etextbook, and quickly search theirentire etextbook library for key concepts. Students can also print sections of the bookfor maximum portability.New and Changes to the Fourth EditionThere are many changes and much new material in the fourth edition, including: Chapter objectives have been added to the beginning of each chapter. A brief references list and a list of corresponding RFCs have been added at the endof each chapter. Some new exercises and some research activities are added to some chapters. Figures are revised to reflect their relation to the actual technology used today. Chapter 3 (Underlying Technologies) has been totally revised to cover newtechnologies Chapter 4 (Introduction to Network Layer) is totally new. Chapter 13 (Introduction to the Transport Layer) is totally new. Chapter 17 (Introduction to the Application Layer) is totally new. Chapter 5 now discusses both classful and classless addressing (a combination ofChapters 4 and 5 in the third edition). Chapter 6 has been revised to include MPLS. Materials on New Generation Internet Protocol (IPv6) has been augmented to threechapters (Chapters 26, 27, 28). Materials on security have been augmented to two chapters (Chapters 29, 30). Some deprecated protocols, such as RARP and BOOTP are removed to providespace for new material. Chapters are reorganized according to the layers in TCP/IP protocol suite. Appendix A (ASCII Code) has been replaced by Unicode. Appendix C (Error Detection) has been totally revised and augmented. Appendix D (Checksum) is totally revised. 37. xxxiv PREFACE Appendix E (HTML, XHTML, XML, and XSL) is totally new. Appendix F (Client-Server Programming in Java) is totally new. Appendix G (Miscellaneous Information) is now a combination of the previousAppendices F, G, and H.How to Use the BookThis book is written for both academic and professional audiences. The book can beused as a self-study guide for interested professionals. As a textbook, it can be used fora one-semester or one-quarter course. The chapters are organized to provide a greatdeal of flexibility. I suggest the following: Chapters 1 to 3 can be skipped if students have already taken a course in data com-municationsand networking. Chapters 4 through 25 are essential for understanding the TCP/IP protocol suite. Chapters 26 to 28 can be used at the professors discretion if there is a need formaking the student familiar with the new generation. Chapters 29 and 30 can prepare the students for a security course, but they can beskipped if there is time restraint.Acknowledgments for the Fourth EditionIt is obvious that the development of a book of this scope needs the support of manypeople. I acknowledged the contributions of many people in the preface of the firstthree editions. For the fourth edition, I would like to acknowledge the contributionsfrom peer reviewers to the development of the book. These reviewers are:Dale Buchholz, DePaul UniversityVictor Clincy, Kennesaw State UniversityRichard Coppins, Virginia Commonwealth UniversityZongming Fei, University of KentuckyGuy Hembroff, Michigan Tech UniversityFrank Lin, San Jose State UniversityTim Lin, California Polytechnic UniversityPomonaAbdallah Shami, University of Western OntarioElsa Valeroso, Eastern Michigan UniversityMark Weiser, Oklahoma State UniversityBen Zhao, University of California at Santa BarbaraI acknowledge the invaluable contributions of professor Paul Amer for providingcomments and feedbacks on the manuscript.Special thanks go to the staff of McGraw-Hill. Raghu Srinivasan, the publisher,proved how a proficient publisher can make the impossible, possible. Melinda Bilecki,the developmental editor, gave help whenever I needed it. Joyce Watters, the projectmanager, guided me through the production process with enormous enthusiasm. I alsothank Les Chappell of Macmillan Publishing Solutions in production, Laurie Janssen,the designer, and George F. Watson, the copy editor.Behrouz A. ForouzanJanuary, 2009. 38. xxxvTrademarkshroughout the text I have used several trademarks. Rather than insert a trademarksymbol with each mention of the trademark name, I acknowledge the trademarksThere and state that they are used with no intention of infringing upon them. Other prod-uctnames, trademarks, and registered trademarks are the property of their respectiveowners. Network File System and NFS are registered trademarks of Sun Microsystems,Inc. UNIX is a registered trademark of UNIX System Laboratories, Inc., a whollyowned subsidiary of Novell, Inc. Xerox is a trademark and Ethernet is a registered trademark of Xerox Corp. 39. 1P A R T1Introduction andUnderlying TechnologiesChapter 1 Introduction 2Chapter 2 The OSI Model and the TCP/IP Protocol Suite 18Chapter 3 Underlying Technologies 46 40. CHAPTER21Introductionhe Internet is a structured, organized system. Before we discuss howit works and its relationship to TCP/IP, we first give a brief history ofthe Internet. We then define the concepts of protocols and standards andtheir relationships to each other. We discuss the various organizations thatare involved in the development of Internet standards. These standards arenot developed by any specific organization, but rather through a consen-susof users. We discuss the mechanism through which these standardsoriginated and matured. Also included in this introductory chapter is asection on Internet administrative groups.OBJECTIVESThe chapter has several objectives: To give a brief history of the Internet. To give the definition of the two often-used terms in the discussion ofthe Internet: protocol and standard. To categorize standard organizations involved in the Internet and givea brief discussion of each. To define Internet Standards and explain the mechanism throughwhich these standards are developed. To discuss the Internet administration and give a brief description ofeach branch.T 41. 1.1 A BRIEF HISTORYA network is a group of connected, communicating devices such as computers andprinters. An internet (note the lowercase i) is two or more networks that can communi-catewith each other. The most notable internet is called the Internet (uppercase I ),composed of hundreds of thousands of interconnected networks. Private individuals aswell as various organizations such as government agencies, schools, research facilities,corporations, and libraries in more than 100 countries use the Internet. Millionsof people are users. Yet this extraordinary communication system only came into beingin 1969.ARPANETIn the mid-1960s, mainframe computers in research organizations were stand-alonedevices. Computers from different manufacturers were unable to communicate withone another. The Advanced Research Projects Agency (ARPA) in the Department ofDefense (DOD) was interested in finding a way to connect computers together so thatthe researchers they funded could share their findings, thereby reducing costs and elim-inating3duplication of effort.In 1967, at an Association for Computing Machinery (ACM) meeting, ARPA pre-sentedits ideas for ARPANET, a small network of connected computers. The idea wasthat each host computer (not necessarily from the same manufacturer) would beattached to a specialized computer, called an interface message processor (IMP). TheIMPs, in turn, would be connected to each other. Each IMP had to be able to communi-catewith other IMPs as well as with its own attached host.By 1969, ARPANET was a reality. Four nodes, at the University of California atLos Angeles (UCLA), the University of California at Santa Barbara (UCSB), StanfordResearch Institute (SRI), and the University of Utah, were connected via the IMPs toform a network. Software called the Network Control Protocol (NCP) provided com-municationbetween the hosts.Birth of the InternetIn 1972, Vint Cerf and Bob Kahn, both of whom were part of the core ARPANETgroup, collaborated on what they called the Internetting Project. They wanted to linkdifferent networks together so that a host on one network could communicate with ahost on a second, different network. There were many problems to overcome: diversepacket sizes, diverse interfaces, and diverse transmission rates, as well as differingreliability requirements. Cerf and Kahn devised the idea of a device called a gateway toserve as the intermediary hardware to transfer data from one network to another. 42. 4 PART 1 INTRODUCTION AND UNDERLYING TECHNOLOGIESTransmission Control Protocol/Internetworking Protocol (TCP/IP)Cerf and Kahns landmark 1973 paper outlined the protocols to achieve end-to-enddelivery of data. This was a new version of NCP. This paper on transmission controlprotocol (TCP) included concepts such as encapsulation, the datagram, and the func-tionsof a gateway. A radical idea was the transfer of responsibility for error correctionfrom the IMP to the host machine. This ARPA Internet now became the focus of thecommunication effort. Around this time responsibility for the ARPANET was handedover to the Defense Communication Agency (DCA).In October 1977, an internet consisting of three different networks (ARPANET,packet radio, and packet satellite) was successfully demonstrated. Communicationbetween networks was now possible.Shortly thereafter, authorities made a decision to split TCP into two protocols:Transmission Control Protocol (TCP) and Internet Protocol (IP). IP would handledatagram routing while TCP would be responsible for higher level functions such assegmentation, reassembly, and error detection. The new combination became known asTCP/IP.In 1981, under a DARPA contract, UC Berkeley modified the UNIX operatingsystem to include TCP/IP. This inclusion of network software along with a popular oper-atingsystem did much for the popularity of networking. The open (non-manufacturer-specific)implementation on Berkeley UNIX gave every manufacturer a working codebase on which they could build their products.In 1983, authorities abolished the original ARPANET protocols, and TCP/IPbecame the official protocol for the ARPANET. Those who wanted to use the Internetto access a computer on a different network had to be running TCP/IP.MILNETIn 1983, ARPANET split into two networks: MILNET for military users and ARPANETfor nonmilitary users.CSNETAnother milestone in Internet history was the creation of CSNET in 1981. CSNET wasa network sponsored by the National Science Foundation (NSF). The network was con-ceivedby universities that were ineligible to join ARPANET due to an absence ofdefense ties to DARPA. CSNET was a less expensive network; there were no redundantlinks and the transmission rate was slower. It featured connections to ARPANET andTelenet, the first commercial packet data service.By the middle 1980s, most U.S. universities with computer science departmentswere part of CSNET. Other institutions and companies were also forming their ownnetworks and using TCP/IP to interconnect. The term Internet, originally associatedwith government-funded connected networks, now referred to the connected networksusing TCP/IP protocols.NSFNETWith the success of CSNET, the NSF, in 1986, sponsored NSFNET, a backbone thatconnected five supercomputer centers located throughout the United States. Community 43. CHAPTER 1 INTRODUCTION 5networks were allowed access to this backbone, a T-1 line with a 1.544-Mbps data rate,thus providing connectivity throughout the United States.In 1990, ARPANET was officially retired and replaced by NSFNET. In 1995,NSFNET reverted back to its original concept of a research network.ANSNETIn 1991, the U.S. government decided that NSFNET was not capable of supporting therapidly increasing Internet traffic. Three companies, IBM, Merit, and MCI, filled thevoid by forming a nonprofit organization called Advanced Network and Services(ANS) to build a new, high-speed Internet backbone called ANSNET.The Internet TodayThe Internet today is not a simple hierarchical structure. It is made up of many wideand local area networks joined by connecting devices and switching stations. It isdifficult to give an accurate representation of the Internet because it is continuouslychangingnew networks are being added, existing networks need more addresses, andnetworks of defunct companies need to be removed. Today most end users who wantInternet connection use the services of Internet service providers (ISPs). There areinternational service providers, national service providers, regional service providers,and local service providers. The Internet today is run by private companies, not thegovernment. Figure 1.1 shows a conceptual (not geographical) view of the Internet.Figure 1.1 Internet todayNAPNAPLocal LocalRegionalISPBackboneISPLocal LocalRegionalISPBackboneISPRegionalISPRegionalISPLocal Local Local Local 44. 6 PART 1 INTRODUCTION AND UNDERLYING TECHNOLOGIESBackbone ISPsBackbone ISPs are created and maintained by specialized companies. There are manybackbone ISPs operating in North America; some of the most well-known are Sprint-Link, PSINet, UUNet Technology, AGIS, and internet MCI. To provide connectivitybetween the end users, these backbone networks are connected by complex switchingstations (normally run by a third party) called network access points (NAPs). Someregional ISP networks are also connected to each other by private switching stationscalled peering points. Backbone ISPs normally operate at a high data rate (10 Gbps, forexample).Regional ISPsRegional ISPs are small ISPs that are connected to one or more backbone ISPs. Theyare at the second level of hierarchy with a lesser data rate.Local ISPsLocal ISPs provide direct service to the end users. The local ISPs can be connectedto regional ISPs or directly to backbone ISPs. Most end users are connected to thelocal ISPs. Note that in this sense, a local ISP can be a company that just providesInternet services, a corporation with a network to supply services to its own employ-ees,or a nonprofit organization, such as a college or a university, that runs its ownnetwork. Each of these can be connected to a regional or backbone service provider.World Wide WebThe 1990s saw the explosion of the Internet applications due to the emergence of theWorld Wide Web (WWW). The web was invented at CERN by Tim Berners-Lee. Thisinvention has added the commercial applications to the Internet.Time LineThe following is a list of important Internet events in chronological order: 1969. Four-node ARPANET established. 1970. ARPA hosts implement NCP. 1973. Development of TCP/IP suite begins. 1977. An internet tested using TCP/IP. 1978. UNIX distributed to academic/research sites. 1981. CSNET established. 1983. TCP/IP becomes the official protocol for ARPANET. 1983. MILNET was born. 1986. NSFNET established. 1990. ARPANET decommissioned and replaced by NSFNET. 1995. NSFNET goes back to being a research network. 1995. Companies known as Internet Service Providers (ISPs) started. 45. CHAPTER 1 INTRODUCTION 7Growth of the InternetThe Internet has grown tremendously. In just a few decades, the number of networks hasincreased from tens to hundreds of thousands. Concurrently, the number of computersconnected to the networks has grown from hundreds to hundreds of millions. The Internetis still growing. Factors that have an impact on this growth include the following: New Protocols. New protocols need to be added and deprecated ones need tobe removed. For example, a protocol superior in many respects to IPv4has been approved as a standard but is not yet fully implemented (see IPv6,Chapter 27). New Technology. New technologies are under development that will increase thecapacity of networks and provide more bandwidth to the Internets users. Increasing Use of Multimedia. It is predicted that the Internet, once just a vehicleto share data, will be used more and more for multimedia (audio and video).1.2 PROTOCOLS AND STANDARDSIn this section, we define two widely used terms: protocols and standards. First, wedefine protocol, which is synonymous with rule. Then we discuss standards, whichare agreed-upon rules.ProtocolsCommunication between two people or two devices needs to follow some protocol. Aprotocol is a set of rules that governs communication. For example, in a face-to-facecommunication between two persons, there is a set of implicit rules in each culture thatdefine how two persons should start the communication, how to continue the communi-cation,and how to end the communication. Similarly, in a telephone conversation, thereare a set of rules that we need to follow. There is a rule how to make connection (dial-ingthe telephone number), how to respond to the call (picking up the receiver), how togreet, how to let the communication flow smoothly by listening when the other party istalking, and finally how to end the communication (hanging up).In computer networks, communication occurs between entities in different sys-tems.An entity is anything capable of sending or receiving information. However, twoentities cannot simply send bit streams to each other and expect to be understood. Forcommunication to occur, the entities must agree on a protocol. A protocol defines whatis communicated, how it is communicated, and when it is communicated. The key ele-mentsof a protocol are syntax, semantics, and timing. Syntax. Syntax refers to the structure or format of the data, meaning the order inwhich they are presented. For example, a simple protocol might expect the first8 bits of data to be the address of the sender, the second 8 bits to be the address ofthe receiver, and the rest of the stream to be the message itself. The data order isalso applied to the order of bits when they are stored or transmitted. Different com-putersmay store data in different bit orders. When these computers communicate,this difference needs to be resolved. 46. 8 PART 1 INTRODUCTION AND UNDERLYING TECHNOLOGIES Semantics. Semantics refers to the meaning of each section of bits. How is a par-ticularpattern to be interpreted, and what action is to be taken based on that inter-pretation?For example, does an address identify the route to be taken or the finaldestination of the message? Timing. Timing refers to two characteristics: when data should be sent and howfast it can be sent. For example, if a sender produces data at 100 megabits per sec-ond(100 Mbps) but the receiver can process data at only 1 Mbps, the transmissionwill overload the receiver and data will be largely lost.StandardsStandards are essential in creating and maintaining an open and competitive market forequipment manufacturers and also in guaranteeing national and international inter-operabilityof data and telecommunications technology and processes. They provideguidelines to manufacturers, vendors, government agencies, and other service providersto ensure the kind of interconnectivity necessary in todays marketplace and in interna-tionalcommunications.Data communication standards fall into two categories: de facto (meaning byfact or by convention) and de jure (meaning by law or by regulation). De facto. Standards that have not been approved by an organized body but havebeen adopted as standards through widespread use are de facto standards. Defacto standards are often established originally by manufacturers that seek todefine the functionality of a new product or technology. Examples of de facto stan-dardsare MS Office and various DVD standards. De jure. De jure standards are those that have been legislated by an officially rec-ognizedbody.1.3 STANDARDS ORGANIZATIONSStandards are developed through the cooperation of standards creation committees,forums, and government regulatory agencies.Standards Creation CommitteesWhile many organizations are dedicated to the establishment of standards, data com-municationsin North America rely primarily on those published by the following: International Standards Organization (ISO). The International Standards Orga-nization(ISO; also referred to as the International Organization for Standardiza-tion)is a multinational body whose membership is drawn mainly from thestandards creation committees of various governments throughout the world. Cre-atedin 1947, the ISO is an entirely voluntary organization dedicated to worldwideagreement on international standards. With a membership that currently includesrepresentative bodies from many industrialized nations, it aims to facilitate theinternational exchange of goods and services by providing models for compatibility,improved quality, increased productivity, and decreased prices. The ISO is active 47. CHAPTER 1 INTRODUCTION 9in developing cooperation in the realms of scientific, technological, and economicactivity. Of primary concern to this book are the ISOs efforts in the field of infor-mationtechnology, which have resulted in the creation of the Open Systems Inter-connection(OSI) model for network communications. The United States isrepresented in the ISO by ANSI. International Telecommunications UnionTelecommunications Standards Sec-tor(ITU-T). By the early 1970s, a number of countries were defining national stan-dardsfor telecommunications, but there was still little international compatibility. TheUnited Nations responded by forming, as part of its International TelecommunicationsUnion (ITU), a committee, the Consultative Committee for International Telegra-phyand Telephony (CCITT). This committee was devoted to the research and estab-lishmentof standards for telecommunications in general and phone and data systemsin particular. On March 1, 1993, the name of this committee was changed to the Inter-nationalTelecommunications UnionTelecommunications Standards Sector (ITU-T). American National Standards Institute (ANSI). Despite its name, the AmericanNational Standards Institute (ANSI) is a completely private, nonprofit corporationnot affiliated with the U.S. federal government. However, all ANSI activities areundertaken with the welfare of the United States and its citizens occupying primaryimportance. ANSIs expressed aims include serving as the national coordinatinginstitution for voluntary standardization in the United States, furthering the adoptionof standards as a way of advancing the U.S. economy, and ensuring the participationand protection of the public interests. ANSI members include professional societies,industry associations, governmental and regulatory bodies, and consumer groups. Institute of Electrical and Electronics Engineers (IEEE). The Institute of Electri-caland Electronics Engineers (IEEE) is the largest professional engineering societyin the world. International in scope, it aims to advance theory, creativity, and productquality in the fields of electrical engineering, electronics, and radio as well as in allrelated branches of engineering. As one of its goals, the IEEE oversees the develop-mentand adoption of international standards for computing and communication. Electronic Industries Association (EIA). Aligned with ANSI, the ElectronicIndustries Association (EIA) is a nonprofit organization devoted to the promotionof electronics manufacturing concerns. Its activities include public awareness edu-cationand lobbying efforts in addition to standards development. In the field ofinformation technology, the EIA has made significant contributions by definingphysical connection interfaces and electronic signaling specifications for datacommunications. World Wide Web Consortium (W3C). Tim Berners-Lee founded this consortiumat Massachusetts Institutue of Technology Laboratory for Computer Science. Itwas founded to provide computability in industry for new standards. W3C has cre-atedregional offices around the world. Open Mobile Alliance (OMA). The standards organizaion OMA was created togather different forums in computer networking and wireless technology under theumbrella of one single authority. Its mission is to provide unified standards forapplication protocols. 48. 10 PART 1 INTRODUCTION AND UNDERLYING TECHNOLOGIESForumsTelecommunications technology development is moving faster than the ability of stan-dardscommittees to ratify standards. Standards committees are procedural bodies andby nature slow moving. To accommodate the need for working models and agreementsand to facilitate the standardization process, many special-interest groups have devel-opedforums made up of representatives from interested corporations. The forumswork with universities and users to test, evaluate, and standardize new technologies. Byconcentrating their efforts on a particular technology, the forums are able to speedacceptance and use of those technologies in the telecommunications community. Theforums present their conclusions to the standards bodies. Some important forums forthe telecommunications industry include the following: Frame Relay Forum. The Frame Relay Forum was formed by Digital Equipment Cor-poration,Northern Telecom, Cisco, and StrataCom to promote the acceptance andimplementation of Frame Relay. Today, it has around 40 members representing NorthAmerica, Europe, and the Pacific Rim. Issues under review include flow control, encap-sulation,translation, and multicasting. The forums results are submitted to the ISO. ATM Forum. The ATM Forum promotes the acceptance and use of AsynchronousTransfer Mode (ATM) technology. The ATM Forum is made up of customer prem-isesequipment (e.g., PBX systems) vendors and central office (e.g., telephoneexchange) providers. It is concerned with the standardization of services to ensureinteroperability. Universal Plug and Play (UPnP) Forum. The UPnP forum is a computer net-workforum that supports and promotes simplifying the implementation ofnetworks by creating zero-configuration networking devices. A UPnP-compatibledevice can join a network without any configuration.Regulatory AgenciesAll communications technology is subject to regulation by government agencies suchas the Federal Communications Commission in the United States. The purpose of theseagencies is to protect the public interest by regulating radio, television, and wire/cablecommunications. Federal Communications Commission (FCC). The Federal CommunicationsCommission (FCC) has authority over interstate and international commerce as itrelates to communications.The websites for the above organizations are given in Appendix G.1.4 INTERNET STANDARDSAn Internet standard is a thoroughly tested specification that is useful to and adhered toby those who work with the Internet. It is a formalized regulation that must be followed.There is a strict procedure by which a specification attains Internet standard status. A spec-ificationbegins as an Internet draft. An Internet draft is a working document (a work inprogress) with no official status and a six-month lifetime. Upon recommendation from the 49. CHAPTER 1 INTRODUCTION 11Internet authorities, a draft may be published as a Request for Comment (RFC). EachRFC is edited, assigned a number, and made available to all interested parties.RFCs go through maturity levels and are categorized according to their require-mentlevel.Maturity LevelsAn RFC, during its lifetime, falls into one of six maturity levels: proposed standard, draftstandard, Internet standard, historic, experimental, and informational (see Figure 1.2).Figure 1.2 Maturity levels of an RFCInternet draftExperimental Proposed standard InformationalDraft standardProposed StandardA proposed standard is a specification that is stable, well understood, and of sufficientinterest to the Internet community. At this level, the specification is usually tested andimplemented by several different groups.Draft StandardA proposed standard is elevated to draft standard status after at least two successful indepen-dentand interoperable implementations. Barring difficulties, a draft standard, with modifica-tionsif specific problems are encountered, normally becomes an Internet standard.Internet StandardA draft standard reaches Internet standard status after demonstrations of successfulimplementation.HistoricThe historic RFCs are significant from a historical perspective. They either have beensuperseded by later specifications or have never passed the necessary maturity levels tobecome an Internet standard.ExperimentalAn RFC classified as experimental describes work related to an experimental situationthat does not affect the operation of the Internet. Such an RFC should not be imple-mentedin any functional Internet service.Six months and two triesFour months and two triesInternet standardHistoric 50. 12 PART 1 INTRODUCTION AND UNDERLYING TECHNOLOGIESInformationalAn RFC classified as informational contains general, historical, or tutorial informationrelated to the Internet. It is usually written by someone in a non-Internet organization,such as a vendor.Requirement LevelsRFCs are classified into five requirement levels: required, recommended, elective,limited use, and not recommended (see Figure 1.3).Figure 1.3 Requirement levels of an RFCRequiredRecommendedRequirement levels ElectiveLimited useNot recommendedRequiredAn RFC is labeled required if it must be implemented by all Internet systems to achieveminimum conformance. For example, IP (Chapter 7) and ICMP (Chapter 9) arerequired protocols.RecommendedAn RFC labeled recommended is not required for minimum conformance; it is recom-mendedbecause of its usefulness. For example, FTP (Chapter 21) and TELNET(Chapter 20) are recommended protocols.ElectiveAn RFC labeled elective is not required and not recommended. However, a system canuse it for its own benefit.Limited UseAn RFC labeled limited use should be used only in limited situations. Most of theexperimental RFCs fall under this category.Not RecommendedAn RFC labeled not recommended is inappropriate for general use. Normally a historic(deprecated) RFC may fall under this category.RFCs can be found at http://www.rfc-editor.org. 51. CHAPTER 1 INTRODUCTION 131.5 INTERNET ADMINISTRATIONThe Internet, with its roots primarily in the research domain, has evolved and gaineda broader user base with significant commercial activity. Various groups that coordinateInternet issues have guided this growth and development. Appendix G gives the addresses,e-mail addresses, and telephone numbers for some of these groups. Figure 1.4shows the general organization of Internet administration.Figure 1.4 Internet administrationISOCIABIRTF IETFIRSG IESGRRGG RRGGArea AreaWG WG WG WGInternet Society (ISOC)The Internet Society (ISOC) is an international, nonprofit organization formed in1992 to provide support for the Internet standards process. ISOC accomplishes thisthrough maintaining and supporting other Internet administrative bodies such as IAB,IETF, IRTF, and IANA (see the following sections). ISOC also promotes research andother scholarly activities relating to the Internet.Internet Architecture Board (IAB)The Internet Architecture Board (IAB) is the technical advisor to the ISOC. Themain purposes of the IAB are to oversee the continuing development of the TCP/IPProtocol Suite and to serve in a technical advisory capacity to research members of theInternet community. IAB accomplishes this through its two primary components, theInternet Engineering Task Force (IETF) and the Internet Research Task Force (IRTF).Another responsibility of the IAB is the editorial management of the RFCs, describedearlier in this chapter. IAB is also the external liaison between the Internet and otherstandards organizations and forums.Internet Engineering Task Force (IETF)The Internet Engineering Task Force (IETF) is a forum of working groups man-agedby the Internet Engineering Steering Group (IESG). IETF is responsible foridentifying operational problems and proposing solutions to these problems. IETF 52. 14 PART 1 INTRODUCTION AND UNDERLYING TECHNOLOGIESalso develops and reviews specifications intended as Internet standards. The workinggroups are collected into areas, and each area concentrates on a specific topic. Cur-rentlynine areas have been defined, although this is by no means a hard and fastnumber. The areas are: Applications Internet protocols Routing Operations User services Network management Transport Internet protocol next generation (IPng) SecurityInternet Research Task Force (IRTF)The Internet Research Task Force (IRTF) is a forum of working groups managed bythe Internet Research Steering Group (IRSG). IRTF focuses on long-term research top-icsrelated to Internet protocols, applications, architecture, and technology.Internet Assigned Numbers Authority (IANA) and InternetCorporation for Assigned Names and Numbers (ICANN)The Internet Assigned Numbers Authority (IANA), supported by the U.S. govern-ment,was responsible for the management of Internet domain names and addressesuntil October 1998. At that time the Internet Corporation for Assigned Names andNumbers (ICANN), a private nonprofit corporation managed by an internationalboard, assumed IANA operations.Network Information Center (NIC)The Network Information Center (NIC) is responsible for collecting and distributinginformation about TCP/IP protocols.The addresses and websites for Internet organizations can be found in Appendix G.1.6 FURTHER READINGFor more details about subjects discussed in this chapter, we recommend the followingbooks and websites. The items enclosed in brackets refer to the reference list at the endof the book. 53. CHAPTER 1 INTRODUCTION 15Books and PapersSeveral books and papers give an easy but thorough coverage of Internet history includ-ing[Seg 98], [Lei et al. 98], [Kle 04], [Cer 89], and [Jen et al. 86].WebsitesThe following websites give more information about topics discussed in this chapter.ietf.org The site of IETFw3c.org The site of W3C standard organization1.7 KEY TERMSAdvanced Research Projects Agency(ARPA)Internet draftInternet Engineering Task Force (IETF)American National Standards Institute (ANSI) Internet Research Task Force (IRTF)ANSNET Internet Service Provider (ISP)ARPANET Internet Society (ISOC)ATM Forum Internet standardConsultative Committee for InternationalTelegraphy and Telephony (CCITT)Internet Protocol (IP)maturity levelsCSNET MILNETde facto standards networkde jure standards network access points (NAPs)Electronic Industries Association (EIA) Network Information Center (NIC)Federal Communications Commission (FCC) NSFNETFrame Relay Forum protocolInstitute of Electrical and ElectronicsEngineers (IEEE)Open Mobile Alliance (OMA)Request for Comment (RFC)International Standards Organization (ISO) requirement levelsInternational TelecommunicationsUnionTelecommunications StandardsSector (ITUT)semanticssyntaxtimingInternet Architecture Board (IAB) Transmission Control Protocol (TCP)Internet Assigned Numbers Authority (IANA) Universal Plug and Play (UPnP) ForumInternet Corporation for Assigned Names andNumbers (ICANN)World Wide Web Consortium (W3C)1.8 SUMMARY A network is a group of connected, communicating devices. An internet is two ormore networks that can communicate with each other. The most notable internet iscalled the Internet, composed of hundreds of thousands of interconnected networks. The history of internetworking started with ARPA in the mid-1960s. The birth ofthe Internet can be associated with the work of Cerf and Kahn and the invention 54. 16 PART 1 INTRODUCTION AND UNDERLYING TECHNOLOGIESof a gateway to connect networks. In 1977, the Defense Communication Agency(DCA) took the responsibility of the ARPANET and used two protocols calledTCP and IP to handle the routing of datagrams between individual networks.MILNET, CSNET, NSFNET, ANSNET, are all evolved from the ARPANET. The Internet today is made up of many wide and local area networks joined byconnecting devices and switching stations. Today most end users who want Inter-netconnection use the services of Internet service providers (ISPs). There arebackbone ISPs, regional ISPs, and local ISPs. A protocol is a set of rules that governs communication. The key elements of a pro-tocolare syntax, semantics, and timing. In computer networks, communicationoccurs between entities in different systems. For communication to occur, the enti-tiesmust agree on a protocol. A protocol defines what is communicated, how it iscommunicated, and when it is communicated. Standards are essential in creating and maintaining an open and competitive mar-ket.They provide guidelines to manufacturers, vendors, government agencies, andother service providers to ensure the kind of interconnectivity necessary in todaysmarketplace and in international communications. Data communication standardsfall into two categories: de facto and de jure. An Internet standard is a thoroughly tested specification that is useful to andadhered to by those who work with the Internet. An Internet draft is a working doc-ument(a work in progress) with no official status and a six-month lifetime. Uponrecommendation from the Internet authorities, a draft may be published as aRequest for Comment (RFC). Each RFC is edited, assigned a number, and madeavailable to all interested parties. RFCs go through maturity levels and are catego-rizedaccording to their requirement level. The Internet administration has evolved with the Internet. ISOC promotes researchand activities. IAB is the technical advisor to the ISOC. IETF is a forum of work-inggroups responsible for operational problems. IRTF is a forum of workinggroups focusing on long-term research topics. ICANN is responsible for the man-agementof Internet domain names and addresses. NIC is responsible for collectingand distributing information about TCP/IP protocols.1.9 PRACTICE SETExercises1. Use the Internet to find the number of RFCs.2. Use the Internet to find the subject matter of RFCs 2418 and 1603.3. Use the Internet to find the RFC that discusses the IRTF working group guidelinesand procedures.4. Use the Internet to find two examples of historic RFCs.5. Use the Internet to find two examples of experimental RFCs. 55. CHAPTER 1 INTRODUCTION 176. Use the Internet to find two examples of informational RFCs.7. Use the Internet to find the RFC that discusses the FTP application.8. Use the Internet to find the RFC for the Internet Protocol (IP).9. Use the Internet to find the RFC for the Transmission Control Protocol (TCP).10. Use the Internet to find the RFC that details the Internet standards process.Research Activities11. Research and find three standards developed by ITU-T.12. Research and find three standards developed by ANSI.13. EIA has developed some standards for interfaces. Research and find two of thesestandards. What is EIA 232?14. Research and find three regulations devised by FCC concerning AM and FMtransmission. 56. CHAPTER182The OSI Model andthe TCP/IP Protocol Suitehe layered model that dominated data communication and network-ingliterature before 1990 was the Open Systems Interconnection(OSI) model. Everyone believed that the OSI model would become theultimate standard for data communicationsbut this did not happen. TheTCP/IP protocol suite became the dominant commercial architecturebecause it was used and tested extensively in the Internet; the OSI modelwas never fully implemented.In this chapter, we first briefly discuss the OSI model and then weconcentrate on TCP/IP as a protocol suite.OBJECTIVESThe chapter has several objectives: To discuss the idea of multiple layering in data communication andnetworking and the interrelationship between layers. To discuss the OSI model and its layer architecture and to show theinterface between the layers. To briefly discuss the functions of each layer in the OSI model. To introduce the TCP/IP protocol suite and compare its layers withthe ones in the OSI model. To show the functionality of each layer in the TCP/IP protocol withsome examples. To discuss the addressing mechanism used in some layers of theTCP/IP protocol suite for the delivery of a message from the sourceto the destination.T 57. 2.1 PROTOCOL LAYERSIn Chapter 1, we discussed that a protocol is required when two entities need to com-municate.When communication is not simple, we may divide the complex task ofcommunication into several layers. In this case, we may need several protocols, one foreach layer.Let us use a scenario in communication in which the role of protocol layering maybe better understood. We use two examples. In the first example, communication is sosimple that it can occur in only one layer. In the second example, we need three layers.Example 2.1Assume Maria and Ann are neighbors with a lot of common ideas. However, Maria speaks onlySpanish, and Ann speaks only English. Since both have learned the sign language in their child-hood,they enjoy meeting in a cafe a couple of days per week and exchange their ideas usingsigns. Occasionally, they also use a bilingual dictionary. Communication is face to face and hap-pens19in one layer as shown in Figure 2.1.Figure 2.1 Example 2.1SignsMaria AnnLayer 1Example 2.2Now assume that Ann has to move to another town because of her job. Before she moves, thetwo meet for the last time in the same cafe. Although both are sad, Maria surprises Ann whenshe opens a packet that contains two small machines. The first machine can scan and transforma letter in English to a secret code or vice versa. The other machine can scan and translate aletter in Spanish to the same secret code or vice versa. Ann takes the first machine; Maria keepsthe second one. The two friends can still communicate using the secret code, as shown inFigure 2.2.Communication between Maria and Ann happens as follows. At the third layer, Maria writesa letter in Spanish, the language she is comfortable with. She then uses the translator machinethat scans the letter and creates a letter in the secret code. Maria then puts the letter in an envelopand drops it to the post office box. The letter is carried by the post office truck to the post office ofthe city where Ann lives now. In the post office, the letter is delivered to the Ann residence. Annuses her own machine to change the secret code to a letter in the English language. The commu-nicationfrom Ann to Maria uses the same process, but in the reverse direction. The communica-tionin both directions is carried in the secret code, a language that neither Maria nor Annunderstands, but through the layered communication, they can exchange ideas.Layer 1 58. 20 PART 1 INTRODUCTION AND UNDERLYING TECHNOLOGIESFigure 2.2 Example 2.2Layer 3 Layer 3SpanishEnglishMaria AnnLayer 2 Layer 2TranslatorPost OfficeSecret code Secret codeTranslatorPost OfficeLayer 1 Layer 1US Post US PostHierarchyUsing Example 2.2, there are three different activities at the sender site and anotherthree activities at the receiver site. The task of transporting the letter between thesender and the receiver is done by the carrier. Something that is not obvious immedi-atelyis that the tasks must be done in the order given in the hierarchy. At the sendersite, the letter must be written, translated to secret code, and dropped in the mailboxbefore being picked up by the letter carrier and delivered to the post office. At thereceiver site, the letter must be dropped in the recipient mailbox before being pickedup and read by the recipient.ServicesEach layer at the sending site uses the services of the layer immediately below it. Thesender at the higher layer uses the services of the middle layer. The middle layer usesthe services of the lower layer. The lower layer uses the services of the carrier.2.2 THE OSI MODELEstablished in 1947, the International Standards Organization (ISO) is a multi-nationalbody dedicated to worldwide agreement on international standards. Almostthree-fourths of countries in the world are represented in the ISO. An ISO standard thatcovers all aspects of network communications is the Open Systems Interconnection(OSI) model. It was first introduced in the late 1970s.ISO is the organization; OSI is the model.An open system is a set of protocols that allows any two different systems to com-municateregardless of their underlying architecture. The purpose of the OSI model is 59. CHAPTER 2 THE OSI MODEL AND THE TCP/IP PROTOCOL SUITE 21to show how to facilitate communication between different systems without requiringchanges to the logic of the underlying hardware and software. The OSI model is not aprotocol; it is a model for understanding and designing a network architecture that isflexible, robust, and interoperable. The OSI model was intended to be the basis for thecreation of the protocols in the OSI stack.The OSI model is a layered framework for the design of network systems thatallows communication between all types of computer systems. It consists of seven sep-aratebut related layers, each of which defines a part of the process of moving informationacross a network (see Figure 2.3). Understanding the fundamentals of the OSI modelprovides a solid basis for exploring data communications.Figure 2.3 The OSI modelApplicationPresentationSessionTransportNetworkData linkLayer 7Layer 6Layer 5Layer 4Layer 3Layer 2Layer 1 PhysicalLayered ArchitectureThe OSI model is composed of seven ordered layers: physical (layer 1), data link(layer 2), network (layer 3), transport (layer 4), session (layer 5), presentation (layer 6),and application (layer 7). Figure 2.4 shows the layers involved when a message is sentfrom device A to device B. As the message travels from A to B, it may pass throughmany intermediate nodes. These intermediate nodes usually involve only the first threelayers of the OSI model.In developing the model, the designers distilled the process of transmitting data toits most fundamental elements. They identified which networking functions had relateduses and collected those functions into discrete groups that became the layers. Eachlayer defines a family of functions distinct from those of the other layers. By definingand localizing functionality in this fashion, the designers created an architecture that isboth comprehensive and flexible. Most important, the OSI model allows completeinteroperability between otherwise incompatible systems.Within a single machine, each layer calls upon the services of the layer just belowit. Layer 3, for example, uses the services provided by layer 2 and provides services forlayer 4. Between machines, layer x on one machine logically communicates with layer xon another machine. This communication is governed by an agreed-upon series of rulesand conventions called protocols. 60. 22 PART 1 INTRODUCTION AND UNDERLYING TECHNOLOGIESFigure 2.4 OSI layersDevice A Intermediate Device BApplicationIntermediatenodenodeLayer-to-layer communication (7th layer)Layer-to-layer communication (6th layer)Layer-to-layer communication (5th layer)Layer-to-layer communication (4th layer)7-6 interfacePresentation6-5 interfaceSession5-4 interfaceTransport4-3 interfaceNetwork3-2 interfaceData link2-1 interfacePhysical76543217654321Application7-6 interfacePresentation6-5 interfaceSession5-4 interfaceTransport4-3 interfaceNetwork3-2 interfaceData link2-1 interfacePhysicalNetworkData linkPhysicalNetworkData linkPhysical3rd2nd1stPhysical communication3rd2nd1st3rd2nd1stLayer-to-Layer CommunicationIn Figure 2.4, device A sends a message to device B (through intermediate nodes). Atthe sending site, the message is moved down from layer 7 to layer 1. At layer 1 theentire package is converted to a form that can be transferred to the receiving site. At thereceiving site, the message is moved up from layer 1 to layer 7.Interfaces between LayersThe passing of the data and network information down through the layers of the send-ingdevice and back up through the layers of the receiving device is made possible byan interface between each pair of adjacent layers. Each interface defines what informa-tionand services a layer must provide for the layer above it. Well-defined interfaces andlayer functions provide modularity to a network. As long as a layer provides theexpected services to the layer above it, the specific implementation of its functions canbe modified or replaced without requiring changes to the surrounding layers.Organization of the LayersThe seven layers can be thought of as belonging to three subgroups. Layers 1, 2, and3physical, data link, and networkare the network support layers; they deal withthe physical aspects of moving data from one device to another (such as electricalspecifications, physical connections, physical addressing, and transport timing andreliability). Layers 5, 6, and 7session, presentation, and applicationcan bethought of as the user support layers; they allow interoperability among unrelatedsoftware systems. Layer 4, the transport layer, links the two subgroups and ensuresthat what the lower layers have transmitted is in a form that the upper layers can use. 61. CHAPTER 2 THE OSI MODEL AND THE TCP/IP PROTOCOL SUITE 23The upper OSI layers are almost always implemented in software; lower layers are acombination of hardware and software, except for the physical layer, which is mostlyhardware.In Figure 2.5, which gives an overall view of the OSI layers, D7 data means thedata unit at layer 7, D6 data means the data unit at layer 6, and so on. The processstarts at layer 7 (the application layer), then moves from layer to layer in descending,sequential order. At each layer, a header can be added to the data unit. At layer 2, atrailer may also be added. When the formatted data unit passes through the physicallayer (layer 1), it is changed into an electromagnetic signal and transported along aphysical link.Figure 2.5 An exchange using the OSI modelH7D7D6 H6D5D4D3H7D5D4D3Upon reaching its destination, the signal passes into layer 1 and is transformedback into digital form. The data units then move back up through the OSI layers. Aseach block of data reaches the next higher layer, the headers and trailers attached to it atthe corresponding sending layer are removed, and actions appropriate to that layer aretaken. By the time it reaches layer 7, the message is again in a form appropriate to theapplication and is made available to the recipient.EncapsulationFigure 2.5 reveals another aspect of data communications in the OSI model: encapsula-tion.A packet at level 7 is encapsulated in the packet at level 6. The whole packet atlevel 6 is encapsulated in a packet at level 5, and so on.In other words, the data part of a packet at level N is carrying the whole packet(data and overhead) from level N+ 1. The concept is called encapsulation because levelN is not aware what part of the encapsulated packet is data and what part is the headeror trailer. For level N, the whole packet coming from level N+ 1 is treated as oneintegral unit.H5H4H3T2 D2H2010101010101101010000010000 H1D7D6 H6H5H4H3T2 D2H2010101010101101010000010000 H1Transmission medium 62. 24 PART 1 INTRODUCTION AND UNDERLYING TECHNOLOGIESLayers in the OSI ModelIn this section we briefly describe the functions of each layer in the OSI model.Physical LayerThe physical layer coordinates the functions required to carry a bit stream over a physi-calmedium. It deals with the mechanical and electrical specifications of the interface andtransmission media. It also defines the procedures and functions that physical devicesand interfaces have to perform for transmission to occur.The physical layer is responsible for moving individual bits from one(node) to the next.The physical layer is also concerned with the following: Physical characteristics of interfaces and media. The physical layer defines thecharacteristics of the interface between the devices and the transmission media. Italso defines the type of transmission media (see Chapter 3). Representation of bits. The physical layer data consists of a stream of bits(sequence of 0s or 1s) with no interpretation. To be transmitted, bits must beencoded into signalselectrical or optical. The physical layer defines the type ofencoding (how 0s and 1s are changed to signals). Data rate. The transmission ratethe number of bits sent each secondis alsodefined by the physical layer. In other words, the physical layer defines the dura-tionof a bit, which is how long it lasts. Synchronization of bits. The sender and receiver must not only use the same bitrate but must also be synchronized at the bit level. In other words, the sender andthe receiver clocks must be synchronized. Line configuration. The physical layer is concerned with the connection ofdevices to the media. In a point-to-point configuration, two devices are con-nectedtogether through a dedicated link. In a multipoint configuration, a link isshared between several devices. Physical topology. The physical topology defines how devices are connected tomake a network. Devices can be connected using a mesh topology (every deviceconnected to every other device), a star topology (devices are connected through acentral device), a ring topology (each device is connected to the next, forming aring), or a bus topology (every device on a common link). Transmission mode. The physical layer also defines the direction of transmissionbetween two devices: simplex, half-duplex, or full-duplex. In the simplex mode,only one device can send; the other can only receive. The simplex mode is a one-waycommunication. In the half-duplex mode, two devices can send and receive,but not at the same time. In a full-duplex (or simply duplex) mode, two devicescan send and receive at the same time. 63. CHAPTER 2 THE OSI MODEL AND THE TCP/IP PROTOCOL SUITE 25Data Link LayerThe data link layer transforms the physical layer, a raw transmission facility, to a reli-ablelink. It makes the physical layer appear error-free to the upper layer (networklayer). Other responsibilities of the data link layer include the following: Framing. The data link layer divides the stream of bits received from the networklayer into manageable data units called frames. Physical addressing. If frames are to be distributed to different systems on thenetwork, the data link layer adds a header to the frame to define the sender and/orreceiver of the frame. If the frame is intended for a system outside the sendersnetwork, the receiver address is the address of the connecting device that connectsthe network to the next one. Flow control. If the rate at which the data is absorbed by the receiver is less thanthe rate produced at the sender, the data link layer imposes a flow control mecha-nismto prevent overwhelming the receiver. Error control. The data link layer adds reliability to the physical layer by addin