简体   繁体   English

如何跨 IP 地址共享数据

[英]How is data shared across ip address

I'm not sure I've phrased the question correctly but I'll explain a bit more.我不确定我是否正确地表达了这个问题,但我会再解释一下。

I have a server running on a virtual machine on PC1.我有一台在 PC1 上的虚拟机上运行的服务器。 I can access this through a particular IP address on the same computer.我可以通过同一台计算机上的特定 IP 地址访问它。 Now on a different PC2, when I try the same IP address I see the content served by PC1's server.现在在不同的 PC2 上,当我尝试使用相同的 IP 地址时,我看到了 PC1 的服务器提供的内容。 Both computers are on the same network.两台计算机都在同一个网络上。

I don't really understand how that IP address is serving the same info on PC2.我真的不明白该 IP 地址如何在 PC2 上提供相同的信息。 I'm not sure of the mechanics in the background either and it would really help if someone could explain what's happening here.我也不确定背景中的机制,如果有人可以解释这里发生的事情,那将真的很有帮助。

If you are using a wifi network then it is because of it you can access the content of the server you have created.如果您使用的是 wifi 网络,那么正是因为它,您可以访问您创建的服务器的内容。

You can see the architecture as that of the internet but on a small scale.您可以将架构视为互联网的架构,但规模较小。 Your IP addresses are stores in the wifi (routing tables) so that it can send packets accordingly (See hoping and packet transmission).您的 IP 地址存储在 wifi(路由表)中,以便它可以相应地发送数据包(请参阅希望和数据包传输)。 To be precise, each and every individual system maintains a routing table in it.准确地说,每个单独的系统都在其中维护一个路由表。 Thus, in order to fetch a particular site, a system sees its routing table.因此,为了获取特定站点,系统会查看其路由表。 If the particular IP address is present, the router returns it and the system shows that page.如果存在特定的 IP 地址,路由器将返回它并且系统显示该页面。 On the contrary, if the IP address is not present the router asks the nearby systems/servers for that particular IP address and the phenomenon continues till the IP address is found.相反,如果 IP 地址不存在,路由器会向附近的系统/服务器询问该特定 IP 地址,并且这种现象会一直持续到找到 IP 地址为止。

So, when you search for a local server via system B, whose data is in system A, then the router requests all its child systems to search for the particular IP address in their routing tables, and thus you can access the local server via systems connected on the same network.因此,当您通过系统 B 搜索本地服务器时,其数据在系统 A 中,然后路由器会请求其所有子系统在其路由表中搜索特定的 IP 地址,从而您可以通过系统访问本地服务器连接在同一个网络上。

To add furthermore, since the local servers are known to be locally operated, the router just sends the seek requests to its child systems only and not globally.此外,由于已知本地服务器是本地操作的,因此路由器仅将查找请求发送到其子系统,而不是全局发送。

I have tried to keep it as simple as possible supposing that you have not learned about computer networks yet.假设您还没有了解计算机网络,我试图使其尽可能简单。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM