100% found this document useful (2 votes)
165 views

Download Mastering the Internet XHTML and JavaScript 2nd Edition Edition Zeid ebook All Chapters PDF

The document promotes various ebooks available for download on ebookgate.com, including titles on web development, JavaScript, and internet literacy. It features the second edition of 'Mastering the Internet, XHTML, and JavaScript' by Ibrahim Zeid, along with other related books. The document also outlines the structure and contents of the featured book, including chapters on internet literacy, XHTML, and JavaScript.

Uploaded by

oludeshoel
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
165 views

Download Mastering the Internet XHTML and JavaScript 2nd Edition Edition Zeid ebook All Chapters PDF

The document promotes various ebooks available for download on ebookgate.com, including titles on web development, JavaScript, and internet literacy. It features the second edition of 'Mastering the Internet, XHTML, and JavaScript' by Ibrahim Zeid, along with other related books. The document also outlines the structure and contents of the featured book, including chapters on internet literacy, XHTML, and JavaScript.

Uploaded by

oludeshoel
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 80

Get the full ebook with Bonus Features for a Better Reading Experience on ebookgate.

com

Mastering the Internet XHTML and JavaScript 2nd


Edition Edition Zeid

https://ebookgate.com/product/mastering-the-internet-xhtml-
and-javascript-2nd-edition-edition-zeid/

OR CLICK HERE

DOWLOAD NOW

Download more ebook instantly today at https://ebookgate.com


Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

Mastering Dojo JavaScript and Ajax Tools for Great Web


Experiences 1st Edition Craig Riecke

https://ebookgate.com/product/mastering-dojo-javascript-and-ajax-
tools-for-great-web-experiences-1st-edition-craig-riecke/

ebookgate.com

Psychology and the Internet 2nd Edition Jayne Gackenbach

https://ebookgate.com/product/psychology-and-the-internet-2nd-edition-
jayne-gackenbach/

ebookgate.com

JavaScript Pocket Reference 2nd Edition Flanagan

https://ebookgate.com/product/javascript-pocket-reference-2nd-edition-
flanagan/

ebookgate.com

JavaScript Cookbook 2nd Edition Shelley Powers

https://ebookgate.com/product/javascript-cookbook-2nd-edition-shelley-
powers/

ebookgate.com
The Internet in the Schools 2nd Edition Duncan Grey

https://ebookgate.com/product/the-internet-in-the-schools-2nd-edition-
duncan-grey/

ebookgate.com

Murach s JavaScript 2nd Edition Mary Delamater

https://ebookgate.com/product/murach-s-javascript-2nd-edition-mary-
delamater/

ebookgate.com

JavaScript 2 0 the complete reference 2nd ed Edition


Schneider

https://ebookgate.com/product/javascript-2-0-the-complete-
reference-2nd-ed-edition-schneider/

ebookgate.com

HTML XHTML and CSS Bible 3rd Edition Pfaffenberger B.

https://ebookgate.com/product/html-xhtml-and-css-bible-3rd-edition-
pfaffenberger-b/

ebookgate.com

CoffeeScript Accelerated javascript Development 2nd


Edition Trevor Burnham

https://ebookgate.com/product/coffeescript-accelerated-javascript-
development-2nd-edition-trevor-burnham/

ebookgate.com
MASTERING
THE INTERNET,
XHTML,
AND JAVASCRIPT
Second Edition

Ibrahim Zeid
Northeastern University

Upper Saddle River, NJ 07458


Library of Congress Cataloging-in-Publication Data
CIP Data on File

Vice President and Editorial Director, ECS: Marcia Horton


Senior Acquisitions Editor: Kate Hargett
Assistant Editor: Sarah E. Parker
Editorial Assistant: Michael Giacobbe
Vice President and Director of Production and Manufacturing, ESM: David W. Riccardi
Executive Managing Editor: Vince O’Brien
Managing Editor: Camille Trentacoste
Production Editor: Lakshmi Balasubramanian
Director of Creative Services: Paul Belfanti
Creative Director: Carole Anson
Art Director and Cover Manager: Jayne Conte
Managing Editor, AV Management and Production: Patricia Burns
Art Editor: Gregory Dulles
Manufacturing Manager: Trudy Pisciotti
Manufacturing Buyer: Lisa McDowell
Marketing Manager: Pamela Hersperger

© 2004 Pearson Education, Inc.


Pearson Prentice Hall
Pearson Education, Inc.
Upper Saddle River, NJ 07458

All rights reserved. No part of this book may be reproduced, in any form or by any means, without permission in writing from
the publisher.

Pearson Prentice Hall® is a trademark of Pearson Education, Inc.


The author and publisher of this book have used their best efforts in preparing this book. These efforts include the
development, research, and testing of the theories and programs to determine their effectiveness. The author and publisher
make no warranty of any kind, expressed or implied, with regard to these programs or the documentation contained in this
book. The author or publisher shall not be liable in any event for incidental or consequential damage in connection with, or
arising out of, the furnishing, performance, or use of these programs.

Product names mentioned herein are the trademarks or registered trademarks of their respective owners.

AceHTML, Acoustica, Active Movie, Adobe Illustrator, Adobe Photoshop, AIM, AOLserver, Apache, CoffeeCup, Commerce-
Server, CoolEdit, Crazy Browser, Domino, Enterprise Server, Eudora, FrontPage, GoldWave, HotDog Pro, Hotmail, HotMetal
Pro, Indeo video, Internet Information Server, Java Web server, Kamboo! Factory, Lview, Macromedia, Mapedit, Maplay 32,
Media Player, MicroServer, Microsoft Access, Microsoft Excel, Microsoft Internet Explorer, Microsoft Outlook Express,
mIRC, MSN Messenger, NCSA HTTPD, Netscape Communicator, Netscape Composer, Netscape Enterpirse Server, Netscape
Navigator, Opera, Oracle Web Application Server, Page Mill, Paint, Paint Shop Pro, Personal Web Server, SnagIt, Sound
catcher, SoundEdit Pro II, Sound Forge, Sound Recorder, Sox, Synchrome’s Maestro V, ThumbsPlus, Tomcat, VMPEG, Web-
EditPRO, WebImage, Winamp, Windows, wintel32, winzip, WS FTL LE, ws_ftp32, Yahoo! Mail, and Yahoo! Messenger.

Printed in the United States of America


10 9 8 7 6 5 4 3 2 1

ISBN: 0-13-140086-X

Pearson Education Ltd., London


Pearson Education Australia Pty. Ltd., Sydney
Pearson Education Singapore, Pte. Ltd.
Pearson Education North Asia Ltd., Hong Kong
Pearson Education Canada, Inc., Toronto
Pearson Educación de Mexico, S.A. de C.V.
Pearson Education—Japan, Tokyo
Pearson Education Malaysia, Pte. Ltd.
Pearson Education, Inc., Upper Saddle River, New Jersey
To all my students
who taught me
how to teach.
This page intentionally left blank
Brief Contents

Part I: Internet Literacy

Chapter 1 Overview of the Internet .................................................................3


Chapter 2 Web Browsers...............................................................................35
Chapter 3 E-Mail Tools .................................................................................89
Chapter 4 Instant Messaging ......................................................................145
Chapter 5 Lists and Newsgroups ................................................................175
Chapter 6 Security and Privacy ..................................................................191
Chapter 7 Searching the Internet ...............................................................209
Chapter 8 FTP and Telnet ...........................................................................227

Part II: XHTML

Chapter 9 XHTML Essentials ......................................................................241


Chapter 10 Images and Maps ........................................................................299
Chapter 11 Web Design .................................................................................333
Chapter 12 Tables..........................................................................................351
Chapter 13 Layers .........................................................................................385
Chapter 14 Frames ........................................................................................407
Chapter 15 Forms ..........................................................................................437
Chapter 16 Cascading Style Sheets ..............................................................479
Chapter 17 HTML Editors .............................................................................505
Chapter 18 Server-Side Scripting ..................................................................527

v
vi Brief Contents

Part III: JavaScript

Chapter 19 JavaScript Syntax .......................................................................567


Chapter 20 Functions and Arrays .................................................................607
Chapter 21 Handling Events .........................................................................637
Chapter 22 Objects ........................................................................................671
Chapter 23 Windows and Frames..................................................................715
Chapter 24 Processing Form Input ...............................................................747
Chapter 25 Temporal Control .......................................................................817
Chapter 26 Cookies .......................................................................................835
Appendix A Glossary .....................................................................................871
Index ..............................................................................................................885
Contents

Preface.................................................................................................xxi

Part I: Internet Literacy

Chapter 1 Overview of the Internet ......................................................... 3


1.1 Introduction 4
1.2 The Internet and the World Wide Web 4
1.3 Internet Jargon 6
1.4 Client/Server Model 6
1.5 Client/Server Diagnostic Commands 8
1.6 Evolution of the Internet and the World Wide Web 9
1.7 Transmission across the Internet 11
1.8 IP Addresses and URLs 14
1.9 Internet Domain Names 15
1.10 E-Mail Addresses 16
1.11 File Protocols on the Internet 17
1.12 File Compression and Decompression 18
1.13 Intranets and Extranets 20
1.14 Connecting to the Internet 21
1.14.1 T-Carrier System 22
1.14.2 Point-to-Point Dial-Up Connection 22
1.15 Types of Modems 24
1.16 Internet Tools 26
1.17 Tutorials 26
1.17.1 Use Client/Server Diagnostic Commands (Study Sections 1.4 and 1.5) 26
1.17.2 Use DNS Lookup Tables (Study Sections 1.7, 1.8, and 1.9) 28

vii
viii Contents

1.17.3 Use File Protocols in a Browser (Study Section 1.11) 28


1.17.4 Using WinZip to Zip and Unzip Files (Study Section 1.12) 29
1.17.5 Create a PPP Dial-Up Connection in Windows (Study Section 1.14) 30
1.17.6 Create and Use a Screen Capture (Study Section 1.16) 30
FAQs 30
Blackbox 31
Check Your Progress 33
Problems 34

Chapter 2 Web Browsers........................................................................ 35


2.1 Introduction 36
2.2 Finding a Web Page 37
2.3 Browser Tasks 37
2.4 The Two Major Browsers 39
2.5 Browser Window Structure 43
2.6 Internet Explorer 44
2.6.1 Menus 44
2.6.2 Toolbars 47
2.7 Netscape Communicator 49
2.7.1 Menus 49
2.7.2 Toolbars 52
2.8 Opera 53
2.8.1 Menus 53
2.8.2 Toolbars 55
2.9 Crazy Browser 55
2.9.1 Menus 56
2.9.2 Toolbars 56
2.10 Managing Web Pages in a Browser 58
2.11 Browser Cache 59
2.12 Plug-Ins 61
2.13 Bookmarks 61
2.14 History List 66
2.15 Customization 66
2.16 Security 70
2.17 Wireless Browsing 74
2.18 Tutorials 76
2.18.1 Manage Cookies in Browsers (Study Sections 2.6–2.9 and 2.15) 76
2.18.2 Browser Cache (Study Section 2.11) 77
2.18.3 Use Browser Skins (Study Section 2.15) 78
FAQs 79
Blackbox 81
Quick reference for using the IE 6.0 browser 81
Quick reference for using Netscape 4.8 82
Contents ix

Quick reference for using Netscape 7.01 84


Quick reference for using Opera 7 85
Quick reference for using Crazy Browser 86
Check Your Progress 87
Problems 88

Chapter 3 E-Mail Tools.......................................................................... 89


3.1 Introduction 90
3.2 Communication 91
3.3 Protocols 93
3.4 Content, Attachments, and Etiquette 98
3.5 Acronyms and Emoticons 101
3.6 E-Mail Clients and Web-Based E-Mail 101
3.7 Eudora 103
3.8 Outlook Express 105
3.9 Netscape Messenger and Mailer 109
3.10 Opera M2 111
3.11 Hotmail 113
3.12 Yahoo! Mail 114
3.13 S-Mail 115
3.14 E-Mail Activities 116
3.15 Managing E-Mail 119
3.16 Wireless E-Mail 129
3.17 Tutorials 129
3.17.1 Open and Save E-Mail Attachments (Study Sections 3.4 and 3.14) 129
3.17.2 Word Wrap of an E-Mail Message’s Text (Study Sections 3.7–3.10) 130
3.17.3 Security in Eudora (Study Section 3.7) 130
3.17.4 Security in Outlook Express (Study Section 3.8) 130
3.17.5 Import E-Mail Messages and Address Books (Study Section 3.15) 131
FAQs 131
Blackbox 133
Quick reference for using Eudora 5.2 134
Quick reference for using Outlook Express 136
Quick reference for using Netscape 138
Quick reference for using Opera M2 139
Quick reference for using Hotmail 141
Quick reference for using Yahoo! Mail 142
Check Your Progress 143
Problems 144

Chapter 4 Instant Messaging............................................................... 145


4.1 Introduction 146
4.2 Text-Only Web Chatting 147
x Contents

4.2.1 Bulletin Board System 148


4.2.2 Internet Relay Chat 149
4.3 Instant Messaging 150
4.4 AIM 152
4.5 Yahoo! Messenger 155
4.6 MSN Messenger 160
4.7 Opera Instant Messaging 165
4.8 Webcasting 165
4.9 Wireless Instant Messaging 166
4.10 Tutorials 166
4.10.1 Use Acronyms and Emoticons in AIM (Study Section 4.4) 166
4.10.2 Use AIM to Send an Image or a File (Study Section 4.4) 166
4.10.3 Use Yahoo! Web Messenger (Study Section 4.5) 167
4.10.4 Use MSN Messenger to Send a File or Photo (Study Section 4.6) 168
FAQs 169
Blackbox 170
Quick reference for using AIM 171
Quick reference for using Yahoo! Messenger 172
Quick reference for using MSN Messenger 173
Check Your Progress 174
Problems 174

Chapter 5 Lists and Newsgroups.......................................................... 175


5.1 Introduction 176
5.2 Mailing Lists 176
5.3 Discussion Groups 178
5.4 Usenet Newsgroups 180
FAQs 187
Blackbox 187
Quick reference for using Outlook Express as a newsreader 188
Check Your Progress 188
Problems 189

Chapter 6 Security and Privacy........................................................... 191


6.1 Introduction 192
6.2 Fraud 193
6.3 Crackers 194
6.4 Firewalls 195
6.5 P3P 196
6.6 Sniffing and Web Bugs 198
6.7 Web Stalking 199
6.8 Censorship 200
6.9 TRUSTe 201
6.10 EPIC 201
Contents xi

6.11 .NET Passport 202


6.12 Liberty Alliance Project 203
FAQs 204
Blackbox 205
Check Your Progress 206
Problems 207

Chapter 7 Searching the Internet........................................................ 209


7.1 Introduction 210
7.2 Directories 210
7.3 Open Directory Project 212
7.4 Search Engines 213
7.5 Metasearch Engines 215
7.6 Search Techniques 215
7.6.1 Word and Exact-Phrase Searches 216
7.6.2 Boolean Search 217
7.6.3 Other Searches 218
7.7 Intelligent Agents 220
7.8 Invisible Web 221
FAQs 223
Blackbox 224
Quick reference for using search techniques in Google 224
Check Your Progress 225
Problems 225

