44
IACT303 – INTI 2005 IACT303 – INTI 2005 World Wide Networking World Wide Networking Web Technologies Web Technologies University of Wollongong University of Wollongong

IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

Embed Size (px)

Citation preview

Page 1: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

IACT303 – INTI 2005 IACT303 – INTI 2005 World Wide NetworkingWorld Wide NetworkingIACT303 – INTI 2005 IACT303 – INTI 2005

World Wide NetworkingWorld Wide Networking

Web TechnologiesWeb TechnologiesUniversity of WollongongUniversity of Wollongong

Page 2: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

Objective• The purpose of this lecture is to

introduce you to a number of web technologies that enable people to interact with networked information sources on the Internet

Page 3: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

Network Types• Peer-to-peer

– No one computer is responsible for processing, each computer is connected to every other

– Common for small office or home network

– Also the model for (MP3) file sharing over the Internet

Page 4: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

Network Types• Mainframe

– Dumb terminals send requests to a main server

– Terminals have almost no autonomy– The idea was briefly resurrected by

Sun several years back as Sun Rays, so called ultra thin clients.

Page 5: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

Network Types• Client-Server

– Most common, a single machine is a designated server for controlling resources

– Print servers, File servers, Email Servers, Web Servers, Back-up servers

Page 6: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

Client-server setup for the Web

WebServer

Application Server

Database ServerClient PC

HTTP

HTTP

When surfing the net, HTML web pages are requested from the WebServer by the client PC using HTTP (Hypertext Transfer Protocol)

Page 7: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

Client-server setup for Web Development

WebServer

Application Server

Database ServerClient PC

FTP

FTP

When designing web sites HTML web pages are loaded on to the WebServer using FTP (File Transfer Protocol)

Page 8: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

Remember?

ApplicationLayer

TransportLayer

NetworkLayer

LinkLayer

PhysicalLayer

UTP, Copper, Fibre, Radio Waves

ARP, Device drivers

IP ICMP

TCP

HTTP, FTP

ApplicationLayer

TransportLayer

NetworkLayer

LinkLayer

PhysicalLayer

UTP, Copper, Fibre, Radio Waves

ARP, Device drivers

IP ICMP

TCP

HTTP, FTP

NetworkLayer

LinkLayer

PhysicalLayer

UTP, Copper, Fibre, Radio Waves

ARP, Device drivers

IP ICMP

Client PC

Router/Internet

Server

Page 9: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

Reviewing previous information

• The Web Server, client PC and routers are identified and accessed using an IP address.

• The Web Server can also be accessed using its domain name (DNS).

• DNS is the way that Internet names are resolved to IP addresses, e.g.http://www.uow.edu.au = http://130.130.37.201

Page 10: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

Client-Server in One PC?

• Its possible to emulate the workings of the Internet by running a Web Server, application server and database server within one PC.

• Windows 2000 and Windows XP makes this arrangement possible

• Add a wed design program such as Front Page or Dreamweaver and it is very straight forward.

Page 11: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

Windows Web Server IIS on Single PC

Application Server(ASP, ASP,NET JSP, or PHP)

Database ServerMS Access or MySQL or ..

C:

Inetpub

HTML Files go here

wwwroot

WebServer(IIS)

Page 12: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

Web Technologies• Web Applications:

– client server applications designed to be used by any authorised user, with a web browser and an Internet connection

– Application code usually reside on a remote Web server

– clients web browser is user interface– platform independent

Page 13: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

Advantages of Client Server

• Users interact over the web– web browser allows universal client access

application from anywhere in the world• Application overheads are absorbed by

the server– need not install latest version on local PC– reduced need for maintenance on local PC

Page 14: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

Development tools for Web Applications

• HTML - Markup• XHTML - Markup• XML – metadata spec.• Javascript – client side• Jscript (Microsoft) – client side• Vbscript (Microsoft) – client side• Perl – CGI; server side• ASP (Microsoft) – CGI; server side• PHP – CGI; server side• Java – client side - applets

Page 15: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

HTML• Hyper Text Markup Language• Describes the format of a document i.e. how

it is to be displayed on the screen• A subset of Standardised General Markup

