ptg
From the Library of Athicom Parinayakosol
ptg
What you should already have to get the most out of this book…
• Familiarity with computer basics
• Basic knowledge of computer operating systems
Some books
that may
help…
Sams Teach Yourself
Microsoft Windows
Vista All in One
ISBN 0-672-32889-5
A quick, easy introduction
to Windows
Sams Teach Yourself
PHP, MySQL, and Apache
All in One
ISBN 0-672-32976-X
A step-by-step approach to
basic setup and creation of
interactive web applications
Possible
titles to
look for…
Sams Teach Yourself
Unix System
Administration in
24 Hours
ISBN 0-672-32398-2
An introduction to managing
/
IP
24
in
Hours
From the Library of Athicom Parinayakosol
ptg
800 East 96th Street, Indianapolis, Indiana, 46240 USA
Joe Casad
Sams TeachYourself
24
in
Hours
TCP/IP
From the Library of Athicom Parinayakosol
ptg
Sams Teach Yourself TCP/IP in 24 Hours
Copyright © 2009 by Pearson Education, Inc.
All rights reserved. No part of this book shall be reproduced, stored in a retrieval system, or
transmitted by any means, electronic, mechanical, photocopying, recording, or otherwise, without
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
this book, the publisher and author assume no responsibility for errors or omissions. Nor is any
liability assumed for damages resulting from the use of the information contained herein.
ISBN-13: 978-0-672-32996-8
ISBN-10: 0-672-32996-4
Library of Congress Cataloging-in-Publication Data:
Casad, Joe, 1958-
Sams teach yourself TCP/IP in 24 hours / Joe Casad. — 4th ed.
p. cm.
Mark Taub
Acquisitions Editor
Trina MacDonald
Development
Editor
Michael Thurston
Managing Editor
Kristy Hart
Project Editor
Betsy Harris
Indexer
Lisa Stumpf
Proofreader
San Dee Phillips
Technical Editor
Ravi Prakash
Publishing
Coordinator
Olivia Basegio
Book Designer
Gary Adair
Compositor
Nonie Ratcliff
From the Library of Athicom Parinayakosol
ptg
Contents at a Glance
Part I: TCP/IP Basics
HOUR 1 What Is TCP/IP? 7
2 How TCP/IP Works
21
18 Email
321
19 Streaming and Casting
339
From the Library of Athicom Parinayakosol
ptg
Part VI: Advanced Topics
HOUR 20 Web Services 353
21 The New Web
363
22 Network Intrusion
375
23 TCP/IP Security
391
24 Implementing a TCP/IP Network—Seven Days
in the Life of a Sys Admin
413
Index 425
iv
Sams Teach Yourself TPC/IP in 24 Hours
From the Library of Athicom Parinayakosol
ptg
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
38
Physical Addressing
40
From the Library of Athicom Parinayakosol
ptg
Ethernet 41
Anatomy of an Ethernet Frame
43
Summary
44
Q&A
44
Key Terms
45
HOUR 4:
The Internet Layer 47
Addressing and Delivering 48
Internet Protocol (IP)
50
Address Resolution Protocol (ARP)
62
Reverse ARP (RARP)
63
Internet Control Message Protocol (ICMP)
63
Other Internet Layer Protocols
64
Summary
65
Q&A
101
vi
Sams Teach Yourself TPC/IP in 24 Hours
From the Library of Athicom Parinayakosol
ptg
Summary 102
Q&A
103
Key Terms
104
HOUR 7:
The Application Layer 107
What Is the Application Layer? 107
The TCP/IP Application Layer and OSI
108
Network Services
109
APIs and the Application Layer
114
TCP/IP Utilities
115
Summary
116
Q&A
116
Key Terms
117
Part III: Networking with TCP/IP
HOUR 8: Routing 121
Routing in TCP/IP 121
ptg
Summary 171
Q&A
171
Key Terms
172
HOUR 10:
Firewalls 175
What Is a Firewall? 175
Firewall Options
177
The DMZ
178
Firewall Rules
180
Proxy Service
181
Reverse Proxy
182
Summary
183
Q&A
183
Key Terms
184
HOUR 11:
Name Resolution 185
What Is Name Resolution? 185
Name Resolution Using Hosts Files
187
Sams Teach Yourself TPC/IP in 24 Hours
From the Library of Athicom Parinayakosol
ptg
Network Address Translation (NAT) 223
Zero Configuration
224
Summary
227
Q&A
227
Key Terms
228
HOUR 13:
IPv6—The Next Generation 229
Why a New IP? 229
IPv6 Header Format
232
IPv6 Addressing
236
IPv6 with IPv4
237
IPv6 and Quality of Service (QoS)
238
Summary
239
Q&A
239
Key Terms
240
Part IV: TCP/IP Utilities
From the Library of Athicom Parinayakosol
ptg
HOUR 15: Monitoring and Remote Access 275
Telnet 275
Berkeley Remote Utilities
278
Secure Shell (SSH)
282
Screen Sharing
283
Simple Network Management Protocol
284
Remote Monitoring
289
Summary
291
Q&A
291
Key Terms
292
Part V: TCP/IP and the Internet
HOUR 16: The Internet: A Closer Look 297
How the Internet Looks 297
What Happens on the Internet
299
URIs and URLs
301
Summary
304
Q&A
Retrieving the Mail
328
Email Readers
331
Webmail
333
Spam
334
Summary
336
Q&A
337
Workshop
337
Key Terms
338
HOUR 19:
Streaming and Casting 339
The Streaming Problem 339
Realtime Transport Protocol (RTP)
341
Transport Options
343
Multimedia Links
344
Podcasting
346
Voice Over IP (VoIP)
347
Summary
XHTML
367
Peer-to-Peer
368
IRC and Instant Messaging
369
The Semantic Web
371
Summary
372
Q&A
373
Key Terms
373
HOUR 22:
Network Intrusion 375
Vandals and Cyber-Crooks 375
What Do Intruders Want?
376
Root Access
385
Going Phishing
386
Denial-of-Service Attacks
387
Summary
389
Key Terms
389
HOUR 23:
ing and system administration. He has written or co-written 12 books on computers and
networking. In a past life, he was the editor of C/C++ Users Journal and senior editor of
UnixReview.com.
From the Library of Athicom Parinayakosol
ptg
Dedication
To the sound of three hands clapping.
—Joe Casad
Acknowledgments
Thanks to Trina MacDonald, Michael Thurston, Betsy Harris, and Ravi Prakash for their
patience and good advice. I would also like to acknowledge the following individuals for
their contributions to previous editions of Sams Teach Yourself TCP/IP in 24 Hours: Bob
Willsey, Sudha Putnam, Walter Glenn, Art Hammond, Jane Brownlow, Jeff Koch, Mark
Renfrow, Vicki Harding, Mark Cierzniak, Marc Charney, and Jenny Watson.
From the Library of Athicom Parinayakosol
ptg
We Want to Hear from You!
As the reader of this book, you are our most important critic and commentator. We value
your opinion and want to know what we’re doing right, what we could do better, what
areas you’d like to see us publish in, and any other words of wisdom you’re willing to pass
our way.
You can email or write me directly to let me know what you did or didn’t like about this
book—as well as what we can do to make our books stronger.
Please note that I cannot help you with technical problems related to the topic of this book, and
that due to the high volume of mail I receive, I might not be able to reply to every message.
When you write, please be sure to include this book’s title and author as well as your name
and phone or email address. I will carefully review your comments and share them with the
author and editors who worked on the book.
E-mail:
Mail: Mark Taub
How to Use This Book
The books in the Sams Teach Yourself series are designed to help you learn a topic in a few
easy and accessible sessions. Sams Teach Yourself TCP/IP in 24 Hours, Fourth Edition, is divided
into six parts. Each part brings you a step closer to mastering the goal of proficiency in
TCP/IP.
.
Part I, “TCP/IP Basics,” introduces you to TCP/IP and the TCP/IP protocol stack.
.
Part II, “The TCP/IP Protocol System,” takes a close look at each of TCP/IP’s protocol
layers: the Network Access, Internet, Transport, and Application layers. You learn
about IP addressing and subnetting, as well as physical networks and application
services. You’ll also learn about the protocols that operate at each of TCP/IP’s layers.
From the Library of Athicom Parinayakosol
ptg
.
Part III, “Networking with TCP/IP,” describes some of the devices, services, and utilities
necessary for supporting TCP/IP networks. You learn about routing and network hard-
ware, DHCP, DNS, and IPv6.
.
Part IV, “TCP/IP Utilities,” introduces some of the common utilities used to configure,
manage, and troubleshoot TCP/IP networks. You learn about Ping, Netstat, FTP,
Telnet, and other network utilities.
.
Part V, “TCP/IP and the Internet,” describes the world’s largest TCP/IP network: the
Internet. You learn about the structure of the Internet. You also learn about HTTP,
HTML, XML, email, and Internet streaming.
.
Part VI, “Advanced Topics,” describes topics such as web services, messaging, the
semantic web, and TCP/IP security. Part VI ends with a case study showing how the
components of TCP/IP interact in a real working environment.
through the exercises to see how the tools work in a real network implementation.
Key Terms
Each hour includes a summary of important key terms that are introduced in the hour. The
key terms are compiled into an alphabetized list at the end of each hour.
Introduction
3
By the
Way
From the Library of Athicom Parinayakosol
ptg
This page intentionally left blank
From the Library of Athicom Parinayakosol
ptg
PART I
TCP/IP Basics
HOUR 1 What Is TCP/IP? 7
HOUR 2
How TCP/IP Works 21
From the Library of Athicom Parinayakosol
ptg
This page intentionally left blank
From the Library of Athicom Parinayakosol
ptg
HOUR 1
What Is TCP/IP?
What You’ll Learn in This Hour:
.
Networks and network protocols
.
History of TCP/IP