62
PART 02 프프프프 1 프프프 프프프프 PART 02 프프프프 (chapter 04 프프프프 ) 프프프 E-mail : [email protected] Home page : http://kowon.dongseo.ac.kr/~htlim

PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : [email protected]@dongseo.ac.kr Home page : htlim

Embed Size (px)

Citation preview

Page 1: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

1

컴퓨터 네트워크

PART 02 프로토콜(chapter 04 응용계층 )

임효택

E-mail : [email protected] page : http://kowon.dongseo.ac.kr/~htlim

Page 2: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

2

chapter 04 응용계층

OSI 참조 모델 응용4.1.1 세션 , 표현 계층

세션 계층의 개관

OSI 참조 모델 5 계층에 해당 전송 제어 기능을 상위 계층에 제공 서비스 측면의 기능들을 제공하는 데 목적이 있다 .

제공 서비스

기본적으로 연결형 서비스를 제공한다 . 전송되는 데이터의 순서는 중요한 의미를 가진다 . 지원되는 서비스의 종류가 많다 . 기능단위와 사용자가 필요한 기능단위를 선택하여 사용할 수 있다 .

Page 3: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

3

chapter 04 응용계층

연결형 서비스 과정– 연결 설정 단계 , 데이터 전송 단계 , 연결 해제 단계로 나눈다 .

세션 연결의 특성

– (a) 트랜스포트와 세션 연결이 일대 일로 대응한다 . ( 가장 일반적 )

– (b) 다시 새로운 세션 연결을 시작할 때 트랜스포트 연결을 그대로 사용 할수 있다 .

– (c) 하나의 세션 연결에 대하여 트랜스포트 연결이 중간에 해제되었다가 다시 연결되어 사용된다 .

Page 4: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

4

chapter 04 응용계층

대화 관리 (Dialogue management)

[ 그림 4.2] 세션 계층의 데이터 전송 방식

Page 5: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

5

chapter 04 응용계층

동기 (Synchronization)

– 두 세션 사용자 간의 데이터를 교환하다가 문제가 발생하였을때 미리 정해 놓은 동기점으로 되돌아가 다시 시작하도록 하는 것 .

– 대동기점 , 소동기점

[ 그림 4.3] 세션 계층에서의 동기점

[ 그림 4.4] 대동기점과 소동기점

Page 6: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

6

chapter 04 응용계층

액티비티 (Activity)

– 세션 사용자 간에 어떤 일의 논리적인 단위를 표시하기 위한 것 .– 독립적인 특성을 가지며 영향을 받지 않는다 .

[ 그림 4.5] 세션 계층 액티비티와 동기점

Page 7: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

7

chapter 04 응용계층

토큰 (Token)

– 어떠한 서비스를 수행할 수 있는 권리를 나타내는 것» 데이터토큰 , 해제 토큰 , 소동기 토큰 , 대동기 / 액티비티

토큰

서비스 프리미티브와 SPDU

서비스 프리미티브는 ISO 8326 또는 X.215 에 정의됨 . SPDU 는 ISO8327, X.255 에 정의 됨 . 에러검출 및 복구의 기능이 없다 .

[ 그림 4.6] 세션 계층에서 SPDU 의 교환 예 ( 연결 설정 )

Page 8: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

8

chapter 04 응용계층

4.1.2 응용계층

응용 서비스 요소

응용 프로그램이 필요로 하는 최소의 단위를 응용 서비스 요소라 한다 . 엔티티 : 특정한 하나의 응용 프로그램에 필요한 통신 서비스 요소들의

결합형태

[ 그림 4.8] 응용 엔티티 구조

Page 9: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

9

chapter 04 응용계층

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)

Page 10: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

10

chapter 04 응용계층

메시지 처리 시스템 (MHS) 서비스

대표적인 예 : 전자우편

파일 전송 , 접근과 관리 (FTAM)

디렉토리 서비스

각 자원의 위치에 관계하는 명칭을 알고 필요한 어드레스를 요구하는 기능

가상 터미널 서비스

가상 터미널이 응용 프로그램 또는 터미널 이용자에게 제공하는 서비스

OSI 관리

기타

Page 11: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

11

Application 이 필요한 트랜스포트 서비스는 ?

Data loss some apps (e.g., audio) can

tolerate some loss other apps (e.g., file transfer,

telnet) require 100% reliable data transfer Timing

some apps (e.g., Internet telephony, interactive games) require low delay to be “effective”

Bandwidth some apps (e.g., multimedia)

require minimum amount of bandwidth to be “effective”

other apps (“elastic apps”) make use of whatever bandwidth they get

Page 12: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

12

