0% found this document useful (0 votes)
160 views9 pages

ICMP Protocol

ICMP (Internet Control Message Protocol) is a crucial network protocol used for diagnostics and management, exemplified by utilities like 'ping' and 'traceroute'. It sends error messages when hosts are unreachable and encapsulates messages in IP packets, functioning primarily at layer 3 of the OSI model. The document details various ICMP message types, including echo requests, destination unreachable messages, and how traceroute utilizes ICMP for path discovery.

Uploaded by

rkgraman86
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
160 views9 pages

ICMP Protocol

ICMP (Internet Control Message Protocol) is a crucial network protocol used for diagnostics and management, exemplified by utilities like 'ping' and 'traceroute'. It sends error messages when hosts are unreachable and encapsulates messages in IP packets, functioning primarily at layer 3 of the OSI model. The document details various ICMP message types, including echo requests, destination unreachable messages, and how traceroute utilizes ICMP for path discovery.

Uploaded by

rkgraman86
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
1312/25, 12:44 PM ICMP (Internet Control Massage Protocol) Get Unlimited Access to 807 Cisco Lessons Now (sign up | Search... Q © ICMP (Internet Control Message Protocol) Lesson Contents 1. Wireshark Captures 4.1.ICMP Echo request and reply 1.2. Destination Unreachable 1.3. Traceroute 2, Conclusion ICMP (Internet Control Message Protocol) is a network protocol used for diagnostics and network management, A good example is the “ping” utility which uses an ICMP request and ICMP reply message. When a certain host of port is unreachable, ICMP might send an error message to the source. Another example of an application that uses ICMP is traceroute. ICMP messages are encapsulated in IP packets so most people would say that it’s a layer 4 protocol like UDP or TCP, However, since ICMP is a vital part of the IP protocol it is typically considered a layer 3 protocol. The header that ICMP uses is really simple, here’s what it looks like: hips networklessons.comvlscoleenp-rauteiemp-ntemet-contro-message-protocol 18 1312/25, 12:44 PM ICMP (Internet Control Massage Protocol) Get Unlimited Access to 807 Cisco Lessons Now (sign up | use type 3 for destination unreachable messages The second byte called code specifies what kind of ICMP message itis. For example, the destination unreachable message has 16 different codes. When you see code 0 it means that the destination network was unreachable while code 1 means that the destination host was unreachable. The third field are 2 bytes that are used for the checksum to see if the ICMP header is corrupt or not. What the remaining part of the header looks like depends on the ICMP message type that we are using. Ifyou are interested, here is a full list with all ICMP codes and types. To show you some examples of ICMP in action, let's look at some popular ICMP messages in Wireshark. 1. Wireshark Captures 1.1. ICMP Echo request and reply Let's start with a simple example, a ping. | will use two routers for this: 1 192.168.12.0 /24 Fa0/0-—————F a0/0 Let's send a ping from R1: hips networklessons.comvlscoleenp-rauteiemp-ntemet-contro-message-protocol 29 ICMP (Internet Control Massage Protocol) Get Unlimited Access to 807 Cisco Lessons Now Success rate is 100 percent (5/5), round-trip min/avg/max = 4/21/64 ms Here's what it looks like: ‘cert Poxocl versfon dy atc: 189.168.42 GME.A6NA0 1), os 03.468 48.2 Gat.168.12.9 baa sakalicanaal Seectsae ET TST deresFter (Ge): 0 (Oxo000) MareiFter (hep! B (010000) Sxquence rasber (2e)" 1 Coro) Sequence runber (Le): 256 COxo109) wba C2 bes) sta eneeG08ECOnL Leos dadcdsdcdadcaedadcdabcdadcs Tenens 23 The message above is the ICMP request, you can see it uses type 8 and code 0 for this. When R2 receives it will reply: 1 Enternt Protocol Yersion ty Sres 192 360,32-2 (192,16822-2), bet: 192-268-42-1 (42-360.22-2) Excvence otber (he) 1 (voon) Exsuenee mnber (LE): 258 Cnta00) [isu anes at [lesporee tine® 4€.296 re] oss Ca mess) acs o0S09000901doabedabcasbccabcdabdabcdabc da (teach! 72) The ICMP echo reply is a type 0 and code 0 message. 1.2, Destination Unreachable Another nice example to look at is the destination unreachable message. We can test this by adding an access-list on R2 that denies ICMP messages: -ntps:Inetworklessons.com/ciscoleonp-routelemp.internet-control message-protocol essons © 3 372125, 12:44 PM ICMP (Internet Control Massage Protocol) Get Unlimited Access to 807 Cisco Lessons Now Now let's try that ping from R1 again: Ri#ping 192.168.12.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.12.2, timeout is 2 seconds: uuu Success rate is @ percent (0/5) The ping fails and you can see the U (unreachable) messages on R1. Here's the ICMP message that R2 sends: “Tiere: frees yesion 4 re; I atha.? Gae lee ifD, te iat? Gs seh. 12. cio eaten ‘Beeeeerotce orion 4 see atzaneana GAMERA, sts AMEE GE Biber ent MTSE events ono (ce onto: oeFanit EEK Ono: HoE-r (ot EN-apae Trangord) 1322) wena cecoun 230 (al atin sshd] SoreesQotasnazd Gorges) Seitneon sense Gis) ‘ance ruber (3 8 fnto00) essons © The ICMP destination unreachable message is a type 3 and it’s using code 13 because this packet was “administratively filtered” (acces-list). 1.3. Traceroute -ntps:Inetworklessons.com/ciscoleonp-routelemp.internet-control message-protocol 372125, 12:44 PM ICMP (Internet Control Massage Protocol) Get Unlimited Access to 807 Cisco Lessons Now Riftraceroute 192.168.23.3 probe 1 Type escape sequence to abort. Tracing the route to 192.168.23.3 1 192.168.12.2 52 msec 2 192.168.23.3 68 msec Cisco 10S by defautt will send multiple probes. For this demonstration | only need one probe. Here's the first packet that R1 sends: “imurgt prococl Vesion#y ee! ot-isbaz 2.tett2.), be! M-teh28.2 GS2-166289) ss Diftereetatea Services r141e: 0100 (ace Oxo: etaute: FEW: O00: AUE-EET (ho EEN-copSBTE ranspOrED? w Kener cece: Oasm Coa ation dashed) seinacion: tah fan 30) Gain 2.2) Faire oe focrina Decinaton sort) aseb8 G4 teense s chedsia tsa atteaionefsae8} {Serean inde 1 Cisco |OS uses UDP packets with a TTL value of 1 and destination port 33434, The TTL and destination port will increase for every hop. Once R2 receives this packet it will reply like this: essons © -ntps:Inetworklessons.com/ciscoleonp-routelemp.internet-control message-protocol 59 372125, 12:44 PM ICMP (Internet Control Message Protocl) Get Unlimited Access to 807 Cisco Lessons Now 2 mena orca vrson 4, fe: BAKE. CDAD), me MAES DARA Sider" Length: 20 bytes olan te eee: ono Ce ete om: ME a oH aD ‘esiraeion: aa-t66 2303 Cse68 23.9) (eerie ed Sexitates ers et Ge Here's where ICMP comes into play. R2 will send an ICMP type 11 (time to live exceeded) message to R1. Once R1 receives this, it will send its second probe: ahora en cas a Se ee ee iareetaces Sev icez ria: 180 (ner on00: seat cow 000 ° 2 2 Tet f ican: onze (43) Oe eter daca ats (at tctioneteaed] Sexreestoetsciea (oe init) {fooree cei: vitrwn) [ostinato cath” tra) + wa ata mronoon se Pores M479 ABE), ee rR BS BBR Above you can see that the TTL is now 2 and the destination port number has increased to 33435, Once R3 receives this packet it will reply like this: -ntps:Inetworklessons.com/ciscoleonp-routelemp.internet-control message-protocol 6 372125, 12:44 PM ICMP (Internet Control Massage Protocol) Get Unlimited Access to 807 Cisco Lessons Now tages Zevices Fels 19 (OC O00: BONE EEK OH: HoR-ET Ct ENA TaD? oes 5) sheer theckoan: @x1530 (voli on sabes) Saree (Setar Go iain sui a) ashe 2.3) R3 will reply with a type 3 destination unreachable message. Take a close look at the type and code. The type tells us the destination is unreachable. This could mean that the remote host or network is unreachable, However, the code is number 3 which means port unreachable. R3. uses this code because nothing is listening on UDP port 33435, R3 replies to R1 and sets this code, so R1 at least now knows that R3 (192.168.23.3) is reachable, it’s just not listening in UDP port 33435. 2. Conclusion You have now seen what the ICMP is used for, what the header looks like and what some of the most popular messages look like. If you have any questions, feel free to leave a comment in our forum! Previous Lesson Next Lesson TCP Bandwidth Delay How to configure static route Product on Cisco 10S Router essons © -ntps:Inetworklessons.com/ciscoleonp-routelemp.internet-control message-protocol 78 372125, 12:44 PM ICMP (Internet Control Massage Protocol) Get Unlimited Access to 807 Cisco Lessons Now IF R3 will reply with a type 3 destination unreachable message then how come you mentioned At least R1 now knows that 192.168.23.3 is reachable at the end? ReneMolenaar Hilynkaran, When R3 sends the IP packet, it will use 192.168.23.3 as the source address. You can see this in the wireshark capture. Rene Ji) 2amanruba HiRene, How Can I block Traceroute, if dst port not fixed 72 What will be the exact Port number . You mentioned the dst port number will be 33434 and increase by 1 but | found from host the port is $1890 and dont increase by one . Please do me clear on it Thanks a lot brit © zaman 4 2 a ReneMolenaar Hi Zaman, -ntps:Inetworklessons.com/ciscoleonp-routelemp.internet-control message-protocol 8 372125, 12:44 PM ICMP (Internet Control Massage Protocol) Get Unlimited Access to 807 Cisco Lessons Now HiRene, Why do we need to use UDP in traceroute? We have other commands like ‘nmap to check if a particular port is listening for connections. | was thinking traceroute is used to just check IP connectivity, for which ICMP is sufficient. 1 83 more replies! Ask a question or join the discussion by visiting ‘our Community Forum Disclaimer Privacy Policy Support About © 2013 - 2025 NetworkLessons.com essons © -ntps:Inetworklessons.com/ciscoleonp-routelemp.internet-control message-protocol 9

You might also like