ebook img

Sams Teach Yourself TCP/IP in 24 Hours (Sams Teach Yourself...in 24 Hours) PDF

545 Pages·2011·9.273 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Sams Teach Yourself TCP/IP in 24 Hours (Sams Teach Yourself...in 24 Hours)

ptg7068940 Joe Casad SamsTeachYourself TCP/IP ptg7068940 24 in Hours 800 East 96th Street,Indianapolis,Indiana,46240 USA Sams Teach Yourself TCP/IP in 24 Hours Editor-in-Chief Copyright © 2012 by Pearson Education,Inc. Mark Taub All rights reserved. No part of this book shall be reproduced,stored in a retrieval system,or Acquisitions Editor transmitted by any means,electronic,mechanical,photocopying,recording,or otherwise,without Trina MacDonald written permission from the publisher. No patent liability is assumed with respect to the use of the information contained herein. Although every precaution has been taken in the preparation of Development this book,the publisher and author assume no responsibility for errors or omissions. Nor is any Editor liability assumed for damages resulting from the use of the information contained herein. Michael Thurston ISBN-13: 978-0-672-33571-6 ISBN-10: 0-672-33571-9 Managing Editor Library of Congress Cataloging-in-Publication Data Kristy Hart Project Editor Casad,Joe,1958- Andy Beaster Sams teach yourself TCP/IP in 24 hours / Joe Casad. — 5th ed. p. cm. Copy Editor ISBN 978-0-672-33571-6 (pbk. : alk. paper) Keith Cline 1. TCP/IP (Computer network protocol) I. Title. II. Title: Teach yourself TCP/IP in 24 hours. TK5105.585.C37 2012 Indexer 005.7’1376—dc23 Lisa Stumpf 2011032322 Proofreader Printed in the United States of America Debbie Williams First Printing November 2011 Trademarks Technical Editor All terms mentioned in this book that are known to be trademarks or service marks have been Jon Snader appropriately capitalized. Sams Publishing cannot attest to the accuracy of this information. Use of a term in this book should not be regarded as affecting the validity of any trademark or service Publishing mark. Coordinator Warning and Disclaimer Olivia Basegio ptg7068940 Every effort has been made to make this book as complete and as accurate as possible,but no Book Designer warranty or fitness is implied. The information provided is on an “as is” basis. The author and the Gary Adair publisher shall have neither liability nor responsibility to any person or entity with respect to any loss or damages arising from the information contained in this book. Compositor Bulk Sales Gloria Schurick Sams Publishing offers excellent discounts on this book when ordered in quantity for bulk pur- chases or special sales. For more information,please contact U.S. Corporate and Government Sales 1-800-382-3419 [email protected] For sales outside of the U.S.,please contact International Sales [email protected] Contents at a Glance Introduction..............................................................................................1 Part I: TCP/IP Basics HOUR 1 What Is TCP/IP?.........................................................................................7 2 How TCP/IP Works...................................................................................23 Part II: The TCP/IP Protocol System HOUR 3 The Network Access Layer......................................................................37 4 The Internet Layer...................................................................................51 5 Subnetting and CIDR..............................................................................73 6 The Transport Layer................................................................................89 ptg7068940 7 The Application Layer..........................................................................113 Part III: Networking with TCP/IP HOUR 8 Routing..................................................................................................127 9 Getting Connected................................................................................149 10 Name Resolution...................................................................................177 11 TCP/IP Security......................................................................................211 12 Configuration........................................................................................255 13 IPv6: The Next Generation...................................................................281 Part IV: Tools HOUR 14 TCP/IP Utilities......................................................................................301 15 Monitoring and Remote Access............................................................323 16 Classic Services......................................................................................345 Part V: The Internet HOUR 17 The Internet: A Closer Look..................................................................365 18 HTTP, HTML, and the World Wide Web...............................................375 19 The New Web........................................................................................397 iv Teach Yourself TCP/IP in 24 Hours Part VI: TCP/IP At Work HOUR 20 Web Services..........................................................................................421 21 Email.....................................................................................................437 22 Streaming and Casting.........................................................................457 23 Living in the Cloud...............................................................................471 24 Implementing a TCP/IP Network: 7 Days in the Life of a Sys Admin.............................................................................................487 APPENDIX A Answers to Quizzes and Exercises..................................................501 Index......................................................................................................515 ptg7068940 Table of Contents Introduction 1 Part I: TCP/IP Basics HOUR 1: What Is TCP/IP? 7 Networks and Protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8 The Development of TCP/IP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10 TCP/IP Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12 Standards Organizations and RFCs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17 HOUR 2: How TCP/IP Works 23 The TCP/IP Protocol System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24 ptg7068940 TCP/IP and the OSI Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26 Data Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28 A Quick Look at TCP/IP Networking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30 Part II: The TCP/IP Protocol System HOUR 3: The Network Access Layer 37 Protocols and Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38 The Network Access Layer and the OSI Model . . . . . . . . . . . . . . . . . . . . . . . . .39 Network Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40 Physical Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43 Ethernet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43 Anatomy of an Ethernet Frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45 HOUR 4: The Internet Layer 51 Addressing and Delivering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52 Internet Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54 Address Resolution Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .65 Reverse ARP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67 Internet Control Message Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67 Other Internet Layer Protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68 vi Teach Yourself TCP/IP in 24 Hours HOUR 5: Subnetting and CIDR 73 Subnets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .73 Dividing the Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .74 Converting a Subnet Mask to Dotted-Decimal Notation . . . . . . . . . . . . . . . . .77 Working with Subnets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79 Classless Interdomain Routing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .84 HOUR 6: The Transport Layer 89 Introducing the Transport Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .90 Transport Layer Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .91 Understanding TCP and UDP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .97 Firewalls and Ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .107 HOUR 7: The Application Layer 113 What Is the Application Layer? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .113 The TCP/IP Application Layer and OSI . . . . . . . . . . . . . . . . . . . . . . . . . . . . .114 Network Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .115 ptg7068940 APIs and the Application Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .119 TCP/IP Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .120 Part III: Networking with TCP/IP HOUR 8: Routing 127 Routing in TCP/IP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127 Routing on Complex Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .139 Examining Interior Routers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .141 Exterior Routers: BGP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .143 Classless Routing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .144 Higher in the Stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .145 HOUR 9: Getting Connected 149 Dial-Up Networking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .150 Cable Broadband . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .156 Digital Subscriber Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .157 Wide Area Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .158 Wireless Networking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .160 Connectivity Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .169 vii Contents HOUR 10: Name Resolution 177 What Is Name Resolution? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .178 Name Resolution Using Hosts Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .179 DNS Name Resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .181 Registering a Domain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .187 Name Server Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .187 Dynamic DNS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .198 NetBIOS Name Resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .199 HOUR 11: TCP/IP Security 211 What Is a Firewall? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .211 Attack Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .219 What Do Intruders Want? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .220 Encryption and Secrecy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .233 HOUR 12: Configuration 255 Getting on the Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .255 ptg7068940 The Case for Server-Supplied IP Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . .256 What Is DHCP? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .257 How DHCP Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .258 DHCP Server Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .261 Network Address Translation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .262 Zero Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .264 Configuring TCP/IP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .268 HOUR 13: IPv6: The Next Generation 281 Why a New IP? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .281 IPv6 Header Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .284 IPv6 Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .287 Subnetting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .289 Multicasting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .289 Link Local . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .290 Neighbor Discovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .290 Autoconfiguration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .291 IPv6 and Quality of Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .291 IPv6 with IPv4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .292 IPv6 Tunnels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .293 viii Teach Yourself TCP/IP in 24 Hours Part IV: Tools HOUR 14: TCP/IP Utilities 301 Connectivity Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .302 Protocol Dysfunction and Misconfiguration . . . . . . . . . . . . . . . . . . . . . . . . . .302 Line Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .310 Name Resolution Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .310 Network Performance Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .311 HOUR 15: Monitoring and Remote Access 323 Telnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .324 Berkeley Remote Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .326 Secure Shell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .330 Remote Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .331 Network Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .332 Simple Network Management Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . .333 Remote Monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .338 ptg7068940 HOUR 16: Classic Services 345 HTTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .346 Email . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .347 FTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .347 Trivial File Transfer Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .352 File and Print Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .352 Lightweight Directory Access Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .355 Part V: The Internet HOUR 17: The Internet: A Closer Look 365 How the Internet Looks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .365 What Happens on the Internet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .368 URIs and URLs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .370 HOUR 18: HTTP,HTML,and the World Wide Web 375 What Is the World Wide Web? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .375 Understanding HTML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .378 Understanding HTTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .384 Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .387 Web Browsers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .390 ix Contents HOUR 19: The New Web 397 Web 2.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .397 Peer to Peer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .402 IRC and IM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .404 The Semantic Web . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .406 XHTML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .408 HTML5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .409 Part VI: TCP/IP At Work HOUR 20: Web Services 421 Understanding Web Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .421 XML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .424 SOAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .425 WSDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .426 Web Service Stacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .427 REST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .428 ptg7068940 E-Commerce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .431 HOUR 21: Email 437 What Is Email? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .437 Email Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .438 How Email Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .440 Simple Mail Transfer Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .442 Retrieving the Mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .444 Email Clients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .446 Webmail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .449 Spam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .450 HOUR 22: Streaming and Casting 457 The Streaming Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .457 Multimedia Environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .459 Real-time Transport Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .459 Transport Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .462 Multimedia Links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .463 Podcasting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .465 Voice over IP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .466

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.