Week 1 Reading: Overview of HTTP - savannahc502/SavC-TechJournal-SEC260 GitHub Wiki
Gourley, David, and Brian Totty. HTTP: The Definitive Guide. O’Reilly, 2002.
Read Chapter 1 (Overview of HTTP)
- HyperText Transfer Protocol uses reliable data-transmission protocols
HTTP, Web Clients and Servers
- Web servers host the content of the web, and are often called HTTP servers
- Most common HTTP clients are browsers
- Communication is request/response
Web Resources
- Web servers host content, aka web resources (the source of web content)
- Includes Static Files: text files, HTML files, Microsoft Word files, Adobe Acrobat files, JPEG image files, AVI movie files
- Includes dynamic content via software (camera feed, stocks, online stores)
Media Types
- HTTP tags transported objects with a label called a MIME type (Multipurpose Internet Mail Extensions)
- The server attaches a MIME to all HTTP objects, the browser interprets
- MIME tag examples
- text/html
- text/plain
- image/jpeg
- image/gif
- video/quicktime
- application/vdn.ms-powerpoint
URI (Uniform Resource Identifier) and URL (Uniform Resource Locator)
- Type of URI are URLs
- URLs describe the specific location of a resource on a particular serve
URN (Uniform Resource Name)
- Type of URI
- "A URN serves as a unique name for a particular piece of content, independent of where the resource currently resides."
Transactions
- HTTP responses and requests are sent via messages
- HTTP requests have a method, typically GET and POST. The method tells the server what action to perform
HTTP Method | Description |
---|---|
GET | Send named resource from server to the client |
PUT | Store data from client into a named server resource |
DELETE | Delete the named resource from the server |
POST | Send client data into a server gateway application |
HEAD | Send just the HTTP headers from the response for the named resource |
Status Codes
- HTTP responses messages
- Three digits (200, 302, 404)
Web Pages Can Consist of Multiple Objects
Messages
- HTTP messages have three parts: Start line, header fields, and the body
- Start line indicates typed of request/response
- Header fields have name and value separated by a colon
- Body holds other data needed
- Examples and more notes: https://github.com/savannahc502/SavC-TechJournal-NET215/wiki/Week-13-and-14-Preview%3A-HTTP
Connections
- HTTP is a simple application layer protocol. The network communication is left to TCP/IP, the reliable Internet transport protocol.
- TCP has error-free data transportation, in-order delivery, and unsegmented data stream
- HTTP is layered OVER TCP.
Connections, IP Addresses, and Port Numbers
- TCP/IP connection must be established before HTTP client
- Requires the IP address of the server and the TCP port numbers of the software running on the server
- This information comes form the URL
- The host name can be translated to an IP via the DNS
- Default server port is 80, which is absent from URLs
- Requires the IP address of the server and the TCP port numbers of the software running on the server
Steps from textbook:
- The browser extracts the server’s hostname from the URL.
- The browser converts the server’s hostname into the server’s IP address.
- The browser extracts the port number (if any) from the URL.
- The browser establishes a TCP connection with the web server.
- The browser sends an HTTP request message to the server.
- The server sends an HTTP response back to the browser.
- The connection is closed, and the browser displays the document.
You can use Telnet to test this out via text lines
Protocol Versions
- HTTP/0.9, HTTP/1.0, HTTP/1.0+, HTTP/1.1, HTTP-NG (HTTP/2.0)
Architectural Components of the Web
- Proxy sits between client and server to be a middle man for incoming HTTP requests
- Web cache/Caching proxy is a proxy server that keeps stock of popular requested documents
- Gateways are intermediaries to filter traffic, like a firewall. Often convert hTTP traffic to another protocol
- Tunnels are HTTP applications that "blindly relay raw data between two connections"
- Agents make HTTP requests for the user, like web browsers