# 웹 브라우저 요청 흐름(면접 질문 가능성有)

![URL](https://3778596469-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MdjOVfCTIpivzhg1Bzh%2F-MdjrZho9rgnWpqasVDT%2F-Mdjshu1Jv6keuiPRDp5%2FScreen%20Shot%202021-07-04%20at%201.59.07%20PM.png?alt=media\&token=2c2d932d-c3de-4747-b4be-868078bc1310)

1. www.google.com DNS 조회\
   HTTPS PORT(443) 생략
2. 웹브라우저에서 HTTP 요청 메시지 생성
3. HTTP 메시지 전송\
   SOCKET 라이브러리를 통해 전달\
   1\. TCP/IP 연결(IP,PORT) : 3 way handshake\
   2\. 데이터 전달\
   3\. HTTP 메시지 포함해서 TCP/IP 패킷 생성
4. 클라이언트(웹 브라우저) : 요청 패킷 전달
5. 서버(구글 서버) : 요청 패킷 도착
6. 서버(구글 서버) : 응답 패킷 전달
7. 클라이언트(웹 브라우저) : 응답 패킷 도착, 웹 브라우저에서 HTML 렌더링

![HTTP 요청 메시지](https://3778596469-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MdjOVfCTIpivzhg1Bzh%2F-Mdjt7rgGwX5TFbeFtQO%2F-MdjtIrP0yUmBzJTrqRU%2FScreen%20Shot%202021-07-04%20at%202.01.45%20PM.png?alt=media\&token=1948f010-af2d-4384-b6c3-296288c5a68d)

![HTTP 메시지 전송](https://3778596469-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MdjOVfCTIpivzhg1Bzh%2F-Mdjt7rgGwX5TFbeFtQO%2F-MdjtWD_yAVYHcFkwcpr%2FScreen%20Shot%202021-07-04%20at%202.02.44%20PM.png?alt=media\&token=dbd18e15-b8d1-4019-9acd-a7eca7d2a6e3)

![HTTP 응답 메시지](https://3778596469-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MdjOVfCTIpivzhg1Bzh%2F-Mdjuf46FceWO0h_Iivf%2F-MdjupIOI9kA_0RjMb1Y%2FScreen%20Shot%202021-07-04%20at%202.08.34%20PM.png?alt=media\&token=223c37a2-6fee-4b25-9efe-1d0fe7130884)
