SlideShare a Scribd company logo
Computer Networks – CSE331
Lecture 7
2 Hrs
First, a review…
 Until 1990s universities, researchers => remote loging, file
transfer, email
 World wide web (www) in 1994 Tim Berners Lee
 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, e.g.,
www.someschool.edu/someDept/pic.gif
host name path name
hypertext transfer protocol
 HTTP/Web Client: browser
 HTTP Server: apache, IIS
 Web page: index.html
 Object: picture, javascript file
 URL: http://www.uet.edu.pk/cs.html
 Uses TCP
 Stateless: server don’t remember
 Non-persistent: one connection per
object
 Persistent: leave connection open
 Uses ASCII messages not binary
PC running
Firefox browser
server
running
Apache Web
server
iphone running
Safari browser
 two types of HTTP messages: request, response
 HTTP request message:
 ASCII (human-readable format)
request line
(GET, POST,
HEAD commands)
header
lines
carriage return,
line feed at start
of line indicates
end of header lines
GET /department/cs HTTP/1.1rn
Host: www.rcet.uet.edu.pkrn
User-Agent: Firefox/3.6.10rn
Accept: text/html,application/xhtml+xmlrn
Accept-Language: en-us,enrn
Accept-Encoding: gzip,deflatern
Accept-Charset: ISO-8859-1,utf-8rn
Connection: keep-alivern
rn
carriage return character
line-feed character
request
line
header
lines
body
method sp sp cr lfversionURL
cr lfvalueheader field name
cr lfvalueheader field name
~~ ~~
cr lf
entity body~~ ~~
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
Lec 7(HTTP Protocol)
status line
(protocol
status code
status phrase)
header
lines
data, e.g.,
requested
HTML file
HTTP/1.1 200 OKrn
Date: Sun, 19 Feb 2017 18:41:45 GMT rn
Server: Apache/2.2.27 (Unix) rn
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Accept-Ranges: bytesrn
Content-Length: 2652rn
Keep-Alive: timeout=10, max=100rn
Connection: Keep-Alivern
Content-Type: text/html; charset=ISO-8859-1rn
rn
data data data data data ...
persistent
200 OK
 request succeeded, requested object later in this msg
301 Moved Permanently
 requested object moved, new location specified later in this msg
(Location:)
400 Bad Request
 request msg not understood by server
404 Not Found
 requested document not found on this server
505 HTTP Version Not Supported
 In 1st line in server-to-client response message.
 some sample codes:
many Web sites use cookies
four components:
1) cookie header line of
HTTP response message
2) cookie header line in
next HTTP request
message
3) cookie file kept on
user’s host, managed by
user’s browser
4) back-end database at
Web site
example:
 visits specific e-commerce
site for first time
 when initial HTTP requests
arrives at site, site creates:
 unique ID
 entry in backend database
for ID
client server
usual http response msg
usual http response msg
cookie file
one week later:
usual http request msg
cookie: 1678 cookie-
specific
action
access
ebay 8734
usual http request msg Amazon server
creates ID
1678 for user create
entry
usual http response
set-cookie: 1678ebay 8734
amazon 1678
usual http request msg
cookie: 1678 cookie-
specific
action
access
ebay 8734
amazon 1678
backend
database
 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
 cache acts as both client and
server
 server for original
requesting client
 client to origin 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 (so too does P2P file
sharing)
origin
serverspublic
Internet
institutional
network 100 Mbps LAN
15 Mbps
access link
assumptions:
 avg object size: 1Mbits
 avg request rate from browsers to origin
servers:15/sec
 RTT from institutional router to any
origin server: 2 sec
 access link rate: 15 Mbps
consequences:
 LAN utilization: 0.15 = 15%
 access link utilization = 1 = 100%
 total delay = Internet delay + access
delay + LAN delay
= 2 sec + minutes + μsecs
problem!
assumptions:
 avg object size: 1Mbits
 avg request rate from browsers to origin
servers:15/sec
 RTT from institutional router to any
origin server: 2 sec
 access link rate: 15 Mbps
consequences:
 LAN utilization: 15%
 access link utilization = 100%
 total delay = Internet delay + access
