The difference between icmp and ping

The ping program is used to detect whether the host can communicate with the host. If it cannot ping to a host, it indicates that the host cannot be connected. The ping uses the ICMP protocol, which sends an icmp echo request message to the destination host. The ICMP protocol specifies that the destination host must return an ICMP echo reply message to the source host. If the source host receives a response within a certain period of time, the host is considered reachable.

The ICMP protocol is sent over the IP protocol, which is a connectionless, unreliable packet protocol. On Unix/Linux, the serial number starts counting from 0 and is incremented. The ICMP serial number of the Windows ping program is irregular.

ICMP protocol in the actual transmission of data packets: 20 bytes IP header + 8 bytes ICMP header + 1472 bytes "data size" 38 bytes

ICMP message format: IP header (20 bytes) + 8-bit type + 8-bit code + 16-bit checksum + (different types and codes, formats are also different)

The difference between icmp and ping

First of all, icmp and arp are irrelevant! The icmp is carried on the network layer. His protocol number seems to be 1, and there are 8 types such as host unreachable, timeout, etc. This is a control information protocol used to test network connectivity. ARP is the most important protocol address resolution protocol in Ethernet technology. It carries the second layer type number of osi as if it is 806. Because Ethernet is a kind of multi-access, it must be used to resolve its physical MAC address. To use the ARP protocol, the destination MAC address of the request packet sent by this protocol is all 1 broadcast address, the reply packet is sourced by its own mac and IP address, and the destination address is encapsulated into frames after the destination host MAC and IP address are targeted. Go out! Although it is a link layer protocol, but he has the concept IP address of the network layer, I have seen the packet type 800 in the ARP protocol. This is the type of IP protocol, because he wants to use the IP address to resolve the MAC address. Therefore, each device above the network layer will have an ARP-based cache. The command in the route switching device is show arp! The command in windows is arp -a,

With this kind of cache, the speed of Internet access is greatly improved! Well, I said so many possible landlords think that I am talking nonsense! Then I started asking what I answered!

First, the ping command is a form of ICMP, it belongs to ICMP, of course, tracert also belongs to ICMP! ICMP has nothing to do with ARP, one is the network layer protocol, and the other is the data link layer protocol! There is no intersection in terms of functionality. The only thing in common is that they all involve IP addresses.

Second, I won't write any UBOOT code, but since it is hosted on the internet, then he should follow the network architecture. In order to unify the network, the IEEE and the International Organization for Standardization ISO define the access layer and the upper layer protocol standard! When you ping, the ARP frame will be sent because you are sending an ARP in an Ethernet environment because there is no communication address of the other host when the computer is just started!

Ping is to test the connectivity with the other host, so you need to know the address of the other host. Although you know the destination IP address, but also need its MAC address, so the ARP frame will be sent before ping, the ARP default cache aging in the host. The time should be 10 minutes. That is, the ARP cache entry is automatically cleared after 10 minutes of ARP parsing.

Third, the arp frame transmission and recovery is really different! One broadcast is one unicast

Ping work process -

Suppose host A's IP address is 192.168.1.1 and host B's IP address is 192.168.1.2, all in the same subnet. What happens when you run "Ping 192.168.1.2" on host A? ?

First, the Ping command constructs a fixed-format ICMP request packet, which is then passed by the ICMP protocol along with the address "192.168.1.2" to the IP layer protocol (as with ICMP, which is actually a set of background running processes). ), the IP layer protocol will use the address "192.168.1.2" as the destination address, the local IP address as the source address, plus some other control information, construct an IP data packet, and find the IP address 192.168 in a mapping table. The physical address corresponding to .1.2 (also called MAC address, familiar with the network card configuration friends will not be unfamiliar, this is necessary for the data link layer protocol to construct the data link layer transmission unit - frame), and hand it to the data Link layer. The latter constructs a data frame, the destination address is the physical address transmitted by the IP layer, the source address is the physical address of the machine, and some control information is added, and they are transmitted according to the medium access rule of the Ethernet.

The mapping table is implemented by ARP. ARP (Address ResoluTIon Protocol) is an address resolution protocol, which is a protocol for converting an IP address into a physical address. Specifically, ARP resolves the address of the network layer (IP layer, which is equivalent to the third layer of OSI) to the MAC address of the data connection layer (MAC layer, which is equivalent to the second layer of OSI).

The difference between icmp and ping

After receiving the data frame, Host B checks its destination address and compares it with the physical address of the machine. If it matches, it receives it; otherwise, it discards it. After receiving the data frame, the IP data packet is extracted from the frame and delivered to the local IP layer protocol. Similarly, after the IP layer checks, the useful information is extracted and then handed over to the ICMP protocol. After the latter processing, an ICMP response packet is immediately constructed and sent to the host A, and the process is identical to the host A sending the ICMP request packet to the host B.

That is, it is transmitted by the IP address at the network layer, and then transmitted to the destination host by the data link layer according to the mac address.

Geekvape Vape

Geekvape Vape,Geek Bar Disposable Vape,Geek Bar Vape Kit,Geek Bar Vape Pod

tsvape , https://www.tsecigarette.com

Posted on