1 / 26

Chapter 27 HTTP 와 WWW

Chapter 27 HTTP 와 WWW. 인터넷 프로토콜. 서버에서 생성되어 저장된 고정 내용의 문서이다 . 클라이언트는 오직 문서의 복사본 만을 얻는다. 웹 문서 : 정적인 문서. 브라우저가 서버에 문서를 요청할 때 서버의 프로그램에 의해서 문서가 생성된다 . 예 , date 요청 CGI(Common Gateway Interface) 스크립트에 의한 문서 생성 문서의 고정 부분을 담은 파일은 HTML 로 생성하고 변화하는 부분은 서버에서 수행하는 스크립트를 삽입한다 .

jade-nunez
Download Presentation

Chapter 27 HTTP 와 WWW

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 27 HTTP와 WWW

  2. 인터넷 프로토콜

  3. 서버에서 생성되어 저장된 고정 내용의 문서이다. 클라이언트는 오직 문서의 복사본 만을 얻는다. 웹 문서: 정적인 문서

  4. 브라우저가 서버에 문서를 요청할 때 서버의 프로그램에 의해서 문서가 생성된다. 예, date 요청 CGI(Common Gateway Interface) 스크립트에 의한 문서 생성 문서의 고정 부분을 담은 파일은 HTML로 생성하고 변화하는 부분은 서버에서 수행하는 스크립트를 삽입한다. Hypertext Preprosessor(PHP): Perl 언어 사용 Java Server Pages(JSP): Java 사용 Active Server Pages(ASP): Visual Basic 사용 웹 문서: 동적인 문서

  5. 웹 문서: 액티브 문서 • 클라이언트에서 실행되는 응용 프로그램 • 예, 클라이언트의 화면에서 움직이는 그림 • 자바 애플릿 • 자바스크립트(JavaScript)

  6. HTTP(Hypertext Transfer Protocol) • HTTP는 브라우저와 서버 간에 정보를 주고 받는 메시지의 형태와 절차를 규정한 프로토콜이다. • HTTP는 두 가지 메시지가 정의되어 있다. • TCP 포트번호 80을 사용한다.

  7. Request와 Response messages

  8. Request와 Status lines

  9. Request type: Method

  10. Status code

  11. Head format

  12. Request Headers

  13. Response Headers

  14. Entity Headers

  15. 예1

  16. 예2

  17. HTTP 연결은 “stateless” 서버는 클라이언트의 과거 요청의 상태에 대해서 어떤 기록도 하지 않는다. 따라서 HTTP에 대한 TCP 연결은 클라이언트와 서버 간에 한 번의 요청과 응답이 발생하면 TCP 연결은 해제된다. HTTP 연결

  18. Nonpersistent HTTP 한 개의 개체(object) 전송이 종료되면 TCP 연결도 종료된다. 따라서 다음 번 전송을 위해서 다시 TCP 연결을 설정해야 한다. HTTP/1.0은 nonpersistent HTTP Persistent HTTP 한 번의 TCP 연결을 통해서 여러 개의 개체를 전송할 수 있다. HTTP/1.1은 디폴트 모드로서 persistent connection 사용 HTTP 연결의 종류

  19. 클라이언트가 다음의 URL로 요청 www.someSchool.edu/someDepartment/home.index 1a. HTTP client initiates TCP connection to HTTP server (process) at www.someSchool.edu on port 80 Nonpersistent HTTP의 예(1) (html text에는 10개 jpeg 그림에 대한 링크가 포함) 1b. HTTP server at host www.someSchool.edu waiting for TCP connection at port 80. “accepts” connection, notifying client 2. HTTP client sends HTTP request message (containing URL) into TCP connection socket. Message indicates that client wants object someDepartment/home.index 3. HTTP server receives request message, forms response message containing requested object, and sends message into its socket time

  20. 5. HTTP client receives response message containing html file, displays html. Parsing html file, finds 10 referenced jpeg objects Nonpersistent HTTP의 예(2) 4. HTTP server closes TCP connection. time 6.Steps 1-5 repeated for each of 10 jpeg objects

  21. 4가지 요소: 1) HTTP response message의 cookie 헤더 라인 2) HTTP request message의 cookie 헤더 라인 3) 브라우저에 보관 되는 cookie file 4) 웹 서버에 cookie 정보를 보관하는 database 예: Susan 동일한 PC로 접속한다. 그는 전자 상거래 사이트에 처음으로 접속한다. 처음 HTTP request가 이 사이트에 도착하면, 사이트는 이 접속자에 대한 고유의 ID를 만들어 database에 보관한다. User-server state: cookies

  22. client server usual http request msg usual http response + Set-cookie: 1678 Cookie file Cookie file Cookie file amazon: 1678 ebay: 8734 ebay: 8734 amazon: 1678 ebay: 8734 cookie- specific action usual http request msg cookie: 1678 usual http request msg cookie: 1678 usual http response msg usual http response msg cookie- spectific action Cookies: 접속자의 상태 보관 server creates ID 1678 for user entry in backend database access access one week later:

  23. cookies 사용 이점: 인증 쇼핑 카트 사용자에 대한 추천 사용자 세션 상태 (Web e-mail) Cookies Cookies의 문제점: • 웹 서버에서는 사용자에 대한 정보를 획득할 수 있다.

  24. Web caches (proxy server) 목표: origin server가 직접 처리하지않고 클라이언트의 reuqest를 처리하도록 한다. origin server Proxy server HTTP request HTTP request client HTTP response HTTP response HTTP request HTTP response client origin server

  25. Cache는 client와 server에서 모두 동작 일반적으로 cache는 ISP에 설치됨 (university, company, residential ISP) 왜 Web caching? client request에 대한 응답 시간을 단축 access link의 트래픽 양을 감소시킴 Web caching

  26. Caching example origin servers public Internet 1.5 Mbps access link institutional network 10 Mbps LAN institutional cache

More Related