SlideShare a Scribd company logo
1 of 33
Download to read offline
Presentation on
Web Technology
Topic: HTTP server and HTTP protocol
Course Code: CSE-502
May 14, 2015 IIT, University of Dhaka 1
Presented by:
Md. Rakib Hossain, BSSE-0516
A. H. M. Azimul Haque, BSSE-0519
Md. Mahbub Islam, BSSE-0510
Md. Rashedul Islam, BSSE-0510
Submitted to:
Mr. Amit Seal Ami
Lecuturer,
Institute of Information Technology
University of Dhaka
May 14, 2015 IIT, University of Dhaka 2
 Is a system of interlinked hypertext documents
 Accessed via the Internet with a web browser
 Client/Server data transfer protocol
 Communication via application level protocol
 Run on standard networking infrastructure
May 14, 2015 IIT, University of Dhaka 3
Internet World Wide Web
 The Internet is a global
system of
interconnected
computer networks.
 Its access is provided by
ISPs.
 It runs applications like
www, ftp, html etc
 Web is collection of text
documents and other
resources, linked by
hyperlinks and URLs
 Usually accessed
by web browsers
 Its an application
running on Internet
May 14, 2015 IIT, University of Dhaka 4
 Web page consists of objects
 Object can be HTML file, JPEG image, Java
applet, audio file,…
 Web page consists of base HTML-file which
includes several referenced objects
 Each object is addressable by a URL
 Example URL:
www.someschool.edu/someDept/pic.gif
host name path name
May 14, 2015 IIT, University of Dhaka 5
<scheme> : //<host> :<port> /<path>
;<parameters> ?<query> #<fragment>
Here
scheme
The protocol you are using
host
Host name or ip number
port
TCP port number that protocol server is using
path
Path and filename reference of object on server
parameters
Any specific parameters that object needs
query
Query string for a CGI program
fragment
Reference to a subset of an object
May 14, 2015 IIT, University of Dhaka 6
HTTP: hypertext transfer
protocol
 Web’s application layer
protocol
 client/server model
 client: browser that
requests, receives,
“displays” Web objects
 server: Web server sends
objects in response to
requests
 HTTP 1.0: RFC 1945
 HTTP 1.1: RFC 2068
PC running
Explorer
Server
running
Apache Web
server
Mac running
Navigator
May 14, 2015 IIT, University of Dhaka 7
Uses TCP:
 client initiates TCP connection
(creates socket) to server, port 80
 server accepts TCP connection from
client
 HTTP messages (application-layer
protocol messages) exchanged
between browser (HTTP client) and
Web server (HTTP server)
 HTTP – not worry about lost data;
taken care of by TCP
 TCP connection closed
HTTP is “stateless”
 server maintains no
information about past
client requests
Protocols that maintain
“state” are complex!
 past history (state) must be
maintained
 if server/client crashes, their
views of “state” may be
inconsistent, must be
reconciled
May 14, 2015 IIT, University of Dhaka 8
HTTP connections
Non-persistent HTTP
 At most one object is sent over a TCP connection.
 HTTP/1.0 uses nonpersistent HTTP
May 14, 2015 IIT, University of Dhaka 9
HTTP connections
Persistent HTTP
 Multiple objects can be sent over single TCP connection
between client and server.
 HTTP/1.1 uses persistent connections in default mode
May 14, 2015 IIT, University of Dhaka 10
Non-persistent HTTP
Suppose user enters URL
www.someSchool.edu/someDepartment/home.index
1a. HTTP client initiates TCP
connection to HTTP server (process)
at www.someSchool.edu on port 80
2. HTTP client sends HTTP request
message (containing URL) into
TCP connection socket. Message
indicates that client wants object
someDepartment/home.index
1b. HTTP server at host
www.someSchool.edu waiting for
TCP connection at port 80.
“accepts” connection, notifying
client
3. HTTP server receives request
message, forms response message
containing requested object, and
sends message into its socket
time
(contains text,
references to 10
jpeg images)
May 14, 2015 IIT, University of Dhaka 11
Non-persistent HTTP
5. HTTP client receives response
message containing html file,
displays html. Parsing html file,
finds 10 referenced jpeg objects
6. Steps 1-5 repeated for each of 10
jpeg objects
4. HTTP server closes TCP connection.
TCP waits and terminates the
connection when it knows that the
message is received by the client
time
Serial vs. parallel TCP connections
May 14, 2015 IIT, University of Dhaka 12
HTTP: Response time
RTT: time to send a small packet to travel
from client to server and back.
May 14, 2015 IIT, University of Dhaka 13
14
Non-Persistent HTTP:
Response time
Response time:
 one RTT to initiate TCP
