HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to:...

72
1 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr Chapter 9 Chapter 9 Upon completion you will be able to: Internet Control Message Internet Control Message Protocol Protocol Be familiar with the ICMP message format Know the types of error reporting messages Know the types of query messages Be able to calculate the ICMP checksum Know how to use the ping and traceroute commands Understand the modules and interactions of an ICMP package Objectives

Transcript of HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to:...

Page 1: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

1HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

Chapter 9Chapter 9

Upon completion you will be able to:

Internet Control Message Internet Control Message ProtocolProtocol

• Be familiar with the ICMP message format• Know the types of error reporting messages• Know the types of query messages• Be able to calculate the ICMP checksum• Know how to use the ping and traceroute commands• Understand the modules and interactions of an ICMP package

Objectives

Page 2: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

2HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

CONTENTSCONTENTS

• TYPES OF MESSAGES• MESSAGE FORMAT• ERROR REPORTING• QUERY• CHECKSUM• ICMP PACKAGE

Page 3: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

3HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

ICMPICMP 프로토콜의 문제점프로토콜의 문제점

신뢰성이 없고 비연결형 데이터그램 전달 제공 최선의 노력 전달 서비스 오류 제어와 지원 메커니즘이 없음 오류 보고 및 오류 수정 기능이 없음 호스트와 관리 질의를 위한 메커니즘이 없다

이 문제점을 보완하기 위해 설계

Page 4: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

4HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

네트워크 계층에서 네트워크 계층에서 ICMP ICMP 위치위치

Page 5: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

5HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

ICMP ICMP 패킷의 캡슐화패킷의 캡슐화

Page 6: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

6HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.1 TYPES OF MESSAGES

ICMP messages are divided into error-reporting messages and query ICMP messages are divided into error-reporting messages and query messages. The error-reporting messages report problems that a router or messages. The error-reporting messages report problems that a router or a host (destination) may encounter. The query messages get specific a host (destination) may encounter. The query messages get specific information from a router or another host. information from a router or another host.

Page 7: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

7HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.1 9.1 메시지 유형메시지 유형

오류 보고 메시지 : IP 패킷 처리 도중 발견된 문제를 보고 질의 메시지 : 다른 호스트로부터 특정 정보를 획득하기 위해 사용

Page 8: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

8HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.1 9.1 메시지 유형메시지 유형

ICMP 메시지

Page 9: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

9HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.2 MESSAGE FORMAT

An ICMP message has an 8-byte header and a variable-size data section. An ICMP message has an 8-byte header and a variable-size data section. Although the general format of the header is different for each Although the general format of the header is different for each message type, the first 4 bytes are common to all.message type, the first 4 bytes are common to all.

Page 10: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

10HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.2 9.2 메시지 형식메시지 형식

ICMP 메시지 일반적인 형식

Page 11: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

11HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.3 ERROR REPORTING

IP, as an unreliable protocol, is not concerned with error checking and IP, as an unreliable protocol, is not concerned with error checking and error control. ICMP was designed, in part, to compensate for this error control. ICMP was designed, in part, to compensate for this shortcoming. ICMP does not correct errors, it simply reports them.shortcoming. ICMP does not correct errors, it simply reports them.

The topics discussed in this section include:The topics discussed in this section include:

Destination UnreachableDestination UnreachableSource QuenchSource QuenchTime ExceededTime ExceededParameter ProblemParameter ProblemRedirectionRedirection

Page 12: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

12HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.3 9.3 오류 보고오류 보고

ICMP 의 주 임무 중 하나

ICMP always reports error messages to the original source.

Note:Note:

Page 13: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

13HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.3 9.3 오류 보고오류 보고

오류 보고 메시지

Page 14: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

14HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.3 9.3 오류 보고오류 보고

The following are important points about ICMP error messages:

