Network layer control protocol ICMP packets ---

Internet Control Message Protocol ICMP

  • In order to more effectively forward the IP datagram delivery and improve the chances for success in 网络层the use of ICMP protocol.

  • ICMP is the Internet standard protocol

  • In addition, the network layer provides a reliable delivery is not, but do our best to deliver. ICMP is a network layer "best effort" of a performance.

  • ICMP allows hosts or routers report 差错the situation and provide relevant 异常reports of the situation. (.ICMP make the maximum effort that means: This is something I try to buckle down, but does not guarantee no problem, a problem I will report to you)

  • ICMP is not 高层协议, but the IP layer protocol data portion exists (IGMP same) IP datagram.

  • When fitting the IP protocol, we have mentioned several protocols over IP protocol used together (in the IP layer), which is the ARP protocol to find the MAC address, ICMP is used to report errors.
    Here Insert Picture Description
    Here Insert Picture Description

ICMP packet type

  1. ICMP 差错报告文(one of the following four cases appear to send back an ICMP error report text)
    1. End unreachable (for example: the routing table can not be found)
    2. Over time (that is, it can jump a few IP datagram fields:. 生存时间)
    3. Parameter Problem
    4. Change the routing (redirect) (could not walk the same route, found a new path)
  2. ICMP询问报文
    1. Echo request and reply messages
    2. Timestamp request and reply messages

ICMP error reporting the contents of the text

Here Insert Picture Description

  • ICMP error report message: Extract the first 8 bytes of ICMP + extracts the IP datagram header + extracts data does not match the IP datagram first 8 bytes
    1. The first part there is also some cause of the error message
    2. Break before the data portion 8 bytes to get the 运输层port number (IP datagram is the data part of the package transport layer packet, the packet has a header, which header contains a port number)
  • ICMP error message after the formation of a good report, give it to add 首部, and then send it as an IP datagram back.

Not send error report message case

  1. ICMP error messages to report no longer send corresponding ICMP error report message (sent back to process ICMP error occurred, and this time do not ignore it anymore)
  2. All subsequent packets of the data sheet of the first sheet of a fragment not send ICMP error report message. (Data are grouped, but as long as there is a wrong, the equivalent of all wrong, many times without being given)
  3. Do not send error reports ICMP packets to datagram has a multicast address
  4. Datagram is not some special address to send ICMP error report message (such as the loopback address:.

ICMP Application examples

  • PING is used to test communication between two hosts. Using ICMP echo request and reply message (inquiry message)

  • PING command is used as an example of the application layer of the network layer ICMP

  • tracert command to track the path of a packet from the origin to the end point (start to end after a number of routers, their addresses are how much)Here Insert Picture Description

    • This command may take tens of seconds longer to complete. It uses the IP datagram 生存时间TTL字段and ICMP时间超过差错报文for tracking the path from the origin to the destination, which works as follows:
      1. Xianxiang host send a final object of the packets, TTL field is set to 1. After reaching the first site times out, the original host sends an ICMP timeout error message. Such access to the relevant information needed
      2. The ultimate goal of the host again sends a message, TTL field is set to 2. . . .
      3. TTL field set to 3. . . . . Until it reaches the end of the path.
      4. How last dive site information brought it (no time-out error)?
        • Set a port number error
Published 22 original articles · won praise 0 · Views 140

Guess you like