1 / 51

컴퓨터 네트워크 chapter 07 응용계층 임효택

컴퓨터 네트워크 chapter 07 응용계층 임효택. OSI 참조 모델 응용. 7.1.1 세션 계층 세션 계층의 개관 OSI 참조 모델 5 계층에 해당 전송 제어 기능을 상위 계층에 제공 서비스 측면의 기능들을 제공하는 데 목적이 있다 . 제공 서비스 기본적으로 연결형 서비스를 제공한다 . 전송되는 데이터의 순서는 중요한 의미를 가진다 . 지원되는 서비스의 종류가 많다 . 기능단위와 사용자가 필요한 기능단위를 선택하여 사용할 수 있다. 세션 계층. 연결형 서비스 과정

rumer
Télécharger la présentation

컴퓨터 네트워크 chapter 07 응용계층 임효택

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. PART 02 프로토콜 컴퓨터 네트워크 chapter 07 응용계층 임효택

  2. PART 02 프로토콜 OSI 참조 모델 응용 7.1.1 세션 계층 • 세션 계층의 개관 • OSI 참조 모델 5계층에 해당 • 전송 제어 기능을 상위 계층에 제공 • 서비스 측면의 기능들을 제공하는 데 목적이 있다. • 제공 서비스 • 기본적으로 연결형 서비스를 제공한다. • 전송되는 데이터의 순서는 중요한 의미를 가진다. • 지원되는 서비스의 종류가 많다. • 기능단위와 사용자가 필요한 기능단위를 선택하여 사용할 수 있다.

  3. PART 02 프로토콜 세션 계층 • 연결형 서비스 과정 • 연결 설정 단계, 데이터 전송 단계, 연결 해제 단계로 나눈다. • 세션 연결의 특성 • (a) 트랜스포트와 세션 연결이 일대 일로 대응한다. (가장 일반적) • (b) 다시 새로운 세션 연결을 시작할 때 트랜스포트 연결을 그대로 사용 할수 있다. • (c) 하나의 세션 연결에 대하여 트랜스포트 연결이 중간에 해제되었다가 다시 연결되어 사용된다.

  4. PART 02 프로토콜 세션 계층 • 대화 관리(Dialogue management) [그림 7.2] 세션 계층의 데이터 전송 방식

  5. PART 02 프로토콜 세션 계층 • 동기(Synchronization) • 두 세션 사용자 간의 데이터를 교환하다가 문제가 발생하였을때 미리 정해 놓은 동기점으로 되돌아가 다시 시작하도록 하는 것. • 대동기점 ,소동기점 [그림 7.3] 세션 계층에서의 동기점 [그림 7.4] 대동기점과 소동기점

  6. PART 02 프로토콜 세션 계층 • 액티비티(Activity) • 세션 사용자 간에 어떤 일의 논리적인 단위를 표시하기 위한 것. • 독립적인 특성을 가지며 영향을 받지 않는다. [그림 7.5] 세션 계층 액티비티와 동기점

  7. PART 02 프로토콜 세션 계층 • 토큰 (Token) • 어떠한 서비스를 수행할 수 있는 권리를 나타내는 것 • 데이터토큰, 해제 토큰, 소동기 토큰, 대동기/액티비티 토큰 • 서비스 프리미티브와 SPDU • 서비스 프리미티브는 ISO 8326 또는 X.215에 정의됨. • SPDU는 ISO8327, X.255에 정의 됨. • 에러검출 및 복구의 기능이 없다. [그림 7.6]세션 계층에서 SPDU의 교환 예(연결 설정)

  8. PART 02 프로토콜 7.1.2 OSI 응용계층 • 응용 서비스 요소 • 응용 프로그램이 필요로 하는 최소의 단위를 응용 서비스 요소라 한다. • 엔티티 : 특정한 하나의 응용 프로그램에 필요한 통신 서비스 요소들의 결합형태 [그림 7.8] 응용 엔티티 구조

  9. PART 02 프로토콜 OSI 응용계층 • SASE • FTAM (file access & management) • VT (virtual terminal) • MOTIS (message oriented text interchange system) • JTM (job transfer & manipulation) • RDA (remote database access) • 트랜젝션 처리 • OSI 관리 • CASE • ACSE (association control service element) • CCR (commitment concurrency & recovery) • ROS (remote operation service)

  10. PART 02 프로토콜 chapter 04 응용계층 • 메시지 처리 시스템(MHS) 서비스 • 대표적인 예 : 전자우편 • 파일 전송, 접근과 관리(FTAM) • 디렉토리 서비스 • 각 자원의 위치에 관계하는 명칭을 알고 필요한 어드레스를 요구하는 기능 • 가상 터미널 서비스 • 가상 터미널이 응용 프로그램 또는 터미널 이용자에게 제공하는 서비스 • OSI 관리 • 기타

  11. PART 02 프로토콜 Transport service requirements of common apps Time Sensitive no no no yes, 100’s msec yes, few secs yes, 100’s msec yes and no Application file transfer e-mail Web documents real-time audio/video stored audio/video interactive games financial apps Data loss no loss no loss loss-tolerant loss-tolerant loss-tolerant loss-tolerant no loss Bandwidth elastic elastic elastic audio: 5Kb-1Mb video:10Kb-5Mb same as above few Kbps up elastic

  12. PART 02 프로토콜 Internet 응용 프로토콜과 트랜스포트 프로토콜 Application layer protocol smtp [RFC 821] telnet [RFC 854] http [RFC 2068] ftp [RFC 959] proprietary (e.g. RealNetworks) NSF proprietary (e.g., Vocaltec) 하부의 transport protocol TCP TCP TCP TCP TCP or UDP TCP or UDP typically UDP Application e-mail remote terminal access Web file transfer streaming multimedia remote file server Internet telephony

  13. Web page: consists of “objects” addressed by a URL Web 페이지의 구성: base HTML page, and several referenced objects. URL 의 두가지 구성요소 : host name and path name: User agent for Web is called a browser: MS Internet Explorer Netscape Communicator Server for Web is called Web server: Apache (public domain) MS Internet Information Server PART 02 프로토콜 7.2 TCP/IP 응용 - Web www.someSchool.edu/someDept/pic.gif

  14. HTTP: HyperText Transfer Protocol Web의 응용계층 프로토콜 client/server model client:웹 객체를 요구하고, 받고, 디스플에이하는 브라우져 server:요구에 대한 응답으로 객체를 보내는 웹 서버 http1.0: RFC 1945 http1.1: RFC 2068 PART 02 프로토콜 HTTP http request Web client http response http request Web Server http response Web client

  15. http: TCP transport service: 클라이언트는 포트번호 80을 가진 서버로 TCP 연결을 시도 서버는 클라이언트의 TCP 연결을 받음 http 메시지가 (application-layer protocol messages) browser (http client) 와 Web server (http server) 사이에 교환 TCP 연결이 해제 http is “stateless” 서버는 과거의 클라이언트 요청에 관한 정보를 유지하지 않음 PART 02 프로토콜 HTTP 참고 “state”를 유지하는 프로토콜은 복잡하다! • 과거 기록이나 상태가 유지되어야 함 • Server 또는 client가 고장이 나면, “state” 정보가 일관적이지 못할수도 있으며 다시 협의가 이루어져야 함

  16. 사용자가 URL www.someSchool.edu/someDepartment/home.index 을 친다고 가정 1a.HTTP 클라이언트는 HTTP의 기본 포트 번호인 번호 80을 통해 www. someSchool.edu 서버로 TCP 연결을 시도 PART 02 프로토콜 Nonpersistent Connection (home.index는 text와 10개의 jpeg image에 대한 링크를 가짐) 1b.http server는 port 80 번을 통해 요청을 “accepts” 하고 클라이언트에게 응답 2.HTTP 클라이언트는 1단계에서 설정된 TCP 연결의 소켓을 통해 서버에게 HTTP 요청 메시지를 보냄 3.HTTP 서버는 1단계에서 설정된 연결의 소켓을 통하여 요청 메시지를 받음. 저장 장치로부터/someDepartment/home.index 객체를 추출. HTTP 응답 메시지에 그 객체를 캡슐화. 응답 메시지를 소켓을 통해 클라이언트에게 보냄 time

  17. 5.HTTP 클라이언트는 응답 메시지를 받음. 클라이언트는 응답 메시지로부터 파일을 추출. HTML 파일을 파싱하고, 10개의 JPEG 객체에 대한 링크를 찾음 PART 02 프로토콜 Nonpersistent Connection 4.TTP 서버는 TCP에게 TCP 연결을 해제 6.그 이후에 참조되는 각 JPEG 객체에 대하여 위의 다섯 단계를 반복 time

  18. PART 02 프로토콜 initiate TCP connection RTT request file time to transmit file RTT file received time time Non-Persistent HTTP: 응답시간 RTT 정의:클라이언트가 패킷을 보내어 서버에서 다시 되돌아오는데 걸리는 시간 응답시간: • TCP 연결을 위해 1 RTT • HTTP 요청에 대한 결과를 받기 위해 1 • 화일전송시간(transmission time) total = 2RTT+transmit time

  19. Nonpersistent HTTP : 객체당 2 RTT가 필요 각 TCP 연결에 대한 OS에 대한 부하 클라이언트는 링크된 객체를 가져오기 위해 자주 여러 개의 TCP 연결을 맺음 Persistent HTTP 서버는 HTTP 응답을 보낸 후 TCP 연결을 그대로 유지 이후의 HTTP 메시지는 이전의 TCP 연결을 통해 주고 받음 Persistent without pipelining: 클라이언트는 이전의 요청에 대한 응답을 받은 후에 새로운 요청을 하게 됨 각 객체에 대하여 1 RTT 필요 Persistent with pipelining: HTTP/1.1에서기본으로 사용 클라이언트는 링크된 객체를 인식하게 되면 여러 개의 요청을 동시에 보냄 모든 링크된 객체에 대하여 약 1 RTT 필요 PART 02 프로토콜 Persistent HTTP

  20. PART 02 프로토콜 http 메시지 형식: request(요청) • http message의 두가지 타입: request, response • http request message: • ASCII (human-readable format) request line (GET, POST, HEAD commands) GET /somedir/page.html HTTP/1.0 User-agent: Mozilla/4.0 Accept: text/html, image/gif,image/jpeg Accept-language:fr (extra carriage return, line feed) header lines Carriage return, line feed (메시지의 끝을 나타냄)

  21. PART 02 프로토콜 http request message의 일반적인 형식

  22. PART 02 프로토콜 http 메시지 형식: response(응답) status line (프로토콜 상태라인) HTTP/1.0 200 OK Date: Thu, 06 Aug 1998 12:00:15 GMT Server: Apache/1.3.0 (Unix) Last-Modified: Mon, 22 Jun 1998 …... Content-Length: 6821 Content-Type: text/html data data data data data ... header lines data, e.g., requested html file

  23. 200 OK request succeeded, requested object later in this message 301 Moved Permanently requested object moved, new location specified later in this message (Location:) 400 Bad Request request message not understood by server 404 Not Found requested document not found on this server 505 HTTP Version Not Supported PART 02 프로토콜 http response 상태코드 응답 메시지 첫번째 라인의 상태코드

  24. 1. 어느 웹서버로 Telnet 명령어 실행: PART 02 프로토콜 HTTP 실행해 보기 80번 포트로 TCP connection을 설정 (입력되는 데이터는 해당 서버의 80번 포트로 전송됨 telnet kowon.dongseo.ac.kr 80 2. GET http request 입력: 왼쪽 내용을 입력하고 Enter키 두번 치게 되면, GET 요청 메시지가 http 서버에 전송 GET /~htlim/ HTTP/1.1 Host: kowon.dongseo.ac.kr 3. 클라이언트는 http 서버가 보낸 응답 메시지를 보게됨

  25. Telnet으로 해보기 Wireshark Protocol Anayzer 로분석하기 PART 02 프로토콜 HTTP 실행해 보기

  26. PART 02 프로토콜 Web Caches (proxy server) 웹 캐슁은 왜 하나? • 클라이언트 요청에 대한 응답시간 절감 • 기관(institution) access link의 트래픽을 절감 origin server Proxy server 웹 캐슁 개요 http request http request client • 사용자는 브라우저에 웹 캐슁 기능을 설정 • 브라우저는 모든 HTTP 요청이 캐쉬로 전달됨 • 원하는 객체는 캐쉬에 있으면캐쉬는 그 객체를 리턴 • 그렇지 않으면 캐쉬는 원래의 서버에게 객체에 대한 요청을 보내고, 객체를 받으면 클라이언트에게 보냄 http response http response http request http request http response http response client origin server

  27. 가정:캐쉬는 클라이언트 와 같은 네트워크 에 위치 원하는 객체가 캐쉬에 있으면 응답시간이 작아짐 원격 서버로의 트래픽이 절감 PART 02 프로토콜 Web Caches (proxy server) origin servers public Internet 1.5 Mbps access link 학과 네트워크 10 Mbps LAN 학과 캐쉬

  28. 가정 평균 객체 크기= 100,000 bits 학과 브라우저에서 원격서버로의 평균 요청률 = 15/sec 학과 라우터에서 원격 서버간의 왕복 지연시간 = 2 sec 결과 LAN utilization(이용률) = 15% access link utilization = 100% 총 지연시간= Internet delay + access link delay + LAN delay = 2 sec + minutes + milliseconds PART 02 프로토콜 웹 캐슁의 분석 origin servers public Internet 1.5 Mbps access link 학과 네트워크 10 Mbps LAN

  29. 해결방안 1 access link의대역폭을 증가(예: 10 Mbps) 결과 LAN utilization(이용률) = 15% access link utilization = 15% 총 지연시간= Internet delay + access link delay + LAN delay = 2 sec + msecs + msecs 문제점 access link의대역폭을 증가로 인한 비용 증가 PART 02 프로토콜 웹 캐슁의 분석 origin servers public Internet 10 Mbps access link 학과 네트워크 10 Mbps LAN

  30. 해결방안 2 웹 캐쉬 설치 가정: hit rate is .4 결과 40% 객체 요청이 캐쉬에서 바로 해결 60% 객체 요청은 원격의 서버에서 해결 access link utilization은 60%로 감소, 결과적으로 무시할만한 지연시간(가령 10 msec) 총 평균 지연시간 = Internet delay + access link delay + LAN delay = .6*(2.01) secs + .4*milliseconds < 1.4 secs PART 02 프로토콜 웹 캐슁의 분석 origin servers public Internet 1.5 Mbps access link 학과 네트워크 10 Mbps LAN 학과 캐쉬

  31. transfer file to/from remote host client/server model client: side that initiates transfer (either to/from remote) server: remote host ftp: RFC 959 ftp server: port 21 PART 02 프로토콜 FTP user interface FTP client FTP server local file system FTP(File Transfer Protocol) file transfer 사용자 remote file system

  32. ftp client 는 ftp server의 TCPport 번호 21에 연결시도 두개의 TCP connection 설정: Control Connection: 클라이언트와 서버간의 명령어와 응답 메시지 교환 “out of band control” Data Connection: 클라이언트와 서버간의 파일 데이터 교환 PART 02 프로토콜 TCP control connection port 21 TCP data connection port 20 FTP client FTP server FTP: Control, Data TCP connection

  33. 명령어(command) 예: control connection 상에서 ASCII text 형태로 클라이언트에서 서버로 전송 USER username PASS password LIST: 현재 디렉토리내의 화일목록 표시 RETR filename: 파일 가져오기 STOR filename: 파일 보내기 응답 코드 예 상태코드와 설명(HTTP와 유사) 331 Username OK, password required 125 data connection already open; transfer starting 425 Can’t open data connection 452 Error writing file PART 02 프로토콜 ftp commands, responses

  34. TCP Connection Establishment PART 02 프로토콜

  35. PART 02 프로토콜 Ethereal Captured Screen For FTP

  36. The Flow of the Captured Packets-Control connection PART 02 프로토콜 • Works Done here • Send username seongyee • Response with 331 (PasswordRequired) • Send password password • Response with 230 (Successful Login) • Change Directory with CWD • Response with 250 (CWD command successed) • List Current Directory with PWD • Response with 257 (List Current Directory) • Set the data type to I • Response with 200 (Type Set to I) • Set to Passive Mode • Response with 277(Entering Passive Mode) • Download Chap2.ppt by sending STOR Command • Response with 125(Data Connection Opened) • Response with 226(Transfer complete) Data Connection Explain Next Slide

  37. Packet Capture For Data Connection PART 02 프로토콜 Another TCP connection where 192.168.112.94:3287 to 203.241.187.71:1163 Established For data connection

  38. PART 02 프로토콜 chapter 04 응용계층 E-mail(전자메일) • 컴퓨터 사용자가 동일한 컴퓨터 또는 네트워크에 연결된 다른 컴퓨터 사용자와 보통의 메일 서비스를 전산망 상에서 온라인으로 사용할 수 있는 서비스. • TCP/IP는 전자메일을 주고받기 위한 SMTP를 정의한다. • [그림 7.14]은 TCP/IP를 사용한 전자메일의 전체적인 구성도를 보여준다. [그림 7.14] 인터넷 전자메일의 구성

  39. 세가지 주요 구성요소: 사용자 에이젼트(user agent ) 메일 서버(mail server ) SMTP(simple mail transfer protocol) User Agent “mail reader” 메일 메시지를 작성, 편집, 읽는 기능포함 예: Eudora, Outlook, elm, Netscape Messenger 송신/수신되는 메시지는 서버에 저장 PART 02 프로토콜 user agent user agent user agent user agent user agent user agent SMTP SMTP SMTP mail server mail server mail server outgoing message queue user mailbox 전자 메일

  40. Mail Servers Mailbox: 수신 메시지를 포함(아직 읽혀지지 않은 메일) message queue: 송신하게 될 mail message 포함 smtp protocol : 서버간의 메일 전송 프로토콜 client: 송신측 mail server server: 수신측 mail server PART 02 프로토콜 user agent user agent user agent user agent user agent user agent SMTP SMTP SMTP mail server mail server mail server Electronic Mail: mail servers

  41. PART 02 프로토콜 SMTP • SMTP 동작 • SMTP 동작의 세 가지 단계 • SMTP 클라이언트와 서버 간의 연결이 확립된다. • 전자메일이 연결을 따라 전송된다. • 연결이 해제된다. • SMTP Command , Reply

  42. PART 02 프로토콜 SMTP 동작예 S: 220 hamburger.edu C: HELO crepes.fr S: 250 Hello crepes.fr, pleased to meet you C: MAIL FROM: <alice@crepes.fr> S: 250 alice@crepes.fr... Sender ok C: RCPT TO: <bob@hamburger.edu> S: 250 bob@hamburger.edu ... Recipient ok C: DATA S: 354 Enter mail, end with "." on a line by itself C: Do you like ketchup? C: How about pickles? C: . S: 250 Message accepted for delivery C: QUIT S: 221 hamburger.edu closing connection

  43. PART 02 프로토콜 SMTP 동작 이해하기 • telnet servername 25 • 서버로부터 220 reply 을 받음 • HELO, MAIL FROM, RCPT TO, DATA, QUIT 명령어 입력 - 위 절차로 email agent 사용하지 않고 email을 전송할 수 있다

  44. SMTP의 Ethereal 스크린 캡쳐 PART 02 프로토콜

  45. SMTP 동작 흐름 PART 02 프로토콜 • Steps • Open TCP connection to port 25 of the server • Server Response with code 220 (Service Ready) • Client send command EHLO (Client authentication) • Server Response with code 250 (OK) • Client send command AUTH PLAIN • Server Response with code 235 (Authentication successes) • Sender send command MAIL ( Enter sender name) • Server Response with code 250 (OK) • Sender send command RCPT TO ( Enter recipient name) • Server Response with code 250 (OK) • Sender send command DATA (Beginning Transmission) • Server Response with code 354 (Start Email Input) • Sender send command Message Body (The body of the msg) • Server Response with code 250 (OK) • TCP Connection Closed

  46. Mail access protocol: 메일 서버로부터 이메일 가져오는 프로토콜 POP: Post Office Protocol [RFC 1939] authorization (agent <-->server) and download IMAP: Internet Mail Access Protocol [RFC 1730] more features (more complex) manipulation of stored msgs on server HTTP: Hotmail , Yahoo! Mail, etc. PART 02 프로토콜 user agent user agent sender’s mail server SMTP Mail access protocols SMTP POP3 or IMAP receiver’s mail server

  47. 인증단계 client commands: user: declare username pass: password server responses +OK -ERR 처리단계, client: list: list message numbers retr: retrieve message by number dele: delete quit PART 02 프로토콜 S: +OK POP3 server ready C: user alice S: +OK C: pass hungry S: +OK user successfully logged on POP3 protocol C: list S: 1 498 S: 2 912 S: . C: retr 1 S: <message 1 contents> S: . C: dele 1 C: retr 2 S: <message 1 contents> S: . C: dele 2 C: quit S: +OK POP3 server signing off

  48. PART 02 프로토콜 7.2.4 DNS • DNS (Domain Name System) • 많은 도메인 네임 서버가 계층적으로 구성된 분산 데이터베이스 • IP주소는 사람이 기억하기에 어려워 기억하기 쉽게 바꾸어 놓은 것이 도메인 이름이다. • Domain Name을 IP 주소로 또는 그 반대로 바꿔 주는 것을 DNS(Domain Name System)이라 한다. • 도메인 네임 • 도메인 네임의 구조 : 호스트 이름. 소속단체. 단체성격. 소속국가

  49. PART 02 프로토콜 Root DNS Servers org DNS servers edu DNS servers com DNS servers poly.edu DNS servers umass.edu DNS servers pbs.org DNS servers yahoo.com DNS servers amazon.com DNS servers 분산, 계층화된 데이타베이스 클라이언트가 www.amazon.com에 대한 IP주소를 알고자 할때; • 클라이언트는 com DNS서버를 알기위해 루트서버에게 질의 • 클라이언트는 amazon.com DNS서버를 알기위해 com DNS 서버에게 질의 • 클라이언트는 www.amazon.com 의 IP주소를 알기위해 amazon.com DNS 서버에게 질의

  50. PART 01 개념 한국의 도메인 네임 계층구조

More Related