[TIL] HTTP : The Definitive Guide "p11 ~ p14"

시윤·2024년 1월 22일
0

[TIL] Two Pages Per Day

목록 보기
6/108
post-thumbnail

Chapter 1. Overview of HTTP

(해석 또는 이해가 잘못된 부분이 있다면 댓글로 편하게 알려주세요.)


❤️ 원문 번역 ❤️

Connections

Now that we’ve sketched what HTTP’s messages look like, let’s talk for a moment about how messages move from place to place, across Transmission Control Protocol (TCP) connections.

-> 지금까지 HTTP 메시지가 어떻게 생겼는지 살펴보았습니다. 이제 이 메시지가 Transmission Control Protocol (TCP)에 의해 전달되는 과정에 대해 이야기해봅시다.


TCP/IP

HTTP is an application layer protocol. HTTP doesn’t worry about the nitty-gritty details of network communication; instead, it leaves the details of networking to TCP/IP, the popular reliable Internet transport protocol.

-> HTTP는 Application Layer(OSI 7계층)의 프로토콜입니다.

-> HTTP는 네트워크 통신의 자잘한 부분까지 고려하지 않습니다. 그 대신 TCP/IP에 세부적인 부분을 맡깁니다.

-> TCP/IP는 가장 대중적이고 신뢰할 수 있는 인터넷 전송 프로토콜입니다.

TCP provides:

• Error-free data transportation
• In-order delivery (data will always arrive in the order in which it was sent)
• Unsegmented data stream (can dribble out data in any size at any time)

-> TCP는 다음과 같은 기능을 제공합니다.

    1. 오류 없는 데이터 전송
    1. 순차적 전송 (데이터가 항상 전송한 순서대로 도착)
    1. Segment화 되지 않은 데이터 스트림 (언제든지 임의의 크기로 데이터 전송)

The Internet itself is based on TCP/IP, a popular layered set of packet-switched network protocols spoken by computers and network devices around the world. TCP/IP hides the peculiarities and foibles of individual networks and hardware, letting computers and networks of any type talk together reliably.

-> TCP/IP는 전세계의 컴퓨터와 네트워크 장치가 사용하는 패킷 교환(packet-switched) 네트워크 프로토콜의 인기 있는 계층화된 집합입니다. 인터넷 자체가 이러한 TCP/IP에 기반하고 있습니다.

-> TCP/IP는 개별 네트워크와 하드웨어의 특성과 결함을 숨기고 모든 종류의 컴퓨터와 네트워크가 함께 신뢰할 수 있는 통신을 하도록 합니다.

Once a TCP connection is established, messages exchanged between the client and server computers will never be lost, damaged, or received out of order.

-> TCP 연결 설정이 완료되면 클라이언트와 서버 컴퓨터 사이에서 교환되는 메시지는 절대 유실되거나 손상되지 않습니다. 혹은 원래의 순서와 다르게 전달되지도 않습니다.

In networking terms, the HTTP protocol is layered over TCP. HTTP uses TCP to transport its message data. Likewise, TCP is layered over IP (see Figure 1-9).

-> 네트워킹 관점에서 HTTP 프로토콜은 TCP 위에 놓여 있습니다. HTTP는 메시지 데이터를 전달하기 위해 TCP를 사용합니다.

-> 마찬가지로 TCP(OSI 4계층)는 IP(OSI 3계층) 위에 놓여 있습니다. (Figure 1-9)


Connections, IP Addresses, and Port Numbers

Before an HTTP client can send a message to a server, it needs to establish a TCP/IP connection between the client and server using Internet protocol (IP) addresses and port numbers.

-> HTTP 클라이언트가 서버로부터 메시지를 보내기 전에, IP 주소와 Port 번호를 사용하는 클라이언트와 서버 사이에서 TCP/IP 연결 설정이 이루어져야 합니다.

Setting up a TCP connection is sort of like calling someone at a corporate office. First, you dial the company’s phone number. This gets you to the right organization. Then, you dial the specific extension of the person you’re trying to reach.
In TCP, you need the IP address of the server computer and the TCP port number associated with the specific software program running on the server.

-> TCP 연결 설정은 사무실에 있는 누군가에게 전화를 거는 것과 같습니다.

-> 먼저 여러분은 회사의 전화번호를 누릅니다. 이 과정을 통해 적절한 조직으로 연결됩니다.

-> 그 다음 여러분은 당신이 전화를 걸고자 하는 특정 내선 번호에 전화를 겁니다.

-> TCP에서는 서버 컴퓨터에 대한 IP 주소(회사 전화번호)와 서버에서 실행중인 특정 소프트웨어 프로그램의 Port 번호(내선 번호)가 필요합니다.

This is all well and good, but how do you get the IP address and port number of the HTTP server in the first place? Why, the URL, of course! We mentioned before that URLs are the addresses for resources, so naturally enough they can provide us with the IP address for the machine that has the resource.

-> HTTP 서버의 IP 주소와 Port 번호는 URL을 통해 얻을 수 있습니다.

-> 이전에 URL이 리소스의 주소라는 것을 언급한 적이 있습니다. 따라서 당연하게 URL은 리소스가 존재하는 장치의 IP 주소를 전달할 수 있습니다.

Let’s take a look at a few URLs:
http://207.200.83.29:80/index.html
http://www.netscape.com:80/index.html
http://www.netscape.com/index.html

The first URL has the machine’s IP address, “207.200.83.29”, and port number, “80”.

