Question: how icmp messages are encapsulated?
Answer: ICMP is actually a user of the IP protocol--in other words, ICMP messages must be encapsulated within IP packets. However, ICMP is implemented as part of the IP layer. ... Therefore, in the topic on TCP/IP-based layered network, ICMP is shown as a layer 3 protocol.