delay + LAN delay
= 2 sec + minutes + μsecs
origin
servers
15 Mbps
access link
150 Mbps
150 Mbps
msecs
Cost: increased access link speed (not cheap!)
10%
public
Internet
institutional
network 100Mbps LAN
institutional
network 100Mbps LAN
origin
servers
15 Mbps
access link
local web
cache
assumptions:
 avg object size: 1Mbits
 avg request rate from browsers to origin
servers:15/sec
 RTT from institutional router to any
origin server: 2 sec
 access link rate: 15 Mbps
consequences:
 LAN utilization: 15%
 access link utilization =
 total delay = Internet delay + access
delay + LAN delay
= 2 sec + minutes + μsecs
?
?
How to compute link
utilization, delay?
Cost: web cache (cheap!)
public
Internet
Calculating access link utilization, delay
with cache:
 suppose cache hit rate is 0.4
 40% requests satisfied at cache, 60% requests
satisfied at origin
origin
servers
15 Mbps
access link
 access link utilization:
 60% of requests use access link
 data rate to browsers over access link = 0.6*15
Mbps = 9 Mbps
 utilization = 9/15 = 0.6
 total delay
 = 0.6 * (delay from origin servers) +0.4 *
(delay when satisfied at cache)
 = 0.6 (2.01) + 0.4 (~msecs)
 = ~ 1.2 secs
 less than with 150 Mbps link (and cheaper
too!)
public
Internet
institutional
network 100 Mbps LAN
local web
cache
 Goal: don’t send object if
cache has up-to-date cached
version
 no object transmission delay
 lower link utilization
 cache: specify date of
cached copy in HTTP
request
If-modified-since: <date>
 server: response contains no
object if cached copy is up-
to-date:
HTTP/1.0 304 Not Modified
HTTP request msg
If-modified-since: <date>
HTTP response
HTTP/1.0
304 Not Modified
object
not
modified
before
<date>
HTTP request msg
If-modified-since: <date>
HTTP response
HTTP/1.0 200 OK
<data>
object
modified
after
<date>
client server
Lec 7(HTTP Protocol)
 Ross book 2.2
 Forouzan book Chapter 22
 HTTP methods example
 See attached file http_methods.pdf
 Key Differences between HTTP1.1 & 1.0
 www8.org/w8-papers/5c-protocols/key/key.html
Ad

More Related Content

What's hot (20)

HTTP Definition and Basics.
HTTP Definition and Basics.HTTP Definition and Basics.
HTTP Definition and Basics.
Halah Salih
 
Http VS. Https
Http VS. HttpsHttp VS. Https
Http VS. Https
Raed Aldahdooh
 
HTTP Protocol Basic
HTTP Protocol BasicHTTP Protocol Basic
HTTP Protocol Basic
Chuong Mai
 
HTTP
HTTPHTTP
HTTP
vaibhavrai1993
 
Http
HttpHttp
Http
Luavis Kang
 
Http Introduction
Http IntroductionHttp Introduction
Http Introduction
Akshay Dhole
 
Hypertext transfer protocol (http)
Hypertext transfer protocol (http)Hypertext transfer protocol (http)
Hypertext transfer protocol (http)
Shimona Agarwal
 
HTTP request and response
HTTP request and responseHTTP request and response
HTTP request and response
Sahil Agarwal
 
Application layer
Application layer Application layer
Application layer
anonymous
 
Http Protocol
Http ProtocolHttp Protocol
Http Protocol
N R Z Malik
 
HTTP & WWW
HTTP & WWWHTTP & WWW
HTTP & WWW
RazanAlsaif
 
message communication protocols in IoT
message communication protocols in IoTmessage communication protocols in IoT
message communication protocols in IoT
FabMinds
 
Simple mail transfer protocol (smtp)
Simple mail transfer protocol (smtp) Simple mail transfer protocol (smtp)
Simple mail transfer protocol (smtp)
RochakSrivastava3
 
AAA Protocol
AAA ProtocolAAA Protocol
AAA Protocol
Netwax Lab
 
HTTP
HTTPHTTP
HTTP
bhavanatmithun
 
Hypertext Transfer Protocol
Hypertext Transfer ProtocolHypertext Transfer Protocol
Hypertext Transfer Protocol
selvakumar_b1985
 
web connectivity in IoT
web connectivity in IoTweb connectivity in IoT
web connectivity in IoT
FabMinds
 