Chapter 8 FTP and Telnet ................................................................... 227


8.1 Introduction 228
8.2 File Types 228
8.3 FTP 230
8.4 Telnet 234
8.5 Tutorials 235
8.5.1 Use FTP and Telnet Sessions Together (Study Sections 8.3 and 8.4) 235
FAQs 237
Blackbox 237
Quick Reference for File Types 237
Check Your Progress 238
Problems 238

Part II: XHTML

Chapter 9 XHTML Essentials............................................................... 241


9.1 Introduction 242
9.2 Websites and Web Pages 242
9.3 Content of Web Pages 244
xii Contents

9.4 Authoring of Web Pages 245


9.5 XHTML Syntax 246
9.6 XHTML Document Structure 248
9.7 Authoring Tools 251
9.8 Text Formatting 253
9.9 Special Characters 257
9.10 Hyperlinks 260
9.10.1 Links 260
9.10.2 Anchors 264
9.11 Lists 266
9.11.1 Unordered Lists 266
9.11.2 Ordered Lists 268
9.11.3 Definition Lists 270
9.11.4 Nested Lists 271
9.11.5 Nontext List Items 273
9.12 Metadata 274
9.13 Colors 275
9.13.1 RGB Color Model 275
9.13.2 Hexadecimal Codes 276
9.13.3 Using Colors in Web Pages 276
9.14 Audio and Video 279
9.15 Tutorials 283
9.15.1 Using Character Sets (Study Section 9.9) 283
9.15.2 Personal Web Site (Study Sections 9.8 and 9.10) 284
9.15.3 Create Anchors (Study Section 9.10) 286
9.15.4 Organizational Structure (Study Section 9.11) 288
FAQs 290
Blackbox 291
Quick reference for the tags presented in this chapter 293
Check Your Progress 295
Problems 296

Chapter 10 Images and Maps ............................................................... 299


10.1 Introduction 300
10.2 Color Palettes and Lookup Tables 300
10.3 Dithering 301
10.4 Image Formats 302
10.5 Image and Map Software 303
10.6 Image Operations 305
10.6.1 Image Creation 305
10.6.2 Image Editing 307
10.6.3 Image Capture 307
10.6.4 Image Scaling 308
10.7 Using Images 308
Contents xiii

10.8 Image Animation 314


10.9 Image Maps 315
10.10 Types of Image Maps 316
10.11 Creating Image Maps 316
10.12 Using Image Maps 319
10.12.1 Define the Image 319
10.12.2 Define the Virtual Shapes 319
10.12.3 Define the Context 320
10.13 Tutorials 322
10.13.1 Using Map-Based Buttons (Study Sections 10.9 and 10.12) 322
10.13.2 Overlapping Hot Spots (Study Section 10.12) 323
FAQs 325
Blackbox 328
Quick reference for chapter tags 328
Check Your Progress 329
Problems 330

Chapter 11 Web Design........................................................................ 333


11.1 Introduction 334
11.2 Planning 335
11.3 Elements of Web Design 336
11.4 Navigation Elements 337
11.5 Layout Design 338
11.5.1 Organization Schemes 339
11.5.2 Organization Structures 339
11.5.3 Storyboarding Site Layout 340
11.5.4 Navigation 342
11.5.5 Web Page Layout 342
11.5.6 Tables and Layers 342
11.5.7 Alignment 342
11.5.8 Proximity 343
11.5.9 Repetition 343
11.5.10 Contrast 343
11.5.11 Mapping Web Pages 343
11.6 Website Design 344
11.7 Web Page Design 345
11.8 Design Tools 347
11.9 Validation and Testing 348
11.10 Putting It All Together 348
FAQs 349
Blackbox 349
Check Your Progress 350
Problems 350
xiv Contents

Chapter 12 Tables ............................................................................... 351


12.1 Introduction 352
12.2 Table Structure and Variables 352
12.2.1 Noncell Variables 353
12.2.2 Cell Variables 354
12.3 Table Layout and Design 355
12.4 Using Tables 356
12.5 Table Rendering and Calculations 363
12.6 Nesting Tables 365
12.7 Formatting via Tables 368
12.8 Tutorials 371
12.8.1 Creating a Traditional Table (Study Section 12.4) 371
12.8.2 Creating a Site Map for Navigation (Study Section 12.7) 374
FAQs 378
Blackbox 378
Quick reference for the tags presented in this chapter 379
Check Your Progress 382
Problems 382

Chapter 13 Layers ............................................................................... 385


13.1 Introduction 386
13.2 Layer Positioning 386
13.3 Properties of Layers 387
13.4 Using Layers 388
13.5 Nesting Layers 393
13.6 Layers and Tables 396
13.7 Formatting via Layers 396
13.8 Tutorials 400
13.8.1 Creating Embossing Effects (Study Section 13.4) 400
13.8.2 Creating a Site Map for Navigation (Study Section 13.7) 401
FAQs 403
Blackbox 403
Quick reference for the tags presented in this chapter 404
Check Your Progress 405
Problems 405

Chapter 14 Frames .............................................................................. 407


14.1 Introduction 408
14.2 Frame Layout and Design 408
14.3 Frame Sets and Nesting 410
14.4 Using Frames 412
14.5 Target Frames and Windows 420
14.6 Tutorials 424
14.6.1 Using Ordered Lists in a TOC Frame (Study Section 14.5) 424
Contents xv

14.6.2 Using Image Maps with Frames (Study Section 14.5) 427
FAQs 429
Blackbox 431
Quick reference for the tags presented in this chapter 432
Check Your Progress 434
Problems 434

Chapter 15 Forms ............................................................................... 437


15.1 Introduction 438
15.2 Structure and Communication 438
15.3 Elements 440
15.4 Layout and Design 443
15.5 Using Forms 444
15.6 Formatting Forms 460
15.7 Tutorials 464
15.7.1 Performing E-Commerce (Study Section 15.5) 464
15.7.2 Guest and Alumni Books (Study Section 15.5) 466
15.7.3 Customer Survey (Study Section 15.5) 468
FAQs 471
Blackbox 472
Quick reference for the tags presented in this chapter 473
Check Your Progress 474
Problems 475

Chapter 16 Cascading Style Sheets...................................................... 479


16.1 Introduction 480
16.2 CSS Syntax 481
16.3 Linking CSS to XHTML 484
16.3.1 Inline CSS 485
16.3.2 Embedded CSS 485
16.3.3 External CSS 486
16.3.4 Imported CSS 487
16.3.5 Attributes and Tags 488
16.4 Inheritance and Cascading Order 491
16.5 The Box Model 492
16.6 Font Properties 493
16.7 Text Properties 493
16.8 Color Properties 495
16.9 Content Positioning 496
16.10 Tutorials 497
16.10.1 Using External CSS (Study Sections 16.6–16.8) 497
16.10.2 Styling Using Images (Study Sections 16.6–16.8) 499
FAQs 500
Blackbox 500
xvi Contents

Quick reference for the tags presented in this chapter 502


Check Your Progress 503
Problems 503

Chapter 17 HTML Editors .................................................................... 505


17.1 Introduction 506
17.2 Editors’ Tasks 507
17.3 Overview of Editors 509
17.4 Formatting Text 512
17.5 Creating Hyperlinks 514
17.6 Inserting Images 515
17.7 Creating Tables 516
17.8 Creating Frames and Forms 517
17.9 Tutorials 518
17.9.1 Creating Text and Links (Study Sections 17.4 and 17.5) 518
17.9.2 Creating Images and Tables (Study Sections 17.6 and 17.7) 519
FAQs 523
Blackbox 523
Check Your Progress 524
Problems 524

Chapter 18 Server-Side Scripting......................................................... 527


18.1 Introduction 528
18.2 Client/Server Architecture 530
18.3 Basics of CGI Scripting 531
18.3.1 Script Structure and Tasks 531
18.3.2 Encoding and Decoding Name/Value Pairs 532
18.3.3 Standard Environment Variables 533
18.3.4 Output Structure 534
18.4 Universal CGI Scripts 536
18.5 Web Servers 537
18.6 Apache Server 538
18.6.1 Downloading and Installing Apache 539
18.6.2 Running and Using Apache 539
18.7 Tomcat Server 547
18.7.1 Downloading and Installing Tomcat 547
18.7.2 Running and Using Tomcat 548
18.8 Tutorials 554
18.8.1 Accessing Environment Variables (Study Section 18.3.3) 554
18.8.2 Processing a Hyperlink Click (Study Section 18.7) 558
FAQs 560
Blackbox 561
Check Your Progress 562
Problems 562
Contents xvii

Part III: JavaScript

Chapter 19 JavaScript Syntax ............................................................. 567


19.1 Introduction 568
19.2 JavaScript and Java 569
19.3 Embedding JavaScript in XHTML 569
19.4 Development Environment 570
19.5 Variables 573
19.5.1 Identifiers 573
19.5.2 Types 574
19.5.3 Scope 576
19.5.4 Constants 577
19.5.5 Literals 577
19.5.6 Data-Type Conversion 577
19.5.7 Escaping and Special Characters 577
19.6 Statements 581
19.7 Expressions and Operators 582
19.7.1 Assignment Operators 582
19.7.2 Comparison Operators 582
19.7.3 Arithmetic Operators 583
19.7.4 Logical Operators 584
19.8 Control Structures 587
19.8.1 Conditional Statements 587
19.8.2 Loop Statements 590
19.9 Code Execution 595
19.10 Input and Output 595
19.11 Tutorials 597
19.11.1 Integer Division (Study Section 19.7) 597
19.11.2 Dollars and Cents (Study Section 19.7) 599
FAQs 601
Blackbox 602
Quick reference for the syntax presented in this chapter 603
Check Your Progress 605
Problems 605

Chapter 20 Functions and Arrays ........................................................ 607


20.1 Introduction 608
20.2 Function Definition 609
20.3 Function Calls 610
20.4 Predefined Functions 617
20.5 Recursion 617
20.6 Array Definition and Properties 619
20.7 Multidimensional Arrays 622
xviii Contents

20.8 Array Manipulations 625


20.9 Associative Arrays 627
20.10 Combining Functions and Arrays 628
20.11 Tutorials 630
20.11.1 Flying from Boston (Study Section 20.10) 630
FAQs 632
Blackbox 632
Quick reference for the syntax presented in this chapter 634
Check Your Progress 635
Problems 635

Chapter 21 Handling Events ................................................................ 637


21.1 Introduction 638
21.2 Event Model 639
21.3 Events 643
21.4 Event Handling 647
21.5 Navigation Events 647
21.6 On-the-Fly Web Pages 653
21.7 Web-Page Context 656
21.8 Nesting On-the-Fly Web Pages 658
21.9 Disabling XHTML Actions 662
21.10 Tutorials 664
21.10.1 Handling all Hyperlink Events (Study Section 21.5) 664
FAQs 666
Blackbox 666
Quick reference for the syntax presented in this chapter 667
Check Your Progress 669
Problems 669

Chapter 22 Objects.............................................................................. 671


22.1 Introduction 672
22.2 Definition 673
22.3 Creation and Use 674
22.3.1 Constructor Function 676
22.3.2 Instantiation 679
22.3.3 The Dot Notation (.) 680
22.3.4 The this Reference 680
22.4 Concepts 682
22.5 Inheriting and Nesting Objects 683
22.6 Document Object Model (DOM) 688
22.7 Objects and Arrays 690
22.8 document Object 694
22.9 Math Object 694
Contents xix

22.10 Date Object 698


22.11 String Object 701
22.12 Tutorials 707
22.12.1 Prime Numbers (Study Section 22.9) 707
FAQs 708
Blackbox 708
Quick reference for the syntax presented in this chapter 710
Check Your Progress 712
Problems 712

Chapter 23 Windows and Frames ......................................................... 715


23.1 Introduction 716
23.2 Browser-Related Objects 716
23.3 location Object 719
23.4 history Object 722
23.5 window Object 725
23.6 Frame Objects 732
23.7 Including JavaScript Files 735
23.8 DHTML 737
23.9 Tutorials 737
23.9.1 Animation Sequence (Study Section 23.5) 737
FAQs 743
Blackbox 743
Quick reference for the syntax presented in this chapter 744
Check Your Progress 745
Problems 745

Chapter 24 Processing Form Input ...................................................... 747


24.1 Introduction 748
24.2 Form Object 748
24.3 Form-Element Objects 749
24.4 Form Input Validation 749
24.5 Footer Scripts 768
24.6 Form Data Processing 771
24.6.1 Servlets and Spreadsheets 771
24.6.2 PHP and MySQL Database 783
24.6.3 Perl and E-Mail Processing 789
24.7 Tutorials 805
24.7.1 Automatic Filling of Form Elements (Study Section 24.4) 805
FAQs 812
Blackbox 812
Quick reference for the syntax presented in this chapter 813
Check Your Progress 814
Problems 814
xx Contents

Chapter 25 Temporal Control .............................................................. 817


25.1 Introduction 818
25.2 Timeline Animation 819
25.3 Timeline Control 819
25.4 Animation Techniques 824
25.5 Animation Tips 828
25.6 Tutorials 829
25.6.1 Creation of Random Popup Windows (Study Sections 25.3 and 25.4) 829
FAQs 831
Blackbox 832
Quick reference for the syntax presented in this chapter 832
Check Your Progress 832
Problems 833

Chapter 26 Cookies ............................................................................. 835


26.1 Introduction 836
26.2 Privacy 837
26.3 System Security 837
26.4 Types 838
26.5 Parameters 838
26.6 The cookie Property 841
26.7 Dealing with Cookies 844
26.8 Visibility 851
26.9 Tutorials 853
26.9.1 Web-Page Hit Counter (Study Sections 26.5 and 26.6) 853
26.9.2 Remember Web-Page Visitors (Study Sections 26.5 and 26.6) 856
FAQs 866
Blackbox 867
Quick reference for the syntax presented in this chapter 868
Check Your Progress 868
Problems 869

Appendix A Glossary .......................................................................... 871

Index ................................................................................................. 885


Preface

This second edition has been redesigned from the ground up to reflect and respond to many of
the suggestions the author has received since the first edition was written. It has also been rewrit-
ten to accommodate the new Internet concepts that have been developed since the first edition
was released.
This edition has many new pedagogical and content features:

• The page design and layout are completely new, with many eye-catching graphics features
for section and example headings.
• Abundant figures and screen captures have been included to illustrate concepts.
• Each chapter begins with a goal, a set of objectives, and a list of section titles; and ends
with tutorials, FAQs, a summary, a progress checklist, and problems.
• Many chapters have a “Quick reference” section at the end that summarizes software use
(Part I of the book), syntax of XHTML tags (Part II), and JavaScript syntax (Part III).
• Each section has at least one pedagogical tool, be it an image insert, a figure, a table, an
example, a tutorial, an FAQ, or a piece of advice. These tools make it easy to follow and
understand the material and minimize the need to thumb through pages in order to find
material.
• Each example and tutorial in the book has three pedagogical elements that inspire inter-
activity and deeper understanding. “Code explained” describes what particular code lines
and sections do. “Discussion” provides insight on why certain segments of code are
written the way they are. It also provides tips on running the code and cites pitfalls to
avoid. “Hands-on” asks the reader to extend the existing code to accomplish a new task.
This element is a confidence builder, as it is hard to write completely new code during the
learning process.

