Contents Introduction to TCP/IP Preface ..................................................................................i Prerequisites ........................................................................................i Key Topics ...........................................................................................i Course Objectives ...............................................................................ii Pedagogical Features ..........................................................................ii Learning Objectives, Unit Summaries, Discussion Questions, and Activities/Exercises ..................................................................iii Key Terms ..........................................................................................iii Supplements ......................................................................................iii Advancing Your Level of Technical Expertise .................................. iv Why Choose WestNet? ..................................................................... iv
Introduction .................................................................... xxiii Overview of Architectures .............................................................xxiii
Unit 1 TCP/IP Structure and Addressing ........................................1 Lesson 1 OSI Model Review .................................................................9 Primary Functions of the OSI Model Layers ...................................... 9 Physical Addresses ..................................................................... 10 The Physical Layer .............................................................. 11 The Data Link Layer ........................................................... 11 Logical Addresses ....................................................................... 11 The Network Layer ............................................................. 11 The Transport Layer ........................................................... 13 Layers 5 Through 7 ................................................................... 13 The Session Layer ............................................................... 14 The Presentation Layer ....................................................... 14 v
Introduction to TCP/IP The Application Layer ........................................................ 14 Addressing Summary ....................................................................... 14 Activities ........................................................................................... 15
Lesson 2 Internet Protocol Suite .........................................................17 Overview of the TCP/IP Protocol Suite ............................................ 17 Network Interface Layer Protocols ............................................ 18 Internetwork Layer Protocols .................................................... 18 Transport Layer Protocols ......................................................... 19 Application Layer Protocols ...................................................... 20 Communication Using TCP/IP ........................................................ 21 Application Layer ...................................................................... 21 Transport Layer ......................................................................... 22 Network Layer ........................................................................... 22 Network Interface Layer ............................................................ 23 Destination Station ................................................................... 23 Activities ........................................................................................... 24
Lesson 3 Internet Addressing .............................................................27 IP Addresses ...................................................................................... 27 Class A Address .......................................................................... 28 Class B Address .......................................................................... 29 Class C Address ......................................................................... 29 Class D Address ......................................................................... 30 Class E Address .......................................................................... 30 Address Format ................................................................................. 30 Dotted Decimal Notation .......................................................... 31 Addressing Rules .............................................................................. 31 Sample Network Using Class A Address Format .............................. 34 Activities ........................................................................................... 35
Unit 2 Overview of TCP/IP Applications ......................................57 Lesson 1 Summary of TCP/IP Applications ..........................................63 Accessing TCP/IP Applications ......................................................... 63 Common TCP/IP Applications ........................................................ 64 Browsers (HTTP) ........................................................................ 64 Telnet ......................................................................................... 65 FTP ............................................................................................. 65 TFTP ........................................................................................... 65 NNTP ......................................................................................... 65 E-Mail ........................................................................................ 66 Network Management .............................................................. 66 DNS ............................................................................................ 67 BOOTP ....................................................................................... 67 DHCP ......................................................................................... 67 Different Applications Use Different Protocols ............................... 68 Activities ........................................................................................... 71
Lesson 2 Web Browsers and Servers ...................................................73 Browsers and Servers Overview ........................................................ 73 Web Browsers ............................................................................ 76 Browser Basics .................................................................... 76 Activities ........................................................................................... 79
Lesson 3 Telnet ..................................................................................82 Common Telnet Uses ....................................................................... 82 How to Use Telnet by Means of a Command Line .......................... 83 Using Telnet With Windows .................................................... 84 Using Telnet by Means of a Web Browser ....................................... 86 Activities ........................................................................................... 87
Lesson 4 FTP ......................................................................................89 Why Use FTP? .................................................................................. 89 Purpose of Browser and Server Software .......................................... 90 Where Can We Use FTP? ........................................................... 90 Is Anonymous FTP Really Anonymous? ................................... 91 How Can We Use FTP? .............................................................. 91 Using Command Line FTP ............................................................... 91 Using FTP With a Browser ............................................................... 94 Activities ........................................................................................... 96
vii
Introduction to TCP/IP
Lesson 5 E-Mail ..................................................................................97 How Does E-Mail Work? .................................................................. 97 Reading an E-Mail Address ............................................................... 98 E-Mail Protocols ............................................................................... 99 SMTP ........................................................................................ 100 Uuencode ......................................................................... 100 MIME ................................................................................ 100 S/MIME ............................................................................. 102 POP ................................................................................... 103 IMAP4 ............................................................................... 103 Mail Server Configuration .............................................................. 103 Store-and-Forward Mail Systems .................................................... 104 Activities ......................................................................................... 106
Summary ...........................................................................142 Quiz ..................................................................................144 Unit 3 TCP/IP Addressing and Subnets ......................................149 Lesson 1 Number Conversion ..........................................................153 Decimal to Binary Conversion ....................................................... 153 Divide by Two ......................................................................... 154 Binary to Decimal Conversion ....................................................... 155 Decimal to Binary Conversion Related to IP Addressing .............. 156 Activities ......................................................................................... 159
Lesson 2 Subnetting Fundamentals ..................................................162 The Value of Subnetting ................................................................ 162 The IP Address Crisis ............................................................... 163 Why Multiple Network Segments? ......................................... 163 Interconnection of TCP/IP Networks ............................................. 163 The Network Mask ......................................................................... 165 Creating Subnets ............................................................................ 167 Recapping What We Have Learned Thus Far ................................ 169 Maximum Usable Subnets and Hosts ............................................ 170 IP Prefixes ................................................................................ 173 Determining Subnet Requirements ............................................... 176 IP Broadcast Addresses ................................................................... 177 Limited Broadcast ........................................................................... 178 Directed Broadcast ......................................................................... 178 Activities ......................................................................................... 179
Lesson 3 Subnetting Class C Networks .............................................186 Determining Address Ranges ......................................................... 186 Network Address Ranges ......................................................... 187 Subnetwork Address Ranges .................................................... 188 Building the Range .................................................................. 190 Sample Problem #1 ........................................................................ 201 Sample Problem #2 ........................................................................ 203 Activities ......................................................................................... 205
ix
Introduction to TCP/IP
Lesson 4 Subnetting Class B Networks .............................................210 Building the Address Range ........................................................... 211 Sample Problem #1 ........................................................................ 220 Sample Problem #2 ........................................................................ 224 Activities ......................................................................................... 226
Lesson 5 Subnetting Class A Networks .............................................230 Building the Address Range ........................................................... 230 Sample Problem #1 ........................................................................ 240 Sample Problem #2 ........................................................................ 242 Activities ......................................................................................... 245
Lesson 6 CIDR ..................................................................................249 The Need for CIDR ......................................................................... 250 Large Routing Tables ............................................................... 253 The Proposed Solution ............................................................ 253 How CIDR Works ........................................................................... 254 Reduction of Routing Table Entries ........................................ 255 Creating a Supernet .......................................................... 256 Contiguous Address Space ...................................................... 257 Sample Problem #1 ........................................................................ 257 Sample Problem #2 ........................................................................ 258 Sample Problem #3 ........................................................................ 259 Activities ......................................................................................... 262
Summary ...........................................................................264 Quiz ..................................................................................266 Unit 4 TCP/IP Protocols ..............................................................273 Lesson 1 IP .......................................................................................276 Overview of IP ................................................................................ 276 IP Header Format and Field Descriptions ...................................... 278 ToS .................................................................................................. 281 Precedence Bits ........................................................................ 281 D-T-R-C Bits ............................................................................. 282 Fragmentation ................................................................................ 282 MTU ......................................................................................... 282 Fields Controlling Fragmentation ........................................... 284 Fragmentation Example .......................................................... 284 TTL ................................................................................................. 286 Protocol .......................................................................................... 286 Addressing ...................................................................................... 287 Options ........................................................................................... 287 x
Contents Record Route Option ............................................................... 288 Source Route Option ............................................................... 288 Time Stamp Option ................................................................. 288 IP Packet Encapsulation ................................................................. 288 Activities ......................................................................................... 290
Lesson 3 UDP ...................................................................................306 UDP Service .................................................................................... 306 Demultiplexing Based on Port Number ......................................... 308 UDP Port Numbers ......................................................................... 310 Frame Encapsulation ...................................................................... 311 Activities ......................................................................................... 312
Lesson 4 TCP and Connection Establishment ...................................315 TCP Features ................................................................................... 315 TCP Interfaces ................................................................................ 317 The TCP Header ............................................................................. 317 Fundamental Operation ................................................................. 319 Basic Data Transfer .................................................................. 319 Reliability ................................................................................ 320 Flow Control ........................................................................... 320 Multiplexing ............................................................................ 320 Connections ............................................................................ 321 Sequence Numbers ......................................................................... 321 Ports ................................................................................................ 323 Sockets ............................................................................................ 325 Connection Establishment ............................................................ 327 Active Open ............................................................................. 327 Passive Open ........................................................................... 328 Activities ......................................................................................... 329
xi
Introduction to TCP/IP
Lesson 5 TCP and Data Transmission ...............................................333 Connection Establishment Functions ........................................... 333 Three-Way Handshake ............................................................ 334 Handshake #1 ................................................................... 334 Handshake #2 ................................................................... 335 Handshake #3 ................................................................... 336 Data Transmission .......................................................................... 337 Sequence Numbers .................................................................. 337 Segments ................................................................................. 337 Push and Urgent Flags ............................................................. 338 ACK and Retransmission ......................................................... 339 Smooth Round-Trip Time ....................................................... 341 Data Reception ........................................................................ 341 Window Management ................................................................... 342 Efficient Transmission ............................................................. 343 Flow Control .................................................................................. 344 Variable-Sized Windows .......................................................... 344 Zero Receive Window ............................................................. 345 Connection Termination ............................................................... 345 Side Initiating Disconnection Request .................................... 346 Side Responding to Disconnection Request ........................... 346 Connection Reset—Crash Recovery ............................................... 346 Frame Encapsulations .................................................................... 347 Activities ......................................................................................... 348
Lesson 6 Moving Information Across a TCP/IP Network ...................352 Information Transfer ...................................................................... 352 Primary Functions of Each Layer ................................................... 353 Addressing in Computer Networks ................................................ 353 Physical Addresses ................................................................... 354 Logical Addresses ..................................................................... 354 Obtaining Logical Addresses .......................................................... 355 Obtaining Physical Addresses ........................................................ 356 Establishing a Connection Between Applications ......................... 357 Transferring Information ............................................................... 357 Terminating the Connection ......................................................... 357 Activities ......................................................................................... 358
Lesson 5 OSPF .................................................................................547 Review of Link-State Routing ......................................................... 547 RIP Limitations ............................................................................... 548 OSPF Solution ................................................................................. 549 Routing Areas ................................................................................. 550 xvii
Introduction to TCP/IP Area Routing Components ............................................................ 550 ABR .......................................................................................... 551 Backbone Area ......................................................................... 552 Virtual Links ............................................................................ 553 ASBR ........................................................................................ 553 Stub Areas ................................................................................ 554 Neighbors and Adjacencies ............................................................ 554 DR and BDR ............................................................................. 554 Forming Adjacencies ...................................................................... 555 Phase 1: Finding Neighbor Routers ......................................... 555 Phase 2: Synchronizing Link-State Databases ......................... 556 Phase 3: Maintaining Database Synchronization ................... 556 Link-State Advertisement Types .............................................. 557 ToS Routing .................................................................................... 559 Activities ......................................................................................... 561
Lesson 6 Advanced Routing .............................................................563 IGP and EGP ................................................................................... 563 EGP ................................................................................................. 565 BGP-4 .............................................................................................. 566 BGP in Practice ........................................................................ 567 BGP-4 Message Header Format ............................................... 568 BGP-4 Open Packet Format ..................................................... 569 Advanced Routing Functions ......................................................... 570 Least-Cost Routing .................................................................. 570 Load Splitting .......................................................................... 571 CoS Routing ............................................................................ 571 ToS/QoS Routing ..................................................................... 571 Policy-Based Routing ............................................................... 572 Activities ......................................................................................... 573
Summary ...........................................................................575 Quiz ..................................................................................577 Unit 7 How TCP/IP Applications Work .......................................583 Lesson 1 Web Browser and Web Server Step-by-Step .......................589 Server Waits for a Client Request ................................................... 590 Client Resolves Server IP Address ................................................... 591 Client TCP Sends a Connection Request to Web Server TCP Process ...................................................... 596 The Server TCP Process Responds to the Client TCP Process ........ 600 Client Acknowledges the Server TCP Connection Request ........... 603 Client Sends HTTP Request to Web Server ............................. 604 The Server Processes the Web Page Request .................................. 607 Activity ........................................................................................... 612 xviii
Contents
Lesson 2 Telnet ................................................................................616 Remote Terminal Access ................................................................ 617 VTP .......................................................................................... 619 Telnet Overview ...................................................................... 620 Client Telnet and Server Telnet ....................................... 620 Telnet NVT .............................................................................. 621 Negotiated Options ................................................................. 622 Default NVT ............................................................................ 622 Telnet Data Transfer ................................................................ 623 Transmission of Control Functions ........................................ 624 Out-of-Band Signaling (Telnet Synch) .................................... 625 Urgent Flag and Data Mark Command ........................... 625 Options Negotiations .............................................................. 626 Single Command Options Negotiation Format ............... 627 Subnegotiations ................................................................ 628 Extended Options List ............................................................. 629 Telnet Options ................................................................. 629 Activities ......................................................................................... 631
Lesson 3 FTP ....................................................................................633 Overview of FTP ............................................................................. 633 File Transfer Issues ................................................................... 635 Data Type ......................................................................... 635 File Structure .................................................................... 636 Transmission Mode .......................................................... 637 Sample File Transfer ....................................................................... 638 User and Server Processes ............................................................... 639 DTP .......................................................................................... 639 FTP Command Structure ......................................................... 640 Sample FTP Implementation ................................................... 643 Start FTP ........................................................................... 643 Transfer Files .................................................................... 643 Close Connection ............................................................. 643 Activities ......................................................................................... 644
Lesson 4 SMTP .................................................................................645 SMTP Commands ........................................................................... 645 Overview of SMTP .......................................................................... 646 SMTP Mail Process .......................................................................... 647 Sender SMTP ............................................................................ 647 Receiver SMTP ......................................................................... 648 Mail Addresses ................................................................................ 648 Two-Part Names ...................................................................... 648 SMTP Mail Transfer ................................................................. 648 Connection Establishment .............................................. 648
xix
Introduction to TCP/IP Data Transfer .................................................................... 649 Connection Closure ......................................................... 652 Activities ......................................................................................... 653
Lesson 5 Network Management ......................................................655 SNMP and OSI Model ..................................................................... 655 Basic Operation ....................................................................... 656 SNMP Architecture ......................................................................... 656 SNMP Proxy Agents ................................................................. 658 SNMP Management Station .................................................... 659 MIB ................................................................................................. 661 Management Objects .............................................................. 661 MIB Object Definitions ........................................................... 661 Systems Group (1) ................................................................... 662 Interface Group (2) .................................................................. 662 Address Translation Group (3) ................................................ 662 IP Group (4) ............................................................................. 662 ICMP Group (5) ....................................................................... 662 TCP Group (6) ......................................................................... 662 UDP Group (7) ........................................................................ 663 MIB Name Tree and Internet Subtrees ........................................... 663 Directory .................................................................................. 664 Management ........................................................................... 664 Managed Objects ..................................................................... 665 Experimental ........................................................................... 666 Private ...................................................................................... 666 Operations and PDUs ..................................................................... 667 PDU Types ............................................................................... 667 Actions Supported by SNMP Protocols .......................................... 668 Agent Actions .......................................................................... 668 Network Management Station Actions ................................... 669 SNMP Encoding ...................................................................... 669 ASN.1 ................................................................................ 669 Protocol Layering ............................................................. 670 Message Format .............................................................................. 671 Version Number ...................................................................... 671 Community String .................................................................. 671 PDU ......................................................................................... 671 Activities ......................................................................................... 673
Lesson 6 H.323 Standard for Packet Multimedia ..............................676 Overview of the H.323 Standard .................................................... 676 Version 1: Videophone ........................................................... 677 Version 2: Packet-Based Multimedia ....................................... 677 Version 3: Connection Reuse .................................................. 677 Version 4: Added Scalability ................................................... 677
xx
Contents Other Standards of the H.32x Family ............................................ 678 Components of an H.323 Network ......................................... 678 Terminals .......................................................................... 678 MCUs ................................................................................ 679 Gateways .......................................................................... 679 Gatekeepers ...................................................................... 680 H.323 Protocols ....................................................................... 681 Audio Codecs ................................................................... 682 Video Codecs .................................................................... 682 RTP ................................................................................... 682 RTCP ................................................................................. 684 RAS: H.225 ........................................................................ 684 Call Signaling: H.225 ....................................................... 684 Control Signaling: H.245 ................................................. 684 Document Conferencing: T.120 Series ............................ 684 Network Infrastructure Requirements ........................................... 685 Activities ......................................................................................... 686
Summary ...........................................................................689 Quiz ..................................................................................690 Unit 8 Troubleshooting a TCP/IP Network ................................697 Lesson 1 Troubleshooting Principles .................................................699 Troubleshooting Steps .................................................................... 699 Identify the Exact Issue ........................................................... 700 Re-Create the Problem ............................................................ 700 Isolate the Cause ..................................................................... 700 Formulate and Implement a Correction ................................. 700 Test the Solution ..................................................................... 701 Document the Problem and Solution and Provide Feedback . 701 Tools Used for Troubleshooting a TCP/IP Network ....................... 701 Activities ......................................................................................... 702
Lesson 7 A Troubleshooting Problem ...............................................732 The Problem ................................................................................... 732 Identify the Exact Issue .................................................................. 732 Re-Create the Problem ................................................................... 733 Isolate the Cause ............................................................................ 734 Phase 1—Internal Communications ....................................... 735 Phase 2—ISP Communications ............................................... 737 Phase 3—Web Host Firm Communications ........................... 737 Tallying the Results ................................................................. 738 Isolating the Cause .................................................................. 738 Formulate and Implement the Solution ........................................ 740 Test the Solution ............................................................................ 740 Document the Problem and Solution and Obtain Feedback ........ 740 Tools Used in Resolving This Problem ........................................... 741 Activities ......................................................................................... 742