# Q3C · Application-layer mechanism

Subject: Computer Networks

Exam: TEE

Reader: https://deep-learning-study-room.vercel.app/cn/#tee/mocks/tee-mock-a/q3c

Canonical: https://deep-learning-study-room.vercel.app/read/cn/tee/mocks/tee-mock-a--q3c/

TEE · 100 attempted marks · solutions for every choice · current syllabus 702AI0C023

### TEE practice mock · Q3C. Explain with a diagram how the WWW uses HTTP when a user enters http://www.example.com. Describe components and the client-server mechanism. [10 mock marks]

#### Answer

The **World Wide Web (WWW)** is an information system of linked resources identified by URLs and accessed using Web clients and servers. A browser is a client; a Web server hosts or generates representations such as HTML, images or JSON. **HTTP** defines request/response semantics between these components. The Web is one application of the Internet, not a synonym for the entire Internet.

Swipe across the diagram to read its labels ↔

![Opening a plain HTTP/1.1 URL](https://deep-learning-study-room.vercel.app/cn/fig/tee-http.de65bc75dd.svg)

Diagram: Opening a plain HTTP/1.1 URL. Labels: Opening a plain HTTP/1.1 URL | Opening a plain HTTP/1.1 URL | Browser parses http://www.example.com/ | Scheme=http, host=www.example.com, path=/, default port=80. | DNS resolves the host | A cached or newly resolved address identifies the target endpoint. | TCP establishes the connection | For this HTTP/1.1 example, client connects to server port 80. | HTTP request → HTTP response | GET / with Host header → status, headers and representation body. | Browser parses and displays | HTML may refer to extra objects, each needing retrieval or cache lookup.

URL → DNS → connection → HTTP request/response → displayed document.

1. Interpret the URL **http://www.example.com/**: scheme=http; host=www.example.com; path=/; absent explicit port, plain HTTP uses default port 80. A fragment identifier, if present, is handled by the client and is not sent as part of an HTTP target.
2. Resolve the hostname using DNS, often via cached results and a recursive resolver. DNS finds an address; it does not download the Web page.
3. For this plain HTTP/1.1 example, establish a TCP connection to the server on port 80. HTTPS additionally protects HTTP using TLS; do not add TLS to an explicitly plain-http example without stating a redirect or change of scheme.
4. Send a request such as GET / HTTP/1.1 with Host: www.example.com. The server identifies the target resource, processes the request and prepares a response.
5. Receive a status line such as HTTP/1.1 200 OK, response headers such as Content-Type, and the response body. A 404 response indicates no matching resource was found; redirects instruct the client to another target.
6. The browser parses HTML, retrieves referenced objects as needed and renders the page. Caching may avoid transfers; persistent connections can serve multiple requests.

| Message component | Purpose |
| --- | --- |
| Request method / target | Requested action and resource; GET retrieves a representation, POST submits data for processing |
| Headers | Metadata, routing context, representation preferences and cache/connection information |
| Status code | Result class: 2xx success, 3xx redirection, 4xx client error, 5xx server error |
| Body | Representation or submitted content when present |

HTTP semantics are stateless: each request has its own meaning. Cookies/tokens can let an application maintain a login session; stateless does not mean “users cannot log in”. HTTP/1.1 and HTTP/2 commonly use TCP; HTTP/3 uses QUIC over UDP, so “HTTP always uses TCP” is not a universal statement.

#### Practical example

A browser can receive the HTML successfully and still need separate requests for its stylesheet and image. One URL entry can therefore cause several HTTP exchanges.
