IP foundation --ARP protocol

xiaoxiao2021-03-06  44

Address Resolution Protocol is responsible for the conversion between IP addresses and NIC entity addresses (Macs). If you have a relatively clear understanding of the online seven-layer protocol, you should know that each level is used to use its respective agreements.

We often treat TCP / IP as an agreement, but in fact, TCP is working on the transfer layer and IP works on the network layer. TCP / IP Agreement is better than the intermediaries between the program and the network, but many of the troubles of both parties.

We already know in the "Internet Introduction" to use different agreements to use different agreements to make nodes to transfer, such as Ethernet CSMA / CD (IEEE802.3) and Token Ring token Pass (IEEE802.5) ). Those agreements can be said to work in the Datalink level. I will not seriously tell their work in this, I am interested, please go through it.

I am not intended to explore how to communicate between the program and TCP, but it is briefly to see how the package is passed from an IP to another IP.

ARP is used in local network

Take the Ethernet network using TCP / IP as an example, each computer has an ARP table (ARP TABLE) is stored in ARP Cache, which mainly records IP and Mac in each node in the same network. Corresponding to the address.

When the machine has a TCP / IP package to send out

Will first look at whether the destination address belongs to the same network (Remember the role of the NetMask and IP above) If so, check the ARP form There is no other IP and Mac, if any, will pass the package directly to The MAC will go to the Internet if the other party cannot find the corresponding to the network, the ARP Request Broadcast Pack Packet Query the MAC address of the other party, this package contains the transmitted MAC information. When the machine above the network answers to the broadcast to see IP Whether the column is unanimously ignored If it is ignored If you will update the sender's Mac and IP data to your own ARP table and then respond to an ARP Reply package to the other party will be updated after the sender is connected to the ARP Reply. Your own ARP table can then use this record. Otherwise, the declaration failed.

The query process of the ARP can be referred to the picture below

ARP in cross-network environment

We already know that if the IP transfer of NET IDs can be done by ROUTER. Then when the machine finds that the package is not transmitted to the local network, it will pass the package to Router. Remember that Router must have an interface and send the same network. This router. We can use DHCP to specify you can also specify on each machine. If the local network is also a few online connections, there are several Router to choose we must also specify in the IP environment on each machine. (We will discuss in detail in the following RIP).

The cross-network process of ARP is rough as follows

Check if the package is sent to the local network if it is not given to Router If there is no Router recorded if the ARP form does not have the record of the Router, then the Router will judge the next Router's Mac and then pass the package. The destination RouterRouter also checks the ARP form or uses the ARP Request to find the MAC of the destination host to finalize the package to the destination IP address.

View ARP Record

If you have to query the ARP form in your Windows98 you can use this command

C: /> arp -a interface: 192.168.0.15 on interface 0x1000002 Internet Address Physical Address Type 192.168.0.17 00-80-C7-47-8C-9A Dynamic 192.168.0.7 00-80-C7-47-8C-9A Dynamic

This way you can see that some systems in IP and Mac will use host names and Mac, but if you return to IP in the IP network, you will be able to pass a package.

Waiting for a while, you will use this command after you will use this command, you will see the content of the ARP table. However, these records generated in cache If they are not used within 2 minutes, they will be removed if they are used. If they are used, they will become 10 minutes. We call this record as a dynamic record.

When our local networks, some IP addresses are often used, such as archive servers and Router, etc. In order to reduce ARP REQUEST broadcasts, we can use ARP -S IP Mac (such as Arp -S 192.168.1.2 48: 54: E8: 27: 75:77) Create a static ARP record. Here, I have to point out a little bit is on a MAC address you can correspond to several IP addresses. We are set to ip aliase or Virtual Host. When you need to build several virtual sites on a single host, you will use Arrived.

RARP and Proxy ARP

Reverse ARP is used to use Some system services that are used to reverse the IP address from the Mac will be used. For example, your diskless (Diskless) workstation uses Boot ROM to log in to the network to start it doesn't know what your IP is. Then it can first send a RARP package, such as other hosts on the Internet, can be set to answer the RARP query and know that its IP can respond. This disk workstation will know your IP address.

Rarp's query process can be refer to the following figure

Usually each machine will only answer the IP address query on itself but can also respond to the IP of other machines to respond to this function as Proxy ARP. Proxy ARP Sometimes you can proxy the next stop of the router to answer the ARP query. It is also very useful on the PPP's callback network.

转载请注明原文地址:https://www.9cbs.com/read-58851.html

New Post(0)