comp3241 e-commerce technologies

41
COMP3241 COMP3241 E-Commerce E-Commerce Technologies Technologies Richard Henson Richard Henson University of Worcester University of Worcester October October 2013 2013

Upload: durin

Post on 25-Jan-2016

38 views

Category:

Documents


0 download

DESCRIPTION

COMP3241 E-Commerce Technologies. Richard Henson University of Worcester October 2013. Week 2: Client-Server systems and E-commerce. Objectives: Describe the client-server model Explain what communications protocols are and their role in client-server networks - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: COMP3241 E-Commerce Technologies

COMP3241COMP3241E-Commerce TechnologiesE-Commerce Technologies

Richard HensonRichard Henson

University of WorcesterUniversity of Worcester

OctoberOctober 20132013

Page 2: COMP3241 E-Commerce Technologies

Week 2: Client-Server Week 2: Client-Server systems and E-commercesystems and E-commerce

Objectives:Objectives: Describe the client-server modelDescribe the client-server model Explain what communications protocols are and Explain what communications protocols are and

their role in client-server networkstheir role in client-server networks Understand the rationale for using server-end code, Understand the rationale for using server-end code,

as an alternative to running the code at the clientas an alternative to running the code at the client Produce further working server scripts running on Produce further working server scripts running on

an IIS webserveran IIS webserver

Page 3: COMP3241 E-Commerce Technologies

Evolution of NetworksEvolution of Networks Early days: Host/Dumb TerminalEarly days: Host/Dumb Terminal

Client/Server & Peer-PeerClient/Server & Peer-Peer

Host

Server

small boxes just provideinput & output

Small boxes represent computers in “client” mode

Page 4: COMP3241 E-Commerce Technologies

The Internet The Internet (peer-peer network)(peer-peer network)

Internet Hosts Interact on a client-server basis!

Page 5: COMP3241 E-Commerce Technologies

Internet CommunicationsInternet Communications

From the start: client & serverFrom the start: client & server

Internet “Host” (Server) can EITHER Internet “Host” (Server) can EITHER take take the role of the role of clientclient OR OR the role of the role of serverservere.g.(1) A user in one university sends an e.g.(1) A user in one university sends an

email to a user in another university:email to a user in another university:» ““A” client sends email to “B” serverA” client sends email to “B” server

(2) When a reply comes back…(2) When a reply comes back…» ““B” client sends email to “A” serverB” client sends email to “A” server

Page 6: COMP3241 E-Commerce Technologies

Client/Server NetworksClient/Server Networks Server end:Server end:

access control to the network and its resources controlled by logon service

access to resources depends on user rights – assessed by logon data

Client-end:Client-end:

user who wishes to access network resources

server

client

Page 7: COMP3241 E-Commerce Technologies

Web ServerWeb Server Software… (e.g. IIS, Apache)Software… (e.g. IIS, Apache) Runs on a Windows or Unix “platform”Runs on a Windows or Unix “platform”

stores web pagesstores web pagesmakes web pages available to remote makes web pages available to remote

computers using either HTTP or other computers using either HTTP or other application layer protocolsapplication layer protocols

exercises control over who accesses those exercises control over who accesses those web pages, and who can edit/delete themweb pages, and who can edit/delete them

runs scripts and provides database runs scripts and provides database interactioninteraction

Page 8: COMP3241 E-Commerce Technologies

Web BrowserWeb Browser Software… Software… (e.g. IE, Firefox, Opera, Chrome)(e.g. IE, Firefox, Opera, Chrome)

translates HTML code into a visual screen translates HTML code into a visual screen outputoutput

executes programs written in given executes programs written in given programming languages e.g.programming languages e.g.» JavaScriptJavaScript» VBScriptVBScript» ““run-time” code (ActiveX)run-time” code (ActiveX)

interacts with web server using the HTTP & interacts with web server using the HTTP & FTP protocols (& HTTPS to deter MITM FTP protocols (& HTTPS to deter MITM hackers)hackers)

Page 9: COMP3241 E-Commerce Technologies

How a Static Web Page How a Static Web Page gets displayedgets displayed

First of all, the First of all, the relevant HTML relevant HTML document must be document must be retrieved:retrieved:

1.1. user types the user types the URL into a one-URL into a one-line text window in line text window in browserbrowser

