April 17, 2004April 17, 2004 Prof. Paul LinProf. Paul Lin 11
CPET 355CPET 355Data Communications & NetworkingData Communications & Networking
7. The Application Layer:7. The Application Layer:World Wide Web - Part 1World Wide Web - Part 1
Paul I-Hai Lin, Professor Paul I-Hai Lin, Professor Electrical and Computer Engineering Electrical and Computer Engineering
TechnologyTechnologyPurdue University, Fort Wayne CampusPurdue University, Fort Wayne Campus
April 17, 2004April 17, 2004 Prof. Paul LinProf. Paul Lin 22
The World Wide WebThe World Wide Web
The Web began in 1989 at CERN, the The Web began in 1989 at CERN, the European center for nuclear researchEuropean center for nuclear research
Tim Berners-Lee, a CERN physicist Tim Berners-Lee, a CERN physicist proposed “A Web of Linked Documents,” proposed “A Web of Linked Documents,” in 1989 for distributing/sharing high-energy in 1989 for distributing/sharing high-energy physics data: reports, blueprints, drawings, physics data: reports, blueprints, drawings, photos, and other documentsphotos, and other documents
In Dec. 1991, the first text-based prototype In Dec. 1991, the first text-based prototype was demonstrated in An Antonio, Texaswas demonstrated in An Antonio, Texas
April 17, 2004April 17, 2004 Prof. Paul LinProf. Paul Lin 33
The World Wide WebThe World Wide Web
Marc Andreessen at the U. of Illinois, Marc Andreessen at the U. of Illinois, developed the first GUI based browser, developed the first GUI based browser, Mosaic and released in Feb. 1993Mosaic and released in Feb. 1993
Marc Andreessen form a company – Marc Andreessen form a company – Netscape Communications Corp., to Netscape Communications Corp., to develop clients, servers, and Web develop clients, servers, and Web software and went public in 1995software and went public in 1995
In 1998, AOL bought Netscape for $4.2 In 1998, AOL bought Netscape for $4.2 billionsbillions
April 17, 2004April 17, 2004 Prof. Paul LinProf. Paul Lin 44
The World Wide WebThe World Wide Web
In 1994, CERN and MIT signed and In 1994, CERN and MIT signed and agreement setting up the World Wide Web agreement setting up the World Wide Web Consortium (Consortium (www.w3c.orgwww.w3c.org))
Time Berners-Lee became the director of Time Berners-Lee became the director of W3CW3C
April 17, 2004April 17, 2004 Prof. Paul LinProf. Paul Lin 55
WWW ArchitectureWWW Architecture
The Web - consists of a vast, worldwide The Web - consists of a vast, worldwide collections of Web pages (documents) stored in collections of Web pages (documents) stored in Web serversWeb servers
Web pages Web pages • Text files written in HTML (HyperText Markup Text files written in HTML (HyperText Markup
Language), and saved with htm or html as an Language), and saved with htm or html as an extensionextension
• Each page may contain links to other pages Each page may contain links to other pages anywhere in the worldanywhere in the world
• User can follow a link by clicking on itUser can follow a link by clicking on it• This process can be repeated indefinitelyThis process can be repeated indefinitely
April 17, 2004April 17, 2004 Prof. Paul LinProf. Paul Lin 66
Web Browser ArchitectureWeb Browser Architecture
HTTP SMTPTELNETFTP
Controller (uses keyboard, mouse, client protocols/programs)
HTML
JAVA
CGI
Client Protocols, Programs
April 17, 2004April 17, 2004 Prof. Paul LinProf. Paul Lin 77
Web ClientsWeb Clients
Address - URLs (uniform resource locators)Address - URLs (uniform resource locators)http://www.etcs.ipfw.edu/~lin/index.htmlhttp://www.etcs.ipfw.edu/~lin/index.html
Browser <-> DNS <-> IP addressBrowser <-> DNS <-> IP address Browser makes a TCP connection to the port 80 on Browser makes a TCP connection to the port 80 on
this IP addressthis IP address Request for the index.html page from the Web Request for the index.html page from the Web
serverserver The Web server sends index.html and related The Web server sends index.html and related
image filesimage files Disconnect TCP connectionDisconnect TCP connection Display all the text and imagesDisplay all the text and images
April 17, 2004April 17, 2004 Prof. Paul LinProf. Paul Lin 88
Web ClientsWeb Clients
HTML InterpreterHTML Interpreter Javacript InterpreterJavacript Interpreter Built-in MIME TypeBuilt-in MIME Type FTP InterfaceFTP Interface Plug-in – a code module that installed Plug-in – a code module that installed
when needed (Java plug-in for example)when needed (Java plug-in for example) Helper applications (Adobe Acrobat Helper applications (Adobe Acrobat
Reader for displaying PDF files, or MS Reader for displaying PDF files, or MS Word for displaying DOC files)Word for displaying DOC files)
April 17, 2004April 17, 2004 Prof. Paul LinProf. Paul Lin 99
Web ClientsWeb Clients
Client’s MIME type/subtypeClient’s MIME type/subtype• Text/htmlText/html• application/pdfapplication/pdf• application/mswordapplication/msword• image/gifimage/gif• Image/jpgImage/jpg• image/x-photoshopimage/x-photoshop• audio/mp3 audio/mp3 - RealOne player- RealOne player
April 17, 2004April 17, 2004 Prof. Paul LinProf. Paul Lin 1010
Web ServersWeb Servers
Web serversWeb servers• Listen to TCP port 80Listen to TCP port 80• Accept client connections (browsers)Accept client connections (browsers)• Retrieve the requested file from the server’s Retrieve the requested file from the server’s
diskdisk• Process the needed server procedures or Process the needed server procedures or
functions (authentication, cookies, session, functions (authentication, cookies, session, access control, log, etc) access control, log, etc)
• Return the fileReturn the file• Release the TCP connectionRelease the TCP connection
April 17, 2004April 17, 2004 Prof. Paul LinProf. Paul Lin 1111
An Apache Web Server An Apache Web Server ExampleExample
Apache Web Server
/home,
/home/cgi-bin/Directories
/var/www/htdocs/
/etc/httpd/conf/http.conf
/var/www/icons/
/var/www/cgi-bin/
/var/www/logs/
/home/ron/html/
/home/ron/html/
/home/ron/html/
index.html
index.html
index.html
Client
database
Internet
Pen computer
TCP Port 80
April 17, 2004April 17, 2004 Prof. Paul LinProf. Paul Lin 1212
Web ServersWeb Servers
Apache
Internet/Intranet/LAN
HTML Files
Client Computer/Web Browser
ETCS School Web Server
HTTP
HTTP
Apache IIS
Hub
PC-H PC-A
Hub
ECET Department Server Room
ECET Lab Computers
April 17, 2004April 17, 2004 Prof. Paul LinProf. Paul Lin 1313
TCP/IP-Based Remote ControlTCP/IP-Based Remote Control
PC Client
Notebook Client
Internet
Solid State Relay
Solid State Relay
Server(HTTP/FTP/CGI,etc)
Remote Access Device
(RS232,485)
Fans
April 17, 2004April 17, 2004 Prof. Paul LinProf. Paul Lin 1414
TCP/IP-based-Monitoring and TCP/IP-based-Monitoring and ControlControl
Digital Inputs
AC On/Off Switch
Vent. Fan On/Off Sw
Main Sw
Ventilation Fan
Analog Inputs
AB
AB
Web-Based HVAC System
Outputs
2-Position On/Off Controller
Humidifier
Cooling
Heating
DamperController
Controller
Controller
Controller
Digital Outputs
Pump
Valve
SSR
Relay
SSR
Air Supply FanLAN/WAN/
Internet/DialUp/Wireless
Client Computer/browser
Computer
A/Ds&
SignalCond.
Digital Inputs
Digital Outputs
D/As&
Amp.
HVAC Control/Monitor
Programs
Web Server
HVAC Control/Monitor Programs
Modem
Wireless
RS485
RS232
Network Interface
Card
Data
Outdoor Temp. Sensor
Humidity Sensor
Zone Temp Sensor
Comp. Motor
Current Sensor
Fan Motor Current Sensor
Light Sensor