powerpoint http
TRANSCRIPT
-
8/20/2019 Powerpoint Http
1/45
HTTPHTTP
Hypertext TransferHypertext Transfer
ProtocolProtocol
-
8/20/2019 Powerpoint Http
2/45
HTTP 2
What It IsWhat It Is
Protocol for transfer of various dataProtocol for transfer of various data
formats between server and clientformats between server and client
– PlaintextPlaintext– HypertextHypertext
– ImagesImages
– VideoVideo– SoundSound
Metainformation also transferredMetainformation also transferred
-
8/20/2019 Powerpoint Http
3/45
HTTP 3
!niform "esources!niform "esources
!"#!"#– !niform "esource #ocator!niform "esource #ocator
– "efers to an existing protocol"efers to an existing protocol http$% wais$% ftp$% mailto$% gopher$% news$http$% wais$% ftp$% mailto$% gopher$% news$
– Points to a document on a speci&c serverPoints to a document on a speci&c server
!"'!"'
– !niform "esource 'ame!niform "esource 'ame
– (lobally uni)ue% persistent identi&er(lobally uni)ue% persistent identi&er Independent of locationIndependent of location
-
8/20/2019 Powerpoint Http
4/45
HTTP 4
!niform "esources!niform "esources
!"I!"I– !niform "esource Identi&er!niform "esource Identi&er
– *ollection of !"#+s and !"'+s*ollection of !"#+s and !"'+s
-
8/20/2019 Powerpoint Http
5/45
HTTP 5
!"#!"#
: // : : // : / ; ? / ; ?##– schemescheme
,he protocol you are using ,he protocol you are using
– hosthost Host name or ip numberHost name or ip number
– portport ,*P port number that protocol server is using ,*P port number that protocol server is using
– pathpath Path and &lename reference of ob-ect on serverPath and &lename reference of ob-ect on server
-
8/20/2019 Powerpoint Http
6/45
HTTP 6
!"#!"#
: // : : // :
/ ; ? / ; ?
##– parametersparameters
.ny speci&c parameters that ob-ect needs.ny speci&c parameters that ob-ect needs
– )uery)uery /uery string for a *(I program/uery string for a *(I program
– fragmentfragment "eference to a subset of an ob-ect"eference to a subset of an ob-ect
-
8/20/2019 Powerpoint Http
7/45HTTP 7
!"# and H,,P!"# and H,,P
.ll parts of !"#% except parameters%.ll parts of !"#% except parameters%
used with httpused with http
Scheme and host can be omitted whenScheme and host can be omitted whenreferenced ob-ect is on same machinereferenced ob-ect is on same machine
as referring documentas referring document
Port can be omitted so long asPort can be omitted so long asreferenced host is running on portreferenced host is running on port
listed in your 0etc0services &lelisted in your 0etc0services &le– !sually port 12!sually port 12
-
8/20/2019 Powerpoint Http
8/45HTTP 8
!"# and H,,P!"# and H,,P
3ull path used when referring to3ull path used when referring to
another serveranother server
– "elative path on same server"elative path on same server "eference with relative path is a"eference with relative path is a partialpartial
URLURL
/uery passes parameters to *(I/uery passes parameters to *(I 3ragment -umps to labels within a3ragment -umps to labels within a
pagepage– http$00www4x4y056foohttp$00www4x4y056foo
-
8/20/2019 Powerpoint Http
9/45HTTP 9
Web 7ocumentsWeb 7ocuments
– htmlhtml– .S*II text.S*II text–
PreformattedPreformatted postscriptpostscript
– ImagesImages (I3(I3 8P9( 8P9(
– VideoVideo MP9(MP9(
– V"M#V"M#– 8ava 8ava
-
8/20/2019 Powerpoint Http
10/45HTTP 10
*ommunication*ommunication
Server tells client what type ofServer tells client what type ofinformation is coming before informationinformation is coming before informationarrivesarrives– 3ile extensions3ile extensions
4html 4htm4html 4htm 4txt4txt 4ps4ps 4au4au 4gif 4ti: 4-peg4gif 4ti: 4-peg 4mpeg4mpeg 4vrml 4wrl4vrml 4wrl 4-ava4-ava
-
8/20/2019 Powerpoint Http
11/45HTTP 11
*ommunication*ommunication
,ext and inline images ,ext and inline images
– Separate ob-ectsSeparate ob-ects
*lient browser may optionally send a*lient browser may optionally send alist of formats it can acceptlist of formats it can accept
7ocument can be a program7ocument can be a program
–Web server executes program and sendsWeb server executes program and sendsresults to clientresults to client
– (eneric term for this program is(eneric term for this program is script script %%
gateway gateway % or% or gateway script gateway script
-
8/20/2019 Powerpoint Http
12/45
-
8/20/2019 Powerpoint Http
13/45HTTP 13
(ateways(ateways
,ranslates from one protocol or ,ranslates from one protocol orservice to anotherservice to another
– H,,P 0 database )ueryH,,P 0 database )uery– 7atabase )uery results 0 H,,P7atabase )uery results 0 H,,P
-
8/20/2019 Powerpoint Http
14/45HTTP 14
H,,P ;42H,,P ;42
!sed in hypermedia systems!sed in hypermedia systems
distributed across networ?sdistributed across networ?s 7e&nes re)uestresponse conversation7e&nes re)uestresponse conversation
– "e)uesting program @clientA establishes"e)uesting program @clientA establishesconnection with receiving program @serverAconnection with receiving program @serverA
– *lient sends re)uest to server*lient sends re)uest to server H,,P speci&es syntaxH,,P speci&es syntax
-
8/20/2019 Powerpoint Http
15/45HTTP 15
H,,P ;42H,,P ;42
7e&nes re)uestresponse7e&nes re)uestresponse
conversationconversation
– Server replies with responseServer replies with response http speci&es syntaxhttp speci&es syntax
7oes not handle networ?7oes not handle networ?
connectivity or how information isconnectivity or how information istransmittedtransmitted
,*P0IP does this ,*P0IP does this
-
8/20/2019 Powerpoint Http
16/45HTTP 16
H,,P ;42H,,P ;42
H,,P re)uestH,,P re)uest
– MethodMethod
– !"I!"I
– Protocol versionProtocol version
– Bptional other informationBptional other information
– Method [Request UR! "$/%&'Method [Request UR! "$/%&'
-
8/20/2019 Powerpoint Http
17/45HTTP 17
H,,P ;42H,,P ;42
MethodMethod
– (et(et "eturns ob-ect"eturns ob-ect
– HeadHead "eturns information about ob-ect"eturns information about ob-ect
– PostPost Sends information to be stored on serverSends information to be stored on server
or as input to scriptor as input to script
-
8/20/2019 Powerpoint Http
18/45HTTP 18
H,,P ;42H,,P ;42
MethodMethod
– PutPut Sends new copy of existing ob-ect toSends new copy of existing ob-ect to
serverserver
!sually not allowed!sually not allowed
– 7elete7elete 7eletes ob-ect7eletes ob-ect
!sually not allowed!sually not allowed
-
8/20/2019 Powerpoint Http
19/45
-
8/20/2019 Powerpoint Http
20/45
-
8/20/2019 Powerpoint Http
21/45
HTTP 21
H,,P ;42H,,P ;42
Bther informationBther information
– .uthori5ation.uthori5ation
!ser password!ser password(9, 0F0G04H,M# H,,P ;42(9, 0F0G04H,M# H,,P ;42
!ser .gent$ ProdigyW
-
8/20/2019 Powerpoint Http
22/45
HTTP 22
H,,P ;42H,,P ;42
H,,P responseH,,P response
– Status lineStatus line H,,Pversion Statuscode "easonH,,Pversion Statuscode "eason Statuscodes ;xx InformationalStatuscodes ;xx Informational
– "eserved for future use"eserved for future use
-
8/20/2019 Powerpoint Http
23/45
HTTP 23
H,,P ;42H,,P ;42
H,,P responseH,,P response
– Status lineStatus line Statuscodes Jxx SuccessStatuscodes Jxx Success
– ,he action was successfully received% ,he action was successfully received%
understood% and acceptedunderstood% and accepted J22 BC J22 BC J2;J2; PBS, command successfulPBS, command successful J2JJ2J "e)uest accepted"e)uest accepted J2DJ2D (9, or H9.7 re)uest ful&lled(9, or H9.7 re)uest ful&lled J2EJ2E 'o content'o content
-
8/20/2019 Powerpoint Http
24/45
-
8/20/2019 Powerpoint Http
25/45
HTTP 25
H,,P ;42H,,P ;42
H,,P responseH,,P response
– Status lineStatus line
Statuscodes Exx *lient errorStatuscodes Exx *lient error– ,he re)uest contains bad syntax or cannot be ful&lled ,he re)uest contains bad syntax or cannot be ful&lled
E22E22 Method not allowed for resourceMethod not allowed for resource
E2KE2K "esource type not acceptable"esource type not acceptable
-
8/20/2019 Powerpoint Http
26/45
HTTP 26
H,,P ;42H,,P ;42
H,,P responseH,,P response
– Status lineStatus line
Statuscodes >xx Server errorStatuscodes >xx Server error– ,he server failed to ful&ll an apparently valid ,he server failed to ful&ll an apparently valid
re)uestre)uest >22>22 Internal server errorInternal server error
>2;>2; Method not implementedMethod not implemented >2J>2J 2D Service unavailable 0 gateway timeoutService unavailable 0 gateway timeout >2E>2E Secondary gateway 0 server timeoutSecondary gateway 0 server timeout
-
8/20/2019 Powerpoint Http
27/45
HTTP 27
H,,P ;42H,,P ;42
H,,P responseH,,P response– 7escription of information7escription of information
ServerServer ,ype of server ,ype of server 7ate7ate 7ate and time 7ate and time *ontent#ength*ontent#ength 'umber of bytes 'umber of bytes *ontent,ype*ontent,ype Mime type Mime type *ontent#anguage*ontent#anguage 9nglish% for example 9nglish% for example
*ontent9ncoding*ontent9ncoding 7ata compression 7ata compression #astModi&ed#astModi&ed 7ate when last modi&ed 7ate when last modi&ed 9xpires9xpires 7ate when &le becomes7ate when &le becomes
invalidinvalid
-
8/20/2019 Powerpoint Http
28/45
HTTP 28
H,,P ;42H,,P ;42
ProblemsProblems
– H,,P is statelessH,,P is stateless 9ach re)uest re)uires separate ,*P9ach re)uest re)uires separate ,*P
connectionconnection
Server doesn+t remember previousServer doesn+t remember previous
re)uestsre)uests
-
8/20/2019 Powerpoint Http
29/45
-
8/20/2019 Powerpoint Http
30/45
HTTP 30
9volution of H,,P9volution of H,,P
H,,P0;42 ;==>H,,P0;42 ;==>
– Metainformation between client and serverMetainformation between client and server
Media typesMedia types– MIM9 type0subtypeMIM9 type0subtype
Status codesStatus codes
,his information inuenced the development of ,his information inuenced the development of
web search enginesweb search engines
– *aching*aching
– .uthori5ation.uthori5ation
-
8/20/2019 Powerpoint Http
31/45
HTTP 31
9volution of H,,P9volution of H,,P
H,,P0;42 ;==>H,,P0;42 ;==>
– ProblemsProblems
ScalabilityScalability– High number of clients visit server for shortHigh number of clients visit server for short
timetime
3lash crowd3lash crowd
-
8/20/2019 Powerpoint Http
32/45
-
8/20/2019 Powerpoint Http
33/45
HTTP 33
9volution of H,,P9volution of H,,P
H,,P0;4;H,,P0;4;
– *ontent negotiation with )uality*ontent negotiation with )uality
factorsfactors /uality factors/uality factors
– "eal numbers between 2 and ;"eal numbers between 2 and ;
7efault is ;7efault is ;
.ccept#anguage$ fr% engb )Q241% en.ccept#anguage$ fr% engb )Q241% en)Q24R)Q24R
-
8/20/2019 Powerpoint Http
34/45
HTTP 34
9volution of H,,P9volution of H,,P
H,,P0;4;H,,P0;4;
– *hun?ed encoding*hun?ed encoding
,ransmission of streaming multimedia ,ransmission of streaming multimedia– Bne frame varies in si5e and composition fromBne frame varies in si5e and composition from
the nextthe next
Streaming videoStreaming video
– 9ntire image transmitted in &rst chun? and9ntire image transmitted in &rst chun? anddi:erences to the previous image aredi:erences to the previous image are
transmitted in the next chun?transmitted in the next chun?
-
8/20/2019 Powerpoint Http
35/45
HTTP 35
9volution of H,,P9volution of H,,P
H,,P0;4;H,,P0;4;– Protocol switchingProtocol switching
*lient can specify another protocol more suited*lient can specify another protocol more suitedto data being transferredto data being transferred
– Message integrity chec?sMessage integrity chec?s
– 7igest authentication7igest authentication In H,,P0;42% user sent username and passwordIn H,,P0;42% user sent username and password
over the networ?over the networ? In H,,P0;4;% the client and the server neverIn H,,P0;4;% the client and the server never
send the actual username or password oversend the actual username or password overthe networ?the networ?
-
8/20/2019 Powerpoint Http
36/45
HTTP 36
9volution of H,,P9volution of H,,P
H,,P0;4;H,,P0;4;
– Persistent connectionsPersistent connections
In H,,P0;42% if a single page includes inlineIn H,,P0;42% if a single page includes inlineimages% multiple frames% animation% and otherimages% multiple frames% animation% and other
external references% to browse this pageexternal references% to browse this page
would re)uire many reconnectionswould re)uire many reconnections
In H,,P0;4; there are multipleIn H,,P0;4; there are multiple
re)uest0response transactions per connectionre)uest0response transactions per connection *lients can pipeline re)uests to the server by*lients can pipeline re)uests to the server by
sending multiple re)uests at start of sessionsending multiple re)uests at start of session
-
8/20/2019 Powerpoint Http
37/45
HTTP 37
9volution of H,,P9volution of H,,P
H,,P0;4;H,,P0;4;– *ache management with entity tags*ache management with entity tags
When body of !"I changes% so does its entity tagWhen body of !"I changes% so does its entity tag
– !seful for maintaining caches% as updated !"I!seful for maintaining caches% as updated !"Iinformation would have a di:erent entity taginformation would have a di:erent entity tag
*an tell if same resource is being cached from*an tell if same resource is being cached frommultiple !"INs as it would have same entity tagmultiple !"INs as it would have same entity tag
Strong entity tagStrong entity tag– *hanges when any portion of resource changes*hanges when any portion of resource changes
Bne or more bytes changeBne or more bytes change Wea? entity tagWea? entity tag
– *hanges only when semantics of entitybody changes*hanges only when semantics of entitybody changes
-
8/20/2019 Powerpoint Http
38/45
HTTP 38
9volution of H,,P9volution of H,,P
H,,P0;4;H,,P0;4;
– Software multihomingSoftware multihoming
'umber of available IP addresses is a'umber of available IP addresses is aconcernconcern
In H,,P0;42% server could have multipleIn H,,P0;42% server could have multiple
7'S entries and IP addresses% each7'S entries and IP addresses% each
corresponding to di:erent document treecorresponding to di:erent document tree In H,,P0;4;% server could have multipleIn H,,P0;4;% server could have multiple
7'S entries and only a single IP address7'S entries and only a single IP address
-
8/20/2019 Powerpoint Http
39/45
HTTP 39
,he 3uture ,he 3uture
H,,P'ext (enerationH,,P'ext (eneration
– Many channelsMany channels
Bne ,*P connection carries multipleBne ,*P connection carries multiplechannels for parallel communicationchannels for parallel communication
7i:erent protocols on each channel7i:erent protocols on each channel
– ,raditional way ,raditional way
Multiple ,*P connections between sameMultiple ,*P connections between sameclient and serverclient and server
Pages contain images% video% audio% and htmlPages contain images% video% audio% and html
-
8/20/2019 Powerpoint Http
40/45
HTTP 40
,he 3uture ,he 3uture
9xtensibility9xtensibility– .dding new MIM9 headers has been the.dding new MIM9 headers has been the
traditional way of extending httptraditional way of extending http
– 7rawbac?s7rawbac?s 'o indication whether receiving end'o indication whether receiving end
understands these extensionsunderstands these extensions 'o indication whether extension is intended'o indication whether extension is intended
for all parties along message path or only forfor all parties along message path or only forcertain intermediariescertain intermediaries
'o indication of order in which extensions'o indication of order in which extensionsshould be interpretedshould be interpreted
-
8/20/2019 Powerpoint Http
41/45
-
8/20/2019 Powerpoint Http
42/45
HTTP 42
,he 3uture ,he 3uture
PerformancePerformance
– Parsing MIM9 headers wastes resourcesParsing MIM9 headers wastes resources
– Stic?y headersStic?y headers Persistent state between multiple httpPersistent state between multiple http
re)uestsre)uests
'ot all headers have to be included in every'ot all headers have to be included in every
http messagehttp message 7istributed authoring7istributed authoring
– 9vent noti&cation9vent noti&cation
-
8/20/2019 Powerpoint Http
43/45
HTTP 43
,he 3uture ,he 3uture
*aching and replication*aching and replication
– Popular sites arePopular sites are rea++yrea++y popularpopular
– 3lash crowds happen3lash crowds happen– Hot spots on the net are dynamicHot spots on the net are dynamic
– .mount of dynamic data is increasing.mount of dynamic data is increasing
-
8/20/2019 Powerpoint Http
44/45
HTTP 44
,he 3uture ,he 3uture
/oS/oS
– /uality of service/uality of service
– 'ot everything must be treated with'ot everything must be treated withsame /oSsame /oS
– "e)uired /oS should be made at the"e)uired /oS should be made at the
userinterfaceuserinterface
-
8/20/2019 Powerpoint Http
45/45
,he 3uture ,he 3uture
"ealtime protocols and the web"ealtime protocols and the web
– Streaming protocolsStreaming protocols
.udio0videoondemand.udio0videoondemand