connection
 one RTT for HTTP request
and first few bytes of HTTP
response to return
 file transmission time
total = 2RTT+transmit time
May 14, 2015 IIT, University of Dhaka 14
Non-Persistent HTTP
Non-persistent HTTP issues:
 requires 2 RTTs per object
 OS overhead for each TCP connection
 browsers often open parallel TCP connections to fetch
referenced objects
 Serious burden on Web server
May 14, 2015 IIT, University of Dhaka 15
Persistent HTTP
Persistent HTTP
 server leaves connection
open after sending
response
 subsequent HTTP
messages between same
client/server sent over open
connection
 Closes connection after
TIMEOUT INTERVAL!!!
May 14, 2015 IIT, University of Dhaka 16
Persistent Connection and
Pipelining
Persistent without pipelining:
 client issues new request only when previous response has
been received
 one RTT for each referenced object
Persistent with pipelining:
 default in HTTP/1.1
 client sends requests as soon as it encounters a referenced
object
 as little as one RTT for all the referenced objects
May 14, 2015 IIT, University of Dhaka 17
Persistent Connection and
Pipelining
May 14, 2015 IIT, University of Dhaka 18
HTTP request message
 two types of HTTP messages: request, response
 HTTP request message:
 ASCII (human-readable format)
GET /somedir/page.html HTTP/1.1
Host: www.someschool.edu
User-agent: Mozilla/4.0
Connection: close
Accept-language:fr
(extra carriage return, line feed)
request line
(GET, POST,
HEAD commands)
header
lines
Carriage return,
line feed
indicates end
of message
May 14, 2015 IIT, University of Dhaka 19
HTTP request message
Con…
May 14, 2015 IIT, University of Dhaka 20
HTTP request message:
general format
May 14, 2015 IIT, University of Dhaka 21
Uploading form input
Post method:
 Web page often includes
form input
 Input is uploaded to server
in entity body
URL method:
 Uses GET method
 Input is uploaded in URL
field of request line:
www.somesite.com/animalsearch?monkeys&banana
May 14, 2015 IIT, University of Dhaka 22
Method types
HTTP/1.0
 GET
 POST
 HEAD
 asks server to leave
requested object out of
response
HTTP/1.1
 GET, POST, HEAD
 PUT
 uploads file in entity body
to path specified in URL
field
 DELETE
 deletes file specified in the
URL field
May 14, 2015 IIT, University of Dhaka 23
HTTP response message
HTTP/1.1 200 OK
Connection close
Date: Thu, 06 Aug 1998 12:00:15 GMT
Server: Apache/1.3.0 (Unix)
Last-Modified: Mon, 22 Jun 1998 …...
Content-Length: 6821
Content-Type: text/html
data data data data data ...
status line
(protocol
status code
status phrase)
header
lines
data, e.g.,
requested
HTML file
May 14, 2015 IIT, University of Dhaka 24
HTTP response message
con..
May 14, 2015 IIT, University of Dhaka 25
HTTP response status codes
200 OK
 request succeeded, requested object later in this message
301 Moved Permanently
 requested object moved, new location specified later in this message
(Location:)
400 Bad Request
 request message not understood by server
404 Not Found
 requested document not found on this server
