Is ICMP a transport layer protocol?
Asked Answered
V

2

17

I was going through a video lecture on networking and there the lecturer mentions ICMP as a transport layer protocol. However, Googling it shows various forums describing it as network layer protocol. This has confused me a lot. Can someone clarify?

Volturno answered 7/10, 2013 at 6:48 Comment(0)
S
21

Transport layer protocols are concerned with send data from end-to-end and ensuring (or explicitly not ensuring) reliability. TCP is used to send data from one computer to another and includes logic necessary to ensure that the data is transported correctly, while UDP is used to send data from one computer to another while hopefully getting reliability.

ICMP really doesn't do this. Its job is to help the routers figure out the shape of the internet and what direction to send packets with different protocols. Consequently, it's considered a network-layer protocol, since its job is to ensure that data is routed to the right place but doesn't actually route the data.

Hope this helps!

Sedimentology answered 7/10, 2013 at 6:51 Comment(2)
The word 'typically' doesn't belong in this answer. Either it is or it isn't.Kinship
The first paragraph of RFC792, the document outlining the ICMP protocol: "ICMP, uses the basic support of IP as if it were a higher level protocol, however, ICMP is actually an integral part of IP, and must be implemented by every IP module".Crockery
H
8

No doubt it is a network layer protocol. The reasons it is often confused with transport layer is that ICMP works without ANY transport layer. E.g. ping or traceroute do not have well defined ports. Instead each machine's tcp/ip stack is responsible for processing and responding to incoming ICMP messages (rather than looking up a port and passing on to corresponding application, as is the case with all other applications).

Update:

Apparently it sounds confusing to readers, so here is snap shot from TCP/IP Illustrated by Richard Stevens explaining the concept and intent.

Quoting from the book.

"Positioning the protocol boxes labeled ICMP and IGMP is always a challenge. Earlier, we showed them at the same layer as IP, because they really are adjuncts to IP. But here we show them above IP, to reiterate that ICMP messages and IGMP messages are encapsulated in IP datagrams"

TCP/IP Layers from RS - TCP/IP Illustrated

Teaching the concept that "some protocols and applications" work differently from the standard concept of each layer being responsible for a different task (transport being end to end, where as network being hop to hop) is tough and takes time to digest.

The next most critical thing to learn is,

Even if you ping using multiple say consoles from the SAME machine to another, it STILL is able to keep track of all individual, so called connections (just relating the message exchange, otherwise there is no connection like tcp).

How the above is done, is OS specific. The Linux stack puts 8 bytes in data field of ICMP, which contains ports from which the original application layer triggered. This is also explained in the same book under the ping program.

The same applies to lower layer protocols such as ARP/RARP.

Heyde answered 7/10, 2013 at 7:19 Comment(9)
When exactly is it 'often confused with transport layer'? I've never seen it, apart from in this question. The fact that it works without a transport layer isn't any kind of evidence that it is in the transport layer. Otherwise everything would have to be in the transport layer. You're just adding to the confusion here.Kinship
For one, learning through OSI model, i have seen students assuming there is always a transport layer of some sort. Not seeing that around makes them think ICMP handles transport on its own. Learning first that there is always a port to identify an application and then learning about the exception which works without ports is new. Even the bible by Stevens LISTS ICMP in some what mingled territory stating that it is like transport in one sense and network in the other. I have a hazy picture of stack in mind. Would look that up to quote here.Heyde
Moreover, don't see what makes you think it is confusing. I explained how TWO most common applications of ICMP work which is always a question in a student's mindHeyde
@EJP, added a good deal of material explaining the intent. Still didn't quite get what seemed confusing to you.Heyde
I didn't say I was confused about ICMP myself. What is confusing is why anybody would think it's a transport layer protocol in the first place, or the line of reasoning that you claim underlies it, which doesn't actually make sense, as I noted. Of course if people persist in teaching the obsolete and inapplicable OSI model with reference to TCP, which has its own, prior, model, anything could happen I guess.Kinship
I only meant to ask "what sounded confusing in my description". I explained above why some one would related it to a transport protocol. "doesn't make sense" is not much of an argument for any thing without ANY rationale at all. is it? And the reference was TCP/IP illustrated, which ONLY talks about the real TCP/IP as opposed to ANY other bookish text.Heyde
Don't know about you, but this is the very real networking knowledge needed, and asked about in core programming positions in networking. Just FYI TCP/IP programming for all sorts of networking equipment ranging from servers to specialized network processors catering 10s of gigabits of traffic per second is what i have been doing for almost a decade. So these points are core to any one doing low level network programming. Academia was only a part time thing though i agree it does teach OSI as opposed to tcp/ip, but that is not the point hereHeyde
The book "Linux Kernel Networking" (in ch3) says ICMP is a Layer 4 (Transport Layer) protocol. I'd be on Stevens' side on this dilemma, though. amazon.com/Linux-Kernel-Networking-Implementation-Experts/dp/…Retain
@holgac, I heard a Stanford professor add a caveat "strictly speaking its a transport layer protocol, but its really there to serve the network layer", BUT I'll take the word of the creator; plus the following makes more sense & it may for you too . RFC792, the document outlining the ICMP protocol: "ICMP, uses the basic support of IP as if it were a higher level protocol, however, ICMP is actually an integral part of IP, and must be implemented by every IP module". I'm inclined to believe, since every IP module needs it, it's a network protocol.Crockery

© 2022 - 2024 — McMap. All rights reserved.