Chapter Five - Transport Layer.pptx
Chapter Five - Transport Layer.pptxChapter Five - Transport Layer.pptx
Chapter Five - Transport Layer.pptx
GirT2
 
Http request&response by Vignesh 15 MAR 2014
Http request&response by Vignesh 15 MAR 2014Http request&response by Vignesh 15 MAR 2014
Http request&response by Vignesh 15 MAR 2014
Navaneethan Naveen
 
Http headers
Http headersHttp headers
Http headers
Judy Ngure
 
HTTP Definition and Basics.
HTTP Definition and Basics.HTTP Definition and Basics.
HTTP Definition and Basics.
Halah Salih
 
HTTP Protocol Basic
HTTP Protocol BasicHTTP Protocol Basic
HTTP Protocol Basic
Chuong Mai
 
Hypertext transfer protocol (http)
Hypertext transfer protocol (http)Hypertext transfer protocol (http)
Hypertext transfer protocol (http)
Shimona Agarwal
 
HTTP request and response
HTTP request and responseHTTP request and response
HTTP request and response
Sahil Agarwal
 
Application layer
Application layer Application layer
Application layer
anonymous
 
message communication protocols in IoT
message communication protocols in IoTmessage communication protocols in IoT
message communication protocols in IoT
FabMinds
 
Simple mail transfer protocol (smtp)
Simple mail transfer protocol (smtp) Simple mail transfer protocol (smtp)
Simple mail transfer protocol (smtp)
RochakSrivastava3
 
Hypertext Transfer Protocol
Hypertext Transfer ProtocolHypertext Transfer Protocol
Hypertext Transfer Protocol
selvakumar_b1985
 
web connectivity in IoT
web connectivity in IoTweb connectivity in IoT
web connectivity in IoT
FabMinds
 
Chapter Five - Transport Layer.pptx
Chapter Five - Transport Layer.pptxChapter Five - Transport Layer.pptx
Chapter Five - Transport Layer.pptx
GirT2
 
Http request&response by Vignesh 15 MAR 2014
Http request&response by Vignesh 15 MAR 2014Http request&response by Vignesh 15 MAR 2014
Http request&response by Vignesh 15 MAR 2014
Navaneethan Naveen
 

Similar to Lec 7(HTTP Protocol) (20)

Computer networks module 5 content covered in this ppt
Computer networks module 5 content covered in this pptComputer networks module 5 content covered in this ppt
Computer networks module 5 content covered in this ppt
vinuthak18
 
009577496.pdf
009577496.pdf009577496.pdf
009577496.pdf
EidTahir
 
02 - Asassssssspplication Layer (HTTP).pdf
02 - Asassssssspplication Layer (HTTP).pdf02 - Asassssssspplication Layer (HTTP).pdf
02 - Asassssssspplication Layer (HTTP).pdf
HasibTurjo
 
Appl layer
Appl layerAppl layer
Appl layer
rajanikant
 
Lec 6(Application Layer)
Lec 6(Application Layer)Lec 6(Application Layer)
Lec 6(Application Layer)
maamir farooq
 
6 app-tcp
6 app-tcp6 app-tcp
6 app-tcp
Olivier Bonaventure
 
Chapter2 Application
Chapter2 ApplicationChapter2 Application
Chapter2 Application
Diego Corrales
 
Chapter_2_v8.3.pptx
Chapter_2_v8.3.pptxChapter_2_v8.3.pptx
Chapter_2_v8.3.pptx
InventiveMinecraft
 
Computer Network presentation chapter two
Computer Network presentation chapter twoComputer Network presentation chapter two
Computer Network presentation chapter two
ChetanLunthi
 
Chapter_2 jaringan komputer informatika.pptx
Chapter_2 jaringan komputer informatika.pptxChapter_2 jaringan komputer informatika.pptx
Chapter_2 jaringan komputer informatika.pptx
FauzanPrasetyo3
 
kkkkkkkkkkkkkkkkkkkmkm,kll;kl;l;l;l;lll;l;l;;;
kkkkkkkkkkkkkkkkkkkmkm,kll;kl;l;l;l;lll;l;l;;;kkkkkkkkkkkkkkkkkkkmkm,kll;kl;l;l;l;lll;l;l;;;
kkkkkkkkkkkkkkkkkkkmkm,kll;kl;l;l;l;lll;l;l;;;
kassemKhalil1
 
4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptx
4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptx
4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptx
ZahouAmel1
 
Chapter2 l2 modified_um
Chapter2 l2 modified_umChapter2 l2 modified_um
Chapter2 l2 modified_um
Sajid Baloch
 
Web Services 2009
Web Services 2009Web Services 2009
Web Services 2009
Cathie101
 
Web Services 2009
Web Services 2009Web Services 2009
Web Services 2009
Cathie101
 
02_Chapter_2_V6_LV.pptx
02_Chapter_2_V6_LV.pptx02_Chapter_2_V6_LV.pptx
02_Chapter_2_V6_LV.pptx
ALI2H
 
Presentation (PowerPoint File)
Presentation (PowerPoint File)Presentation (PowerPoint File)
Presentation (PowerPoint File)
webhostingguy
 
Presentation (PowerPoint File)
Presentation (PowerPoint File)Presentation (PowerPoint File)
Presentation (PowerPoint File)
webhostingguy
 
Chapter_2 Computer Networks Basics....pptx
Chapter_2 Computer Networks Basics....pptxChapter_2 Computer Networks Basics....pptx
Chapter_2 Computer Networks Basics....pptx
usmanahmadawan
 
Chapter_2_v8.1.pptx
Chapter_2_v8.1.pptxChapter_2_v8.1.pptx
Chapter_2_v8.1.pptx
WentworthMiller3
 
Computer networks module 5 content covered in this ppt
Computer networks module 5 content covered in this pptComputer networks module 5 content covered in this ppt
Computer networks module 5 content covered in this ppt
vinuthak18
 
009577496.pdf
009577496.pdf009577496.pdf
009577496.pdf
EidTahir
 
02 - Asassssssspplication Layer (HTTP).pdf
02 - Asassssssspplication Layer (HTTP).pdf02 - Asassssssspplication Layer (HTTP).pdf
02 - Asassssssspplication Layer (HTTP).pdf
HasibTurjo
 
Lec 6(Application Layer)
Lec 6(Application Layer)Lec 6(Application Layer)
Lec 6(Application Layer)
maamir farooq
 
Computer Network presentation chapter two
Computer Network presentation chapter twoComputer Network presentation chapter two
Computer Network presentation chapter two
ChetanLunthi
 
Chapter_2 jaringan komputer informatika.pptx
Chapter_2 jaringan komputer informatika.pptxChapter_2 jaringan komputer informatika.pptx
Chapter_2 jaringan komputer informatika.pptx
FauzanPrasetyo3
 
kkkkkkkkkkkkkkkkkkkmkm,kll;kl;l;l;l;lll;l;l;;;
kkkkkkkkkkkkkkkkkkkmkm,kll;kl;l;l;l;lll;l;l;;;kkkkkkkkkkkkkkkkkkkmkm,kll;kl;l;l;l;lll;l;l;;;
kkkkkkkkkkkkkkkkkkkmkm,kll;kl;l;l;l;lll;l;l;;;
kassemKhalil1
 
4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptx
4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptx
4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptx
ZahouAmel1
 
Chapter2 l2 modified_um
Chapter2 l2 modified_umChapter2 l2 modified_um
Chapter2 l2 modified_um
Sajid Baloch
 
Web Services 2009
Web Services 2009Web Services 2009
Web Services 2009
Cathie101
 
Web Services 2009
Web Services 2009Web Services 2009
Web Services 2009
Cathie101
 
02_Chapter_2_V6_LV.pptx
02_Chapter_2_V6_LV.pptx02_Chapter_2_V6_LV.pptx
02_Chapter_2_V6_LV.pptx
ALI2H
 
Presentation (PowerPoint File)
Presentation (PowerPoint File)Presentation (PowerPoint File)
Presentation (PowerPoint File)
webhostingguy
 
Presentation (PowerPoint File)
Presentation (PowerPoint File)Presentation (PowerPoint File)
Presentation (PowerPoint File)
webhostingguy
 
Chapter_2 Computer Networks Basics....pptx
Chapter_2 Computer Networks Basics....pptxChapter_2 Computer Networks Basics....pptx
Chapter_2 Computer Networks Basics....pptx
usmanahmadawan
 
Ad

More from maamir farooq (20)

Ooad lab1
Ooad lab1Ooad lab1
Ooad lab1
maamir farooq
 