505 HTTP Version Not Supported
In first line in server->client response message.
A few sample codes:
May 14, 2015 IIT, University of Dhaka 26
Trying out HTTP (client
side) for yourself
1. Telnet to your favorite Web server:
Opens TCP connection to port 80
(default HTTP server port) at cis.poly.edu.
Anything typed in sent
to port 80 at cis.poly.edu
telnet cis.poly.edu 80
2. Type in a GET HTTP request:
GET /~ross/ HTTP/1.1
Host: cis.poly.edu
By typing this in (hit carriage
return twice), you send
this minimal (but complete)
GET request to HTTP server
3. Look at response message sent by HTTP server!
May 14, 2015 IIT, University of Dhaka 27
User-server state: cookies
Many major Web sites use cookies
Four components:
1) cookie header line of HTTP response message
2) cookie header line in HTTP request message
3) cookie file kept on user’s host, managed by user’s browser
4) back-end database at Web site
May 14, 2015 IIT, University of Dhaka 28
User-server state: cookies
Example:
 Susan access Internet always from same PC
 She visits a specific e-commerce site for first time
 When initial HTTP requests arrives at site, site creates a
unique ID and creates an entry in backend database for ID
May 14, 2015 IIT, University of Dhaka 29
Cookies: keeping “state”
May 14, 2015 IIT, University of Dhaka 30
Web Cookies
What cookies can bring:
 authorization
 shopping carts
 recommendations
 user session state (Web e-
mail)
Cookies and privacy:
 cookies permit sites to learn a lot
about you
 you may supply name and e-mail to
sites
aside
How to keep “state”:
 Protocol endpoints:
maintain state at
sender/receiver over
multiple transactions
 cookies: http messages
carry state
May 14, 2015 IIT, University of Dhaka 31
Web caches (proxy server)
 user sets browser: Web
accesses via cache
 browser sends all HTTP
requests to cache
 object in cache: cache
returns object
 else cache requests object
from origin server, then
returns object to client
Goal: satisfy client request without involving origin
server
client
Proxy
server
client
origin
server
origin
server
May 14, 2015 IIT, University of Dhaka 32
More about Web caching
 Cache acts as both
client and server
 Typically cache is
installed by ISP
(university, company,
residential ISP)
Why Web caching?
 Reduce response time for
client request.
 Reduce traffic on an
institution’s access link.
 Internet dense with
caches: enables “poor”
content providers to
effectively deliver content
(but so does P2P file
sharing)
May 14, 2015 IIT, University of Dhaka 33

More Related Content

Similar to Introduction to HTTP for 3rd year undergraduate

Distributed web based systems
Distributed web based systemsDistributed web based systems
Distributed web based systemsReza Gh
 
Ch2 the application layer protocols_http_3
Ch2 the application layer protocols_http_3Ch2 the application layer protocols_http_3
Ch2 the application layer protocols_http_3Syed Ariful Islam Emon
 
Abhishek srivastava ppt_web_tech
Abhishek srivastava ppt_web_techAbhishek srivastava ppt_web_tech
Abhishek srivastava ppt_web_techabhishek srivastav
 
HTTP/2 for Developers
HTTP/2 for DevelopersHTTP/2 for Developers
HTTP/2 for DevelopersSvetlin Nakov
 
ip1clientserver model
 ip1clientserver model ip1clientserver model
ip1clientserver modelmonikadeshmane
 
HTTP Protocol Basic
HTTP Protocol BasicHTTP Protocol Basic
HTTP Protocol BasicChuong Mai
 
application of http.pptx
application of http.pptxapplication of http.pptx
application of http.pptxssuseraf60311
 
Introduction to the World Wide Web
Introduction to the World Wide WebIntroduction to the World Wide Web
Introduction to the World Wide WebAbdalla Mahmoud
 
1 web technologies
1 web technologies1 web technologies
1 web technologiesJalpesh Vasa
 
Web programming by Najeeb ullahAzad(1)
Web programming by Najeeb ullahAzad(1)Web programming by Najeeb ullahAzad(1)
Web programming by Najeeb ullahAzad(1)azadmcs
 
NY Web Perf Meetup: Peeling the Web Performance Onion
NY Web Perf Meetup: Peeling the Web Performance OnionNY Web Perf Meetup: Peeling the Web Performance Onion
NY Web Perf Meetup: Peeling the Web Performance OnionCatchpoint Systems
 

Similar to Introduction to HTTP for 3rd year undergraduate (20)

