OS must work and allocate host resources for each TCP connection
Browser often open parallel TCP connections to fetch referenced objects
HTTP response time (2RTT+)
RTT: Time for a small packet to travel from client to server and back
1RTT to initiate TCP connection
1RTT for HTTP request and first few bytes of HTTP response to return
File transmission time
Persistent HTTP
Procedures
TCP connection opened to a server
Multiple objects can be sent over single TCP connection between clients and that server
TCP connection closed
Server leaves connection open after sending response
Subsequent HTTP messages between same client/server are sent over connection
Persistent HTTP without pipelining
Client issues new request only when previous response has been received
1RTT for each referenced object
Head-of-line (HoL) blocking
Persistent HTTP with pipelining
Client sends requests as soon as it encounters a referenced object
As little as 1RTT for all the referenced objects
Not activated in practice
HTTP Message
Request
In ASCII (human readable format)
Methods
POST
GET
HEAD
PUT
Response
Statu Code
Informational, 1XX
Successful, 2XX, (200 OK)
Redirection, 3XX, (301 Moved Permanently)
Client Error, 4XX, (400 Bad Request, 404 Not Found)
Server Error, 5XX, (505 HTTP Version Not Support)
Cookies
Components
Cookie header line of HTTP response message
Cookie header line in next HTTP request message
Cookie file kept on user’s host, managed by user’s browser
Back-end database at website
Example
3rd-party cookies
Many sites use third party advertisements
The third party can set a cookie that identifies the user
This cookie is sent to the third party each time an ad is downloaded by the user’s browser along with the address of the page that contains the link to the ad
Web Caches (Proxy Servers)
Goal
Satisfy client request without involving origin server
User configures browser to point to a web cache
Browser sends all HTTP requsets to cache
If object in cache: cache returns object
Else: cache requests object from origin server, then returns object to client
Conditional GET
Goal
Don’t send object if cache has up-to-date cached version
No object transmission delay
Lower link utilization
Cache: specify date of cached copy in HTTP request
Server: response contains no object if cached copy is up-to-date
HTTP/2
Goals
Backward compatible with HTTP 1.1
Improve page load speed
Data compression of HTTP headers
HTTP/2 Server Push
Pipelining of requests
Fixing the head-of-line blocking problem in HTTP 1.1
Multiplexing multiple requests over a single TCP connection
Mitigating HOL blocking
Objects divided into frames, frame transmission interleaved
HTTP/2 to HTTP/3
Goal
To further decrease delay in multi-object HTTP requests
HTTP/2 over single TCP connection means
Recovery from packet loss still stalls all object transmissions => Head-of-line blocking!
HTTP/3 over UDP (to address the HoL blocking)
Adds security, per object error and congestion-control
Email
Components
User agents
Composing, editing, reading mail messages
Outgoing, incoming messages stored on server
Mail server
Mailbox
Message queue
SMTP (Simple Mail Transfer Protocol)
Client: Sending mail server
Server: Receiving mail server
SMTP [RFC 5321]
Uses TCP to reliably transfer email message from client to server, port 25 (or 587)
Direct transfer: sending server to receiving server
Three phases of transfer
Handshaking (greeting)
Transfer of messages
Closure
Command/response interaction (like HTTP, FTP)
Commands: ASCII text
Response: status code and phrase
Messages must be in 7-bit ASCII
Uses persistent connections
use CRLF.CRLF to determine end of message
Example
Mail Message Format
RFC 822: standard for text message format
Header lines (different from SMTP MAIL FROM, RCPT TO commands)
To
From
Subject
Body (the message)
ASCII characters only
Message Format: multimedia extensions
MIME (multipurpose internet mail extension): multimedia mail extension (to RFC 822), RFC 2045, 2056
Additional lines in msg header declare MIME content type
Mail Access Protocols
SMTP
Delivery/storage to receiver’s server
Mail access protocol: retrieval from server
POP
Post Office Protocol [RFC 1939]: authorization, download
IMAP
Internet Mail Access Protocol [RFC 1730]: more features, including manipulation of stored msgs on server
HTTP
Provides web-based interface on top of STMP (to send), IMAP (or POP) to retrieve e-mail messages
Gmail, Hotmail, etc.
DNS (Domain Name System)
Why not a single centralized DNS server
Single point of failure
Traffic jam due to huge number of requests/queries
Long distance => slow response
Maintenance issue
DNS services
Hostname to IP address translation
Host aliasing
Mail server aliasing
Load distribution
Root Name Servers
13 LOGICAL root name servers, but 1086(or more) PHYICAL servers
Reply with a referral to the DNS servers for a TLD, or indicating no such TLD exists.