1 / 22

TCP/IP 네트워크

TCP/IP 네트워크. 제 7 장 Ping 프로그램. 목차. 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. 1. Introduction. Ping Packet InterNet Goper 에 나타남 호스트에 도착할 수 있는지 테스트

kim-spears
Télécharger la présentation

TCP/IP 네트워크

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. TCP/IP 네트워크 제7장 Ping 프로그램 정보통신연구실

  2. 목차 • 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 정보통신연구실

  3. 1. Introduction • Ping • Packet InterNet Goper에 나타남 • 호스트에 도착할 수 있는지 테스트 • send an ICMP echo request message to a host • 호스트에 telnet을 할 수 없을 경우, 어떤 문제인지 결정하기 위해 사용 • 호스트까지 얼마나 멀리 떨어져 측정 • measures the round-trip time to the host 정보통신연구실

  4. 0 7 8 15 16 31 Code(0) checksum Type(0 or 8) 8 byte identifier Sequence number Optional data Figure 7.1 Format of ICMP message for echo request and echo reply 2. Ping Program • Client : ping program( sends the echo requests) • Server : host • UNIX implementations of ping • identifier : process ID of the sending process • sequence number : 0부터 시작, 순차적으로 증가 • option : -s 정보통신연구실

  5. LAN Output bsdi % ping svr4 PING svr4 (140.252.13.34) : 56 data bytes 64 bytes from 140.252.13.34 : icmp_seq=0 ttl=255 time=0 ms 64 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 ms 64 bytes from 140.252.13.34 : icmp_seq=3 ttl=255 time=0 ms 64 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 loss round-trip (ms) min/avg/max = 0/0/0 ms 정보통신연구실

  6. Cont’d [dblab:/users/user/kangms]# ping ce ce.hannam.ac.kr is alive [dblab:/users/user/kangms]# ping -s ce PING ce.hannam.ac.kr: 56 data bytes 64 bytes from ce.hannam.ac.kr (203.247.40.42): icmp_seq=0. time=3. ms 64 bytes from ce.hannam.ac.kr (203.247.40.42): icmp_seq=1. time=2. ms 64 bytes from ce.hannam.ac.kr (203.247.40.42): icmp_seq=2. time=2. ms 64 bytes from ce.hannam.ac.kr (203.247.40.42): icmp_seq=3. time=14. ms 64 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 loss round-trip (ms) min/avg/max = 2/4/14 정보통신연구실

  7. 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부터는 지원) 정보통신연구실

  8. Cont’d • 호스트 이름을 지정하더라도, 첫째 줄에 IP가 출력 • sunOS에서는 그렇지 않음 • resolver에 의해 IP 주소로 변환 됨 • resolver는 14 장에서 다룸 • Ping을 실행 시키면 첫줄이 출력 될 때까지의 시간이 지연 됨 • 0번의 응답 시간이 긴 이유 • 목적지의 주소가 sender의 ARP cache에 없기 때문 • ARP 요구와 응답 때문에 지연 • echo 응답 요구 메시지는 1초마다 보냄 정보통신연구실

  9. WAN 출력 [ce:/user/msphd/kangms]# ping -s vangogh.cs.berkeley.edu PING vangogh.cs.berkeley.edu: 56 data bytes 64 bytes from 128.32.33.5: icmp_seq=0. time=405. ms 64 bytes from 128.32.33.5: icmp_seq=1. time=295. ms 64 bytes from 128.32.33.5: icmp_seq=2. time=301. ms 64 bytes from 128.32.33.5: icmp_seq=3. time=314. ms 64 bytes from 128.32.33.5: icmp_seq=4. time=291. ms 64 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 loss round-trip (ms) min/avg/max = 291/316/405 [ce:/user/msphd/kangms]# 정보통신연구실

  10. Hardwired SLIP links Svr4 % ping -s slip PING slip: 56 data bytes 64 byte from slip (192.42.62.1): icmp_seq=0. Time=1480. ms 64 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 loss round-trip (ms) min/avg/max = 1480/1480/1480 Svr4 % • Hardwired SLIP link 통신 속도 : 1200 bit/sec 정보통신연구실

  11. Cont’d • Round-trip time 계산 • IP datagram의 총 크기 : 84 byte • ICMP message : 54 byte • IP header : 20 byte • ICMP 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 정보통신연구실

  12. 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 정보통신연구실

  13. Cont’d sun % ping gemini PING gemini: 56 data bytes 64 byte from gemini (140.252.1.11): icmp_seq=0. Time=373. ms 64 byte from gemini (140.252.1.11): icmp_seq=1. Time=360. ms 64 byte from gemini (140.252.1.11): icmp_seq=2. Time=340. ms 64 byte from gemini (140.252.1.11): icmp_seq=3. Time=320. ms 64 byte from gemini (140.252.1.11): icmp_seq=4. Time=330. ms 64 byte from gemini (140.252.1.11): icmp_seq=5. Time=310. ms 64 byte from gemini (140.252.1.11): icmp_seq=6. Time=290. ms 64 byte from gemini (140.252.1.11): icmp_seq=7. Time=300. ms 64 byte from gemini (140.252.1.11): icmp_seq=8. Time=280. ms 64 byte from gemini (140.252.1.11): icmp_seq=9. Time=290. ms 64 byte from gemini (140.252.1.11): icmp_seq=10. Time=300. ms 64 byte from gemini (140.252.1.11): icmp_seq=11. Time=280. ms ^? ----gemini PING statistics---- 12 packets transmitted, 12 packets received, 0% packet loss round-trip (ms) min/avg/max = 280/314/373 정보통신연구실

  14. 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 주소 목록만 수록할 수 있음 정보통신연구실

  15. 39 byte code len ptr IP addr #1 IP addr #2 IP addr #3 IP addr #9 1 1 4 byte 4 byte 4 byte 4 byte 1 Ptr = 4 Ptr = 8 Ptr = 12 Ptr = 36 Ptr = 40 Figure 7.3 General format of record route option in IP header Con’d • Field 설명 • Code : IP option 유형을 지정하는 필드 ( RR = 7 ) • len : RR option의 총 바이트 수 ( 39 byte ) • ptr : IP 주소 목록이 채워질 곳을 지정 • 최소값 = 4, 최대값 = 40 • IP add : 송신하는 IP add를 기록(RFC 791) • 마지막으로 자신의 수신 IP 주소를 기록 정보통신연구실

  16. Normal Example svr4 % ping -R slip PING slip (140.252.13.65) : 56 data bytes 64 bytes from 140.252.13.65 : icmp_seq=0 ttl=254 time=280 ms RR : 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 route ) 64 bytes from 140.252.13.65 : icmp_seq=2 ttl=254 time=270 ms ( same route ) ^? ------ slip ping statistics ----- 3 packers transmitted, 3 packets received, 0% packet loss round-trip min/avg/max = 270/276/280 ms 정보통신연구실

  17. SLIP slip bsdi sun svr4 .65 .66 .35 .34 Eithernet 4th =140.252.13.34 Empty list 1st = 140.252.13.66 2st = 140.252.13.65 3st = 140.252.13.35 Figure 7.4 Ping with recorcd route option. 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 정보통신연구실

  18. Abnormal Output slip % ping -R aix PING aix (140.252.13.65) : 56 data bytes 64 bytes from 140.252.1.92 : icmp_seq=0 ttl=251 time=650 ms RR : 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 loss round-trip min/avg/max = 600/620/6250 ms 정보통신연구실

  19. internet Ping destination 4st = 140.252.1.92 gateway aix .1.4 .1.92 Eithernet 3st = 140.252.1.183 .1.183 5st = 140.252.1.4 netb 6st = 140.252.1.183 SLIP 8st = 140.252.13.66 7st = 140.252.13.33 2st = 140.252.1.29 .1.29 SLIP slip bsdi sun .13.65 .13.66 .13.35 .13.33 Eithernet Empty list 1st = 140.252.13.35 Figure 7.6 ping with record route, showing IP routing feature Cont’d 정보통신연구실

  20. 40 byte code len ptr OF FL Tstamp #1 Tstamp #2 Tstamp #3 Tstamp #9 1 1 1 4 byte 4 byte 4 byte 4 byte Figure 7.7 General format of timestamp option in IP header 4. IP Timestamp Option • Field 설명 • code : 0x44 - timestamp option code • len, ptr : record route option과 같음 • OF(overflow) : timestamp의 공간이 없는 경우에 router는 OF field를 증가 정보통신연구실

  21. Cont’d • FL(flag) • 0 : timestamp만 기록 • 1 : router의 IP 주소와 timestamp 기록( 4쌍의 공간) • 3 : sender는 최대 4쌍의 IP add와 0 timestamp를 초기화router는 리스트에 있는 다음 IP add가 자신의 것과 일치할 경우만 timestamp를 기록 정보통신연구실

  22. 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 정보통신연구실

More Related