Distributed web based systems
Distributed web based systemsDistributed web based systems
Distributed web based systems
 
www and http services
www and http serviceswww and http services
www and http services
 
Appl layer
Appl layerAppl layer
Appl layer
 
Ch2 the application layer protocols_http_3
Ch2 the application layer protocols_http_3Ch2 the application layer protocols_http_3
Ch2 the application layer protocols_http_3
 
Abhishek srivastava ppt_web_tech
Abhishek srivastava ppt_web_techAbhishek srivastava ppt_web_tech
Abhishek srivastava ppt_web_tech
 
Web technology
Web technologyWeb technology
Web technology
 
HTTP/2 for Developers
HTTP/2 for DevelopersHTTP/2 for Developers
HTTP/2 for Developers
 
http presentation 1.pptx
http presentation 1.pptxhttp presentation 1.pptx
http presentation 1.pptx
 
ip1clientserver model
 ip1clientserver model ip1clientserver model
ip1clientserver model
 
HTTP Protocol Basic
HTTP Protocol BasicHTTP Protocol Basic
HTTP Protocol Basic
 
Www and http
Www and httpWww and http
Www and http
 
application of http.pptx
application of http.pptxapplication of http.pptx
application of http.pptx
 
Introduction to the World Wide Web
Introduction to the World Wide WebIntroduction to the World Wide Web
Introduction to the World Wide Web
 
The HTTP and Web
The HTTP and Web The HTTP and Web
The HTTP and Web
 
1 web technologies
1 web technologies1 web technologies
1 web technologies
 
Study of http
Study of httpStudy of http
Study of http
 
Web programming by Najeeb ullahAzad(1)
Web programming by Najeeb ullahAzad(1)Web programming by Najeeb ullahAzad(1)
Web programming by Najeeb ullahAzad(1)
 
Application layer
Application layerApplication layer
Application layer
 
NY Web Perf Meetup: Peeling the Web Performance Onion
NY Web Perf Meetup: Peeling the Web Performance OnionNY Web Perf Meetup: Peeling the Web Performance Onion
NY Web Perf Meetup: Peeling the Web Performance Onion
 
HTTP Basics
HTTP BasicsHTTP Basics
HTTP Basics
 

Recently uploaded

Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01KreezheaRecto
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfRagavanV2
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringmulugeta48
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptMsecMca
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoordharasingh5698
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdfSuman Jyoti
 

Recently uploaded (20)

