Topics 1,3 & 4 - St Andrew`s High School

Download Report

Transcript Topics 1,3 & 4 - St Andrew`s High School

Higher Computing – Unit 3
Protocols
Networking
St Andrew's High School, Higher Computing
1
Pre-Requisite Knowledge
• Client and a server.
• The server provides resources to the client and the
client uses the resources provided by the server.
• You should know that on a network, every computer
needs a unique address • this is necessary so that information can be correctly
routed from one machine to another. On the Internet
this unique address is known as the Internet Protocol
(IP) address. IP addresses are translated into userfriendly domain names by the Domain Name Service
(DNS).
• You should know that computers use agreed
standards in order to make communication easy, and
that a common data standard used to transfer
information between computers is the American
Standard Code for Information Interchange (ASCII).
St Andrew's High School, Higher Computing
2
Pre-Requisite Knowledge
Learning Objectives
After studying this topic you should be able to:
• Understand the need for protocols when
connecting computers together in networks
• Describe the purpose of a number of common
network protocols
• Understand how these protocols are linked to
network applications
• Describe the functions of the networking
protocols underlying the Internet
St Andrew's High School, Higher Computing
3
Pre-Requisite Knowledge
Q1: What is an IP address?
a) The physical location of a computer
b) The code which identifies the user on a network
c) A unique number which identifies a computer on a network
d) An internet web site
Q2: What kind of data is ASCII code used to transmit?
a) Text
b) Graphics
c) Audio
d) Binary code
Q3: Why do we need a Domain Name Service?
a) Because people cannot always remember names of web sites
b) To translate user-friendly domain names into IP addresses
c) Because not all computers on the Internet have an IP address
d) To give every computer on the Internet a unique IP address
St Andrew's High School, Higher Computing
4
What is a Network Protocol
A protocol is an internationally agreed set
of rules that two parties agree upon in
order to communicate successfully, even
when using different hardware and
software.
A protocol is a set of rules governing
things like data format, handshaking (who
speaks first) and control commands, which
allow computers to communicate.
As soon as it was possible to connect two
computers together, it became necessary
to develop software to enable computers
and their users to communicate.
St Andrew's High School, Higher Computing
5
What is a Network Protocol
The four main application areas
where computer communications were
developed are:
• accessing computers remotely
• accessing information on remote
computers
• transferring files between computers
• sending and receiving email.
St Andrew's High School, Higher Computing
6
What is a Network Protocol
The protocols associated with these applications are:
• Telnet
• File Transfer protocol (FTP)
• Hypertext Transfer protocol (HTTP)
• Simple Mail Transfer Protocol (SMTP)
• Post Office Protocol (POP3)
• Networks are best understood as a series of
software layers with network applications functioning
on the top layer. On this top layer, all of these
protocols use ASCII code to initiate communication
and transfer commands, even when the commands
issued by the user use GUI, the network
communication protocols consist of simple ASCII
text commands.
St Andrew's High School, Higher Computing
7
What is a Network Protocol
All of these protocols:
• FTP
• Telnet
• HTTP
• SMTP
• POP
rely on the concept of addressability
between computers on a network This
means that every computer on the network
must have a unique identity known as an
Internet Protocol (IP) address.
St Andrew's High School, Higher Computing
8
Telnet – Remote Login
Telnet
Allows you to log-in to a remote machine
from the machine you are sitting at.
Telnet had no security built into it except
the initial request for a login name and
password on the remote system.
Telnet has a command driven interface
and all communication between the two
machines is transferred as ASCII code.
St Andrew's High School, Higher Computing
9
Telnet – Remote Login
Telnet is still used to monitor and control
network devices such as a hub a switch or
a Print Server.
It can be used as a primitive diagnostic
tool to test web servers, mail servers,
news servers and other remote network
services. When a telnet connection is
made between client and server, the
connection is retained until the client
disconnects.
Telnet operates at the application layer
of the OSI model and is part of the
TCP/IP protocols.
St Andrew's High School, Higher Computing
10
HTTP – Hypertext Transfer Protocol
HTTP is the protocol which provides many
of the functions of the WWW today.
HTTP is a file transfer system. The
WWW makes accessing information much
easier as the files are transferred
transparently, possibly from different
computers, without each file being
requested separately. When you enter a
web address the client machine issues a
command to the web server requesting
that the server sends the page to the
client machine.
St Andrew's High School, Higher Computing
11
HTTP – Hypertext Transfer Protocol
Web pages stored on Web servers are
written in HTML. HTML describes a
document using embedded formatting
controls (tags). An HTML document is
written in ASCII text, so it can be read
by any machine which accesses it. The
browser receives the page and interprets
the HTML in order to lay out the text on
the screen, requesting additional files
such as graphics, multimedia content etc.
from the web server as it needs them.
St Andrew's High School, Higher Computing
12
HTTP – Hypertext Transfer Protocol
HTTP transfers one file at a time and
only maintains the connection between
client and server while the file is being
transferred.
Pages on the WWW are identified by a
Uniform Resource Locator (URL). A URL
contains the protocol used, the server
domain name or IP address, and the pathname of the file.
e.g.
HTTP - application layer of OSI model.
St Andrew's High School, Higher Computing
13
FTP – File Transfer Protocol
File transfer is the moving of a file from
one computer to another over a network.
An FTP server program must be running
on a host machine before a client FTP
program can access it in order to transfer
files to or from that machine. FTP
requires an ID and password before the
user can transfer files, but guest access
is allowed.
FTP allows multiple file selection, batch
file transfer, automatic updates of websites, and synchronisation options.
St Andrew's High School, Higher Computing
14
FTP – File Transfer Protocol
FTP is the preferred option for downloading
files from a remote site for such tasks as
software installation or driver upgrades. In a
situation like this the user will normally be able
to use anonymous FTP where the user ID is
"anonymous" and the password is their email
address.
Like Telnet, when an FTP connection is made
between client and server, the connection is
retained until the client disconnects.
FTP operates at the application layer of the
OSI model
St Andrew's High School, Higher Computing
15
SMTP – Simple Mail Transfer Protocol, POP – Post Office Protocol
Email protocols
Electronic mail allows a message to be composed
and sent to another person on a remote system.
The protocols SMTP and POP are used.
SMTP specifies how mail is sent from one
computer to another. Originally designed for
permanently connected systems and allowed
email to be relayed between machines so that it
could be transferred from the sender’s mail
server across the world to the recipient’s mail
server.
SMTP now requires authentication
due to “spam”, ie User ID and password.
St Andrew's High School, Higher Computing
16
SMTP – Simple Mail Transfer Protocol, POP – Post Office Protocol
The POP3 protocol was designed to receive mail
stored on a remote mailbox. This is useful for
users who connect over a dial-up connection and
are not permanently connected to their mail
server. The POP3 protocol requires the user to
provide a username and password, but like
Telnet and FTP, these are transmitted in plain
unencrypted ASCII code.
The SMTP server is used for sending mail, the
POP3 server for receiving it.
SMTP operates at the application layer of the
OSI model
St Andrew's High School, Higher Computing
17
SMTP – Simple Mail Transfer Protocol, POP – Post Office Protocol
An email address has the following structure:
username@domain_name
username is the recipient of the email, the
domain name will usually consist of several
words separated by full stops. Theoretically the
domain name identifies the computer that the
email account is stored on. The last item in the
domain name is called the top level domain and
will consist of 2 or 3 letters. The top level
domain often gives some indication of your
affiliation or country of residence. For example:
[email protected]
[email protected]
St Andrew's High School, Higher Computing
18
SMTP – Simple Mail Transfer Protocol, POP – Post Office Protocol
Two letter top level domains are allocated to
countries other than the United States.
Top level Domain
Country
Examples are:
.uk
.fr
.di
.au
.jp
United Kingdom
France
Germany
Australia
Japan
If you get email from someone, and there
is no "at" sign (@), then that probably
means they have the exact same domain
as you. For example, when you receive mail
in school from someone else on the school
email system.
St Andrew's High School, Higher Computing
19
Lower Layer Network Protocols
The OSI Network
model is a 7 layer
model.
All
People
Seem
To
Need
Domino’s
Pizza
St Andrew's High School, Higher Computing
20
Lower Layer Network Protocols
The OSI Network model is a 7 layer model.
Computer network functions are divided into
different layers to make them easier to
implement. Protocols like HTTP and FTP operate
at the top layer (application layer), but there are
other protocols such as TCP and IP which
operate on layers lower down.
TCP/IP is the acronym for Transmission Control
Protocol / Internet Protocol. These are the two
standard protocols, internationally adopted,
which have made connecting networks together
and connecting to the Internet easy to achieve.
St Andrew's High School, Higher Computing
21
Lower Layer Network Protocols
St Andrew's High School, Higher Computing
22
Lower Layer Network Protocols
TCP
When a file is to be transmitted between two
computers on a network running TCP/IP then the
file is broken down into chunks of data called
packets.
TCP is responsible for splitting the data into
packets and adding a header to each one. This
header includes a sequence number which allows
the file to be re-assembled at the receiving end
by re-assembling the packets in the correct
order.
TCP is also responsible for retransmitting
packets if it does not receive an acknowledgment
that a packet has been received.
St Andrew's High School, Higher Computing
23
Lower Layer Network Protocols
IP
The IP protocol is responsible for taking each
packet and adding its own header to allow the
packet to be routed around and between
networks.
As it is perfectly possible for packets to follow
different routes to their destination, they might
easily take different amounts of time to arrive
and therefore be out of sequence when they do.
As long as the packets can be re-assembled in
the correct order by TCP using the sequence
numbers added when packets were created, then
the transmission will have been successful and
TCP will issue an ACKnowledgment.
St Andrew's High School, Higher Computing
24
Lower Layer Network Protocols
Ports
The use of ports allow a number of different network
functions to occur simultaneously eg browsing the web
and transferring a file. Some common ports and the
services that run on them are:
Service
Port
File Transfer Protocol
21 and 20
Telnet
23
Simple Mail Transfer Protocol
25
Hyper Text Transfer Protocol
80
Post Office Protocol
110
By specifying ports and including port numbers with TCP
data, multiple network connections can take place
simultaneously. This is known as multiplexing, and is why
you can collect your email and browse the Internet at
the same time. The port number along with the IP
address together make a socket.
St Andrew's High School, Higher Computing
25
Protocols
•
•
•
•
•
•
•
•
•
•
Telnet - protocol to connect to a remote computer
FTP - protocol to transfer files to and from a remote computer
HTTP - protocol to retrieve web pages and other files from a web
server
SMTP - protocol to transfer email to a mail server
POP3 - protocol to retrieve email from a mailbox on a mail server
An email address consists of a username and a domain name
separated by the @ symbol, then the top level domain (eg fr, uk)
Telnet, FTP, HTTP, SMTP and POP3 all use plain text ASCII
commands, although nowadays GUI front ends exist to make them
easier to use
TCP is a lower level protocol responsible for splitting a file to be
transmitted into packets, each with a sequence number to allow it
to be re-assembled at its destination
IP is a lower layer protocol responsible for routing packets
around and between Networks
A combination of a port and a TCP/IP connection is called a
socket and allows several virtual connections to run on one
machine at the same time.
St Andrew's High School, Higher Computing
26
IP Addresses and Domain Name Service. Pre-requisite Knowledge
• Before studying this topic you should know that
computers on the Internet are uniquely identified by
their IP address and that the World Wide Web
(WWW) uses a Name Resolution system so that user
friendly domain names can be mapped to a machine’s IP
address. You should know that computers on a network
which provide a service to other users are often
referred to as hosts.
Learning Objectives
• After studying this topic you should be able to:
• Describe the structure of an IP address
• Explain the three different classes of IP address
• Understand the difference between static and
dynamic IP addressing
• Understand some of the limitations of IP addressing
• Describe the Domain Name Service (DNS)
St Andrew's High School, Higher Computing
27
IP Addresses and Domain Name Service. Pre-requisite Knowledge
Revision
Q1: Which of these is a host?
a) A network link
b) A networked printer
c) A networked machine running a mail server
d) A multi-port repeater (hub)
Q2: Which of the these is not a host?
a) A networked machine running a web server
b) A print server
c) A router
d) A multi-port repeater (hub)
St Andrew's High School, Higher Computing
28
IP Addresses and Domain Name Service. Pre-requisite Knowledge
Revision
Q3: What is an IP address?
a) The physical location of a computer
b) The code which identifies the user on a network
c) A unique number which identifies a computer on a
network
d) An internet web site
Q4: Why do we need a Domain Name Service?
a) Because people cannot always remember names of web
sites
b) To translate user-friendly domain names into IP
addresses
c) Because not all computers on the Internet have an IP
address
d) To give every computer on the Internet a unique IP
address
St Andrew's High School, Higher Computing
29
Introduction to IP Addresses and Domain Name Service
An IP address allows a device on a network to be
distinguished from all other devices on the same
network. All devices must have a unique IP address so
the network can distinguish between them.
You can have a single computer with two network
Interface Cards (NIC)s fitted, each one with its own IP
address. In this case the computer would be connected
to two different networks. Routers are computers like
this.
Because IP addresses are difficult to remember, we use
Domain names to identify them instead.
Eg google.co.uk is actually IP address
216.239.59.99.
But the IP address is too difficult for us to remember.
St Andrew's High School, Higher Computing
30
Introduction to IP Addresses and Domain Name Service
An IP address is a 32-bit number separated into
four 8-bit parts called octets. The first number
of the IP address is the most general and the
last is the most specific.
An IP address can be divided into 2 sections the network identifier and the host identifier.
There are three ways to split the IP address.
Class A
nnn.hhh.hhh.hhh
Class B
nnn.nnn.hhh.hhh
Class C
nnn.nnn.nnn.hhh
where n = network identifier, h = host identifier
St Andrew's High School, Higher Computing
31
Introduction to IP Addresses and Domain Name Service
The network identifier is used to route packets to the
correct destination network. Once a packet reaches the
network which requested it, the network part of the
address is ignored and the packet is routed to the
correct host using the host identifier. That is, the
network address sends the data packet to the correct
network, the host address to the correct device.
IP4 Addressing
The IP4 addressing scheme is made up of 4 octets. On
Tuesday 1st February 2011 the final addresses in this
range were allocated. If you want to read up on this
read the article at:http://www.theregister.co.uk/2011/02/02/ipv4_exhaustion/
St Andrew's High School, Higher Computing
32
Classes of IP address
Since each computer on the Internet needs a
different IP address and since there are a small
number of large organizations and a large
number of small organizations, ranges of IP
addresses can be allocated by giving large
organisations blocks of Class A addresses and
small organisations blocks of Class B or Class C
addresses.
St Andrew's High School, Higher Computing
33
Classes of IP address
Class A addresses first octet is in the range 1 to 126;
Class B addresses first octet is in the range 128 to 191;
Class C addresses first octet is in the range 192 to 223.
Class A addresses allow a block of about 16 million IP
addresses, such as 115.h.h.h
There are only 127 Class A address blocks, and no more
are to be allocated. The owner is assigned an address in
the first octet and can assign addresses in the remaining
3 octets
eg given nnn.hhh.hhh.hhh,
so can have 124 or up to 16 million addresses.
Class A is for large companies such as HP, Apple etc.
St Andrew's High School, Higher Computing
34
Classes of IP address
Class B addresses are common for large
companies, allowing a block of 65534 IP
addresses.
When a Class B IP address is allocated, (say
135.113.n.n), the first two numbers identify that
company network. The company can give any IP
address in that block to any computer on their
network.
The owner is assigned an address in the first 2
octets
eg 129.135.hhh.hhh.
They can have up to 216 or 65,534 unique nodes
(MS = Class B, it was assigned when it was small!)
St Andrew's High School, Higher Computing
35
Classes of IP address
Class C addresses are the third type, giving 254
possible IP addresses for any one block (0 and
255 are reserved for particular functions).
The owner is assigned an address in the first 3
octets leaving 256 addresses to be assigned. Eg
193.135.57.hhh.
These are generally assigned to ISP companies,
which break them into blocks and assign them to
small companies with 10-20 hosts.
When you dial up an ISP with a modem, your
computer is temporarily allocated an IP address.
This will be in the range of the Class C licences
that they own.
St Andrew's High School, Higher Computing
36
Classes of IP address
There are two other special classes of IP
addresses:
Class D addresses have their first octet in the
range 224 to 239 and are used for multicast.
Multicast is a way of defining a group of nodes
and only sending packets to these nodes instead
of every node on the network (Broadcast).
Class E addresses have their first octet in the
range 240 to 255 and these are reserved for
experimental purposes.
St Andrew's High School, Higher Computing
37
Classes of IP address - Private IP addresses
These are addresses that can safely be used in internal
Local Area Networks (LAN)s, as they have no direct
connection to the Internet eg in our school.
The advantages to using private IP addresses on a
network is that you can use a proxy server with a single
public IP address to access the network. The proxy
server forwards requests for web pages (made by client
machines) or other Internet services as if they were its
own. This means that only one IP address is presented to
the outside world, protecting machines on the network
from external attack, and avoiding the purchase of more
than one IP address. This arrangement is known as
Network Address Translation (NAT). This is what we
use in school.
St Andrew's High School, Higher Computing
38
Classes of IP address - Private IP addresses
St Andrew's High School, Higher Computing
39
Classes of IP address - Static and Dynamic IP addressing
Static IP addresses – a device has a fixed IP
address
Dynamic IP addresses – Normally allocated when
a user logs-in to a server or dials-in to an ISP.
On a LAN, dynamic IP addressing is often used in
order to avoid the possibility of two machines
being allocated the same IP address. The server
runs a DHCP (Dynamic Host Configuration
Protocol) service which allocates IP addresses
from a range specified by the network manager
to machines whenever they connect.
St Andrew's High School, Higher Computing
40
Classes of IP address - Static and Dynamic IP addressing
In school all computers are allocated an address
in the range 10.5.10.h to 10.5.11.h. Type ipconfig
into any PC to find out its IP address. It keeps
the same IP address for around 90 days then it
may be allocated a different one.
This is ipconfig from my laptop at home, note the
IP address is the one allocated by my ISP!
What class
of IP
address is
this?
St Andrew's High School, Higher Computing
41
Domain Names
A Domain Name is the unique name that
identifies an Internet site.
Domain Names always have 2 or more parts,
separated by dots. The part on the left is the
most specific, and the part on the right is the
most general. For example in the domain name:
my_comany.com
my_company refers to a specific company and
.com refers to the commercial domain.
St Andrew's High School, Higher Computing
42
Domain Names
Examples of three letter top level domains are:
Two letter top level domains are allocated to
countries other than the United States. Examples
are:
St Andrew's High School, Higher Computing
43
Domain Name Service (DNS)
Name resolution is the system of mapping a
domain name to its IP address. This is done on
the Internet by the Domain Name Service.
Resolving Domain Names
When you type in a domain name eg bbc.co.uk
this name must be converted to an IP address
with 4 octets. A DNS server does this.
DNS servers are sites that have a list of IP
addresses and domain names in a database. Each
computer is set to have a few DNS lookups. If
the name cannot be resolved to the IP address in
the first DNS lookup address it moves up the
hierarchy and uses the next DNS address to
resolve the IP address.
St Andrew's High School, Higher Computing
44
Ping – Detecting Network Errors
Using Ping (Packet Internet Groper)
ping 10.5.0.3
This sends a packet internet
groper to one of our servers. It should reply 4
times giving you similar data to that below:Pinging 10.5.0.3 with 32 bytes of data:
Ping statistics for 192.168.0.1:
St Andrew's High School, Higher Computing
45
Detecting Network Errors
Using nslookup
You can use the nslookup command from a command
prompt to get a domain name from an IP address, or an
IP address from a domain name. In this example the
users commands are in bold with the response following:nslookup www.microsoft.com
Server: resolver2.svr.pol.co.uk
Address: 195.92.195.95
Name: www2.microsoft.akadns.net
Addresses: 207.46.134.189, 207.46.249.29, 207.46.245.92,
207.46.249.189
207.46.245.156, 207.46.134.221, 207.46.134.157,
207.46.249.221
Aliases: www.microsoft.com, www.microsoft.akadns.net
nslookup 207.46.134.189
Server: resolver2.svr.pol.co.uk
Address: 195.92.195.95
Name: origin2.microsoft.com
Address: 207.46.134.189
St Andrew's High School, Higher Computing
46
Limitations of IP Address System
Limitations of the IP address system
The IPv4 Class A, B and C system of allocating IP
addresses is very inefficient, particularly where Class A
and B addresses are concerned as many allocated IP
addresses may remain unused. With more and more
devices being connected to the Internet there is concern
that the world will run out of IP addresses. The 4 octet
IP address system can only address 232 different IP
addresses.
There are two possible solutions to this problem. One is
to extend the number of IP addresses using eight 16-bit
fields known as IPv6. IPv6 is a system of IP addressing
which among other improvements, increases the IP
address size from 32 bits to 128 bits, making a possible
maximum number of 3.4 x 1038 addresses
St Andrew's High School, Higher Computing
47
Limitation of IP Address System
The other solution is to dispense with the IP
Class system and use Classless Inter Domain
Routing (CIDR) uses IP addressing space more
efficiently by making it possible to allocate part
of a block to a network instead of the whole
block.
St Andrew's High School, Higher Computing
48
Topic 3 - Summary
• An IP address consists of four 8 bit numbers called
octets
• An IP address can be divided into two sections - a
network identifier and a host identifier.
• IP addresses can be classed as A B or C depending on
the number of octets used as the host identifier
• Private IP addresses and a Proxy Server can be used on
Local Area Networks to provide Network Address
Translation (NAT)
• Static IP addressing is where every machine on a
network has a fixed IP address
• Dynamic IP addressing is where an IP address is
allocated from a pool of Addresses
• The Domain Name Service translates user friendly
domain names into IP addresses using Name Resolution
St Andrew's High School, Higher Computing
49
Topic 4 – Pre-Requisite Knowledge
Before studying this topic you should know about
the services provided by the Internet such as
the WWW. You should know that every web page
has a unique address or Uniform Resource
Location (URL) which includes the protocol used,
the domain name and the path and file name of
the page referred to:
http://domain_name/directory/sub_directory/filename.htm
The HTTP is Hypertext Transfer Protocol (most web
browsers assume the HTTP protocol if no other
protocol is specified and so do not need this included in
the URL). You should also be familiar with using a search
engine and navigating web pages using hyperlinks.
St Andrew's High School, Higher Computing
50
Topic 4 – Learning Objectives
After studying this topic you should be able to:
Describe the structure of a web page written in
HTML
Be able to create a simple HTML web document
Explain the difference between a browser and a
micro-browser
Describe the Wireless Markup Language (WML)
Describe the various methods used by search
engines to build their indexes
St Andrew's High School, Higher Computing
51
Topic 4 – Revision
Q1: What is a hyperlink?
a) A connection between two machines on the Internet
b) A downloadable file
c) A clickable link on a web page which links to another page on the
Internet
d) A type of web browser
Q2: Which of these is not part of a Uniform Resource Locator?
a) A protocol
b) A domain
c) A host
d) A file path
Q3: Which is the best search string to use if you want to find out
about Scottish football?
a) Football
b) Soccer
c) Scotland
d) "Scottish football"
St Andrew's High School, Higher Computing
52
Topic 4 – Introduction to the World Wide Web
We learned in the section describing the HTTP
protocol, that when a web browser requests a
file from a web server, it interprets the
Hypertext Markup Language (HTML) script in
the file in order to format the web page on the
screen for the user. We are going to look more
closely at the HTML script on a web page and
how it influences how a web page looks.
St Andrew's High School, Higher Computing
53
Topic 4 – Introduction to the World Wide Web
A markup language is one which annotates text
with additional information about how it should
be displayed. HTML uses tags to annotate the
text of a web page. Tags in a web page are used
to identify elements. Elements should always
have a start and an end tag around them (to
conform to the XHTML standard). Tags can be
nested inside each other.
St Andrew's High School, Higher Computing
54
Topic 4 – Introduction to the World Wide Web
Here is an example of a simple web page
<html>
<head>
<title> My first web page </title>
</head>
<body>
<h1> Welcome to my first web page! </h1>
<p> This section is in normal text </p>
<p> <b> This section is in bold </b></p>
<p> <u> This section is underlined </u> </p>
</body>
This file (test.txt), can be downloaded from the
course web site.
St Andrew's High School, Higher Computing
55
Topic 4 – Introduction to the World Wide Web
If you type this text into a text editor and save
it as "test.htm" then you can see the results
when you open it in a web browser:-
St Andrew's High School, Higher Computing
56
Topic 4 – The Structure of a Web Page – Structure and Text Tags
In the code above, the <html> <head> and <body>
tags were structure tags. Structure tags define
the structural elements of a web page eg head
and body.
The <html> tags surround the whole file and
determine what type of file it is. The <head>
tags define the head element containing some
information about the html file (such as its title
which is contained in the <title> tag). The <body>
tags surround the main content of the file.
Also in the example above, there are text tags.
The <h1> (headline size 1), <p> (new paragraph),
<b> (bold) and <u> (underline) tags all define
different text elements.
St Andrew's High School, Higher Computing
57
Topic 4 – The Structure of a Web Page – Element Attributes
An element defined by a tag can also have an
attribute. An attribute gives additional
information about an element. This additional
information often relates to the appearance or
layout of an element such as colour or size.
For example:
<body bgcolor = "lightblue" > In this case the
body element of the page will be
shown with a light blue background
<p align = "center"> In this case the paragraph
element will be centred
St Andrew's High School, Higher Computing
58
Topic 4 – The Structure of a Web Page – Link and Image Tags
The link and image tags on a web page are what
provide the interactivity which we are so
familiar with on web pages. Add this line to your
test.htm file and refresh it in the browser to
see the effect.
<a href = "http://www.google.co.uk/" > Click here
for Google </a>
St Andrew's High School, Higher Computing
59
Topic 4 – The Structure of a Web Page – Link and Image Tags
In this example the <a> tags surround the link
element. Its attributes in this case are the URL
for the Google web page and the text which will
show as the link.
Add this line to your test.htm file and refresh it
in the browser to see the effect.
<img src =
"http://www.google.co.u
k/intl/en_uk/images/lo
go.gif" align="left"
alt="google logo"></img>
St Andrew's High School, Higher Computing
60
Topic 4 – The Structure of a Web Page – Link and Image Tags
In this example the <img> tags surround the
image element. Its attributes in this case are
the URL of the Google logo, its alignment, and an
alternative text which appears when you move
the mouse over the picture.
You can learn more about HTML tags from the
following link
http://archive.devx.com/projectcool/developer/
reference/tag-table.html
St Andrew's High School, Higher Computing
61
Topic 4 – Why Understanding HTML is Important
Web authoring software enables developers to
create web pages using a WYSIWYG (What You
See Is What You Get) approach, but it is still
very important to understand how the underlying
HTML code works so that you can sort out the
inevitable problems which occur.
HTML code can be interpreted in different ways
in different browsers.
St Andrew's High School, Higher Computing
62
Topic 4 – Why Understanding HTML is Important
HTML authoring should primarily be about the
structure of a document. It allows you to declare
that something is a heading or a quoted section,
or an itemised list, but the details of the
presentation (how to list items in an itemised list
or how to display a heading) are not specified.
Ideally you should keep the Structure, Content
and Presentation of a web page separate.
St Andrew's High School, Higher Computing
63
Topic 4 – Writing your own web page in HTML
Use a text editor to edit the page outlined in
this section. You should try out a number of
different tags from the link above. You should
create at least three pages, linked to each
other, with a graphic on at least one page and at
least one external link. If you are feeling
adventurous, see if you can create a table to lay
out the content of your page.
St Andrew's High School, Higher Computing
64
Topic 4 – Extensible Hypertext Markup Language (XHTML)
The Extensible Hypertext Markup Language
(XHTML) has slightly stricter rules for its tags
than HTML, but it is worth making your HTML
documents conform to XHTML as it allows pages
to be used with XML tools. XML is a standard
which describes a method of encoding data in a
form which makes it non application specific.
St Andrew's High School, Higher Computing
65
Topic 4 – Extensible Hypertext Markup Language (XHTML)
XHTML rules include:
• All documents must have a type declaration
• All elements must be closed (they must have
start and stop tags)
• Tag names must be in lower case
• Tags must be properly nested - tags cannot
overlap <li> <b> </li> </b> is not allowed.
St Andrew's High School, Higher Computing
66
Topic 4 – Extensible Hypertext Markup Language (XHTML)
To make the original example above a valid XHTML file
we need to add the document type declaration at the
beginning of the file.
<!DOCTYPE html
PUBLIC "--//W3C/DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml/DTD/xhtml1-strict.dtd">
<html>
<head>
<title> My first web page </title>
</head>
<body>
<h1> Welcome to my first web page! </h1>
<p> This section is in normal text </p>
<p> <b> This section is in bold </b></p>
<p> <u> This section is underlined </u> </p>
</body>
</html>
This file (validXHTML.txt), can be downloaded from the
course web site. It creates this:St Andrew's High School, Higher Computing
67
Topic 4 – Extensible Hypertext Markup Language (XHTML)
To make the original example above a valid XHTML file
we need to add the document type declaration at the
beginning of the file.
<!DOCTYPE html
PUBLIC "--//W3C/DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml/DTD/xhtml1-strict.dtd">
<html>
<head>
<title> My first web page </title>
</head>
<body>
<h1> Welcome to my first web page! </h1>
<p> This section is in normal text </p>
<p> <b> This section is in bold </b></p>
<p> <u> This section is underlined </u> </p>
</body>
</html>
This file (validXHTML.txt), can be downloaded from the
course web site. It creates this:St Andrew's High School, Higher Computing
68
Topic 4 – Extensible Hypertext Markup Language (XHTML)
Creates this:-
St Andrew's High School, Higher Computing
69
Topic 4 – Types of Browsers
Types of Browsers
• Browsers commonly incorporate:• Email
• News
• HTML editing facilities
• Favourites
• History
• Built in links to useful web sites.
• Use caching – saving data to a local hard drive
and serving the web page to other users from
their. Used in networks like our school one.
St Andrew's High School, Higher Computing
70
Topic 4 – Types of Browsers
• Plugins for multimedia content eg audio,
animation, video, interactive 3D. (A plugin is a
piece of software which allows a browser to
display content normally associated with other
applications such as a word processor or video
player)
A browser interprets the HTML code on a
downloaded web page in order to layout the
content of the page, and the files linked to it,
for the user.
St Andrew's High School, Higher Computing
71
Topic 4 – Microbrowsers
Microbrowser
A microbrowser is one designed for use with a
mobile/wireless handheld device such as a mobile
phone or Personal Digital Organiser (PDA), or
hybrid. Microbrowsers are written to be as small
as possible to make best use of the low memory
available on handheld devices and the lowbandwidth constraints of wireless-handheld
networks.
St Andrew's High School, Higher Computing
72
Topic 4 – WAP
Wireless Application Protocol (WAP)
HTTP is not ideal as a transport protocol for
wireless communication via hand-held devices as
it is not optimised for low bandwidth. For this
reason a new protocol was developed called the
Wireless Application protocol (WAP).
Just as HTTP is used to retrieve pages written
using HTML, WAP is used to retrieve pages
written using Wireless Markup Language
(WML).
WAP is a set of standard protocols and
technologies designed to bring web content to
hand-held communication devices (hybrids of
mobile phones and PDAs).
St Andrew's High School, Higher Computing
73
Topic 4 – What you need to know about WAP
The typical characteristics of WAP devices are:
• Small low resolution screens, content limited
• Less powerful processing capabilities so
cannot deal easily with multimedia content
• They do not usually have a keyboard, so typing
in a URL is likely to be much more difficult
than on a normal computer
• The wireless networks they use operate at a
much lower bandwidth (2G = 9.6Kbps, 3G = up
to 3.6 Mbps) than desktop computers so
content was originally primarily text based
rather than graphical
St Andrew's High School, Higher Computing
74
Topic 4 – What you need to know about WAP
• WAP enables web content to be delivered to
hand-held devices to collect and send emails
and browse for information.
• WAP 2 supports animations, colour graphics,
streaming media and allows synchronisation
with content stored on desktops.
• WAP is designed to deliver content at 2nd
Generation (2G) speeds of 9.6 Kbps, WAP 2 at
up to 3.6 Mbps, but some service providers
claim the up-to speed is much greater.
• This limited speed (2G/3G) means its
unsuitable for accessing HTML based web
content using TCP/IP. WAPs therefore use
WML.
St Andrew's High School, Higher Computing
75
Topic 4 – WAP Characteristics
Although all these may be seen as disadvantages,
the main advantage of WAP enabled devices is
the fact that they can access the Internet
without a physical connection - anywhere you can
use a mobile phone.
St Andrew's High School, Higher Computing
76
Topic 4 – WML and HTML - the differences
HTML
HTML
was
designed
creating documents
WML
for WML was designed for creating applications
HTML documents are designed WML applications are designed to run on mobile
to be read on browsers running WAP enabled devices with small screens, low power
on powerful desktop machines processors and an expensive connection
with cheap reliable connections.
A user may spend several Users of WAP enabled devices need short menus
minutes reading an HTML and easily read questions in order to find what
document
they need. Users want to be connected for as little
time as possible.
Simplifies the way users access content
Downloads a whole deck then allows the users to
access individual cards
St Andrew's High School, Higher Computing
77
Topic 4 – WML
WML files are sent to microbrowsers in a
compact form as they compress pages. This
compact form is compiled by WAP gateway on
the Internet. The compilation is mostly a
process of converting tags and elements in a
WML
document
into
pre-defined
single
character codes. This represents a considerable
saving in file size.
St Andrew's High School, Higher Computing
78
Topic 4 – WML
Wireless Markup Language (WML)
A WML application consists of one or more
decks containing collections of cards.
Each card typically contains some content
displayed to the user and some other content
used by the microbrowser to control how the
user moves from one card to another.
The idea of bundling a deck of related cards
together means that several of them can be sent
together without the browser requesting a new
card from the server every time a user moves
from one card to another. The compiled size of a
deck is limited to 1.4Kb.
St Andrew's High School, Higher Computing
79
Topic 4 – Simple WML File
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM/DTD WML 1.2//EN"
"http://www.wapforum.org/DTD/wml12.dtd">
<wml>
<card id="welcome">
<p> Welcome to my WAP site </p> As you can see it is very
<p> <a href ="#higher"> Enter for Higher
details </a>
</p>
similarcourse
to XHTML.
The
file
</card>
starts with a Document Type
<card id = "higher">
Declaration (DTD).
<p> Course details: </p>
Elements are defined by start
<p> Higher Computing </p>
and end tags. In this case the
<p> Computer Systems </p>
card elements have their id
<p> Software Development </p>
attributes
specified
so that a
<p> <a href ="#welcome"> Back to welcome
card </a>
</p>
user can move between the
</card>
two cards in the deck.
</wml>
St Andrew's High School, Higher Computing
80
Topic 4 – WML – Key Points
• WML devices have limited data input facilities, small screens, and
relatively low connection speeds. They can’t access normal web
pages written in HTML so WML was designed to produce web
content for hand-held devices.
• Allows text portions of Web pages to be displayed on hand-helds
• WML lacks many of the formatting features of HTML since they
are hard to implement on the small hand-held displays
• Supports a limited number of styles eg strong emphasis, B, I, U
• Has limited support for tables and images
• WML organises content into stack of cards, called decks. It prefetches a deck, caches it, allowing speedier access.
• Supports links between cards
• Supports dynamic interaction, based on events, input forms and
selection lines.
St Andrew's High School, Higher Computing
81
Topic 4 – WML – Deck/Card Elements
WML
Defines start/end of stack
Card
Defines start/end of card
head
Defines start/end of heading
Event Elements
Do
Starts an action
Ontimer
Starts action, controlled by timer
onenterforward
Forwards to a card after input
onenterbackward
Backwards to a card after input
Tasks
Prev
Now answer questions 14 to
19 on page 76 of the How
Links to a card
to Pass Higher Computing
Links to previous cardtextbook.
Refresh
Refreshes display of a card
Go
User Input
Input
Reads in user data
Select
Reads in user selection
St Andrew's High School, Higher Computing
82
Topic 4 – Search Engines
Searching for information on a WAN like the
Internet is easy! Many web sites offer a search
facility which will search for a specific word or
phrase on pages within the site itself.
Favourites lists provide a means of saving
frequently visited pages, and many organisations
provide search facilities on the web to make
finding pages easier.
St Andrew's High School, Higher Computing
83
Topic 4 – Types of Search Engines
2 main types of search facility available:
Crawler based search engines have databases
which are selected and built by computer robot
programs called spiders. These programs "crawl"
the web in their hunt for pages to include.
They find the pages for potential inclusion by
following the links in the pages they already have
in their database, but also rely on contributors
submitting their web pages to be indexed. The
software "crawls" through the web indexing pages
as it goes, using the content of pages, their titles,
and content HTML tags as a means of building the
index.
Google is an indexed search engine.
St Andrew's High School, Higher Computing
84
Topic 4 – Types of Search Engines
Directories are human powered indexing facilities
which are built up by users and editors working for
the directory company. Users submit a short
description to the directory for their entire site,
or editors write one for sites they review. When a
query is entered, the search engine only looks for
matches in the descriptions submitted.
Yahoo is an example of a directory based search
engine.
St Andrew's High School, Higher Computing
85
Topic 4 – How Do Search Engines Work
Search Engines do not really search the WWW
directly. Each one searches an index built from the
text of web pages the search engine has looked at.
When you click on a link provided by a search
engine’s results, you retrieve the current version
of the page. New web pages must be submitted by
a human to the search engine company for it to be
added.
Once a spider finds a page, it passes it on to
another program for "indexing." This program
identifies the text, links, and other content in the
page and stores it in the search engine database
files so that it can be searched by keyword and
whatever more advanced approaches are offered.
St Andrew's High School, Higher Computing
86
Topic 4 – Meta Tags
A meta tag is an HTML tag which is placed in the
HTML header element of a web page. It provides
information which is not visible to browsers, but
which can be used by search engines to index web
pages. The most common meta tags are
keywords and description.
The keywords tag allows the author to list the
words which describe the content of the page. The
description tag allows the author to give the text
of the summary displayed when the page appears
in the results of a search.
St Andrew's High School, Higher Computing
87
Topic 4 – Meta Tags
For instance:
<meta name="keywords" content="HTML, html,
html reference, HTML tags"></meta>
<meta name="description" content="Joe's guide to
HTML tags."></meta>
St Andrew's High School, Higher Computing
88
Topic 4 – Meta Search Engines
A meta-search engine is one which passes queries
on to several search engines and directories and
then summarises all the results, having removed
duplicate entries. This means that the results
should theoretically be the aggregate of all the
best search engines on the web. Some examples of
meta-search engines are:
http://www.ask.com/
http://www.dogpile.com/
http://www.metacrawler.com/
St Andrew's High School, Higher Computing
89
Topic 4 – Summary
• Web pages written in Hypertext Markup
Language (HTML), it’s interpreted by a browser
to present the page on the screen for the user.
• HTML uses tags which define elements
• Structure of an HTML page is shown by the <html>
<head> and <body> tags
• Examples of text tags are <p> <b> and <h1>
• Elements have attributes which are additional
information relating to the appearance or layout of
that element
• XHTML - stricter version of HTML. Requires all
documents to have a type declaration, all tags are
properly closed, lower case and properly nested
St Andrew's High School, Higher Computing
90
Topic 4 – Summary
• Microbrowsers - for mobile devices - small
screens/low bandwidth
• Applications written for microbrowsers use the
Wireless Markup Language (WML)
• Indexed search engines use programs called
spiders to hunt around the web for pages which
are linked to pages already in their database
• Directory based search engines rely on human
reviewers to create their database of links
• Meta search engines return results from a
number of different search engines
St Andrew's High School, Higher Computing
91