Ip – OSI layer of Neighbor Discovery Protocol

icmpv6ipipv6ndposi

NDP operates using ICMPv6 and, even though ICMPv6 messages are encapsulated in payload field of IPv6 datagram, ICMPv6 and ICMP are usually considered as network layer protocols. At least, on Wikipedia they are network layer protocols.

So I thought that NDP, thus, is also network layer protocol. However, on Wikipedia it is directly stated that it is a link layer protocol:

The Neighbor Discovery Protocol (NDP, ND)[1] is a protocol in the Internet protocol suite used with Internet Protocol Version 6 (IPv6). It operates at the Link Layer of the Internet model (RFC 1122), and is responsible for gathering various information required for internet communication, including the configuration of local connections and the domain name servers and gateways used to communicate with more distant systems. [https://en.wikipedia.org/wiki/Neighbor_Discovery_Protocol]

So my hypothesis is that NDP is considered as a link layer protocol because ICMPv6 messages used by NDP (Neighbor Solicitations, Router Advertisements, Redirects and so on) never leave the local network — the same as ARP messages never leave the local network. Am I right?

Thank you for attention.

UPDATE 1:

Well, I realized that the point which is most interesting to me is — if it is right that NDP ICMPv6 messages never leave the bounds of local network?

UPDATE 2:

Though it looks like nothing can actually prevent me from sending Neighbor Solicitation to any host in the Internet. ICMPv6 is routable. So I can choose any destination IPv6 including that which is outside my network.

Best Answer

First of all: In every "model" you will find some aspects that do not describe the reality correctly. This is true for "models" in computer science, financial theory, politics or any other field of science. As the word already says, the "OSI model" is a "model" so it does not describe the reality correctly in all aspects.

Especially the question "what layer is the protocol XYZ" often has no definite answer: Think about tunneling IP packets in HTTPS connections in a VPN session.

However, the so-called "TCP/IP model" (which is a simplified alternative to the OSI model) sees ICMP packets in the layer corresponding to OSI layer 3, not layer 2.

This model does not see ICMP as own layer-3 protocol, but as part of the IP protocol (which is clearly layer 3):

Placing NDP in any other layer than layer-3 would imply that this protocol works together with any layer-3 protocol (e.g. NDP can be used together with IPv4). However this is not the case.

It would have been possible to place NDP between layer-2 and layer-3:

ARP for example is placed "between" layer-2 and layer-3 (Wikipedia says "layer 2.5") to indicate that this protocol will only work together with certain combinations of layer-2 and layer-3 protocols. (As far as I know ARP only works with the combination IPv4 and Ethernet).

However this is not true in the case of NDP: NDP should work with every layer-2 protocol.

Well, I realized that the point which is most interesting to me is -- if it is right that NDP ICMPv6 messages never leave the bounds of local network?

  1. This criterion is not sufficient to say that a protocol is on layer 2:

    DHCP also never leaves the local network - however DHCP covers OSI layers 5-7.

  2. There is at least one case I know where NDP messages travel around the world:

    When using IPv6 using Teredo!

Related Topic