2.2. browser passes browser passes the text to the the text to the remote web remote web server (via default server (via default Internet gateway)Internet gateway)

Page 10: COMP3241 E-Commerce Technologies

How a Static Web Page gets How a Static Web Page gets displayed (2)displayed (2)

3.3. Web server Web server locateslocates the file for that web the file for that web pagepage in its own in its own storage foldersstorage folders

4.4. File containing File containing HTML etc code HTML etc code copied back to copied back to default gatewaydefault gateway

5.5. then routed to the then routed to the IP address of the IP address of the local computerlocal computer

Page 11: COMP3241 E-Commerce Technologies

How a Static Web Page gets How a Static Web Page gets displayed (3)displayed (3)

6.6. File suffix checked File suffix checked by browser…by browser…

7.7. If .htm or .html If .htm or .html suffix:suffix: HTML etc. code is HTML etc. code is

read & processed by read & processed by local CPU using a local CPU using a program called an program called an interpreterinterpreter

Page 12: COMP3241 E-Commerce Technologies

How a Static Web Page gets How a Static Web Page gets displayed (4)displayed (4)

8.8. Results of Results of processing passed processing passed to graphics card to graphics card CPUCPU converted into binary converted into binary

display signals by the CPU display signals by the CPU and graphics cardand graphics card

9.9. Signals transmitted Signals transmitted to screen; web page to screen; web page displayed…displayed…

Page 13: COMP3241 E-Commerce Technologies

Client-side scripting & Client-side scripting & Dynamic Web PagesDynamic Web Pages

Berners-Lee’s original intention was just text, links, and Berners-Lee’s original intention was just text, links, and graphics…graphics…

Soon became more sophisticated…Soon became more sophisticated… embedded JavaScript, VBScript, or code from other languagesembedded JavaScript, VBScript, or code from other languages

HTML forms allowed emailing & interaction with databasesHTML forms allowed emailing & interaction with databases

templates and Cascading Style Sheets provided scope for a templates and Cascading Style Sheets provided scope for a huge range of formatting optionshuge range of formatting options

Result: can now display virtually anythingResult: can now display virtually anything very wide range of multimedia and special effects available…very wide range of multimedia and special effects available…

Relational databases allow query/retrieval of complex data structuresRelational databases allow query/retrieval of complex data structures

Page 14: COMP3241 E-Commerce Technologies

Why are client-server networks Why are client-server networks so important to e-commerce?so important to e-commerce?

CConnection between client & server only onnection between client & server only made when user requests information made when user requests information very very efficient…efficient… But requires excellent communication between But requires excellent communication between

processesprocesses

Any client-server system must therefore:Any client-server system must therefore: communicate 100% effectivelycommunicate 100% effectively use an entirely reliable set of protocolsuse an entirely reliable set of protocols The Internet uses… TCP/IPThe Internet uses… TCP/IP

Page 15: COMP3241 E-Commerce Technologies

Why is knowledge Why is knowledge of networks important?of networks important?

Any worthwhile E-Any worthwhile E-Business system Business system

usually works usually works across:across: at least two different at least two different

systems systems a digital link including a digital link including

the Internetthe Internet

client

server

Network(s)

Page 16: COMP3241 E-Commerce Technologies

Request and responseRequest and response

1. Client requests information

2. Server processes the request, sends a response back to the client

CLIENT SERVER

RESPONSE

Send RequestRead Results

Process RequestSend Back Results

ClientProgram

REQUEST

ServerProgram

Page 17: COMP3241 E-Commerce Technologies

Request and response Request and response web applicationsweb applications

A single transaction across a client-server network requires (minimum)…

Client:Client: Request for services or information from another

computer (e.g. the server) Server: Server:

response to client's requestsending the results of processing the request back

to the client computer

Page 18: COMP3241 E-Commerce Technologies

““Middleware”Middleware”

A layer(s) of SOFTWARE that sits between client and serverA layer(s) of SOFTWARE that sits between client and server

Could “glue” together incompatible formatsCould “glue” together incompatible formats

Page 19: COMP3241 E-Commerce Technologies

More on More on MiddlewareMiddleware Middleware can join users to raw data and Middleware can join users to raw data and

applications!applications! Attractions range aroundAttractions range around “future-proofing” “future-proofing”