Lesson 03
Lesson 03Lesson 03
Lesson 03
maamir farooq
 
Lesson 02
Lesson 02Lesson 02
Lesson 02
maamir farooq
 
Php client libray
Php client librayPhp client libray
Php client libray
maamir farooq
 
Swiftmailer
SwiftmailerSwiftmailer
Swiftmailer
maamir farooq
 
Lect15
Lect15Lect15
Lect15
maamir farooq
 
Lec 7
Lec 7Lec 7
Lec 7
maamir farooq
 
Lec 6
Lec 6Lec 6
Lec 6
maamir farooq
 
Lec 5
Lec 5Lec 5
Lec 5
maamir farooq
 
J query 1.7 cheat sheet
J query 1.7 cheat sheetJ query 1.7 cheat sheet
J query 1.7 cheat sheet
maamir farooq
 
Assignment
AssignmentAssignment
Assignment
maamir farooq
 
Java script summary
Java script summaryJava script summary
Java script summary
maamir farooq
 
Lec 3
Lec 3Lec 3
Lec 3
maamir farooq
 
Lec 2
Lec 2Lec 2
Lec 2
maamir farooq
 
Lec 1
Lec 1Lec 1
Lec 1
maamir farooq
 
Css summary
Css summaryCss summary
Css summary
maamir farooq
 
Manual of image processing lab
Manual of image processing labManual of image processing lab
Manual of image processing lab
maamir farooq
 
Session management
Session managementSession management
Session management
maamir farooq
 
Data management
Data managementData management
Data management
maamir farooq
 
Content provider
Content providerContent provider
Content provider
maamir farooq
 
Ad

Recently uploaded (20)

How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Library Association of Ireland
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdfExploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Sandeep Swamy
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
Social Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy StudentsSocial Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy Students
DrNidhiAgarwal
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
Operations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdfOperations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdf
Arab Academy for Science, Technology and Maritime Transport
 
Metamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative JourneyMetamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative Journey
Arshad Shaikh
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptxSCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
Ronisha Das
 
Unit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdfUnit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdf
KanchanPatil34
 
P-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 finalP-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 final
bs22n2s
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Library Association of Ireland
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdfExploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Sandeep Swamy
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
Social Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy StudentsSocial Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy Students
DrNidhiAgarwal
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
Metamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative JourneyMetamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative Journey
Arshad Shaikh
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptxSCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
Ronisha Das
 
Unit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdfUnit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdf
KanchanPatil34
 
P-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 finalP-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 final
bs22n2s
 