❏ No ICMP error message will be generated in response to a datagram carrying an ICMP error message.❏ No ICMP error message will be generated for a fragmented datagram that is not the first fragment.❏ No ICMP error message will be generated for a datagram having a multicast address.❏ No ICMP error message will be generated for a datagram having a special address such as 127.0.0.0 or 0.0.0.0.

Note:Note:

Page 15: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

15HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.3 9.3 오류 보고오류 보고

오류 메시지를 위한 데이터 필드 내용 처음 8 바이트 : TCP 와 UDP 포트 번호와 순서 번호

Page 16: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

16HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.3 9.3 오류 보고오류 보고

목적지 도달 불가능 (Destination Unreachable) 라우터가 데이터그램을 라우팅할 수 없거나 호스트나

데이터그램을 배달할 수 없을 때 데이터그램은 폐기되고 발신지 호스트에 목적지 도달 불가 메시지 전달

목적지 도달 불가 메시지 형식

Page 17: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

17HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.3 9.3 오류 보고오류 보고

코드 필드 : 데이터그램 폐기 이유0 : 하드웨어 고장 네트워크에 도달 불가1 : 하드웨어 고장 호스트에 도달 불가2 : 프로토콜에 도달 불가3 : 포트 도달 불가

.

.

15 : 우선 순위가 낮아서 호스트 도달 불가 책 214,215 쪽 참조

Page 18: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

18HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.3 9.3 오류 보고오류 보고

Destination-unreachable messages with codes 2 or 3 can be created only

by the destination host.

Other destination-unreachable messages can be created only by

routers.

Note:Note:

Page 19: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

19HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.3 9.3 오류 보고오류 보고

A router cannot detect all problems that prevent the delivery of a packet.

Note:Note:

Page 20: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

20HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.3 9.3 오류 보고오류 보고

There is no flow-control mechanism in the IP protocol.

Note:Note:

Page 21: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

21HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.3 9.3 오류 보고오류 보고

발신지 억제 (source quench)혼잡으로 인하여 데이터그램 폐기를 발신지에 알림

Page 22: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

22HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.3 9.3 오류 보고오류 보고

A source-quench message informs the source that a datagram has been discarded

due to congestion in a router or the destination host.

The source must slow down the sending of datagrams until the congestion is relieved.

Note:Note:

Page 23: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

23HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.3 9.3 오류 보고오류 보고

One source-quench message is sent for each datagram that is discarded due to

congestion.

Note:Note:

Page 24: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

24HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.3 9.3 오류 보고오류 보고

Whenever a router decrements a datagram with a time-to-live value to

zero, it discards the datagram and sends a time-exceeded message to the

original source.

Note:Note:

Page 25: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

25HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.3 9.3 오류 보고오류 보고

When the final destination does not receive all of the fragments in a set

time, it discards the received fragments and sends a time-exceeded message to

the original source.

Note:Note:

Page 26: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

26HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.3 9.3 오류 보고오류 보고

In a time-exceeded message, code 0 is used only by routers to show that the value of the time-to-live field is zero.

Code 1 is used only by the destination host to show that not all of the

fragments have arrived within a set time.

Note:Note:

Page 27: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

27HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.3 9.3 오류 보고오류 보고

시간 경과 (time exceeded) 메시지 형식

Code 0: Time to liveCode 1: Fragmentation

Page 28: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

28HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.3 9.3 오류 보고오류 보고

A parameter-problem message can be created by a router or the destination

host.

Note:Note:

Page 29: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

29HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.3 9.3 오류 보고오류 보고

매개 변수 문제 (parameter problem) 메시지 형식

Code 0: Main header problemCode 1: Problem in the option field

Page 30: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

30HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.3 9.3 오류 보고오류 보고

재지정 (redirection) 데이터그램을 잘못된 라우터로 보낼때 라우팅 테이블을

갱신하기 위한 방법

Page 31: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

31HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.3 9.3 오류 보고오류 보고

A host usually starts with a small routing table that is gradually