xxi
xxii Preface

• Each example focuses on one chapter concept only, while each tutorial combines a few
chapter concepts together to provide a more practical application.
• Concepts are explained first and then applied, using many existing software tools in one
place, so that the reader can have a conceptual overview and can compare the available
tools.
• The “FAQs” are organized by chapter sections and serve as a stimulus for discussion.
• The “Blackbox” (summary) section is tightly integrated with the chapter material. It lists
the section and example numbers where the corresponding detailed information can be
found.
• The “Check your progress” section is tightly integrated with the chapter sections. It can
serve to focus group discussions in class or as a review for exams.
• The text is written in an easy-to-follow writing style.
• All topics are covered with great attention to both depth and breadth.
• The book covers three essential elements of today’s Web pages: the Internet, XHTML, and
JavaScript.
• The book covers four major leading browsers: IE 6.0, Netscape 4.8 & 7.0, Opera 7, and
Crazy Browser 1.05.
• The book covers seven major leading e-mail tools: Eudora, Hotmail, Outlook Express 6.0,
Yahoo! Mail, Netscape 4.8 Messenger, Netscape 7.01 mailer, and Opera 7 M2.
• The book covers three major leading HTML editors: FrontPage 2002, Composer 7.01, and
AceHTML 5.0.
• The book covers two leading servers: Apache server version 2.0.45 and Tomcat server ver-
sion 4.1.24, both from the Apache Software Foundation.
The rationale behind this edition is simple, but effective: We need to provide a comprehen-
sive and complete source of Web knowledge for students to be able to learn the basics that allow
them to be proficient in client-side technologies. These technologies include Internet literacy,
XHTML, and client-side JavaScript—three essential elements that one begins studying in order
to understand the Web and Web pages today. As the Web matures and its users become more
sophisticated, both students and instructors should continue to find this book useful as a single
source for all their learning and teaching needs.
The purpose of this edition is to present the fundamental concepts of the Internet and its
scripting tools (XHTML and JavaScript) in a generic framework. These concepts and tools are
supplemented with examples, tutorials, and problems to provide readers with hands-on experi-
ence so that they can master the concepts. The book strikes a delicate balance between subject
depth and breadth, and between generic and practical aspects of the Internet. As an example of
the book’s coverage of depth and breadth, the text covers the basic topics pertaining to the Inter-
net and its effective use in daily tasks such as e-mail and searching, as well as all aspects of
client-side XHTML and JavaScript. As an example of its coverage of generic and practical
aspects, the book always relates the generic concepts to their use in technology, software, and
practical applications. For instance, the book discusses the generic concepts behind e-mail tools
Preface xxiii

and then covers the details of seven popular tools today, including e-mail clients and Web-based
mail. Another example is the use of XHTML editors: After covering the generic aspects of
XHTML, the book presents some of the commonly used HTML editors and relates their user
interfaces to the raw XHTML.
This book fills an important need in the market. Students need a book that explains the
subject matter in a simple, yet comprehensive and coherent, way, with ample examples and
hands-on tutorials. As a matter of fact, this book’s approach is a response to the nature of surf-
ing the Web: If surfers do not find what they need on a Web page in about 30 seconds, they
move on to another one. So, if a Web site does not offer visitors concentrated services and
information, it loses them. This book offers concentrated knowledge to its readers so that they
can find what they need very quickly. Students can also use the book’s companion website,
located at http://www.prenhall.com/zeid, to download the source code for each chapter
and can use the chapter’s multiple-choice questions to study and prepare for exams.
Instructors need a book that provides them with ample topics, examples, tutorials, prob-
lems, and pedagogy. For example, the instructor may use the examples, tutorials, or exercises in a
lab setting. Or the instructor may use the “Blackbox” (summary) section at the end of each chap-
ter as the basis for class discussion and review to prepare students for exams. The instructor can
also access the book’s companion website to download a complete set of PowerPoint slides and
all the book’s source code, or to use the online test bank to prepare quizzes and exams. A solu-
tions manual accompanies the book as well. Moreover, instructors who wish to have only portions
of the book, such as individual parts or selected chapters, can do so through custom publishing—
a request that Prentice Hall handles with ease through its sales representatives.
The book covers three topics: Internet literacy, XHTML, and JavaScript. If you cover the
three topics in one course, use the book as is. If you cover each topic in a separate course, order
one part per course through Prentice Hall’s custom-publishing service. Why should instructors
use this three-part volume instead of three separate books? Consistency in style, format, and
pedagogy is the reason. This consistency significantly increases the ease of using the book for
both instructors, who must prepare the material, and students, who must learn it. Reducing the
overhead of preparation and learning allows both instructors and students to devote their scarce
time to using and learning the material instead of weaving through page after page trying to fol-
low and understand three styles of three different books and authors. With the three parts of this
book, instructors and students know what to expect and where to find it.
Professionals, who are usually pressed for time, need a book that they can use for self-teach-
ing purposes. They also need a book that provides them with answers to specific questions they
may have when developing websites and Web pages. With this volume, professionals can tap into
the “Blackbox” (summary) and “FAQs” sections for quick consultation. In fact, many of the ques-
tions in the “FAQs” sections of this book are questions asked by past students and professionals.
The book is organized into three related parts. Part I covers the effective use of the Internet.
This part develops the basic skills required for using the Internet. While many readers have been
using the Internet for a long time, Part I formalizes this experience. Part II discusses, in detail,
XHTML and Web-page design and development. Part III covers client-side JavaScript. This
xxiv Preface

organization is beneficial in accommodating different course requirements and reader back-


grounds. Those who want to focus on XHTML can also use the early chapters of Part III. Those
who want to focus on JavaScript can use Part II as a review. As stated previously, if instructors or
professionals want only portions of the book, the solution is custom publishing.
As in the first edition, the problems section is divided into two parts: exercises and home-
work. The exercises can be used in a lab where class time is limited. The homework problems
are designed to be more extensive, and some of them are open ended in nature, as students have
more time outside the classroom to do them.
I am indebted to all the people who helped directly and indirectly to improve this book. I
would like to thank the following reviewers (of both the first and second editions) for their valu-
able comments, suggestions, and advice throughout the project: Floyd LeCureux of California
State University at Sacramento, Harold Grossman of Clemson University, Rayford Vaughn of
Mississippi State University, Scott Henninger of the University of Nebraska–Lincoln, Michelle
Ratliff Lee of Sante Fe Community College, Patricia Gregory of Anne Arundel Community Col-
lege, Denny Czejdo of Loyola University, and Hayden Schultz of Northeastern University. There
is no doubt that their suggestions have influenced and enhanced this book.
I would also like to thank all my students and colleagues who contributed to both editions
of this book in many ways through seminars, discussions, and courses. Special thanks are due to
the following former students who gave me their generous permission to use their work in this
book: Janet Beaudoin, Debra Buchanan, Ted Catino, John Daley, Cindy Desmond, John Doyle,
Roger Eames, Lisa Evans, Walter Frank, Adrian Goneau, Linda Haviland, Anatoli Kurkil,
Regina Lagakos, Tim Martel, Rick Mashburn, Tom Medlar, Lissa Pierson, Stephanie Rogers,
Margery Rosenblatt, David Shadmon, Suzanne Sigman, John Trainor, Donna Waugh, and Paul
Wikstrom. I also would like to acknowledge the following readers of the first edition who
informed me of typos and errata: Mohamed Assim, Lass Hellvig, Donna Mistal-Houle, Bob
Sherman, and Arnold Worsley.
Thanks are due to the Prentice Hall staff for its patience and professional help. The valu-
able experience and vision of Petra Recter permitted the successful completion of the manu-
script. Her e-mail messages and phone calls kept the project moving, and her coordination of the
review process ensured the reception of valuable feedback in a timely manner. I would also like
to thank Marcia Horton for her support of the project. In addition, I greatly appreciate the efforts
and support of Kate Hargett in finishing the review process and the project. I would like to thank
Camille Trentacoste and Lakshmi Balasubramanian for helping with all production issues as
well. Many thanks are also due to Jessica Fitzpatrick for editing the early chapters of the book
and providing very valuable feedback and suggestions.
Last, but not least, very special thanks are due to my family and friends, who supported
me from start to finish with their love and encouragement, which are greatly appreciated.
IBRAHIM ZEID
Boston
P A R T I

Internet Literacy

This part covers all the plumbing of the Internet, an important foundation that students must
understand. This part helps put Parts II and III in context. The goal of this part is to provide a
solid and clear understanding of the basic concepts of the Internet and World Wide Web. To
achieve this goal, this part helps readers accomplish the following objectives:
1. Understand and master the client/server model, IP addresses, URLs, e-mail addresses, file
protocols and compression, and Internet connections (Chapter 1).
2. Understand and master four Web browsers (Internet Explorer 6.0, Netscape 4.8 and 7.01,
Crazy Browser 1.05, and Opera 7) (Chapter 2).
3. Understand and master e-mail concepts, e-mail clients (Eudora 5.2, Outlook Express 6.0,
Netscape 4.8 and 7.01, and Opera 7), and Web-based e-mail (Hotmail and Yahoo! Mail)
(Chapter 3).
4. Understand and master synchronous Web communication such as instant messaging, Web
chat (BBS, chat rooms, and IRC channels), and Webcasting (Chapter 4).
5. Understand and master asynchronous Web communication such as mailing lists, discus-
sion groups, and Usenet newsgroups (Chapter 5).
6. Understand and master the security and privacy issues associated with using the Internet
(Chapter 6).
7. Understand and master searching the Internet via a number of techniques (Chapter 7).
8. Understand and master FTP and Telnet concepts (Chapter 8).

1
This page intentionally left blank
1
Overview of the
Internet

Goal
Understand and master some of the basic concepts of the Internet and the World Wide Web in
order to be able to use them effectively in ordinary life, as well as in professional activities.

Objectives
• Client/server model
• Data and file transmission across the Internet
• URLs and IP addresses as unique Internet IDs
• The structure of e-mail addresses
• File protocols and compression and decompression of files
• Inranets and extranets
• Requirements and types of Internet connections
• Modem types

3
4 Chapter 1 • Overview of the Internet

Outline
1.1 Introduction
1.2 The Internet and the World Wide Web
1.3 Internet Jargon
1.4 Client/Server Model
1.5 Client/Server Diagnostic Commands
1.6 Evolution of the Internet and the World Wide Web
1.7 Transmission across the Internet
1.8 IP Addresses and URLs
1.9 Internet Domain Names
1.10 E-mail Addresses
1.11 File Protocols on the Internet
1.12 File Compression and Decompression
1.13 Intranets and Extranets
1.14 Connecting to the Internet
1.15 Types of Modems
1.16 Internet Tools
1.17 Tutorials
FAQs -Blackbox -Check Your Progress - Problems

1.1 Introduction
The Internet has been acknowledged as the source of a profound information revolution. It has
already changed our lives and the ways in which we communicate and conduct business. For
example, many of us send e-mail messages back and forth to friends, colleagues, customers, cli-
ents and relatives all over the world. The Internet provides an instant mode of communication in
the form of electronic mail—or e-mail for short—and instant messaging. You can even meet
people on the Internet. Web pages clutter the Internet. Today, Internet Yellow Pages assist in
helping people sift through the clutter. There is no doubt that this medium of communication
will dominate and surpass any other medium. The Internet had more users in its first 5 years than
the telephone did in its first 30 years, and the volume of e-mail sent everyday already outnum-
bers that of regular mail.
While hearing and reading about the Internet is exciting, putting all its related pieces
together is often confusing. This chapter provides an overview of the structure of the Internet,
explains how the Internet works, and discusses the different types of connections to the Internet.

1.2 The Internet and the World Wide Web


The Internet encompasses diverse computers and programs working together seamlessly as a
network. A network is a collection of devices (such as computers and printers) that are con-
nected together by communication paths. These devices are called the nodes of the network, and
The Internet and the World Wide Web 5

the communication paths may be wires, fiber-optic cables, or wireless connections. The Internet
is a network of networks. These networks include various federal networks, a set of regional net-
works, campus networks, and foreign networks. The Internet connects many geographical
regions; sometimes it is known as the “information superhighway.” It also enables worldwide
international networks to communicate with each other.
This definition of the Internet typically does not mean much to the end user. The user only
wants to do something specific, such as run a program, access a website, or download a particu-
lar file. As such, an end user does not need to worry about how the Internet is put together. A
good analogy is the telephone system; it, too, is a network. Phone companies such as AT&T,
MCI, and Sprint are all separate corporations running pieces of the telephone system. They
worry about how to make it all work together; all the user has to do is dial the number. The user
begins to worry only when a problem occurs, such as when a phone call cannot be completed. In
such cases, the company that owns the part of the phone system causing the problem should fix
it. The same is true for the Internet: Each network has its own operations center. If something
goes wrong with the network, the center that operates it should fix the problem.
The Internet’s driving force is the World Wide Web (also known as WWW, W3, or the
Web), the section of the Internet that features multimedia capabilities (i.e., has video, audio,
images, graphics, and text). The Web began to take off after Mosaic, the first graphical Web
viewer (browser), came out in 1994 and has quickly become a vast network of data, news, shop-
ping guides, promotional materials, periodicals, and Web pages, displayed in colors, often with
audio and video output. As described in detail in Part II of the book, extensible hypertext markup
language (XHTML) allows website creators to link their Web pages to other pages, with each
page accessed by a simple click of the mouse button.

Internet

WWW

The Internet links powerful servers in every part of the world. A server is a program that
resides on a computer and provides services for other computer programs known as clients. A
particular computer may contain both client and server programs. Web users can transfer files to
and from other computers (known as uploading and downloading, respectively), send electronic
messages to the e-mail addresses of other users, and set up their own Web pages for whatever
purpose they desire. Companies, universities, government agencies, and individuals throughout
the world now maintain pages on the Web, and the demand for Web access is increasing PC
(personal computer) use.
The methods for finding and accessing information on the Internet are very unique. Tradi-
tionally, as found in libraries, information is organized in books that are indexed and shelved in
6 Chapter 1 • Overview of the Internet

order, according to a standard classification system. Unlike information in libraries, however,


information on the Internet is not organized at all. Information is contained in Web pages. In
order to find a particular piece of information, a Web surfer uses a search engine. A Web surfer
is a person who uses the Internet to find desired information. A search engine is a computer pro-
gram that helps you find specific information on the Web. The Web surfer types a search string
(one or more words that might be found in websites containing the information), and the search
engine returns links to the Web pages that contain the string (usually known as hits).
The conclusion drawn from the foregoing analogy is that we need to use a different mental
model when dealing with information on the Web. The heart of this model is a dynamic nature
and randomness of information. Thus, one should not tend to memorize the addresses and titles
of websites, but rather learn how to search for information effectively.

1.3 Internet Jargon


