computer network lab. 1 제 7 장 ping 프로그램. computer network lab. 2 목차 n introduction n...

22
1 Computer Network Lab. 제 7 제 Ping 제제제제

Post on 19-Dec-2015

220 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Computer Network Lab. 1 제 7 장 Ping 프로그램. Computer Network Lab. 2 목차 n Introduction n Ping Program LAN Output WAN Output Hardwired SLIP Links Dialup SLIP

1Computer Network Lab.

제 7 장

Ping 프로그램

Page 2: Computer Network Lab. 1 제 7 장 Ping 프로그램. Computer Network Lab. 2 목차 n Introduction n Ping Program LAN Output WAN Output Hardwired SLIP Links Dialup SLIP

2Computer Network Lab.

목차 Introduction Ping Program

LAN Output WAN Output Hardwired SLIP Links Dialup SLIP Links

IP Record Route Option Normal Example Abnormal Output

IP Timestamp Option Summary

Page 3: Computer Network Lab. 1 제 7 장 Ping 프로그램. Computer Network Lab. 2 목차 n Introduction n Ping Program LAN Output WAN Output Hardwired SLIP Links Dialup SLIP

3Computer Network Lab.

1. Introduction Ping

Packet InterNet Goper 에 나타남

호스트에 도착할 수 있는지 테스트 send an ICMP echo request message to a host

호스트에 telnet 을 할 수 없을 경우 , 어떤 문제인지 결정하기 위해 사용

호스트까지 얼마나 멀리 떨어져 측정 measures the round-trip time to the host

Page 4: Computer Network Lab. 1 제 7 장 Ping 프로그램. Computer Network Lab. 2 목차 n Introduction n Ping Program LAN Output WAN Output Hardwired SLIP Links Dialup SLIP

4Computer Network Lab.

2. Ping Program

Client : ping program( sends the echo requests) Server : host UNIX implementations of ping

identifier : process ID of the sending processsequence number : 0 부터 시작 , 순차적으로 증가option : -s

0 167 158 31

Type(0 or 8)

identifier

Optional data

Sequence number

Code(0) checksum8 byte

Figure 7.1 Format of ICMP message for echo request and echo reply

Page 5: Computer Network Lab. 1 제 7 장 Ping 프로그램. Computer Network Lab. 2 목차 n Introduction n Ping Program LAN Output WAN Output Hardwired SLIP Links Dialup SLIP

5Computer Network Lab.

LAN Outputbsdi % ping svr4PING svr4 (140.252.13.34) : 56 data bytes64 bytes from 140.252.13.34 : icmp_seq=0 ttl=255 time=0 ms64 bytes from 140.252.13.34 : icmp_seq=1 ttl=255 time=0 ms 64 bytes from 140.252.13.34 : icmp_seq=2 ttl=255 time=0 ms64 bytes from 140.252.13.34 : icmp_seq=3 ttl=255 time=0 ms64 bytes from 140.252.13.34 : icmp_seq=4 ttl=255 time=0 ms^?----svr4 PING Statistics----5 packets transmitted, 5 packets received, 0% packet lossround-trip (ms) min/avg/max = 0/0/0 ms

Page 6: Computer Network Lab. 1 제 7 장 Ping 프로그램. Computer Network Lab. 2 목차 n Introduction n Ping Program LAN Output WAN Output Hardwired SLIP Links Dialup SLIP

6Computer Network Lab.

Cont’d[dblab:/users/user/kangms]# ping cece.hannam.ac.kr is alive[dblab:/users/user/kangms]# ping -s cePING ce.hannam.ac.kr: 56 data bytes64 bytes from ce.hannam.ac.kr (203.247.40.42): icmp_seq=0. time=3. ms64 bytes from ce.hannam.ac.kr (203.247.40.42): icmp_seq=1. time=2. ms64 bytes from ce.hannam.ac.kr (203.247.40.42): icmp_seq=2. time=2. ms64 bytes from ce.hannam.ac.kr (203.247.40.42): icmp_seq=3. time=14. m

s64 bytes from ce.hannam.ac.kr (203.247.40.42): icmp_seq=4. time=2. ms^C----ce.hannam.ac.kr PING Statistics----5 packets transmitted, 5 packets received, 0% packet lossround-trip (ms) min/avg/max = 2/4/14

Page 7: Computer Network Lab. 1 제 7 장 Ping 프로그램. Computer Network Lab. 2 목차 n Introduction n Ping Program LAN Output WAN Output Hardwired SLIP Links Dialup SLIP

7Computer Network Lab.

Cont’d