augmented and updated. One of the tools to accomplish this is the

redirection message.

Note:Note:

Page 32: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

32HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.3 9.3 오류 보고오류 보고

재지정 메시지 형식

Code 0: Network specificCode 1: Host specificCode 2: Network specific (specified service)Code 3: Host specific (specified service)

Page 33: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

33HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.3 9.3 오류 보고오류 보고

A redirection message is sent from a router to a host on the same local

network.

Note:Note:

Page 34: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

34HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.4 QUERY

ICMP can also diagnose some network problems through the query ICMP can also diagnose some network problems through the query messages, a group of four different pairs of messages. In this type of messages, a group of four different pairs of messages. In this type of ICMP message, a node sends a message that is answered in a specific ICMP message, a node sends a message that is answered in a specific format by the destination node. format by the destination node.

The topics discussed in this section include:The topics discussed in this section include:

Echo Request and ReplyEcho Request and ReplyTimestamp Request and ReplyTimestamp Request and ReplyAddress-Mask Request and ReplyAddress-Mask Request and ReplyRouter Solicitation and AdvertisementRouter Solicitation and Advertisement

Page 35: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

35HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.4 9.4 질의질의

네트워크 문제 진단 질의 메시지

Page 36: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

36HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.4 9.4 질의질의

An echo-request message can be sent by a host or router. An echo-reply

message is sent by the host or router which receives an echo-request

message.

Note:Note:

Page 37: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

37HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.4 9.4 질의질의

Echo-request and echo-reply messages can be used by network managers to

check the operation of the IP protocol.

Note:Note:

Page 38: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

38HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.4 9.4 질의질의

Echo-request and echo-reply messages can test the reachability of a host. This

is usually done by invoking the ping command.

Note:Note:

Page 39: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

39HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.4 9.4 질의질의

에코 요청 및 에코 응답 메시지

Ping command can use theses messages.

Page 40: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

40HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.4 9.4 질의질의

타임스탬프 요청과 응답두 시스템 간에 IP 데이터그램이 오고 가는데

필요한 왕복 시간 결정그리니치 표준시 사용세계 표준시 (Universal Time) 의 자정으로 부터

시간을 ms 단위로 표현3 개의 (original, receive, transmit) 32 비트 필드 사용

(0~4, 294, 967, 295 사이 값 )

Page 41: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

41HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.4 9.4 질의질의

타임스탬프 요청과 응답 메시지 형식

Page 42: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

42HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.4 9.4 질의질의

동작 과정발신지는 타임스탬프 요청 메시지 생성Original timestamp 필드에 출발 시간 값 삽입나머지 두 필드는 0목적지는 응답 메시지 생성Original timestamp 값을 같은 필드에 복사요청이 수신된 시점의 시간을 receive timestamp

필드에 삽입응답 메시지가 출발하는 시간을 transmit timestamp

필드에 삽입

Page 43: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

43HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.4 9.4 질의질의

왕복시간 계산

Sending time value of receive timestamp

value of original timestamp

Receiving time time the packet returned

value of transmit timestamp

Round-trip time sending time

receiving time

Page 44: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

44HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.4 9.4 질의질의

Timestamp-request and timestamp-reply messages can be used to

calculate the round-trip time between a source and a destination machine

even if their clocks are not synchronized.

Note:Note:

Page 45: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

45HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.4 9.4 질의질의

Value of original timestamp: 46

Value of receive timestamp: 59

Value of transmit timestamp: 60

Time the packet arrived: 67

Given the following information:

Page 46: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

46HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.4 9.4 질의질의

Sending time 59 46 13 milliseconds

Receiving time 67 60 7 milliseconds

Round-trip time 13 7 20 milliseconds

We can calculate:

Page 47: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

47HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.4 9.4 질의질의

The timestamp-request and timestamp-reply messages can be used to synchronize two clocks in two

machines if the exact one-way time duration is known.