The Internet field is full of acronyms and new words. The chapters of this book introduce defini-
tions as we need them, and these definitions are listed again in the glossary in Appendix A. For
additional information on Internet jargon, refer to the following websites or use a search engine:
http://www.whatis.com and http://www.webopaedia.com.

1.4 Client/Server Model


The client/server model is central to Internet communication, distributed networked computing,
and services. This model uses two computer programs installed on two separate, but networked,
computers at different locations. The client program (or client, for short) installed on one com-
puter (known as the client computer) communicates with the server program (or server, for short)
installed on the other computer (known as the server computer), as shown in Figure 1.1. The client
requests services from the server. While the server is running, it acts as a daemon. A daemon is a
process that awaits (“listens” to) client requests. When it receives a request from a client, it grants
the request and sends a response back to the client. A common example of client/server communi-
cation is a Web browser acting as a client when requesting a Web page from a Web server.
Multiple clients can access a server concurrently. This situation increases the demand
(known as the server load, traffic, or number of hits) on the server and may slow its response
time significantly. In such a case, the server computer (also known as the host computer or host
machine, or host for short) must be upgraded or replaced with a faster computer to handle the
increased demand. Balancing a server’s load to improve its response time is a very interesting
and practical problem, but is beyond the scope of this book.

Client
Server

Clients

Client
Client/Server Model 7

Client computer Server computer


Client request

Daemon

Client Internet Server

Server response
(a) One client and one server

Server 1 Server 2

Client 1 Internet Client 2

(b) Multiple clients and servers

Figure 1.1 Client/server model.

Client/server databases are used extensively on the Web. A database is a set of data that is
organized and stored in a file or many files. For example, a bank customer can use a browser to
access the bank’s database, installed on a server, to check his or her account balance. A common
architecture of a client/server database is the two-tier model, where two networked computers
are used as shown in Figure 1.1(a). The client, running as an application in a browser, sends
requests (queries) to the database. The database, accessed through a server, sends the query
results back to the client. Another architecture is the three-tier model, where a middle server is
added between the database and the client for security purposes.

Client Middle server DB server

Database
access
Application Database
program
and rules

Three-tier database model


8 Chapter 1 • Overview of the Internet

The client/server model and the increasing accessibility of the Internet have spurred the
concept of remote hosting of applications for delivery over the Internet. A subscriber can rent
any of these applications from an ASP (application server provider) for a fee, instead of install-
ing and maintaining the applications in-house. The ASP hosts the software on its Web servers,
which entails purchasing, installing, maintaining, managing, and upgrading it. The burden of
computing then shifts from the client (subscriber) to the ASP server. Renting software applica-
tions from ASPs frees subscribers’ resources, saves subscribers money, and allows them to focus
on their core activities. The evaluation and choice of an ASP should include an assessment of the
service, support, scalability (can it handle a significant increase in the number of users or
amount of data?), and security the ASP provides.

1.5 Client/Server Diagnostic Commands


There are many operating system–level (OS-level) commands that a client can use to probe
communication with a server. These commands are supported by major OSs such as Windows
and Unix. We cover three commands in this section: finger, ping, and traceroute.
Refer to Tutorial 1.17.1 for an exercise in their use. We cover the nslookup command in
Section 1.8.
The finger command allows you to find out who is currently logged into a given host
or whether a particular user is logged in. To finger a host, use the command finger
hostname—for example, finger neu.edu, for which the result would be a list of the
users currently logged into the neu.edu host. To finger a particular user, use the command
finger username@hostname—for example, finger zeid@coe.neu.edu. If the
user is logged in, you will receive back the login name, the last name, and the logging time of
the user. You need to realize that some computers may reject the finger command, for secu-
rity reasons.
The ping command allows a client to check whether a server is up and running. The gen-
eral command syntax is ping hostname—for example, ping neu.edu. The command
returns whether the host is up or down. This command is helpful to use before you connect to a
host.
The traceroute (Unix) and tracert (Windows) commands trace the transmission
route that data take from a client to a server. The general command syntax is traceroute
hostname—for example, traceroute www.mit.edu. The route is measured in term of
hops. A hop is the trip that data take from one router to another. Alternatively, a hop is an inter-
mediate network node that data pass through. The command also calculates and displays the
amount of time each hop takes. traceroute is useful in debugging network problems, espe-
cially with respect to determining where they are.
There are computer programs that include finger, ping, traceroute, and other
diagnostic commands. Interested readers can search for Internet sites from which they may
download and install one of these programs. To do so, go to a search engine and enter the string
“ping and trace tools”. Examples of the programs include NetMaps and CyberKit.
Evolution of the Internet and the World Wide Web 9


Example 1.1 Use client/server diagnostic commands.
Check the status of the following two hosts: mit.edu and neu.edu. How many hops it takes
to connect to each host?
Solution 1.1 Type the following two commands in a DOS window: ping mit.edu and
ping neu.edu. Observe the output. Then enter these two commands: tracert mit.edu
and tracert neu.edu. Count the number of hops for each command. See Tutorial 1.17.1
for more details.

1.6 Evolution of the Internet and the World Wide Web


This section provides a brief history of the Internet and some of its milestone events. For further
information, the reader can enter a search string such as “history of the Internet” into a search
engine. Early research on the concept of the Internet began in 1962 at the Advanced Research
Project Agency (ARPA; then known as DARPA) within the Department of Defense (DoD).
Researchers sought to study the feasibility of communication using packets (see page 11 for def-
initions). This concept is what fueled computer networking. The Internet was born when ARPA
established ARPAnet in an effort to connect together the U.S. DoD networks. In 1969, four com-
puters were connected via ARPAnet, and in 1971 this connection was successfully demonstrated
to military personnel 1971 also brought the invention of e-mail.
Much of the time during the 1970s was spent on researching the idea of open-architecture
networking, as well as on the development of Ethernet (the most widely installed network tech-
nology today) by Xerox. With ARPAnet and Ethernet, the United States was able to develop a
working network, and academic and research users had access to it. Other networks were soon
developed in the late 1970s and early 1980s, including CSNET, USENET, and BITNET. At
about the same time, Ethernet local area networks (LANs) were developed to allow computers,
printers, and other hardware to communicate. When desktop computers and workstations
became available, local networking exploded. Users wanted to connect their LANs to ARPAnet.
Many companies and organizations began building private networks.

Ethernet hub
LAN

NSFnet, one of the important networks developed in 1980s, was created in 1986 by the
National Science Foundation (NSF) to connect five supercomputer centers at major universities.
NSFnet was built as a result of collaboration between the NSF and ARPA. NSFnet divided the
United States into five regions. Each region had a supercomputer center as a hub or gateway.
Universities and organizations belonging to a region could connect to the designated center via a
10 Chapter 1 • Overview of the Internet

regional network. Because of the overloading of these centers in 1987, NSFnet was upgraded
with faster telephone lines and more powerful computers. By 1990, NSFnet replaced ARPAnet,
with a well-developed set of regional and metropolitan area networks feeding into the NSF
backbone. NSFnet’s major objective was to serve educational, research, and government net-
working needs. In 1991, the CIX (Commercial Internet Exchange) Association was formed by
Internet service providers to commercialize the Internet and establish the legitimate uses of the
Internet for business and profit purposes.
PCs, which become a major platform in the 1980s, helped promote the widespread use of
the Internet. LANs became available from major players in the market such as Novell. These
LANs were connected to Ethernet, which allowed PCs to connect to the Internet. PCs at home
could access the Internet via modems and telephone lines.
In 1989, the World Wide Web was conceived by Tim Berners-Lee of the European Labora-
tory for Particle Physics, or CERN (an acronym for the group’s original name in French), in
Geneva, Switzerland. By the end of 1991, CERN released a line-by-line text browser. The actual
explosive growth of the Web started when the first graphically oriented browser, Mosaic, was
developed at the National Center for Supercomputing Applications (NCSA) at the University of
Illinois at Urbana-Champaign (UIUC) in 1994. The Web has quickly become the predominant part
of the Internet, since it supports documents with multimedia elements: text, graphics, colors,
images, and sounds. In addition, the tools needed to utilize the Web, such as browsers and search
engines, are fairly easy to use. With the wide use of the Web, an organization called the World
Wide Web Consortium (W3C) has taken the responsibility for evolving the various protocols and
standards related to the Web.

Mosaic Browser window (Courtesy of the National


Center for Supercomputing Applications (NCSA) and
the Board of Trustees of the University of Illinois)

In 1996, the Internet2 project was established. This project developed the NSF High-
Performance Connections program. The Internet2 project is a collaborative effort by many uni-
versities to develop advanced Internet technologies and applications. The target next-generation
applications for Internet2 include health care, national security, distance learning, digital
libraries, video teleconferencing, virtual laboratories, and manufacturing. Internet2 is not
intended to replace the current Internet. Instead, they are expected to complement each other.
During the 1990s, the wireless World Wide Web (WWWW) began to evolve in response
to the need for instant communication anytime and anywhere by many Web users. The concept
Transmission across the Internet 11

of the mobile Internet has been possible because of the availability of many wireless gadgets
such as PDAs (personal digital assistants), cell phones, and other handheld mobile devices and
the accessibility of wireless networks, satellite communications, and GPS (Global Positioning
System) technology.
During the late 1990s and early 2000s, the “connected home” concept started to emerge,
wherein home devices and appliances can be connected to the Internet by using a home gateway.
A home gateway is a black box that connects home devices and appliances to each other and to
the Internet. The Internet and smart embedded devices are the key drivers of the connected
home. The home gateway enables dynamic delivery of network services on demand, including
communication (e.g., phones, e-mail, voice mail, fax, and answering service), entertainment
(e.g., video on demand and digital video recorders), home control (e.g., monitoring and integra-
tion of home devices, such as the alarm clock telling the coffeemaker to turn on), and informa-
tion services (e.g., clicking a button on the TV remote control in order to store items like recipes
and TV programs).

Home gateway

Connected Home


Example 1.2 Become familiar with the World Wide Web Consortium (W3C).
What are W3C technologies, and what are some of the W3C’s latest developments?
Solution 1.2 Visit http://www.w3c.org to find information on current Web technolo-
gies and much more. Familiarize yourself with the W3C website, and visit it frequently to stay
current.

1.7 Transmission across the Internet


The best way to understand how the Internet works is to think of mail delivery via a postal ser-
vice. The postal service has its network of offices, its hardware (mail trucks, cars, sorting
machines, etc.), and its distribution system, consisting mainly of letter carriers. Similarly, the
Internet has its network of computers, its hardware (computers, routers, telephone lines, etc.),
and its software needed to distribute the data (files) from one location to another.
12 Chapter 1 • Overview of the Internet

Internet

Network 1 Router 1 Network 3

Computer Computer
A C

Router 2 Router 3 Router 4

Modem Network 2 Router 5 Network 4

Computer
Computer D
B

Figure 1.2 A four-network model of the Internet.

As shown in Figure 1.2, the basic idea of communication across the Internet is to have two
remote sites or computers connected together via a network. Figure 1.2 shows four networks,
five routers (a router is a computer that decides how to route data across the Internet), one
modem, and four computers. The four networks resemble the Internet. They could be LANs,
regional networks, national networks, or international networks. Computers A, C, and D are con-
nected to the Internet via dedicated lines. Laptop computer B is connected to the Internet via a
modem and a typical telephone line. The dedicated and telephone lines are equivalent to postal
trucks and cars. They move the data from one place to another. The routers are the postal substa-
tions. They decide how to route the data transmitted through the network lines, finding the short-
est and best way to deliver the data. To do so, the routers use sophisticated routing software and
algorithms.
How does the Internet know where data are coming from and going to? It uses a communi-
cation protocol (a protocol is a set of telecommunication rules that two computers use to commu-
nicate) called TCP/IP (transmission control protocol/Internet protocol) that allows the inclusion of
the IP addresses (see page 12 for definition) of the sending and receiving computers in the trans-
mitted data, be they an e-mail message, a Web page, or any other file. A TCP program residing on
the sending computer breaks the data to be transmitted into one or more chunks, called packets. It
Transmission across the Internet 13

numbers the packets and adds both the sender’s and receiver’s IP addresses to each packet. It then
forwards the packets to an IP program that resides on the same sending computer. The IP program
delivers them to the receiving computer, using the IP address that is included in each packet.


Sender IP address
Receiver IP address
Packet # 
TCP/IP handles packets in a similar way to how the traditional postal service handles mail.
The postal service receives envelopes, addressed with both sending and receiving addresses, and
delivers them to the right destinations. Similarly, TCP/IP is a two-layer protocol. The lower
layer, IP, delivers the packets. The higher layer, TCP, breaks the data into packets and manages
their transmission for efficient routing through the Internet. Although each packet has the same
receiver’s IP address, it may get routed differently than the other packets. A TCP program resid-
ing on the receiving computer awaits the delivery of the packets and then collects and reassem-
bles them together in the right order, thus generating the original data that were sent and making
them available on the receiving computer. A user can utilize an application program to view the
data (e.g., an e-mail tool to read an e-mail message, or a Web browser to view a Web page) at a
convenient time. Figure 1.3 shows the steps of the transmission process.
Packet transmission across the Internet employs the Internet’s heterarchical structure. A
heterarchical network has its nodes connected randomly, which implies that no one node is
more important than another in the network. When a part of the Internet is down, packets are
routed to avoid it. Only the users of the down part are affected. Packets are routed dynamically at

 Node
Heterarchical structure

Packets
(original data
Original data  Assembled
Sender IP addresses of Receiver
(file) data (file)
sender and
receiver)

Figure 1.3 Transmission across the Internet.


14 Chapter 1 • Overview of the Internet

the time of transmission, based on the conditions of the networks. Dynamic routing is done to
ensure robust communication.

1.8 IP Addresses and URLs


The IP protocol uses a logical address scheme to guarantee that a host or a node in any network
has a unique address. An IP address is a 32-bit integer composed of four 8-bit numbers written
in base 10 and separated by periods. A bit is a computer storage space that holds a binary value
of 0 or 1. A byte is an 8-bit storage space. Thus, each of the four numbers of an IP address holds
a value between 0 and 255, inclusive (28 = 256 values). An example of an IP address is
155.33.227.141. Like a house address, an IP address is assigned to one and only one host.
While numbers are convenient for machines and computers, they are not for humans.
Therefore, we use names to refer to IP addresses. The DNS (domain name system) is a software
application that converts names to IP addresses, and vice versa, by using a technique called
reverse lookup. Both Windows and Unix OSs provide the command nslookup, which converts
a host name to an IP address. Linux OS uses the dig and host commands. The nslookup
command and its equivalents can also do reverse name lookup to find the name for an IP
address. Tutorial 1.17.2 provides instruction in use of this command. DNS servers maintain the
lookup tables of name and address correspondences. For example, the name www.neu.edu
corresponds to an IP address of 155.33.227.141. So if a client requests to be connected to
www.neu.edu, the DNS server converts this address into an IP address, locates the site, and
connects the client to it. This conversion is sometimes known as DNS name resolution. If the site
is down or the given address is incorrect, no communication takes place between the client and
the site, and a communication error is reported.
The name version of an IP address is a part of what is commonly known as a uniform
resource locator, or URL. A URL is an address of an accessible file, say a Web page, on the
Internet. An example of a valid URL is http://www.neu.edu. A URL consists of the proto-
col name required to access the file (http for Web pages), the name of the server computer that
hosts the file (www.neu.edu), and the file name, including its directory name (none for
www.neu.edu). When no file is specified in the URL, a default file name in a default directory
is used. The webmaster (the administrator in charge of the Web server’s operations) sets up the
default file name, usually as index.html or index.htm.
The entire system of assigning and managing IP addresses is managed and controlled by
national and international organizations. There are companies that sell IP addresses around the
globe. These companies charge a purchase price and an annual fee to maintain an IP address. It
is the responsibility of these companies to ensure that IP addresses are unique.


