25
Wireshark Lab: ICMP Wireshark Lab: ICMP Computer Networking: A Topdown Approach, 4th edition.

Wireshark Lab: ICMP

Embed Size (px)

DESCRIPTION

Wireshark Lab: ICMP. Computer Networking: A Topdown Approach, 4th edition. Wireshark Lab: ICMP. In this lab, we’ll explore several aspects of the ICMP protocol ICMP messages generating by the Ping program; ICMP messages generated by the Traceroute(tracert) program - PowerPoint PPT Presentation

Citation preview

Page 1: Wireshark Lab: ICMP

Wireshark Lab: ICMPWireshark Lab: ICMP

Computer Networking: A TopdownApproach, 4th edition.

Page 2: Wireshark Lab: ICMP

Wireshark Lab: ICMPWireshark Lab: ICMP In this lab, we’ll explore several aspects of the

ICMP protocol ICMP messages generating by the Ping program; ICMP messages generated by the Traceroute(tracert)

program

The format and contents of an ICMP message.

Page 3: Wireshark Lab: ICMP

ICMPICMPInternet Control Message Protocol偵測遠端主機是否存在建立及維護路由資料重導資料傳送路徑資料流量控制。

Page 4: Wireshark Lab: ICMP

ICMP 封包

Page 5: Wireshark Lab: ICMP

ICMP 封包的欄位

Page 6: Wireshark Lab: ICMP

Type & CodeType & Code定義 ICMP 封包的類型 ( 功能 ) 。

Page 7: Wireshark Lab: ICMP

Code每種類型可再根據 Code 欄位來定義

各種不同用途。大部份 ICMP 封包類型 (Type) 只定

義一種 Code 欄位值。Checksum( 錯誤檢查碼 ): 長度為 2 Bytes ,記錄 ICMP 封包的錯誤檢查碼。

Page 8: Wireshark Lab: ICMP

常見的 ICMP 類型Echo Request / Echo Reply Destination Unreachable Source Quench Redirect Time Exceeded

Page 9: Wireshark Lab: ICMP

Echo Request / Echo Reply1. A 主動發出回應要求封包給

B 。2. B 收到回應要求後,被動發

出回應答覆給 A 。

request

reply

Page 10: Wireshark Lab: ICMP

Destination UnreachableIP 路由過程中,若出現以下問題,路由器或目的裝置 便發出此類封包通知來源端:

1. 路由器無法將 IP 封包傳送出去。2. 目的裝置無法處理收到的 IP 封包。

Page 11: Wireshark Lab: ICMP

Source Quench當路由器因為來往的 IP 封包太多,以致來

不及處理時,便會發出此類的 ICMP 封包給來源端裝置。

Page 12: Wireshark Lab: ICMP

Redirect1. A → B 的最佳路徑是 R1 路由器。2. 若 A 誤將封包送至 R2 ,則 R2 會發

出 Redirect 的 ICMP 封包給 A ,使其重送。

Page 13: Wireshark Lab: ICMP

Time Exceeded路由器收到 TTL 值為 1 的 IP 封包時,會

將此 IP 封包丟棄,並送出此類 ICMP 封包給來源裝置。

重組封包的過程中,若時間內未收到全部的 IP Fragment ,目的裝置也會發出此類 的 ICMP 封包給來源裝置。

Page 14: Wireshark Lab: ICMP

ICMP 工具程式PINGTRACERT

Page 15: Wireshark Lab: ICMP

關於 關於 PINGPING

Figure 1 Command Prompt window after entering Ping command

Page 16: Wireshark Lab: ICMP

相關參數Options :

  -t Ping the specifed host until interrupted.

  -a Resolve addresses to hostnames. -n count Number of echo requests to send.  -l size Send buffer size. -f Set Don‘t Fragment flag in packet. -i TTL Time To Live.

Localhost(127.0.0.1)Localhost(127.0.0.1)

Page 17: Wireshark Lab: ICMP

In WiresharkIn Wireshark

Page 18: Wireshark Lab: ICMP

In wiresharkIn wiresharkSender : echo-request( type 8 ) Receiver : echo-reply( type 0 )

Page 19: Wireshark Lab: ICMP
Page 20: Wireshark Lab: ICMP

一、 Linux 、 Solaris.... 這些 Linux/Unix 的機器,它們的 TTL 值大約都在 240 ~ 254 之間

二、 Windows 系列的機器,它們的 TTL 值大約都在 110 ~ 128 之間。

不同作業系統對於 TOS 位元所設定的 IP TTL 欄位值,都不一樣,我們可以用它來作為作業系統的判斷。

Page 21: Wireshark Lab: ICMP

TRACERTTRACERT

Option: -d Do not resolve addresses to hostnames. -h maximum Maximum number of hops to search for target. -j host-list Loose source route along host-list. -w timeout Wait timeout milliseconds for each reply.

Page 22: Wireshark Lab: ICMP

How to tracerouteHow to traceroute

Step1

Step 2

Step 3

What’s the “TTL”?

TTL=1

TTL=2

TTL=3

Page 23: Wireshark Lab: ICMP

TRACERT 2

Page 24: Wireshark Lab: ICMP

following questions:following questions: 1. What is the IP address of your host? What is the IP

address of the destination host? 2. Why is it that an ICMP packet does not have source

and destination port numbers? 3. Examine one of the ping request packets sent by

your host. What are the ICMP type and code numbers? What other fields does this ICMP packet have? How many bytes are the checksum, sequence number and identifier fields?

4. Examine the corresponding ping reply packet. What are the ICMP type and code numbers? What other fields does this ICMP packet have? How many bytes are the checksum, sequence number and identifier fields?

Page 25: Wireshark Lab: ICMP

習題﹕ 請問為何要有 ICMP ?其功能是甚麼? 請列舉常見的 ICMP TYPE 有哪些。 請列舉 Distination Unreachable 的 ICMP CODE 有哪些

。 請描述 ping 是如何運用 ICMP 機制的。 請描述 traceroute 是如何運用 ICMP 機制的。 請繪制其中一種 ICMP 的封包結構。 請說明 ICMP 與 IP 的關係。