HTTPHTTP
HypertextHypertext TransferTransfer ProtocolProtocol WhatWhat ItIt IsIs
n ProtocolProtocol forfor transfertransfer ofof variousvarious datadata formatsformats betweenbetween serverserver andand clientclient – Plaintext – Hypertext – Images – Video – Sound n MetaMeta--informationinformation alsoalso transferredtransferred
HTTP 2 UniformUniform ResourcesResources
n URLURL – Uniform Resource Locator – Refers to an existing protocol
n http:, wais:, ftp:, mailto:, gopher:, news: – Points to a document on a specific server n URNURN – Uniform Resource Name – Globally unique, persistent identifier
n Independent of location
HTTP 3 UniformUniform ResourcesResources
n URIURI – Uniform Resource Identifier – Collection of URL’s and URN’s
HTTP 4 URLURL
n
n
HTTP 6 URLURL andand HTTPHTTP
n AllAll partsparts ofof URL,URL, exceptexcept parameters,parameters, usedused withwith httphttp n SchemeScheme andand hosthost cancan bebe omittedomitted whenwhen referencedreferenced objectobject isis onon samesame machinemachine asas referringreferring documentdocument n PortPort cancan bebe omittedomitted soso longlong asas referencedreferenced hosthost isis runningrunning onon portport listedlisted inin youryour /etc/services/etc/services filefile – Usually port 80 HTTP 7 URLURL andand HTTPHTTP
n FullFull pathpath usedused whenwhen referringreferring toto anotheranother serverserver – Relative path on same server
n Reference with relative path is a partial URL n QueryQuery passespasses parametersparameters toto CGICGI n FragmentFragment jumpsjumps toto labelslabels withinwithin aa pagepage – http://www.x.y/z#foo
HTTP 8 WebWeb DocumentsDocuments
– html – ASCII text – Preformatted n postscript – Images n GIF n JPEG – Video n MPEG – VRML – Java HTTP 9 CommunicationCommunication
n ServerServer tellstells clientclient whatwhat typetype ofof informationinformation isis comingcoming beforebefore informationinformation arrivesarrives – File extensions n .html .htm n .txt n .ps n .au n .gif .tiff .jpeg n .mpeg n .vrml .wrl n .java HTTP .java 10 CommunicationCommunication
n TextText andand inlineinline imagesimages – Separate objects n ClientClient browserbrowser maymay optionallyoptionally sendsend aa listlist ofof formatsformats itit cancan acceptaccept n DocumentDocument cancan bebe aa programprogram – Web server executes program and sends results to client – Generic term for this program is script, gateway, or gateway script HTTP gateway, or gateway script 11 ScriptsScripts
n TranslatesTranslates inputinput fromfrom clientclient n CallsCalls otherother programsprograms n TranslatesTranslates outputoutput fromfrom programsprograms andand returnsreturns itit toto clientclient
HTTP 12 GatewaysGateways
n TranslatesTranslates fromfrom oneone protocolprotocol oror serviceservice toto anotheranother – HTTP / database query – Database query results / HTTP
HTTP 13 HTTPHTTP 1.01.0
n BernersBerners Lee,Lee, Fielding,Fielding, NielsenNielsen -- 19951995 n UsedUsed inin hypermediahypermedia systemssystems distributeddistributed acrossacross networksnetworks n DefinesDefines requestrequest--responseresponse conversationconversation – Requesting program (client) establishes connection with receiving program (server) – Client sends request to server
n HTTP specifies syntax
HTTP 14 HTTPHTTP 1.01.0
n DefinesDefines requestrequest--responseresponse conversationconversation – Server replies with response
n http specifies syntax n DoesDoes notnot handlehandle networknetwork connectivityconnectivity oror howhow informationinformation isis transmittedtransmitted
n TCP/IP does this
HTTP 15 HTTPHTTP 1.01.0
n HTTPHTTP requestrequest – Method – URI – Protocol version – Optional other information – Method [Request URI] HTTP/1.0
HTTP 16 HTTPHTTP 1.01.0
n MethodMethod – Get
n Returns object – Head
n Returns information about object – Post
n Sends information to be stored on server or as input to script
HTTP 17 HTTPHTTP 1.01.0
n MethodMethod – Put
n Sends new copy of existing object to server
n Usually not allowed – Delete
n Deletes object
n Usually not allowed
HTTP 18 HTTPHTTP 1.01.0
n OtherOther informationinformation – User Agent
n Kind of browser – If-Modified-Since
n Returns object only if more recent than given date
n Otherwise returns status code 304
HTTP 19 HTTPHTTP 1.01.0
n OtherOther informationinformation – Accept
n Mime types which browser can accept – Multipurpose Internet Mail Extension
n text/plain
n text/html
n application/postscript
n image/gif
n image/jpeg
n audio/basic
n video/mpeg
n x-world/x-vrml HTTP 20 HTTPHTTP 1.01.0
n OtherOther informationinformation – Authorization
n User password GET /X/Y/Z.HTML HTTP 1.0 User Agent: Prodigy-WB/1.3e Accept: text/plain Accept: text/html Accept: application/postscript Accept: image/gif – Accept: */*
HTTP 21 HTTPHTTP 1.01.0
n HTTPHTTP responseresponse – Status line
n HTTP-version Status-code Reason
n Status-codes 1xx - Informational – Reserved for future use
HTTP 22 HTTPHTTP 1.01.0
n HTTPHTTP responseresponse – Status line
n Status-codes 2xx - Success – The action was successfully received, understood, and accepted
n 200 OK
n 201 POST command successful
n 202 Request accepted
n 203 GET or HEAD request fulfilled
n 204 No content
HTTP 23 HTTPHTTP 1.01.0
n HTTPHTTP responseresponse – Status line
n Status-codes 3xx - Redirection – Further action must be taken in order to complete request
n 300 Resource found at multiple locations
n 301 Resource moved permanently
n 302 Resource moved temporarily
n 304 Resource has not modified (since date)
HTTP 24 HTTPHTTP 1.01.0
n HTTPHTTP responseresponse – Status line
n Status-codes 4xx - Client error – The request contains bad syntax or cannot be fulfilled
n 400 Bad request from client
n 401 Unauthorized request
n 402 Payment required for request
n 403 Resource access forbidden
n 404 Resource not found
n 405 Method not allowed for resource
HTTP n 406 Resource type not acceptable 25 HTTPHTTP 1.01.0
n HTTPHTTP responseresponse – Status line
n Status-codes 5xx - Server error – The server failed to fulfill an apparently valid request
n 500 Internal server error
n 501 Method not implemented
n 502 Bad gateway or server overload
n 503 Service unavailable / gateway timeout
n 504 Secondary gateway / server timeout
HTTP 26 HTTPHTTP 1.01.0
n HTTPHTTP responseresponse – Description of information
n Server Type of server
n Date Date and time
n Content-Length Number of bytes
n Content-Type Mime type
n Content-Language English, for example
n Content-Encoding Data compression
n Last-Modified Date when last modified
n Expires Date when file becomes invalid HTTP invalid 27 HTTPHTTP 1.01.0
n ProblemsProblems – HTTP is stateless
n Each request requires separate TCP connection
n Server doesn’t remember previous requests
HTTP 28 EvolutionEvolution ofof HTTPHTTP
n HTTP/0.9HTTP/0.9 -- 19901990 – Request method + URI + crlf
n GET /pets/index.html
n Just file contents sent back – No header information n GopherGopher influenceinfluence – Media types
n Single character indicated one of ten types
HTTP 29 EvolutionEvolution ofof HTTPHTTP
n HTTP/1.0HTTP/1.0 -- 19951995 – Meta-information between client and server
n Media types – MIME type/subtype
n Status codes
n This information influenced the development of web search engines – Caching – Authorization HTTP 30 EvolutionEvolution ofof HTTPHTTP
n HTTP/1.0HTTP/1.0 -- 19951995 – Problems
n Scalability – High number of clients visit server for short time
n Flash crowd
n Bandwidth
HTTP 31 EvolutionEvolution ofof HTTPHTTP
n HTTP/1.1HTTP/1.1 – Byte ranges
n Request of a document subset – Adobe's Portable Document Format – Streaming multimedia
n Eliminates unnecessary client/server communication
n An interrupted transfer which is restarted can be more efficient
HTTP 32 EvolutionEvolution ofof HTTPHTTP
n HTTP/1.1HTTP/1.1 – Content negotiation with quality factors
n Quality factors – Real numbers between 0 and 1
n Default is 1
n Accept-Language: fr, en-gb; q=0.8, en; q=0.7
HTTP 33 EvolutionEvolution ofof HTTPHTTP
n HTTP/1.1HTTP/1.1 – Chunked encoding
n Transmission of streaming multimedia – One frame varies in size and composition from the next
n Streaming video – Entire image transmitted in first chunk and differences to the previous image are transmitted in the next chunk
HTTP 34 EvolutionEvolution ofof HTTPHTTP
n HTTP/1.1HTTP/1.1 – Protocol switching
n Client can specify another protocol more suited to data being transferred – Message integrity checks – Digest authentication
n In HTTP/1.0, user sent username and password over the network
n In HTTP/1.1, the client and the server never send the actual username or password over the network HTTP 35 EvolutionEvolution ofof HTTPHTTP
n HTTP/1.1HTTP/1.1 – Persistent connections
n In HTTP/1.0, if a single page includes inline images, multiple frames, animation, and other external references, to browse this page would require many reconnections
n In HTTP/1.1 there are multiple request/response transactions per connection
n Clients can pipeline requests to the server by sending multiple requests at start of session
HTTP 36 EvolutionEvolution ofof HTTPHTTP
n HTTP/1.1HTTP/1.1 – Cache management with entity tags n When body of URI changes, so does its entity tag – Useful for maintaining caches, as updated URI information would have a different entity tag n Can tell if same resource is being cached from multiple URI's as it would have same entity tag n Strong entity tag – Changes when any portion of resource changes
n One or more bytes change n Weak entity tag – Changes only when semantics of entity-body HTTP changes 37 EvolutionEvolution ofof HTTPHTTP
n HTTP/1.1HTTP/1.1 – Software multihoming
n Number of available IP addresses is a concern
n In HTTP/1.0, server could have multiple DNS entries and IP addresses, each corresponding to different document tree
n In HTTP/1.1, server could have multiple DNS entries and only a single IP address
HTTP 38 TheThe FutureFuture
n HTTPHTTP--NextNext GenerationGeneration – Many channels
n One TCP connection carries multiple channels for parallel communication
n Different protocols on each channel – Traditional way
n Multiple TCP connections between same client and server
n Pages contain images, video, audio, and html
HTTP 39 TheThe FutureFuture
n ExtensibilityExtensibility – Adding new MIME headers has been the traditional way of extending http – Drawbacks
n No indication whether receiving end understands these extensions
n No indication whether extension is intended for all parties along message path or only for certain intermediaries
n No indication of order in which extensions should be interpreted HTTP 40 TheThe FutureFuture
n ExtensibilityExtensibility – PEP
n Protocol Extension Protocol
HTTP 41 TheThe FutureFuture
n PerformancePerformance – Parsing MIME headers wastes resources – Sticky headers
n Persistent state between multiple http requests
n Not all headers have to be included in every http message n DistributedDistributed authoringauthoring – Event notification
HTTP 42 TheThe FutureFuture
n CachingCaching andand replicationreplication – Popular sites are really popular – Flash crowds happen – Hot spots on the net are dynamic – Amount of dynamic data is increasing
HTTP 43 TheThe FutureFuture
n QoSQoS – Quality of service – Not everything must be treated with same QoS – Required QoS should be made at the user- interface
HTTP 44 TheThe FutureFuture
n RealReal--timetime protocolsprotocols andand thethe webweb – Streaming protocols
n Audio/video-on-demand
HTTP 45