Example 1.3 Use the nslookup command.
Find the name of the IP address 66.135.192.83 and the IP address of the name
www.harvard.edu.
Internet Domain Names 15

Solution 1.3 Type the following two commands into a DOS window: nslookup
66.135.192.83 and nslookup www.harvard.edu. The name of the IP address is
www.ebay.com; use nslookup www.ebay.com to confirm. The IP address of Harvard is
128.103.60.24. See Tutorial 1.17.2 for more details.

1.9 Internet Domain Names


The name version of an IP address is also known as the domain name. A domain name consists
of subdomains (usually fewer than five) separated by periods. The first subdomain (on the far
left of the domain name) is the host name, and the last subdomain (on the far right) is the top-
level domain (TLD). The second-level domain name excludes the host name of the domain
name. For example, the domain name of the College of Engineering at Northeastern University
is www.coe.neu.edu. The host name is www, and edu is the TLD. The second-level domain
name is coe.neu.edu.

Second-level domain name

domain name: www.coe.neu.edu


Host name TLD

Anatomy of domain names


As a general rule, the subdomains in a domain name get more general from left to right;
for example, the College of Engineering (coe) is part of Northeastern University (neu), which,
in turn, is part of the education sphere (edu). Within the college itself, there are many hosts,
including www (www.coe.neu.edu) and ftp (ftp.coe.neu.edu).

edu
mit

coe
neu
www ftp

The TLD can be geographic if needed. For international use, the TLD is the country code,
e.g., au for Australia and uk for the United Kingdom. Thus, in general, the format of a domain
name looks as follows: h.p1.p2.....oo.tt.cc, where each element is defined as follows:
h is the host name. The host name is usually www.
p1.p2.... are parts of an organization tree, e.g., dept1.coe. That tree organization
can be as deep as needed. For example, dept1 may be broken down into a number of groups,
and each group may have subgroups for both faculty and students. In this case, we keep adding
different subdomains separated by periods, i.e., p1.p2.p3.p4.....
oo is the organization name, e.g., neu, harvard, mit, sun, ibm, or dell.
16 Chapter 1 • Overview of the Internet

tt is the TLD (unless we have a cc). It is usually three characters long. The most com-
mon top-level domain names used are as follows:

.com: commercial organization;


.edu: educational institution;
.gov: government agency;
.org: nonprofit organization;
.net: network service provider;
.mil: U.S. military.

cc is the country code. This code identifies countries or geographical zones. While the
country code us is optional for the United States, it is mandatory for other countries. Here are
some sample codes: at (Austria), au (Australia), nz (New Zealand), ca (Canada), ch (Swit-
zerland), dk (Denmark), es (Spain), fr (France), de (Germany), gr (Greece), jp (Japan), uk
(United Kingdom), se (Sweden), and ie (Republic of Ireland). Country codes are defined in
the ISO-3166-1 standard.
With the explosive growth of the Internet, available domain names using the top-level
domains .com, .net, and .org are running out. To address this problem, new top-level
domains have been created—for example, .web, .shop, .firm, .rec, .biz, .tv, .inc,
and .law.


Example 1.4 Find the latest TLDs.
What are some TLDs that exist or have been proposed?
Solution 1.4 Perform a Web search, using a search engine. Use search strings such as “new
TLD”. Some of the TLDs you may find are as follows:

.pro: accountants, lawyers, and physicians; .name: individuals;


.museum: museums; .aero: air-transport industry;
.coop: cooperative businesses; .info: unrestricted use.

1.10 E-mail Addresses


The aforementioned naming scheme for a domain name is extended by the Internet to assign
e-mail addresses to its users. Each node or user on the Internet has a unique e-mail address.
Often, e-mail addresses employ the username@second-levelDomainName format.
The username could be a combination of the user’s first and last names, or any fictitious name.
Some usernames employ the first letter of the user’s first name followed by a period or an
underscore and then the user’s last name, e.g., p.smith or p_smith for Paul Smith. Others
use the user’s last name only. The author’s e-mail address is zeid@coe.neu.edu. In general,
an e-mail address can be represented in one of the following formats:
File Protocols on the Internet 17

username@organization.extension, e.g., smith@company.tt;


username@organization.extension.country-code,
e.g., smith@company.tt.cc;
username@organizational-unit.organization.extension,
e.g., smith@sales.company.tt;
username@server.organization.extension.country-code,
e.g., smith@alpha.company.tt.cc.

1.11 File Protocols on the Internet


While the TCP/IP protocol transmits files between servers and clients, file protocols determine
the formats and rules of exchanging files between them. For example, exchanging a Web-page
file is different from exchanging a plain-text file, although both files are transmitted as packets.
The concept of a file protocol is analogous to making a phone call. While the voices of both the
caller and the recipient are transmitted as sound waves, both the caller and the recipient must
speak the same language in order to exchange the phone call correctly, i.e., understand each
other. Relative to TCP/IP, a file protocol is an application protocol. Several types of file proto-
cols are used on the Web, including the following:

1. HTTP (hypertext transfer protocol): Allows a client to request a Web page from a server.
An example is http://www.neu.edu.
2. HTTPS (secure HTTP): Ensures secure communication between a client and a server. An
example is https://www.amazon.com.
3. Mailto: Sends an e-mail message to a specified address, e.g.,
mailto:zeid@coe.neu.edu. When this command is typed in a browser, it invokes
the client’s default e-mail tool.
4. NNTP (network news transfer protocol): Allows a client to read (post) messages from (to)
newsgroups and bulletin boards. Refer to Chapter 5 for an explanation of how to use this
protocol.
5. FTP (file transfer protocol): Allows you to receive (download) and send (upload) files
from a remote computer. An example is ftp://ftp.coe.neu.edu.
6. Telnet: Allows you to access a remote computer. An example is telnet://gate-
way.coe.neu.edu.
7. File: Displays a file that exists on any of a client’s local drives, such as a hard or floppy
drive. An example is c:\dir1\dir2\filename.txt.

Tutorial 1.17.3 demonstrates how to use some of these protocols. The default protocol is
HTTP. If a user does not specify a protocol, the browser uses HTTP to send and receive infor-
mation from the Web server. In addition to protocols, URLs may occasionally use port num-
bers. A port is a logical connection or channel that allows a client to communicate with a
server. For example, HTTP communication occurs through port 80. An example is http://
www.neu.edu:80.
18 Chapter 1 • Overview of the Internet

Port numbers used by the Web are standard and do not have to be specified. They are 80,
25, 110, 119, 21, and 23 for HTTP, SMTP (send mail), POP (retrieve mail), NNTP, FTP, and Tel-
net, respectively. The TCP/IP protocol hands off packets to a server through the standard port
number. This arrangement guarantees that the server is able to handle the packets successfully.
Some servers may request that packets of a certain type go to a nonstandard port number. In this
case, this number is used as part of the server’s URL. A port number may be used in a URL
when the website is experimental, in a development stage, or otherwise not ready for public use.

1.12 File Compression and Decompression


Users surfing the Internet often find music and video files to download. Multimedia files can be
very large, making them slow to download. File transfer depends on factors such as the speed of
the Internet connection transferring the file, the file size, and the server traffic. In particular, the
file size affects both the transfer time and the disk space required to store the file on a computer.
File compression (encoding) and decompression (decoding) are two techniques that control the
size of a file. File compression reduces the file size and therefore its downloading time. Typi-
cally, large files available on server computers are stored in compressed mode in order to speed
up their transfer. A user decompresses them after downloading in order to use them.
File compression software, such as WinZip, uses complex algorithms to scan a file for
repeating patterns and redundancy in the data. An algorithm may replace the repeating patterns
with a code storing their content and locations more efficiently. A repeating pattern could be
composed of either characters (in text files) or pixels (in image files). For example, consider the
following string of characters:
AAAAAAAAAAGGGGWWZZZZZ
We can compress (encode) this string in a more compact form by writing it as
10A4G2W5Z
where 10A means 10 A’s, 4G means 4 G’s, and so on.
As another example, consider the following single-color bit-mapped image:
000000000000000000000000000000
000000000011111111110000000000
111110000000000000111111111111
111111111111111111111111111111
This image file can be compressed to 30 0; 10 0, 10 1, 10 0; 5 1, 13 0, 12
1; 30 1, where rows of data are separated by semicolons. The first row of the image has 30 0’s.
The second row has 10 0’s followed by 10 1’s followed by 10 0’s, and so on for the other rows.
To view compressed files, a compatible decompression program is required to read the
codes stored and restore the file to its orginal state. Typically, the same program can perform both
compression and decompression. For example, we can use the WinZip program to decompress
(unzip) and compress (zip) files on Windows OS, or we can use a zip command on Unix OS.
Two types of compressed files exist: self-extracting and non-self-extracting. A self-
extracting zip file has a zip program built into it. It has the .exe file extension. This file unzips
File Compression and Decompression 19

and installs itself. Executable files of application programs are zipped in this way. Examples
include browser and Java software. A non-self-extracting file requires a zip–unzip program to
decompress it. Examples include large text and multimedia files. To find out if a zipped file is
self-extracting or not, simply double-click on it. If it is self-extracting, then, as stated previously,
it will unzip and install itself. If not, a dialog box will appear stating that the file must first be
unzipped before it can be open.
The most commonly used extensions for compressed files are .zip, .sit, and .gzip
(or .zip) for PC, Mac, and Unix, respectively. File extensions used on Linux OS include
.arc, .arj, .lzh, .rar, .sit, .zip, and .zoo.
When we package multiple files together, we create an archive (one file) that holds them.
Archives can maintain a file directory structure. Archive programs provide their users with this
option. WinZip, for example, can maintain a file directory structure, or it can flatten it (i.e., put
all of the files at one level). WinZip uses the .zip file extension for archives. On Unix OS,
archives use the .tar (tape archive) extension. In the Java community, archives use the .jar
(Java archive) extension. While compression is not required in order to create archives, it is com-
monly used. For example, as started previously, WinZip compresses archives and then uses the
.zip file extension for them; see Tutorial 1.17.4.


Example 1.5 Zip a file.
Choose a file on your computer and zip it. What is the file size before and after zipping?
Solution 1.5 Use WinZip and Windows OS. Follow this sequence to create a zip file with
the name zipFile: Right-click on the desktop => Select New => Select WinZip File.
The file we will compress is an Excel file and has the name mim3140new. Drag and drop it
onto the zipFile icon. To find the file size, right-click on the file icon => Click Properties
=> Click OK. The file sizes before and after zipping are 19.5 KB (1KB = 1024 bytes, and 1 byte
= 8 bits) and 3.88 KB, respectively. The compression ratio (19.5/3.88) is not constant and
depends on the file type.
20 Chapter 1 • Overview of the Internet

1.13 Intranets and Extranets


The underlying concept for the Internet, intranets, and extranets is the same. They are all networks
using the same hardware and software. The differences occur with respect to their geographical
domains and the level of security they use. Figure 1.4 shows the three types of networks. An
intranet is a network that is contained within an organization; that is, it is an internal or private
network. Organizations use intranets to share information and computing resources among
employees in different departments and widespread offices.
Like the Internet, intranets connect heterogeneous computer hardware, including server
computers, workstations, and PCs. Because intranets provide companywide (intracompany)
access to the internal private information of the entire company, they must be protected from
outside intruders. Thus, it is typical for companies to install firewalls around their intranets in
order to prevent unauthorized access. A firewall is a collection of related computer programs
installed on a server computer that acts as a gateway to the intranet. The firewall intercepts each
incoming packet and examines the sender’s IP address to determine whether to forward it to its
destination.
An extranet is an organization network that allows access to outside networks such as the
Internet. It allows users outside a company to communicate with its employees, and vice versa.
The users can access the company’s internal information and resources as well. An extranet
facilitates intercompany relationships. Extranets typically link companies and businesses with
their customers, suppliers, vendors, partners, and other businesses over the Internet. Extranets
provide secure and private links via advances in network security and the use of firewalls. An
extranet may be viewed as an intermediate network between the Internet and an intranet.

Internet

Organization

Extranet

Firewall

Intranet

Figure 1.4 The Internet, intranets, and extranets.


Connecting to the Internet 21

1.14 Connecting to the Internet


Organizations, such as companies and universities, and individuals need an Internet service pro-
vider (ISP) in order to connect to the Internet. Organizations connect their networks to one of
the ISP networks. Individuals typically connect their computers at home to an ISP network. Indi-
viduals who own more than one computer at home can network them first before connecting
them to an ISP network.
ISPs can offer Internet access (connection) only or both access and content. Organizations
usually select access only, while individuals may select both access and content. America Online
(AOL) and the Microsoft Network (MSN) are examples of ISPs that offer both types of service.
These ISPs offer extensive categorized online services, including information, sports, finance,
news, and shopping, to end users. Phone and cable companies that act as ISPs provide online
access only. End users who have online access through these ISPs surf the Internet on their own
to find the content they need. This process can be time consuming for some users. If you think of
the Internet as a city, a content-providing ISP would be its directory. Once you remove the direc-
tory, you are on your own in finding your way around the city.
The choice of an ISP for individual use depends largely on the individual’s particular
needs. It is out of the scope of this book to compare commercial ISPs. Interested readers can
search the Internet itself for answers. However, some of the general features one should consider
when choosing an ISP include the maximum connection speed; the type of connection (dial-up
or broadband); whether there is an available 800-number help line; the software provided, if any,
for browsing and other online activities; the monthly service charges and hourly rates (both peak
and off-peak), the search tools and Web services provided; the extent of technical support pro-
vided, whether there are any trial accounts one can use before deciding to purchase the service;
the procedure for installation and orientation (e.g., via a CD-ROM); and the supported news-
groups and forums.
After choosing an ISP, organizations connect their employees’ PCs and workstations to
network (known as Ethernet) ports. These ports provide dedicated broadband (high-speed) con-
nections that are available 24 hours a day. The PCs and workstations have Ethernet cards to
allow communication with the network. Organizations also install Web browsers on the PCs and
workstations in order to complete the Internet access requirements. They also provide in-house
training and support for their employees on using the companywide Web tools such as e-mail
tools, online databases, and Web-based software.
Individuals who set up Internet connections at home need a modem and a browser. Refer to
the next section for information on modem types and specifications. Three types of home connec-
tions exist. A dial-up connection requires a telephone line and a modem. The modem speed is
usually 56K. (See the next section for more details.) This type of connection is slow, crash prone,
and ties up phone lines. The user must dial a phone number provided by the ISP in order to estab-
lish a connection. After he or she is done surfing the Web, the user must disconnect the phone line.
The other two types of home connections are cable and DSL. (See the next section
for more details.) Both types are dedicated (i.e., available 24 hours a day) and high speed
22 Chapter 1 • Overview of the Internet