Language (SGML)– SGML released in 1980, standardised in 1985

• HTML standard maintained by World Wide Web Consortium (W3C) – Current version 4.01 has been stable since 1999

Page 16: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

HTML Limitations• By itself is largely static • Not all types of content supported

– E.g. maths, scientific notations• Not all kinds of audience is supported

e.g the disabled• W3C has developed guidelines for

developers to ensure that common mistakes are avoided. See reading list.

Page 17: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

XML• Extensible Markup Language• Also a recommendation of W3C• Describes the structure of a document (not the

way it is to be presented)• Allows the author to define their own tags

– To deal with internal or external data

• An XML document must also have an associated Document Type Definition (DTD)– Describes the “grammar” of the tags you have

created

Page 18: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

XML– An XML parser checks if the document

and DTD agree, if so the doc is “valid”– Some XML parsers only check if the doc

follows the XML rules i.e. if it is “well formed”

HTML<h1>Car</h1><h2>Make</h2><p> Ford Mustangh2>Seats</h2><p>5<h2>Top Speed</h2><p>70 m.p.h.

XML<h1>Car</h1<make>Ford

Mustang</make><seats>5</seats><speed

units=“mph”>70</speed>

Page 19: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

XHTML• A reformulation of HTML 4.0 that conforms to

XML.• Released by W3C, January 2000• As an XML app, an XHTML doc must be able

to be parsed by an XML parser• XHTML docs must therefore be more

compliant than many current HTML docs– Current browsers allow for many errors– HTML is unsuitable for displaying content on newer

(smaller) mobile devices such as mobile phones

Page 20: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

Client-side Scripts• Client side scripts are embedded in

HTML so that moderately sophisticated programmed functions can occur.– E.g user alerts for incorrect entry into forms;

roll over images when mouse passes over image;

• Provides a limited degree of interactivity between user and machine.

Page 21: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

Javascript• A client side in-browser application

promoted by Netscape• Provides static HTML web pages with a

limited degree of dynamism (rollover effects, checks user data entered by user before being sent to the web server, error messages, )

• Small pieces of code that accomplish a single task

• Originally developed be Netscape and formalised in an ECMA Standard

Page 22: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

JScript• Microsoft’s version of the ECMA standard. • Not fully compatible with Javascript

meaning that developers tend to write code for either Netscape or Microsoft browsers.

• Each have implemented different application specific objects like the Document Object Model (DOM)

Page 23: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

VBscript• Another Microsoft’s client-side

scripting language• “Cut down” version of Visual Basic• Only used on Microsoft servers

(PWS and IIS)• Excellent compatibility with MS

Access database

Page 24: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

What is an Application Server?

• To process web pages (eg to make them dynamic) requires an application server.

• An application server is software that works closely wit the the HTTP web server to process web pages that have server-side scripts.

• When a page with server-side scripts (small programs such as CGI) is requested from the web server, it send waits for the application server to process the script before sending the page to the browser

Page 25: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

What is CGI?• CGI - Common Gateway Interface is an application server

protocol. • Supports interactive form filling and other dynamic function

but the action occurs at the server ( as opposed to the client/web browser)

• A standard protocol allowing external programs such as Data Base Management Software to interface with the HTTP Web server.

• CGI is a major portion of Web applications• Usually written in a scripting language rather than a full

programming language– Small set of keywords, command line

• Perl used to be most common, now rivaled by PHP

Page 26: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

Perl• Grew out of UNIX text manipulation tool developed by Larry Wall in the 1980s

• Continually evolving (open source)• Many free modules available (see www.cpan.org)• Well documented • Interpreted

– Compiles to bytecode (intermediate form)– Bytecode interpreted by system dependent client

• Mainly used for server side processing• Allows the developer freedom to write quick prototypes or

full apps• Only small subset of commands needed to be useful• No GUI

Page 27: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

Perl• Perl scripts are not embedded within

HTML pages. This means the script is not downloaded to the browser.

• They are executed by commands within HTML pages (or other scripts) and may produce HTML pages that are downloaded to the client’s browser.

Page 28: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

PHP• PHP is open source and is designed for

