[TIL] HTTP : The Definitive Guide "p74 ~ p75"

시윤·2024년 3월 5일
0

[TIL] Two Pages Per Day

목록 보기
31/109
post-thumbnail

Chapter 4. Connection Management

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


❤️ 원문 번역 ❤️

Preface

The HTTP specifications explain HTTP messages fairly well, but they don’t talk much about HTTP connections, the critical plumbing that HTTP messages flow through. If you’re a programmer writing HTTP applications, you need to understand the ins and outs of HTTP connections and how to use them.

  • HTTP 명세는 HTTP 메시지에 대해 잘 설명하고 있지만, HTTP 메시지가 흘러가는 중요한 배관인 HTTP 연결에 대해서는 자세하게 언급하지 않습니다.

  • 만약 여러분이 HTTP 응용 프로그램을 작성하는 개발자라면, 여러분은 HTTP 연결의 입출력과 사용 방식을 이해해야만 합니다.

HTTP connection management has been a bit of a black art, learned as much from experimentation and apprenticeship as from published literature. In this chapter, you’ll learn about:

  • How HTTP uses TCP connections
  • Delays, bottlenecks and clogs in TCP connections
  • HTTP optimizations, including parallel, keep-alive, and pipelined connections
  • Dos and don’ts for managing connections
  • HTTP 연결 관리는 출판된 문헌에서부터 배우는 것만큼 실험과 견습에서 배우는 것이 많은 블랙 아트의 일종입니다.

  • 이번 챕터에서는 다음과 같은 것들을 학습합니다.
    - HTTP가 TCP 연결을 활용하는 방법
    - TCP 연결의 Delay, Bottleneck, Clog 현상
    - 병렬연결, 파이프라인, 지속연결 등을 통한 HTTP 최적화
    - 연결 관리중 해야 하는 일과 해서는 안 되는 일


TCP Connections

Just about all of the world’s HTTP communication is carried over TCP/IP, a popular layered set of packet-switched network protocols spoken by computers and network devices around the globe. A client application can open a TCP/IP connection to a server application, running just about anywhere in the world. Once the connection is established, messages exchanged between the client’s and server’s computers will never be lost, damaged, or received out of order.*

  • 전세계의 모든 HTTP 통신은 TCP/IP 위에서 이루어집니다. TCP/IP는 전세계의 컴퓨터와 네트워크 장치가 사용하는 패킷 교환 네트워크 프로토콜의 인기 있는 레이어 집합입니다.

  • 클라이언트 응용 프로그램은 전세계의 어느 곳에서 동작하는 서버 응용 프로그램에 대해서든 TCP/IP 연결을 열 수 있습니다.

  • 연결이 설정되면 클라이언트와 서버 사이에서 교환되는 메시지는 절대 유실되지도, 손상되지도, 순서가 뒤바뀌지도 않을 것입니다.

Say you want the latest power tools price list from Joe’s Hardware store:

http://www.joes-hardware.com:80/power-tools.html

When given this URL, your browser performs the steps shown in Figure 4-1. In Steps 1–3, the IP address and port number of the server are pulled from the URL. A TCP connection is made to the web server in Step 4, and a request message is sent across the connection in Step 5. The response is read in Step 6, and the connection is closed in Step 7.

  • 여러분이 Joe's Hardware Store에서 최신 전동공구의 가격 리스트를 원한다고 가정해봅시다.

        http://www.joes-hardware.com:80/power-tools.html
  • 해당 URL이 주어지면 브라우저는 Figure 4-1과 같은 단계를 수행합니다.

  • Steps 1-3은 서버의 IP 주소와 Port 번호를 URL로부터 받아오는 과정을 나타냅니다.

  • Step 4에서는 웹 서버에 TCP 연결이 이루어지고, Step 5에서 요청 메시지가 연결을 통해 전달됩니다.

  • 응답은 Step 6에서 받아들여지고 Step 7에서 연결이 닫힙니다.


TCP Reliable Data Pipes

HTTP connections really are nothing more than TCP connections, plus a few rules about how to use them. TCP connections are the reliable connections of the Internet. To send data accurately and quickly, you need to know the basics of TCP.*

  • HTTP 연결은 TCP 연결 그 이상도 이하도 아닙니다. TCP 연결을 사용하는 방법에 대한 약간의 규칙이 더 추가된 것뿐입니다.

  • TCP 연결은 신뢰할 수 있는 인터넷 연결입니다.

  • 데이터를 정확하고 신속하게 전달하기 위해, 여러분은 TCP의 기초를 알아야 합니다.

TCP gives HTTP a reliable bit pipe. Bytes stuffed in one side of a TCP connection come out the other side correctly, and in the right order (see Figure 4-2).

  • TCP는 HTTP에게 신뢰할 수 있는 비트 파이프를 제공합니다.

  • TCP 연결의 한 쪽에서 채워진 바이트들은 올바른 순서대로 정확히 반대쪽으로 빠져 나옵니다. (Figure 4-2)


🧡 요약 정리 🧡

TCP Connections

  • 패킷 교환 네트워크 프로토콜 레이어 집합
  • TCP 연결을 통해 전달되는 HTTP 메시지는 유실, 고장 X
  • 신뢰할 수 있는 연결 : 전송의 순서가 뒤바뀌지 않는다

HTTP over TCP

    1. 브라우저가 DNS를 통해 변환한 IP 주소와 Port 번호 획득
    1. 해당 IP 주소와 Port로의 TCP 연결 설정
    1. 브라우저와 서버간의 메시지 교환
    1. 브라우저의 연결 종료

💛 감상 💛

  • TCP는 개인적으로 네트워크 수업에서 재미있게 들었던 내용이라 이번 챕터가 상당히 기대된다. 어려우면서도 방대한 내용을 포함하고 있는 TCP지만 차근차근 공부하다 보면 흥미로운 부분들이 많다. 처음 배웠을 때 이해가 잘 되지 않았던 요소도 이번 기회에 확실하게 짚고 넘어가면 좋을 것 같다. 원서는 이해하기 어렵지만 잘만 활용하면 한국말로 표현하기 어려운 내용도 쉽게 받아들일 수 있으니, 배경지식을 활용해서 최대한 100% 이해해보겠다.

  • 개강을 했다... 예상대로 강의 중간중간에 틈틈이 글을 쓰기가 참 쉽지 않다. 그래도 이왕 하기로 한 거 끝장은 봐야 하니까 매일 신경써서 글을 올리려고 노력할 것이다.

profile
맑은 눈의 다람쥐

0개의 댓글

관련 채용 정보