[Computer Network] ARP protocol and DNS protocol

The change process of data packets during transmission

Before talking about ARP and DNS, we need to know how data packets change during transmission.

Insert image description here

As you can see from the picture, the original data of the sender is initially in the application layer, then the UDP header is added to the transport layer, the IP header is added to the network layer, and the frame header, frame tail and CRC check are added to the physical layer. , and then the receiver will verify and unpack it layer by layer until the original data is obtained at the application layer.

Unicast multicast and broadcast

Insert image description here

Unicast means one-to-one, broadcast means whether the target device is within the range, and multicast means whether the target device is the device to send.

ARP protocol

Insert image description here

Address Resolution Protocol is a TCP/IP protocol that obtains a physical address based on an IP address. It is used between two-end devices before sending and receiving data during communication. If you do not know the MAC address of the other end, you can obtain it through the ARP protocol.

The ARP protocol spans the data link layer and the network layer, so its upper layer protocol is the IP protocol

The process of implementing the ARP protocol is that the own device will send an ARP Request broadcast, then all devices connected to the current router will receive this broadcast, and the destination MAC in the data packet will be filled with 0. All devices that receive this broadcast will see their own Is the IP of this broadcast the destination IP? If not, the packet will be discarded. If it is, an ARP Reply unicast will be returned, and then communication can begin.

ARP proxy

When the sending end broadcasts an ARP request, no host on the local network will respond (because the IP address is from the external network). At this time, the router will respond to the request, and the sending source will think that the router is the destination host and will forward all the messages. Give it, and then the router forwards the packet to the external network, then the router is called an ARP proxy.

Free ARP

When the host is powered on and configured, it will send an ARP request message with the destination IP address being its own IP address. This message is called free ARP and has two functions:

  1. Let the host confirm whether there is a host with the same IP address as its own on the local network. If so, an error message will be returned.
  2. Tell the entire broadcast domain what the MAC address corresponding to a certain IP is - this behavior is like sending out a leaflet, and the leaflet does not require a response. If the receiving host's ARP cache already contains the sending source host's IP-MAC pair, it will be updated. Otherwise, the sending source's IP-MAC pair will be cached.

Routing data forwarding process

Insert image description here

The original device and the destination device are not connected to the same router and need to be forwarded through multiple routers to connect.

Every time data is sent, the source IP is the IP address of the current device, the source mac is the mac address of the initial device, the destination ip is the ip address of the final device, and the destination mac is the next hop mac (searched through the routing table)

DNS protocol

Domain name resolution protocol, the DNS server resolves memorable domain names into IP addresses

**Process:**The network client transmits the domain name to be accessed to the local DNS server. If it exists in the cache, it will directly return the IP address. If not, it will access the DNS root server. If it is found to be a .com domain, then the local DNS server will access it again. com domain server and find that it is the .163.com domain, then visit the .163.com domain server again to find the IP address.

Guess you like

Origin blog.csdn.net/jia_03/article/details/132698596