Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 ICMP – Using Ping and Trace CCNA Semester 2. 2 172.30.1.20 172.30.1.25.

Similar presentations


Presentation on theme: "1 ICMP – Using Ping and Trace CCNA Semester 2. 2 172.30.1.20 172.30.1.25."— Presentation transcript:

1 1 ICMP – Using Ping and Trace CCNA Semester 2

2 2 172.30.1.20 172.30.1.25

3 3 Ping n Uses ICMP message within an IP Packet, Protocol field = 1 n Both are layer 3 protocols. (ICMP is considered as a network layer protocol.) n Does not use TCP or UDP, but may be acted upon by the receiver using TCP or UDP. Format n ping ip address (or ping for extended ping) n ping 172.30.1.25

4 4 Echo Request n The sender of the ping, transmits an ICMP message, “Echo Request” Echo Request - Within ICMP Message n Type = 8 n Code = 0

5 5 172.30.1.20 172.30.1.25

6 6 Echo Reply n The IP address (destination) of the ping, receives the ICMP message, “Echo Request” n The ip address (destination) of the ping, returns the ICMP message, “Echo Reply” Echo Reply - Within ICMP Message n Type = 0 n Code = 0

7 7 Q: Are pings forwarded by routers? A: Yes! This is why you can ping devices all over the Internet. Q: Do all devices forward or respond to pings? A: No, this is up to the network administrator of the device. Devices, including routers, can be configured not to reply to pings (ICMP echo requests). This is why you may not always be able to ping a device. Also, routers can be configured not to forward pings destined for other devices.

8 8 Traceroute n Trace ( Cisco = traceroute, tracert,…) is used to trace the probable path a packet takes between source and destination. n Probable, because IP is a connectionless protocol, and different packets may take different paths between the same source and destination networks, although this is not usually the case. n Trace will show the path the packet takes to the destination, but the return path may be different. –This is more likely the case in the Internet, and less likely within your own autonomous system. n Uses ICMP message within an IP Packet n Both are layer 3 protocols. n Uses UDP as a the transport layer. We will see why this is important in a moment.

9 9 Format (trace, traceroute, tracert) n RTA# traceroute ip address RTA# traceroute 192.168.10.2

10 10 How it works - Fooling the routers & host! n Traceroute uses ping (echo requests) n Traceroute sets the TTL (Time To Live) field in the IP Header, initially to “1”

11 11 RTB - TTL: n When a router receives an IP Packet, it decrements the TTL by 1. n If the TTL is 0, it will not forward the IP Packet, and send back to the source an ICMP “time exceeded” message. n ICMP Message: Type = 11, Code = 0

12 12 RTB n After the traceroute is received by the first router, it decrements the TTL by 1 to 0. n Noticing the TTL is 0, it sends back a ICMP Time Exceeded message back to the source, using its IP address for the source IP address. n Router B’s IP header includes its own IP address (source IP) and the sending host’s IP address (dest. IP).

13 13 RTA, Sending Host n The traceroute program of the sending host (RTA) will use the source IP address of this ICMP Time Exceeded packet to display at the first hop. RTA# traceroute 192.168.10.2 Type escape sequence to abort. Tracing the route to 192.168.10.2 1 10.0.0.2 4 msec 4 msec 4 msec

14 14 RTA n The traceroute program increments the TTL by 1 (now 2 ) and resends the ICMP Echo Request packet.

15 15 RTB n This time RTB decrements the TTL by 1 and it is NOT 0. (It is 1.) n So it looks up the destination ip address in its routing table and forwards it on to the next router. RTC n RTC however decrements the TTL by 1 and it is 0. n RTC notices the TTL is 0 and sends back the ICMP Time Exceeded message back to the source. n RTC’s IP header includes its own IP address (source IP) and the sending host’s IP address (destination IP address of RTA). n The sending host, RTA, will use the source IP address of this ICMP Time Exceeded message to display at the second hop.

16 16. RTA to RTB RTB to RTC

17 17 The sending host, RTA: n The traceroute program uses this information (Source IP Address) and displays the second hop. RTA# traceroute 192.168.10.2 Type escape sequence to abort. Tracing the route to 192.168.10.2 1 10.0.0.2 4 msec 4 msec 4 msec 2 172.16.0.2 20 msec 16 msec 16 msec

18 18 The sending host, RTA: n The traceroute program increments the TTL by 1 (now 3 ) and resends the Packet.

19 19. RTA to RTB RTB to RTC RTC to RTD

20 20 RTB n This time RTB decrements the TTL by 1 and it is NOT 0. (It is 2.) n So it looks up the destination ip address in its routing table and forwards it on to the next router. RTC n This time RTC decrements the TTL by 1 and it is NOT 0. (It is 1.) n So it looks up the destination ip address in its routing table and forwards it on to the next router. RTD n RTD however decrements the TTL by 1 and it is 0. n However, RTD notices that the Destination IP Address of 192.168.0.2 is it’s own interface. n Since it does not need to forward the packet, the TTL of 0 has no affect.

21 21 RTD n RTD sends the packet to the UDP process. n UDP examines the unrecognizable port number of 35,000 and sends back an ICMP Port Unreachable message to the sender, RTA, using Type 3 and Code 3.

22 22 Sending host, RTA n RTA receives the ICMP Port Unreachable message. n The traceroute program uses this information (Source IP Address) and displays the third hop. n The traceroute program also recognizes this Port Unreachable message as meaning this is the destination it was tracing.

23 23 Sending host, RTA n RTA, the sending host, now displays the third hop. n Getting the ICMP Port Unreachable message, it knows this is the final hop and does not send any more traces (echo requests). RTA# traceroute 192.168.10.2 Type escape sequence to abort. Tracing the route to 192.168.10.2 1 10.0.0.2 4 msec 4 msec 4 msec 2 172.16.0.2 20 msec 16 msec 16 msec 3 192.168.10.2 16 msec 16 msec 16 msec

24 24 For more information on ICMP and other TCP/IP topics, I recommend: n TCP/IP Illustrated, Volume I – R.W. Stevens


Download ppt "1 ICMP – Using Ping and Trace CCNA Semester 2. 2 172.30.1.20 172.30.1.25."

Similar presentations


Ads by Google