CSC430 L4 Sum
CSC430 L4 Sum
18) When you enter the following URL to your navigator: www.lau.edu.lb/files/lecture3.html:
19) Connection Initiation: The client (browser) initiates a TCP connection to the server located at
www.lau.edu.lb on port 80.
20) The server, listening on port 80, accepts the connection and notifies the client.
21) HTTP client sends HTTP request message (containing URL) into TCP connection socket. Message
indicates that client wants object files/lecture3.html
22) Server Response: The server receives the request, prepares a response containing the
lecture3.html file, and sends it back to the client through the same TCP connection.
23) Display and Further Requests: Upon receiving the HTML file, the client displays it. While parsing,
it identifies 10 JPEG images referenced within the HTML.
24) Connection Closure: After sending the HTML file, the server closes the TCP connection.
25) Repeat for Additional Object: Steps 1 to 5 are repeated for each of the 10 JPEG images, as each
object requires a new TCP connection in a nonpersistent HTTP setup.
26) This process highlights the inefficiency in nonpersistent HTTP, where a new TCP connection is
needed for each web object, increasing the load time due to the overhead of establishing and
closing connections.
27) RTT (Round-Trip Time): The time it takes for a packet to go from the client to the server and
back.
28) Response Time Calculation:
29) 1 RTT to set up the TCP connection.
30) 1 RTT for the HTTP request and to start receiving the HTTP response.
31) File Transmission Time: The time needed to actually send the file data.
32) Total Response Time: 2 RTTs plus the file transmission time.
33) Issues:
34) Requires 2 RTTs for each web object, adding delay.
35) Each TCP connection setup and teardown incurs operating system overhead.
36) Browsers may open multiple connections in parallel to speed up loading but at the cost of
increased resource use.
37) Persistent HTTP: Keeps the connection open for multiple exchanges between the client and
server, reducing overhead from opening/closing connections.
38) Without Pipelining: Each request is made after receiving the response for the previous one,
requiring one RTT per object but over a single, persistent connection.
39) With Pipelining (standard in HTTP/1.1): Allows sending multiple requests back-to-back without
waiting for each response, potentially reducing the total RTT to as low as one for all referenced
objects, enhancing efficiency.
75) Cookies:
76) Cookies are a mechanism for websites to store and retrieve information from a user's browser:
77) Cookie in Response: When you visit a site, it can send a cookie to your browser in an HTTP
response.
78) Cookie in Request: Next time you visit, your browser sends the cookie back to the site in an
HTTP request.
79) Cookie Storage: This cookie is stored on your computer and managed by your browser.
80) Server Database: The site keeps a record linked to the cookie for things like preferences or
session info.
81) Example: Susan visits an e-commerce site from her PC. The site assigns her a unique ID through
a cookie and tracks her visits with this ID, storing information in its database.
82) Cookie example:
83) Cookie Creation and Storage: When a user visits a website (e.g., eBay or Amazon), the server
generates a unique ID for that user and sends it back to the user's browser in the form of a
cookie. This cookie is stored in a file on the user's device, managed by the browser.
84) Cookie File Example: The cookie file might contain entries such as ebay: 8734 and amazon: 1678,
indicating unique IDs assigned by eBay and Amazon.
85) Subsequent Visits and Requests: On subsequent visits to the same website, the browser sends
the stored cookie back to the server in the HTTP request message. This cookie contains the
unique ID (cookie: 1678 for Amazon, for example). The server uses this ID to recognize the user
and potentially customize the response based on the user's preferences or browsing history,
which is tracked in the server's back-end database.
86) One Week Later Example: Even one week later, the cookie file on the user's device still contains
the unique IDs for Amazon and eBay. This enables consistent user identification over time.
98) The Conditional GET mechanism is designed to optimize web traffic by preventing the
retransmission of unchanged content:
99) Goal: To not resend an object if the cache already has an up-to-date version of it.
100) How It Works:
101) Cache's Role: When making an HTTP request for an object, the cache includes an If-
modified-since: header. This date represents when the cached version was last updated.
102) Server's Role: Upon receiving the request, the server checks the object's last
modification date.
103) If the object hasn't been modified since the date specified in the request, the server
responds with a status code of HTTP/1.0 304 Not Modified, and does not send the object again.
104) If the object has been modified, the server sends the updated object with a 200 OK
response.
105) This process reduces bandwidth usage and load times by ensuring that only new or
updated content is transmitted, while unchanged content is reused from the cache.
106)