15

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?

11
  • 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, 2013 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.
    – Rob M
    May 30, 2013 at 14:47
  • 1
    There are too many layers anyways :)
    – NickW
    May 30, 2013 at 14:47
  • 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.
    – Rob M
    May 30, 2013 at 14:54
  • 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, 2013 at 16:55

2 Answers 2

18

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 )

8
  • 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?
    – Rob M
    May 30, 2013 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, 2013 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
    – Rob M
    May 30, 2013 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, 2013 at 15:15
  • To answer cuonglm: the PDU of layer 4 is a "segment"
    – lobi
    Sep 28, 2016 at 17:33
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.

Not the answer you're looking for? Browse other questions tagged .