ICMP echo 응답 sequence number, TTL, round-trip time 이 출력 TTL

IP header 에 있는 time-to-live 필드 현재 BSD ping 프로그램은 echo 응답을 수신할 때마다 TTL

을 출력 8 장에서 TTL 이용방법 설명

round-trip time 계산 ICMP 메시지의 데이터 부분에 echo 요구를 보내는 시간을 저장 계산 : 현재 시간 - 응답이 되돌아 온 시간 BSD/386 version 0.9.8 에서는 10-ms 이하는 지원하지 않음

( version 1.0 부터는 지원 )

Page 8: Computer Network Lab. 1 제 7 장 Ping 프로그램. Computer Network Lab. 2 목차 n Introduction n Ping Program LAN Output WAN Output Hardwired SLIP Links Dialup SLIP

8Computer Network Lab.

Cont’d

호스트 이름을 지정하더라도 , 첫째 줄에 IP 가 출력 sunOS 에서는 그렇지 않음 resolver 에 의해 IP 주소로 변환 됨

resolver 는 14 장에서 다룸

Ping 을 실행 시키면 첫줄이 출력 될 때까지의 시간이 지연 됨

0 번의 응답 시간이 긴 이유 목적지의 주소가 sender 의 ARP cache 에 없기 때문 ARP 요구와 응답 때문에 지연

echo 응답 요구 메시지는 1 초마다 보냄

Page 9: Computer Network Lab. 1 제 7 장 Ping 프로그램. Computer Network Lab. 2 목차 n Introduction n Ping Program LAN Output WAN Output Hardwired SLIP Links Dialup SLIP

9Computer Network Lab.

WAN 출력[ce:/user/msphd/kangms]# ping -s vangogh.cs.berkeley.eduPING vangogh.cs.berkeley.edu: 56 data bytes64 bytes from 128.32.33.5: icmp_seq=0. time=405. ms64 bytes from 128.32.33.5: icmp_seq=1. time=295. ms64 bytes from 128.32.33.5: icmp_seq=2. time=301. ms64 bytes from 128.32.33.5: icmp_seq=3. time=314. ms64 bytes from 128.32.33.5: icmp_seq=4. time=291. ms64 bytes from 128.32.33.5: icmp_seq=6. time=294. ms^C----vangogh.cs.berkeley.edu PING Statistics----8 packets transmitted, 6 packets received, 25% packet lossround-trip (ms) min/avg/max = 291/316/405[ce:/user/msphd/kangms]#

Page 10: Computer Network Lab. 1 제 7 장 Ping 프로그램. Computer Network Lab. 2 목차 n Introduction n Ping Program LAN Output WAN Output Hardwired SLIP Links Dialup SLIP

10Computer Network Lab.

Hardwired SLIP linksSvr4 % ping -s slipPING slip: 56 data bytes64 byte from slip (192.42.62.1): icmp_seq=0. Time=1480. ms64 byte from slip (192.42.62.1): icmp_seq=1. Time=1480. ms 64 byte from slip (192.42.62.1): icmp_seq=2. Time=1480. ms 64 byte from slip (192.42.62.1): icmp_seq=3. Time=1480. ms^?---------------------slip PING statistics------------------5 packets transmitted, 4 packets received, 20% packet lossround-trip (ms) min/avg/max = 1480/1480/1480 Svr4 %

Hardwired SLIP link 통신 속도 : 1200 bit/sec

Page 11: Computer Network Lab. 1 제 7 장 Ping 프로그램. Computer Network Lab. 2 목차 n Introduction n Ping Program LAN Output WAN Output Hardwired SLIP Links Dialup SLIP

11Computer Network Lab.

Cont’d

Round-trip time 계산 IP datagram 의 총 크기 : 84 byte

ICMP message : 54 byteIP header : 20 byteICMP header : 8byte

datagram 의 시작과 끝의 END byte : 2 byte 초당 전송 byte : 8.33 ms/byte

1byte (8bit) + start bit(1) + stop bit(1)1200 bit/sec => 120 byte/sec ( 8.33 ms/byte)

round-trip time 계산(86 * 8.22 * 2) = 1.433 ms

Page 12: Computer Network Lab. 1 제 7 장 Ping 프로그램. Computer Network Lab. 2 목차 n Introduction n Ping Program LAN Output WAN Output Hardwired SLIP Links Dialup SLIP

12Computer Network Lab.

Dialup SLIP Links

환경 조건 모뎀을 가지고 연결

V.32 modulation ( 9600 bit/sec )

V.42 error control

V.42bis 데이터 압축 hardware 처럼 계산이 정확하지 않음

