当前位置:网站首页>Understand what ICMP Protocol is
Understand what ICMP Protocol is
2022-06-25 06:21:00 【Programmer community】
Messages on the network are not always transmitted and received smoothly , Sometimes it may be due to the gateway MTU It is too small and the message is not allowed to be fragmented, so the message cannot be forwarded by the gateway , Sometimes it may be due to TTL The value is reduced to 0 And cannot continue to send or receive , It is also possible that the message cannot be received by the receiver due to the problem of the header parameters , These problems , You can't simply discard the process . If you discard it without telling the source host , The source host will think that it was sent successfully , This will cause the information of communication parties to be out of sync , And then cause even greater failure . therefore , While discarding the message , The source host must also be informed of the reason for discarding , It is through ICMP The message carries relevant information
ICMP
ICMP
Internet Control Message Protocol, It's on the network layer , yes IP A component of a layer , It is mainly used to transmit error messages and other information that needs attention

icmp The protocol is an integral part of the network layer , therefore icmp Message has ip First floor , I didn't put icmp It's written in icmpHeader+icmpPayload, because icmp There are many types of messages , It's caused icmp The message structure is not identical
What's the difference ? Let's take a look first icmp message General format

All types of icmp All messages have 1 Bytes of Type、1 Bytes of Code and 2 Bytes of Checksum, And then according to Type and Code Values are different , To determine the Message Body Different
- Type
Message type , Used to represent a message
- Code
Code , Provide further information about the message type
- Checksum
The checksum ,icmp Checksums only cover icmp message
- Message Body
The length and content of the field , Depending on the type of message and the code
ICMP Message type
ICMP Echo Request/Response
Used to detect IP Of network connectivity Ping/Tracert, Is that we are cmd Window ping The operation of
ICMP Destination unreachable message
IP Is a best effort delivery mechanism , Datagrams are not easily discarded . When Routing devices Unable to forward or deliver IP The data tell the time , It will send a message unreachable to the destination station to the source station , Then discard the datagram
This is what we mentioned in the preface because of the routing device MTU It is too small and needs to be divided , However IP message DF Flag bit not allowed , This makes it impossible to forward , At this time, the route will discard the message and send a message to the source host at the same time ICMP Destination unreachable message
ICMP Redirect message
ICMP Redirect message is ICMP One of the control messages . Under certain circumstances , When the router detects that a host or network device uses a non optimized route , It sends a message to the host or network device ICMP Redirect message , Request the host or network device to change the route . The router will also forward the initial datagram to its destination
ICMP Time Exceeded
When I received TTL by 0 The message of , Network devices / The host will discard the message , And return a ICMP time exceeded message
ICMP Parameter problem message
If the received packet is found to have a problem with the header parameters , When packet parsing cannot be completed , The Internet / The host will discard the packets , And may return a ICMP The parameter problem message is sent to the source
When the IP Head , perhaps TCP Head , perhaps UDP A parameter error occurred in the header , The receiver is unable to complete the packet parsing , The packets will be discarded , And return a icmp Parameter problem message
ICMP The source side is closed
Used to indicate that the other party or the server in the middle is busy and cannot respond . If the network device does not have enough cache space to store messages to a destination host , These messages will be discarded by the device . here , The network device sends ICMP The source side is closed and the message is sent to the Destination host . If a packet arrives at a host too fast , Too late to be handled by the host , Then the host can also send ICMP The source side is closed , In order to reduce the packet rate
Last , All the above are ICMPv4 agreement , be based on IPv4 Agreed icmp message ,ICMPv6 It has its own definition and format
边栏推荐
- Vscode voice notes to enrich information (Part 1)
- [open source sharing] deeply study KVM, CEPH, fuse features, including open source projects, code cases, articles, videos, architecture brain maps, etc
- Getting started with mongodb
- D compile time reflection
- Analysis report on investment and financing status and operation benefits of global and Chinese dental industry (2022 Edition)
- Wind farm visualization: wind farm data
- Talk about TCP and UDP
- SAP ui5 beginner tutorial No. 28 - Introduction to the integration test tool OPA for SAP ui5 applications
- Wechat applet authorization login + mobile phone sending verification code +jwt verification interface (laravel8+php)
- Grep command – powerful text search tool
猜你喜欢
The e-book "action guide for large organizations to further promote zero code application platform" was officially released!
SAP ui5 application development tutorial 32 - how to create a custom SAP ui5 control

Socket, network model notes

3-7sql injection website instance step 3: attack type and attack strategy

What is the IP address

Soft exam information system project manager_ Management Science (Operations Research) 2--- senior information system project manager of soft test 034

【LeetCode】40. Combined summation II (2 strokes of wrong questions)

What happens when redis runs out of memory
![[v2.0] automatic update system based on motion step API (support disconnection reconnection and data compensation)](/img/73/2ec957d58616d692e571a70826787f.jpg)
[v2.0] automatic update system based on motion step API (support disconnection reconnection and data compensation)

Guess the size of the number
随机推荐
MySQL tuning -- 02 -- slow query log
China rehabilitation hospital industry operation benefit analysis and operation situation investigation report 2022
JS implementation mouse can achieve the effect of left and right scrolling
Explain @builder usage
C switch nested syntax
Gb28181 protocol -- timing
[road of system analyst] collection of wrong questions in the chapters of Applied Mathematics and economic management
The sum problem
[kicad image] download and installation
Research Report on brand strategic management and marketing trends in the global and Chinese preserved fruit market 2022
SAP ui5 Application Development Tutorial Part 30 - parameter transfer in the routing process of SAP ui5
Tablespace free space
Investment opportunities and operational risk assessment report of China's engineering consulting industry during the 14th Five Year Plan period 2022-2028
Optimal Parking
Digitalization, transformation?
Handling skills of SQL optimization (2)
Sword finger offer II 095 Longest common subsequence
Ping command – test network connectivity between hosts
Laravel8 fill data
Three tier architecture experiment