Lec 7(HTTP Protocol)

  • 1. Computer Networks – CSE331 Lecture 7 2 Hrs
  • 2. First, a review…  Until 1990s universities, researchers => remote loging, file transfer, email  World wide web (www) in 1994 Tim Berners Lee  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, e.g., www.someschool.edu/someDept/pic.gif host name path name
  • 3. hypertext transfer protocol  HTTP/Web Client: browser  HTTP Server: apache, IIS  Web page: index.html  Object: picture, javascript file  URL: http://www.uet.edu.pk/cs.html  Uses TCP  Stateless: server don’t remember  Non-persistent: one connection per object  Persistent: leave connection open  Uses ASCII messages not binary PC running Firefox browser server running Apache Web server iphone running Safari browser
  • 4.  two types of HTTP messages: request, response  HTTP request message:  ASCII (human-readable format) request line (GET, POST, HEAD commands) header lines carriage return, line feed at start of line indicates end of header lines GET /department/cs HTTP/1.1rn Host: www.rcet.uet.edu.pkrn User-Agent: Firefox/3.6.10rn Accept: text/html,application/xhtml+xmlrn Accept-Language: en-us,enrn Accept-Encoding: gzip,deflatern Accept-Charset: ISO-8859-1,utf-8rn Connection: keep-alivern rn carriage return character line-feed character
  • 5. request line header lines body method sp sp cr lfversionURL cr lfvalueheader field name cr lfvalueheader field name ~~ ~~ cr lf entity body~~ ~~
  • 6. 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
  • 8. status line (protocol status code status phrase) header lines data, e.g., requested HTML file HTTP/1.1 200 OKrn Date: Sun, 19 Feb 2017 18:41:45 GMT rn Server: Apache/2.2.27 (Unix) rn Expires: Thu, 19 Nov 1981 08:52:00 GMT Accept-Ranges: bytesrn Content-Length: 2652rn Keep-Alive: timeout=10, max=100rn Connection: Keep-Alivern Content-Type: text/html; charset=ISO-8859-1rn rn data data data data data ... persistent
  • 9. 200 OK  request succeeded, requested object later in this msg 301 Moved Permanently  requested object moved, new location specified later in this msg (Location:) 400 Bad Request  request msg not understood by server 404 Not Found  requested document not found on this server 505 HTTP Version Not Supported  In 1st line in server-to-client response message.  some sample codes:
  • 10. many Web sites use cookies four components: 1) cookie header line of HTTP response message 2) cookie header line in next HTTP request message 3) cookie file kept on user’s host, managed by user’s browser 4) back-end database at Web site example:  visits specific e-commerce site for first time  when initial HTTP requests arrives at site, site creates:  unique ID  entry in backend database for ID
  • 11. client server usual http response msg usual http response msg cookie file one week later: usual http request msg cookie: 1678 cookie- specific action access ebay 8734 usual http request msg Amazon server creates ID 1678 for user create entry usual http response set-cookie: 1678ebay 8734 amazon 1678 usual http request msg cookie: 1678 cookie- specific action access ebay 8734 amazon 1678 backend database
  • 12.  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
  • 13.  cache acts as both client and server  server for original requesting client  client to origin 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 (so too does P2P file sharing)
  • 14. origin serverspublic Internet institutional network 100 Mbps LAN 15 Mbps access link assumptions:  avg object size: 1Mbits  avg request rate from browsers to origin servers:15/sec  RTT from institutional router to any origin server: 2 sec  access link rate: 15 Mbps consequences:  LAN utilization: 0.15 = 15%  access link utilization = 1 = 100%  total delay = Internet delay + access delay + LAN delay = 2 sec + minutes + μsecs problem!
  • 15. assumptions:  avg object size: 1Mbits  avg request rate from browsers to origin servers:15/sec  RTT from institutional router to any origin server: 2 sec  access link rate: 15 Mbps consequences:  LAN utilization: 15%  access link utilization = 100%  total delay = Internet delay + access delay + LAN delay = 2 sec + minutes + μsecs origin servers 15 Mbps access link 150 Mbps 150 Mbps msecs Cost: increased access link speed (not cheap!) 10% public Internet institutional network 100Mbps LAN
  • 16. institutional network 100Mbps LAN origin servers 15 Mbps access link local web cache assumptions:  avg object size: 1Mbits  avg request rate from browsers to origin servers:15/sec  RTT from institutional router to any origin server: 2 sec  access link rate: 15 Mbps consequences:  LAN utilization: 15%  access link utilization =  total delay = Internet delay + access delay + LAN delay = 2 sec + minutes + μsecs ? ? How to compute link utilization, delay? Cost: web cache (cheap!) public Internet
  • 17. Calculating access link utilization, delay with cache:  suppose cache hit rate is 0.4  40% requests satisfied at cache, 60% requests satisfied at origin origin servers 15 Mbps access link  access link utilization:  60% of requests use access link  data rate to browsers over access link = 0.6*15 Mbps = 9 Mbps  utilization = 9/15 = 0.6  total delay  = 0.6 * (delay from origin servers) +0.4 * (delay when satisfied at cache)  = 0.6 (2.01) + 0.4 (~msecs)  = ~ 1.2 secs  less than with 150 Mbps link (and cheaper too!) public Internet institutional network 100 Mbps LAN local web cache
  • 18.  Goal: don’t send object if cache has up-to-date cached version  no object transmission delay  lower link utilization  cache: specify date of cached copy in HTTP request If-modified-since: <date>  server: response contains no object if cached copy is up- to-date: HTTP/1.0 304 Not Modified HTTP request msg If-modified-since: <date> HTTP response HTTP/1.0 304 Not Modified object not modified before <date> HTTP request msg If-modified-since: <date> HTTP response HTTP/1.0 200 OK <data> object modified after <date> client server
  • 20.  Ross book 2.2  Forouzan book Chapter 22  HTTP methods example  See attached file http_methods.pdf  Key Differences between HTTP1.1 & 1.0  www8.org/w8-papers/5c-protocols/key/key.html