주의 사항 RTT 는 10 ms 의 배수 RTT 는 서서히 감소 (280 ~ 300 ms) RTT 의 최소 : 260 ms

Page 13: Computer Network Lab. 1 제 7 장 Ping 프로그램. Computer Network Lab. 2 목차 n Introduction n Ping Program LAN Output WAN Output Hardwired SLIP Links Dialup SLIP

13Computer Network Lab.

Cont’dsun % ping geminiPING gemini: 56 data bytes64 byte from gemini (140.252.1.11): icmp_seq=0. Time=373. ms64 byte from gemini (140.252.1.11): icmp_seq=1. Time=360. ms64 byte from gemini (140.252.1.11): icmp_seq=2. Time=340. ms64 byte from gemini (140.252.1.11): icmp_seq=3. Time=320. ms64 byte from gemini (140.252.1.11): icmp_seq=4. Time=330. ms64 byte from gemini (140.252.1.11): icmp_seq=5. Time=310. ms64 byte from gemini (140.252.1.11): icmp_seq=6. Time=290. ms64 byte from gemini (140.252.1.11): icmp_seq=7. Time=300. ms64 byte from gemini (140.252.1.11): icmp_seq=8. Time=280. ms64 byte from gemini (140.252.1.11): icmp_seq=9. Time=290. ms64 byte from gemini (140.252.1.11): icmp_seq=10. Time=300. ms64 byte from gemini (140.252.1.11): icmp_seq=11. Time=280. ms^?----gemini PING statistics----12 packets transmitted, 12 packets received, 0% packet lossround-trip (ms) min/avg/max = 280/314/373

Page 14: Computer Network Lab. 1 제 7 장 Ping 프로그램. Computer Network Lab. 2 목차 n Introduction n Ping Program LAN Output WAN Output Hardwired SLIP Links Dialup SLIP

14Computer Network Lab.

3. IP Record Route Option

IP record route option ping -R [ destination ]

-R option 은 record route 기능을 갖음

IP 주소 목록 출력datagram 을 처리하는 모든 router 들은 자신의 IP 를 추가목적지에 도달 시 , ICMP echo 응답에 IP 주소 복사echo 응답을 받았을 시 , IP 주소 목록 출력

대부분 시스템들이 이 option 기능을 지원시스템 중에는 IP 목록을 반영하지 않는 것도 있음

문제점 : 9 개의 IP 주소 목록만 수록할 수 있음

Page 15: Computer Network Lab. 1 제 7 장 Ping 프로그램. Computer Network Lab. 2 목차 n Introduction n Ping Program LAN Output WAN Output Hardwired SLIP Links Dialup SLIP

15Computer Network Lab.

Con’d

Field 설명 Code : IP option 유형을 지정하는 필드 ( RR = 7 ) len : RR option 의 총 바이트 수 ( 39 byte ) ptr : IP 주소 목록이 채워질 곳을 지정

최소값 = 4, 최대값 = 40 IP add : 송신하는 IP add 를 기록 (RFC 791)

마지막으로 자신의 수신 IP 주소를 기록

39 byte

code len ptr IP addr #1 IP addr #2 IP addr #3 IP addr #9

Ptr = 4 Ptr = 8 Ptr = 12 Ptr = 36 Ptr = 401 1 1 4 byte 4 byte 4 byte 4 byte

Figure 7.3 General format of record route option in IP header

Page 16: Computer Network Lab. 1 제 7 장 Ping 프로그램. Computer Network Lab. 2 목차 n Introduction n Ping Program LAN Output WAN Output Hardwired SLIP Links Dialup SLIP

16Computer Network Lab.

Normal Examplesvr4 % ping -R slipPING slip (140.252.13.65) : 56 data bytes64 bytes from 140.252.13.65 : icmp_seq=0 ttl=254 time=280 msRR : bsdi (140.252.13.66)

slip (140.252.13.65) bsdi (140.252.13.35)

svr4 (140.252.13.34)64 bytes from 140.252.13.65 : icmp_seq=1 ttl=254 time=280 ms ( same rout

e )64 bytes from 140.252.13.65 : icmp_seq=2 ttl=254 time=270 ms ( same rout

e )

^?------ slip ping statistics -----3 packers transmitted, 3 packets received, 0% packet lossround-trip min/avg/max = 270/276/280 ms

Page 17: Computer Network Lab. 1 제 7 장 Ping 프로그램. Computer Network Lab. 2 목차 n Introduction n Ping Program LAN Output WAN Output Hardwired SLIP Links Dialup SLIP

17Computer Network Lab.

Cont’d

