12

ICMP is categorized as a layer 3 protocol in the OSI model, but as far as i can tell it does not meet the definition of a network layer protocol.

It does not provide addressing or packet routing (it uses IP for this), so all it does is send information from one node to another node, like a transport protocol. So, given that, why is ICMP categorized as a layer 3 protocol?

HopelessN00b
  • 53,385
  • 32
  • 133
  • 208
Robbie Mckennie
  • 1,083
  • 1
  • 8
  • 21
  • It can also tell you which way traffic goes, confirm the existence of hosts, inform the sender of problems, and above all, to work, it *needs* IP address – NickW May 30 '13 at 14:41
  • all of the things you mentioned i believe to be mere forms of moving information about. i agree it needs IP, but surely this is a reason for it to be placed in a layer above IP in the stack. – Robbie Mckennie May 30 '13 at 14:47
  • 1
    There are too many layers anyways :) – NickW May 30 '13 at 14:47
  • Even in the TCP/IP model i believe ICMP should be in the transport layer, not the internet layer – Robbie Mckennie May 30 '13 at 14:49
  • Unfortunately the RFCs closed a while ago, but if you're positive you can convince people, you can probably propose a new one to supersede it. – NickW May 30 '13 at 14:52
  • 1
    I suppose i mispoke when i said it SHOULD be in the transport layer. I meant that it appears to be out of place in the network layer, so what is the explanation for it saying there? Of course i assume that everything has a reason, sometimes i'm wrong. – Robbie Mckennie May 30 '13 at 14:54
  • I'd say probably because by itself it doesn't exactly fit into either layer, and doesn't merit a layer unto itself? – NickW May 30 '13 at 14:57
  • 7
    It is important for you to realize that the Internet does not fit cleaning into the OSI model. In fact RFCs (3439 2.4) mention that they consider layering to be harmful when people try to be too strict about it. ICMP is basically required for IP, so one could argue it belongs as part of IP. ICMP is basically the error notification feature of IP. TCP/UDP uses IP for error messages (port unreachable). PMTU is done by ICMP. So ICMP certainly lower the TCP/UDP. You need to simply accept that **in TCP/IP there are no rigid borders between the layers**. It only matters that something works. – Zoredache May 30 '13 at 16:55
  • In any case. Wikipedia seems to indicate that the Network layer is the best fit. http://en.wikipedia.org/wiki/Network_layer – Zoredache May 30 '13 at 16:56
  • Terrible decision to close this question. – lobi Sep 28 '16 at 17:36
  • @Zoredache, Actually it can be done if we are not concerned about speed isn't it? TCP should run its own TCMP instead of using ICMP. – Pacerier Jun 16 '17 at 10:19

2 Answers2

17

ICMP is actually at the "top" of the layer 3. It uses the IP protocol to deliver data to a remote host. In other words, ICMP messages must be encapsulated in IP packets.

Consider it as similar to ARP which could be considered to be "at the top" of layer 2, while using the Ethernet protocol to actually send packets.

ICMP is implemented as a part of the IP layer so ICMP processing can be viewed as occurring parallel to, or as a part of, IP processing. Therefore, in the topic on TCP/IP-based layered network, ICMP is shown as a layer 3 protocol.

@Robbie Mckennie

Which layer ICMP belongs to is a subject of fierce debate. The ICMP header is at layer 4, just like TCP and UDP so people argue that it belongs in layer 4. Others however argue that ICMP is a layer 3 protocol, since it assists IP and has no concept of ports.

For me, classification of a protocol as belonging to a certain layer in the OSI model depends on how protocol works. An example:

BGP is used to route at layer 3, but BGP itself is carried by TCP ( and of course IP )

cuonglm
  • 2,346
  • 2
  • 15
  • 20
  • So you're saying it's classified as a layer 3 protocol because of the way it's processed in the stack, not because of what it does? – Robbie Mckennie May 30 '13 at 14:52
  • 3
    No, It works at layer 3. For everything it does, it is at layer 3. The important thing you should ask your self, `What is the "data unit of layer 4 protocol"?` – cuonglm May 30 '13 at 15:02
  • I don't even know what that question means. I was just thinking along the lines of the definitions i've read for the different layers, perhaps my idea of how the osi layer model works is incorrect – Robbie Mckennie May 30 '13 at 15:08
  • 1
    Ops, just a hint.`data unit of layer 1 is bits`, `data unit of layer 2 is frames`, `data unit of layer 3 is packets`. What is about layer 4? – cuonglm May 30 '13 at 15:15
  • To answer cuonglm: the PDU of layer 4 is a "segment" – lobi Sep 28 '16 at 17:33
  • to further Robbie's personal classification, ask yourself this: "If BGP works, then have I verified layer 4 connectivity", the answer is yes because BGP relies on TCP. Likewise, "If ICMP works, then have I verified layer 4 connectivity", the answer is no, but if the question was "...have I verified layer 3 connectivity", the answer is yes. With this thought process, ICMP is a "layer 3 protocol" that relies on another layer 3 protocol (IP). – lobi Sep 28 '16 at 17:36
  • @cuonglm, "The ICMP header is at layer 4" meaning? – Pacerier Jun 16 '17 at 10:22
  • @cuonglm, "but BGP itself is carried by TCP" is this even real? Then without the invention of TCP, IP cannot work? – Pacerier Jun 16 '17 at 10:23
6

ICMP (and ICMPv6, IGMP, etc) all manage the Network Layer connections. They are not (typically) used by end users, but by the Operating System. For that reason, it belongs in Layer 3 (Network) even though it relies on IP for addressing and path determination (routing).

The OSI model is largely written from the prospective of connecting users (actual people, or application servers). All the management protocols and whatnot still fit in the OSI model, but will not seem to quite match the language because they not (typically) serving users directly.

Chris S
  • 77,337
  • 11
  • 120
  • 212