Observe the ARP protocol and ICMP protocol
ARP request (request) message: The host mac address of the requesting gateway Below is caught under Etherne 0/0/1 interface to PC packages
ps: When the very beginning of hosts will see your arp cache table does not send arp request Note here: the sender host sends ARP request packet which is all 0's mac
After receiving router then forwards broadcast here Note: The sender host sends an ARP request packet which is full of mac F
ARP reply (reply) message: The gateway will own mac address of the reply to the host Below is caught under Etherne 0/0/1 interface to PC packages
ICMP requests (request) message: host requests the mac address of the gateway is caught in FIG Etherne 0/0/1 PC Interface package
ICMP requests (request) message: host requests the mac address of the gateway is caught in FIG Etherne 0/0/1 PC Interface package
Obtained Summary:
1, if the source and destination ip ip host is not the same network segment, but there is no case where the gateway is configured, the host does not arp transmission request (transmission request does not go directly to the mac address of the object ip)
2, If the source ip and destination ip host a mac address of the same network segment, then the host directly request destination ip to
3, in the case if the host source ip and destination ip not the same network segment, configured gateway host sends arp request message, to ask for the mac address of the gateway
In this process, the communication 192.168.0.1 ------ 192.168.3.1
first acquired by the arp PC2 sends a request to the mac 192.168.0.2 (gateway mac)
and PC2 encapsulated ICMP request packet to send icmp AR1
PC2 ---- ---- AR1 source mac: mac object pc2 host mac: AR1 g0 / 0/1 mac port (gateway mac) source ip: 0.2 Objective itself ip: 3.1
AR1 object mac receive link layer is removed to see their to the destination ip: 192.168.3.1 192.168.1.2 is directly connected at one
AR1 request sent arp mac address of 192.168.1.2
AR1 -------- AR2 source mac: mac object mac AR1 g0 / 0/0 port : (AR1 is checked after the routing table, obtained after issuing arp) mac AR2 g0 / 0/0 0.2 Objective IP: 3.1
AR2 of -------- AR1
AR2 of mac receive the object is to remove their link-layer , the corresponding interface is object ip 3.1 Loopback ( not corresponding to the mac address 192.168.3.1 mac address in the table Huawei simulator, but eve Cisco devices 192.168.3.1 and 192.168.1.2 has mac are the same out: specialized about finishing the loopback)
AR1 -------- PC2
behind two mac table is checked between two broadcast domains and then repackaged deblocking procedure
ps: mac address action limited to only one broadcast domain
is formed mac address table: source mac address will arp packets and receive this packet to make the mapping interface to form mac entry into its mac address table
Front too much nonsense can be ignored
for reference only
1, PC2 transmits the acquisition request gateway arp mac (reques / reply) icmp package sent to AR1 (Reques)
2, AR2 of received Layer removed, ip not view the object of their own, the routing table, go-mesh found route segment, so arp request to send the next hop corresponding to the mac address ip (reques / reply) icmp package to AR2 of (Reques)
. 3, AR2 of received Layer removed, ip view the object itself is in a port loopback the ip, and a ping packet, ICMP then respond, and there is a corresponding entry mac, sent to AR1 (reply) after the package
4, AR1 received Layer removed to view the object ip not own, the routing table, found We have a route to the destination network segment, and a corresponding entry mac, directly to a good package PC2
OK end of
the following two procedures, you can simply look at the change mac address
1, PC2 ---------- AR1 figure is caught in the interface PC packet Etherne 0/0/1
2, the AR1 ---------- AR2 FIG AR1 is caught under the G 0/0/0 interface packet
AR1 routing table as well as its mac address table
AR2 routing table as well as its mac address table