Transport service requirements of common apps

Application

file transfere-mail

Web documentsreal-time audio/video

stored audio/videointeractive games

financial apps

Data loss

no lossno lossloss-tolerantloss-tolerant

loss-tolerantloss-tolerantno loss

Bandwidth

elasticelasticelasticaudio: 5Kb-1Mbvideo:10Kb-5Mbsame as above few Kbps upelastic

Time Sensitive

nononoyes, 100’s msec

yes, few secsyes, 100’s msecyes and no

Page 13: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

13

Internet 응용 프로토콜과 트랜스포트 프로토콜

Application

e-mailremote terminal access

Web file transfer

streaming multimedia

remote file serverInternet telephony

Applicationlayer protocol

smtp [RFC 821]telnet [RFC 854]http [RFC 2068]ftp [RFC 959]proprietary(e.g. RealNetworks)NSFproprietary(e.g., Vocaltec)

Underlyingtransport protocol

TCPTCPTCPTCPTCP or UDP

TCP or UDPtypically UDP

Page 14: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

14

Web 상식

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

www.someSchool.edu/someDept/pic.gif

Page 15: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

15

The Web: the http protocol

http: hypertext transfer protocol

Web’s application layer protocol client/server model

client: browser that requests, receives, “displays” Web objects

server: Web server sends objects in response to requests

http1.0: RFC 1945 http1.1: RFC 2068

PC runningExplorer

Server running

NCSA Webserver

Mac runningNavigator

http request

http re

quest

http response

http re

sponse

Page 16: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

16

The http protocol: more

http: TCP transport service: client initiates TCP connection

(creates socket) to server, port 80

server accepts TCP connection from client

http messages (application-layer protocol messages) exchanged between browser (http client) and Web server (http server)

TCP connection closed

http is “stateless” server maintains no

information about past client requests

Protocols that maintain “state” are complex!

past history (state) must be maintained

if server/client crashes, their views of “state” may be inconsistent, must be reconciled

aside

Page 17: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

17

http example

Suppose user enters URL www.someSchool.edu/someDepartment/home.index

1a. http client initiates TCP connection to http server (process) at www.someSchool.edu. Port 80 is default for http server.

2. http client sends http request message (containing URL) into TCP connection socket

1b. http server at host www.someSchool.edu waiting for TCP connection at port 80. “accepts” connection, notifying client

3. http server receives request message, forms response message containing requested object (someDepartment/home.index), sends message into socket

time

(contains text, references to 10

jpeg images)

Page 18: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

18

http example (cont.)

5. http client receives response message containing html file, displays html. Parsing html file, finds 10 referenced jpeg objects

6. Steps 1-5 repeated for each of 10 jpeg objects

4. http server closes TCP connection.

time

Page 19: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

19

Non-persistent and persistent connections

Non-persistent HTTP/1.0 server parses request, respond

s, and closes TCP connection 2 RTTs to fetch each object Each object transfer suffers fro

m slow start

Persistent default for HTTP/1.1 on same TCP connection: serve

r, parses request, responds, parses new request,..

Client sends requests for all referenced objects as soon as it receives base HTML.

Fewer RTTs and less slow start.

But most 1.0 browsers useparallel TCP connections.

Page 20: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

20

Non-Persistent HTTP: Response time

Definition of RTT: time to send a small packet to travel from client to server and back.

Response time: one RTT to initiate TCP

connection one RTT for HTTP request and

first few bytes of HTTP response to return

file transmission timetotal = 2RTT+transmit time

time to transmit file

initiate TCPconnection

RTT

requestfile

RTT

filereceived

time time

Page 21: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

21

Persistent HTTP

Nonpersistent HTTP issues: requires 2 RTTs per object OS overhead for each TCP

connection browsers often open parallel TCP

connections to fetch referenced objects

Persistent HTTP server leaves connection open

after sending response subsequent HTTP messages

between same client/server sent over open connection

Persistent without pipelining: client issues new request only

when previous response has been received

one RTT for each referenced object

Persistent with pipelining: default in HTTP/1.1 client sends requests as soon as

it encounters a referenced object

as little as one RTT for all the referenced objects

Page 22: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

22

http message format: request

two types of http messages: request, response http request message:

ASCII (human-readable format)

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)

request line(GET, POST,

HEAD commands)

header lines

Carriage return, line feed

indicates end of message

Page 23: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

23

http request message: general format

Page 24: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

24

http message format: respone

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 ...

status line(protocol

status codestatus phrase)

header lines

data, e.g., requestedhtml file

Page 25: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

25

http response status codes

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

In first line in server->client response message.A few sample codes:

Page 26: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

26

Trying out http (client side) for yourself

1. Telnet to your favorite Web server:

Opens TCP connection to port 80(default http server port) at www.eurecom.fr.Anything typed in sent to port 80 at www.eurecom.fr

telnet www.eurecom.fr 80

2. Type in a GET http request:

GET /~ross/index.html HTTP/1.0 By typing this in (hit carriagereturn twice), you sendthis minimal (but complete) GET request to http server

3. Look at response message sent by http server!

Page 27: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

27

Web Caches (proxy server)

user sets browser: Web accesses via web cache

client sends all http requests to web cache

if object at web cache, web cache immediately returns object in http response

else requests object from origin server, then returns http response to client

Goal: satisfy client request without involving origin server

client

Proxyserver

client

http request

http re

quest

http response

http re

sponse

http re

quest

http re

sponse

http requesthttp response

origin server

origin server

Page 28: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

28

Why Web Caching?

Assume: cache is “close” to client (e.g., in same network)

smaller response time: cache “closer” to client

decrease traffic to distant servers link out of institutional/local

ISP network often bottleneck

originservers

public Internet

institutionalnetwork 10 Mbps LAN

1.5 Mbps access link

institutionalcache

Page 29: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

29

Web caches (proxy server)

user sets browser: Web accesses via cache

browser sends all HTTP requests to cache

object in cache: cache returns object

else cache requests object from origin server, then returns object to client

Goal: satisfy client request without involving origin server

client

Proxyserver

client

HTTP request

HTTP request

HTTP response

HTTP response

HTTP request

HTTP response

origin server

origin server

Page 30: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

30

More about Web caching

Cache acts as both client and server

Typically cache is installed by ISP (university, company, residential ISP)

Why Web caching? Reduce response time for client

request. Reduce traffic on an

institution’s access link. Internet dense with caches:

enables “poor” content providers to effectively deliver content (but so does P2P file sharing)

Page 31: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

31

Caching example

Assumptions average object size = 100,000 bits avg. request rate from institution’s

browsers to origin servers = 15/sec delay from institutional router to

any origin server and back to router = 2 sec

Consequences utilization on LAN = 15% utilization on access link = 100% total delay = Internet delay + access

delay + LAN delay = 2 sec + minutes + milliseconds

originservers

public Internet

institutionalnetwork 10 Mbps LAN

1.5 Mbps access link

institutionalcache

Page 32: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

32

Caching example (cont)

Possible solution increase bandwidth of access link

to, say, 10 MbpsConsequences utilization on LAN = 15% utilization on access link = 15% Total delay = Internet delay + access

delay + LAN delay = 2 sec + msecs + msecs often a costly upgrade

originservers

public Internet

institutionalnetwork 10 Mbps LAN

10 Mbps access link

institutionalcache

Page 33: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

33

Caching example (cont)

Install cache suppose hit rate is .4Consequence 40% requests will be satisfied

almost immediately 60% requests satisfied by origin

server utilization of access link reduced

to 60%, resulting in negligible delays (say 10 msec)

total avg delay = Internet delay + access delay + LAN delay = .6*(2.01) secs + .4*milliseconds < 1.4 secs

originservers

public Internet

institutionalnetwork 10 Mbps LAN

1.5 Mbps access link

institutionalcache

Page 34: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

34

ftp: the file transfer protocol

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

file transfer FTPserver

FTPuser

interface

FTPclient

local filesystem

remote filesystem

user at host

Page 35: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

35

ftp: separate control, data connections

ftp client contacts ftp server at port 21, specifying TCP as transport protocol

two parallel TCP connections opened: control: exchange commands,

responses between client, server.

“out of band control” data: file data to/from server

ftp server maintains “state”: current directory, earlier authentication

FTPclient

FTPserver

TCP control connection

port 21

TCP data connectionport 20

Page 36: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

36

ftp commands, responses

Sample commands: sent as ASCII text over control

channel USER username PASS password LIST return list of file in current

directory RETR filename retrieves (gets)

file STOR filename stores (puts)

file onto remote host

Sample return codes status code and phrase (as in

http) 331 Username OK, password

required 125 data connection

already open; transfer starting

425 Can’t open data connection

452 Error writing file

Page 37: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

37

TCP Connection Establishment

Page 38: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

38

Control Connection

Control functions (commands) and reply codes are transferred over the control connection.

Example:- Commands Reply Codes

USER 331PASS 230CWD 250PWD 257TYPE I 200PASV 227STOR 125

226

-For more commands and Reply codes -Check on RFC 959

http://www.faqs.org/rfcs/rfc959.html

Page 39: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

39