incompatible computing systems can co-operate and interact incompatible computing systems can co-operate and interact with each other – can be glued together to deliver with each other – can be glued together to deliver applications to the user seamlesslyapplications to the user seamlessly

applications independent of the underlying network applications independent of the underlying network infrastructureinfrastructure

integration with legacy systemsintegration with legacy systems (protecting investment in (protecting investment in older technology)older technology)

GGives organisations time to decide what to do with ives organisations time to decide what to do with older systemsolder systems e.g. during w2k “panic”!e.g. during w2k “panic”!

Page 20: COMP3241 E-Commerce Technologies

Bandwidth and Client/Server Bandwidth and Client/Server processesprocesses

Messages transferred between client Messages transferred between client and server via networkand server via network

Page 21: COMP3241 E-Commerce Technologies

Bandwidth and Bandwidth and Client/Server processesClient/Server processes

Data transfer: the faster the better…Data transfer: the faster the better… most effective on LANs - nowadays 1000 most effective on LANs - nowadays 1000

Mbits/sec or moreMbits/sec or more between connected Internet computers bandwidth between connected Internet computers bandwidth

needs to be as high as possible - 2 Mbits/sec needs to be as high as possible - 2 Mbits/sec upwards upwards

Slow connections…Slow connections… data takes longer to get throughdata takes longer to get through so longer time to get a response backso longer time to get a response back server could even “time out”server could even “time out”

Page 22: COMP3241 E-Commerce Technologies

Early Network ProtocolsEarly Network Protocols Challenge for client-server data to be RELIABLY Challenge for client-server data to be RELIABLY

transferred between Internet sitestransferred between Internet sites one purpose of the protocolone purpose of the protocol

» detect errors and resend if necessarydetect errors and resend if necessary

Early model (TCP)…Early model (TCP)… used in early days of Unix (1970s) used in early days of Unix (1970s)

communication between nodes separated into four layers of communication between nodes separated into four layers of abstraction, computerized through just 4 software layers:abstraction, computerized through just 4 software layers:

» Physical Network access layerPhysical Network access layer

» Internet layer – became IP protocolInternet layer – became IP protocol

» Transport or Host-Host – TCP protocolTransport or Host-Host – TCP protocol

» Application layer – became FTP and SMTPApplication layer – became FTP and SMTP

Page 23: COMP3241 E-Commerce Technologies

THE OSI seven layer modelTHE OSI seven layer model In 1978, the network model expanded to In 1978, the network model expanded to

SEVEN software layersSEVEN software layers included a further three levels of abstraction from included a further three levels of abstraction from

physical network through to screen display, this physical network through to screen display, this was the MINIMUM number OSI committee could was the MINIMUM number OSI committee could agree onagree on

helpful for efficient client-server communication helpful for efficient client-server communication across different networks, with different protocolsacross different networks, with different protocols

First used in the extended (7 layer…) TCP/IP First used in the extended (7 layer…) TCP/IP protocol stackprotocol stack remains to present day…remains to present day…

Page 24: COMP3241 E-Commerce Technologies

OSI-compliant Internet ProtocolsOSI-compliant Internet Protocols

When any OSI application layer file (e-mail When any OSI application layer file (e-mail message, HTML file, GIF file, URL request, message, HTML file, GIF file, URL request, and so forth) is sent from one place to another and so forth) is sent from one place to another on the Internet…on the Internet… at OSI level 4, the TCP protocol divides it into at OSI level 4, the TCP protocol divides it into

"chunks" or packets of an efficient size for routing "chunks" or packets of an efficient size for routing through packet switchingthrough packet switching

At OSI Level 3:At OSI Level 3:» packets are created and IP addresses are addedpackets are created and IP addresses are added» used in conjunction with packet-switching to navigate used in conjunction with packet-switching to navigate

packets from source to destination across the physical packets from source to destination across the physical networknetwork

Page 25: COMP3241 E-Commerce Technologies

How a message is “sent”How a message is “sent”

Physical Physical LayerLayer

Data link Data link LayerLayer

Network Network LayerLayer

Transport Transport LayerLayer

SessionSessionLayerLayer

Presentation Presentation LayerLayer

Application Application LayerLayer

Physical Physical LayerLayer

Data link Data link LayerLayer

Network Network LayerLayer

