COMPUTER NETWORK AND SECURITY

ICMP, which stands for Internet Control Message Protocol, is a network layer protocol that is a fundamental part of the Internet Protocol (IP) suite. ICMP is used to send error messages and operational information about network conditions. It is primarily employed by network devices, including routers and hosts, to communicate error messages or other information about the status of a network.

Uses of ICMP include:

  • Ping: The most well-known use of ICMP is the Ping tool, which sends ICMP Echo Request messages to check the reachability of a host on an Internet Protocol (IP) network. The target host responds with an Echo Reply.
  • Traceroute: ICMP is used by the Traceroute tool to trace the route that packets take to reach a destination. It works by sending packets with gradually increasing Time-to-Live (TTL) values, and routers along the path respond with ICMP Time Exceeded messages.
  • Error Reporting: ICMP is used to report errors in packet delivery. For example, if a router encounters a problem while processing a packet, it may send an ICMP error message back to the source.
  • Path MTU Discovery: ICMP is used for Path Maximum Transmission Unit (PMTU) Discovery, which helps hosts discover the maximum packet size that can be transmitted without fragmentation along a network path.

ICMP Packet Format

Type:

This defines the type of field message. 

Code:

For error messages, this defines the sub type of field error. 

Checksum:

The checksum is calculated by the header and the data that is used to detect the errors.

 

Data:

The packet in this section contains the complete information of the packet.

 

ICMP Message 

 

  • Error - Reporting 
  • Destination Unreachable (Type 3): This message is sent by a router or a host to indicate that the destination host or network is unreachable. It can be due to reasons like network congestion, lack of route, or firewall filtering.
  • Source Quench (Type 4): A router can send this message to request the sender to slow down the rate of packet transmission. This is a way to control network congestion.
  • Time Exceeded (Type 11): This message is typically generated by routers when the Time-to-Live (TTL) field of a packet reaches zero. It's used in Traceroute to identify the routers along the path to a destination.
  • Parameter Problem (Type 12): This message indicates that there is an issue with the header of an IP packet. It may specify which part of the header caused the problem.
  • Redirect Message (Type 5): This message is sent by routers to inform a host that it should send its traffic to a different next-hop router for a specific destination.
  •  
  • Query Message 
  •  
  • Echo Request and Echo Reply (Ping) (Type 8 and 0): While not strictly an error message, the ICMP Echo Request (ping) message is used for testing the reachability of a host, and the Echo Reply is the response to the Echo Request.

Time-stamp Request  & Time stamp Reply :

The time it takes to travel a host from one host to another is detected by timestamp request & reply messages.

 

Address Mask Request & Address Mask Reply :

A host may be aware of its own IP address but it is not necessary that it is aware of its own subnet mask. To know your subnet mask sends the address mask request to the host router and the router sends this host's subnet mask address as the mask reply message. If the host is aware of the router's address, then he sends the request directly to the router, otherwise this request is broadcast.

 

Router Solicitation and Router Advertisement

The ICMP Router Solicitation Message is sent from a computer host to any routers on the local area network to request that they advertise their presence on the network. 

The ICMP Router Advertisement Message is sent by a router on the local area network to announce its IP address as available for routing.

 

 

ICMPV6

 

ICMPv6 (Internet Control Message Protocol version 6) is the version of ICMP designed for use with IPv6, the next-generation Internet Protocol. Like ICMP for IPv4, ICMPv6 is an integral part of the IPv6 protocol suite, providing various control and error messaging functions for network devices. ICMPv6 serves several purposes in IPv6 networks, including diagnostics, error reporting, and network management.

 

ICMPv6 Error Messages

 

ICMPv6 error messages are used to report errors in the forwarding or delivery of IPv6 packets. ICMPv6 error messages are Destination Unreachable, Packet Too Big, Time Exceeded, and Parameter Problem.

 

"Destination Unreachable" ICMPv6 error message:

 Destination Unreachable ICMPv6 error message is generated by the source host or a router when an IPv6 datagram packet cannot be delivered for any reason other than congestion.

 

"Packet Too Big" ICMPv6 error message:

 "Packet Too Big" ICMPv6 error messages are generated by the router when a packet cannot be forwarded to the next hop link because the size of the IPv6 datagram is larger than the MTU (Maximum Transmission Unit) of the link. 

"Time Exceeded" ICMPv6 error message: 

Similar to the Time-to-Live field value in IPv4 datagram header, IPv6 header includes a Hop Limit field. The Hop Limit field value in IPv6 header is used to prevent routing loops. The Hop Limit field in IPv6 datagram header is decremented by each router that forwards the packet. When the Hop Limit field value in IPv6 header reaches zero, the router discards the IPv6 datagram packet and returns a "Time Exceeded" ICMPv6 error message to the source host.

 

"Parameter Problem" ICMPv6 error message: 

"Parameter Problem" ICMPv6 error message is typically related with the problems and mistakes related to the IPv6 header itself. When a problem or mistake with an IPv6 header makes a router unable to process the packet, the router stops processing the IPv6 datagram packet, discards the packet and returns a "Parameter Problem" ICMPv6 error message to the source host.