Note:Note:

Page 48: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

48HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.4 9.4 질의질의

Time difference receive timestamp

(original timestamp field one-way time duration)

Given the actual one-way time,

Time difference 59 (46 10) 3

We have:

Page 49: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

49HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.4 9.4 질의질의

주소 마스크 요청과 응답 디스크가 없는 국이 구동될 때 필요 호스트가 LAN 상의 라우터에 요청 메시지 송신 마스크 요청과 마스크 응답 메시지 형식

Page 50: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

50HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.4 9.4 질의질의

라우터 요청과 광고 다른 네트워크 상의 호스트에 데이터를 보낼 때 자신의

네트워크에 연결된 라우터 주소를 알고자 할 때 호스트는 라우터 요청 메시지를 브로드캐스트 하거나

멀티캐스트 라우터는 광고 메시지를 이용하여 라우팅 정보를 브로드캐스트 라우터 요청 메시지 형식

Page 51: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

51HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.4 9.4 질의질의

라우터 광고 메시지 형식

Page 52: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

52HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.5 CHECKSUM

In ICMP the checksum is calculated over the entire message (header In ICMP the checksum is calculated over the entire message (header and data). and data).

The topics discussed in this section include:The topics discussed in this section include:

Checksum CalculationChecksum CalculationChecksum TestingChecksum Testing

Page 53: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

53HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

Figure 9.19 shows an example of checksum calculation for a simple echo-request message (see Figure 9.14). We randomly chose the identifier to be 1 and the sequence number to be 9. The message is divided into 16-bit (2-byte) words. The words are added together and the sum is complemented. Now the sender can put this value in the checksum field.

Example 1

Page 54: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

54HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.5 9.5 검사합검사합

헤더와 데이터를 포함한 전체 메시지에 대해 계산

Page 55: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

55HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.6 DEBUGGING TOOLS

We introduce two tools that use ICMP for debugging: We introduce two tools that use ICMP for debugging: pingping and and traceroutetraceroute..

The topics discussed in this section include:The topics discussed in this section include:

PingPingTraceroute Traceroute

Page 56: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

56HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

We use the ping program to test the server fhda.edu. The result is shown below:

Example 2

$ ping fhda.eduPING fhda.edu (153.18.8.1) 56 (84) bytes of data.64 bytes from tiptoe.fhda.edu (153.18.8.1): icmp_seq=0 ttl=62 time=1.91 ms64 bytes from tiptoe.fhda.edu (153.18.8.1): icmp_seq=1 ttl=62 time=2.04 ms64 bytes from tiptoe.fhda.edu (153.18.8.1): icmp_seq=2 ttl=62 time=1.90 ms64 bytes from tiptoe.fhda.edu (153.18.8.1): icmp_seq=3 ttl=62 time=1.97 ms64 bytes from tiptoe.fhda.edu (153.18.8.1): icmp_seq=4 ttl=62 time=1.93 ms

Page 57: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

57HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

Example 2

64 bytes from tiptoe.fhda.edu (153.18.8.1): icmp_seq=5 ttl=62 time=2.00 ms64 bytes from tiptoe.fhda.edu (153.18.8.1): icmp_seq=6 ttl=62 time=1.94 ms64 bytes from tiptoe.fhda.edu (153.18.8.1): icmp_seq=7 ttl=62 time=1.94 ms64 bytes from tiptoe.fhda.edu (153.18.8.1): icmp_seq=8 ttl=62 time=1.97 ms64 bytes from tiptoe.fhda.edu (153.18.8.1): icmp_seq=9 ttl=62 time=1.89 ms64 bytes from tiptoe.fhda.edu (153.18.8.1): icmp_seq=10 ttl=62 time=1.98 ms

--- fhda.edu ping statistics ---11 packets transmitted, 11 received, 0% packet loss, time 10103ms

rtt min/avg/max = 1.899/1.955/2.041 ms