The second URL doesn’t have a numeric IP address; it has a textual domain name, or hostname (“www.netscape.com”). The hostname is just a human-friendly alias for an IP address. Hostnames can easily be converted into IP addresses through a facility called the Domain Name Service (DNS), so we’re all set here, too. We will talk much more about DNS and URLs in Chapter 2.

The final URL has no port number. When the port number is missing from an HTTP URL, you can assume the default value of port 80.

-> 몇 가지 URL들을 살펴봅시다.

-> 첫 번째 URL은 장치의 IP 주소인 "207.20.83.29"가 직접적으로 드러나고, Port 번호가 "80"입니다.

-> 두 번째 URL은 숫자로 된 IP 주소가 드러나지 않고, 텍스트로 이루어진 도메인 이름 혹은 호스트 이름("www.netscape.com")을 보유하고 있습니다.
-> 호스트 이름은 IP 주소의 인간 친화적인 이름에 불과합니다.
-> 호스트 이름은 Domain Name Service(DNS)에 의해 쉽게 IP 주소로 변환될 수 있습니다. DNS와 URL에 대해서는 Chapter2에서 더 자세히 이야기할 예정입니다.

-> 세 번째 URL은 Port 번호를 가지고 있지 않습니다. Port 번호가 URL에 존재하지 않는다면 디폴트 Port 번호인 80이라고 볼 수 있습니다.

With the IP address and port number, a client can easily communicate via TCP/IP. Figure 1-10 shows how a browser uses HTTP to display a simple HTML resource that resides on a distant server.

-> IP 주소 및 Port 번호를 가지고, 클라이언트는 TCP/IP를 통해 쉽게 소통할 수 있습니다.

-> Figure 1-10은 브라우저가 원격 서버에 위치한 단순한 HTML 리소스를 보여주기 위해 HTTP를 어떻게 사용하고 있는지 보여줍니다.

Here are the steps:

(a) The browser extracts the server’s hostname from the URL.

(b) The browser converts the server’s hostname into the server’s IP address.

(c) The browser extracts the port number (if any) from the URL.

(d) The browser establishes a TCP connection with the web server.

(e) The browser sends an HTTP request message to the server.

(f) The server sends an HTTP response back to the browser.

(g) The connection is closed, and the browser displays the document.

-> 위의 그림은 다음과 같은 단계를 나타냅니다.

  • (a) 브라우저가 URL로부터 서버의 호스트 이름을 추출합니다.
  • (b) 브라우저가 서버의 호스트 이름을 IP 주소로 변환합니다(DNS).
  • (c) 브라우저가 URL로부터 Port 번호를 추출합니다.
  • (d) 브라우저가 웹 서버와 TCP 연결합니다.
  • (e) 브라우저가 서버에 HTTP Request Message를 전송합니다.
  • (f) 서버가 브라우저에 HTTP Response Message를 돌려줍니다.
  • (e) 연결이 끝나고 브라우저는 파일을 화면에 띄웁니다.

🧡 요약 정리 🧡

HTTP over TCP/IP

  • HTTP : OSI 7계층 프로토콜
  • TCP : OSI 4계층 프로토콜 (Process-to-Process, 특정 프로세스의 Port 번호)
  • IP : OSI 3계층 프로토콜 (Host-to-Host, 서버 컴퓨터의 IP 주소)
  • HTTP는 HTTP/3가 아닌 한 TCP/IP 위에서 동작
    따라서 URL로부터 IP 주소와 Port 번호를 추출하여 사용

TCP/IP

  • 가장 대중적이고 신뢰할 수 있는 인터넷 전송 프로토콜
  • 오류 없는 데이터 전송
  • 순차적 전송
  • 임의의 크기를 가진 데이터 스트림

URL, IP Address, Port Number

  • URL에서 IP 주소는 숫자로 나타나거나 호스트 이름으로 나타남
    (호스트 이름은 DNS를 통해 숫자로 변환)
  • URL에서 Port 번호는 콜론 뒤에 숫자로 나타나거나 생략
    (생략 가능한 Default Port 번호 = 80)
  • HTTP 통신 과정 : URL에서 IP 주소와 Port 번호를 추출해 TCP/IP 연결 설정을 진행한 후 메시지를 다 주고받으면 연결 설정 해제

💛 감상 💛

  • OSI 7계층이나 TCP/IP에 대한 사전지식이 부족했다면 내용이 어렵게 느껴졌을 것 같다. 네트워크 수업을 먼저 듣고 책을 읽어서 그나마 다행이었다. 글을 읽다 보니 TCP/IP에 대해서도 다시 자세히 공부해봐야겠다는 생각이 들었다. 강의 들은 지 얼마나 됐다고 벌써 많이 까먹은 것 같다(?).

  • 글을 읽다보니 DNS의 동작 원리가 궁금해졌다. 그러나 Chapter2에서 DNS에 대해 자세히 다룬다고 하여 따로 찾아보지 않았다. 그게 궁금하면 두 페이지씩 꾸준히 읽어서 얼른 Chapter2까지 정독하면 그만이다!

  • Overview 파트에서 Chapter2나 3에 대한 예고를 자꾸 하는데 그걸 읽은 나는 50% 세일하는 X신사 옷을 본 것 같은 기분이다. 뒷내용을 더 읽을까 말까 백만 번 고민하게 된다. 마음 같아서는 전부 읽어버리고 싶지만, 한 번에 이해할 자신도 전부 기억할 자신도 없다. 조금씩 꾸준히 읽어서 더 잘 이해하고 더 잘 기억하는 것이 현명하지 않을까...? 나는 모든 것에 인내심이 좀 필요하다.

profile
맑은 눈의 다람쥐

0개의 댓글

관련 채용 정보