Ethereal Captured Screen For FTP

Page 40: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

40

The Flow of the Captured Packets-Control connection

Works Done here

1. Send username seongyee2. Response with 331 (PasswordRequired)

3. Send password password4. Response with 230 (Successful Login)

5. Change Directory with CWD 6. Response with 250 (CWD command successed)

7. List Current Directory with PWD8. Response with 257 (List Current Directory)

9. Set the data type to I10. Response with 200 (Type Set to I)

11. Set to Passive Mode12. Response with 277(Entering Passive Mode)

13. Download Chap2.ppt by sending STOR Command14. Response with 125(Data Connection Opened)15. Response with 226(Transfer complete)Data

ConnectionExplain Next Slide

Page 41: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

41

Packet Capture For Data Connection

Another TCP connection where 192.168.112.94:3287 to 203.241.187.71:1163 Established For data connection

Page 42: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

42

chapter 04 응용계층

E-mail( 전자메일 )

컴퓨터 사용자가 동일한 컴퓨터 또는 네트워크에 연결된 다른 컴퓨터 사용자와 보통의 메일 서비스를 전산망 상에서 온라인으로 사용할 수 있는 서비스 .

TCP/IP 는 전자메일을 주고받기 위한 SMTP 를 정의한다 .

[ 그림 4.13] 은 TCP/IP 를 사용한 전자메일의 전체적인 구성도를 보여준다 .

[ 그림 4.13] 인터넷 전자메일의 구성

Page 43: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

43

Electronic Mail

Three major components: user agents mail servers simple mail transfer protocol: smtp

User Agent a.k.a. “mail reader” composing, editing, reading mail mes

sages e.g., Eudora, Outlook, elm, Netscape

Messenger outgoing, incoming messages stored

on server

user mailbox

outgoing message queue

mailserver

useragent

useragent

useragent

mailserver

useragent

useragent

mailserver

useragent

SMTP

SMTP

SMTP

Page 44: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

44

Electronic Mail: mail servers

Mail Servers mailbox contains incoming messages

(yet to be read) for user message queue of outgoing (to be se

nt) mail messages smtp protocol between mail servers to

send email messages client: sending mail server “server”: receiving mail server

mailserver

useragent

useragent

useragent

mailserver

useragent

useragent

mailserver

useragent

SMTP

SMTP

SMTP

Page 45: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

45

chapter 04 응용계층

SMTP 동작

SMTP 동작의 세 가지 단계

1. SMTP 클라이언트와 서버 간의 연결이 확립된다 .2. 전자메일이 연결을 따라 전송된다 .3. 연결이 해제된다 .

SMTP Command , Reply

Page 46: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

46

Command From Client To Server

Page 47: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

47

Reply From Server to Client

-Quite similar with FTP-For more command and reply , refer to RFC 2821 http://rfc.net/rfc2821.html

Page 48: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

48

Electronic Mail: smtp [RFC 821]

uses tcp to reliably transfer email msg from client to server, port 25 direct transfer: sending server to receiving server three phases of transfer

handshaking (greeting) transfer of messages closure

command/response interaction commands: ASCII text response: status code and phrase

messages must be in 7-bit ASCII

Page 49: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

49

Sample smtp interaction

S: 220 hamburger.edu C: HELO crepes.fr S: 250 Hello crepes.fr, pleased to meet you C: MAIL FROM: <[email protected]> S: 250 [email protected]... Sender ok C: RCPT TO: <[email protected]> S: 250 [email protected] ... 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

Page 50: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

50

try smtp interaction for yourself:

telnet servername 25 see 220 reply from server enter HELO, MAIL FROM, RCPT TO, DATA, QUIT commands above lets you send email without using email client (reader)

Page 51: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

51

Ethereal Captured Screen For SMTP

Page 52: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

52

Works Flow in SMTP

Steps involved 1. Open TCP connection to port 25 of the server2. Server Response with code 220 (Service Ready)3. Client send command EHLO (Client authentication)4. Server Response with code 250 (OK)5. Client send command AUTH PLAIN 6. Server Response with code 235 (Authentication successes)7. Sender send command MAIL ( Enter sender name) 8. Server Response with code 250 (OK)9. Sender send command RCPT TO ( Enter recipient name)10.Server Response with code 250 (OK)11.Sender send command DATA (Beginning Transmission)12.Server Response with code 354 (Start Email Input)13.Sender send command Message Body (The body of the msg)14.Server Response with code 250 (OK)15.TCP Connection Closed

Page 53: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

53

Mail access protocols

SMTP: delivery/storage to receiver’s server Mail access protocol: retrieval from server

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.

useragent