(i.e., broadband). DSL connections use existing phone lines; they require DSL modems.
Cable connections use TV cables and require cable modems. Both connections have compa-
rable speeds. Telephone companies usually offer DSL services, and cable-TV companies offer
cable services.

1.14.1 T-Carrier System


ISPs use T lines to provide dedicated high-speed access to the Internet. The T-carrier system is
the easiest, fastest, and most convenient way to connect to the Internet. The system was intro-
duced by Bell phone companies in the United States in the 1960s. A T line supports digital
transmission at high speeds. Large organizations typically lease T lines at a speed of their choice
from a commercial provider. The provider places a routing computer (router) at an organization
site. This computer takes communications from the site and sends them to their final destina-
tions. All site computers can be connected to the router via the site’s LANs. The LANs are the
responsibility of the site. Once the site is up and running, the provider is responsible for only the
router and the T line.
How fast are T lines? Two of the existing technologies are T1 and T3 lines. A T1 line
provides a bandwidth of 1.5 million bits per second. A T3 line has a bandwidth of 45 Mbps
(45 megabits, or 45 million bits, per second). A bandwidth of 45 Mbps means that a T3 line
transmits 45 million bits of data, voice, and video per second. A T1 line uses 24 64-Kbps
channels ( 24 × 64 Kbps = 1.5 Mbps) to deliver its data throughput. A T3 line uses 672 64-Kbps
channels (the equivalent of 28 T1 lines). The channels of a T line can be divided or allocated
between data, video, and voice, depending on a company’s needs. A T1 line provides enough
speed for a small company that has a Web server that gets more than 1500 hits a month. A T3
line is good for a large company with an active website that gets more than 25,000 hits per
month. The cost of a T1 line includes installation fees and a monthly fee that depends on the
traffic (number of bits) that goes through the line. A T3 line costs more than a T1 line and can
handle much more traffic.

1.14.2 Point-to-Point Dial-Up Connection


All Internet dial-up connections via a modem and a telephone line use the PPP (point-to-
point) protocol. ISPs issue PPP accounts to their dial-up customers. Whether you configure
the PPP connection yourself or through your ISP, it is beneficial that you know the basics of
the procedure.
The PPP protocol enables the connection of two hosts, say, your PC and a Web server,
over a direct link such as a telephone line. Your PC becomes a host on the network. The PPP pro-
tocol was introduced in 1992. It allows the user to specify the network protocol—that is,
whether it is TCP/IP or something else. It can negotiate connection parameters and compression,
and it can protect against transmission errors.
You need a PPP account in order to be able to use a PPP connection. Your ISP provides
you with the account and its information. The ISP also gives you a phone number, a username,
and a password. With this information, you can log into your service provider’s server. The
Connecting to the Internet 23

phone call you make to connect to the server may be a local call to you, and, depending on your
phone billing plan, the call may not add charge to your phone bill. To minimize or eliminate
charges to users for phone calls during connection time, all ISPs have many POP (point of pres-
ence) access points in many regions of the country.
It does not take too much effort to make a home PC Internet ready. A computer program
that uses the TCP/IP protocol is typically part of the OS (e.g., Windows). Configuring a PPP
connection is systematic and simple, as shown in Tutorial 1.17.5. The connection uses sockets
to connect two computers. A socket is a method of communication between a client and a
server. Think of a socket as the end of a virtual wire that goes into a computer. A client/server
communication requires two sockets, one on each end. They are known as a client socket and
a server socket.
OSs (e.g., Windows and Unix) provide users with built-in computer programs that han-
dle socket communication. Windows uses the Winsock (Windows socket) API (application
programming interface). Winsock is an adaptation of the Berkeley Unix socket interface.
Winsock became available in 1993 and became part of the OS with Windows 95. Stand-alone
versions of Winsock, such as Trumpet Winsock, also exist. Unix OS does not require a Win-
sock equivalent, because TCP/IP and sockets are designed to run directly with Unix applica-
tion programs.
Winsock runs between a browser and the program that uses the TCP/IP protocol, as shown
in Figure 1.5. It runs as a Windows DLL (dynamic link library) file—that is, it is loaded and exe-
cuted when, say, a TCP/IP program needs it.
The main bottleneck for dial-up users is the access speed. Downloading or uploading
Web pages with many graphics, a lot of animation, and high sound content is very slow when
using modem speeds. Access speeds are directly dependent on the wires that make up the tele-
phone system. They are typically twisted-pair copper wires. These wires are not the ideal
medium for moving data at high speeds. As a result, telecommunication companies such as
Cisco, Lucent Technologies, and Northern Telecom as well as telephone and cable-television
companies compete to upgrade transmission methods and speeds.

Request

Web browser Winsock TCP/IP

Response

Server Modem

Figure 1.5 Windows Winsock communication.


24 Chapter 1 • Overview of the Internet

1.15 Types of Modems


Different types of modems exist. What most people refer to as just “a modem” is and analog
modem. In this book, when we say a modem, we mean an analog modem. A modem is a device
that is used to transfer data from one location to another through phone lines. On the sending
end, the modem converts the data into sound (analog) waves that can be transmitted through the
phone lines. Thus, the modem acts as a modulator. On the receiving end, the modem performs
the opposite operation: It converts the sound waves back to data. Here, the modem acts as a
demodulator. The name modem originates from the words “modulator” and “demodulator.”
The battle for faster dial-up connections has resulted in many technologies and ways to
access the Internet. Here is a list of the available modem types for dial-up users:
1. Telephone (analog) modems. This is the most common and least expensive way to con-
nect to the Internet, but it is also the slowest. The fastest modem speed today is 56K; that
is, the modem can transmit 56,000 bits of data per second. Slower modem speeds, such as
28.8K and 14.4K, also exist. The slower the modem speed, the longer it takes to download
Web pages. Most home PCs come with a 56K modem. All 56K modems use the ITU V.90
analog modem speed standard.
2. Cable modems. Cable-television wires, made of coaxial cables, can be adapted to transfer
data at access speeds as high as 10 Mbps. Cable companies charge monthly fees for using
cable modems and may charge installation fees as well. With cable modems, the cable com-
pany becomes one’s ISP. Users who are interested in utilizing cable modems should check
with their local cable companies to make sure that the service exists in their area or neigh-
borhood. Cable modems share the bandwidth with many users; thus, ISPs that offer cable
connections usually prohibit running a server. DSL providers (see the next item) do not.
3. DSL and ADSL modems. Digital subscriber line (DSL) and asynchronous DSL (ADSL)
are technologies that allow Internet users to tap into the Internet over an ordinary phone
line, at speeds significantly faster than those of the existing V.90 modems. DSL modems
use existing phone lines. A DSL modem takes an electronic signal and splits it so that a
single phone wire can transmit voice (regular phone calls) and data (Internet content)
simultaneously. A DSL modem uses the same speed for both downloading and uploading.
An ADSL modem splits the bandwidth so that more of it is dedicated to downloading.
Thus, ADSL modems allow faster downloads than uploads. Use of DSL and ADSL
modems enables one family member to chat on the phone or fax a document while another
member in the same house is surfing the Web, using the same phone line. Speeds of DSL
and ADSL modems range from 144K bits to 1.5Mb per second, with plans for 7.1 Mbps in
the works. DSL works best when the modem is close to the origin of the phone line and
suffers greatly with decreasing line quality and increasing distance.
4. ISDN (digital) modems. ISDN (integrated services digital network) modems transmit
data, voice, and video over ordinary telephone lines. Transmission speed is up to 128
Kbps. An ISDN line is a digital line. It uses twisted-pair copper wires. The monthly fee for
an ISDN line depends on its speed and use.
Types of Modems 25

5. B-ISDN modems. These modems are broadband ISDN modems. (The previously men-
tioned ISDN modems are narrowband ISDN modems.) B-ISDN lines use fiber optics
instead of twisted-pair copper wires. B-ISDN is much faster than ISDN.
6. Satellite modems. Satellite-based Internet access uses a satellite dish to receive data at
an average speed of 300 Kbps. A satellite Internet connection requires a special receiver,
a PC adapter card, and special software. Each one of these components has a price asso-
ciated with it, in addition to a monthly fee. The advantage of satellite-based Internet
connection is that it allows rural areas and the developing world, where phone lines are
rare or nonexistent, to access the Internet.
7. Wireless (cellular) modems. Cellular modems are used to connect a laptop computer or a
cellular phone to the Internet. This capability alleviates the need to plug the laptop into a
wall socket. Users can check their e-mail while on the road, on a boat, in a plane, etc.
Wireless modems are slow. While connected, the modem may transfer data at a rate of
9600 bits per second over a cellular phone line, thus costing you a lot just to check your
e-mail, for example. To try to bring the cost down, the cellular phone companies have
developed a replacement for the TCP/IP protocol. The new protocol is called CDPD (cellular
digital packet data). The CDPD packets are IP packets encrypted for security purposes.
This technique allows cellular phone companies to charge customers by packets trans-
ferred and not by the number of minutes of connection.


Example 1.6 Understand home broadband networking.
How do you network multiple computers at home to share the same cable or DSL modem?
Solution 1.6 You can buy a home broadband networking kit from an electronics store. The
kit typically comes with a router (hub), network cables, and LAN cards. A cable or DSL line
connects your ISP to the cable or DSL modem at home. Another cable connects the modem to
the router. A LAN card is installed into each computer at home. Each card is connected to the
router via a separate cable. In addition, LAN software is installed on each computer. The soft-
ware must be configured before successful communication through the network can be
achieved. It is preferred that the kit provide wireless networking, because a wireless setup is
more convenient to use around the house.

Cable or DSL modem ISP


Cable Line Line
Internet

Router
PC
Cable Home
broadband
PC networking
Another Random Document on
Scribd Without Any Related Topics
Tanil
A Great while ago a man in a stripéd jacket went travelling almost
to the verge of the world, and there he came upon a region of green
fertility, quiet sounds, and sharp colour; save for one tiny green
mound it was all smooth and even, as level as the moon’s face, so
flat that you could see the sky rising up out of the end of everything
like a blue dim cliff. He passed into a city very populous and
powerful, and entered the shop of a man who sold birds in traps of
wicker, birds of rare kinds, the flame-winged antillomeneus and kriffs
with green eyes.
“Sir,” said he to the hawker of birds, “this should be a city of great
occasions, it has the smell of opulence. But it is all unknown to me, I
have not heard the story of its arts and policy, or of its people and
their governors. What annalists have you recording all its
magnificence and glory, or what poets to tell if its record be just?”
The hawker of birds replied: “There are tales and the tellers of
tales.”
“I have not heard of these,” said the other, “tell me, tell me.”
The bird man drew finger and thumb downwards from the bridge
of his long nose to its extremity, and sliding the finger across his
pliant nostrils said: “I will tell you.” They both sat down upon a
coffer of wheat. “I will tell you,” repeated the bird man, and he
asked the other if he had heard of the tomb in which none could lie,
nor die, nor mortify.
“No,” said he.
“Or of the oracle that destroys its interpreter?”
“No,” answered the man in the stripéd jacket, and a talking bird in
a cage screamed: “No, no, no, no!” The traveller whistled caressingly
to the bird, tapping his finger nail along the rods of its cage, while
the bird man continued: “Or of Fax, Mint, and Bombassor, the three
faithful brothers?”
“No,” replied he again.
“They had a sister of beauty, of beauty indeed, beyond
imagination. (Soo-eet! soo-eet! chirped the oracular bird.) It smote
even the hearts of kings like a reaping hook among grass, and her
favour was a ransom from death itself, as I will tell you.”
“Friend,” said he of the stripéd jacket, “tell me of that woman.”
“I will tell you,” answered the other; and he told him, and this was
the way of it.

