Web Protocols
The Internet Protocol Suite
The Internet protocol suite is conceptually divided into four layers:
Link layer: physical connectivity
Internet Layer: network-to-network
Transport Layer: host-to-host
Application Layer: process-to-process
Web Specific Protocols
Internet Layer:
- Internet Protocol (IP)
Transport Layer:
- Transmission Control Protocol (TCP)
Application Layer:
Domain Name System (DNS)
Hypertext Transfer Protocol (HTTP)
Transport Layer Security (TLS)
Internet Protocol (IP)
The Internet Protocol (IP) performs two basic functions:
Host addressing and identification
Packet routing
IP packets may be lost, duplicated, or arrive out-of-order
Transmission Control Protocol (TCP)
The Transmissions Control Protocol (TCP) provides a reliable communication mechanism on top of IP
The main points of TCP data transfer:
ordered data
retransmission of lost packets
error-free data transfer
flow control
congestion control
Domain Name System (DNS)
The Domain Name System (DNS) maps internet domain names to IP addresses
A domain name locates an entity on the internet using a human-readable name
The IP address of a domain name is retrieved by querying a DNS name server
If the name is inside the server’s domain, then an authoritative response is returned
If the name is outside the server’s domain, then the request is made to another DNS name server or a cached response is returned
Hypertext Transfer Protocol (HTTP)
HTTP is a request-response protocol in the client-server computing model
Form of a request:
Request line:
[request method] [resource] HTTP/1.1
empty line
optional message body
Form of a response:
Response line:
HTTP/1.1 [status code] [reason message]
empty line
optional message body
HTTP Example
Request:
GET /index.html HTTP/1.1 Host: www.example.com
Response:
HTTP/1.1 200 OK Content-Type: text/html; charset=UTF-8 Content-Length: 79 <html> <head><title>Title</title></head> <body><h1>Example</h1></body> </html
HTTP Request Methods
GET: requests a representation of the specified resource
HEAD: requests a representation of the specified resource without the message body
POST: requests that the server accept the data in the message body
PUT: requests that the server store the data in the message body under the specified URI
DELETE: requests that the server delete the resource
TRACE: echoes the received request
OPTIONS: returns the HTTP methods that the server supports for the specified URI
CONNECT: converts the request to a TCP/IP tunnel
PATCH: requests a partial modification to a resource
Uniform Resource Locator (URL)
scheme:[//user:password@]host[:port]][/]path[?query][#fragment]
scheme: e.g. http, ftp, mailto, file
authority:
authentication: user name and password
host: name or IP address
port
path: contains data source
query: contains attribute-value pairs
fragment: contains fragment identifier providing direction to a secondary source