1 0.0 svr4 > slip : icmp: echo request (ttl 32, id 35835, optlen=40 RR{39} = RR{#0.0.0.0/0.0.0.0/ ~ /0.0.0.0} EOF)

2 0.267746 (0.2677) slip > svr4 : icmp: echo reply ( ttl 254, id 1976, optlen=40 RR{39}=RR{140,252,13,66/ 140,252,13,65/140,252,13,35/ #0.0.0.0/ ~ / 0.0.0.0} EOF)

Figure 7.5 tcpdump output of record option

4th =140.252.13.34

slip bsdi sun svr4SLIP

.65 .66.35 .34

Eithernet1st = 140.252.13.66

2st = 140.252.13.65 3st = 140.252.13.35

Empty list

Figure 7.4 Ping with recorcd route option.

Page 18: Computer Network Lab. 1 제 7 장 Ping 프로그램. Computer Network Lab. 2 목차 n Introduction n Ping Program LAN Output WAN Output Hardwired SLIP Links Dialup SLIP

18Computer Network Lab.

Abnormal Outputslip % ping -R aixPING aix (140.252.13.65) : 56 data bytes64 bytes from 140.252.1.92 : icmp_seq=0 ttl=251 time=650 msRR : bsdi (140.252.13.35)

sun (140.252.1.29) netb (140.252.1.183)

gateway (140.252.1.4) why is this router used ?netb (140.252.1.183) sun (140.252.13.33)

bsdi (140.252.13.66)slip (140.252.13.65)

64 bytes from aix : icmp_seq=1 ttl=251 time=610 ms ( same route )64 bytes from aix : icmp_seq=2 ttl=251 time=600 ms ( same route )^?------ aix ping statistics -----4 packers transmitted, 3 packets received, 25% packet lossround-trip min/avg/max = 600/620/6250 ms

Page 19: Computer Network Lab. 1 제 7 장 Ping 프로그램. Computer Network Lab. 2 목차 n Introduction n Ping Program LAN Output WAN Output Hardwired SLIP Links Dialup SLIP

19Computer Network Lab.

Cont’d

slip bsdi sunSLIP

.13.65 .13.66.13.35 .13.33

Eithernet

8st = 140.252.13.66

Empty list 1st = 140.252.13.35

netb

SLIP

.1.29 2st = 140.252.1.29

gateway aix4st = 140.252.1.92

Eithernet 3st = 140.252.1.183.1.183

.1.92.1.4

internetPing destination

5st = 140.252.1.46st = 140.252.1.183

7st = 140.252.13.33

Figure 7.6 ping with record route, showing IP routing feature

Page 20: Computer Network Lab. 1 제 7 장 Ping 프로그램. Computer Network Lab. 2 목차 n Introduction n Ping Program LAN Output WAN Output Hardwired SLIP Links Dialup SLIP

20Computer Network Lab.

4. IP Timestamp Option

Field 설명 code : 0x44 - timestamp option code

len, ptr : record route option 과 같음 OF(overflow) : timestamp 의 공간이 없는 경우에 router 는

OF field 를 증가

40 byte

code len ptr Tstamp #1

1 1 1 4 byte 4 byte 4 byte 4 byte

Figure 7.7 General format of timestamp option in IP header

Tstamp #2 Tstamp #3 Tstamp #9FLOF

Page 21: Computer Network Lab. 1 제 7 장 Ping 프로그램. Computer Network Lab. 2 목차 n Introduction n Ping Program LAN Output WAN Output Hardwired SLIP Links Dialup SLIP

21Computer Network Lab.

Cont’d

FL(flag)

0 : timestamp 만 기록1 : router 의 IP 주소와 timestamp 기록 ( 4 쌍의 공간 )

3 : sender 는 최대 4 쌍의 IP add 와 0 timestamp 를 초기화router 는 리스트에 있는 다음 IP add 가 자신의 것과 일치할 경우만 timestamp 를 기록

Page 22: Computer Network Lab. 1 제 7 장 Ping 프로그램. Computer Network Lab. 2 목차 n Introduction n Ping Program LAN Output WAN Output Hardwired SLIP Links Dialup SLIP

22Computer Network Lab.

5. Summary Ping program

TCP/IP 실행을 하는 두 시스템 간의 기본적인 접속 실험을 함

ICMP echo 요구와 echo 응답 메시지를 이용 트랜스포트 계층 (TCP or UDP) 를 사용하지 않음

LAN, WAN, SLIP link(hardwired, dialup) 에 서의 일반적인 ping 출력을 알아봄

Ping 을 이용한 RR(record route) option IP timestamp option