sender’s mail server

useragent

SMTP SMTP POP3 orIMAP

receiver’s mail server

Page 54: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

54

POP3 protocol

authorization phase client commands:

user: declare username pass: password

server responses +OK -ERR

transaction phase, client: list: list message numbers retr: retrieve message by number dele: delete quit

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

S: +OK POP3 server ready C: user alice S: +OK C: pass hungry S: +OK user successfully logged on

Page 55: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

55

chapter 04 응용계층

4.2.5 DNS

DNS (Domain Name Server)

IP 주소는 사람이 기억하기에 어려워 기억하기 쉽게 바꾸어 놓은 것이 도메인 이름이다 .

컴퓨터가 속해 있는 기관이나 국가에 따라서 계층적으로 형성됨

Domain Name 을 IP 주소로 또는 그 반대로 바꿔 주는 것을 DNS(Domain Name System) 이라 한다 .

도메인 네임

– 도메인 네임의 구조 : 호스트 이름 . 소속단체 . 단체성격 . 소속국가

Nslookup 명령– 가끔씩 컴퓨터가 도메인 주소를 이해 못하는 경우가 발생할 수 있으며 , 사용자가 특별히 특정 호스트 이름에 해당하는 IP 주소를 알고 싶을 때 사용하는 명령어

Page 56: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

56

DNS: Domain Name System

People: many identifiers: SSN, name, passport #

Internet hosts, routers: IP address (32 bit) - used

for addressing datagrams “name”, e.g.,

ww.yahoo.com - used by humans

Q: map between IP addresses and name ?

Domain Name System: distributed database implemented

in hierarchy of many name servers application-layer protocol host,

routers, name servers to communicate to resolve names (address/name translation) note: core Internet function,

implemented as application-layer protocol

complexity at network’s “edge”

Page 57: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

57

DNS

Why not centralize DNS? single point of failure traffic volume distant centralized database maintenance

doesn’t scale!

DNS services Hostname to IP address

translation Host aliasing

Canonical and alias names

Mail server aliasing Load distribution

Replicated Web servers: set of IP addresses for one canonical name

Page 58: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

58

Root DNS Servers

com DNS servers org DNS servers edu DNS servers

poly.eduDNS servers

umass.eduDNS servers

yahoo.comDNS servers

amazon.comDNS servers

pbs.orgDNS servers

Distributed, Hierarchical Database

Client wants IP for www.amazon.com; 1st approx: Client queries a root server to find com DNS server Client queries com DNS server to get amazon.com DNS server Client queries amazon.com DNS server to get IP address for

www.amazon.com

Page 59: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

59

DNS: Root name servers

contacted by local name server that can not resolve name root name server:

contacts authoritative name server if name mapping not known gets mapping returns mapping to local name server

13 root name servers worldwide

b USC-ISI Marina del Rey, CAl ICANN Los Angeles, CA

e NASA Mt View, CAf Internet Software C. Palo Alto, CA (and 17 other locations)

i Autonomica, Stockholm (plus 3 other locations)

k RIPE London (also Amsterdam, Frankfurt)

m WIDE Tokyo

a Verisign, Dulles, VAc Cogent, Herndon, VA (also Los Angeles)d U Maryland College Park, MDg US DoD Vienna, VAh ARL Aberdeen, MDj Verisign, ( 11 locations)

Page 60: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

60

TLD and Authoritative Servers

Top-level domain (TLD) servers: responsible for com, org, net, edu, etc, and all top-level country domains uk, fr, ca, jp. Network solutions maintains servers for com TLD Educause for edu TLD

Authoritative DNS servers: organization’s DNS servers, providing authoritative hostname to IP mappings for organization’s servers (e.g., Web and mail). Can be maintained by organization or service provider

Page 61: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

61

Local Name Server

Does not strictly belong to hierarchy Each ISP (residential ISP, company, university) has one.

Also called “default name server”

When a host makes a DNS query, query is sent to its local DNS server Acts as a proxy, forwards query into hierarchy.

Page 62: PART 02 프로토콜 1 컴퓨터 네트워크 PART 02 프로토콜 (chapter 04 응용계층 ) 임효택 E-mail : htlim@dongseo.ac.krhtlim@dongseo.ac.kr Home page : htlim

PART 02 프로토콜

62

requesting hostcis.poly.edu

gaia.cs.umass.edu

root DNS server

local DNS serverdns.poly.edu

1

23

4

5

6

authoritative DNS serverdns.cs.umass.edu

78

TLD DNS server

Example

Host at cis.poly.edu wants IP address for gaia.cs.umass.edu

DNS Caching is used to improve the delay perpermance