There was once a king of this country, mighty with riches and
homage, with tribute from his enemies—for he was a great warrior—
and the favour of many excellent queens. His ancestors were
numberless as the hairs of his black beard; so ancient was his
lineage that he may have sprung from divinity itself, but he had a
heart of brass, his bowels were of lead, and at times he was afflicted
with madness.
One day he called for his captain of the guard, Tanil, a valiant,
debonair man of much courtesy, and delivered to him his
commands.
Tanil took a company of the guard and they marched to that green
hill on the plain—it is but a league away. At the foot of the hill they
crossed a stream; beyond that was a white dwelling and a garden;
at the gate of the garden was a stumbling stone; a flock grazed on
the hill. The soldiers threw down the stone and, coming into the
vineyard, they hacked down the vines until they heard a voice call to
them. They saw at the door of the white dwelling a woman so
beautiful that the weapons slid from their hands at the wonder of it.
“Friends, friends!” said she. Tanil told her the King’s bidding, how
they must destroy the vineyard, the dwelling, and the flock, and turn
Fax, Mint, and Bombassor, with the foster sister Flaune, out from the
kingdom of Cumac.
“You have denied the King tribute,” said he.
“We are wanderers from the eastern world,” Flaune answered. “Is
not the mountain a free mountain? Does not this stream divide it
from Cumac’s country?”
She took Tanil into the white dwelling and gave a pitcher of wine
to his men.
“Sir,” said she to Tanil, “I will go to your King. Take me to your
King.”
And when Tanil agreed to do this she sent a message secretly to
her brothers to drive the flock away into a hiding-place. So while
Flaune was gone a-journeying to the palace with Tanil’s troup, Fax,
Mint, and Bombassor set back the stumbling stone and took away
the sheep.
The King was resting in his palace garden, throwing crumbs into
the lake, and beans to his peacocks, but when Flaune was brought
to him he rose and bowed himself to the pavement at her feet. The
woman said nothing, she walked to and fro before him, and he was
content to let his gaze rest upon her. The carp under the fountain
watched them, the rose drooped on its envious briar, the heart of
King Cumac was like a tree full of chirping birds.
Tanil confessed his fault; might the King be merciful and forgive
him! but the lady had taken their trespass with a soft temper and
policy that had overcome both his loyalty and his mind. It was
unpardonable, but it was not guilt, it was infirmity, she had
bewitched him. Cumac grinned and nodded. He bade Tanil return to
the vineyard and restore the vines, bade him requite the brothers
and confirm them in those pastures for ever. But as to this Flaune he
would not let her go.
She paces before him, or she dips her palm into the fountain,
spilling its drops upon the ground; she smiles and she is silent.
Cumac gave her into the care of his groom of the women, Yali, the
sister of Tanil, and thereafter, every day and many a day, the King
courted and coveted Flaune. But he could not take her; her pride,
her cunning words, and her lustre bore her like an anchored boat
upon the tide of his purpose. At one moment full of pride and gloom,
and in the next full of humility and love, he would bring gifts and
praises.
“I will cover you,” he whispered, “with green garnets and
jargoons. A collar of onyx and ruby, that is for you; breastknots of
beryl, and rings for the finger, wrist, and ear. Take them, take them!
For you I would tear the moon asunder.”
But all her desire was only to return to the green mountain and
her brothers and the flock by the stumbling stone. The King was
merged in anger and in grief.
“Do not so,” he pleaded, “I have given freedom to your men; will
you not give freedom to me?”
“What freedom, Cumac?” she asked him.
And he said: “Love.”
“How may the bound give freedom?”
“With the gift of love.”
“The spirit of the gift lies only in the giver.” Her voice was
mournful and low.
He was confused and cast down. “You humble me with words, but
words are nothing, beautiful one. Put on your collar of onyx, and
fasten your breastknots of beryl. Have I not griefs, fierce griefs, that
crash upon my brain, and frenzies that shoot in fire! Does not your
voice—that rest-recovering lure—allay them, your presence numb
them! I cannot let you go, I cannot let you go.”
“He who woos and does not win,” so said Flaune, “wins what he
does not woo for.”
“Though I beg but a rose,” murmured the King, “do you offer me a
sword?”
“Time’s sword is laid at the breast of every rose.”
“But I am your lowly servant,” he cried. “You have that which all
secretly seek and denyingly long for; it is seen without sight and
affirmed without speech.”
“What is the thing you seek and long for?”
“Purity,” said he.
“Purity!” She seemed to muse upon it as a theme of mystery. “If
you found purity, what would you match it with?”
“My sins!” he cried again. “Would you waste purity on purity, or
mingle sin with sin?”
“Cumac,” said the wise woman, with no pride then but only pity,
“you seek to conquer that which strikes the conqueror dead.”
Then, indeed, for a while he was mute, and then for a while he
talked of his sickness and his frenzy. “Are there not charms,” he
asked, “or magic herbs, to find and bind these demons?”
There was no charm—she told him—but the mind, and no magic
but in the tranquillity of freedom.
“I do not know this,” he sighed, “it will never be known.”
The unknown—she told him—was better than the known.
“Alas, then,” sighed the King again, “I shall never discover it.”
“It is everywhere,” said Flaune, “but it is like a sweet herb that
withers in the ground. All may gather it—and it is not gathered. All
may see it—and it is not seen. All destroy it—and it never dies....”
“Shall I be a little wind,” laughed Cumac, “and gush among this
grass?”
“It is the wind’s way among the roses. It has horns of bright brass
and quiet harps of silver. Its golden boats flash in every tossing bay.”
Cumac laughed again, but still he would not let her go. “The fox
has many tricks, the cat but one,” he said, and caused her ankles to
be fastened with two jewelled links tied with a hopple of gold. But in
a day he struck them from her with his own hands, and hung the
hopple upon her lustrous neck.
And still he would not let her go; so Yali and Tanil connived to
send news to the brothers, and in a little time Bombassor came to
her aid.
Bombassor was a dancer without blemish, in beauty or movement
either. He came into the palace to Cumac who did not know him,
and the King’s household came to the beaten gongs to witness the
art of Bombassor. Yali brought Flaune a harp of ivory, and to its
music Bombassor caracoled and spun before the delighted King.
Then Flaune (who spoke as a stranger to him) asked Bombassor if
he would dance with her, and he said they would take the dance of
“The Flying Phœnix.” The King was enchanted; he vowed he would
grant any wish of Bombassor’s, any wish; yes, he would cut the
moon in half did he desire it. “I will dance for your pledge,” said
Bombassor.
It seemed to the King then as if a little whirling wind made of
flame, and a music that was perfume, gyred and rose before him:
the tapped gongs, the tinkle of harp, the surprise of Flaune’s
swaying and reeling, now coy, now passionate, the lure of her
wooing arms, the rhythm of her flying feet, the chanting of the
onlookers, and the flashing buoyance of Bombassor, so thrilled and
distracted him that he shouted like an eager boy.
But when Bombassor desired Cumac to give him the maiden
Flaune, the King was astonished. “No, no,” he said, “but give him an
urn full of diamonds,” and Bombassor was given an urn full of
diamonds. He let it fall at the King’s feet, and the gems clattered
upon the pavement like a heap of peas. “Give him Yali, then,” Cumac
shouted. Yali was a nymph of splendour, but Bombassor called
aloud, “No, a pledge is a pledge!”
Then the King’s joy went from him and, like a star falling, left
darkness and terror.
“Take,” he cried, “an axe to his head and pitch it to the crows.”
And so was Bombassor destroyed, while the King continued
ignorantly to woo his sister. Silent and proud was she, silent and
proud, but her beauty began to droop until Yali and Tanil, perceiving
this, connived again to send to her brothers, and in a little time Mint
came. To race on foot he was fleeter than any of Cumac’s
champions; they strove with him, but he was like the unreturning
wind, and although they cunningly moved the bounds of the course,
and threw thorns and rocks under his feet, he defeated them all,
and the King jeered at his own champions. Then Mint called for an
antelope to be set in the midst of the plain and cried: “Who will
catch this for the King?” All were amazed and Cumac said: “Whoever
will do it I will give him whatever a King may give, though I crack
the moon for it.”
The men let go the hind and it swooped away, Mint pursuing. Fast
and far they sped until no man’s gaze could discern them, but in a
while Mint returned bearing the breathing hind upon his back. “Take
off his shoes,” cried the King, “and fill them with gold.” But when this
was done Mint spilled the gold back at the King’s feet.
“Give me,” said he, “this maiden Flaune.”
The King grinned and refused him.
“Was it not in the bond?” asked Mint.
“Ay,” replied Cumac, “but choose again.”
“Is this then a King’s bond?” sneered Mint.
“It was a living bond,” said the King, “but death can sever it. Let
this dog be riven in sunder and his bowels spilled to the foxes.” Mint
died on the moment, and Cumac continued ignorantly to woo his
sister.
Then Flaune conferred with Tanil and with Yali about a means of
escape. Tanil feared to be about this, but he loved Flaune, and his
sister Yali persuaded him. He showed them a great door in the back
of the palace, a concealed issue through the city wall, from which
Flaune might go in a darkness could but the door be opened. But it
had not been opened for a hundred years, and they feared the
hinges would shriek and the wards grind in the lock and so discover
them.
“Let us bring oil to-morrow,” they said, “and oil it.”
In the morning they brought oil to the hinge and brushed it with
drops from a cock’s feather. The hinge gave up its squeak but yet it
groaned. They filled Yali’s thimble that was made of tortoise horn
and poured this upon it. The hinge gave up its groan but yet it
sighed. They filled the eggshell of a goose with oil and poured upon
the hinge until it was silent. Then they turned to the lock, which, as
they threw back the wards, cried clack, clack. Tanil lapped the great
key with ointment, but still the lock clattered. He filled his mouth
with oil and spat into the hole, but still it clinked. Then Flaune
caught a grasshopper which she dipped in oil and cast into the lock.
After that the lock was silent too.
On the mid of night Tanil ushered Flaune to the great door, and it
opened in peace. She said “Farewell” to him tenderly, and vanished
away into the darkness, and so to the green mountain. As he
stooped, watching her until his eyes could see no more, the door
suddenly closed and locked against him, leaving him outside the
wall. Lights came, and an outcry and a voice roaring: “Tanil is fled
with the King’s mistress. Turn out the guard.” Tanil knew it to be the
voice of a jealous captain, and, filled with consternation, he too
turned and fled away into the night; not towards the mountains, but
to the sea, hoping to catch a ship that would deliver him.
Throughout the night he was going, striving or sleeping, and it
was stark noon before he came to the shore and passed over the
strait in a ship conveying merchants to a fair where no one knew
him and all were friendly. He hobnobbed with the merchants for
several days, feeding and sleeping in the booths until the morning of
the sixth day, and on that day a crier came into the fair ringing and
bawling, bawling and ringing, and what he cried was this:
That King Cumac, Lord of the Forty Kingdoms, Prince of the Moon,
and Chieftain under God, laid a ban upon all who should aid or
relieve his treacherous servant Tanil, who had conspired against the
King and fled. Furthermore it was to be known that Yali, the sister of
Tanil, was taken as hostage for him, that if he failed to redeem her
and deliver up his own body Yali herself was doomed to perish at
sunset of the seventh day after his flight.
Tanil scarcely waited to hear the conclusion, for he had but one
day more and he could suffer not his sister Yali to die. He turned
from the fair and ran to the sea. As he ran he slipped upon a rock
and was stunned, but a good wife restored him and soon he reached
the harbour. Here none of the sailors would convey him over the
strait, for they were bound to the merchantmen who intended not to
sail that day. Having so little time to reckon Tanil offered them bribes
(but in vain), and threats (but they would not), and he was in
torment and anguish until he came to an old man who said he would
take him within the hour if the wind held and the tide turned. But if
the wind failed, although the tide should ebb never so kindly, yet he
would not go: and even should the tide ebb strongly, yet if the wind
wavered from its quarter he would not go: and if by mysterious
caprice (for all was in the hands of God and a great wonder) the tide
itself should not turn, then the wind might blow a dainty squall but
he would not be able to undertake him. Upon this they agreed, and
Tanil and the old sailor sat down in the little ship to play at checkers.
Alas, fortune was against Tanil, he could not conquer the sailor, so
he made to pay down his loss.
“Friend,” said the sailor, “a game is but a game, put up your
purse.”
Tanil would not put back the money and the sailor said: “Let us
then play on, friend; double or quits.” They played on, and again
Tanil lost, and, as before, tendered his money. “Nay,” said the sailor,
“a game is but a pastime, put back your money.” But Tanil laid it in a
heap upon one of the thwarts. The old sailor sighed and said:
“Come, you are now at the turn of fortune; is not an egg made of
water and a stone of fire: let us play once more; double or quits.”
And so continually, until it was long past noon ere they began to sail
in a course for Cumac’s shore, two leagues over the strait. Now they
had accomplished about three parts of this voyage when the wind
slackened away like a wisp of smoke; slowly they drifted onwards
until at eve the boat lay becalmed, and as yet some way out from
the land. “Friend,” said the old sailor, laying out the checkers again,
“let us tempt the winds of fortune.” But, full of grief at having
squandered the precious hours, Tanil leaped into the sea and swam
towards the shore. Soon the tide checked and was changed, and a
current washed him far down the strait until the fading of day; then
he was cast upon a crooking cape of sand in such darkness of night
and such weariness of mind and body that he could not rise. He lay
there for a while consumed with languor and hunger until the peace
refreshed him; the winds of night were lulled and the waves; but
though there were stars in the sky they could not guide him.
“Alas,” he groaned, “darkness and the oddness of the coast
deceive me. Whether I venture to the right hand or the left, how
shall I make my way? How little is man’s power; the fox and the
hare may wander deceitfully but undeterred, yet here in this
darkness I go groping like a worm laid upon a rock. Yali, my sister,
how shall I preserve you?”
He went wandering across a hill away from the sea until he
stumbled upon a hurdle and fell; and where he fell he lay still,
sleeping.
Not until the dawn did Tanil wake; then he lay shivering in bonds,
with a company of sheep watchers that stood by and mocked at
him. Their shadows were long, a hundred-fold, for day was but
newly dawned.
Their master was not yet risen from his bed, but the watchers
carried Tanil to the door of his house and called to him.
“Master, we have caught a robber of the flock, lying by the fold
and feigning sleep.”
Now the sleepy master lay with a new bride, and he would not
stir.
“Come, master, we have taken a robber,” they cried again. And still
he did not move, but the bride rose and came to the window.
“What sheep has he stole?”
They answered her: “None, for we swaddled him; behold!”
She looked down at Tanil with her pleasant eyes, and bade the
men unbind him.
“Who guards now the sheep from robbers and wolves?” she
called. They were all silent, and some made to go off. She bade
them mend their ways, and went back to her lover. When the thongs
were loosened from Tanil he begged them to give him a little food
for he was empty and weak, but they scolded him and went hastily
away. Their shadows were long, a hundred-fold.
Tanil travelled on wings. Yali was to die at fall of night. He
hastened like a lover, but sickness and hunger overcame him; at
noon he lay down in a cool cavern to recover. No other travellers
came by him and no homes were near, for he was passing across the
fringe of a desert to shorten his journey, and the highway crooked
round far to the eastward. Nothing that man could eat was there to
sustain him, but he slept. When he rose his legs weakened and he
limped onwards like a slow beggar whose life lies all behind him.
Again he sank down, again he could not keep from sleeping. The
sun was setting when he awoke, the coloured towers of his city
shone only a league away. Then in his heart despair leaped and
maddened him—Yali had died while he tarried.
Searching through a thicket for some place where he could hang
himself he came upon a river, and saw, close to the shore, a small
ship standing slowly down towards the straits from which he had
come. Under her slack sail a man was playing on a pipe; with him
was a monkey gazing sorrowfully from the deck at the great glow in
the sky.
“Shipman,” cried Tanil, “will you give me bread, I am at an end?”
The man with a smile of malice held up from the deck a dish of
fruits and said: “Take. I have done.”
But the hungry man could not reach it. “Throw it to me,” he cried,
following the ship. But the sailor had no mind to throw it upon the
shore; he went leaning against his mast, piping an air, while the
monkey peered at him and gabbled. Tanil plunged into the river and
swam beneath the ship’s keel. Taking a knife from his girdle he was
for mounting by a little hawser, but the man beflogged him with a
cudgel until he fell back into the water. There he would have died
but that a large barque presently catched him up on board and
recovered him.
The ship carried Tanil from the river past the straits and so to the
great sea, where for the space of a year he was borne in absence,
willy-nilly, while the ship voyaged among the archipelagos, coasted
grim seaboards, or lay against strange wharves docking her cargo of
oil. Faithfully he laboured for wages under this ship’s captain, being
a man of pith and limb, valiant in storm, and enamoured of the
uncouth work: the haul of anchor, and men singing; setting, reefing,
furling, and men singing; the watch, the sleep, the song; the
treading of unknown waters, the crying gust, the change to glassy
endless calm, and the change again from green day to black night
and the bending of the harsh sheet in a starry squall, the crumpling
of far thunder, the rattle of halyard and block, the howl of cordage.
Grand it was in some bright tempest to watch the lubber wave slide
greenly to the bows and crack in showers of flying diamonds, but
best of all was the long crunch in from the vast gulfs, and the
wafture to some blue bay sighing below a white dock and the homes
of men.
Forgotten was Yali his loved sister, but that proud living Flaune
who had brought Yali to her death, she was not forgotten. He sailed
the seas and he sailed the seas, but she was ever a soft recalling
wonder in his breast, the sound of a bell of glass beaten by a spirit.
After a year of hazards the ship by chance docked in that harbour
where Tanil had heard the crier crying of Yali and her doom. Looking
about him he espied an old sailor sitting in his boat playing a game
of checkers with a young man. The crier bawled in the market place,
but he had no news for Tanil. Standing again amid the merchants
and the kind coloured sweetness of streets and people, this bliss of
home so welled up in his breast that he hastened back to the ship.
“Master,” he said, “give me my wages, and let me go.” The shipman
gave him his wages, and he went back to the town.
But only nine days did he linger there, for joy, like truth, lives in
the bottom of a well, and he cast in his wages. Then he went off
with a hunter to trap leopards in a forest. A month they were gone,
and they trapped the leopards and sold them, and then, having
parted from the hunter, Tanil roved back to the port to spend his
gains among the women of the town. Often his soul invited him to
return to that city of Cumac, but death awaited him there and he did
not go. Now he was come to poverty, but he was blithe, and evil
could not chain him. “Surely,” said Tanil, “life is a hope unquenched
and a tree of longing. There is none so poor but he can love
himself.” With a stolen net he used to catch fish and live. Then he
lost the net at dicing. So he went to bake loaves for certain scholars,
but they were unmonied men and he desisted, and went wandering
from village to village snaring birds, or living like the wild dogs, until
a friendly warrior enlisted him to convoy a caravan across the desert
to the great lakes. When he came again to the harbour town two
years had withered since he had flown from Cumac’s city.
He went to lodge at the inn, and as he paced in the evening along
the wharf a man accosted him, called him by name, and would not
let him go, and then Tanil knew it was Fax, the brother of that
Flaune. His heart rocked in his breast when he took Fax to the inn
and related all his adventure. “Tell me the tidings of our city, what
comes or goes there, what lives or dies.” And Fax replied: “I have
wandered in the world searching after you from that time. I bring a
greeting from my sister Flaune,” he said, “and from your sister Yali,
my beloved.”
The wonder then, the joy and shame of Tanil, cannot be told: he
threw himself down and wept, and begged Fax to tell him of the
miracle: “For,” said he, “my mind has misused me in this.”
“Know then,” proceeded Fax, “that after the unlocking of the door
my sister flees in darkness to the green mountain. I go watching and
lurking, and learn that the King is in jealous madness, for your
enemy spreads a slander and Cumac is deceived. He believes that
my sister’s love has been cozened by you. Yali is caught fast in his
net. My heart quivers in fear of his bloody intent, and I say to
Flaune: ‘What shall follow if Tanil return not?’ And she smiles and
says ever: ‘He will return.’ And again I say: ‘He tarries. What if he be
dead?’ And she smiles and says ever: ‘He is not dead.’ But you come
not, your steps are turned from us, no one has seen you, you are
like a hare that has fallen into a pit, and you do not come. Then in
that last hour Flaune goes to Cumac. He raves of deceit and
treachery. ‘It is my sin,’ my sister pleads, ‘the blame is mine. Spare
but this Yali and I will wash out the blame.’ ’Ay, you will wash it out
with words!‘ ’I will pay the debt in kind,’ says my sister Flaune, ‘if
Tanil does not return.’ But the cunning King will not yield up Yali
unless my sister yield in love to him. So thus it stands even now, but
whether they live in peace and love I do not know. I only know that
Yali lives and serves her in the palace there. But they wait, and I too
wait. Now the thread is ravelled to its end; I have lived only to seek
you. My flock is lost, perished; my vineyard fades, but I came
seeking.”
“Brother,” cried Tanil in grief, “all shall be as before. Yali shall rest
in your bosom.”
At dawn then they sailed over the straits and landed, and having
bargained with a wine carrier for two asses they rode off in the
direction of the city. Tanil’s heart was filled with joy and love, his
voice carolled, his mind hummed like a homing bee. “Surely,” he
said, “life is a hope unquenched, a tree of longing. It yields its
branches into a little world of summer. The asp and the dragon
appear, but the tree buds, the enriching bough cherishes its leaves,
and, lo, the fruit hangs.”
But the heart of Fax was very grave within him. “For,” thought he,
“this man will surely die. Yet I would rather this than lose the love of
Yali, and though they slay him I will bring him there.”
So they rode along upon the asses, and a great bird on high
followed them and hovered on its wings.
“What bird is that?” asked the one. And the other, screening his
eyes and peering upwards, said:
“A vulture.”
When King Cumac heard that they were come he ordered them to
be bound, and they were bound, and the guard clustered around
them. Tanil saw that his enemy was now captain of the men, and
that the King was sour and distraught.
“You come!” cried Cumac, “why do you come?”
They told him it was to redeem the bond and make quittance.
“Bonds and quittances! What bond can lie between a King and
faithless subjects?”
Said Fax: “It lies between the King and my sister Flaune.”
“How if I kill you both?”
“The bond will hold,” said Fax.
“Come, is a bond everlasting then, shall nothing break it?”
“Neither everlasting, nor to be broken.”
“What then?”
“It shall be fulfilled.”
“Can nothing amend it?”
“Nothing,” said Fax.
“Nothing? Nothing? Fools!” laughed the King, “the woman is
happy, and desires not to leave me!”
Tanil stood bowed in silence and shame, and Cumac turned upon
him. “What says this rude passionate beast!” The King’s anger rose
like a blast among oaks. “Has he no talk of bonds, this toad that
crawled into my heart and drank my living blood? Has he nothing to
restore? or gives he and takes he at the will of the wind?”
“I have a life to give,” said Tanil.
“To give! You have a life to lose!”
“Take it, Cumac,” said he.
The King sprang up and seized Tanil by the beard, rocking him,
and shouting through his gritting teeth: “Ay, bonds should be kept—
should they not?—in truth and trust—should they not?”
Then he flung from him and went wailing in misery, swinging his
hands, and raging to and fro, up and down.
“Did she not come to me, come to me? Was it not agreed? Bonds
and again bonds! Yet when I woo her she denies me still. O, honesty
in petticoats is a saint with a devil’s claw. The bitter virginal thing
turned her wild heart to this piece of cloven honour. Bonds, more
bonds! Spare me these supple bonds! O, you spread cunning nets,
but what fowler ever thrived in his own snare? Did she not come to
me? Was it not agreed?”
Suddenly he stopped and made a sign through a casement. “Is all
ready?”
“Ay,” cried a voice.
“Now I will make an end,” said King Cumac. “Prop them against
the casements.” They carried Tanil to a casement on his right hand,
and Fax to a casement on his left hand. Tanil saw Flaune standing in
the palace garden amid a troop of Ethiopians, each with a green
turban and red shoes and a tunic coloured like a stone, but she half-
clad with only black pantaloons, and her long dark locks flowing.
And Fax saw Yali in fetters amid another troop of black soldiers.
Again a sigh from the King; two great swords flashed, and Tanil,
at one casement, saw the head of Flaune turn over backwards and
topple to the ground, her body falling after with a great swathe of
shorn tresses floating over it. Fax at the other casement saw Yali die,
screaming a long cry that it seemed would never end. Tanil swayed
at the casement.
Then Cumac turned with a moan of grief, his madness all gone.
“The bond is ended. I have done. I say I have done.” He seemed to
wake as from sleep, and, seeing the two captive men, he asked:
“Why did they come? What brought them here? Take them away, the
bond is ended, I say I have done. There shall be no more bonds
given in the world. But take them out of the city gate and unbind
them and cast them both loose; then clap fast the gate again. No
more death, I would not have them die; let them wander in the live
world, and dog each other for ever. Tanil, you rotten core of
constancy, Fax brought you here and so Flaune, bitter and beautiful,
dies. But Fax still lives—do you not see him?—I give Fax to you: may
he die daily for ever. Fax, blundering jackal, you spoke of bonds. The
bond is met, and so Yali is dead, but Tanil still lives: I give you Tanil
as an offering, but not of peace. May he die daily for ever.”
So the guard took Fax and Tamil out of the city, struck off their
shackles, and left them there together.

