1 / 54

Understanding HTTP: The Protocol of the World Wide Web

Learn about HTTP, the transaction-oriented client/server protocol underlying the World Wide Web. Explore its operation, messages, methods, and header fields. Discover how HTTP facilitates efficient information transmission for hyperlinked content.

elwoodg
Download Presentation

Understanding HTTP: The Protocol of the World Wide Web

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Computer Networks with Internet TechnologyWilliam Stallings Chapter 04 Modern Applications

  2. Hypertext Transfer ProtocolHTTP • Underlying protocol of the World Wide Web • Not a protocol for transferring hypertext • For transmitting information with efficiency necessary for hypertext jumps • Can transfer plain text, hypertext, audio, images, and Internet accessible information

  3. HTTP Overview • Transaction oriented client/server protocol • Usually between Web browser (clinet) and Web server • Uses TCP connections • Stateless • Each transaction treated independently • Each new TCP connection for each transaction • Terminate connection when transaction complete

  4. Key Terms • Cache • Client • Connection • Entity • Gateway • Message • Origin server • Proxy • Resource • Server • Tunnel • User agent

  5. Figure 4.1Examples of HTTP Operation

  6. Figure 4.2Intermediate HTTP Systems

  7. HTTP Messages • Requests • Client to server • Responses • Server to client • Request line • Response line • General header • Request header • Response header • Entity header • Entity body

  8. Figure 4.3HTTP Message Structure

  9. General Header Fields • Cache control • Connection • Data • Forwarded • Keep alive • MIME version • Pragma • Upgrade

  10. Request Methods • Request-Line = Method <SP> Request_URL <SP> HTTP-Version <CRLF> • Methods: • Options • Get • Head • Post • Put • Patch • Copy • Move • Delete • Link • Unlink • Trace • Wrapped • Extension-method

  11. Request Header Field • Accept • Accept charset • Accept encoding • Accept language • Authorization • From • Host • If modified since • Proxy authentication • Range • Referrer • Unless • User agent

  12. Response Messages • Status line followed by one or more general, response and entity headers, followed by optional entity body • Status-Line = HTTP-Version <SP> Status-Code <SP> Reason-Phrase <CRLF>

  13. Status Codes • Informational • Successful • Redirection • Client error • Server error

  14. Response Header Fields • Location • Proxy authentication • Public • Retry after • Server • WWW-Authenticate

  15. Allow Content encoding Content language Content length Content MD5 Content range Content type Content version Derived from Expires Last modified Link Title Transfer encoding URL header Extension header Entity Header Fields

  16. Entity Body • Arbitrary sequence of octets • HTTP transfers any type of data including: • text • binary data • audio • images • video • Interpretation of data determined by header fields • Content encoding, content type, transfer encoding

  17. Internet Directory Services DNS • Directory lookup service • Provides mapping between host name and numerical address • Essential to functioning of Internet • RFCs 1034 and 1035. • Four elements • Domain name space • Tree-structured • DNS database • Each node and leaf in name space tree structure names set of information (e.g., IP address, type of resource) in resource record • Name servers • Servers that hold information about portion of tree • Resolvers • Programs that extract information from name servers

  18. Domain Names • 32-bit IP address uniquely identifies devices • Two components • Network number • Host address • Problems • Routers devise routes based on network number • Can’t hold table of every network and path • Networks group to simplify routing • 32-bit address usually written as four decimal numbers • Effective for computer processing • Not convenient for users • Problems are addressed by concept of domain • Group of networks are under control of single entity • Organized hierarchically • Names assigned reflect organization

  19. Domain Name Example • edu is college-level U.S. educational institutions • mit.edu is M.I.T. • lcs.mit.edu is Laboratory for Computer Science at M.I.T. • Eventually get to leaf nodes • Identify specific hosts • Hosts assigned Internet (IP) addresses • Internet-wide organization assigns domain names • Delegated down the hierarchy • mit.edu, has four IP addresses: 18.7.21.77, 18.7.21.69, 18.7.21.70, and 18.7.21.110 • Subordinate domain lcs.mit.edu has IP address 18.26.0.36

  20. Figure 4.4Portion of Internet Domain Tree

  21. DNS Database • Variable-depth unlimited levels hierarchy for names • Delimited by period (.) • Distributed database • Distribution controlled by database • Thousands of separately managed zones • DNS servers provide name-to-address directory service for network applications

  22. Resource Record • Domain name • Human readable form • Series of labels of alphanumeric characters or hyphens • Each pair separated by period • Type • E.g. A = Host address, MX = Mail exchange • Class • Usually IN, for Internet • Time to live • How long to hold result in local cache • Zero means don’t cache • Rdata field length • Rdata • Description of resource • For A type, Rdata is 32-bit IP address

  23. Figure 4.5DNS Resource Record Format

  24. DNS Operation • User program requests IP address for domain name • Resolver module in local host or local ISP formulates query for local name server • In same domain as resolver • Local name server checks for name in local database or cache • If so, returns IP address to requestor • Otherwise, query other available name servers • Starting down from root of DNS tree or as high up as possible • Local name server caches reply • Depending on Time to live field • User program given IP address or error message • DNS name servers automatically send out updates to other relevant name servers as conditions warrant

  25. Figure 4.6DNS Name Resolution

  26. Server Hierarchy • Name servers operated by any organization that has domain • Each name server holds subset of name space (a zone) • One or more (or all) subdomains within domain • Authoritative • This name server maintains accurate data for this portion hierarchy • Can extend to any depth • 13 root name servers share responsibility for top level zones • Replication prevents root server bottleneck • Individual root servers are busy • Internet Software Consortium server (F) answers almost 300 million DNS requests daily (www.isc.org/services/public/F-root-server.html) • Typically, single queries carried over UDP • Queries for group of names carried over TCP

  27. Name Resolution • Resolver knows name and address of local DNS server • If resolver does not have name in cache, it sends DNS query to local server • Either returns address or after querying one or more other servers • Server (A) forwards request to server (B) • If B has name in cache or database, it can return result • If not, B can • Query another name server and send result back to A • Recursive • Tell A address of next server (C) to ask • A then asks to C • Iterative •  Server exchanges use can either • Name resolvers use recursive

  28. Figure 4.7DNS Message Format

  29. DNS Message Fields - Header • Header always present  • Identifier to match queries and responses. • Query Response: is message query or response • Opcode: Standard, inverse query (address to name), or server status request • Authoritative Answer • Truncated: was response truncated • Requestor will use TCP to resend query • Recursion Desired • Recursion Available • Response Code: e.g. no error, format error, refused • QDcount: entries in question section (zero or more) • ANcount: RRs in answer section (zero or more) • NScount: RRs in authority section (zero or more) • ARcount: RRs in additional records section (zero or more)

  30. DNS Message Fields – Question and Answer • If present, question typically contains only one entry • Domain Name • Sequence of labels • Length octet followed by that number of octets • Terminates with the zero length octet for null label of root • Query Type • Values include all values valid for Type field in RR format plus general codes that match more than one type of RR • Query Class: typically Internet. • Answer section contains RRs that answer question • Authority section contains RRs that point toward an authoritative name server • Additional records section contains RRs that relate to query but not strictly answers

  31. Session Initiation ProtocolOverview • RFC 3261 • Application-level control protocol • Setting up, modifying, and terminating real-time sessions • Enable Internet telephony,(voice over IP, VoIP • Supports single or multimedia session, including teleconferencing • Facets of SIP • User location: Users can access application features from remote locations • User availability: Willingness of called party to communicate • User capabilities: Media and parameters to be used • Session setup: Point-to-point and multiparty calls • Session management: Transfer and termination, modifying session parameters, and invoking services

  32. Session Initiation ProtocolFeatures • Based on HTTP-like request/response transaction model • Client request invokes function on server • At least one response • Uses most HTTP header fields, encoding rules, and status codes • Readable format for displaying information • Uses concepts similar to recursive and iterative searches of DNS • Incorporates Session Description Protocol (SDP) • Defines session content using types similar to MIME

  33. Components and Protocols (1) • Client • Sends requests and receives responses • User agent clients and proxies are clients • Server • Receives requests and sends back responses • Proxies, user agent servers, redirect servers, and registrars • User Agent • In every SIP end station • User agent client (UAC): Issues requests • User agent server (UAS): Receives requests and reponds • Redirect Server • Determines address of called device • Like iterative searches in DNS

  34. Components and Protocols (2) • Proxy Server • Server and client • Makes requests for other clients • Routing • Enforcing policy • Like recursive searches in DNS • Registrar • Server that accepts REGISTER requests • Places information it receives in requests inlocation service for domain • SIP address, associated IP address of device • Location Service • Used by redirect or proxy server to obtain information about a callee's possible location(s) • Maintains database of SIP-address/IP-address mappings

  35. Components and Protocols (3) • Servers defined (RFC 3261) as logical devices • Implemented as separate servers or combined into single application • Proxy servers may act as redirect servers • Need to consult location service database • May be on proxy server or not • Communication between proxy server and location service beyond scope of SIP standard • Proxy consults DNS server to find target domain proxy • SIP typically runs on UDP for performance • Own reliability mechanisms • May also use TCP • May use Transport Layer Security (TLS) protocol for secure connection

  36. Session Description ProtocolSDP • RFC 2327 • SIP invites participants to session • SDP-encoded body of SIP message contains information about what media encodings (e.g., voice, video) parties can and will use • Then data transmission begins, using appropriate transport protocol • Real-Time Transport Protocol (RTP) • Participants can make changes to session parameters using SIP

  37. Figure 4.8 SIP Components and Protocols

  38. Uniform Resource Identifier URI • Identifies SIP resource • User of online service • Appearance on multiline phone • Mailbox on messaging system • Telephone number at gateway service • Group (such as "sales" or "helpdesk") in an organization • Format based on email address formats • user@domain • sip:bob@biloxi.com •  May also include password, port number, and related parameters • If secure transmission required, use "sips:“ • SIP messages are transported over TLS • URI is generic identifier for resource on Internet • URL, for Web addresses is type of URI

  39. Figure 4.9 SIP Call Setup Attempt Scenario

  40. Figure 4.10 SIP Presence Example

  41. Figure 4.11 SIP Registration and Notification Example

  42. Figure 4.12 SIP Successful Call Setup

  43. SIP Messages • Requests and responses • Difference between types in first line • Request • Method: nature of request • Request-URI: where request should be sent • Response has response code • All messages include header • Number of lines • Beginning with header label • Message can also contain body e.g. SDP media description

  44. SIP Messages - Requests • Methods • REGISTER: notify SIP network of IP address and URLs for which it would like to receive calls • INVITE: establish session between user agents • ACK: Confirms reliable message exchanges • CANCEL: Terminates pending request, but does not undo completed call • BYE: Terminates session between two users in conference • OPTIONS: Solicits information about callee capabilities

  45. SIP Message Request Example INVITE sip:bob@biloxi.com SIP/2.0 Via: SIP/2.0/UDP 12.26.17.91:5060 Max-Forwards: 70 To: Bob <sip:bob@biloxi.com> From: Alice <sip:alice@atlanta.com>;tag=1928301774 Call-ID: a84b4c76e66710@12.26.17.91 CSeq: 314159 INVITE Contact: <sip:alice@atlanta.com> Content-Type: application/sdp Content-Length: 142

  46. SIP Messages - Response • Provisional (1xx): Request received and being processed • Success (2xx): Action successfully received, understood, and accepted • Redirection (3xx): Further action needed • Client Error (4xx): Request contains bad syntax or cannot be fulfilled at this server • Server Error (5xx): Server failed to fulfill apparently valid request • Global Failure (6xx): Request cannot be fulfilled at any server

  47. SIP Response Example SIP/2.0 200 OK Via: SIP/2.0/UDP server10.biloxi.com Via: SIP/2.0/UDP bigbox3.site3.atlanta.com Via: SIP/2.0/UDP 12.26.17.91:5060 To: Bob <sip:bob@biloxi.com>;tag=a6c85cf From: Alice <sip:alice@atlanta.com>;tag=1928301774 Call-ID: a84b4c76e66710@12.26.17.91 CSeq: 314159 INVITE Contact: <sip:bob@biloxi.com> Content-Type: application/sdp Content-Length: 131

  48. SDP Information • Media streams • Session can include multiple streams of differing content • Currently defines audio, video, data, control, and application • Addresses • Destination addresses, • May be multicast • Ports • For each stream • Payload types • For each media stream type • Start and stop times • For broadcast sessions e.g. television or radio program • Originator • For broadcast sessions

  49. Sockets • 1980s UNIX Berkeley Sockets Interface • Socket enables communications between client and server process • Connection-oriented or connectionless • Endpoint in communication • Client socket in one computer uses address to call server socket on another computer • Once appropriate sockets engaged, can exchange data • Server sockets keep TCP or UDP port open • Once connected server switches dialogue to different port

  50. Sockets API (1) • Sockets can be constructed from within program in most languages • Berkeley Sockets Interface is de facto standard API • Windows Sockets (WinSock) based on Berkeley • TCP and UDP header includes source port and destination port fields • Identify respective users (applications) • IPv4 and IPv6 header includes source address and destination address fields • Identify host systems • Port value with IP address forms socket • Unique throughout Internet • When used as API, socket is identified by triple • Protocol, local-address (IP), local-process (port)

More Related