(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdf
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 

Introduction to HTTP for 3rd year undergraduate

  • 1. Presentation on Web Technology Topic: HTTP server and HTTP protocol Course Code: CSE-502 May 14, 2015 IIT, University of Dhaka 1
  • 2. Presented by: Md. Rakib Hossain, BSSE-0516 A. H. M. Azimul Haque, BSSE-0519 Md. Mahbub Islam, BSSE-0510 Md. Rashedul Islam, BSSE-0510 Submitted to: Mr. Amit Seal Ami Lecuturer, Institute of Information Technology University of Dhaka May 14, 2015 IIT, University of Dhaka 2
  • 3.  Is a system of interlinked hypertext documents  Accessed via the Internet with a web browser  Client/Server data transfer protocol  Communication via application level protocol  Run on standard networking infrastructure May 14, 2015 IIT, University of Dhaka 3
  • 4. Internet World Wide Web  The Internet is a global system of interconnected computer networks.  Its access is provided by ISPs.  It runs applications like www, ftp, html etc  Web is collection of text documents and other resources, linked by hyperlinks and URLs  Usually accessed by web browsers  Its an application running on Internet May 14, 2015 IIT, University of Dhaka 4
  • 5.  Web page consists of objects  Object can be HTML file, JPEG image, Java applet, audio file,…  Web page consists of base HTML-file which includes several referenced objects  Each object is addressable by a URL  Example URL: www.someschool.edu/someDept/pic.gif host name path name May 14, 2015 IIT, University of Dhaka 5
  • 6. <scheme> : //<host> :<port> /<path> ;<parameters> ?<query> #<fragment> Here scheme The protocol you are using host Host name or ip number port TCP port number that protocol server is using path Path and filename reference of object on server parameters Any specific parameters that object needs query Query string for a CGI program fragment Reference to a subset of an object May 14, 2015 IIT, University of Dhaka 6
  • 7. HTTP: hypertext transfer protocol  Web’s application layer protocol  client/server model  client: browser that requests, receives, “displays” Web objects  server: Web server sends objects in response to requests  HTTP 1.0: RFC 1945  HTTP 1.1: RFC 2068 PC running Explorer Server running Apache Web server Mac running Navigator May 14, 2015 IIT, University of Dhaka 7
  • 8. Uses TCP:  client initiates TCP connection (creates socket) to server, port 80  server accepts TCP connection from client  HTTP messages (application-layer protocol messages) exchanged between browser (HTTP client) and Web server (HTTP server)  HTTP – not worry about lost data; taken care of by TCP  TCP connection closed HTTP is “stateless”  server maintains no information about past client requests Protocols that maintain “state” are complex!  past history (state) must be maintained  if server/client crashes, their views of “state” may be inconsistent, must be reconciled May 14, 2015 IIT, University of Dhaka 8
  • 9. HTTP connections Non-persistent HTTP  At most one object is sent over a TCP connection.  HTTP/1.0 uses nonpersistent HTTP May 14, 2015 IIT, University of Dhaka 9
  • 10. HTTP connections Persistent HTTP  Multiple objects can be sent over single TCP connection between client and server.  HTTP/1.1 uses persistent connections in default mode May 14, 2015 IIT, University of Dhaka 10
  • 11. Non-persistent HTTP Suppose user enters URL www.someSchool.edu/someDepartment/home.index 1a. HTTP client initiates TCP connection to HTTP server (process) at www.someSchool.edu on port 80 2. HTTP client sends HTTP request message (containing URL) into TCP connection socket. Message indicates that client wants object someDepartment/home.index 1b. HTTP server at host www.someSchool.edu waiting for TCP connection at port 80. “accepts” connection, notifying client 3. HTTP server receives request message, forms response message containing requested object, and sends message into its socket time (contains text, references to 10 jpeg images) May 14, 2015 IIT, University of Dhaka 11
  • 12. Non-persistent HTTP 5. HTTP client receives response message containing html file, displays html. Parsing html file, finds 10 referenced jpeg objects 6. Steps 1-5 repeated for each of 10 jpeg objects 4. HTTP server closes TCP connection. TCP waits and terminates the connection when it knows that the message is received by the client time Serial vs. parallel TCP connections May 14, 2015 IIT, University of Dhaka 12
  • 13. HTTP: Response time RTT: time to send a small packet to travel from client to server and back. May 14, 2015 IIT, University of Dhaka 13
  • 14. 14 Non-Persistent HTTP: Response time Response time:  one RTT to initiate TCP connection  one RTT for HTTP request and first few bytes of HTTP response to return  file transmission time total = 2RTT+transmit time May 14, 2015 IIT, University of Dhaka 14
  • 15. Non-Persistent HTTP Non-persistent HTTP issues:  requires 2 RTTs per object  OS overhead for each TCP connection  browsers often open parallel TCP connections to fetch referenced objects  Serious burden on Web server May 14, 2015 IIT, University of Dhaka 15
  • 16. Persistent HTTP Persistent HTTP  server leaves connection open after sending response  subsequent HTTP messages between same client/server sent over open connection  Closes connection after TIMEOUT INTERVAL!!! May 14, 2015 IIT, University of Dhaka 16
  • 17. Persistent Connection and Pipelining Persistent without pipelining:  client issues new request only when previous response has been received  one RTT for each referenced object Persistent with pipelining:  default in HTTP/1.1  client sends requests as soon as it encounters a referenced object  as little as one RTT for all the referenced objects May 14, 2015 IIT, University of Dhaka 17
  • 18. Persistent Connection and Pipelining May 14, 2015 IIT, University of Dhaka 18
  • 19. HTTP request message  two types of HTTP messages: request, response  HTTP request message:  ASCII (human-readable format) GET /somedir/page.html HTTP/1.1 Host: www.someschool.edu User-agent: Mozilla/4.0 Connection: close Accept-language:fr (extra carriage return, line feed) request line (GET, POST, HEAD commands) header lines Carriage return, line feed indicates end of message May 14, 2015 IIT, University of Dhaka 19
  • 20. HTTP request message Con… May 14, 2015 IIT, University of Dhaka 20
  • 21. HTTP request message: general format May 14, 2015 IIT, University of Dhaka 21
  • 22. Uploading form input Post method:  Web page often includes form input  Input is uploaded to server in entity body URL method:  Uses GET method  Input is uploaded in URL field of request line: www.somesite.com/animalsearch?monkeys&banana May 14, 2015 IIT, University of Dhaka 22
  • 23. Method types HTTP/1.0  GET  POST  HEAD  asks server to leave requested object out of response HTTP/1.1  GET, POST, HEAD  PUT  uploads file in entity body to path specified in URL field  DELETE  deletes file specified in the URL field May 14, 2015 IIT, University of Dhaka 23
  • 24. HTTP response message HTTP/1.1 200 OK Connection close Date: Thu, 06 Aug 1998 12:00:15 GMT Server: Apache/1.3.0 (Unix) Last-Modified: Mon, 22 Jun 1998 …... Content-Length: 6821 Content-Type: text/html data data data data data ... status line (protocol status code status phrase) header lines data, e.g., requested HTML file May 14, 2015 IIT, University of Dhaka 24
  • 25. HTTP response message con.. May 14, 2015 IIT, University of Dhaka 25
  • 26. HTTP response status codes 200 OK  request succeeded, requested object later in this message 301 Moved Permanently  requested object moved, new location specified later in this message (Location:) 400 Bad Request  request message not understood by server 404 Not Found  requested document not found on this server 505 HTTP Version Not Supported In first line in server->client response message. A few sample codes: May 14, 2015 IIT, University of Dhaka 26
  • 27. Trying out HTTP (client side) for yourself 1. Telnet to your favorite Web server: Opens TCP connection to port 80 (default HTTP server port) at cis.poly.edu. Anything typed in sent to port 80 at cis.poly.edu telnet cis.poly.edu 80 2. Type in a GET HTTP request: GET /~ross/ HTTP/1.1 Host: cis.poly.edu By typing this in (hit carriage return twice), you send this minimal (but complete) GET request to HTTP server 3. Look at response message sent by HTTP server! May 14, 2015 IIT, University of Dhaka 27
  • 28. User-server state: cookies Many major Web sites use cookies Four components: 1) cookie header line of HTTP response message 2) cookie header line in HTTP request message 3) cookie file kept on user’s host, managed by user’s browser 4) back-end database at Web site May 14, 2015 IIT, University of Dhaka 28
  • 29. User-server state: cookies Example:  Susan access Internet always from same PC  She visits a specific e-commerce site for first time  When initial HTTP requests arrives at site, site creates a unique ID and creates an entry in backend database for ID May 14, 2015 IIT, University of Dhaka 29
  • 30. Cookies: keeping “state” May 14, 2015 IIT, University of Dhaka 30
  • 31. Web Cookies What cookies can bring:  authorization  shopping carts  recommendations  user session state (Web e- mail) Cookies and privacy:  cookies permit sites to learn a lot about you  you may supply name and e-mail to sites aside How to keep “state”:  Protocol endpoints: maintain state at sender/receiver over multiple transactions  cookies: http messages carry state May 14, 2015 IIT, University of Dhaka 31
  • 32. Web caches (proxy server)  user sets browser: Web accesses via cache  browser sends all HTTP requests to cache  object in cache: cache returns object  else cache requests object from origin server, then returns object to client Goal: satisfy client request without involving origin server client Proxy server client origin server origin server May 14, 2015 IIT, University of Dhaka 32
  • 33. More about Web caching  Cache acts as both client and server  Typically cache is installed by ISP (university, company, residential ISP) Why Web caching?  Reduce response time for client request.  Reduce traffic on an institution’s access link.  Internet dense with caches: enables “poor” content providers to effectively deliver content (but so does P2P file sharing) May 14, 2015 IIT, University of Dhaka 33