Application protocols
도입됨이 수업의 내용
| English | 의미 |
|---|---|
| DNS/ˌdiː en ˈes/ | 도메인 시스템 |
| delegation/ˌdelɪˈɡeɪʃn/ | handing responsibility for part of the DNS name space to another server |
| HTTP/ˌeɪtʃ tiː tiː ˈpiː/ | 초文本 전송 프로토콜 |
| status code/ˈsteɪtəs kəʊd/ | |
| multiplexing/ˌmʌltɪˈpleksɪŋ/ | carrying several streams over one connection or link |
| stateless/ˈsteɪtləs/ | keeping no memory of earlier requests between one request and the next |
Resolve the name
- DNS 域名系统 turns a name into an address by passing the question down a hierarchy (delegation 委派). Each answer points one level down:
| Ask | It knows | So it answers |
|---|---|---|
| A root server | the top-level domain (TLD) servers | "ask the .com servers" |
A .com server |
each domain's authoritative servers | "ask example.com's server" |
| The authoritative server | the hosts in its domain | the address |
- Caching skips the walk until the answer's TTL (time to live) runs out.
- HTTP 超文本传输协议 is a request and response format: a request line, headers, a blank line and a body. The class of the status code 状态码 is a promise: 2xx success, 3xx redirect, 4xx client error, 5xx server error.

DNS delegation means the root answers with —
난이도 1/5 · 100코인 + 오늘 첫 완료 시 작은 보너스 추가
Each level refers downward; the authoritative server holds the host record.
Put an uncached DNS lookup of www.example.com in order.
난이도 3/5 · 200코인 + 오늘 첫 완료 시 작은 보너스 추가
Every answer except the last is a referral one level down. The cache is why most lookups skip the whole walk.
One page, byte by byte
GET /index.html HTTP/1.1with a Host header. The server answers200 OK, then headers (Content-Type,Content-Length: 128), a blank line, and exactly 128 body bytes.- The blank line matters: the parser waits for exactly that empty line. Content-Length counts only the body bytes; the end of the headers is marked by the blank line.
The header block ends at —
난이도 1/5 · 100코인 + 오늘 첫 완료 시 작은 보너스 추가
Two newlines end the headers - the parser waits for exactly those.
Codes as promises
- 200 (here is the body), 301 (it moved;
Locationsays where), 404 (you asked for something that is not there), 500 (the server failed). A search crawler treats 301 as a pointer, 404 as a dead end and 500 as "try again later". - One global table of names would mean one global outage. Delegation splits the risk of failure as well as the data.
A 301 response tells the client —
난이도 1/5 · 100코인 + 오늘 첫 완료 시 작은 보너스 추가
Redirect: the resource lives elsewhere now.
Caching and HTTP versions
Cache-Control: max-age=3600lets a browser reuse a response for an hour without any request. After that it checks again with theETag: if nothing changed, the server sends304 Not Modifiedwith no body.- HTTP/1.1 keeps connections open; HTTP/2 sends many requests at once over one TCP connection (multiplexing 多路复用); HTTP/3 runs over QUIC on UDP, so one lost packet no longer holds up every stream.
- A DNS lookup with nothing cached asks the root, the TLD and the authoritative server: $3$ queries.
A server answers a revalidation with 304 Not Modified. The browser —
난이도 1/5 · 100코인 + 오늘 첫 완료 시 작은 보너스 추가
304 means the cached copy is still valid, so no body is sent.
A resolver has the .com TLD server cached but not the domain. How many queries does it send to resolve www.example.com?
난이도 2/5 · 140코인 + 오늘 첫 완료 시 작은 보너스 추가
It skips the root: one query to the .com server, one to the authoritative server.
A stateless protocol that remembers you
- HTTP keeps no memory between requests (it is stateless 无状态). After a login the server sends
Set-Cookie: session=7f3a…, and the browser returns that cookie with every later request to the site. - The server looks up the session and knows who is asking. Mark session cookies
SecureandHttpOnly, so they travel only over HTTPS and page scripts cannot read them.
By default an HTTP server remembers each client between requests.
난이도 1/5 · 100코인 + 오늘 첫 완료 시 작은 보너스 추가
HTTP is stateless; cookies carry the state.
Worked example: ten images at 50 ms
- A page has its HTML and 10 small images, and the round trip is 50 ms. HTTP/1.1 on one connection: 1 RTT to connect, 1 for the HTML, then 10 requests one after another: $12 \times 50 = \mathbf{600}$ ms.
- HTTP/2 sends all 10 requests together on that connection: $1 + 1 + 1 = 3$ RTTs, 150 ms. Browsers once opened six connections side by side to get part of this gain.
HTTP/1.1, one connection, RTT 50 ms: connect, HTML, then 10 images one at a time. Total (ms)?
난이도 2/5 · 140코인 + 오늘 첫 완료 시 작은 보너스 추가
$(1 + 1 + 10) \times 50 = 600$ ms.
Same page over HTTP/2 with the 10 requests multiplexed: total (ms)?
난이도 2/5 · 140코인 + 오늘 첫 완료 시 작은 보너스 추가
$3 \times 50 = 150$ ms.
Marks that slip away
- Forgetting the blank line. Headers end at an empty line; without it the server keeps waiting.
- Counting headers in
Content-Length. It counts body bytes only. - A 404 for a moved page. Answer
301with aLocationheader; a 404 tells crawlers the page is gone.
Recap
- DNS delegates: root, TLD, authoritative; caching skips the walk for the TTL.
- HTTP: request line, headers, a blank line, then exactly Content-Length body bytes.
- 2xx success, 3xx redirect, 4xx client error, 5xx server error.
어떤 문제가 있었나요? 사이트 팀만 이 내용을 볼 수 있습니다.