ICMP protocol works on which layer of the OSI reference model?

It doesn't make sense to discuss which layer the purely fragmented agreement belongs to. It can only cope with the exam and there is no benefit to understanding the agreement.

Internet Control Message Protocol (ICMP)
If we rearrange these four English words "Internet Protocol Control Message", where "Internet Protocol" is an abbreviation of IP, then this arrangement will become "IP Control Message". The function completed by the ICMP protocol is to "help the IP protocol send control messages."

The IP protocol belongs to the OSI network layer. However, knowing that these still cannot eliminate the doubts of some readers, in order to fully discuss this issue, it needs to continue.

Let’s bring out some questions…

Question 1: For the HTTP protocol, when the web page requested by the client does not exist, how does the server do?

Students will say that this is an error situation. Of course, it needs to send a specific error code and tell the client what is wrong. In order to let the client recognize the current situation, adjust their behavior in time or let the user intervene.

If there is no such "error message notification mechanism", once the error occurs, the server does nothing and just throwing the unresolved request as simple, the problem is that the client is no idea with such error and wait until the user closes the software with dissatisfaction with a "What a crap software!"

Obviously, HTTP has its own "error message notification mechanism". Since HTTP belongs to the application layer, it is called "application layer error message notification mechanism".





Question 2: How to deal with the TCP protocol once it receives a message which is no ability to process?

Students who are familiar with the TCP protocol will think a little bit and use the RST (Reset) message to tell the sender that they are currently unable to handle the abnormal situation and cannot be repaired. Only the Reset connection is the best choice.

Once the client received the reset message, As long as the reset message is valid, the receiver will unconditionally reset the current connection.

The RST message belongs to the "error message notification mechanism" of the TCP protocol. Since the TCP protocol belongs to the OSI transport layer, it is called the "transport layer error message notification mechanism".

But the RST message of TCP is very rough which has no "Error Code" so that the receiver only knows that an error has occurred but it is not known where the error occurred. This sets a big obstacle for troubleshooting. So thousands of network workers and code farmers will fall into deep thoughts when they encounter the TCP connection being reset and thinking… “What is going on?”

If TCP provides "Error Code", it will make the TCP protocol bloated at the same time as it is easy to debug. Personally, when designing these basic protocols, I still hope that streamlined and compact, minimize the size of the protocol header, and leave more space for user data transfer.

Question 3: When the host is processing IP packets, it finds that there is no program listening on the destination port then what should we do?
Students familiar with the ICMP protocol will come out without thinking, using the ICMP message to send the error message "Port Unreachable" and tell the source host with the current status.
It is correct because currently no program listening on the destination port (Listen), you cannot use the "transport layer error message notification mechanism" to notify the source host of the current error condition, so you have to retreat to the next level of the transport layer - - Network layer to handle.



We have no doubt to say IP protocol is the representative of the network layer. However, students familiar with the IP protocol will know that the IP protocol 20-byte standard header and the 40-byte extended header do not handle the error fields.
As mentioned above, if the IP protocol itself adds an error handling field, the protocol becomes no longer streamlined and will greatly crowd out the user data space but the wrong situation does not have an "error message notification mechanism" to notify the source host, which is unacceptable. Therefore, the protocol designer invented the ICMP protocol which is used to assist the IP layer to handle the "error message notification mechanism". Since this layer is located at the network layer, it is called "the network layer error message notification mechanism".

评论

热门博文