IP Addressing a process

 

Suppose A needs to send data to B then A must first encapsulating data to be transmitted: transporting layer plus the source / destination port network layer plus the source / destination IP address plus the data link layer source / destination MAC address

 

··· Packaging: top-down process has arisen of sending --- each layer is added to the application data on a specific head / tail (PDU - Protocol Data Unit)

 

Applications ··· -> data segments -> Packet -> data frame -> 'bit

 

··· decapsulating: bottom-receiver layer by layer process to remove the header and footer Amount

 

 

A data transfer between two hosts directly connected to the switcher through (two hosts in the same local area network)

 

1, A B starts only know the IP address of the mac address B does not know, and does not forward the data switcher and IP addresses

 

So then A will send an ARP broadcast: My IP is xxx, mac XXX is the IP-mac B want to know is how much of this broadcast will be received by all hosts in this local area network but only B accordingly and an ARP reply to A response

 

2, the switch receives the ARP broadcast and forwards it to all ports (port), and records the broadcast source MAC address (MAC address of A) to B receives a broadcast mac address list and find matching will want their IP A send an ARP response

 

3, the switch receives the response frame in response to the target B, and its own MAC address table mac comparison found corresponding port (network port is F0 / 1) to put forward the response frame F0 / 1 while the response frame source mac address B MAC address to the mac address list

 

4, A receives the reply frame B, B IP address that corresponds to the mac address will then save the information to a local ARP cache while B is the mac address of the destination address sent encapsulated in frames received data A again switches destination MAC address is found in B corresponding port (Ethernet port) F0 / 2 and then forwards the frame to F0 / 2

 

5, B receives the data sent by A

 

 

(----- replacement works: it maintains a MAC address table to reflect the correspondence between each port and MAC address, in order to make data transfer work

 

----- works routers: the router also maintains a table, called a routing table entries to reflect the IP address how to reach a network segment, but also in the router ARP cache, reflecting the router corresponding relationship between IP address and MAC address of each network segment directly)

Guess you like

Origin www.cnblogs.com/123zhangyue/p/11954963.html