Mastering 0 The Internet MACMILLAN MASTER SERIES Accounting German 2 Advanced English Language Global Information Systems Advanced Pure Mathematics Human Biology Arabic Internet Banking Italian Basic Management Italian 2 Biology Japanese British Politics Manufacturing Business Administration Marketing Business Communication Mathematics Business Law Mathematics for Electrical and C Programming Electronic Engineering Catering Theory Modem British History Chemistry Modem European History COBOL Programming Modem World History Communication Pascal Programming Databases Philosophy Economic and Social History Photography Economics Physics Electrical Engineering Psychology Electronic and Electrical Calculations Science Electronics Social Welfare English as a Foreign Language Sociology English Grammar Spanish English Language Spanish 2 English Literature Statistics French Study Skills French 2 Visual Basic German Macmillan Master Series Series Standing Order ISBN 978-0-333-69343-8 (outside North America only) You can receive future titles in this series as they are published by placing a standing order. Please contact your bookseller or, in case of difficulty, write to us at the address below with your name and address, the title of the series and the ISBN quoted above. Customer Services Department, Macmillan Distribution Ltd Houndmills, Basingstoke, Hampshire RG21 6XS, England Mastering o The Internet William Buchanan, BSc, CEng, PhD Senior Lecturer Department ofE lectrical and Electronic Engineering Napier University Edinburgh Series Editor Timothy Davies Computer Consultant ~ MACMIllAN This book is dedicated to the memory of my Father. C William Buchanan 1997 All rights reserved. No reproduction, copy or transmission of this publication may be made without written permission. No paragraph of this publication may be reproduced, copied or transmitted save with written permission or in accordance with the provision of the Copyright, Designs and Patents Act 1988. or under the terms of any licence permitting limited copying issued by the Copyright Licensing Agency, 90 Tottenham Court Road. London WIP 9HE. Any person who does any unathorised act in relation to this publication may be liable to criminal prosecution and civil claims for damages. The author has asserted his right to be identified as the author of this work in accordance with the Copyright. Designs and Patents Act 1988. First edition 1997 Published by MACMILLAN PRESS LTD Houndmills, Basingstoke, Hampshire RG21 6XS and London Companies and representatives throughout the world ISBN 978-0-333-69261-5 ISBN 978-1-349-14456-3 (eBook) DOI 10.1007/978-1-349-14456-3 A catalogue record for this book is available from the British Library. This book is printed on paper suitable for recycling and made from fully managed and sustained forest sources. 10 9 8 7 6 5 4 3 2 1 06 05 04 03 02 01 00 99 98 97 o Contents Preface ix 1 Introduction to the Internet 1 1.1 Introduction 1 1.2 Standardised addressing 1 1.3 LANs, WANs and MANs 2 1.4 OSImodel 4 1.5 Network cable types 6 1.6 LAN Topology 8 1.7 Network topologies 9 1.8 Routers, bridges and repeaters 12 1.9 Exercises 15 2 Local Area Networks (Ethernet) 19 2.1 Introduction 19 2.2 IEEE standards 20 2.3 Ethernet -media access control (MAC) layer 21 2.4 Ethernet transceivers 22 2.5 Ethernet types 23 2.6 Twisted-pair hubs 24 2.7 100 Mbps Ethernet 26 2.8 Exercises 28 3 TCPIIP 33 3.1 Introduction 33 3.2 TCPIIP gateways and hosts 34 3.3 Function of the IP protocol 35 3.4 Internet datagram 35 3.5 ICMP 37 3.6 TCPIIP intemets 38 3.7 Domain name system 43 3.8 Internet naming structure 43 3.9 Domain name server 44 3.10 Example network 45 3.11 Exercises 47 3.12 Tutorial 48 4 TCPIIP II 49 4.1 Introduction 49 4.2 IPVer6 49 4.3 Transmission control protocol 51 4.4 TCPIIP commands 53 4.5 Exercises 60 4.6 Tutorial 61 5 Electronic Mail 63 5.1 Introduction 63 5.2 Shared-file versus client/server approach 64 5.3 Electronic mail overview 65 5.4 Internet email address 67 5.5 SMTP 68 5.6 X.400 74 5.7 MIME 75 5.8 Exercises 83 5.9 Tutorial 86 6 The World Wide Web 87 6.1 Introduction 87 6.2 www topology 88 6.3 Typical Web browsers 93 6.4 Web browser design 94 6.5 Client/server architecture 96 6.6 Internet resources 97 6.7 Universal Resource Locators (URLs) 98 6.8 Universal resource identifier 101 6.9 Exercises 101 6.10 Tutorial 103 7 Intranets and HTTP 105 7.1 Introduction 105 7.2 Intranets 105 7.3 Firewalls 106 7.4 HTTP 109 7.5 Exercises 117 7.6 Tutorial 118 8 HTML (Introduction) 119 8.1 Introduction 119 8.2 Links 121 8.3 Lists 122 8.4 Colours 126 8.5 Background images 128 8.6 Displaying images 129 8.7 Horizontal lines 132 8.8 Exercises 133 8.9 Tutorial 136 9 HTML (Tables, Forms and Helpers) 139 VI Mastering the Internet 9.1 Introduction 139 9.2 Anchors 139 9.3 Tables 141 9.4 COl scripts 144 9.5 Forms 144 9.6 Multimedia 149 9.7 Exercise 151 9.8 Tutorial 152 10 JavaScript 155 10.1 Introduction 155 10.2 JavaScript 157 10.3 JavaScript values, variables and literals 158 10.4 Expressions and operators 161 10.5 JavaScript operators 162 10.6 JavaScript statements 167 10.7 Conditional statements 167 10.8 Loops 168 10.9 Comments 169 10.10 Functions 169 10.11 Objects and properties 171 10.12 Document objects 171 10.13 Event handling 172 10.14 Window objects 173 10.15 Object manipulation statements and operators 175 10.16 Tutorial 178 11 Java (Introduction) 179 11.1 Introduction 179 11.2 Creating an applet 182 11.3 Applet basics 184 11.4 Standalone programs 187 11.5 Java reserved words 188 11.6 Applet variables 188 11.7 Java operators 189 11.8 Mathematical operations 189 11.9 Loops 192 11.10 Conditional statements 193 11.11 Exercises 194 11.12 Tutorial 195 12 Java (Extended functions) 197 12.1 Introduction 197 12.2 Initialization and exit functions 197 12.3 Mouse events 199 12.4 Mouse selection 200 Contents vii 12.5 Keyboard input 201 12.6 Graphics images 204 12.7 Graphics 205 12.8 Sound 209 12.9 Dialog-boxes 210 12.10 Fonts 214 12.11 Exercises 215 12.12 Tutorial 216 13 Windows NT/95 Networking 219 13.1 Introduction 219 13.2 Novell NetWare networking 220 13.3 Servers, workstations and clients 220 13.4 Workgroups and domains 221 13.5 Windows NT/95 networking 222 13.6 Setting up TCPIIP networking on Windows NT/95 225 13.7 Windows sockets 229 13.8 TCPIIP applications 229 13.9 Windows NT network drives 230 13.10 Point-to-point protocol (PPP) 232 13.11 Exercises 235 13 .12 Tutorial 236 A ASCII Coding 237 A.l ASCII character set 237 A.2 Extended ASCII code 239 B lAB Recommendations 241 C Java Classes 245 D Common Abbreviations 251 Index 255 viii Mastering the Internet o Preface Data communications is now becoming one of the greatest industries in the world. The key to this growth is the use of the Internet which provides a global interconnection of networks and independently connected computers, using a standard communications standard known as TCPIIP. Many people confuse the Internet with the World Wide Web (WWW), but the WWW is just one application of the Internet. Other uses include the transmission of electronic mail, remote computer login, transmission of re mote data and control of remote devices. This book covers the main technologies of the Internet, these are: • Local area networks (Chapter 2). • TCPIIP (Chapters 3 and 4). • Electronic Mail (Chapter 5). • WWW (Chapter 6). • HTTP and Intranets (Chapter 7). • HTML (Chapters 8 and 9). • Javascript (Chapter 10). • Java (Chapters 11 and 12). • Windows NT/95 (Chapter 13). One of the growth in the computing industry in the next few years will be in the development of Java programs. This book gives a basic introduction to Java programming, as well as an introduction to HTML programming. Further information, from the author, on related subjects, such as emerging technologies and the diagrams from the text, is available on the WWW page: http://www.eece.napier.ac.uk/-bill_b/mti.html Help from the author can also be sought using the email address: [email protected] or, if unavailable, send an email [email protected] . uk Dr William J Buchanan, Napier University. ix