标签:
This is to illustrate the communication between two separate machines which don‘t have a direct physical connection.
Application data is generated and passed to layer 3 (network layer) which wrapps up the data with the destination IP address. Then hands to layer 2 (link layer) which has a lookup table of IP addresses and their corresponding MAC addresses in the local network. Layer 2 looks at the IP address and try to resolve the IP address. If the IP address is in the table, it will wrap the layer 3 envelope in a layer 2 envelop with the MAC address in the header and then pass to physical layer to do the data communication.
Alternatively, if IP address is not in the lookup table, it will have the MAC address of default gateway (i.e. router) and forward data to the router The routers notices that the envelope has its own MAC address. It opens up the layer 2 envelope, look at the IP address and works out where to send the message, which probably forward to the ISP router. These steps repeat untill data is sent to the destination.
标签:
原文地址:http://www.cnblogs.com/touchdown/p/5188511.html