The bird man finished; there was a silence; the other yawned.
“Did you hear this?” asked the bird man. And the man in the stripéd
jacket replied: “Ay, with both ears, and so may God bless you.” So
saying, he rose and went out singing.
The Devil in the Churchyard
“Henry Turley was one of those awkward old chaps as had more
money than he knowed what to do wi'. Shadrach we called him, the
silly man. He had worked for it, worked hard for it, but when he was
old he stuck to his fortune and wouldn’t spend a sixpence of it on his
comforts. What a silly man!”
The thatcher, who was thus talking of Henry Turley (long since
dead and gone) in the “Black Cat” of Starncombe, was himself
perhaps fifty years old. Already there was a crank of age or of
dampness or of mere custom in most of his limbs, but he was bluff
and gruff and hale enough, with a bluffness of manner that could
only offend a fool—and fools never listened to him.
“Shadrach—that’s what we called him—was a good man wi’ cattle,
a masterpiece; he would strip a cow as clean as a tooth and you
never knowed a cow have a bad quarter as Henry Turley ever
milked. And when he was buried he was buried with all that money
in his coffin, holding it in his hand, I reckon. He had plenty of
relations—you wouldn’t know ’em, it is thirty years ago I be speaking
of—but it was all down in black and white so’s no one could touch it.
A lot of people in these parts had a right to some of it, Jim Scarrott
for one, and Issy Hawker a bit, Mrs. Keelson, poor woman, ought to
have had a bit, and his own brother, Mark Turley; but he left it in the
will as all his fortune was to be buried in the coffin along of him.
’Twas cruel, but so it is and so it will be, for whenever such people
has a shilling to give away they goes and claps it on some fat pig’s
haunches. The foolishness! Sixty pounds it was, in a canister, and he
held it in his hand.”
“I don’t believe a word of it,” said a mild-faced man sitting in the
corner. “Henry Turley never did a deed like that.”
“What?” growled the thatcher with unusual ferocity.
“Coorse I’m not disputing what you’re saying, but he never did
such a thing in his life.”
“Then you calls me a liar?”
“Certainly not. O no, don’t misunderstand me, but Henry Turley
never did any such thing, I can’t believe it of him.”
“Huh! I be telling you facts, and facts be true one way or another.
Now you waunts to call over me, you waunts to know the rights of
everything and the wrongs of nothing.”
“Well,” said the mild-faced man, pushing his pot toward the teller
of tales, “I might believe it to-morrow, but it’s a bit of a twister now,
this minute!”
“Ah, that’s all right then”—the thatcher was completely mollified.
“Well the worst part of the case was his brother Mark. Shadrach
served him shameful, treated him like a dog. (Good health!) Ah, like
a dog. Mark was older nor him, about seventy, and he lived by
himself in a little house out by the hanging pust, not much of a
cottage, it warn’t—just wattle and daub wi’ a thetch o’ straa'—but
the lease was running out (‘twas a lifehold affair) and unless he
bought this little house for fifty pound he’d got to go out of it. Well,
old Mark hadn’t got no fifty pounds, he was ate up wi’ rheumatics
and only did just a little light labour in the woods, they might as well
a’ asked him for the King’s crown, so he said to his master: Would
he lend him the fifty pounds?
“‘No, I can’t do that,’ his master says.
“‘You can reduct it from my wages,’ Mark says.
“‘Nor I can’t do that neither,’ says his master, ‘but there’s your
brother Henry, he’s worth a power o’ money, ask him.‘ So Mark asks
Shadrach to lend him the fifty pounds, so’s he could buy this little
house. ’No,’ says Henry, ‘I can’t.’ Nor he wouldn’t. Well—old Mark
says to him: ‘I doan wish you no harm Henry,’ he says, ‘but I hope
as how you’ll die in a ditch.’ (Good health!) And sure enough he did.
That was his own brother, he were strooken wi’ the sun and died in
a ditch, Henry did, and when he was buried his fortune was buried
with him, in a little canister, holding it in his hand, I reckons. And a
lot of good that was to him! He hadn’t been buried a month when
two bad parties putt their heads together. Levi Carter, one was, he
was the sexton, a man that was half a loony as I always thought. O
yes, he had got all his wits about him, somewheres, only they didn’t
often get much of a quorum, still he got them—somewheres. T’other
was a chap by the name of Impey, lived in Slack the shoemaker’s
house down by the old traveller’s garden. He wasn’t much of a
mucher, helped in the fieldwork and did shepherding at odd times.
And these two chaps made up their minds to goo and collar Henry
Turley’s fortune out of his coffin one night and share it between
theirselves. ’Twas crime, ye know, might a been prison for life, but
this Impey was a bad lot—he’d the manners of a pig, pooh! filthy!—
and I expects he persuaded old Levi on to do it. Bad as body-
snatchen, coorse ’twas!
“So they goos together one dark night, ’long in November it was,
and well you knows, all of you, as well as I, that nobody can’t ever
see over our churchyard wall by day let alone on a dark night. You
all knows that, don’t you?” asserted the thatcher, who appeared to
lay some stress upon this point in his narrative. There were murmurs
of acquiescence by all except the mild-faced man, and the thatcher
continued: “‘Twere about nine o’clock when they dug out the earth.
’Twarn’t a very hard job, for Henry was only just a little way down.
He was buried on top of his old woman, and she was on top of her
two daughters. But when they got down to the coffin Impey didn’t
much care for that part of the job, he felt a little bit sick, so he gives
the hammer and the screwdriver to Levi and he says: ’Levi,’ he says,
‘are you game to make a good job o’ this?’
“‘Yes, I be,’ says old Levi.
“‘Well, then,’ Impey says, ‘yous’ll have my smock on now while I
just creeps off to old Wannaker’s sheep and collars one of they fat
lambs over by the 'lotments.’
“‘You’re not going to leave me here,’ says Carter, ‘what be I going
to do?’
“‘You go on and finish this ’ere job, Levi,’ he says, ‘you get the
money and put back all the earth and don’t stir out of the yard afore
I comes or I’ll have yer blood.’
“‘No,’ says Carter, ‘you maun do that.’
“‘I ’ull do that,’ Impey says, ‘he’ve got some smartish lambs I can
tell ’ee, fat as snails.’
“‘No,’ says Carter, ‘I waun’t have no truck wi’ that, tain’t right.’
“‘You will,’ says Impey, ‘and I ’ull get the sheep. Here’s my smock.
I’ll meet ’ee here again in ten minutes. I’ll have that lamb if I ’as to
cut his blasted head off.’ And he rooshed away before Levi could
stop him. So Carter putts on the smock and finishes the job. He got
the money and putt the earth back on poor Henry and tidied it up,
and then he went and sat in the church poorch waiting for this
Impey to come back. Just as he did that an oldish man passed by
the gate. He was coming to this very place for a drop o’ drink and he
sees old Levi’s white figure sitting in the church poorch and it
frittened him so that he took to his heels and tore along to this very
room we be sittin’ in now—only 'twas thirty years ago.
“‘What in the name of God’s the matter wi’ you?‘ they says to him,
for he’d a face like chalk and his lips was blue as a whetstone. ’Have
you seen a goost?’
“‘Yes,’ he says, ‘I have seen a goost, just now then.’
“‘A goost?’ they says, ‘a goost? You an’t seen no goost.’
“‘I seen a goost.’
Welcome to Our Bookstore - The Ultimate Destination for Book Lovers
Are you passionate about books and eager to explore new worlds of
knowledge? At our website, we offer a vast collection of books that
cater to every interest and age group. From classic literature to
specialized publications, self-help books, and children’s stories, we
have it all! Each book is a gateway to new adventures, helping you
expand your knowledge and nourish your soul
Experience Convenient and Enjoyable Book Shopping Our website is more
than just an online bookstore—it’s a bridge connecting readers to the
timeless values of culture and wisdom. With a sleek and user-friendly
interface and a smart search system, you can find your favorite books
quickly and easily. Enjoy special promotions, fast home delivery, and
a seamless shopping experience that saves you time and enhances your
love for reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!

ebookgate.com

You might also like