Page 58: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

58HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

For the this example, we want to know if the adelphia.net mail server is alive and running. The result is shown below:

Example 3

$ ping mail.adelphia.netPING mail.adelphia.net (68.168.78.100) 56(84) bytes of data.64 bytes from mail.adelphia.net (68.168.78.100): icmp_seq=0 ttl=48 time=85.4 ms64 bytes from mail.adelphia.net (68.168.78.100): icmp_seq=1 ttl=48 time=84.6 ms64 bytes from mail.adelphia.net (68.168.78.100): icmp_seq=2 ttl=48 time=84.9 ms64 bytes from mail.adelphia.net (68.168.78.100): icmp_seq=3 ttl=48 time=84.3 ms64 bytes from mail.adelphia.net (68.168.78.100): icmp_seq=4 ttl=48 time=84.5 ms

Page 59: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

59HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

Example 3

64 bytes from mail.adelphia.net (68.168.78.100): icmp_seq=5 ttl=48 time=84.7 ms64 bytes from mail.adelphia.net (68.168.78.100): icmp_seq=6 ttl=48 time=84.6 ms64 bytes from mail.adelphia.net (68.168.78.100): icmp_seq=7 ttl=48 time=84.7 ms64 bytes from mail.adelphia.net (68.168.78.100): icmp_seq=8 ttl=48 time=84.4 ms64 bytes from mail.adelphia.net (68.168.78.100): icmp_seq=9 ttl=48 time=84.2 ms64 bytes from mail.adelphia.net (68.168.78.100): icmp_seq=10 ttl=48 time=84.9 ms64 bytes from mail.adelphia.net (68.168.78.100): icmp_seq=11 ttl=48 time=84.6 ms64 bytes from mail.adelphia.net (68.168.78.100): icmp_seq=12 ttl=48 time=84.5 ms

--- mail.adelphia.net ping statistics ---

14 packets transmitted, 13 received, 7% packet loss, time 13129msrtt min/avg/max/mdev = 84.207/84.694/85.469

Page 60: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

60HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

The traceroute program operation

9.9.6 DEBUGGING TOOLS6 DEBUGGING TOOLS

Page 61: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

61HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

We use the traceroute program to find the route from the computer voyager.deanza.edu to the server fhda.edu. The following shows the result:

Example 4

$ traceroute fhda.edutraceroute to fhda.edu (153.18.8.1), 30 hops max, 38 byte packets1 Dcore.fhda.edu (153.18.31.254) 0.995 ms 0.899 ms 0.878 ms2 Dbackup.fhda.edu (153.18.251.4) 1.039 ms 1.064 ms 1.083 ms3 tiptoe.fhda.edu (153.18.8.1) 1.797 ms 1.642 ms 1.757 ms

Page 62: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

62HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

The un-numbered line after the command shows that the destination is 153.18.8.1. The TTL value is 30 hops. The packet contains 38 bytes: 20 bytes of IP header, 8 bytes of UDP header, and 10 bytes of application data. The application data is used by traceroute to keep track of the packets.

Example 4

The first line shows the first router visited. The router is named Dcore.fhda.edu with IP address 153.18.31.254. The first round trip time was 0.995 milliseconds, the second was 0.899 milliseconds, and the third was 0.878 milliseconds.

The second line shows the second router visited. The router is named Dbackup.fhda.edu with IP address 153.18.251.4. The three round trip times are also shown.

The third line shows the destination host. We know that this is the destination host because there are no more lines. The destination host is the server fhda.edu, but it is named tiptoe. fhda.edu with the IP address 153.18.8.1. The three round trip times are also shown.

Page 63: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

63HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

In this example, we trace a longer route, the route to xerox.com

Example 5

$ traceroute xerox.comtraceroute to xerox.com (13.1.64.93), 30 hops max, 38 byte packets1 Dcore.fhda.edu (153.18.31.254) 0.622 ms 0.891 ms 0.875 ms2 Ddmz.fhda.edu (153.18.251.40) 2.132 ms 2.266 ms 2.094 ms...

