World Wide Web

The World Wide Web

Formats and protocols
  • What do those words mean?
    • A convention
    • Gives meaning to “bits on the wire”
    • Example:
  • 3 critical protocols or formats
    • HTTP - Hyptertext Transfer ProtocolP
    • URI - Universal Resource Identifier
    • HTML - Hypertext Markup Language
  • Actually there are a bunch more that are almost as important
    • CSS - Cascading Style Sheets
    • JS (or ECMA) - Javascript
    • More?
  • All this is based on foundational Internet protocols
    • TCP/IP
    • DNS
  • Dissecting the URL
    • Protocol
    • Host Name (see also: domain name, subdomain name)
    • Port (default for http is 80 and for telnet is 23, etc.)
    • Path
    • Parameters
  • HTTP Protocol
    • Client makes a request (a packet is sent)
    • Server Responds to the request (a packet is sent back)
    • URL is on the “envelope” of the request
    • Stateless
  • HTTP Requests contain:
    • Request “method”
    • URL
      • Host name
      • Path
      • Parameters
    • Request Headers
    • Methods:
      • GET, HEAD, POST, PUT, DELETE, a few others
  • HTTP Responses contain
    • Status code
    • Response headers:
      • Content-type
      • Content-length
      • Lots of other stuff

Understanding this is critical!

Use Telnet to experiment with TCP/IP
  • TCP/IP sends and receives ‘text’ protocols
  • Telnet utility
    • command line indicates the target host and port
    • Then you can type in the messages
    • What happens if I don’t specify port 80?
telnet example.com 80
GET /index.html HTTP/1.1
Host: www.example.com
Use an app to visualize HTTP
Review: What does TCP/IP do?
  • Sends a ‘message’ from one computer to another (often message is text)
  • Destination computer is designated by a host or domain name
  • Destination within the computer is designated by a port number
  • The format or Interpretation of the ‘message’ is determined by the port
  • Usually port 80 messages are interpreted as HTTP
Review: What does HTTP do?
  • Expects a “request” message which is answered by a “response”
  • Request message
    • Defines a “method”
    • Defines the “path”
    • Supplies information about the format and lots of other stuff
  • Response message
    • Defines a status code
    • Defines format of the response
    • Defines the response body
Review: How is the URL processed?
  • URL: http://www.salas.com:80/toplevel?catalog=cosi goes:
    • http -> use http protocol
    • :80 -> over port 80
    • -> method is implictly GET
    • www.salas.com -> host www.salas.com
    • /toplevel -> the path
    • Params ->
      • catalog = “cosi”