web development (unlike Pearl).• Server side application• PHP can be embedded within HTML

pages (saved with a .php file extension). – The PHP sections of the page are then

parsed by the PHP engine on the server.– The PHP code is executed and replaced with

output (of the execution) before the page is downloaded to the web browser.

– This is called ‘templates’ - HTML pages that have calls to scripts embedded in the pages

Page 29: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

PHP• Alternatively, PHP can be written

as scripts that reside on the server and may produce HTML output that downloads to the web browser (like Pearl).

Page 30: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

ASP• Active Server Pages• A Microsoft product so is limited to

Microsoft platforms• Microsoft's technology that enables

HTML pages to be dynamic and interactive by embedding scripts, i.e. either VBScript or JScript

• Tightly integrated with MS Internet Information Server and Windows

Page 31: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

ASP continued• The page is processed on the server then

sent to the client• Allows static elements to be built once

instead of each time the page changes• Usually Jscript or VBscript but can use

any language with a suitable ActiveX engine

• Since the scripts in ASP pages (suffix .asp) are processed by the server, any browser can work with ASP pages regardless of its support for the scripting language used therein.

Page 32: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

ASP.NET• Part of the .Net effort• ASP.Net has more powerful server

controls and is more efficient in using server processing power (is compiled code – compiled once used many times)

Page 33: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

Web /client server model has limitations

• The Web offers a different model to traditional programming where he program is executed locally – Forms on browser handle entry of request– All work transferred to server running CGI

• So the Web offers the advantage of standardized interface, independent of platform (because done via browser)

• …but doesn’t share work effectively.

Page 34: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

Challenges• Peak loads - unpredictable• loose coupling of client/server means

sophisticated means needed to keep track of client activities

• external access to internal corporate databases - security challenge

Page 35: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

Sharing the Load

• The answer? • Some way of having web pages

that can perform computations at the client, not on server.

Page 36: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

Applets to the rescue

• But what about “byte-code” programs?

• You could publish details of the byte code, people writing “Web browsers” etc for different machines would find it easy to write interpreters.

• The interpreter for a byte code machine could enforce some security, e.g.– no access to local file space– no calling out on the net

Page 37: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

• Even with security controls, a byte interpreter would allow you to do much more computation than you could do in a scripting language.

Applets to the rescue

Page 38: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

Java • Java seen as potential solution to

many of problems• A full programming language

developed by Sun Systems.• Owes something to C++.

Page 39: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

Java• Java virtual machine masks the differences

among platforms for software developer– develop once, and its not merely source compatible

with different systems, it is binary compatible– not tied to a particular OS– market cross platform, Unix, OS/2, MacOS, ...

• Generally compiled only as far as interpretable byte codes.

• Byte code interpreter relatively easy to write and embed in some other program.

Page 40: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

Applets and Web pages• HTML defines the environment for

running an Applet• A browser, e.g. Netscape, (or some

simpler “Applet Viewer” program) contains the Java byte code interpreter.– Browser fetches the file with the byte

codes from the specified Web address.– the interpreter executes byte codes.

Page 41: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

Applets or applications• Such applications can be simple

text oriented programs, just like conventional C/C++ programs reading “standard input” and writing to “standard output”.

• Network bandwidth is not sufficient – downloading applets is too slow

Page 42: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

Changing world of programs and their

users ...• 1960s – 1970s

– the corporate mainframe– a few large software systems developed in house

• 1980s– the personal computer– a few “shrink wrapped” applications– many competing software vendors

• Early 1990s– networking and combining those PCs– more, larger and more complex software packages– a single vendor dominating the software market

Page 43: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

Why are those PCs networked?

• They started out stand-alone – word processor, spreadsheet, diagram editor

• Networking– to share the laser printer– to share files!– to gain access to corporate data

resources!!– Got to be a way of getting data to the PCs

Page 44: IACT303 – INTI 2005 World Wide Networking Web Technologies University of Wollongong

“Client-server” late 1980s - early 1990s

• Client-server computing grew in 80s-90s• PC client communicates with server over

network• PC handles

• presentation of data• interaction with users• small scale computations

• Server (super-mini or mainframe) handles• data warehousing• any large scale computations