If application data needs to be sent to IP address xx.xx.xx.xx, how does it work in underneath netwo

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了If application data needs to be sent to IP address xx.xx.xx.xx, how does it work in underneath netwo相关的知识,希望对你有一定的参考价值。

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.

 

  • MAC address will not be routed to router. It is only used for the communication inside the local physical network (LAN)
  • It is in layer 2 that MAC address starts playing the game.
  • IP addresses cover the whole internet and routers use them to figure out where to send the data

以上是关于If application data needs to be sent to IP address xx.xx.xx.xx, how does it work in underneath netwo的主要内容,如果未能解决你的问题,请参考以下文章

R 语言这个错误,如何解决?missing value where TRUE/FALSE needed

如何自动生成图片用于测试 pytorch(No image? No need image)

mysqld: Could not create or access the registry key needed for the MySQL application

[TypeScript@2.5] Omit catch error block if not needed

valueError: This solver needs samples of at least 2 classes in the data, but the data contains only

[Javascript] Avoid Creating floats if they are not needed