18 alpha.Xerox.COM (13.1.64.93) 11.172 ms 11.048 ms 10.922 ms

Here there are 17 hops between source and destination. Note that some round trip times look unusual. It could be that a router is too busy to process the packet immediately.

Page 64: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

64HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

An interesting point is that a host can send a traceroute packet to itself. This can be done by specifying the host as the destination. The packet goes to the loopback address as we expect.

Example 6

$ traceroute voyager.deanza.edutraceroute to voyager.deanza.edu (127.0.0.1), 30 hops max, 38 byte packets1 voyager (127.0.0.1) 0.178 ms 0.086 ms 0.055 ms

Page 65: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

65HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

Finally, we use the traceroute program to find the route between fhda.edu and mhhe.com (McGraw-Hill server). We notice that we cannot find the whole route. When traceroute does not receive a response within 5 seconds, it prints an asterisk to signify a problem, and then tries the next hop..

Example 7

$ traceroute mhhe.comtraceroute to mhhe.com (198.45.24.104), 30 hops max, 38 byte packets1 Dcore.fhda.edu (153.18.31.254) 1.025 ms 0.892 ms 0.880 ms2 Ddmz.fhda.edu (153.18.251.40) 2.141 ms 2.159 ms 2.103 ms3 Cinic.fhda.edu (153.18.253.126) 2.159 ms 2.050 ms 1.992 ms ...16 * * *17 * * *...............

Page 66: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

66HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.7 ICMP PACKAGE

To give an idea of how ICMP can handle the sending and receiving of To give an idea of how ICMP can handle the sending and receiving of ICMP messages, we present our version of an ICMP package made of ICMP messages, we present our version of an ICMP package made of two modules: an input module and an output module. two modules: an input module and an output module.

The topics discussed in this section include:The topics discussed in this section include:

Input ModuleInput ModuleOutput ModuleOutput Module

Page 67: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

67HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.9.7 ICMP 7 ICMP 설계설계

ICMP package

Page 68: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

68HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.7 ICMP 9.7 ICMP 패키지패키지

입력 모듈IP 계층으로 부터 수신된 ICMP 패킷 처리

Receive: an ICMP packet from the IP layer

1. If(the type is any of the three request types)

1. Create a reply.

2. Send the reply.

2. If(the type is a router solicitation)

1. If(station is a router)

1. Create a router advertisement.

2. Send the advertisement.

Page 69: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

69HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.7 ICMP 9.7 ICMP 패키지패키지

3. If(the type is one of the three reply messages or router advertisement)

1. Extract information in the data section of the packet.

2. Deliver extracted information to the process that requested

it.

4. If(the type defines a redirection)

1. Modify the routing table.

5. If(the type defines an error message other than a redirection)

1. Inform the appropriate source protocol about the situation.

6. Return.

Page 70: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

70HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.7 ICMP 9.7 ICMP 패키지패키지

출력 모듈상위 계층 또는 IP 프로토콜에 의해 요청된 요청 ,

청원 , 오류 메시지 생성

Receive: a demand

1. If(the demand defines an error message)

1. If(the demand is from IP)

1. If(the demand is forbidden)

1. Return.

2. If(the type defines a redirection message)

1. If(the station is not a router)

1. Return

Page 71: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

71HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

9.7 ICMP 9.7 ICMP 패키지패키지

3. Create the error message using the type, the code, and the

IP packet.

2. If(the demand defines a request or solicitation)

1. Create a request or solicitation message.

3. Send the message.

4. Return.

Page 72: HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 9 Upon completion you will be able to: Internet Control Message Protocol Be familiar with the ICMP.

72HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

연습문제 풀이해서

Report 로 다음주까지 ( 일주일 후 )

제출해 주세요 !

알림알림