Transport Transport LayerLayer

SessionSessionLayerLayer

Presentation Presentation LayerLayer

Application Application LayerLayer

TransmitTransmitStationStation

ReceiveReceiveStationStation

AH DATA

PH AH DATA

SH PH AH DATA

TH SH PH AH DATA

NH TH SH PH AH DATA

LH NH TH SH PH AH DATA LT

DATA AH

DATA AH PH

DATA AH PH SH

DATA AH PH SH TH

DATA AH PH SH TH NH

LT DATA AH PH SH TH NH LH

LinkLink

Page 26: COMP3241 E-Commerce Technologies

Preparation of data to send Preparation of data to send across the networkacross the network

File/message “chunking” into packets…File/message “chunking” into packets…TCP orders the file into units of data of a TCP orders the file into units of data of a

specific size containing header information specific size containing header information (for routing) and the data itself(for routing) and the data itself

this allows packets to be routed between this allows packets to be routed between an origin and a destination on the Internet an origin and a destination on the Internet or any other or any other packet-switchedpacket-switched network network

Page 27: COMP3241 E-Commerce Technologies

Packet Size & ManagementPacket Size & Management

Traditional TCP/IP used packets with 48 Traditional TCP/IP used packets with 48 bytes data + 5 bytes headerbytes data + 5 bytes header latest implementations: e.g. 768 bytes + headerlatest implementations: e.g. 768 bytes + header

Large messages broken into many packetsLarge messages broken into many packets Sometimes very small messages are Sometimes very small messages are

combined and share a packetcombined and share a packet

dataheader

Page 28: COMP3241 E-Commerce Technologies

Contents of a basic 53 byte Contents of a basic 53 byte TCP/IP “packet”TCP/IP “packet”

1. The main body of information to send (48 1. The main body of information to send (48 bytes)bytes)

2. The packet header (5 bytes) containing:2. The packet header (5 bytes) containing:where to send packet (destination IP address)where to send packet (destination IP address)where packet came from (source IP address)where packet came from (source IP address)error checking information - CRC error checking information - CRC TTL (time to live) in case it gets lost!TTL (time to live) in case it gets lost!

Page 29: COMP3241 E-Commerce Technologies

Movement of Data by Movement of Data by Packet-switching Packet-switching

IP protocolIP protocol addressing and routing the packet addressing and routing the packet each packet separately numberedeach packet separately numbered

Individual packets for a given file may take Individual packets for a given file may take different routes through the Internetdifferent routes through the Internet

When all packets have arrived at their When all packets have arrived at their destination:destination: TCP at the receiving end reads the packet numbersTCP at the receiving end reads the packet numbers reassembles the packets into the correct order to reassembles the packets into the correct order to

recreate the original filerecreate the original file

Page 30: COMP3241 E-Commerce Technologies

Packet-switchingPacket-switching Known as “connectionless” (as opposed to Known as “connectionless” (as opposed to

“connection-oriented”, like the public “connection-oriented”, like the public telephone system)telephone system) unlike the latter, packets do not follow one another unlike the latter, packets do not follow one another

in order down a particular pathin order down a particular path Most Internet traffic uses packet switchingMost Internet traffic uses packet switching

requires no connection channelsrequires no connection channels breaking communication down into packets allows breaking communication down into packets allows

the same data path(s) to be shared among many the same data path(s) to be shared among many users in the networkusers in the network

Page 31: COMP3241 E-Commerce Technologies

WWW-related Application WWW-related Application Layer (layer 7) ProtocolsLayer (layer 7) Protocols

FTP (file transfer protocol)FTP (file transfer protocol) predates the wwwpredates the www used to upload/download files between user computer used to upload/download files between user computer

and the Internetand the Internet» FTP client program contacts an FTP server FTP client program contacts an FTP server » requests the transfer of a filerequests the transfer of a file» FTP server responds by transferring the file to the clientFTP server responds by transferring the file to the client

HTTP (hypertext transfer protocol)HTTP (hypertext transfer protocol) Used, usually via the Internet:Used, usually via the Internet:

» to upload requests for web pages from a browser on a client to upload requests for web pages from a browser on a client computer to a web servercomputer to a web server

» to download web pages from a web server to a browser on to download web pages from a web server to a browser on a client computera client computer

