CCNA learning record (three) simulation to understand the ARP protocol

Topology

Configuration

Router R2:
GigabitEthernet 0/0/0 IP Address: 192.168.1.1Subnet Mask: 255.255.255.0
Serial 0/1/0IP Address: 192.168.1.2Subnet Mask:255.255.255.0

PC0:
IP Address: 192.168.1.2 Subnet Mask: 255.255.255.0

PC1:
IP Address: 192.168.1.3 Subnet Mask: 255.255.255.0


IP terminal device configuration method

For example, click PC0 -> Desktop -> IP Configuration, fill in the IP Address, Subnet Mask automatically set, Default Gateway Default Gateway we wrote on the router's IP address 192.168.1.1, will be used later

Simulation Test

The lower right corner of the software RealTime mode Click to switch to Simulation emulation mode, click on the top of the Edit Filtersbutton to open the filter selection, the addition ARPand ICMPthe other are unchecked, the purpose is to allow us to more easily be able to see the ARP protocol. PC0 then open the page PC0 -> Desktop -> Command prompt, open a command line interface with Windows Dos exactly the same, and then try to enter ping 192.168.1.1and found two packets to be sent Even List appears on the right, respectively, ICMP and ARP packets package

Then click the right player is similar to fast-forward the "Next" button, you will find ARP packet is sent to the switch, and then click, switch packages were distributed to all devices under subnets, continue to move forward, after sending a packet to the router return package, it is answering 192.168.1.1device, while PC1 package will be discarded because the address of its IP address is not PC0 to be requested. Finally PC1 and then the ICMP packet sent to the router.


After we all pass the remaining packets, re-execute the process again, you will find an ARP packet PC1 no longer the same as before, but directly sends ICMP packets to the router, this is because: ARP ARP in. When ping the IP address (e.g., 192.168.1.1) on the local network, will be converted to the IP address 192.168.1.1 MAC address . Since the communication between the underlying computer actually communicates through a physical address. In addition, the system will retain a ARP cache table , which is stored in the IP address and MAC address information is associated. When you try to send packets to the IP address, the system will first consult this table to see if it already knows the MAC address. If the cache is a value not used ARP.


Therefore, when a ping, PC1 can not find the IP address in the ARP table, then sent to the network using the ARP protocol broadcast packets , asking "Who is 192.168.1.1". And when we first simulation, click ARP packets topology map appears, and then click Outbound PDU Details, you can see the data go ARP packets, which found DEST ADDRthat FFFF.FFFF.FFFFthis is because broadcast packets must be sent to a specific MAC address, which will address all the computers on the network can receive it, this is the addressFFFF.FFFF.FFFF ,The IP address of any computer that will be used to meet the requirements of ARP reply packets, packet reply with "I'm 192.168.1.1" information and its own MAC address information can be used to receive data packets , while he will also request Ip party address and the address stored in the ARP cache table mac


topology map data packet outgoing
Outgoing packet topology occurred

ARP packet header data
ARP packet header data

View and delete ARP cache table

After the completion of the first ping command, the PC1 command line, enter arp -a, you can view the ip address of the router corresponding mac addresses has been cached to the table, and then enter arp -dthis command will delete all the cache, and re-look, discovery cache table has been empty, this time to re-ping, you will find PC1 in turn re-broadcasting ARP packets.

Guess you like

Origin www.cnblogs.com/haluk/p/12090430.html