0% found this document useful (0 votes)
12 views5 pages

CSC430 L4 Sum

Uploaded by

omarobeidd03
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views5 pages

CSC430 L4 Sum

Uploaded by

omarobeidd03
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

1) Web Page Composition: Web pages are made up of various objects such as HTML files, images,

audio files, and more.


2) Structure: The main structure is provided by a base HTML file, which includes references to
other objects that make up the complete web page.
3) Object Access: Each object on a web page is accessible through a unique URL, which specifies its
location on the internet.
4) URL Example: http:/ (protocol) /www.someschool.edu (host + network name ("www" is host
name)) /someDept/pic.gif (path (full file) name (or directory name, or "")); is an example of a
URL pointing to an image object on a web page.
5) HTTP (Hypertext Transfer Protocol): The protocol used for transferring web pages and other
content on the internet. It operates at the application layer.
6) Client/Server Model: In this model, the client (usually a web browser) requests web objects, and
the server (a web server) responds by sending the requested objects back to the client.
7) Versions:
8) HTTP 1.0: Defined in RFC 1945. It's the first version of the protocol.
9) HTTP 1.1: An improved version detailed in RFC 2068, offering enhancements like persistent
connections.
10) RFC (Request for Comments): Documents that describe the specifications and standards of
protocols like HTTP.
11) HTTP Overview:
12) TCP Connection: HTTP uses TCP (Transmission Control Protocol) for reliable communication. The
client (browser) initiates a TCP connection to the server on port 80 by default.
13) Message Exchange: Once the TCP connection is established, HTTP messages are exchanged
between the client and the server.
14) Connection Closure: After the message exchange, the TCP connection is closed.
15) Statelessness: HTTP is stateless, meaning the server does not keep track of any past requests
from the client.
16) Nonpersistent HTTP: Allows only one object to be sent per TCP connection. Commonly used in
HTTP/1.0, requiring separate connections for each web object, leading to more overhead.
17) Persistent HTTP: Multiple objects can be transmitted over a single TCP connection without
closing it immediately after each transfer. Default in HTTP/1.1, it reduces overhead and speeds
up web page loading by reusing connections for multiple resources.

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.

40) HTTP methods:


41) HTTP/1.0:
42) • GET: Requests data from a specified resource. Does not change the state of the resource.
43) • POST: Submits data to a specified resource, potentially changing the state or causing side
effects on the server.
44) • HEAD: Similar to GET, but only requests the headers of the resource. No body is returned,
useful for checking what a GET request will return. Asks server to leave requested object out of
response.
45) HTTP/1.1:
46) • GET, POST, HEAD
47) • PUT: Uploads a representation of the specified resource. If it exists, it is updated; if not, a new
resource is created with the provided data. Uploads file in entity body to path specified in URL
field
48) • DELETE: deletes file specified in the URL field.
49) On slide 11, the focus is on the structure of HTTP request messages, which are essential for web
communication. It breaks down the format into its components:
50) Request Line: This is the first line in the request message and contains three parts: the method
(GET, POST, etc.), the resource URL being requested, and the HTTP version being used.
51) Header Fields: Following the request line, there are various headers providing additional details
about the request. These include the Host (the server's address), User-Agent (information about
the client's software), Accept (the types of data the client can process), and more. Headers are
key-value pairs separated by colons.
52) Blank Line: An empty line signaling the end of the header section.
53) Optional Message Body: Not always present, but when it is, this section contains data sent to
the server, like form submissions in POST requests.
54) sp: separator can be a space; cr: carriage return; lf: line feed.
55) Example: HTTP request message:
56) Two types of HTTP messages: request, response
57) • HTTP request message: • ASCII (human-readable format)
58) GET /somedir/page.html HTTP/1.1 (request line( (GET, POST, HEAD commands))
59) Host: www.someschool.edu
60) User-agent: Mozilla/4.0
61) Connection: close
62) Accept-language:fr (header lines)
63) Carriage return, line feed indicates end of message
64) When you fill out a form on a website and hit submit, two main methods can be used to send
this data to the server:
65) POST Method: This method sends your form data through the body of the HTTP request, not
visible in the web address. It's more secure and can handle large amounts of data.
66) URL Method (uses GET): This sends your form data appended to the URL, visible to anyone who
looks at the web address. It's less secure and better for simple, small data submissions.
67) So, if you're submitting sensitive information or a lot of data, POST is used. For simple searches
or filters, GET might be used, making the data part of the URL.
68) HTTP response status code:
69) 200 OK: The request has succeeded, and the requested content is included in the message.
70) 301 Moved Permanently: The requested resource has been moved to a new URL, which is
provided in the response.
71) 400 Bad Request: The server couldn't understand the request due to invalid syntax.
72) 404 Not Found: The server couldn't find the requested resource.
73) 505 HTTP Version Not Supported: The HTTP version used in the request is not supported by the
server.
74) Example: HTTP/1.1 200 OK (status line (protocol status code status phrase)) Connection close
Date: Thu, 06 Aug 1998 12:00:15 GMT Server: Apache/1.3.0 (Unix) Last-Modified: Mon, 22 Jun
1998 …... Content-Length: 6821 Content-Type: text/html (header lines) data data data data
data… (data, e.g., requested HTML file)

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.

87) Cache-Proxy Servers:


88) To fulfill user requests for web content by accessing a cache-proxy server instead of directly
reaching out to the origin server.
89) How It Works:
90) User's Browser Configuration: Users configure their browsers to route all web access through a
cache-proxy server.
91) Request Handling: When the browser makes HTTP requests, these are directed to the cache-
proxy.
92) If the requested content is already in the cache and up-to-date, the proxy serves this content
back to the user.
93) If the content is not in the cache or is outdated, the proxy fetches the content from the origin
server, serves it to the user, and updates the cache.
94) Benefits of Web Caching:
95) Reduces Response Time: Fetching content from a nearby cache is faster than accessing the
origin server, especially if the server is geographically distant.
96) Reduces Traffic: By serving content from the cache, the amount of data transmitted across the
internet and the institution's access link is reduced.
97) Supports Content Delivery: A dense network of caches across the internet allows content
providers with limited bandwidth or resources to effectively deliver content. This is somewhat
similar to how peer-to-peer (P2P) file sharing distributes the load of content delivery across
multiple peers.

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)

You might also like