Can also be used to send data between client and serverCan also be used to send data between client and server

Page 32: COMP3241 E-Commerce Technologies

HTTP and HTML as “middleware”HTTP and HTML as “middleware”

CLIENT SERVER

RESPONSE

Send RequestRead Results

Process RequestSend Back Results

ClientProgram

REQUEST

ServerProgram

Web Browser (HTML page)

Web Server (Server Script)

Page 33: COMP3241 E-Commerce Technologies

Web Static Client-Server Web Static Client-Server Model (simplified – excluding Model (simplified – excluding

the “local” server)the “local” server)

Page 34: COMP3241 E-Commerce Technologies

More about HTTP and Client-More about HTTP and Client-Server ComputingServer Computing

Client and server systems work right up to the Client and server systems work right up to the application layerapplication layer communication needs to function accordingly…communication needs to function accordingly…

Tim Berners-Lee invented HTTP to facilitate web-Tim Berners-Lee invented HTTP to facilitate web-based application layer communicationbased application layer communication

To allow client-server interaction, Tim designed To allow client-server interaction, Tim designed HTTP to integrate well with his basic web page HTTP to integrate well with his basic web page formatting language - HTMLformatting language - HTML HTML language GET command instructs the client process HTML language GET command instructs the client process

to get data for the serverto get data for the server HTML POST command sends client data either using an HTML POST command sends client data either using an

email protocol or using HTTPemail protocol or using HTTP

Page 35: COMP3241 E-Commerce Technologies

Server-side scripts Server-side scripts & dynamic Web pages& dynamic Web pages

This time, the programming code is sent to and runs at the This time, the programming code is sent to and runs at the web server end…web server end… creates a web page for the client endcreates a web page for the client end if database data being returned, needs a table to display the dataif database data being returned, needs a table to display the data

How does this all work?How does this all work?

Page 36: COMP3241 E-Commerce Technologies

Server-side scripts etc…Server-side scripts etc… If the data picked up from the server has If the data picked up from the server has

been changed (e.g. by use of SQL query)…been changed (e.g. by use of SQL query)… the client display is changedthe client display is changed web pages become “dynamic”web pages become “dynamic”

» i.e. readily changeable without changing the web page i.e. readily changeable without changing the web page code code

Effect: Effect: by triggering SQL commands on the server, a by triggering SQL commands on the server, a

local web page gives an appearance of interacting local web page gives an appearance of interacting directly with a databasedirectly with a database

Page 37: COMP3241 E-Commerce Technologies

Web Dynamic Web Dynamic Client-Server ModelClient-Server Model

Server-Side processing Server-Side processing - typical web-based - typical web-based client-server app:client-server app:

1.1. HTML form displayed HTML form displayed on a web browser at on a web browser at the client end collects the client end collects datadata

2.2. Using HTTP form data Using HTTP form data sent to web serversent to web server

Page 38: COMP3241 E-Commerce Technologies

Web Dynamic Web Dynamic Client-Server ModelClient-Server Model

3.3. The web server The web server processes the data processes the data according to instructions according to instructions on a specified server on a specified server scriptscript

4.4. Using HTTP, the results Using HTTP, the results of processing generated of processing generated as specified by the as specified by the script are sent back to script are sent back to the clientthe client

Page 39: COMP3241 E-Commerce Technologies

Web Dynamic Web Dynamic Client-Server modelClient-Server model

5.5. The web browser on the The web browser on the client machine displays client machine displays the results on a web page the results on a web page in a specified positionin a specified position

This gets even more This gets even more complex when a complex when a database, and database database, and database programming, are also programming, are also involved at the server involved at the server end…end…

Page 40: COMP3241 E-Commerce Technologies

Exercise for Next WeekExercise for Next Week

Search Google for web hostsSearch Google for web hosts How many available?How many available? How could you choose?How could you choose?

Use the following URL to compare web hosts Use the following URL to compare web hosts and their offerings:and their offerings:http://www.hostindex.com/voteresults.shtm

Select criteria for an e-commerce hosting Select criteria for an e-commerce hosting solution that fit with comparison datasolution that fit with comparison data

Choose a suitable web host (server) for an Choose a suitable web host (server) for an e-commerce solutione-commerce solution

Page 41: COMP3241 E-Commerce Technologies

Thanks for listeningThanks for listening